flake: move nixosConfigurations setup to hosts/

This commit is contained in:
NotAShelf 2024-08-18 15:29:08 +03:00
parent 824e09de21
commit f7e3a9bff6
No known key found for this signature in database
GPG key ID: AF26552424E53993
2 changed files with 25 additions and 24 deletions

View file

@ -5,26 +5,17 @@
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
agenix.url = "github:ryantm/agenix";
typhon.url = "github:typhon-ci/typhon";
};
outputs = {
self,
flake-parts,
...
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
outputs = inputs:
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux"];
imports = [./hosts];
perSystem = {pkgs, ...}: {
devShells.default = pkgs.mkShell {
buildInputs = [pkgs.alejandra];
};
};
flake = {
nixosConfigurations = import ./hosts {inherit self;};
};
};
}

View file

@ -14,8 +14,14 @@
...
} @ args:
mkSystem {
inherit system;
modules = [{networking.hostName = hostname;}] ++ args.modules or [];
modules =
[
{
networking.hostName = hostname;
nixpkgs.hostPlatform = system;
}
]
++ args.modules or [];
specialArgs = {inherit inputs self;} // args.specialArgs or {};
};
@ -23,15 +29,19 @@
inputs.agenix.nixosModules.default
];
in {
caesar = mkNixosSystem {
hostname = "caesar";
system = "x86_64-linux";
modules =
[
./caesar
../modules/nix-daemon.nix
../modules/openssh.nix
]
++ sharedModules;
flake.nixosConfigurations = {
caesar = mkNixosSystem {
hostname = "caesar";
system = "x86_64-linux";
modules = builtins.concatLists [
[
./caesar
../modules/nix-daemon.nix
../modules/openssh.nix
]
[sharedModules]
];
};
};
}