summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hoang <enzime@users.noreply.github.com>2024-11-15 14:03:43 +1100
committerMichael Hoang <enzime@users.noreply.github.com>2024-11-15 14:10:48 +1100
commitdae702993d18c608f07e9d320ccba816e9bce064 (patch)
treef7703d194fbe9a9bb51ca9744f9eb441a084ecb0
parent6c71c49e2448e51ad830ed211024e6d0edc50116 (diff)
activate-system: remove `enable` option
Disabling this is not supported as `/run` gets cleared out on every reboot so it is necessary for ensuring that the `/run/current-system` symlink exists.
-rw-r--r--README.md6
-rw-r--r--modules/nix/default.nix1
-rw-r--r--modules/services/activate-system/default.nix20
-rw-r--r--tests/services-activate-system-changed-label-prefix.nix1
-rw-r--r--tests/services-activate-system.nix2
5 files changed, 7 insertions, 23 deletions
diff --git a/README.md b/README.md
index b9e3de7..eb6228c 100644
--- a/README.md
+++ b/README.md
@@ -172,7 +172,7 @@ Furthermore there's `darwin-option` to introspect the settings of a system and i
> NOTE: `darwin-option` is only available to non-flake installations.
```
-$ darwin-option services.activate-system.enable
+$ darwin-option nix.linux-builder.enable
Value:
true
@@ -180,10 +180,10 @@ Default:
false
Example:
-no example
+true
Description:
-Whether to activate system at boot time.
+Whether to enable Linux builder.
```
There's also a small wiki https://github.com/LnL7/nix-darwin/wiki about
diff --git a/modules/nix/default.nix b/modules/nix/default.nix
index d99aae8..3751e8c 100644
--- a/modules/nix/default.nix
+++ b/modules/nix/default.nix
@@ -774,7 +774,6 @@ in
# Not in NixOS module
warnings = [
- (mkIf (!config.services.activate-system.enable && cfg.distributedBuilds) "services.activate-system is not enabled, a reboot could cause distributed builds to stop working.")
(mkIf (!cfg.distributedBuilds && cfg.buildMachines != []) "nix.distributedBuilds is not enabled, build machines won't be configured.")
];
diff --git a/modules/services/activate-system/default.nix b/modules/services/activate-system/default.nix
index c41d963..6a982fe 100644
--- a/modules/services/activate-system/default.nix
+++ b/modules/services/activate-system/default.nix
@@ -1,22 +1,11 @@
{ config, lib, pkgs, ... }:
-with lib;
-
-let
- cfg = config.services.activate-system;
-in
-
{
- options = {
- services.activate-system.enable = mkOption {
- type = types.bool;
- default = true;
- description = "Whether to activate system at boot time.";
- };
- };
-
- config = mkIf cfg.enable {
+ imports = [
+ (lib.mkRemovedOptionModule [ "services" "activate-system" "enable" ] "The `activate-system` service is now always enabled as it is necessary for a working `nix-darwin` setup.")
+ ];
+ config = {
launchd.daemons.activate-system = {
script = ''
set -e
@@ -41,6 +30,5 @@ in
serviceConfig.RunAtLoad = true;
serviceConfig.KeepAlive.SuccessfulExit = false;
};
-
};
}
diff --git a/tests/services-activate-system-changed-label-prefix.nix b/tests/services-activate-system-changed-label-prefix.nix
index 1ae2bcf..2c2f603 100644
--- a/tests/services-activate-system-changed-label-prefix.nix
+++ b/tests/services-activate-system-changed-label-prefix.nix
@@ -1,7 +1,6 @@
{ config, pkgs, ... }:
{
- services.activate-system.enable = true;
launchd.labelPrefix = "org.nix-darwin";
test = ''
diff --git a/tests/services-activate-system.nix b/tests/services-activate-system.nix
index c519aa8..702bb26 100644
--- a/tests/services-activate-system.nix
+++ b/tests/services-activate-system.nix
@@ -1,8 +1,6 @@
{ config, pkgs, ... }:
{
- services.activate-system.enable = true;
-
test = ''
echo checking activation service in /Library/LaunchDaemons >&2
grep "org.nixos.activate-system" ${config.out}/Library/LaunchDaemons/org.nixos.activate-system.plist