Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/accounts/email.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
10 changes: 5 additions & 5 deletions modules/files.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

let

cfg = lib.filterAttrs (n: f: f.enable) config.home.file;
cfg = lib.filterAttrs (_n: f: f.enable) config.home.file;

homeDirectory = config.home.homeDirectory;

Expand Down Expand Up @@ -52,8 +52,8 @@ in
(
let
dups = lib.attrNames (
lib.filterAttrs (n: v: v > 1) (
lib.foldAttrs (acc: v: acc + v) 0 (lib.mapAttrsToList (n: v: { ${v.target} = 1; }) cfg)
lib.filterAttrs (_n: v: v > 1) (
lib.foldAttrs (acc: v: acc + v) 0 (lib.mapAttrsToList (_n: v: { ${v.target} = 1; }) cfg)
)
);
dupsStr = lib.concatStringsSep ", " dups;
Expand Down Expand Up @@ -96,7 +96,7 @@ in
# Paths that should be forcibly overwritten by Home Manager.
# Caveat emptor!
forcedPaths = lib.concatMapStringsSep " " (p: ''"$HOME"/${lib.escapeShellArg p}'') (
lib.mapAttrsToList (n: v: v.target) (lib.filterAttrs (n: v: v.force) cfg)
lib.mapAttrsToList (_n: v: v.target) (lib.filterAttrs (_n: v: v.force) cfg)
);

storeDir = lib.escapeShellArg builtins.storeDir;
Expand Down Expand Up @@ -358,7 +358,7 @@ in
}
''
+ lib.concatStrings (
lib.mapAttrsToList (n: v: ''
lib.mapAttrsToList (_n: v: ''
insertFile ${
lib.escapeShellArgs [
(sourceStorePath v)
Expand Down
29 changes: 13 additions & 16 deletions modules/i18n/input-method/hime.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,21 @@
let
im = config.i18n.inputMethod;
in
{
config = lib.mkIf (im.enable && im.type == "hime") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does deadnix actually remove top level configs by itself now? Interesting..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I did this manually when I came across it.

i18n.inputMethod.package = pkgs.hime;
lib.mkIf (im.enable && im.type == "hime") {
i18n.inputMethod.package = pkgs.hime;

home.sessionVariables = {
GTK_IM_MODULE = "hime";
QT_IM_MODULE = "hime";
XMODIFIERS = "@im=hime";
};
home.sessionVariables = {
GTK_IM_MODULE = "hime";
QT_IM_MODULE = "hime";
XMODIFIERS = "@im=hime";
};

systemd.user.services.hime-daemon = {
Unit = {
Description = "Hime input method editor";
PartOf = [ "graphical-session.desktop" ];
};
Service.ExecStart = "${pkgs.hime}/bin/hime";
Install.WantedBy = [ "graphical-session.target" ];
systemd.user.services.hime-daemon = {
Unit = {
Description = "Hime input method editor";
PartOf = [ "graphical-session.desktop" ];
};
Service.ExecStart = "${pkgs.hime}/bin/hime";
Install.WantedBy = [ "graphical-session.target" ];
};

}
29 changes: 13 additions & 16 deletions modules/i18n/input-method/nabi.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,21 @@
let
im = config.i18n.inputMethod;
in
{
config = lib.mkIf (im.enable && im.type == "nabi") {
i18n.inputMethod.package = pkgs.nabi;
lib.mkIf (im.enable && im.type == "nabi") {
i18n.inputMethod.package = pkgs.nabi;

home.sessionVariables = {
GTK_IM_MODULE = "nabi";
QT_IM_MODULE = "nabi";
XMODIFIERS = "@im=nabi";
};
home.sessionVariables = {
GTK_IM_MODULE = "nabi";
QT_IM_MODULE = "nabi";
XMODIFIERS = "@im=nabi";
};

systemd.user.services.nabi-daemon = {
Unit = {
Description = "Nabi input method editor";
PartOf = [ "graphical-session.desktop" ];
};
Service.ExecStart = "${pkgs.nabi}/bin/nabi";
Install.WantedBy = [ "graphical-session.target" ];
systemd.user.services.nabi-daemon = {
Unit = {
Description = "Nabi input method editor";
PartOf = [ "graphical-session.desktop" ];
};
Service.ExecStart = "${pkgs.nabi}/bin/nabi";
Install.WantedBy = [ "graphical-session.target" ];
};

}
8 changes: 4 additions & 4 deletions modules/launchd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let
dstDir = "${config.home.homeDirectory}/Library/LaunchAgents";

launchdConfig =
{ config, name, ... }:
{ name, ... }:
{
options = {
enable = lib.mkEnableOption name;
Expand Down Expand Up @@ -45,9 +45,9 @@ let

toAgent = config: pkgs.writeText "${config.Label}.plist" (toPlist { escape = true; } 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"
Expand Down
1 change: 0 additions & 1 deletion modules/lib/booleans.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{ lib }:
{
# Converts a boolean to a yes/no string. This is used in lots of
# configuration formats.
Expand Down
2 changes: 1 addition & 1 deletion modules/lib/dag.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
data = v.data;
Expand Down
2 changes: 1 addition & 1 deletion modules/lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rec {

assertions = import ./assertions.nix { inherit lib; };

booleans = import ./booleans.nix { inherit lib; };
booleans = import ./booleans.nix;
darwin = import ./darwin.nix { inherit lib; };
deprecations = import ./deprecations.nix { inherit lib; };
generators = import ./generators.nix { inherit lib; };
Expand Down
4 changes: 2 additions & 2 deletions modules/lib/generators.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
toHyprconf' =
indent: attrs:
let
sections = filterAttrs (n: v: isAttrs v || (isList v && all isAttrs v)) attrs;
sections = filterAttrs (_n: v: isAttrs v || (isList v && all isAttrs v)) attrs;

mkSection =
n: attrs:
Expand All @@ -45,7 +45,7 @@
inherit indent;
};

allFields = filterAttrs (n: v: !(isAttrs v || (isList v && all isAttrs v))) attrs;
allFields = filterAttrs (_n: v: !(isAttrs v || (isList v && all isAttrs v))) attrs;

isImportantField =
n: _: foldl (acc: prev: if hasPrefix prev n then true else acc) false importantPrefixes;
Expand Down
2 changes: 1 addition & 1 deletion modules/lib/stdlib-extended.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
mkHmLib = import ./.;
in
nixpkgsLib.extend (
self: super: {
self: _super: {
hm = mkHmLib { lib = self; };
}
)
2 changes: 1 addition & 1 deletion modules/lib/strings.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion modules/misc/fontconfig.nix
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ in
};

xdg.configFile = lib.mapAttrs' (
name: config:
_name: config:
lib.nameValuePair "fontconfig/conf.d/${builtins.toString config.priority}-hm-${config.label}.conf" {
inherit (config) enable text;
source = lib.mkIf (config.source != null) config.source;
Expand Down
2 changes: 1 addition & 1 deletion modules/misc/news.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
4 changes: 2 additions & 2 deletions modules/misc/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
};
Expand Down Expand Up @@ -345,7 +345,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;
};
})

Expand Down
2 changes: 1 addition & 1 deletion modules/misc/nixpkgs-disabled.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ let
traceXIfNot = c: if c x then true else lib.traceSeqN 1 x false;
in
traceXIfNot isConfig;
merge = args: lib.fold (def: mergeConfig def.value) { };
merge = _args: lib.fold (def: mergeConfig def.value) { };
};

# Copied from nixpkgs.nix.
Expand Down
4 changes: 2 additions & 2 deletions modules/misc/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ let
traceXIfNot = c: if c x then true else lib.traceSeqN 1 x false;
in
traceXIfNot isConfig;
merge = args: lib.fold (def: mergeConfig def.value) { };
merge = _args: lib.fold (def: mergeConfig def.value) { };
};

overlayType = lib.mkOptionType {
Expand All @@ -53,7 +53,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
{
Expand Down
2 changes: 1 addition & 1 deletion modules/misc/qt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,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
Expand Down
2 changes: 1 addition & 1 deletion modules/misc/xdg-mime-apps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,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;
Expand Down
2 changes: 1 addition & 1 deletion modules/misc/xdg-user-dirs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ in
config =
let
directories =
(lib.filterAttrs (n: v: !isNull v) {
(lib.filterAttrs (_n: v: !isNull v) {
XDG_DESKTOP_DIR = cfg.desktop;
XDG_DOCUMENTS_DIR = cfg.documents;
XDG_DOWNLOAD_DIR = cfg.download;
Expand Down
7 changes: 3 additions & 4 deletions modules/programs/aerc/accounts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ in
};

mkAccount =
name: account:
_name: account:
let
nullOrMap = f: v: if v == null then v else f v;

Expand All @@ -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
Expand All @@ -188,7 +188,6 @@ in
userName,
imap,
passwordCommand,
aerc,
...
}@cfg:
let
Expand Down Expand Up @@ -242,7 +241,7 @@ in
}
// optPwCmd "outgoing" passwordCommand;

msmtp = cfg: {
msmtp = _cfg: {
outgoing = "msmtpq --read-envelope-from --read-recipients";
};

Expand Down
2 changes: 1 addition & 1 deletion modules/programs/alacritty.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion modules/programs/alot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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: x: submoduleToAttrs x) cfg.tags
lib.mapAttrs (_name: x: submoduleToAttrs x) cfg.tags
)
)
+ ''
Expand Down
4 changes: 2 additions & 2 deletions modules/programs/astroid/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/programs/borgmatic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions modules/programs/docker-cli.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ in
contexts = mkOption {
type = lib.types.attrsOf (
lib.types.submodule (
{ name, config, ... }:
{ name, ... }:
{
freeformType = jsonFormat.type;
options = {
Expand Down Expand Up @@ -96,7 +96,7 @@ in
};
}
// lib.mapAttrs' (
n: ctx:
_n: ctx:
let
path = "${cfg.configDir}/contexts/meta/${builtins.hashString "sha256" ctx.Name}/meta.json";
in
Expand Down
Loading