summaryrefslogtreecommitdiff
path: root/system-profiles/core.nix
diff options
context:
space:
mode:
Diffstat (limited to 'system-profiles/core.nix')
-rw-r--r--system-profiles/core.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/system-profiles/core.nix b/system-profiles/core.nix
new file mode 100644
index 00000000..2af82703
--- /dev/null
+++ b/system-profiles/core.nix
@@ -0,0 +1,47 @@
1{ flake, flakeInputs, path, hostName, config, lib, pkgs, customUtils, ... }:
2let
3 profileSet = customUtils.types.attrNameSet flake.nixosModules.systemProfiles;
4in {
5 options = {
6 # See mkSystemProfile in ../flake.nix
7 system.profiles = lib.mkOption {
8 type = profileSet;
9 default = [];
10 description = ''
11 Set (list without duplicates) of ‘systemProfiles’ enabled for this host
12 '';
13 };
14 };
15
16 config = {
17 networking.hostName = hostName;
18 system.configurationRevision = lib.mkIf (flake ? rev) flake.rev;
19
20 nixpkgs.pkgs = flakeInputs.nixpkgs.legacyPackages.${config.nixpkgs.system};
21 nixpkgs.overlays = lib.attrValues flake.overlays;
22
23 nix = {
24 package = pkgs.nixUnstable;
25 useSandbox = true;
26 allowedUsers = [ "@wheel" ];
27 trustedUsers = [ "root" "@wheel" ];
28 extraOptions = ''
29 experimental-features = nix-command flakes ca-references
30 '';
31 nixPath = [
32 "nixpkgs=${path}"
33 ];
34 registry = {
35 nixpkgs.flake = flakeInputs.nixpkgs;
36 home-manager.flake = flakeInputs.home-manager;
37 machines.flake = flake;
38 };
39 };
40
41 users.mutableUsers = false;
42
43 # documentation.nixos.includeAllModules = true; # incompatible with home-manager (build fails)
44
45 home-manager.useGlobalPkgs = true; # Otherwise home-manager would only work impurely
46 };
47}