treewide: remove with lib (#6735)

Continuation of `with lib;` cleanup.
This commit is contained in:
Austin Horstman 2025-03-31 22:32:16 -05:00 committed by GitHub
parent ccd7df836e
commit 0b491b460f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
200 changed files with 2421 additions and 2817 deletions

View file

@ -1,13 +1,11 @@
{ config, lib, pkgs, ... }:
with lib;
let
inherit (lib) concatStringsSep literalExpression mkIf mkOption types;
cfg = config.programs.ncmpcpp;
renderSettings = settings:
concatStringsSep "\n" (mapAttrsToList renderSetting settings);
concatStringsSep "\n" (lib.mapAttrsToList renderSetting settings);
renderSetting = name: value: "${name}=${renderValue value}";
@ -23,7 +21,7 @@ let
renderBinding = { key, command }:
concatStringsSep "\n " ([ ''def_key "${key}"'' ] ++ maybeWrapList command);
maybeWrapList = xs: if isList xs then xs else [ xs ];
maybeWrapList = xs: if lib.isList xs then xs else [ xs ];
valueType = with types; oneOf [ bool int str ];
@ -44,11 +42,11 @@ let
});
in {
meta.maintainers = [ hm.maintainers.olmokramer ];
meta.maintainers = [ lib.hm.maintainers.olmokramer ];
options.programs.ncmpcpp = {
enable =
mkEnableOption "ncmpcpp - an ncurses Music Player Daemon (MPD) client";
enable = lib.mkEnableOption
"ncmpcpp - an ncurses Music Player Daemon (MPD) client";
package = mkOption {
type = types.package;
@ -119,7 +117,7 @@ in {
xdg.configFile = {
"ncmpcpp/config" = let
settings = cfg.settings // optionalAttrs (cfg.mpdMusicDir != null) {
settings = cfg.settings // lib.optionalAttrs (cfg.mpdMusicDir != null) {
mpd_music_dir = cfg.mpdMusicDir;
};
in mkIf (settings != { }) { text = renderSettings settings + "\n"; };