nixos/lib/mk_raspi.nix

76 lines
1.9 KiB
Nix
Raw Normal View History

2024-02-02 13:45:05 +01: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;
2024-02-02 13:45:05 +01:00
config = {
allowUnfree = true;
};
2022-09-07 17:42:36 +02:00
overlays = [
overlay-unstable
2024-01-08 19:21:55 +01:00
(final: prev: {
2024-03-18 11:58:36 +01:00
freshrss = prev.freshrss.overrideAttrs (_: {
version = "1.32.1";
src = pkgs.fetchFromGitHub {
owner = "FreshRSS";
repo = "FreshRSS";
rev = "c89073d60e491f775a13a9ec57915313eb073964";
sha256 = "sha256-DqfkbfvqGkAMQ2oawfb7Ggiv2u6/Qq6UgygLTNov9CA=";
};
});
2024-01-08 19:21:55 +01:00
})
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: {
2024-02-02 13:45:05 +01:00
makeModulesClosure = x: super.makeModulesClosure (x // { allowMissing = true; });
2022-11-05 19:08:12 +01:00
})
# }
2022-09-07 17:42:36 +02:00
];
2022-09-07 11:50:25 +02:00
};
2024-02-02 13:45:05 +01:00
in
inputs.nixpkgs.lib.nixosSystem {
2022-11-04 13:52:30 +01:00
inherit pkgs system;
2024-02-02 13:45:05 +01:00
specialArgs = {
inherit inputs;
};
2024-01-01 13:14:24 +01:00
modules = ([
# System configuration for this host
(import "${inputs.self}/systems/${hostname}" { inherit hostname; })
2024-01-01 13:14:24 +01:00
# Common configuration
"${inputs.self}/modules"
2024-01-01 13:14:24 +01:00
inputs.agenix.nixosModules.age
{
environment.systemPackages = [ inputs.agenix.packages.${system}.default ];
az-username = username;
}
2024-01-01 13:14:24 +01:00
inputs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
2024-02-02 13:45:05 +01:00
home-manager.extraSpecialArgs = {
inherit inputs system;
};
2024-01-01 13:14:24 +01:00
home-manager.users.${username}.imports = [
inputs.agenix.homeManagerModules.default
"${inputs.self}/home-manager/profiles/${home-module}.nix"
];
}
]);
}