Skip to content

Commit

Permalink
Merge pull request #1169 from Enzime/push-uktzylymvtyk
Browse files Browse the repository at this point in the history
activate-system: remove `enable` option
  • Loading branch information
Enzime authored Nov 15, 2024
2 parents 6c71c49 + dae7029 commit f86f158
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 23 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,18 @@ 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
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
Expand Down
1 change: 0 additions & 1 deletion modules/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
];

Expand Down
20 changes: 4 additions & 16 deletions modules/services/activate-system/default.nix
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -41,6 +30,5 @@ in
serviceConfig.RunAtLoad = true;
serviceConfig.KeepAlive.SuccessfulExit = false;
};

};
}
1 change: 0 additions & 1 deletion tests/services-activate-system-changed-label-prefix.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ config, pkgs, ... }:

{
services.activate-system.enable = true;
launchd.labelPrefix = "org.nix-darwin";

test = ''
Expand Down
2 changes: 0 additions & 2 deletions tests/services-activate-system.nix
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit f86f158

Please sign in to comment.