treewide: Drop usage of inherit (pkgs)

Having to change the package list in two places was a bit redundant. We
can also use `with` patterns now since nixd warns if there are escaping
variables being used.

Note that variables used in multiple places are kept to make it easier
to recognize that those variables must be changed together. Also note
that inherit (pkgs) inside of mkMerge are currently kept to reduce the
diff.
This commit is contained in:
Donovan Glover 2024-08-07 16:32:53 -04:00
parent b3f5c61625
commit 2297fb41e3
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
13 changed files with 17 additions and 43 deletions

View File

@ -10,7 +10,6 @@ let
inherit (nix-config.inputs.sakaya.packages.${pkgs.system}) sakaya; inherit (nix-config.inputs.sakaya.packages.${pkgs.system}) sakaya;
inherit (config.modules.system) username; inherit (config.modules.system) username;
inherit (lib) singleton getExe; inherit (lib) singleton getExe;
inherit (pkgs) su winetricks wineWowPackages;
sakayaPort = 39493; sakayaPort = 39493;
in in
@ -32,7 +31,7 @@ in
Type = "simple"; Type = "simple";
}; };
path = [ su ]; path = with pkgs; [ su ];
serviceConfig = { serviceConfig = {
ExecStart = "/usr/bin/env su ${username} --command=${getExe sakaya}"; ExecStart = "/usr/bin/env su ${username} --command=${getExe sakaya}";
@ -41,9 +40,10 @@ in
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
}; };
environment.systemPackages = [ environment.systemPackages = (with pkgs; [
wineWowPackages.waylandFull wineWowPackages.waylandFull
winetricks winetricks
]) ++ [
sakaya sakaya
]; ];

View File

