2016-12-04 10:38:21 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2024-11-15 14:03:43 +11:00
|
|
|
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.")
|
|
|
|
];
|
2016-12-04 10:38:21 +01:00
|
|
|
|
2024-11-15 14:03:43 +11:00
|
|
|
config = {
|
2016-12-14 21:15:02 +01:00
|
|
|
launchd.daemons.activate-system = {
|
2017-05-15 08:34:53 +02:00
|
|
|
script = ''
|
2020-10-25 15:17:36 +01:00
|
|
|
set -e
|
|
|
|
set -o pipefail
|
|
|
|
export PATH="${pkgs.gnugrep}/bin:${pkgs.coreutils}/bin:@out@/sw/bin:/usr/bin:/bin:/usr/sbin:/sbin"
|
|
|
|
|
2020-10-25 16:02:23 +01:00
|
|
|
systemConfig=$(cat ${config.system.profile}/systemConfig)
|
|
|
|
|
2017-05-15 08:34:53 +02:00
|
|
|
# Make this configuration the current configuration.
|
|
|
|
# The readlink is there to ensure that when $systemConfig = /system
|
|
|
|
# (which is a symlink to the store), /run/current-system is still
|
|
|
|
# used as a garbage collection root.
|
|
|
|
ln -sfn $(cat ${config.system.profile}/systemConfig) /run/current-system
|
|
|
|
|
|
|
|
# Prevent the current configuration from being garbage-collected.
|
|
|
|
ln -sfn /run/current-system /nix/var/nix/gcroots/current-system
|
|
|
|
|
2023-07-12 08:35:11 +01:00
|
|
|
${config.system.activationScripts.etcChecks.text}
|
2020-10-25 16:02:23 +01:00
|
|
|
${config.system.activationScripts.etc.text}
|
2018-02-28 20:18:49 +01:00
|
|
|
${config.system.activationScripts.keyboard.text}
|
2017-05-15 08:34:53 +02:00
|
|
|
'';
|
2016-12-04 10:38:21 +01:00
|
|
|
serviceConfig.RunAtLoad = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|