nixos/lib/mk_raspi.nix

58 lines
1.5 KiB
Nix
Raw Normal View History

2023-06-07 20:14:44 +02:00
{ 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: {
unstable = import inputs.nixpkgs-unstable {
2022-09-07 17:42:36 +02:00
inherit system;
config.allowUnfree = true;
};
};
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
inputs.nixpkgs.lib.nixosSystem {
2022-11-04 13:52:30 +01:00
inherit pkgs system;
specialArgs = { inherit inputs; };
modules = (
[
# System configuration for this host
(import "${inputs.self}/systems/${hostname}"
2023-05-29 16:21:23 +02:00
{ inherit hostname; })
# Common configuration
"${inputs.self}/modules"
inputs.agenix.nixosModules.age
2023-05-29 14:58:49 +02:00
{
environment.systemPackages = [ inputs.agenix.packages.${system}.default ];
2023-05-29 14:58:49 +02:00
az-username = username;
}
inputs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
2023-06-07 20:14:44 +02:00
home-manager.extraSpecialArgs = { inherit inputs system; };
2023-05-29 14:58:49 +02:00
home-manager.users.${username}.imports = [
2023-08-22 18:41:05 +02:00
inputs.agenix.homeManagerModules.default
2023-06-07 20:27:13 +02:00
"${inputs.self}/home-manager/profiles/${home-module}.nix"
];
}
]);
}