treewide: mark unused lambda arguments

This commit is contained in:
Benedikt Rips
2025-10-26 22:24:33 +01:00
committed by Austin Horstman
parent 2de7205ce6
commit 71402c5df3
120 changed files with 176 additions and 174 deletions

View File

@@ -9,7 +9,7 @@ let
; ;
cfg = config.accounts.email; cfg = config.accounts.email;
enabledAccounts = lib.filterAttrs (n: v: v.enable) cfg.accounts; enabledAccounts = lib.filterAttrs (_n: v: v.enable) cfg.accounts;
gpgModule = types.submodule { gpgModule = types.submodule {
options = { options = {

View File

@@ -100,7 +100,7 @@ in
( (
let let
dups = lib.attrNames ( dups = lib.attrNames (
lib.filterAttrs (n: v: v > 1) ( lib.filterAttrs (_n: v: v > 1) (
lib.foldAttrs (acc: v: acc + v) 0 (map (v: { ${v.target} = 1; }) cfg) lib.foldAttrs (acc: v: acc + v) 0 (map (v: { ${v.target} = 1; }) cfg)
) )
); );

View File

@@ -69,9 +69,9 @@ let
toAgent = toAgent =
config: pkgs.writeText "${config.Label}.plist" (toPlist { escape = true; } (mutateConfig config)); config: pkgs.writeText "${config.Label}.plist" (toPlist { escape = true; } (mutateConfig config));
agentPlists = lib.mapAttrs' (n: v: lib.nameValuePair "${v.config.Label}.plist" (toAgent v.config)) ( agentPlists = lib.mapAttrs' (
lib.filterAttrs (n: v: v.enable) cfg.agents _n: v: lib.nameValuePair "${v.config.Label}.plist" (toAgent v.config)
); ) (lib.filterAttrs (_n: v: v.enable) cfg.agents);
agentsDrv = pkgs.runCommand "home-manager-agents" { } '' agentsDrv = pkgs.runCommand "home-manager-agents" { } ''
mkdir -p "$out" mkdir -p "$out"

View File

@@ -86,7 +86,7 @@ in
topoSort = topoSort =
dag: dag:
let let
dagBefore = dag: name: builtins.attrNames (filterAttrs (n: v: builtins.elem name v.before) dag); dagBefore = dag: name: builtins.attrNames (filterAttrs (_n: v: builtins.elem name v.before) dag);
normalizedDag = mapAttrs (n: v: { normalizedDag = mapAttrs (n: v: {
name = n; name = n;
inherit (v) data; inherit (v) data;

View File

@@ -34,7 +34,7 @@
importantFields = filterAttrs isImportantField attrs; importantFields = filterAttrs isImportantField attrs;
withoutImportantFields = fields: removeAttrs fields (attrNames importantFields); withoutImportantFields = fields: removeAttrs fields (attrNames importantFields);
allSections = filterAttrs (n: v: isAttrs v || isList v) attrs; allSections = filterAttrs (_n: v: isAttrs v || isList v) attrs;
sections = withoutImportantFields allSections; sections = withoutImportantFields allSections;
mkSection = mkSection =
@@ -57,7 +57,7 @@
inherit indent; inherit indent;
}; };
allFields = filterAttrs (n: v: !(isAttrs v || isList v)) attrs; allFields = filterAttrs (_n: v: !(isAttrs v || isList v)) attrs;
fields = withoutImportantFields allFields; fields = withoutImportantFields allFields;
in in
mkFields importantFields mkFields importantFields

View File

@@ -29,7 +29,7 @@ rec {
++ upperChars ++ upperChars
++ stringToCharacters "0123456789"; ++ stringToCharacters "0123456789";
empties = l: genList (x: "") (length l); empties = l: genList (_x: "") (length l);
unsafeInName = stringToCharacters (replaceStrings safeChars (empties safeChars) path); unsafeInName = stringToCharacters (replaceStrings safeChars (empties safeChars) path);

View File

@@ -337,7 +337,7 @@ in
}; };
xdg.configFile = lib.mapAttrs' ( xdg.configFile = lib.mapAttrs' (
name: config: _name: config:
lib.nameValuePair "fontconfig/conf.d/${toString config.priority}-hm-${config.label}.conf" { lib.nameValuePair "fontconfig/conf.d/${toString config.priority}-hm-${config.label}.conf" {
inherit (config) enable text; inherit (config) enable text;
source = lib.mkIf (config.source != null) config.source; source = lib.mkIf (config.source != null) config.source;

View File

@@ -53,7 +53,7 @@ let
); );
isNixFile = n: v: v == "regular" && lib.hasSuffix ".nix" n; isNixFile = n: v: v == "regular" && lib.hasSuffix ".nix" n;
isDirectory = n: v: v == "directory"; isDirectory = _n: v: v == "directory";
# Recursively collect all .nix files from a directory # Recursively collect all .nix files from a directory
collectNixFiles = collectNixFiles =

View File

@@ -269,7 +269,7 @@ in
path = config.flake.outPath; path = config.flake.outPath;
} }
// lib.filterAttrs ( // lib.filterAttrs (
n: v: n == "lastModified" || n == "rev" || n == "revCount" || n == "narHash" n: _v: n == "lastModified" || n == "rev" || n == "revCount" || n == "narHash"
) config.flake ) config.flake
); );
}; };
@@ -398,7 +398,7 @@ in
(mkIf (cfg.registry != { }) { (mkIf (cfg.registry != { }) {
xdg.configFile."nix/registry.json".source = jsonFormat.generate "registry.json" { xdg.configFile."nix/registry.json".source = jsonFormat.generate "registry.json" {
version = cfg.registryVersion; version = cfg.registryVersion;
flakes = mapAttrsToList (n: v: { inherit (v) from to exact; }) cfg.registry; flakes = mapAttrsToList (_n: v: { inherit (v) from to exact; }) cfg.registry;
}; };
}) })

View File

@@ -46,7 +46,7 @@ let
traceXIfNot = c: if c x then true else lib.traceSeqN 1 x false; traceXIfNot = c: if c x then true else lib.traceSeqN 1 x false;
in in
traceXIfNot isConfig; traceXIfNot isConfig;
merge = args: lib.foldr (def: mergeConfig def.value) { }; merge = _args: lib.foldr (def: mergeConfig def.value) { };
}; };
# Copied from nixpkgs.nix. # Copied from nixpkgs.nix.

View File