@ -1,12 +1,9 @@
{ pkgs, ... }: { pkgs, ... }:
let
inherit (pkgs) ungoogled-chromium;
in
{ {
programs.chromium = { programs.chromium = {
enable = true; enable = true;
package = ungoogled-chromium; package = pkgs.ungoogled-chromium;
commandLineArgs = [ commandLineArgs = [
"--ozone-platform=wayland" "--ozone-platform=wayland"

View File

@ -3,7 +3,6 @@
let let
inherit (config.home) homeDirectory; inherit (config.home) homeDirectory;
inherit (config.lib.stylix.colors.withHashtag) base00 base05; inherit (config.lib.stylix.colors.withHashtag) base00 base05;
inherit (pkgs) eww;
inherit (config.xdg.userDirs) inherit (config.xdg.userDirs)
download download
@ -16,7 +15,7 @@ let
fluent-icons = pkgs.callPackage ../packages/fluent-icons.nix { }; fluent-icons = pkgs.callPackage ../packages/fluent-icons.nix { };
in in
{ {
home.packages = [ eww ]; home.packages = with pkgs; [ eww ];
xdg.configFile."eww/eww.yuck".text = # yuck xdg.configFile."eww/eww.yuck".text = # yuck
'' ''

View File

@ -1,10 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
let
inherit (pkgs) tig mgitstatus;
in
{ {
home.packages = [ home.packages = with pkgs; [
tig tig
mgitstatus mgitstatus
]; ];

View File

@ -1,8 +1,5 @@
{ pkgs, ... }: { pkgs, ... }:
let
inherit (pkgs) pinentry-curses;
in
{ {
programs.gpg = { programs.gpg = {
enable = true; enable = true;
@ -21,7 +18,7 @@ in
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
pinentryPackage = pinentry-curses; pinentryPackage = pkgs.pinentry-curses;
defaultCacheTtl = 43200; defaultCacheTtl = 43200;
maxCacheTtl = 43200; maxCacheTtl = 43200;
}; };

View File

@ -1,8 +1,5 @@
{ pkgs, ... }: { pkgs, ... }:
let
inherit (pkgs) fluent-icon-theme;
in
{ {
gtk = { gtk = {
enable = true; enable = true;
@ -17,7 +14,7 @@ in
}; };
iconTheme = { iconTheme = {
package = fluent-icon-theme; package = pkgs.fluent-icon-theme;
name = "Fluent-dark"; name = "Fluent-dark";
}; };
}; };

View File

@ -1,12 +1,9 @@
{ pkgs, ... }: { pkgs, ... }:
let
inherit (pkgs) htop-vim;
in
{ {
programs.htop = { programs.htop = {
enable = true; enable = true;
package = htop-vim; package = pkgs.htop-vim;
settings = { settings = {
tree_view = true; tree_view = true;

View File

@ -6,14 +6,13 @@
}: }:
let let
inherit (pkgs) polkit_gnome callPackage;
inherit (lib) mkForce; inherit (lib) mkForce;
inherit (vars) notifySend; inherit (vars) notifySend;
opacity = "0.95"; opacity = "0.95";
super = "SUPER"; super = "SUPER";
osu-backgrounds = callPackage ../packages/osu-backgrounds.nix { }; osu-backgrounds = pkgs.callPackage ../packages/osu-backgrounds.nix { };
gapsScript = "hypr/gaps.fish"; gapsScript = "hypr/gaps.fish";
randomBackgroundScript = "hypr/random-bg.fish"; randomBackgroundScript = "hypr/random-bg.fish";
@ -76,7 +75,7 @@ in
"fcitx5" "fcitx5"
"mpdris2-rs" "mpdris2-rs"
"hyprctl dispatch workspace 5000000" "hyprctl dispatch workspace 5000000"
"${polkit_gnome}/libexec/polkit-gnome-authentication-agent-1" "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
"hyprdim --no-dim-when-only --persist --ignore-leaving-special --dialog-dim" "hyprdim --no-dim-when-only --persist --ignore-leaving-special --dialog-dim"
"sleep 1 && eww open desktop-icons" "sleep 1 && eww open desktop-icons"
"~/.config/${randomBackgroundScript}" "~/.config/${randomBackgroundScript}"

View File

@ -7,7 +7,6 @@
let let
inherit (lib) singleton; inherit (lib) singleton;
inherit (pkgs) ironbar inotify-tools;
inherit (builtins) toJSON; inherit (builtins) toJSON;
inherit (config.lib.stylix.colors.withHashtag) inherit (config.lib.stylix.colors.withHashtag)
@ -23,7 +22,7 @@ let
volumeGet = "ironbar/volume-get.fish"; volumeGet = "ironbar/volume-get.fish";
in in
{ {
home.packages = [ ironbar ]; home.packages = with pkgs; [ ironbar ];
xdg.configFile = { xdg.configFile = {
"ironbar/config.json".text = toJSON { "ironbar/config.json".text = toJSON {
@ -249,7 +248,7 @@ in
get_mullvad_status get_mullvad_status
set initialized true set initialized true
${inotify-tools}/bin/inotifywait -q -e close_write,moved_to,create -m /etc/mullvad-vpn | ${pkgs.inotify-tools}/bin/inotifywait -q -e close_write,moved_to,create -m /etc/mullvad-vpn |
while read directory events filename while read directory events filename
get_mullvad_status get_mullvad_status
end end

View File

@ -1,13 +1,10 @@
{ pkgs, ... }: { pkgs, ... }:
let
inherit (pkgs) librewolf;
in
{ {
programs.librewolf = { programs.librewolf = {
enable = true; enable = true;
package = librewolf.override { cfg.speechSynthesisSupport = false; }; package = pkgs.librewolf.override { cfg.speechSynthesisSupport = false; };
settings = { settings = {
"middlemouse.paste" = false; "middlemouse.paste" = false;

View File

@ -1,8 +1,5 @@
{ pkgs, ... }: { pkgs, ... }:
let
inherit (pkgs.mpvScripts) mpris uosc thumbfast;
in
{ {
programs.mpv = { programs.mpv = {
enable = true; enable = true;
@ -38,7 +35,7 @@ in
"ctrl+a" = "script-message osc-visibility cycle"; "ctrl+a" = "script-message osc-visibility cycle";
}; };
scripts = [ scripts = with pkgs.mpvScripts; [
mpris mpris
uosc uosc
thumbfast thumbfast

View File

@ -6,7 +6,6 @@
}: }:
let let
inherit (pkgs) rofi-wayland;
inherit (lib) mkForce; inherit (lib) mkForce;
inherit (config.lib.formats.rasi) mkLiteral; inherit (config.lib.formats.rasi) mkLiteral;
inherit (config.lib.stylix.colors.withHashtag) base00 base05; inherit (config.lib.stylix.colors.withHashtag) base00 base05;
@ -16,7 +15,7 @@ in
enable = true; enable = true;
cycle = false; cycle = false;
package = rofi-wayland; package = pkgs.rofi-wayland;
extraConfig = { extraConfig = {
modi = "drun,filebrowser"; modi = "drun,filebrowser";

View File

@ -7,13 +7,12 @@
let let
inherit (config.modules.system) username; inherit (config.modules.system) username;
inherit (pkgs) xterm;
in in
{ {
services = { services = {
xserver = { xserver = {
enable = true; enable = true;
excludePackages = [ xterm ]; excludePackages = with pkgs; [ xterm ];
}; };
displayManager = { displayManager = {