Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

activate-system: remove enable option #1169

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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