@@ -45,7 +45,7 @@ let
traceXIfNot = c: if c x then true else lib.traceSeqN 1 x false; traceXIfNot = c: if c x then true else lib.traceSeqN 1 x false;
in in
traceXIfNot isConfig; traceXIfNot isConfig;
merge = args: lib.foldr (def: mergeConfig def.value) { }; merge = _args: lib.foldr (def: mergeConfig def.value) { };
}; };
overlayType = lib.mkOptionType { overlayType = lib.mkOptionType {
@@ -55,7 +55,7 @@ let
merge = lib.mergeOneOption; merge = lib.mergeOneOption;
}; };
_pkgs = import pkgsPath (lib.filterAttrs (n: v: v != null) config.nixpkgs); _pkgs = import pkgsPath (lib.filterAttrs (_n: v: v != null) config.nixpkgs);
in in
{ {

View File

@@ -353,7 +353,7 @@ in
}; };
# Necessary because home.sessionVariables doesn't support mkIf # Necessary because home.sessionVariables doesn't support mkIf
envVars = lib.filterAttrs (n: v: v != null) { envVars = lib.filterAttrs (_n: v: v != null) {
QT_QPA_PLATFORMTHEME = QT_QPA_PLATFORMTHEME =
if (platformTheme.name != null) then if (platformTheme.name != null) then
styleNames.${platformTheme.name} or platformTheme.name styleNames.${platformTheme.name} or platformTheme.name

View File

@@ -149,7 +149,7 @@ in
xdg.configFile."mimeapps.list".source = xdg.configFile."mimeapps.list".source =
let let
joinValues = lib.mapAttrs (n: lib.concatStringsSep ";"); joinValues = lib.mapAttrs (_n: lib.concatStringsSep ";");
baseFile = (pkgs.formats.ini { }).generate "mimeapps.list" { baseFile = (pkgs.formats.ini { }).generate "mimeapps.list" {
"Added Associations" = joinValues cfg.associations.added; "Added Associations" = joinValues cfg.associations.added;

View File

@@ -169,7 +169,7 @@ in
config = config =
let let
directories = directories =
(lib.filterAttrs (n: v: !isNull v) { (lib.filterAttrs (_n: v: !isNull v) {
DESKTOP = cfg.desktop; DESKTOP = cfg.desktop;
DOCUMENTS = cfg.documents; DOCUMENTS = cfg.documents;
DOWNLOAD = cfg.download; DOWNLOAD = cfg.download;

View File

@@ -145,7 +145,7 @@ in
}; };
mkAccount = mkAccount =
name: account: _name: account:
let let
nullOrMap = f: v: if v == null then v else f v; nullOrMap = f: v: if v == null then v else f v;
@@ -168,7 +168,7 @@ in
"?" "?"
+ builtins.concatStringsSep "&" ( + builtins.concatStringsSep "&" (
lib.attrsets.mapAttrsToList (k: v: k + "=" + lib.strings.escapeURL v) ( lib.attrsets.mapAttrsToList (k: v: k + "=" + lib.strings.escapeURL v) (
lib.attrsets.filterAttrs (k: v: v != null) params lib.attrsets.filterAttrs (_k: v: v != null) params
) )
) )
else else
@@ -249,7 +249,7 @@ in
} }
// optPwCmd "outgoing" passwordCommand; // optPwCmd "outgoing" passwordCommand;
msmtp = cfg: { msmtp = _cfg: {
outgoing = "msmtpq --read-envelope-from --read-recipients"; outgoing = "msmtpq --read-envelope-from --read-recipients";
}; };

View File

@@ -99,7 +99,7 @@ in
xdg.configFile."alacritty/alacritty.toml" = lib.mkIf (cfg.settings != { }) { xdg.configFile."alacritty/alacritty.toml" = lib.mkIf (cfg.settings != { }) {
source = (tomlFormat.generate "alacritty.toml" cfg.settings).overrideAttrs ( source = (tomlFormat.generate "alacritty.toml" cfg.settings).overrideAttrs (
finalAttrs: prevAttrs: { _finalAttrs: prevAttrs: {
buildCommand = lib.concatStringsSep "\n" [ buildCommand = lib.concatStringsSep "\n" [
prevAttrs.buildCommand prevAttrs.buildCommand
# TODO: why is this needed? Is there a better way to retain escape sequences? # TODO: why is this needed? Is there a better way to retain escape sequences?

View File

@@ -138,7 +138,7 @@ let
submoduleToAttrs = m: lib.filterAttrs (name: v: name != "_module" && v != null) m; submoduleToAttrs = m: lib.filterAttrs (name: v: name != "_module" && v != null) m;
in in
lib.generators.toINI { mkSectionName = mk2ndLevelSectionName; } ( lib.generators.toINI { mkSectionName = mk2ndLevelSectionName; } (
lib.mapAttrs (name: submoduleToAttrs) cfg.tags lib.mapAttrs (_name: submoduleToAttrs) cfg.tags
) )
) )
+ '' + ''

View File

@@ -12,7 +12,7 @@ let
jsonFormat = pkgs.formats.json { }; jsonFormat = pkgs.formats.json { };
astroidAccounts = lib.filterAttrs ( astroidAccounts = lib.filterAttrs (
n: v: v.enable && v.astroid.enable _n: v: v.enable && v.astroid.enable
) config.accounts.email.accounts; ) config.accounts.email.accounts;
boolOpt = b: if b then "true" else "false"; boolOpt = b: if b then "true" else "false";
@@ -51,7 +51,7 @@ let
astroidConfig = lib.foldl' lib.recursiveUpdate template [ astroidConfig = lib.foldl' lib.recursiveUpdate template [
{ {
astroid.notmuch_config = "${config.xdg.configHome}/notmuch/default/config"; astroid.notmuch_config = "${config.xdg.configHome}/notmuch/default/config";
accounts = lib.mapAttrs (n: accountAttr) astroidAccounts; accounts = lib.mapAttrs (_n: accountAttr) astroidAccounts;
crypto.gpg.path = "${pkgs.gnupg}/bin/gpg"; crypto.gpg.path = "${pkgs.gnupg}/bin/gpg";
} }
cfg.extraConfig cfg.extraConfig

View File

@@ -232,7 +232,7 @@ let
} }
); );
removeNullValues = attrSet: lib.filterAttrs (key: value: value != null) attrSet; removeNullValues = attrSet: lib.filterAttrs (_key: value: value != null) attrSet;
hmFiles = builtins.attrValues config.home.file; hmFiles = builtins.attrValues config.home.file;
hmSymlinks = (lib.filter (file: !file.recursive) hmFiles); hmSymlinks = (lib.filter (file: !file.recursive) hmFiles);

View File

@@ -548,7 +548,7 @@ in
if isPathLikeContent content then { source = content; } else { text = content; } if isPathLikeContent content then { source = content; } else { text = content; }
); );
mkMarketplaceEntry = name: content: { mkMarketplaceEntry = _name: content: {
source = { source = {
source = "directory"; source = "directory";
path = content; path = content;

View File

@@ -106,7 +106,7 @@ in
}; };
} }
// lib.mapAttrs' ( // lib.mapAttrs' (
n: ctx: _n: ctx:
let let
path = "${cfg.configDir}/contexts/meta/${builtins.hashString "sha256" ctx.Name}/meta.json"; path = "${cfg.configDir}/contexts/meta/${builtins.hashString "sha256" ctx.Name}/meta.json";
in in

View File

@@ -112,7 +112,7 @@ in
in in
defaultConfig defaultConfig
// (lib.mapAttrs' ( // (lib.mapAttrs' (
name: value: name: _value:
lib.nameValuePair "${prefix}/Element-${name}/config.json" { lib.nameValuePair "${prefix}/Element-${name}/config.json" {
source = (formatter.generate "element-desktop-${name}" cfg.profiles."${name}"); source = (formatter.generate "element-desktop-${name}" cfg.profiles."${name}");
} }

View File

@@ -69,7 +69,7 @@ in
}; };
extraPackages = mkOption { extraPackages = mkOption {
default = self: [ ]; default = _self: [ ];
type = lib.hm.types.selectorFunction; type = lib.hm.types.selectorFunction;
defaultText = "epkgs: []"; defaultText = "epkgs: []";
example = literalExpression "epkgs: [ epkgs.emms epkgs.magit ]"; example = literalExpression "epkgs: [ epkgs.emms epkgs.magit ]";
@@ -81,7 +81,7 @@ in
}; };
overrides = mkOption { overrides = mkOption {
default = self: super: { }; default = _self: _super: { };
type = lib.hm.types.overlayFunction; type = lib.hm.types.overlayFunction;
defaultText = "self: super: {}"; defaultText = "self: super: {}";
example = literalExpression '' example = literalExpression ''

View File

@@ -26,8 +26,8 @@ let
renderBindings = renderBindings =
bindings: bindings:
let let
enabled = filterAttrs (n: v: v != null) bindings; enabled = filterAttrs (_n: v: v != null) bindings;
disabled = filterAttrs (n: v: v == null) bindings; disabled = filterAttrs (_n: v: v == null) bindings;
render = mapAttrsToList renderBinding; render = mapAttrsToList renderBinding;
in in
lib.concatStringsSep "\n" (render disabled ++ render enabled); lib.concatStringsSep "\n" (render disabled ++ render enabled);
@@ -139,7 +139,7 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
assertions = [ assertions = [
{ {
assertion = ((filterAttrs (n: v: v == "") cfg.keybindings) == { }); assertion = ((filterAttrs (_n: v: v == "") cfg.keybindings) == { });
message = "To disable a keybinding, use `null` instead of an empty string."; message = "To disable a keybinding, use `null` instead of an empty string.";
} }
]; ];

View File

@@ -49,7 +49,7 @@ let
} }
// (removeAttrs input [ "icon" ]) // (removeAttrs input [ "icon" ])
// optionalAttrs (input ? icon || input ? iconMapObj) { // optionalAttrs (input ? icon || input ? iconMapObj) {
iconMapObj = mapAttrs (name: iconUrl) ( iconMapObj = mapAttrs (_name: iconUrl) (
(optionalAttrs (input ? icon) { (optionalAttrs (input ? icon) {
# Convenience to specify single icon instead of map # Convenience to specify single icon instead of map
"16" = input.icon; "16" = input.icon;

View File

@@ -420,9 +420,9 @@ let
"onSignal" "onSignal"
"onEvent" "onEvent"
]; ];
isHandler = name: def: isAttrs def && builtins.any (attr: builtins.hasAttr attr def) handlerAttrs; isHandler = _name: def: isAttrs def && builtins.any (attr: builtins.hasAttr attr def) handlerAttrs;
handlerFunctions = lib.filterAttrs isHandler cfg.functions; handlerFunctions = lib.filterAttrs isHandler cfg.functions;
sourceFunction = name: def: "source ${config.xdg.configHome}/fish/functions/${name}.fish"; sourceFunction = name: _def: "source ${config.xdg.configHome}/fish/functions/${name}.fish";
in in
builtins.concatStringsSep "\n" (lib.mapAttrsToList sourceFunction handlerFunctions); builtins.concatStringsSep "\n" (lib.mapAttrsToList sourceFunction handlerFunctions);

View File

@@ -193,8 +193,8 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = [ cfg.package ]; home.packages = [ cfg.package ];
home.sessionVariables = lib.mapAttrs (n: toString) ( home.sessionVariables = lib.mapAttrs (_n: toString) (
lib.filterAttrs (n: v: v != [ ] && v != null) { lib.filterAttrs (_n: v: v != [ ] && v != null) {
FZF_ALT_C_COMMAND = cfg.changeDirWidgetCommand; FZF_ALT_C_COMMAND = cfg.changeDirWidgetCommand;
FZF_ALT_C_OPTS = cfg.changeDirWidgetOptions; FZF_ALT_C_OPTS = cfg.changeDirWidgetOptions;
FZF_CTRL_R_OPTS = cfg.historyWidgetOptions; FZF_CTRL_R_OPTS = cfg.historyWidgetOptions;

View File

@@ -394,7 +394,7 @@ in
}; };
"${dconfPath}/profiles:" = { "${dconfPath}/profiles:" = {
default = lib.head (lib.attrNames (lib.filterAttrs (n: v: v.default) cfg.profile)); default = lib.head (lib.attrNames (lib.filterAttrs (_n: v: v.default) cfg.profile));
list = lib.attrNames cfg.profile; list = lib.attrNames cfg.profile;
}; };
} }

View File

@@ -14,7 +14,7 @@ let
cfg = config.programs.i3status; cfg = config.programs.i3status;
enabledModules = lib.filterAttrs (n: v: v.enable) cfg.modules; enabledModules = lib.filterAttrs (_n: v: v.enable) cfg.modules;
formatOrder = n: ''order += "${n}"''; formatOrder = n: ''order += "${n}"'';
@@ -231,7 +231,7 @@ in
xdg.configFile."i3status/config".text = lib.concatStringsSep "\n" ( xdg.configFile."i3status/config".text = lib.concatStringsSep "\n" (
lib.optional (cfg.general != { }) (formatModule "general" cfg.general) lib.optional (cfg.general != { }) (formatModule "general" cfg.general)
++ map formatOrder (sortAttrNamesByPosition lib.lessThan enabledModules) ++ map formatOrder (sortAttrNamesByPosition lib.lessThan enabledModules)
++ lib.mapAttrsToList formatModule (lib.mapAttrs (n: v: v.settings) enabledModules) ++ lib.mapAttrsToList formatModule (lib.mapAttrs (_n: v: v.settings) enabledModules)
); );
}; };
} }

View File

@@ -98,7 +98,7 @@ in
activateJoplinDesktopConfig = activateJoplinDesktopConfig =
let let
newConfig = jsonFormat.generate "joplin-settings.json" ( newConfig = jsonFormat.generate "joplin-settings.json" (
lib.attrsets.filterAttrs (n: v: (v != null) && (v != "")) ( lib.attrsets.filterAttrs (_n: v: (v != null) && (v != "")) (
{ {
# TODO: find a better way to convert nix attribute names to strings: # TODO: find a better way to convert nix attribute names to strings:
# sync.interval = ... -> "sync.interval" = ... # sync.interval = ... -> "sync.interval" = ...

View File

@@ -190,7 +190,7 @@ in
lutris-overrides = { lutris-overrides = {
# This only adds pkgs.steam to the extraPkgs, I see no reason to ever enable it. # This only adds pkgs.steam to the extraPkgs, I see no reason to ever enable it.
steamSupport = false; steamSupport = false;
extraPkgs = (prev: cfg.extraPackages ++ optional (cfg.steamPackage != null) cfg.steamPackage); extraPkgs = (_prev: cfg.extraPackages ++ optional (cfg.steamPackage != null) cfg.steamPackage);
}; };
in in
[ (cfg.package.override lutris-overrides) ]; [ (cfg.package.override lutris-overrides) ];
@@ -200,7 +200,7 @@ in
buildRunnerConfig = ( buildRunnerConfig = (
runner_name: runner_config: runner_name: runner_config:
# Remove the unset values so they don't end up on the final config. # Remove the unset values so they don't end up on the final config.
filterAttrsRecursive (name: value: value != { } && value != null && value != "") { filterAttrsRecursive (_name: value: value != { } && value != null && value != "") {
"${runner_name}" = "${runner_name}" =
runner_config.settings.runner runner_config.settings.runner
# If set translate .package to runner_executable # If set translate .package to runner_executable

View File

@@ -27,20 +27,20 @@ let
# Given a SINGLE group's channels attribute set, return true if ANY of the channel's # Given a SINGLE group's channels attribute set, return true if ANY of the channel's
# patterns use the invalidOption attribute set value name. # patterns use the invalidOption attribute set value name.
channelInvalidOption = channelInvalidOption =
channels: invalidOption: any (c: c) (mapAttrsToList (c: lib.hasAttr invalidOption) channels); channels: invalidOption: any (c: c) (mapAttrsToList (_c: lib.hasAttr invalidOption) channels);
# Given a SINGLE account's groups attribute set, return true if ANY of the account's group's channel's patterns use the invalidOption attribute set value name. # Given a SINGLE account's groups attribute set, return true if ANY of the account's group's channel's patterns use the invalidOption attribute set value name.
groupInvalidOption = groupInvalidOption =
groups: invalidOption: groups: invalidOption:
any (g: g) ( any (g: g) (
mapAttrsToList (groupName: groupVals: channelInvalidOption groupVals.channels invalidOption) groups mapAttrsToList (_groupName: groupVals: channelInvalidOption groupVals.channels invalidOption) groups
); );
# Given all accounts (ensure that accounts passed in here ARE mbsync-using accounts) # Given all accounts (ensure that accounts passed in here ARE mbsync-using accounts)
# return true if ANY of the account's groups' channels' patterns use the # return true if ANY of the account's groups' channels' patterns use the
# invalidOption attribute set value name. # invalidOption attribute set value name.
accountInvalidOption = accountInvalidOption =
accounts: invalidOption: _accounts: invalidOption:
any (a: a) (map (account: groupInvalidOption account.mbsync.groups invalidOption) mbsyncAccounts); any (a: a) (map (account: groupInvalidOption account.mbsync.groups invalidOption) mbsyncAccounts);
genTlsConfig = genTlsConfig =
@@ -203,14 +203,14 @@ let
genChannelStrings = genChannelStrings =
groupName: channels: groupName: channels:
lib.optionals (channels != { }) ( lib.optionals (channels != { }) (
mapAttrsToList (channelName: info: genChannelString groupName info) channels mapAttrsToList (_channelName: info: genChannelString groupName info) channels
); );
# Given a group, return a string that configures all the channels within # Given a group, return a string that configures all the channels within
# the group. # the group.
genGroupsChannels = group: concatStringsSep "\n" (genChannelStrings group.name group.channels); genGroupsChannels = group: concatStringsSep "\n" (genChannelStrings group.name group.channels);
# Generate all channel configurations for all groups for this account. # Generate all channel configurations for all groups for this account.
in in
concatStringsSep "\n" (lib.remove "" (mapAttrsToList (name: genGroupsChannels) groups)); concatStringsSep "\n" (lib.remove "" (mapAttrsToList (_name: genGroupsChannels) groups));
# Given the attr set of groups, return a string which maps channels to groups # Given the attr set of groups, return a string which maps channels to groups
genAccountGroups = genAccountGroups =
@@ -219,7 +219,7 @@ let
# Given the name of the group and the attribute set of channels, make # Given the name of the group and the attribute set of channels, make
# make "Channel <grpName>-<chnName>" for each channel to list os strings # make "Channel <grpName>-<chnName>" for each channel to list os strings
genChannelStrings = genChannelStrings =
groupName: channels: mapAttrsToList (name: info: "Channel ${groupName}-${name}") channels; groupName: channels: mapAttrsToList (name: _info: "Channel ${groupName}-${name}") channels;
# Take in 1 group, if the group has channels specified, construct the # Take in 1 group, if the group has channels specified, construct the
# "Group <grpName>" header and each of the channels. # "Group <grpName>" header and each of the channels.
genGroupChannelString = genGroupChannelString =
@@ -232,7 +232,7 @@ let
# Given set of groups, generates list of strings, where each string is one # Given set of groups, generates list of strings, where each string is one
# of the groups and its constituent channels. # of the groups and its constituent channels.
genGroupsStrings = mapAttrsToList ( genGroupsStrings = mapAttrsToList (
name: info: concatStringsSep "\n" (genGroupChannelString groups.${name}) name: _info: concatStringsSep "\n" (genGroupChannelString groups.${name})
) groups; ) groups;
# Join all non-empty groups. # Join all non-empty groups.
combined = concatStringsSep "\n\n" (lib.remove "" genGroupsStrings) + "\n"; combined = concatStringsSep "\n\n" (lib.remove "" genGroupsStrings) + "\n";

View File

@@ -18,13 +18,13 @@ let
tomlFormat = pkgs.formats.toml { }; tomlFormat = pkgs.formats.toml { };
enabledAccounts = lib.attrsets.filterAttrs ( enabledAccounts = lib.attrsets.filterAttrs (
name: value: value.enable && (value.meli.enable or false) _name: value: value.enable && (value.meli.enable or false)
) config.accounts.email.accounts; ) config.accounts.email.accounts;
meliAccounts = (lib.attrsets.mapAttrs (name: value: (mkMeliAccounts name value)) enabledAccounts); meliAccounts = (lib.attrsets.mapAttrs (name: value: (mkMeliAccounts name value)) enabledAccounts);
mkMeliAccounts = ( mkMeliAccounts = (
name: account: _name: account:
{ {
root_mailbox = "${config.accounts.email.maildirBasePath}/${account.maildir.path}"; root_mailbox = "${config.accounts.email.maildirBasePath}/${account.maildir.path}";
format = "Maildir"; format = "Maildir";

View File

@@ -23,7 +23,7 @@ let
settingsFormat = pkgs.formats.toml { }; settingsFormat = pkgs.formats.toml { };
filterNull = attrs: lib.attrsets.filterAttrs (n: v: v != null) attrs; filterNull = attrs: lib.attrsets.filterAttrs (_n: v: v != null) attrs;
configFile = configFile =
account: account:

View File

@@ -21,7 +21,7 @@ let
cfg = config.programs.neomutt; cfg = config.programs.neomutt;
neomuttAccountsCfg = filterAttrs ( neomuttAccountsCfg = filterAttrs (
n: a: a.enable && a.neomutt.enable _n: a: a.enable && a.neomutt.enable
) config.accounts.email.accounts; ) config.accounts.email.accounts;
neomuttAccounts = attrValues neomuttAccountsCfg; neomuttAccounts = attrValues neomuttAccountsCfg;

View File

@@ -481,7 +481,7 @@ in
suppressIncompatibleConfig = suppressIncompatibleConfig =
p: p:
lib.filterAttrs ( lib.filterAttrs (
n: v: n: _v:
builtins.elem n [ builtins.elem n [
"plugin" "plugin"
"optional" "optional"

View File

@@ -13,7 +13,7 @@ let
lib.mapAttrsToList (n: v: if v.isDefault then n else null) cfg.libraries lib.mapAttrsToList (n: v: if v.isDefault then n else null) cfg.libraries
); );
settingsIni = (lib.mapAttrs (n: v: v.settings) cfg.libraries) // { settingsIni = (lib.mapAttrs (_n: v: v.settings) cfg.libraries) // {
settings = settings =
cfg.settings cfg.settings
// lib.optionalAttrs (cfg.libraries != { }) { // lib.optionalAttrs (cfg.libraries != { }) {

View File

@@ -113,7 +113,7 @@
accountSettings = calendarConfig ++ contactConfig; accountSettings = calendarConfig ++ contactConfig;
localStorageDir = name: acc: lib.attrsets.getAttrFromPath [ "local" "path" ] acc; localStorageDir = _name: acc: lib.attrsets.getAttrFromPath [ "local" "path" ] acc;
calendarLocalStorageDirs = lib.mapAttrsToList localStorageDir calendarAccounts; calendarLocalStorageDirs = lib.mapAttrsToList localStorageDir calendarAccounts;
contactLocalStorageDirs = lib.mapAttrsToList localStorageDir contactAccounts; contactLocalStorageDirs = lib.mapAttrsToList localStorageDir contactAccounts;

View File

@@ -104,7 +104,7 @@ in
radio-active = radio-active =
if player == "mpv" then if player == "mpv" then
pkgs.radio-active.overrideAttrs ( pkgs.radio-active.overrideAttrs (
finalAttrs: previousAttrs: { _finalAttrs: previousAttrs: {
postPatch = '' postPatch = ''
${previousAttrs.postPatch} ${previousAttrs.postPatch}
@@ -116,7 +116,7 @@ in
) )
else if player == "vlc" then else if player == "vlc" then
pkgs.radio-active.overrideAttrs ( pkgs.radio-active.overrideAttrs (
finalAttrs: previousAttrs: { _finalAttrs: previousAttrs: {
postPatch = '' postPatch = ''
${previousAttrs.postPatch} ${previousAttrs.postPatch}

View File

@@ -94,7 +94,7 @@ in
file."${configPath}" = lib.mkIf (cfg.custom_adapters != [ ]) { file."${configPath}" = lib.mkIf (cfg.custom_adapters != [ ]) {
source = (pkgs.formats.json { }).generate "ripgrep-all" { source = (pkgs.formats.json { }).generate "ripgrep-all" {
"$schema" = "./config.schema.json"; "$schema" = "./config.schema.json";
custom_adapters = map (lib.filterAttrs (n: v: v != null)) cfg.custom_adapters; custom_adapters = map (lib.filterAttrs (_n: v: v != null)) cfg.custom_adapters;
}; };
}; };
}; };

View File

@@ -43,7 +43,7 @@ let
${concatStrings (lib.mapAttrsToList (name: value: "${name}: ${value}") value)} ${concatStrings (lib.mapAttrsToList (name: value: "${name}: ${value}") value)}
''; '';
renderRepositories = repos: '' renderRepositories = _repos: ''
[repositories] [repositories]
${concatStrings (map renderRepository cfg.repositories)}''; ${concatStrings (map renderRepository cfg.repositories)}'';

View File

@@ -98,8 +98,8 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = [ cfg.package ]; home.packages = [ cfg.package ];
home.sessionVariables = lib.mapAttrs (n: toString) ( home.sessionVariables = lib.mapAttrs (_n: toString) (
lib.filterAttrs (n: v: v != [ ] && v != null) { lib.filterAttrs (_n: v: v != [ ] && v != null) {
SKIM_ALT_C_COMMAND = cfg.changeDirWidgetCommand; SKIM_ALT_C_COMMAND = cfg.changeDirWidgetCommand;
SKIM_ALT_C_OPTS = cfg.changeDirWidgetOptions; SKIM_ALT_C_OPTS = cfg.changeDirWidgetOptions;
SKIM_CTRL_R_OPTS = cfg.historyWidgetOptions; SKIM_CTRL_R_OPTS = cfg.historyWidgetOptions;

View File

@@ -156,7 +156,7 @@ in
config = config =
let let
cleanedProjects = lib.filterAttrsRecursive (name: value: value != null) cfg.projects; cleanedProjects = lib.filterAttrsRecursive (_name: value: value != null) cfg.projects;
mkProjects = lib.attrsets.mapAttrs' ( mkProjects = lib.attrsets.mapAttrs' (
k: v: { k: v: {
@@ -171,7 +171,7 @@ in
// { // {
inherit (v) session; inherit (v) session;
windows = lib.lists.forEach v.windows ( windows = lib.lists.forEach v.windows (
winprop: (lib.filterAttrsRecursive (name: value: value != null) winprop) winprop: (lib.filterAttrsRecursive (_name: value: value != null) winprop)
); );
}; };
in in

View File

@@ -635,10 +635,10 @@ in
warnings = warnings =
mapAttrsToList mapAttrsToList
(n: v: '' (n: _v: ''
The SSH config match block `programs.ssh.matchBlocks.${n}` sets both of the host and match options. The SSH config match block `programs.ssh.matchBlocks.${n}` sets both of the host and match options.
The match option takes precedence.'') The match option takes precedence.'')
(lib.filterAttrs (n: v: v.data.host != null && v.data.match != null) cfg.matchBlocks); (lib.filterAttrs (_n: v: v.data.host != null && v.data.match != null) cfg.matchBlocks);
} }
(lib.mkIf cfg.enableDefaultConfig { (lib.mkIf cfg.enableDefaultConfig {
warnings = [ warnings = [

View File

@@ -251,7 +251,7 @@ let
let let
inherit (contact) id; inherit (contact) id;
in in
lib.filterAttrs (n: v: v != null) ( lib.filterAttrs (_n: v: v != null) (
{ {
"ldap_2.servers.contact_${id}.description" = contact.name; "ldap_2.servers.contact_${id}.description" = contact.name;
"ldap_2.servers.contact_${id}.filename" = "contact_${id}.sqlite"; # this is needed for carddav to work "ldap_2.servers.contact_${id}.filename" = "contact_${id}.sqlite"; # this is needed for carddav to work
@@ -970,7 +970,7 @@ in
# Append the default local folder name "account1". # Append the default local folder name "account1".
# See https://github.com/nix-community/home-manager/issues/5031. # See https://github.com/nix-community/home-manager/issues/5031.
enabledAccountsIds = (lib.attrsets.mapAttrsToList (name: value: value) accountNameToId) ++ [ enabledAccountsIds = (lib.attrsets.mapAttrsToList (_name: value: value) accountNameToId) ++ [
"account1" "account1"
]; ];
in in
@@ -989,7 +989,7 @@ in
accountsOrderIds = map (a: accountNameToId."${a}" or a) profile.calendarAccountsOrder; accountsOrderIds = map (a: accountNameToId."${a}" or a) profile.calendarAccountsOrder;
enabledAccountsIds = (lib.attrsets.mapAttrsToList (name: value: value) accountNameToId); enabledAccountsIds = (lib.attrsets.mapAttrsToList (_name: value: value) accountNameToId);
in in
lib.optionals (calendarAccounts != [ ]) ( lib.optionals (calendarAccounts != [ ]) (
accountsOrderIds ++ (lib.lists.subtractLists accountsOrderIds enabledAccountsIds) accountsOrderIds ++ (lib.lists.subtractLists accountsOrderIds enabledAccountsIds)
@@ -1045,7 +1045,7 @@ in
} }
) )
++ (mapAttrsToList ( ++ (mapAttrsToList (
name: profile: name: _profile:
let let
emailAccountsWithFilters = ( emailAccountsWithFilters = (
filter (a: a.thunderbird.messageFilters != [ ]) ( filter (a: a.thunderbird.messageFilters != [ ]) (

View File

@@ -300,7 +300,7 @@ in
in in
mapAttrsToList mapAttrsToList
( (
a: v': a: _v':
[ [
{ {
assertion = (lib.elem a allowed); assertion = (lib.elem a allowed);
@@ -327,7 +327,7 @@ in
++ map ( ++ map (
attrs: attrs:
let let
defined = lib.attrNames (filterAttrs (n: v: v != null) (lib.genAttrs attrs (a: v.${a} or null))); defined = lib.attrNames (filterAttrs (_n: v: v != null) (lib.genAttrs attrs (a: v.${a} or null)));
in in
{ {
assertion = lib.length defined <= 1; assertion = lib.length defined <= 1;

View File

@@ -57,7 +57,7 @@ let
options = options =
let let
opt = opt =
name: type: _name: type:
mkOption { mkOption {
type = types.nullOr type; type = types.nullOr type;
default = null; default = null;

View File

@@ -129,7 +129,7 @@ let
name: server: name: server:
let let
# Remove the disabled field from the server config # Remove the disabled field from the server config
cleanServer = lib.filterAttrs (n: v: n != "disabled") server; cleanServer = lib.filterAttrs (n: _v: n != "disabled") server;
in in
{ {
inherit name; inherit name;
@@ -478,7 +478,7 @@ in
(mkIf (mkIf
( (
(lib.filterAttrs ( (lib.filterAttrs (
n: v: _n: v:
(v ? enableExtensionUpdateCheck || v ? enableUpdateCheck) (v ? enableExtensionUpdateCheck || v ? enableUpdateCheck)
&& (v.enableExtensionUpdateCheck != null || v.enableUpdateCheck != null) && (v.enableExtensionUpdateCheck != null || v.enableUpdateCheck != null)
) allProfilesExceptDefault) != { } ) allProfilesExceptDefault) != { }
@@ -501,7 +501,7 @@ in
PATH=${lib.makeBinPath [ pkgs.jq ]}''${PATH:+:}$PATH PATH=${lib.makeBinPath [ pkgs.jq ]}''${PATH:+:}$PATH
file="${userDir}/globalStorage/storage.json" file="${userDir}/globalStorage/storage.json"
file_write="" file_write=""
profiles=(${lib.escapeShellArgs (flatten (mapAttrsToList (n: v: n) allProfilesExceptDefault))}) profiles=(${lib.escapeShellArgs (flatten (mapAttrsToList (n: _v: n) allProfilesExceptDefault))})
if [ -f "$file" ]; then if [ -f "$file" ]; then
existing_profiles=$(jq '.userDataProfiles // [] | map({ (.name): .location }) | add // {}' "$file") existing_profiles=$(jq '.userDataProfiles // [] | map({ (.name): .location }) | add // {}' "$file")
@@ -635,7 +635,7 @@ in
# causes VSCode to create the extensions.json with all the extensions # causes VSCode to create the extensions.json with all the extensions
# in the extension directory, which includes extensions from other profiles. # in the extension directory, which includes extensions from other profiles.
lib.mkMerge ( lib.mkMerge (
lib.concatMap toPaths (flatten (mapAttrsToList (n: v: v.extensions) cfg.profiles)) lib.concatMap toPaths (flatten (mapAttrsToList (_n: v: v.extensions) cfg.profiles))
++ ++
lib.optional lib.optional
( (
@@ -669,7 +669,7 @@ in
combinedExtensionsDrv = pkgs.buildEnv { combinedExtensionsDrv = pkgs.buildEnv {
name = "vscode-extensions"; name = "vscode-extensions";
paths = paths =
(flatten (mapAttrsToList (n: v: v.extensions) cfg.profiles)) (flatten (mapAttrsToList (_n: v: v.extensions) cfg.profiles))
++ lib.optional ( ++ lib.optional (
( (
lib.versionAtLeast vscodeVersion "1.74.0" lib.versionAtLeast vscodeVersion "1.74.0"

View File

@@ -350,7 +350,7 @@ in
mkIf cfg.enable { mkIf cfg.enable {
assertions = [ assertions = [
{ {
assertion = (lib.filterAttrs (k: v: !isNull v.text && !isNull v.source) cfg.cgiBin) == { }; assertion = (lib.filterAttrs (_k: v: !isNull v.text && !isNull v.source) cfg.cgiBin) == { };
message = "Cannot specify both `.text` and `.source` options for `programs.w3m.cgiBin` scripts."; message = "Cannot specify both `.text` and `.source` options for `programs.w3m.cgiBin` scripts.";
} }
]; ];

View File

@@ -24,7 +24,7 @@ let
jsonFormat = pkgs.formats.json { }; jsonFormat = pkgs.formats.json { };
mkMargin = mkMargin =
name: _name:
mkOption { mkOption {
type = types.nullOr types.int; type = types.nullOr types.int;
default = null; default = null;

View File

@@ -14,7 +14,7 @@ let
'' ''
# Generated by Home Manager. # Generated by Home Manager.
'' ''
+ lib.generators.toKeyValue { } (lib.filterAttrs (name: value: value != null) attrs); + lib.generators.toKeyValue { } (lib.filterAttrs (_name: value: value != null) attrs);
in in
{ {
meta.maintainers = [ lib.maintainers.christoph-heiss ]; meta.maintainers = [ lib.maintainers.christoph-heiss ];

View File

@@ -12,7 +12,7 @@ let
cfg = config.services.activitywatch; cfg = config.services.activitywatch;
mkWatcherService = mkWatcherService =
name: cfg: _name: cfg:
let let
jobName = "activitywatch-watcher-${cfg.name}"; jobName = "activitywatch-watcher-${cfg.name}";
in in
@@ -122,7 +122,7 @@ let
}; };
generateWatchersConfig = generateWatchersConfig =
name: cfg: _name: cfg:
let let
# We're only assuming the generated filepath this since most watchers # We're only assuming the generated filepath this since most watchers
# uses the ActivityWatch client library which has `load_config_toml` # uses the ActivityWatch client library which has `load_config_toml`

View File

@@ -245,7 +245,7 @@ in
"${cfg.colimaHomeDir}/${profileName}/colima.yaml" = { "${cfg.colimaHomeDir}/${profileName}/colima.yaml" = {
source = yamlFormat.generate "colima.yaml" profile.settings; source = yamlFormat.generate "colima.yaml" profile.settings;
}; };
}) (lib.filterAttrs (name: profile: profile.settings != { }) cfg.profiles) }) (lib.filterAttrs (_name: profile: profile.settings != { }) cfg.profiles)
); );
sessionVariables = { sessionVariables = {

View File

@@ -106,7 +106,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
launchd.agents = services ( launchd.agents = services (
name: repo: { _name: repo: {
enable = true; enable = true;
config = { config = {
StartInterval = repo.interval; StartInterval = repo.interval;

View File

@@ -137,7 +137,7 @@ let
mapToInt = mapToInt =
keyPage: attrs: keyPage: attrs:
lib.mapAttrs ( lib.mapAttrs (
name: value: _name: value:
let let
keycode = lib.fromHexString (lib.removePrefix "0x" value); keycode = lib.fromHexString (lib.removePrefix "0x" value);
in in

View File

@@ -19,8 +19,8 @@ let
let let
formatValue = v: if builtins.isBool v then if v then "true" else "false" else toString v; formatValue = v: if builtins.isBool v then if v then "true" else "false" else toString v;
globalSettings = lib.filterAttrs (n: v: !(lib.isAttrs v)) config; globalSettings = lib.filterAttrs (_n: v: !(lib.isAttrs v)) config;
sectionSettings = lib.filterAttrs (n: v: lib.isAttrs v) config; sectionSettings = lib.filterAttrs (_n: v: lib.isAttrs v) config;
globalLines = lib.concatStringsSep "\n" ( globalLines = lib.concatStringsSep "\n" (
lib.mapAttrsToList (k: v: "${k}=${formatValue v}") globalSettings lib.mapAttrsToList (k: v: "${k}=${formatValue v}") globalSettings

View File

@@ -41,7 +41,7 @@ let
description = "pair of ${x.description}"; description = "pair of ${x.description}";
}; };
mkDefaultAttrs = mapAttrs (n: mkDefault); mkDefaultAttrs = mapAttrs (_n: mkDefault);
# Basically a tinkered lib.generators.mkKeyValueDefault # Basically a tinkered lib.generators.mkKeyValueDefault
# It either serializes a top-level definition "key: { values };" # It either serializes a top-level definition "key: { values };"

View File

@@ -107,7 +107,7 @@ in
else else
"${pkgs.skopeo.policy}/default-policy.json"; "${pkgs.skopeo.policy}/default-policy.json";
"containers/registries.conf".source = toml.generate "registries.conf" { "containers/registries.conf".source = toml.generate "registries.conf" {
registries = lib.mapAttrs (n: v: { registries = v; }) cfg.settings.registries; registries = lib.mapAttrs (_n: v: { registries = v; }) cfg.settings.registries;
}; };
"containers/storage.conf".source = toml.generate "storage.conf" cfg.settings.storage; "containers/storage.conf".source = toml.generate "storage.conf" cfg.settings.storage;
"containers/containers.conf".source = toml.generate "containers.conf" cfg.settings.containers; "containers/containers.conf".source = toml.generate "containers.conf" cfg.settings.containers;

View File

@@ -69,7 +69,7 @@ let
let let
quadletName = extractQuadletReference type value; quadletName = extractQuadletReference type value;
quadletsOfType = lib.filterAttrs ( quadletsOfType = lib.filterAttrs (
n: v: v.quadletData.resourceType == type _n: v: v.quadletData.resourceType == type
) cfg.internal.builtQuadlets; ) cfg.internal.builtQuadlets;
in in
if (lib.hasAttr quadletName quadletsOfType) then if (lib.hasAttr quadletName quadletsOfType) then

View File

@@ -64,8 +64,8 @@ let
# There's a possibility of attributes with attrsets overriding other # There's a possibility of attributes with attrsets overriding other
# top-level attributes with non-attrsets so we're forcing the attrsets to # top-level attributes with non-attrsets so we're forcing the attrsets to
# come last. # come last.
_config = lib.mapAttrsToList convert (lib.filterAttrs (k: v: !isAttrs v) attr); _config = lib.mapAttrsToList convert (lib.filterAttrs (_k: v: !isAttrs v) attr);
_config' = lib.mapAttrsToList convert (lib.filterAttrs (k: isAttrs) attr); _config' = lib.mapAttrsToList convert (lib.filterAttrs (_k: isAttrs) attr);
config = _config ++ _config'; config = _config ++ _config';
in in
lib.concatStringsSep "\n" config; lib.concatStringsSep "\n" config;

View File

@@ -417,12 +417,12 @@ in
}) cfg.backups; }) cfg.backups;
mustSetRepository = assertBackup { mustSetRepository = assertBackup {
assertion = n: v: lib.xor (v.repository == null) (v.repositoryFile == null); assertion = _n: v: lib.xor (v.repository == null) (v.repositoryFile == null);
message = "exactly one of repository or repositoryFile should be set"; message = "exactly one of repository or repositoryFile should be set";
}; };
mustSetPassword = assertBackup { mustSetPassword = assertBackup {
assertion = n: v: lib.xor (v.passwordCommand == null) (v.passwordFile == null); assertion = _n: v: lib.xor (v.passwordCommand == null) (v.passwordFile == null);
message = "exactly one of passwordCommand or passwordFile should be set"; message = "exactly one of passwordCommand or passwordFile should be set";
}; };
in in

View File

@@ -184,7 +184,7 @@ in
command command
]; ];
nonemptyEvents = lib.filterAttrs (event: command: command != null) cfg.events; nonemptyEvents = lib.filterAttrs (_event: command: command != null) cfg.events;
args = args =
cfg.extraArgs cfg.extraArgs

View File

@@ -144,7 +144,7 @@ in
); );
systemd.user.timers = makeDefs ( systemd.user.timers = makeDefs (
name: pairCfg: { name: _pairCfg: {
Unit.Description = "Unison pair sync auto-restart (${name})"; Unit.Description = "Unison pair sync auto-restart (${name})";
Install.WantedBy = [ "timers.target" ]; Install.WantedBy = [ "timers.target" ];
Timer = { Timer = {

View File

@@ -88,7 +88,7 @@ in
home.packages = [ cfg.package ]; home.packages = [ cfg.package ];
wayland.windowManager = lib.mapAttrs (name: _: { wayland.windowManager = lib.mapAttrs (_name: _: {
systemd.variables = lib.mkOptionDefault [ "XDG_VTNR" ]; systemd.variables = lib.mkOptionDefault [ "XDG_VTNR" ];
}) options.wayland.windowManager; }) options.wayland.windowManager;

View File

@@ -59,7 +59,7 @@ let
formatDirective = n: v: "${camelToSnake n}=${formatValue v}"; formatDirective = n: v: "${camelToSnake n}=${formatValue v}";
directivesStr = escapeShellArgs ( directivesStr = escapeShellArgs (
mapAttrsToList formatDirective (lib.filterAttrs (n: v: v != null) directives) mapAttrsToList formatDirective (lib.filterAttrs (_n: v: v != null) directives)
); );
in in
"bspc rule -a ${escapeShellArg target} ${directivesStr}"; "bspc rule -a ${escapeShellArg target} ${directivesStr}";

View File

@@ -367,12 +367,12 @@ in
# attrset of { <submap name> = <list of non bind* keys>; } for all submaps # attrset of { <submap name> = <list of non bind* keys>; } for all submaps
submapWarningsAttrset = builtins.mapAttrs ( submapWarningsAttrset = builtins.mapAttrs (
name: submap: filterNonBinds submap.settings _name: submap: filterNonBinds submap.settings
) cfg.submaps; ) cfg.submaps;
submapWarnings = lib.mapAttrsToList (submapName: nonBinds: '' submapWarnings = lib.mapAttrsToList (submapName: nonBinds: ''
wayland.windowManager.hyprland.submaps."${submapName}".settings: found non-bind entries: [${toString nonBinds}], which will have no effect in a submap wayland.windowManager.hyprland.submaps."${submapName}".settings: found non-bind entries: [${toString nonBinds}], which will have no effect in a submap
'') (lib.filterAttrs (n: v: v != [ ]) submapWarningsAttrset); '') (lib.filterAttrs (_n: v: v != [ ]) submapWarningsAttrset);
in in
submapWarnings ++ lib.optional inconsistent warning; submapWarnings ++ lib.optional inconsistent warning;
@@ -388,7 +388,7 @@ in
importantPrefixes = cfg.importantPrefixes ++ lib.optional cfg.sourceFirst "source"; importantPrefixes = cfg.importantPrefixes ++ lib.optional cfg.sourceFirst "source";
pluginsToHyprconf = pluginsToHyprconf =
plugins: _plugins:
lib.hm.generators.toHyprconf { lib.hm.generators.toHyprconf {
attrs = { attrs = {
"exec-once" = "exec-once" =

View File

@@ -43,7 +43,7 @@ let
keybindings = mkOption { keybindings = mkOption {
type = types.attrsOf (types.nullOr types.str); type = types.attrsOf (types.nullOr types.str);
default = lib.mapAttrs (n: lib.mkOptionDefault) { default = lib.mapAttrs (_n: lib.mkOptionDefault) {
"${cfg.config.modifier}+Return" = "exec ${cfg.config.terminal}"; "${cfg.config.modifier}+Return" = "exec ${cfg.config.terminal}";
"${cfg.config.modifier}+Shift+q" = "kill"; "${cfg.config.modifier}+Shift+q" = "kill";
"${cfg.config.modifier}+d" = "exec ${cfg.config.menu}"; "${cfg.config.modifier}+d" = "exec ${cfg.config.menu}";

View File

@@ -16,11 +16,11 @@ rec {
"[${concatStringsSep " " (mapAttrsToList toCriteria criteria)}]"; "[${concatStringsSep " " (mapAttrsToList toCriteria criteria)}]";
keybindingDefaultWorkspace = lib.filterAttrs ( keybindingDefaultWorkspace = lib.filterAttrs (
n: v: cfg.config.defaultWorkspace != null && v == cfg.config.defaultWorkspace _n: v: cfg.config.defaultWorkspace != null && v == cfg.config.defaultWorkspace
) cfg.config.keybindings; ) cfg.config.keybindings;
keybindingsRest = lib.filterAttrs ( keybindingsRest = lib.filterAttrs (
n: v: cfg.config.defaultWorkspace == null || v != cfg.config.defaultWorkspace _n: v: cfg.config.defaultWorkspace == null || v != cfg.config.defaultWorkspace
) cfg.config.keybindings; ) cfg.config.keybindings;
keybindingsStr = keybindingsStr =
@@ -120,7 +120,7 @@ rec {
... ...
}: }:
let let
colorsNotNull = lib.filterAttrs (n: v: v != null) colors != { }; colorsNotNull = lib.filterAttrs (_n: v: v != null) colors != { };
in in
lib.concatMapStrings (x: x + "\n") ( lib.concatMapStrings (x: x + "\n") (
indent (lib.lists.subtractLists [ "" null ] ( indent (lib.lists.subtractLists [ "" null ] (
@@ -221,7 +221,7 @@ rec {
level ? 1, level ? 1,
}: }:
let let
prefix = concatStringsSep "" (lib.genList (x: " ") (level * 2)); prefix = concatStringsSep "" (lib.genList (_x: " ") (level * 2));
in in
(lib.imap1 ( (lib.imap1 (

View File

@@ -77,7 +77,7 @@ let
keybindings = mkOption { keybindings = mkOption {
type = types.attrsOf (types.nullOr types.str); type = types.attrsOf (types.nullOr types.str);
default = lib.mapAttrs (n: lib.mkOptionDefault) { default = lib.mapAttrs (_n: lib.mkOptionDefault) {
"${cfg.config.modifier}+Return" = "exec ${cfg.config.terminal}"; "${cfg.config.modifier}+Return" = "exec ${cfg.config.terminal}";
"${cfg.config.modifier}+Shift+q" = "kill"; "${cfg.config.modifier}+Shift+q" = "kill";
"${cfg.config.modifier}+d" = "exec ${cfg.config.menu}"; "${cfg.config.modifier}+d" = "exec ${cfg.config.menu}";
@@ -478,9 +478,9 @@ let
(keycodebindingsStr keycodebindings) (keycodebindingsStr keycodebindings)
] ]
++ optional (builtins.attrNames bindswitches != [ ]) (bindswitchesStr bindswitches) ++ optional (builtins.attrNames bindswitches != [ ]) (bindswitchesStr bindswitches)
++ mapAttrsToList inputStr (filterAttrs (n: v: n == "*") input) ++ mapAttrsToList inputStr (filterAttrs (n: _v: n == "*") input)
++ mapAttrsToList inputStr (filterAttrs (n: v: hasPrefix "type:" n) input) ++ mapAttrsToList inputStr (filterAttrs (n: _v: hasPrefix "type:" n) input)
++ mapAttrsToList inputStr (filterAttrs (n: v: n != "*" && !(hasPrefix "type:" n)) input) ++ mapAttrsToList inputStr (filterAttrs (n: _v: n != "*" && !(hasPrefix "type:" n)) input)
++ mapAttrsToList outputStr output # outputs ++ mapAttrsToList outputStr output # outputs
++ mapAttrsToList seatStr seat # seats ++ mapAttrsToList seatStr seat # seats
++ mapAttrsToList (modeStr cfg.config.bindkeysToCode) modes # modes ++ mapAttrsToList (modeStr cfg.config.bindkeysToCode) modes # modes

View File

@@ -48,7 +48,7 @@ in
}; };
extraPackages = mkOption { extraPackages = mkOption {
default = self: [ ]; default = _self: [ ];
defaultText = "self: []"; defaultText = "self: []";
example = literalExpression '' example = literalExpression ''
haskellPackages: [ haskellPackages: [

View File

@@ -51,7 +51,7 @@ let
let let
# Filters out fields that are set to `null` or empty list. # Filters out fields that are set to `null` or empty list.
shouldKeepField = shouldKeepField =
section: key: value: _section: _key: value:
value != null && value != [ ]; value != null && value != [ ];
# Filters out empty sections. # Filters out empty sections.

View File

@@ -20,9 +20,11 @@ let
domain: attrs: domain: attrs:
"run /usr/bin/defaults ${cliFlags} import ${lib.escapeShellArg domain} ${toDefaultsFile domain attrs}"; "run /usr/bin/defaults ${cliFlags} import ${lib.escapeShellArg domain} ${toDefaultsFile domain attrs}";
nonNullDefaults = lib.mapAttrs (domain: attrs: (lib.filterAttrs (n: v: v != null) attrs)) settings; nonNullDefaults = lib.mapAttrs (
_domain: attrs: (lib.filterAttrs (_n: v: v != null) attrs)
) settings;
writableDefaults = lib.filterAttrs (domain: attrs: attrs != { }) nonNullDefaults; writableDefaults = lib.filterAttrs (_domain: attrs: attrs != { }) nonNullDefaults;
in in
lib.mapAttrsToList toActivationCmd writableDefaults; lib.mapAttrsToList toActivationCmd writableDefaults;

View File

@@ -18,7 +18,7 @@ in
(lib.mkIf (cfg.users != { }) { (lib.mkIf (cfg.users != { }) {
system.activationScripts.postActivation.text = lib.concatStringsSep "\n" ( system.activationScripts.postActivation.text = lib.concatStringsSep "\n" (
lib.mapAttrsToList ( lib.mapAttrsToList (
username: usercfg: _username: usercfg:
let let
driverVersion = if cfg.enableLegacyProfileManagement then "0" else "1"; driverVersion = if cfg.enableLegacyProfileManagement then "0" else "1";
in in

View File

@@ -1,3 +1,3 @@
final: prev: { _final: prev: {
home-manager = prev.callPackage ./home-manager { path = toString ./.; }; home-manager = prev.callPackage ./home-manager { path = toString ./.; };
} }

View File

@@ -201,7 +201,7 @@ let
# Create an overlay that scrubs packages in the scrublist # Create an overlay that scrubs packages in the scrublist
packageScrubOverlay = packageScrubOverlay =
self: super: _self: super:
lib.mapAttrs ( lib.mapAttrs (
name: value: name: value:
if lib.elem name packagesToScrub then if lib.elem name packagesToScrub then

View File

@@ -47,7 +47,7 @@ let
# Globally unscrub a few selected packages that are used by a wide selection of tests. # Globally unscrub a few selected packages that are used by a wide selection of tests.
whitelist = whitelist =
let let
inner = self: super: { inner = _self: _super: {
inherit (pkgs) inherit (pkgs)
coreutils coreutils
crudini crudini
@@ -84,12 +84,12 @@ let
# TODO: fix darwin stdenv stubbing # TODO: fix darwin stdenv stubbing
if isDarwin then if isDarwin then
let let
rawPkgs = lib.makeExtensible (final: pkgs); rawPkgs = lib.makeExtensible (_final: pkgs);
in in
builtins.traceVerbose "eval scrubbed darwin nixpkgs" (rawPkgs.extend darwinScrublist) builtins.traceVerbose "eval scrubbed darwin nixpkgs" (rawPkgs.extend darwinScrublist)
else else
let let
rawScrubbedPkgs = lib.makeExtensible (final: scrubDerivations pkgs); rawScrubbedPkgs = lib.makeExtensible (_final: scrubDerivations pkgs);
in in
builtins.traceVerbose "eval scrubbed nixpkgs" (rawScrubbedPkgs.extend whitelist); builtins.traceVerbose "eval scrubbed nixpkgs" (rawScrubbedPkgs.extend whitelist);

View File

@@ -12,7 +12,7 @@ let
''; '';
dynDir = testDir.overrideAttrs ( dynDir = testDir.overrideAttrs (
final: prev: { _final: prev: {
buildCommand = prev.buildCommand + '' buildCommand = prev.buildCommand + ''
echo more secret data > $out/top-secret echo more secret data > $out/top-secret
echo shhhh > $out/top-secret-v2 echo shhhh > $out/top-secret-v2

View File

@@ -67,7 +67,7 @@ let
in in
{ {
options.test.values = lib.mapAttrs ( options.test.values = lib.mapAttrs (
name: case: _name: case:
lib.mkOption { lib.mkOption {
type = attrSetOfString; type = attrSetOfString;
default = { }; default = { };
@@ -114,12 +114,12 @@ in
}; };
asserts.warnings.expected = lib.flatten ( asserts.warnings.expected = lib.flatten (
lib.mapAttrsToList (name: case: lib.optional case.expectedWarn case.default.warning) cases lib.mapAttrsToList (_name: case: lib.optional case.expectedWarn case.default.warning) cases
); );
}; };
warnings = lib.flatten ( warnings = lib.flatten (
lib.mapAttrsToList (name: case: lib.optional case.default.shouldWarn case.default.warning) cases lib.mapAttrsToList (_name: case: lib.optional case.default.shouldWarn case.default.warning) cases
); );
home.file."result.txt".text = '' home.file."result.txt".text = ''

View File

@@ -37,7 +37,7 @@
accountAttrOptions = options.accounts.email.accounts.type.nestedTypes.elemType.getSubOptions [ ]; accountAttrOptions = options.accounts.email.accounts.type.nestedTypes.elemType.getSubOptions [ ];
throwOnAttrAccess = throwOnAttrAccess =
baseName: builtins.mapAttrs (n: v: throw "Unexpected access of ${baseName}.${n}"); baseName: builtins.mapAttrs (n: _v: throw "Unexpected access of ${baseName}.${n}");
# Don't want to do anything with these account attributes. # Don't want to do anything with these account attributes.
ignoredAttrNames = [ ignoredAttrNames = [

View File

@@ -26,9 +26,9 @@ in
]; ];
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: { (_final: prev: {
lib = prev.lib.extend ( lib = prev.lib.extend (
final: prev: { _final: prev: {
trivial = prev.trivial // { trivial = prev.trivial // {
release = pkgsRelease; release = pkgsRelease;
}; };

View File

@@ -5,7 +5,7 @@
# Use `realPkgs` here since the creation of the fontconfig cache relies on the # Use `realPkgs` here since the creation of the fontconfig cache relies on the
# `fc-cache` binary and actual (non-stubbed) fonts. # `fc-cache` binary and actual (non-stubbed) fonts.
test.unstubs = [ (self: super: { inherit (realPkgs) fontconfig; }) ]; test.unstubs = [ (_self: _super: { inherit (realPkgs) fontconfig; }) ];
home.packages = [ home.packages = [
realPkgs.comic-relief realPkgs.comic-relief
realPkgs.unifont realPkgs.unifont

View File

@@ -5,7 +5,7 @@
# Use `realPkgs` here since the creation of the fontconfig cache relies on the # Use `realPkgs` here since the creation of the fontconfig cache relies on the
# `fc-cache` binary and actual (non-stubbed) fonts. # `fc-cache` binary and actual (non-stubbed) fonts.
test.unstubs = [ (self: super: { inherit (realPkgs) fontconfig; }) ]; test.unstubs = [ (_self: _super: { inherit (realPkgs) fontconfig; }) ];
home.packages = [ realPkgs.comic-relief ]; home.packages = [ realPkgs.comic-relief ];
nmt.script = '' nmt.script = ''

View File

@@ -12,15 +12,15 @@
}; };
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: { (_final: prev: {
libsForQt5 = prev.libsForQt5.overrideScope ( libsForQt5 = prev.libsForQt5.overrideScope (
qt5final: qt5prev: { _qt5final: _qt5prev: {
qtstyleplugins = config.lib.test.mkStubPackage { outPath = null; }; qtstyleplugins = config.lib.test.mkStubPackage { outPath = null; };
} }
); );
qt6Packages = prev.qt6Packages.overrideScope ( qt6Packages = prev.qt6Packages.overrideScope (
qt6final: qt6prev: { _qt6final: _qt6prev: {
qt6gtk2 = config.lib.test.mkStubPackage { outPath = null; }; qt6gtk2 = config.lib.test.mkStubPackage { outPath = null; };
} }
); );

View File

@@ -21,7 +21,7 @@ lib.mkIf config.test.enableBig {
}; };
}; };
test.unstubs = [ (self: super: { inherit (realPkgs) xdg-desktop-portal; }) ]; test.unstubs = [ (_self: _super: { inherit (realPkgs) xdg-desktop-portal; }) ];
nmt.script = '' nmt.script = ''
assertFileExists home-path/share/systemd/user/xdg-desktop-portal.service assertFileExists home-path/share/systemd/user/xdg-desktop-portal.service

View File

@@ -1,7 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
hmPkgs = pkgs.extend ( hmPkgs = pkgs.extend (
self: super: { _self: _super: {
aerospace = config.lib.test.mkStubPackage { aerospace = config.lib.test.mkStubPackage {
name = "aerospace"; name = "aerospace";
buildScript = '' buildScript = ''

View File

@@ -1,7 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
hmPkgs = pkgs.extend ( hmPkgs = pkgs.extend (
self: super: { _self: _super: {
aerospace = config.lib.test.mkStubPackage { aerospace = config.lib.test.mkStubPackage {
name = "aerospace"; name = "aerospace";
buildScript = '' buildScript = ''

View File

@@ -1,7 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
hmPkgs = pkgs.extend ( hmPkgs = pkgs.extend (
self: super: { _self: _super: {
aerospace = config.lib.test.mkStubPackage { aerospace = config.lib.test.mkStubPackage {
name = "aerospace"; name = "aerospace";
buildScript = '' buildScript = ''

View File

@@ -1,7 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
hmPkgs = pkgs.extend ( hmPkgs = pkgs.extend (
self: super: { _self: _super: {
aerospace = config.lib.test.mkStubPackage { aerospace = config.lib.test.mkStubPackage {
name = "aerospace"; name = "aerospace";
buildScript = '' buildScript = ''

View File

@@ -13,7 +13,7 @@
]; ];
}; };
nixpkgs.overlays = [ (self: super: { inherit (realPkgs) browserpass; }) ]; nixpkgs.overlays = [ (_self: _super: { inherit (realPkgs) browserpass; }) ];
nmt.script = nmt.script =
if realPkgs.stdenv.hostPlatform.isDarwin then if realPkgs.stdenv.hostPlatform.isDarwin then

View File

@@ -11,7 +11,7 @@ lib.mkIf config.test.enableBig {
fish.enable = true; fish.enable = true;
}; };
nixpkgs.overlays = [ (self: super: { inherit (realPkgs) carapace; }) ]; nixpkgs.overlays = [ (_self: _super: { inherit (realPkgs) carapace; }) ];
nmt.script = nmt.script =
let let

View File

@@ -1,7 +1,7 @@
name: name:
builtins.mapAttrs builtins.mapAttrs
( (
test: module: _test: module:
import module [ import module [
"programs" "programs"
name name

View File

@@ -43,7 +43,7 @@ let
in in
{ {
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: { gnome-shell-extensions = dummy-gnome-shell-extensions; }) (_final: _prev: { gnome-shell-extensions = dummy-gnome-shell-extensions; })
]; ];
programs.gnome-shell.enable = true; programs.gnome-shell.enable = true;

View File

@@ -21,7 +21,7 @@ lib.mkIf config.test.enableLegacyIfd {
) )
]; ];
nixpkgs.overlays = [ (self: super: { inherit (realPkgs) kitty-themes; }) ]; nixpkgs.overlays = [ (_self: _super: { inherit (realPkgs) kitty-themes; }) ];
nmt.script = '' nmt.script = ''
assertFileExists home-files/.config/kitty/kitty.conf assertFileExists home-files/.config/kitty/kitty.conf

View File

@@ -17,7 +17,7 @@
}; };
}; };
nixpkgs.overlays = [ nixpkgs.overlays = [
(self: super: { (_self: _super: {
openshift = config.lib.test.mkStubPackage { openshift = config.lib.test.mkStubPackage {
name = "openshift"; name = "openshift";
version = "4.16.0"; version = "4.16.0";

View File

@@ -6,7 +6,7 @@
let let
hmPkgs = pkgs.extend ( hmPkgs = pkgs.extend (
self: super: { _self: _super: {
sketchybar = config.lib.test.mkStubPackage { sketchybar = config.lib.test.mkStubPackage {
name = "sketchybar"; name = "sketchybar";
buildScript = '' buildScript = ''

View File

@@ -5,7 +5,7 @@
# Set up a minimal mocked texlive package set. # Set up a minimal mocked texlive package set.
nixpkgs.overlays = [ nixpkgs.overlays = [
(self: super: { (_self: _super: {
texlive = { texlive = {
collection-basic = pkgs.writeTextDir "collection-basic" ""; collection-basic = pkgs.writeTextDir "collection-basic" "";
combine = combine =

View File

@@ -6,7 +6,7 @@
}; };
nixpkgs.overlays = [ nixpkgs.overlays = [
(self: super: { (_self: super: {
tmuxPlugins = super.tmuxPlugins // { tmuxPlugins = super.tmuxPlugins // {
sensible = super.tmuxPlugins.sensible // { sensible = super.tmuxPlugins.sensible // {
rtp = "@sensible_rtp@"; rtp = "@sensible_rtp@";

View File

@@ -17,7 +17,7 @@
}; };
nixpkgs.overlays = [ nixpkgs.overlays = [
(self: super: { (_self: super: {
tmuxPlugins = super.tmuxPlugins // { tmuxPlugins = super.tmuxPlugins // {
fzf-tmux-url = super.tmuxPlugins.fzf-tmux-url // { fzf-tmux-url = super.tmuxPlugins.fzf-tmux-url // {
rtp = "@tmuxplugin_fzf_tmux_url_rtp@"; rtp = "@tmuxplugin_fzf_tmux_url_rtp@";

View File

@@ -6,7 +6,7 @@
}; };
nixpkgs.overlays = [ nixpkgs.overlays = [
(self: super: { (_self: super: {
tmuxPlugins = super.tmuxPlugins // { tmuxPlugins = super.tmuxPlugins // {
sensible = super.tmuxPlugins.sensible // { sensible = super.tmuxPlugins.sensible // {
rtp = "@sensible_rtp@"; rtp = "@sensible_rtp@";

View File

@@ -6,7 +6,7 @@
}; };
nixpkgs.overlays = [ nixpkgs.overlays = [
(self: super: { (_self: super: {
tmuxPlugins = super.tmuxPlugins // { tmuxPlugins = super.tmuxPlugins // {
sensible = super.tmuxPlugins.sensible // { sensible = super.tmuxPlugins.sensible // {
rtp = "@sensible_rtp@"; rtp = "@sensible_rtp@";

Some files were not shown because too many files have changed in this diff Show More