2023-05-29 15:20:49 +02:00
|
|
|
{ custom, hostname, inputs, system ? "aarch64-linux", home-module ? "headless", username ? "andreas" }:
|
2022-09-07 11:50:25 +02:00
|
|
|
let
|
2022-09-07 17:42:36 +02:00
|
|
|
overlay-unstable = final: prev: {
|
2023-06-05 10:40:39 +02:00
|
|
|
unstable = import inputs.nixpkgs-unstable {
|
2022-09-07 17:42:36 +02:00
|
|
|
inherit system;
|
|
|
|
config.allowUnfree = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-06-05 10:40:39 +02:00
|
|
|
pkgs = import inputs.nixpkgs {
|
2022-09-07 11:50:25 +02:00
|
|
|
inherit system;
|
|
|
|
config = {
|
|
|
|
allowUnfree = true;
|
|
|
|
};
|
2022-09-07 17:42:36 +02:00
|
|
|
overlays = [
|
|
|
|
overlay-unstable
|
2022-11-05 19:08:12 +01:00
|
|
|
# The following is requried for building images {
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/126755#issuecomment-869149243
|
|
|
|
(final: super: {
|
|
|
|
makeModulesClosure = x:
|
|
|
|
super.makeModulesClosure (x // { allowMissing = true; });
|
|
|
|
})
|
|
|
|
# }
|
2022-09-07 17:42:36 +02:00
|
|
|
];
|
2022-09-07 11:50:25 +02:00
|
|
|
};
|
|
|
|
in
|
2022-11-04 19:35:57 +01:00
|
|
|
|
2023-06-05 10:40:39 +02:00
|
|
|
inputs.nixpkgs.lib.nixosSystem {
|
2022-11-04 13:52:30 +01:00
|
|
|
inherit pkgs system;
|
2023-06-05 10:40:39 +02:00
|
|
|
specialArgs = { inherit inputs; };
|
2022-06-27 19:13:10 +02:00
|
|
|
modules = (
|
|
|
|
[
|
|
|
|
# System configuration for this host
|
2023-06-05 10:40:39 +02:00
|
|
|
(import "${inputs.self}/systems/${hostname}"
|
2023-05-29 16:21:23 +02:00
|
|
|
{ inherit hostname; })
|
2022-06-27 19:13:10 +02:00
|
|
|
|
|
|
|
# Common configuration
|
2023-06-05 10:40:39 +02:00
|
|
|
"${inputs.self}/modules"
|
2022-06-27 19:13:10 +02:00
|
|
|
|
2023-06-05 10:40:39 +02:00
|
|
|
inputs.agenix.nixosModules.age
|
2023-05-29 14:58:49 +02:00
|
|
|
{
|
2023-06-05 10:40:39 +02:00
|
|
|
environment.systemPackages = [ inputs.agenix.packages.${system}.default ];
|
2023-05-29 14:58:49 +02:00
|
|
|
az-username = username;
|
|
|
|
}
|
2022-06-27 19:13:10 +02:00
|
|
|
|
2023-06-05 10:40:39 +02:00
|
|
|
inputs.home-manager.nixosModules.home-manager
|
2022-06-27 19:13:10 +02:00
|
|
|
{
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
home-manager.useUserPackages = true;
|
2023-05-29 14:58:49 +02:00
|
|
|
home-manager.users.${username}.imports = [
|
2023-06-05 10:40:39 +02:00
|
|
|
(import "${inputs.self}/home-manager/${home-module}.nix" { inherit custom system; })
|
2022-06-27 19:13:10 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
}
|