From 2f67b084d2674643425c69dab57bbb49a9e5ad3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Wed, 5 Jun 2024 01:18:48 -0300 Subject: [PATCH] treewide: remove variables from pkgs --- overlays/default.nix | 3 --- scripts/wdmenu.nix | 10 +--------- scripts/wfile-picker.nix | 2 +- scripts/wlauncher.nix | 10 +--------- settings/default.nix | 6 ++++++ system/boot.nix | 2 +- system/configuration.nix | 3 +++ system/greetd.nix | 2 +- user/alacritty.nix | 2 +- user/bmenu.nix | 2 +- user/firefox.nix | 2 +- user/fish/default.nix | 10 +--------- user/fzf.nix | 2 +- user/git.nix | 2 +- user/gnome.nix | 3 ++- user/helix.nix | 9 +++++++-- user/home.nix | 3 +++ user/hyprland.nix | 2 +- user/kakoune/default.nix | 2 +- user/man.nix | 2 +- user/mangohud.nix | 2 +- user/mimeapps.nix | 2 +- user/mpd.nix | 2 +- user/pqiv.nix | 2 +- user/rofi.nix | 2 +- user/ssh.nix | 2 +- user/sway/default.nix | 4 ++-- user/sway/kanshi.nix | 2 +- user/sway/mako.nix | 2 +- user/sway/sway-assigns.nix | 2 +- user/sway/sway-binds.nix | 2 +- user/sway/sway-modes.nix | 2 +- user/sway/swayidle.nix | 2 +- user/sway/swaylock.nix | 2 +- user/sway/theme.nix | 2 +- user/vdir.nix | 9 +++++++-- user/waybar/default.nix | 2 +- user/zathura.nix | 2 +- 38 files changed, 60 insertions(+), 64 deletions(-) create mode 100644 settings/default.nix diff --git a/overlays/default.nix b/overlays/default.nix index 14257ba..8d4046b 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -6,7 +6,6 @@ rec { themes new-packages patches - variables lib_extended ]; @@ -80,8 +79,6 @@ rec { } ); - variables = (final: prev: { uservars = import ../user/variables.nix; }); - lib_extended = ( final: prev: { lib = prev.lib // rec { diff --git a/scripts/wdmenu.nix b/scripts/wdmenu.nix index 85fb6fc..3505781 100644 --- a/scripts/wdmenu.nix +++ b/scripts/wdmenu.nix @@ -1,12 +1,4 @@ { pkgs, ... }: -let - inherit (pkgs.uservars) dmenu; - available_menus = { - bmenu = "bmenu"; - rofi = "rofi -dmenu -sort"; - }; - menu_cmd = available_menus.${dmenu}; -in pkgs.writeShellScriptBin "wdmenu" '' - exec ${menu_cmd} "$@" + exec bmenu "$@" '' diff --git a/scripts/wfile-picker.nix b/scripts/wfile-picker.nix index eb68752..d8ced8a 100644 --- a/scripts/wfile-picker.nix +++ b/scripts/wfile-picker.nix @@ -1,6 +1,6 @@ { pkgs, ... }: let - inherit (pkgs.uservars) dmenu; + inherit (config.my) dmenu; available_menus = { bmenu = "bmenu run"; rofi = "rofi -show drun -sort"; diff --git a/scripts/wlauncher.nix b/scripts/wlauncher.nix index eb68752..d2c2dec 100644 --- a/scripts/wlauncher.nix +++ b/scripts/wlauncher.nix @@ -1,12 +1,4 @@ { pkgs, ... }: -let - inherit (pkgs.uservars) dmenu; - available_menus = { - bmenu = "bmenu run"; - rofi = "rofi -show drun -sort"; - }; - menu_cmd = available_menus.${dmenu}; -in pkgs.writeShellScriptBin "wlauncher" '' - exec ${menu_cmd} "$@" + exec bmenu run "$@" '' diff --git a/settings/default.nix b/settings/default.nix new file mode 100644 index 0000000..2a2ca08 --- /dev/null +++ b/settings/default.nix @@ -0,0 +1,6 @@ +{ lib, ... }: +{ + options = { + my = lib.mkOption { }; + }; +} diff --git a/system/boot.nix b/system/boot.nix index 81d838e..fa1ed8d 100644 --- a/system/boot.nix +++ b/system/boot.nix @@ -43,7 +43,7 @@ }; plymouth = { enable = true; - theme = lib.mkIf (pkgs.uservars.desktop == "sway") "red_loader"; + theme = lib.mkIf (config.my.desktop == "sway") "red_loader"; themePackages = with pkgs; [ (adi1090x-plymouth-themes.override { selected_themes = [ "red_loader" ]; }) ]; diff --git a/system/configuration.nix b/system/configuration.nix index e00ff47..6661e40 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -22,8 +22,11 @@ ./users.nix ./containers.nix ./network.nix + ../settings ]; + my = import ../user/variables.nix; + zramSwap.enable = true; programs.adb.enable = true; diff --git a/system/greetd.nix b/system/greetd.nix index 68f0cf8..b152c72 100644 --- a/system/greetd.nix +++ b/system/greetd.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font diff --git a/user/alacritty.nix b/user/alacritty.nix index ae2e2fb..91b98c0 100644 --- a/user/alacritty.nix +++ b/user/alacritty.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme accent diff --git a/user/bmenu.nix b/user/bmenu.nix index 38c36c6..1543dcf 100644 --- a/user/bmenu.nix +++ b/user/bmenu.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme accent diff --git a/user/firefox.nix b/user/firefox.nix index 4c442e3..207ebb6 100644 --- a/user/firefox.nix +++ b/user/firefox.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) desktop browser; + inherit (config.my) desktop browser; bugfixedFirefox = pkgs.firefox-esr-unwrapped // { requireSigning = false; allowAddonSideload = true; diff --git a/user/fish/default.nix b/user/fish/default.nix index 07ba4c2..aef7fd5 100644 --- a/user/fish/default.nix +++ b/user/fish/default.nix @@ -5,15 +5,7 @@ ... }: let - inherit (pkgs.uservars) - key - theme - color - accent - font - editor - desktop - ; + inherit (config.my) accent editor desktop; in { config = { diff --git a/user/fzf.nix b/user/fzf.nix index a4113fa..df16adb 100644 --- a/user/fzf.nix +++ b/user/fzf.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme accent diff --git a/user/git.nix b/user/git.nix index f50a249..94532f3 100644 --- a/user/git.nix +++ b/user/git.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) username mail; + inherit (config.my) username mail; in { config = { diff --git a/user/gnome.nix b/user/gnome.nix index d7282dc..53dd630 100644 --- a/user/gnome.nix +++ b/user/gnome.nix @@ -2,9 +2,10 @@ pkgs, lib, inputs, + config, ... }: -lib.mkIf (pkgs.uservars.desktop == "gnome") { +lib.mkIf (config.my.desktop == "gnome") { home.pointerCursor = { name = "Adwaita"; diff --git a/user/helix.nix b/user/helix.nix index 292cfb0..b711055 100644 --- a/user/helix.nix +++ b/user/helix.nix @@ -1,6 +1,11 @@ -{ pkgs, lib, ... }: +{ + pkgs, + lib, + config, + ... +}: let - inherit (pkgs.uservars) accent theme editor; + inherit (config.my) accent theme editor; inherit (theme) color; in { diff --git a/user/home.nix b/user/home.nix index 8453572..e482406 100644 --- a/user/home.nix +++ b/user/home.nix @@ -44,8 +44,11 @@ ./xdg-dirs.nix inputs.hyprland.homeManagerModules.default inputs.nix-index-database.hmModules.nix-index + ../settings ]; + my = import ./variables.nix; + # Home Manager needs a bit of information about you and the # paths it should manage. home.username = "lelgenio"; diff --git a/user/hyprland.nix b/user/hyprland.nix index e1a632b..721e14b 100644 --- a/user/hyprland.nix +++ b/user/hyprland.nix @@ -5,7 +5,7 @@ ... }: { - config = lib.mkIf (pkgs.uservars.desktop == "hyprland") { + config = lib.mkIf (config.my.desktop == "hyprland") { wayland.windowManager.hyprland = { enable = false; extraConfig = '' diff --git a/user/kakoune/default.nix b/user/kakoune/default.nix index 091fe1b..ebb17f5 100644 --- a/user/kakoune/default.nix +++ b/user/kakoune/default.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key dmenu editor diff --git a/user/man.nix b/user/man.nix index c77607e..cc56089 100644 --- a/user/man.nix +++ b/user/man.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme color diff --git a/user/mangohud.nix b/user/mangohud.nix index f43564f..440b750 100644 --- a/user/mangohud.nix +++ b/user/mangohud.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme color diff --git a/user/mimeapps.nix b/user/mimeapps.nix index ff39ea4..a5ddae6 100644 --- a/user/mimeapps.nix +++ b/user/mimeapps.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) browser; + inherit (config.my) browser; cfg = config.xdg.defaultApplications; in { diff --git a/user/mpd.nix b/user/mpd.nix index 8a4c155..f4cca16 100644 --- a/user/mpd.nix +++ b/user/mpd.nix @@ -5,7 +5,7 @@ ... }: { - config = lib.mkIf (pkgs.uservars.desktop != "gnome") { + config = lib.mkIf (config.my.desktop != "gnome") { services.mpd = { enable = true; musicDirectory = config.home.homeDirectory + "/Música"; diff --git a/user/pqiv.nix b/user/pqiv.nix index 10e6c3d..70cf9de 100644 --- a/user/pqiv.nix +++ b/user/pqiv.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme color diff --git a/user/rofi.nix b/user/rofi.nix index 79307eb..c24a0ce 100644 --- a/user/rofi.nix +++ b/user/rofi.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme accent diff --git a/user/ssh.nix b/user/ssh.nix index 3193876..60649ba 100644 --- a/user/ssh.nix +++ b/user/ssh.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) username mail; + inherit (config.my) username mail; in { config = { diff --git a/user/sway/default.nix b/user/sway/default.nix index 570a25b..d98b0d7 100644 --- a/user/sway/default.nix +++ b/user/sway/default.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font @@ -24,7 +24,7 @@ in ./swaylock.nix ./theme.nix ]; - config = lib.mkIf (pkgs.uservars.desktop == "sway") { + config = lib.mkIf (config.my.desktop == "sway") { services.mako.enable = true; services.swayidle.enable = true; services.kanshi.enable = true; diff --git a/user/sway/kanshi.nix b/user/sway/kanshi.nix index f35fd4f..c0a584b 100644 --- a/user/sway/kanshi.nix +++ b/user/sway/kanshi.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font diff --git a/user/sway/mako.nix b/user/sway/mako.nix index c8575ab..4f43734 100644 --- a/user/sway/mako.nix +++ b/user/sway/mako.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font diff --git a/user/sway/sway-assigns.nix b/user/sway/sway-assigns.nix index 5ad5473..3822a22 100644 --- a/user/sway/sway-assigns.nix +++ b/user/sway/sway-assigns.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: let in -# inherit (pkgs.uservars) key accent font theme; +# inherit (config.my) key accent font theme; # inherit (theme) color; # inherit (pkgs) lib; # mod = "Mod4"; diff --git a/user/sway/sway-binds.nix b/user/sway/sway-binds.nix index fe22594..543de59 100644 --- a/user/sway/sway-binds.nix +++ b/user/sway/sway-binds.nix @@ -1,6 +1,6 @@ { config, pkgs, ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font diff --git a/user/sway/sway-modes.nix b/user/sway/sway-modes.nix index ea75ca8..cc3efff 100644 --- a/user/sway/sway-modes.nix +++ b/user/sway/sway-modes.nix @@ -1,6 +1,6 @@ { config, pkgs, ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font diff --git a/user/sway/swayidle.nix b/user/sway/swayidle.nix index b0bd455..2c5384f 100644 --- a/user/sway/swayidle.nix +++ b/user/sway/swayidle.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font diff --git a/user/sway/swaylock.nix b/user/sway/swaylock.nix index eb6104e..e46b5d9 100644 --- a/user/sway/swaylock.nix +++ b/user/sway/swaylock.nix @@ -5,7 +5,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font diff --git a/user/sway/theme.nix b/user/sway/theme.nix index 202eaff..ca4ea76 100644 --- a/user/sway/theme.nix +++ b/user/sway/theme.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) theme font desktop; + inherit (config.my) theme font desktop; inherit (theme) color gtk_theme diff --git a/user/vdir.nix b/user/vdir.nix index 80e6145..02aa2b6 100644 --- a/user/vdir.nix +++ b/user/vdir.nix @@ -1,6 +1,11 @@ -{ pkgs, lib, ... }: +{ + pkgs, + lib, + config, + ... +}: let - inherit (pkgs.uservars) nextcloud; + inherit (config.my) nextcloud; pass_cmd = ( pkgs.writeShellScript "get_pass" '' pass "${nextcloud.pass}" | head -n1 diff --git a/user/waybar/default.nix b/user/waybar/default.nix index 5113808..d2dc661 100644 --- a/user/waybar/default.nix +++ b/user/waybar/default.nix @@ -7,7 +7,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key theme accent diff --git a/user/zathura.nix b/user/zathura.nix index ccb4c42..70e1c23 100644 --- a/user/zathura.nix +++ b/user/zathura.nix @@ -6,7 +6,7 @@ ... }: let - inherit (pkgs.uservars) + inherit (config.my) key accent font