From f5ce6d6493d7bc25972dc15c868dd897db075ab5 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sun, 12 Jan 2025 13:34:02 -0800 Subject: [PATCH] refactor: pkgs. -> config.programs..package --- modules/darwin/programs/fish/default.nix | 9 +++------ modules/home/options/apps/default.nix | 8 ++++---- modules/home/programs/pidgin/default.nix | 21 +++++++++++---------- modules/home/programs/wofi/default.nix | 3 +-- modules/home/wayland/hyprland/default.nix | 2 +- modules/nixos/programs/fish/default.nix | 3 +-- systems/aarch64-darwin/mairley/default.nix | 12 +++++------- 7 files changed, 26 insertions(+), 32 deletions(-) diff --git a/modules/darwin/programs/fish/default.nix b/modules/darwin/programs/fish/default.nix index c441fe0..f8a88c8 100644 --- a/modules/darwin/programs/fish/default.nix +++ b/modules/darwin/programs/fish/default.nix @@ -1,15 +1,12 @@ { lib, config, - pkgs, ... -}: -let +}: let inherit (lib) mkIf mkEnableOption; cfg = config.marleyos.programs.fish; -in -{ +in { options.marleyos.programs.fish.enable = mkEnableOption "fish"; config = mkIf cfg.enable { @@ -19,6 +16,6 @@ in useBabelfish = true; }; - environment.shells = [ pkgs.fish ]; + environment.shells = [config.programs.fish.package]; }; } diff --git a/modules/home/options/apps/default.nix b/modules/home/options/apps/default.nix index 9737b70..bffc470 100644 --- a/modules/home/options/apps/default.nix +++ b/modules/home/options/apps/default.nix @@ -27,13 +27,13 @@ in { terminal = lib.mkOption { type = lib.types.package; - default = pkgs.wezterm; + default = config.programs.wezterm.package; description = "The terminal emulator to use."; }; browser = lib.mkOption { type = lib.types.package; - default = pkgs.floorp; + default = config.programs.floorp.package; description = "The browser to use."; }; @@ -44,8 +44,8 @@ in { type = lib.types.package; default = if config.marleyos.wayland.hyprland.enable - then pkgs.wofi - else pkgs.rofi; + then config.programs.wofi.package + else config.programs.rofi.package; description = "The launcher to use."; }; command = lib.mkOption { diff --git a/modules/home/programs/pidgin/default.nix b/modules/home/programs/pidgin/default.nix index 9fa84ff..0bf3aa1 100644 --- a/modules/home/programs/pidgin/default.nix +++ b/modules/home/programs/pidgin/default.nix @@ -3,16 +3,12 @@ config, pkgs, ... -}: -let - inherit (lib) mkEnableOption mkIf getExe; - +}: let cfg = config.marleyos.programs.pidgin; -in -{ - options.marleyos.programs.pidgin.enable = mkEnableOption "pidgin"; +in { + options.marleyos.programs.pidgin.enable = lib.mkEnableOption "pidgin"; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { programs.pidgin = { enable = true; @@ -27,9 +23,14 @@ in ".purple/themes/hearty".source = ./hearty; }; - xsession.initExtra = # sh + xsession.initExtra = + # sh '' - ${getExe pkgs.pidgin} & + ${lib.getExe config.programs.pidgin.package} & ''; + + wayland.windowManager.hyprland.settings.exec-once = [ + (lib.getExe config.programs.pidgin.package) + ]; }; } diff --git a/modules/home/programs/wofi/default.nix b/modules/home/programs/wofi/default.nix index 598816f..8e198b1 100644 --- a/modules/home/programs/wofi/default.nix +++ b/modules/home/programs/wofi/default.nix @@ -1,7 +1,6 @@ { lib, config, - pkgs, ... }: let inherit (lib) mkEnableOption mkIf; @@ -12,7 +11,7 @@ in { config = mkIf cfg.enable { marleyos.apps.launcher = { - package = pkgs.wofi; + inherit (config.programs.wofi) package; command = "--show drun"; }; diff --git a/modules/home/wayland/hyprland/default.nix b/modules/home/wayland/hyprland/default.nix index a638abe..8d13e3f 100644 --- a/modules/home/wayland/hyprland/default.nix +++ b/modules/home/wayland/hyprland/default.nix @@ -123,7 +123,7 @@ in { then wsPerMonitor + 1 else 2; in [ - (lib.getExe pkgs.waybar) + (lib.getExe config.programs.waybar.package) "[workspace 1 silent] $terminal" "[workspace ${toString browserWs} silent] $browser" ]; diff --git a/modules/nixos/programs/fish/default.nix b/modules/nixos/programs/fish/default.nix index c68ce89..ce48bfd 100644 --- a/modules/nixos/programs/fish/default.nix +++ b/modules/nixos/programs/fish/default.nix @@ -1,7 +1,6 @@ { lib, config, - pkgs, ... }: let inherit (lib) mkEnableOption mkIf; @@ -16,6 +15,6 @@ in { useBabelfish = true; }; - users.defaultUserShell = pkgs.fish; + users.defaultUserShell = config.programs.fish.package; }; } diff --git a/systems/aarch64-darwin/mairley/default.nix b/systems/aarch64-darwin/mairley/default.nix index f4a7b58..c9a44e3 100644 --- a/systems/aarch64-darwin/mairley/default.nix +++ b/systems/aarch64-darwin/mairley/default.nix @@ -1,12 +1,10 @@ { lib, - pkgs, + config, ... -}: -let +}: let inherit (lib.marleyos) enabled; -in -{ +in { networking = { computerName = "mairley"; hostName = "mairley"; @@ -24,12 +22,12 @@ in }; users = { - knownUsers = [ "marley" ]; + knownUsers = ["marley"]; users."marley" = { # This is required for some reason. uid = 501; - shell = pkgs.fish; + shell = config.programs.fish.package; }; };