aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mkNixos.nix
blob: a058dfc83f4ff96290778eb282c4bc3f1b7d4bfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ inputs }:
{ hostname, system ? "x86_64-linux", users ? [ "tom" ], extraModules ? [ ] }:
let
  unfreeAllowlist = import ./unfree-allowlist.nix;
in
inputs.nixpkgs.lib.nixosSystem {
  inherit system;
  specialArgs = { inherit inputs; };
  modules = [
    {
      nixpkgs.config.allowUnfreePredicate = pkg:
        builtins.elem (inputs.nixpkgs.lib.getName pkg) unfreeAllowlist;
    }
    ../modules/nixos/common.nix
    ../hosts/${hostname}/configuration.nix
    inputs.home-manager.nixosModules.home-manager
    {
      home-manager.useGlobalPkgs = true;
      home-manager.useUserPackages = true;
      home-manager.users = builtins.listToAttrs (map
        (u: {
          name = u;
          value = import ../users/${u}.nix;
        })
        users);
    }
  ] ++ extraModules;
}