nixos/lib/mk_computer.nix

58 lines
1.7 KiB
Nix

{ custom, hostname, system ? "x86_64-linux", home-module ? "headless" }:
let
overlay-unstable = final: prev: {
unstable = import custom.inputs.nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
};
pkgs = import custom.inputs.nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
overlays = [
overlay-unstable
# (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=";
# };
# });
# })
];
};
in
custom.inputs.nixpkgs.lib.nixosSystem
{
inherit system pkgs;
specialArgs = { inherit custom; };
modules = (
[
# System configuration for this host
(import "${custom.inputs.self}/systems/${hostname}" {
inherit custom hostname;
})
# Common configuration
(import "${custom.inputs.self}/modules/common-x86" { inherit custom; })
custom.inputs.agenix.nixosModules.age
{ environment.systemPackages = [ custom.inputs.agenix.defaultPackage.${system} ]; }
custom.inputs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${custom.username}.imports = [
(import "${custom.inputs.self}/home-manager/${home-module}.nix" { inherit custom; })
];
}
]);
}