security: scope privileges and stop a world-readable secret copy (#335)

This commit is contained in:
ryan4yin | 二花 authored and GitHub committed 2026-10-01 21:18:34 +08:00
1 parent d690f45183
commit 4909f6357b
11 files changed
+106 -45

No files matched your search

+6 -3
View File
@@ -139,11 +139,14 @@ in
mode = "0000";
};
# The following secrets are used by home-manager modules
# So we need to make then readable by the user
# Used by a home-manager module, so it must be readable by the user.
# Setting `mode` makes environment.etc copy the file instead of
# symlinking the runtime secret, so the owner must be set as well —
# otherwise it becomes a world-readable, root-owned copy of the secret.
"agenix/nushell-secrets.nu" = {
source = config.age.secrets."nushell-secrets.nu".path;
mode = "0644"; # both the original file and the symlink should be readable and executable by the user
mode = "0400";
user = myvars.username;
};
};
})