65 lines
1.6 KiB
Nix
65 lines
1.6 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
hyprland.url = "github:hyprwm/Hyprland";
|
|
agenix.url = "github:ryantm/agenix";
|
|
|
|
hjem = {
|
|
url = "github:feel-co/hjem";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
hjem-rum = {
|
|
url = "github:snugnug/hjem-rum";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
inputs.hjem.follows = "hjem";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
...
|
|
}@inputs:
|
|
let
|
|
system = "x86_64-linux";
|
|
username = "poslop";
|
|
lib = nixpkgs.lib;
|
|
|
|
# mkHost <hostname> <role list>
|
|
# roles resolve to ./roles/<name>.nix; list entries may also be
|
|
# inline attrsets or paths, which load after (and override) roles.
|
|
# hosts/<host>/custom.nix, if present, always loads last.
|
|
mkHost =
|
|
name: roles:
|
|
nixpkgs.lib.nixosSystem {
|
|
modules =
|
|
[ { nixpkgs.hostPlatform = system; } ]
|
|
++ [ ./hosts/${name}/configuration.nix ]
|
|
++ map (
|
|
role:
|
|
if builtins.isString role then ./roles/${role}.nix else role
|
|
) roles
|
|
++ lib.optional (builtins.pathExists ./hosts/${name}/custom.nix)
|
|
./hosts/${name}/custom.nix;
|
|
specialArgs = {
|
|
inherit
|
|
self
|
|
inputs
|
|
username
|
|
;
|
|
host = name;
|
|
};
|
|
};
|
|
in
|
|
{
|
|
nixosConfigurations = {
|
|
nixos-vm2 = mkHost "nixos-vm2" [ "core" ];
|
|
qemu-vm = mkHost "qemu-vm" [ "core" ];
|
|
goyplex-vm = mkHost "goyplex-vm" [ "k3s-server" ];
|
|
};
|
|
};
|
|
}
|