1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

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.
This commit is contained in:
Michael Hoang 2024-11-15 14:03:43 +11:00
parent 6c71c49e24
commit dae702993d
5 changed files with 7 additions and 23 deletions

View file

@ -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

View file

@ -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.")
];

View file

@ -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;
};
};
}

View file

@ -1,7 +1,6 @@
{ config, pkgs, ... }:
{
services.activate-system.enable = true;
launchd.labelPrefix = "org.nix-darwin";
test = ''

View file

@ -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