diff options
| author | andromeda <andromeda@lenovo> | 2025-12-30 13:47:08 +0100 |
|---|---|---|
| committer | andromeda <andromeda@lenovo> | 2025-12-30 13:47:08 +0100 |
| commit | e39747ae2e9f4032b234f1f8d9a399b240f66539 (patch) | |
| tree | c8859757d48bc012f3c2d0526f09aed2896797e7 /flake.nix | |
| parent | 9a089ea5090c72e363446b1576724edfbdb42c81 (diff) | |
andromeda: add agenix; machines: start to add box
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 46 |
1 files changed, 31 insertions, 15 deletions
@@ -1,5 +1,9 @@ { inputs = { + agenix = { + url = "github:ryantm/agenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -24,6 +28,7 @@ }; }; outputs = { + agenix, home-manager, impermanence, nixpkgs, @@ -34,27 +39,38 @@ ... }: let laptop = import ./machines/laptop/machine.nix; - in { - nixosConfigurations.${laptop.hostname} = nixpkgs.lib.nixosSystem { - system = laptop.system; - specialArgs = {machine = laptop;}; - modules = [ + _173-249-5-230 = import ./machines/173-249-5-230/machine.nix; + configuration = machine: modules: + nixpkgs.lib.nixosSystem { + system = machine.system; + specialArgs = {inherit machine;}; + modules = + modules + ++ [ + machine.configuration + machine.hardware-configuration + ]; + }; + configurationWithHomeManager = machine: (configuration machine + [ home-manager.nixosModules.home-manager { - nixpkgs.overlays = [nur.overlays.default]; + nixpkgs.overlays = [ + agenix.overlays.default + nur.overlays.default + ]; home-manager.useGlobalPkgs = true; - home-manager.extraSpecialArgs = { - machine = laptop; - }; + home-manager.extraSpecialArgs = {inherit machine;}; home-manager.users = builtins.mapAttrs (name: value: value) ( - nixpkgs.legacyPackages.${laptop.system}.lib.genAttrs - laptop.usernames + nixpkgs.legacyPackages.${machine.system}.lib.genAttrs + machine.usernames ( name: { imports = [ + agenix.homeManagerModules.default stylix.homeModules.stylix nvf.homeManagerModules.default ./users/${name}/home.nix @@ -65,9 +81,9 @@ } impermanence.nixosModules.impermanence noshell.nixosModules.default - ./configuration.nix - laptop.hardware-configuration - ]; - }; + ]); + in { + nixosConfigurations.${laptop.hostname} = configurationWithHomeManager laptop; + nixosConfigurations.${_173-249-5-230.hostname} = configurationWithHomeManager _173-249-5-230; }; } |
