diff options
Diffstat (limited to 'nixpkgs/nixos/modules/system/activation/activation-script.nix')
-rw-r--r-- | nixpkgs/nixos/modules/system/activation/activation-script.nix | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/nixpkgs/nixos/modules/system/activation/activation-script.nix b/nixpkgs/nixos/modules/system/activation/activation-script.nix index 88b3ac1d18e8..f23d4809e356 100644 --- a/nixpkgs/nixos/modules/system/activation/activation-script.nix +++ b/nixpkgs/nixos/modules/system/activation/activation-script.nix @@ -78,22 +78,22 @@ let { deps = mkOption { type = types.listOf types.str; default = [ ]; - description = "List of dependencies. The script will run after these."; + description = lib.mdDoc "List of dependencies. The script will run after these."; }; text = mkOption { type = types.lines; - description = "The content of the script."; + description = lib.mdDoc "The content of the script."; }; } // optionalAttrs withDry { supportsDryActivation = mkOption { type = types.bool; default = false; - description = '' + description = lib.mdDoc '' Whether this activation script supports being dry-activated. These activation scripts will also be executed on dry-activate activations with the environment variable - <literal>NIXOS_ACTION</literal> being set to <literal>dry-activate - </literal>. it's important that these activation scripts don't + `NIXOS_ACTION` being set to `dry-activate`. + it's important that these activation scripts don't modify anything about the system when the variable is set. ''; }; @@ -139,11 +139,11 @@ in }; system.dryActivationScript = mkOption { - description = "The shell script that is to be run when dry-activating a system."; + description = lib.mdDoc "The shell script that is to be run when dry-activating a system."; readOnly = true; internal = true; default = systemActivationScript (removeAttrs config.system.activationScripts [ "script" ]) true; - defaultText = literalDocBook "generated activation script"; + defaultText = literalMD "generated activation script"; }; system.userActivationScripts = mkOption { @@ -199,9 +199,9 @@ in example = literalExpression ''"''${pkgs.busybox}/bin/env"''; type = types.nullOr types.path; visible = false; - description = '' + description = lib.mdDoc '' The env(1) executable that is linked system-wide to - <literal>/usr/bin/env</literal>. + `/usr/bin/env`. ''; }; }; @@ -217,7 +217,8 @@ in '' # Various log/runtime directories. - mkdir -m 1777 -p /var/tmp + mkdir -p /var/tmp + chmod 1777 /var/tmp # Empty, immutable home directory of many system accounts. mkdir -p /var/empty @@ -231,7 +232,8 @@ in system.activationScripts.usrbinenv = if config.environment.usrbinenv != null then '' - mkdir -m 0755 -p /usr/bin + mkdir -p /usr/bin + chmod 0755 /usr/bin ln -sfn ${config.environment.usrbinenv} /usr/bin/.env.tmp mv /usr/bin/.env.tmp /usr/bin/env # atomically replace /usr/bin/env '' @@ -251,7 +253,8 @@ in if mountpoint -q "$mountPoint"; then local options="remount,$options" else - mkdir -m 0755 -p "$mountPoint" + mkdir -p "$mountPoint" + chmod 0755 "$mountPoint" fi mount -t "$fsType" -o "$options" "$device" "$mountPoint" } |