initial commit
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
{
|
||||
description = "NixOS server base system configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
agenix.url = "github:ryantm/agenix";
|
||||
|
||||
disko = {
|
||||
url = "github:nix-community/disko";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
agenix,
|
||||
disko,
|
||||
} @ inputs: let
|
||||
system = "x86_64-linux";
|
||||
|
||||
# hostnames
|
||||
# hosts = ["s1901" "s1902" "s1903" "s1904" "s1905" "s1906" ];
|
||||
hosts = ["s1901"];
|
||||
|
||||
baseModule = {lib, ...}: {
|
||||
imports = [
|
||||
home-manager.nixosModules.default
|
||||
agenix.nixosModules.default
|
||||
disko.nixosModules.disko
|
||||
];
|
||||
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
|
||||
environment.systemPackages = [
|
||||
agenix.packages.${system}.default
|
||||
];
|
||||
};
|
||||
|
||||
mkHost = name: {
|
||||
name = name;
|
||||
value = nixpkgs.lib.nixosSystem {
|
||||
modules = [
|
||||
baseModule
|
||||
./hosts/${name}/configuration.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
in {
|
||||
nixosConfigurations = builtins.listToAttrs (map mkHost hosts);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user