nixos/lib/mk_computer.nix

71 lines
1.8 KiB
Nix

{
home-module,
hostname,
inputs,
username ? "andreas",
}:
let
system = "x86_64-linux";
overlay-unstable = final: prev: {
unstable = import inputs.nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
};
pkgs = import 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
inputs.nixpkgs.lib.nixosSystem {
inherit system pkgs;
specialArgs = {
inherit inputs;
};
modules = ([
# System configuration for this host
(import "${inputs.self}/systems/${hostname}" { inherit hostname; })
# Common configuration
"${inputs.self}/modules"
inputs.agenix.nixosModules.age
inputs.attic.nixosModules.atticd
{
environment.systemPackages = [ inputs.agenix.packages.${system}.default ];
az-username = username;
}
inputs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit inputs system;
};
age.identityPaths = [ "/home/${username}/.ssh/id_rsa" ];
home-manager.users.${username}.imports = [
inputs.agenix.homeManagerModules.default
"${inputs.self}/home-manager/profiles/${home-module}.nix"
];
}
]);
}