1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-05 08:17:01 +00:00

fix system activation service

This commit is contained in:
Daiderd Jordan 2016-12-03 22:44:36 +01:00
parent 61a91d3c99
commit 9a5af2ee4a
No known key found for this signature in database
GPG key ID: D02435D05B810C96
3 changed files with 25 additions and 5 deletions

View file

@ -36,7 +36,7 @@ let
pkgs.nox
];
launchd.agents.activate-system =
launchd.daemons.activate-system =
{ serviceConfig.Program = "${config.system.build.activate}";
serviceConfig.RunAtLoad = true;
};
@ -144,7 +144,7 @@ let
if [ -n "$__ETC_ZSHENV_SOURCED" ]; then return; fi
export __ETC_ZSHENV_SOURCED=1
export NIX_PATH=nixpkgs=$HOME/.nix-defexpr/nixpkgs:$NIX_PATH/.nix-defexpr/channels_root
export NIX_PATH=nixpkgs=$HOME/.nix-defexpr/nixpkgs:$HOME/.nix-defexpr/channels_root
# Set up secure multi-user builds: non-root users build through the
# Nix daemon.

View file

@ -44,13 +44,33 @@ in
launchd.agents = mkOption {
default = {};
type = types.attrsOf (types.submodule serviceOptions);
description = "Definition of launchd agents.";
description = ''
Definition of per-user launchd agents.
When a user logs in, a per-user launchd is started.
It does the following:
1. It loads the parameters for each launch-on-demand user agent from the property list files found in /System/Library/LaunchAgents, /Library/LaunchAgents, and the users individual Library/LaunchAgents directory.
2. It registers the sockets and file descriptors requested by those user agents.
3. It launches any user agents that requested to be running all the time.
4. As requests for a particular service arrive, it launches the corresponding user agent and passes the request to it.
5. When the user logs out, it sends a SIGTERM signal to all of the user agents that it started.
'';
};
launchd.daemons = mkOption {
default = {};
type = types.attrsOf (types.submodule serviceOptions);
description = "Definition of launchd daemons.";
description = ''
Definition of launchd daemons.
After the system is booted and the kernel is running, launchd is run to finish the system initialization.
As part of that initialization, it goes through the following steps:
1. It loads the parameters for each launch-on-demand system-level daemon from the property list files found in /System/Library/LaunchDaemons/ and /Library/LaunchDaemons/.
2. It registers the sockets and file descriptors requested by those daemons.
3. It launches any daemons that requested to be running all the time.
4. As requests for a particular service arrive, it launches the corresponding daemon and passes the request to it.
5. When the system shuts down, it sends a SIGTERM signal to all of the daemons that it started.
'';
};
};

View file

@ -34,7 +34,7 @@ in
config = {
system.build.activate = pkgs.writeText "activate-system" ''
system.build.activate = pkgs.writeScript "activate-system" ''
#! ${pkgs.stdenv.shell}
# Make this configuration the current configuration.