flake
This commit is contained in:
parent
6f05c12683
commit
a2c8e91b3c
6 changed files with 784 additions and 5 deletions
43
flake.nix
43
flake.nix
|
|
@ -15,17 +15,50 @@
|
|||
sops-nix = {
|
||||
url = "github:Mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.nixpkgs-stable.follows = "nixpkgs-stable";
|
||||
};
|
||||
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
|
||||
stylix.url = "github:danth/stylix";
|
||||
|
||||
helix.url = "github:pascalkuthe/helix/inline-diagnostics";
|
||||
stylix = {
|
||||
url = "github:danth/stylix";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
flake-utils.follows = "flake-utils";
|
||||
home-manager.follows = "home-manager";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {} @ inputs: let
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
...
|
||||
} @ inputs: let
|
||||
inherit (nixpkgs) lib;
|
||||
|
||||
defaultConfig = {
|
||||
};
|
||||
|
||||
makeHost = host: let
|
||||
config = defaultConfig // import ./hosts/${host}/config.nix;
|
||||
in
|
||||
lib.nixosSystem {
|
||||
system = config.system;
|
||||
pkgs = import nixpkgs {system = config.system;};
|
||||
specialArgs = inputs;
|
||||
modules = [
|
||||
./hosts/${host}/default.nix
|
||||
./hosts/${host}/hardware-configuration.nix
|
||||
./system
|
||||
{networking.hostName = host;}
|
||||
];
|
||||
};
|
||||
in {
|
||||
nixosConfigurations = lib.pipe ./hosts [
|
||||
builtins.readDir
|
||||
(lib.filterAttrs (_: type: type == "directory"))
|
||||
(lib.filterAttrs (name: _: builtins.pathExists ./hosts/${name}/default.nix && builtins.pathExists ./hosts/${name}/hardware.nix && builtins.pathExists ./hosts/${name}/config.nix))
|
||||
(lib.mapAttrs (name: _: makeHost name))
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue