From 1493257c5162dc0f80dffc78d0e0ac06cdc2128c Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Mon, 15 Jul 2024 21:53:54 +0200 Subject: [PATCH] create and move everything to the agenix module --- hosts/chmura/configuration.nix | 1 + hosts/default.nix | 3 --- hosts/del/configuration.nix | 1 + hosts/del/programs.nix | 2 -- hosts/niks/configuration.nix | 1 + hosts/niks/programs.nix | 2 -- modules/cli/agenix.nix | 27 +++++++++++++++++++++++++++ modules/cli/default.nix | 1 + 8 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 modules/cli/agenix.nix diff --git a/hosts/chmura/configuration.nix b/hosts/chmura/configuration.nix index ed46c35..d032ed1 100644 --- a/hosts/chmura/configuration.nix +++ b/hosts/chmura/configuration.nix @@ -47,6 +47,7 @@ in { myOptions = { other.home-manager.enable = true; programs = { + agenix.enable = true; git = { enable = true; defaultBranch = "master"; diff --git a/hosts/default.nix b/hosts/default.nix index 16561ec..ee6b031 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -13,7 +13,6 @@ in { modules = [ ./niks ../modules - inputs.agenix.nixosModules.default ]; }; @@ -25,7 +24,6 @@ in { modules = [ ./del ../modules - inputs.agenix.nixosModules.default ]; }; @@ -48,7 +46,6 @@ in { modules = [ ./chmura ../modules - inputs.agenix.nixosModules.default ]; }; } diff --git a/hosts/del/configuration.nix b/hosts/del/configuration.nix index 4f0839d..7499b0b 100644 --- a/hosts/del/configuration.nix +++ b/hosts/del/configuration.nix @@ -140,6 +140,7 @@ in { enableDirenv = true; }; programs = { + agenix.enable = true; nh = let inherit (config.myOptions.other.system) username; home = config.home-manager.users.${username}.home.homeDirectory; diff --git a/hosts/del/programs.nix b/hosts/del/programs.nix index e1dc433..f0a2258 100644 --- a/hosts/del/programs.nix +++ b/hosts/del/programs.nix @@ -12,7 +12,6 @@ in { shadower = inputs.shadower.packages.${pkgs.system}; fenix = inputs.fenix.packages.${pkgs.system}; nixpkgs-wayland = inputs.nixpkgs-wayland.packages.${pkgs.system}; - agenix = inputs.agenix.packages.${pkgs.system}; in with pkgs; [ librewolf-wayland keepassxc @@ -128,7 +127,6 @@ in { tree ydotool piper - agenix.default exiv2 krita gamescope diff --git a/hosts/niks/configuration.nix b/hosts/niks/configuration.nix index 991a6e2..3bd023c 100644 --- a/hosts/niks/configuration.nix +++ b/hosts/niks/configuration.nix @@ -76,6 +76,7 @@ in { enableDirenv = true; }; programs = { + agenix.enable = true; nh = let inherit (config.myOptions.other.system) username; home = config.home-manager.users.${username}.home.homeDirectory; diff --git a/hosts/niks/programs.nix b/hosts/niks/programs.nix index 3c630e5..993c625 100644 --- a/hosts/niks/programs.nix +++ b/hosts/niks/programs.nix @@ -12,7 +12,6 @@ in { shadower = inputs.shadower.packages.${pkgs.system}; fenix = inputs.fenix.packages.${pkgs.system}; nixpkgs-wayland = inputs.nixpkgs-wayland.packages.${pkgs.system}; - agenix = inputs.agenix.packages.${pkgs.system}; in with pkgs; [ librewolf-wayland keepassxc @@ -128,7 +127,6 @@ in { tree ydotool piper - agenix.default exiv2 krita gamescope diff --git a/modules/cli/agenix.nix b/modules/cli/agenix.nix new file mode 100644 index 0000000..28a969b --- /dev/null +++ b/modules/cli/agenix.nix @@ -0,0 +1,27 @@ +{ + config, + inputs, + lib, + pkgs, + ... +}: let + cfg = config.myOptions.programs.agenix; + + inherit (config.myOptions.other.system) username; + + inherit (lib) mkEnableOption mkIf; +in { + options.myOptions.programs.agenix = { + enable = mkEnableOption "agenix"; + }; + + imports = [ inputs.agenix.nixosModules.default ]; + + config = mkIf cfg.enable { + home-manager.users.${username} = { + home.packages = [ + inputs.agenix.packages.${pkgs.system}.default + ]; + }; + }; +} diff --git a/modules/cli/default.nix b/modules/cli/default.nix index b681026..66e7be8 100644 --- a/modules/cli/default.nix +++ b/modules/cli/default.nix @@ -1,5 +1,6 @@ _: { imports = [ + ./agenix.nix ./git.nix ./nh.nix ./starship.nix