diff options
author | Linus Heckemann <git@sphalerite.org> | 2023-10-28 10:17:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-28 10:17:15 +0200 |
commit | 86707945659e730bc7af48969d0898a765ee4c05 (patch) | |
tree | b41cdb205107c50ab64e1148d9383540dcf79f0e /nixos/modules/config | |
parent | 0643b928c86e6f8e1786ad2ffb666331a42add51 (diff) | |
parent | d300940637a74421b78d3e94b25daf35f1b9ec9d (diff) |
Merge pull request #263203 from nikstur/replace-activation
Replace simple activationScripts
Diffstat (limited to 'nixos/modules/config')
-rw-r--r-- | nixos/modules/config/mysql.nix | 4 | ||||
-rw-r--r-- | nixos/modules/config/nix-channel.nix | 11 |
2 files changed, 6 insertions, 9 deletions
diff --git a/nixos/modules/config/mysql.nix b/nixos/modules/config/mysql.nix index 2f13c56f2ae59..95c9ba76663ea 100644 --- a/nixos/modules/config/mysql.nix +++ b/nixos/modules/config/mysql.nix @@ -429,11 +429,11 @@ in ''; }; - # Activation script to append the password from the password file + # preStart script to append the password from the password file # to the configuration files. It also fixes the owner of the # libnss-mysql-root.cfg because it is changed to root after the # password is appended. - system.activationScripts.mysql-auth-passwords = '' + systemd.services.mysql.preStart = '' if [[ -r ${cfg.passwordFile} ]]; then org_umask=$(umask) umask 0077 diff --git a/nixos/modules/config/nix-channel.nix b/nixos/modules/config/nix-channel.nix index 3f8e088ede929..4abc846b08586 100644 --- a/nixos/modules/config/nix-channel.nix +++ b/nixos/modules/config/nix-channel.nix @@ -97,12 +97,9 @@ in nix.settings.nix-path = mkIf (! cfg.channel.enable) (mkDefault ""); - system.activationScripts.nix-channel = mkIf cfg.channel.enable - (stringAfter [ "etc" "users" ] '' - # Subscribe the root user to the NixOS channel by default. - if [ ! -e "/root/.nix-channels" ]; then - echo "${config.system.defaultChannel} nixos" > "/root/.nix-channels" - fi - ''); + systemd.tmpfiles.rules = lib.mkIf cfg.channel.enable [ + "f /root/.nix-channels -" + ''w "/root/.nix-channels" - - - - "${config.system.defaultChannel} nixos\n"'' + ]; }; } |