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;
enabledAccounts = lib.filterAttrs (n: v: v.enable) cfg.accounts;
enabledAccounts = lib.filterAttrs (_n: v: v.enable) cfg.accounts;
gpgModule = types.submodule {
options = {

View File

@@ -100,7 +100,7 @@ in
(
let
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)
)
);

View File

@@ -69,9 +69,9 @@ let
toAgent =
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)) (
lib.filterAttrs (n: v: v.enable) cfg.agents
);
agentPlists = lib.mapAttrs' (
_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" { } ''
mkdir -p "$out"

View File

@@ -86,7 +86,7 @@ in
topoSort =
dag:
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: {
name = n;
inherit (v) data;

View File

@@ -34,7 +34,7 @@
importantFields = filterAttrs isImportantField attrs;
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;
mkSection =
@@ -57,7 +57,7 @@
inherit indent;
};
allFields = filterAttrs (n: v: !(isAttrs v || isList v)) attrs;
allFields = filterAttrs (_n: v: !(isAttrs v || isList v)) attrs;
fields = withoutImportantFields allFields;
in
mkFields importantFields

View File

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

View File

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

View File

@@ -53,7 +53,7 @@ let
);
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
collectNixFiles =

View File

@@ -269,7 +269,7 @@ in
path = config.flake.outPath;
}
// lib.filterAttrs (
n: v: n == "lastModified" || n == "rev" || n == "revCount" || n == "narHash"
n: _v: n == "lastModified" || n == "rev" || n == "revCount" || n == "narHash"
) config.flake
);
};
@@ -398,7 +398,7 @@ in
(mkIf (cfg.registry != { }) {
xdg.configFile."nix/registry.json".source = jsonFormat.generate "registry.json" {
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;
in
traceXIfNot isConfig;
merge = args: lib.foldr (def: mergeConfig def.value) { };
merge = _args: lib.foldr (def: mergeConfig def.value) { };
};
# Copied from nixpkgs.nix.

View File

@@ -45,7 +45,7 @@ let
traceXIfNot = c: if c x then true else lib.traceSeqN 1 x false;
in
traceXIfNot isConfig;
merge = args: lib.foldr (def: mergeConfig def.value) { };
merge = _args: lib.foldr (def: mergeConfig def.value) { };
};
overlayType = lib.mkOptionType {
@@ -55,7 +55,7 @@ let
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
{

View File

@@ -353,7 +353,7 @@ in
};
# 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 =
if (platformTheme.name != null) then
styleNames.${platformTheme.name} or platformTheme.name

View File

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

View File

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

View File

@@ -145,7 +145,7 @@ in
};
mkAccount =
name: account:
_name: account:
let
nullOrMap = f: v: if v == null then v else f v;
@@ -168,7 +168,7 @@ in
"?"
+ builtins.concatStringsSep "&" (
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
@@ -249,7 +249,7 @@ in
}
// optPwCmd "outgoing" passwordCommand;
msmtp = cfg: {
msmtp = _cfg: {
outgoing = "msmtpq --read-envelope-from --read-recipients";
};

View File

@@ -99,7 +99,7 @@ in
xdg.configFile."alacritty/alacritty.toml" = lib.mkIf (cfg.settings != { }) {
source = (tomlFormat.generate "alacritty.toml" cfg.settings).overrideAttrs (
finalAttrs: prevAttrs: {
_finalAttrs: prevAttrs: {
buildCommand = lib.concatStringsSep "\n" [
prevAttrs.buildCommand
# 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;
in
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 { };
astroidAccounts = lib.filterAttrs (
n: v: v.enable && v.astroid.enable
_n: v: v.enable && v.astroid.enable
) config.accounts.email.accounts;
boolOpt = b: if b then "true" else "false";
@@ -51,7 +51,7 @@ let
astroidConfig = lib.foldl' lib.recursiveUpdate template [
{
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";
}
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;
hmSymlinks = (lib.filter (file: !file.recursive) hmFiles);

View File

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

View File

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

View File

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

View File

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

View File

@@ -26,8 +26,8 @@ let
renderBindings =
bindings:
let
enabled = filterAttrs (n: v: v != null) bindings;
disabled = filterAttrs (n: v: v == null) bindings;
enabled = filterAttrs (_n: v: v != null) bindings;
disabled = filterAttrs (_n: v: v == null) bindings;
render = mapAttrsToList renderBinding;
in
lib.concatStringsSep "\n" (render disabled ++ render enabled);
@@ -139,7 +139,7 @@ in
config = lib.mkIf cfg.enable {
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.";
}
];

View File

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

View File

@@ -420,9 +420,9 @@ let
"onSignal"
"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;
sourceFunction = name: def: "source ${config.xdg.configHome}/fish/functions/${name}.fish";
sourceFunction = name: _def: "source ${config.xdg.configHome}/fish/functions/${name}.fish";
in
builtins.concatStringsSep "\n" (lib.mapAttrsToList sourceFunction handlerFunctions);

View File

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

View File

@@ -394,7 +394,7 @@ in
};
"${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;
};
}

View File

@@ -14,7 +14,7 @@ let
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}"'';
@@ -231,7 +231,7 @@ in
xdg.configFile."i3status/config".text = lib.concatStringsSep "\n" (
lib.optional (cfg.general != { }) (formatModule "general" cfg.general)
++ 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 =
let
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:
# sync.interval = ... -> "sync.interval" = ...

View File

@@ -190,7 +190,7 @@ in
lutris-overrides = {
# This only adds pkgs.steam to the extraPkgs, I see no reason to ever enable it.
steamSupport = false;
extraPkgs = (prev: cfg.extraPackages ++ optional (cfg.steamPackage != null) cfg.steamPackage);
extraPkgs = (_prev: cfg.extraPackages ++ optional (cfg.steamPackage != null) cfg.steamPackage);
};
in
[ (cfg.package.override lutris-overrides) ];
@@ -200,7 +200,7 @@ in
buildRunnerConfig = (
runner_name: runner_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_config.settings.runner
# 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
# patterns use the invalidOption attribute set value name.
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.
groupInvalidOption =
groups: invalidOption:
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)
# return true if ANY of the account's groups' channels' patterns use the
# invalidOption attribute set value name.
accountInvalidOption =
accounts: invalidOption:
_accounts: invalidOption:
any (a: a) (map (account: groupInvalidOption account.mbsync.groups invalidOption) mbsyncAccounts);
genTlsConfig =
@@ -203,14 +203,14 @@ let
genChannelStrings =
groupName: 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
# the group.
genGroupsChannels = group: concatStringsSep "\n" (genChannelStrings group.name group.channels);
# Generate all channel configurations for all groups for this account.
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
genAccountGroups =
@@ -219,7 +219,7 @@ let
# Given the name of the group and the attribute set of channels, make
# make "Channel <grpName>-<chnName>" for each channel to list os strings
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
# "Group <grpName>" header and each of the channels.
genGroupChannelString =
@@ -232,7 +232,7 @@ let
# Given set of groups, generates list of strings, where each string is one
# of the groups and its constituent channels.
genGroupsStrings = mapAttrsToList (
name: info: concatStringsSep "\n" (genGroupChannelString groups.${name})
name: _info: concatStringsSep "\n" (genGroupChannelString groups.${name})
) groups;
# Join all non-empty groups.
combined = concatStringsSep "\n\n" (lib.remove "" genGroupsStrings) + "\n";

View File

@@ -18,13 +18,13 @@ let
tomlFormat = pkgs.formats.toml { };
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;
meliAccounts = (lib.attrsets.mapAttrs (name: value: (mkMeliAccounts name value)) enabledAccounts);
mkMeliAccounts = (
name: account:
_name: account:
{
root_mailbox = "${config.accounts.email.maildirBasePath}/${account.maildir.path}";
format = "Maildir";

View File

@@ -23,7 +23,7 @@ let
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 =
account:

View File

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

View File

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

View File

@@ -13,7 +13,7 @@ let
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 =
cfg.settings
// lib.optionalAttrs (cfg.libraries != { }) {

View File

@@ -113,7 +113,7 @@
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;
contactLocalStorageDirs = lib.mapAttrsToList localStorageDir contactAccounts;

View File

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

View File

@@ -94,7 +94,7 @@ in
file."${configPath}" = lib.mkIf (cfg.custom_adapters != [ ]) {
source = (pkgs.formats.json { }).generate "ripgrep-all" {
"$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)}
'';
renderRepositories = repos: ''
renderRepositories = _repos: ''
[repositories]
${concatStrings (map renderRepository cfg.repositories)}'';

View File

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

View File

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

View File

@@ -635,10 +635,10 @@ in
warnings =
mapAttrsToList
(n: v: ''
(n: _v: ''
The SSH config match block `programs.ssh.matchBlocks.${n}` sets both of the host and match options.
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 {
warnings = [

View File

@@ -251,7 +251,7 @@ let
let
inherit (contact) id;
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}.filename" = "contact_${id}.sqlite"; # this is needed for carddav to work
@@ -970,7 +970,7 @@ in
# Append the default local folder name "account1".
# 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"
];
in
@@ -989,7 +989,7 @@ in
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
lib.optionals (calendarAccounts != [ ]) (
accountsOrderIds ++ (lib.lists.subtractLists accountsOrderIds enabledAccountsIds)
@@ -1045,7 +1045,7 @@ in
}
)
++ (mapAttrsToList (
name: profile:
name: _profile:
let
emailAccountsWithFilters = (
filter (a: a.thunderbird.messageFilters != [ ]) (

View File

@@ -300,7 +300,7 @@ in
in
mapAttrsToList
(
a: v':
a: _v':
[
{
assertion = (lib.elem a allowed);
@@ -327,7 +327,7 @@ in
++ map (
attrs:
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
{
assertion = lib.length defined <= 1;

View File

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

View File

@@ -129,7 +129,7 @@ let
name: server:
let
# 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
{
inherit name;
@@ -478,7 +478,7 @@ in
(mkIf
(
(lib.filterAttrs (
n: v:
_n: v:
(v ? enableExtensionUpdateCheck || v ? enableUpdateCheck)
&& (v.enableExtensionUpdateCheck != null || v.enableUpdateCheck != null)
) allProfilesExceptDefault) != { }
@@ -501,7 +501,7 @@ in
PATH=${lib.makeBinPath [ pkgs.jq ]}''${PATH:+:}$PATH
file="${userDir}/globalStorage/storage.json"
file_write=""
profiles=(${lib.escapeShellArgs (flatten (mapAttrsToList (n: v: n) allProfilesExceptDefault))})
profiles=(${lib.escapeShellArgs (flatten (mapAttrsToList (n: _v: n) allProfilesExceptDefault))})
if [ -f "$file" ]; then
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
# in the extension directory, which includes extensions from other profiles.
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
(
@@ -669,7 +669,7 @@ in
combinedExtensionsDrv = pkgs.buildEnv {
name = "vscode-extensions";
paths =
(flatten (mapAttrsToList (n: v: v.extensions) cfg.profiles))
(flatten (mapAttrsToList (_n: v: v.extensions) cfg.profiles))
++ lib.optional (
(
lib.versionAtLeast vscodeVersion "1.74.0"

View File

@@ -350,7 +350,7 @@ in
mkIf cfg.enable {
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.";
}
];

View File

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

View File

@@ -14,7 +14,7 @@ let
''
# 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
{
meta.maintainers = [ lib.maintainers.christoph-heiss ];

View File

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

View File

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

View File

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

View File

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

View File

@@ -19,8 +19,8 @@ let
let
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;
sectionSettings = 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;
globalLines = lib.concatStringsSep "\n" (
lib.mapAttrsToList (k: v: "${k}=${formatValue v}") globalSettings

View File

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

View File

@@ -107,7 +107,7 @@ in
else
"${pkgs.skopeo.policy}/default-policy.json";
"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/containers.conf".source = toml.generate "containers.conf" cfg.settings.containers;

View File

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

View File

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

View File

@@ -417,12 +417,12 @@ in
}) cfg.backups;
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";
};
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";
};
in

View File

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

View File

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

View File

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

View File

@@ -59,7 +59,7 @@ let
formatDirective = n: v: "${camelToSnake n}=${formatValue v}";
directivesStr = escapeShellArgs (
mapAttrsToList formatDirective (lib.filterAttrs (n: v: v != null) directives)
mapAttrsToList formatDirective (lib.filterAttrs (_n: v: v != null) directives)
);
in
"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
submapWarningsAttrset = builtins.mapAttrs (
name: submap: filterNonBinds submap.settings
_name: submap: filterNonBinds submap.settings
) cfg.submaps;
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
'') (lib.filterAttrs (n: v: v != [ ]) submapWarningsAttrset);
'') (lib.filterAttrs (_n: v: v != [ ]) submapWarningsAttrset);
in
submapWarnings ++ lib.optional inconsistent warning;
@@ -388,7 +388,7 @@ in
importantPrefixes = cfg.importantPrefixes ++ lib.optional cfg.sourceFirst "source";
pluginsToHyprconf =
plugins:
_plugins:
lib.hm.generators.toHyprconf {
attrs = {
"exec-once" =

View File

@@ -43,7 +43,7 @@ let
keybindings = mkOption {
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}+Shift+q" = "kill";
"${cfg.config.modifier}+d" = "exec ${cfg.config.menu}";

View File

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

View File

@@ -77,7 +77,7 @@ let
keybindings = mkOption {
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}+Shift+q" = "kill";
"${cfg.config.modifier}+d" = "exec ${cfg.config.menu}";
@@ -478,9 +478,9 @@ let
(keycodebindingsStr keycodebindings)
]
++ optional (builtins.attrNames bindswitches != [ ]) (bindswitchesStr bindswitches)
++ mapAttrsToList inputStr (filterAttrs (n: v: 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 == "*") input)
++ mapAttrsToList inputStr (filterAttrs (n: _v: hasPrefix "type:" n) input)
++ mapAttrsToList inputStr (filterAttrs (n: _v: n != "*" && !(hasPrefix "type:" n)) input)
++ mapAttrsToList outputStr output # outputs
++ mapAttrsToList seatStr seat # seats
++ mapAttrsToList (modeStr cfg.config.bindkeysToCode) modes # modes

View File

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

View File

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

View File

@@ -20,9 +20,11 @@ let
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
lib.mapAttrsToList toActivationCmd writableDefaults;

View File

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

View File

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

View File

@@ -201,7 +201,7 @@ let
# Create an overlay that scrubs packages in the scrublist
packageScrubOverlay =
self: super:
_self: super:
lib.mapAttrs (
name: value:
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.
whitelist =
let
inner = self: super: {
inner = _self: _super: {
inherit (pkgs)
coreutils
crudini
@@ -84,12 +84,12 @@ let
# TODO: fix darwin stdenv stubbing
if isDarwin then
let
rawPkgs = lib.makeExtensible (final: pkgs);
rawPkgs = lib.makeExtensible (_final: pkgs);
in
builtins.traceVerbose "eval scrubbed darwin nixpkgs" (rawPkgs.extend darwinScrublist)
else
let
rawScrubbedPkgs = lib.makeExtensible (final: scrubDerivations pkgs);
rawScrubbedPkgs = lib.makeExtensible (_final: scrubDerivations pkgs);
in
builtins.traceVerbose "eval scrubbed nixpkgs" (rawScrubbedPkgs.extend whitelist);

View File

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

View File

@@ -67,7 +67,7 @@ let
in
{
options.test.values = lib.mapAttrs (
name: case:
_name: case:
lib.mkOption {
type = attrSetOfString;
default = { };
@@ -114,12 +114,12 @@ in
};
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 (
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 = ''

View File

@@ -37,7 +37,7 @@
accountAttrOptions = options.accounts.email.accounts.type.nestedTypes.elemType.getSubOptions [ ];
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.
ignoredAttrNames = [

View File

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

View File

@@ -5,7 +5,7 @@
# Use `realPkgs` here since the creation of the fontconfig cache relies on the
# `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
realPkgs.unifont

View File

@@ -5,7 +5,7 @@
# Use `realPkgs` here since the creation of the fontconfig cache relies on the
# `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 ];
nmt.script = ''

View File

@@ -12,15 +12,15 @@
};
nixpkgs.overlays = [
(final: prev: {
(_final: prev: {
libsForQt5 = prev.libsForQt5.overrideScope (
qt5final: qt5prev: {
_qt5final: _qt5prev: {
qtstyleplugins = config.lib.test.mkStubPackage { outPath = null; };
}
);
qt6Packages = prev.qt6Packages.overrideScope (
qt6final: qt6prev: {
_qt6final: _qt6prev: {
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 = ''
assertFileExists home-path/share/systemd/user/xdg-desktop-portal.service

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -43,7 +43,7 @@ let
in
{
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;

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 = ''
assertFileExists home-files/.config/kitty/kitty.conf

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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