mirror of
https://github.com/hyprwm/hyprland-infra.git
synced 2025-05-12 21:30:36 +01:00
50 lines
1.2 KiB
Nix
50 lines
1.2 KiB
Nix
{self, ...}: let
|
|
inherit (self) inputs;
|
|
|
|
# TODO: move to standalone lib directory
|
|
mkSystem = inputs.nixpkgs.lib.nixosSystem;
|
|
|
|
# mkNixosSystem wraps mkSystem (a.k.a lib.nixosSystem) acts as a template for my nixos hosts with system type and modules
|
|
# being imported beforehand specialArgs is also defined here to avoid defining them for each host and lazily merged if the
|
|
# host defines any other args
|
|
mkNixosSystem = {
|
|
modules,
|
|
system,
|
|
hostname,
|
|
...
|
|
} @ args:
|
|
mkSystem {
|
|
modules =
|
|
[
|
|
{
|
|
networking.hostName = hostname;
|
|
nixpkgs.hostPlatform = system;
|
|
}
|
|
]
|
|
++ args.modules or [];
|
|
specialArgs = {inherit inputs self;} // args.specialArgs or {};
|
|
};
|
|
|
|
sharedModules = [
|
|
inputs.agenix.nixosModules.default
|
|
../modules/users.nix
|
|
];
|
|
in {
|
|
flake.nixosConfigurations = {
|
|
caesar = mkNixosSystem {
|
|
hostname = "caesar";
|
|
system = "x86_64-linux";
|
|
modules = builtins.concatLists [
|
|
[
|
|
./caesar
|
|
../modules/nix-daemon.nix
|
|
../modules/openssh.nix
|
|
../modules/firewall.nix
|
|
../modules/nginx.nix
|
|
]
|
|
|
|
sharedModules
|
|
];
|
|
};
|
|
};
|
|
}
|