49 lines
1.4 KiB
Nix
49 lines
1.4 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
nixos-generators = {
|
|
url = "github:nix-community/nixos-generators";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
systems.url = "github:nix-systems/default";
|
|
flake-utils = {
|
|
url = "github:numtide/flake-utils";
|
|
inputs.systems.follows = "systems";
|
|
};
|
|
sops-nix = {
|
|
url = "github:Mic92/sops-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs = { nixpkgs, nixos-generators, ... }@inputs:
|
|
inputs.flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
config.allowUnfree = true;
|
|
};
|
|
user = "admin";
|
|
self = inputs.self.packages.${system};
|
|
in
|
|
{
|
|
packages = {
|
|
nixosConfigurations = builtins.mapAttrs (name: modules:
|
|
nixpkgs.lib.nixosSystem {
|
|
specialArgs = { inherit inputs self user system; };
|
|
inherit system modules;
|
|
}
|
|
) self.nixosModules;
|
|
nixosModules = (builtins.mapAttrs (name: modules: [ ./configuration ./host/${name} ] ++ modules) {
|
|
server = [ ] ;
|
|
});
|
|
image = nixos-generators.nixosGenerate {
|
|
system = "x86_64-linux";
|
|
format = "qcow-efi";
|
|
specialArgs = { inherit inputs self user system; };
|
|
modules = self.nixosModules.server;
|
|
};
|
|
};
|
|
});
|
|
}
|