nixos/lib/mk_computer.nix

64 lines
1.8 KiB
Nix
Raw Normal View History

2023-06-07 20:14:44 +02:00
{ hostname, inputs, system ? "x86_64-linux", home-module ? "headless", username ? "andreas" }:
2022-09-07 17:36:29 +02:00
let
overlay-unstable = final: prev: {
unstable = import inputs.nixpkgs-unstable {
2022-09-07 17:42:36 +02:00
inherit system;
2022-09-07 17:36:29 +02:00
config.allowUnfree = true;
};
};
pkgs = import inputs.nixpkgs {
2022-09-07 17:36:29 +02:00
inherit system;
config = {
allowUnfree = true;
};
overlays = [
overlay-unstable
2022-11-01 15:23:52 +01:00
# (final: prev: {
# nextcloud-client = prev.nextcloud-client.overrideAttrs (_: rec {
# version = "3.6.0";
# src = pkgs.fetchFromGitHub {
# owner = "nextcloud";
# repo = "desktop";
# rev = "v${version}";
# sha256 = "sha256-wAxq5xFlofn2xEguvewMvGcel9O+CN/1AycR3tv/xMA=";
# };
# });
# })
2022-09-07 17:36:29 +02:00
];
};
in
inputs.nixpkgs.lib.nixosSystem
2022-09-07 17:36:29 +02:00
{
inherit system pkgs;
specialArgs = { inherit inputs; };
modules = (
[
# System configuration for this host
(import "${inputs.self}/systems/${hostname}" {
2023-05-29 16:21:23 +02:00
inherit hostname;
2022-09-06 23:03:29 +02:00
})
# 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-08-22 18:41:05 +02:00
age.identityPaths = [ "/home/${username}/.ssh/id_rsa" ];
home-manager.users.${username}.imports = [
inputs.agenix.homeManagerModules.default
2023-06-07 20:27:13 +02:00
"${inputs.self}/home-manager/profiles/${home-module}.nix"
];
}
]);
}