summaryrefslogtreecommitdiff
path: root/system-profiles/core.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2020-12-31 14:26:32 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2021-01-03 20:16:56 +0100
commitc6eac8a549fd9f55d5da908dbe49da9301e264f0 (patch)
tree9f71db38590c55f682f35efe1153616e4f4dd2b9 /system-profiles/core.nix
parent5e868ac30eefa04de215268cd10e06a32daa0e9b (diff)
downloadnixos-c6eac8a549fd9f55d5da908dbe49da9301e264f0.tar
nixos-c6eac8a549fd9f55d5da908dbe49da9301e264f0.tar.gz
nixos-c6eac8a549fd9f55d5da908dbe49da9301e264f0.tar.bz2
nixos-c6eac8a549fd9f55d5da908dbe49da9301e264f0.tar.xz
nixos-c6eac8a549fd9f55d5da908dbe49da9301e264f0.zip
Set up template
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}