From f113c763ea430e0a94faf21e5d628d22084da2db Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Sun, 1 Sep 2024 18:07:43 -0400 Subject: [PATCH] treewide: Drop remaining usage of inherit (pkgs) --- example/configuration.nix | 16 +++++++++++----- hosts/phone/configuration.nix | 18 +++++++----------- modules/desktop.nix | 21 +++++++-------------- modules/hardware.nix | 17 ++++++++++------- modules/shell.nix | 9 ++++----- 5 files changed, 39 insertions(+), 42 deletions(-) diff --git a/example/configuration.nix b/example/configuration.nix index d80aa072..118937ca 100644 --- a/example/configuration.nix +++ b/example/configuration.nix @@ -6,7 +6,7 @@ }: let - inherit (lib) singleton; + inherit (lib) singleton mkMerge; inherit (builtins) attrValues; in { @@ -24,10 +24,16 @@ in programs.btop.enable = true; }; - environment.systemPackages = attrValues { - inherit (nix-config.packages.${pkgs.system}) webp-thumbnailer; - inherit (pkgs) ruby php; - }; + environment.systemPackages = mkMerge [ + (with pkgs; [ + ruby + php + ]) + + (with nix-config.packages.${pkgs.system}; [ + webp-thumbnailer + ]) + ]; nixpkgs.overlays = attrValues nix-config.overlays ++ [ (final: prev: { diff --git a/hosts/phone/configuration.nix b/hosts/phone/configuration.nix index c4cf32a1..08b71820 100644 --- a/hosts/phone/configuration.nix +++ b/hosts/phone/configuration.nix @@ -200,17 +200,13 @@ in LIBGL_ALWAYS_SOFTWARE = "true"; }; - systemPackages = attrValues { - inherit (self.packages.${pkgs.system}) webp-thumbnailer; - - inherit (pkgs) - chatty - megapixels - livi - gnome-contacts - eog - ; - }; + systemPackages = with pkgs; [ + chatty + megapixels + livi + gnome-contacts + eog + ]; }; nixpkgs.config.permittedInsecurePackages = [ diff --git a/modules/desktop.nix b/modules/desktop.nix index 7bd42ca5..c6e4a305 100644 --- a/modules/desktop.nix +++ b/modules/desktop.nix @@ -26,13 +26,6 @@ let fontSize ; - inherit (pkgs) - phinger-cursors - noto-fonts-cjk-sans - maple-mono - noto-fonts-emoji - ; - stylix-background = nix-config.packages.${pkgs.system}.stylix-background.override { color = config.lib.stylix.colors.base00; }; @@ -179,14 +172,14 @@ in packages = [ - noto-fonts-cjk-sans - noto-fonts-emoji - maple-mono aleo-fonts ] ++ (with pkgs; [ noto-fonts noto-fonts-cjk-serif + noto-fonts-cjk-sans + noto-fonts-emoji + maple-mono font-awesome (nerdfonts.override { fonts = [ "Noto" ]; }) kanji-stroke-order-font @@ -251,7 +244,7 @@ in }; cursor = { - package = phinger-cursors; + package = pkgs.phinger-cursors; name = "phinger-cursors"; size = 24; }; @@ -263,17 +256,17 @@ in }; sansSerif = { - package = noto-fonts-cjk-sans; + package = pkgs.noto-fonts-cjk-sans; name = "Noto Sans CJK JP"; }; monospace = { - package = maple-mono; + package = pkgs.maple-mono; name = "Maple Mono"; }; emoji = { - package = noto-fonts-emoji; + package = pkgs.noto-fonts-emoji; name = "Noto Color Emoji"; }; diff --git a/modules/hardware.nix b/modules/hardware.nix index cbcdc8e2..aa770d04 100644 --- a/modules/hardware.nix +++ b/modules/hardware.nix @@ -6,8 +6,6 @@ }: let - inherit (pkgs) piper interception-tools; - inherit (pkgs.interception-tools-plugins) dual-function-keys; inherit (builtins) toJSON; inherit (lib) @@ -50,14 +48,17 @@ in interception-tools = { enable = mkIf keyboardBinds true; - plugins = [ dual-function-keys ]; + + plugins = with pkgs.interception-tools-plugins; [ + dual-function-keys + ]; udevmonConfig = toJSON (singleton { JOB = # bash '' - ${interception-tools}/bin/intercept -g $DEVNODE | - ${getExe dual-function-keys} -c /etc/${dualFunctionKeysConfig} | - ${interception-tools}/bin/uinput -d $DEVNODE + ${pkgs.interception-tools}/bin/intercept -g $DEVNODE | + ${getExe pkgs.interception-tools-plugins.dual-function-keys} -c /etc/${dualFunctionKeysConfig} | + ${pkgs.interception-tools}/bin/uinput -d $DEVNODE ''; DEVICE = { @@ -73,7 +74,9 @@ in }; environment = { - systemPackages = mkIf mouseSettings [ piper ]; + systemPackages = mkIf mouseSettings (with pkgs; [ + piper + ]); etc.${dualFunctionKeysConfig}.text = toJSON { TIMING = [ diff --git a/modules/shell.nix b/modules/shell.nix index f9bd012b..c83d231c 100644 --- a/modules/shell.nix +++ b/modules/shell.nix @@ -1,13 +1,12 @@ { pkgs, ... }: -let - inherit (pkgs) fish; -in { - users.defaultUserShell = fish; + users.defaultUserShell = pkgs.fish; environment = { - shells = [ fish ]; + shells = with pkgs; [ + fish + ]; systemPackages = with pkgs; [ jq