From 4b6a7eafda5f506cc8897d7a5920d60563c1e378 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Sat, 3 Sep 2022 10:04:06 +0200 Subject: [PATCH] Fix ordering of activation operations --- modules/base/zfs/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/base/zfs/default.nix b/modules/base/zfs/default.nix index c2c50887..fdc965c7 100644 --- a/modules/base/zfs/default.nix +++ b/modules/base/zfs/default.nix @@ -92,7 +92,8 @@ system.activationScripts = let ensureSystemExistsScript = lib.concatStringsSep "\n" (map (path: ''mkdir -p "${path}"'') config.chvp.base.zfs.ensureSystemExists); - ensureHomeExistsScript = lib.concatStringsSep "\n" (map (path: ''mkdir -p "/home/charlotte/${path}"; chown charlotte:users /home/charlotte/${path};'') config.chvp.base.zfs.ensureHomeExists); + ensureHomeExistsScript = lib.concatStringsSep "\n" (map (path: ''mkdir -p "/home/charlotte/${path}"'') config.chvp.base.zfs.ensureHomeExists); + ensureHomePermissionsScript = lib.concatStringsSep "\n" (map (path: ''chown charlotte:users /home/charlotte/${path}'') config.chvp.base.zfs.ensureHomeExists); in { ensureSystemPathsExist = { @@ -104,9 +105,15 @@ mkdir -p /home/charlotte/ ${ensureHomeExistsScript} ''; - deps = [ "users" "groups" ]; }; agenixInstall.deps = [ "ensureSystemPathsExist" "ensureHomePathsExist" ]; + ensureHomePermissionsScript = { + text = '' + chown charlotte:users /home/charlotte + ${ensureHomePermissionsScript} + ''; + deps = [ "agenixInstall" "users" "groups" ]; + }; }; systemd.services =