about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2023-03-15 14:36:37 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2023-03-15 14:36:40 +0100
commit1c52b361a85d4f9e139d5b54fc21df2e1e012285 (patch)
tree93eb6a1d60de769ba53090c1913b2727c55d2377 /nixos
parentaeb7c79ee498491cd53168c94559cc671217c06d (diff)
parent3d02414b60f33bfeb1a0087ed502bc458c886478 (diff)
downloadnixlib-1c52b361a85d4f9e139d5b54fc21df2e1e012285.tar
nixlib-1c52b361a85d4f9e139d5b54fc21df2e1e012285.tar.gz
nixlib-1c52b361a85d4f9e139d5b54fc21df2e1e012285.tar.bz2
nixlib-1c52b361a85d4f9e139d5b54fc21df2e1e012285.tar.lz
nixlib-1c52b361a85d4f9e139d5b54fc21df2e1e012285.tar.xz
nixlib-1c52b361a85d4f9e139d5b54fc21df2e1e012285.tar.zst
nixlib-1c52b361a85d4f9e139d5b54fc21df2e1e012285.zip
Merge remote-tracking branch 'origin/master' into staging-next
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/x11/xserver.nix3
-rw-r--r--nixos/modules/system/activation/top-level.nix30
2 files changed, 31 insertions, 2 deletions
diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix
index adb079c87a8b..0f5dce40640a 100644
--- a/nixos/modules/services/x11/xserver.nix
+++ b/nixos/modules/services/x11/xserver.nix
@@ -592,7 +592,8 @@ in
                     || dmConf.sddm.enable
                     || dmConf.xpra.enable
                     || dmConf.sx.enable
-                    || dmConf.startx.enable);
+                    || dmConf.startx.enable
+                    || config.services.greetd.enable);
       in mkIf (default) (mkDefault true);
 
     # so that the service won't be enabled when only startx is used
diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix
index 240e20959175..896f8c0a6935 100644
--- a/nixos/modules/system/activation/top-level.nix
+++ b/nixos/modules/system/activation/top-level.nix
@@ -130,6 +130,13 @@ let
       pkgs.replaceDependency { inherit oldDependency newDependency drv; }
     ) baseSystemAssertWarn config.system.replaceRuntimeDependencies;
 
+  systemWithBuildDeps = system.overrideAttrs (o: {
+    systemBuildClosure = pkgs.closureInfo { rootPaths = [ system.drvPath ]; };
+    buildCommand = o.buildCommand + ''
+      ln -sn $systemBuildClosure $out/build-closure
+    '';
+  });
+
 in
 
 {
@@ -306,6 +313,27 @@ in
       '';
     };
 
+    system.includeBuildDependencies = mkOption {
+      type = types.bool;
+      default = false;
+      description = lib.mdDoc ''
+        Whether to include the build closure of the whole system in
+        its runtime closure.  This can be useful for making changes
+        fully offline, as it includes all sources, patches, and
+        intermediate outputs required to build all the derivations
+        that the system depends on.
+
+        Note that this includes _all_ the derivations, down from the
+        included applications to their sources, the compilers used to
+        build them, and even the bootstrap compiler used to compile
+        the compilers. This increases the size of the system and the
+        time needed to download its dependencies drastically: a
+        minimal configuration with no extra services enabled grows
+        from ~670MiB in size to 13.5GiB, and takes proportionally
+        longer to download.
+      '';
+    };
+
   };
 
 
@@ -336,7 +364,7 @@ in
       ]; };
     };
 
-    system.build.toplevel = system;
+    system.build.toplevel = if config.system.includeBuildDependencies then systemWithBuildDeps else system;
 
   };