From 662630321739fc61b2623fa76858fae543ff4696 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Mon, 6 May 2024 20:29:04 +0200 Subject: [PATCH] Use the self attribute directly --- flake.nix | 16 +++++++++++++--- modules/home/sops.nix | 3 ++- modules/system/sops.nix | 3 ++- users/common.nix | 11 +++++++++-- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index 80b0b8c..847c093 100644 --- a/flake.nix +++ b/flake.nix @@ -33,20 +33,30 @@ }; }; - outputs = {nixpkgs, ...} @ inputs: let + outputs = { + self, + nixpkgs, + ... + } @ inputs: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; in { nixosConfigurations = { north = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;}; + specialArgs = { + inherit self; + inherit inputs; + }; modules = [ ./hosts/north "${./.}/users/seb/@north.nix" ]; }; inspiron = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs;}; + specialArgs = { + inherit self; + inherit inputs; + }; modules = [ ./hosts/inspiron "${./.}/users/seb/@inspiron.nix" diff --git a/modules/home/sops.nix b/modules/home/sops.nix index 2d4f7ee..8d1bf3e 100644 --- a/modules/home/sops.nix +++ b/modules/home/sops.nix @@ -1,4 +1,5 @@ { + self, inputs, config, lib, @@ -11,7 +12,7 @@ config = lib.mkIf config.myConfig.sops.enable { sops = { age.sshKeyPaths = ["${config.home.homeDirectory}/.ssh/id_ed25519"]; - defaultSopsFile = "${inputs.self}/users/${config.home.username}/secrets.yaml"; + defaultSopsFile = "${self}/users/${config.home.username}/secrets.yaml"; }; }; } diff --git a/modules/system/sops.nix b/modules/system/sops.nix index 4f404ba..c81587b 100644 --- a/modules/system/sops.nix +++ b/modules/system/sops.nix @@ -1,4 +1,5 @@ { + self, inputs, config, lib, @@ -11,7 +12,7 @@ config = lib.mkIf config.myConfig.sops.enable { sops = { age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; - defaultSopsFile = "${inputs.self}/hosts/${config.networking.hostName}/secrets.yaml"; + defaultSopsFile = "${self}/hosts/${config.networking.hostName}/secrets.yaml"; }; }; } diff --git a/users/common.nix b/users/common.nix index bcf6f37..87b5aad 100644 --- a/users/common.nix +++ b/users/common.nix @@ -1,10 +1,17 @@ -{inputs, ...}: { +{ + self, + inputs, + ... +}: { imports = [inputs.home-manager.nixosModules.home-manager]; home-manager = { useGlobalPkgs = true; useUserPackages = true; - extraSpecialArgs = {inherit inputs;}; + extraSpecialArgs = { + inherit self; + inherit inputs; + }; }; home-manager.sharedModules = [