mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-13 12:13:46 +01:00
fix(aquamarine): persist the user's unit directories (#464)
Assisted-by: DeepSeek Harness (deepseek-flash)
This commit is contained in:
1 parent
a0ff9f7fd7
commit
afa7a4c72e
3 files changed
+26
-1
No files matched your search
@@ -72,19 +72,33 @@ in
|
||||
# not listed is gone on the next boot; weights are re-downloadable, but
|
||||
# re-downloading tens of GB is not a boot step.
|
||||
"models"
|
||||
|
||||
".config/systemd/user"
|
||||
".config/containers/systemd"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# `.config`/`.local` are not immediate parents of any persisted path here, so
|
||||
# tmpfiles would create them root:root 0755 and the user could not write
|
||||
# under them. Same fix as hosts/idols-ai/preservation.nix.
|
||||
# under them. Same fix as hosts/idols-ai/preservation.nix, plus the `.config`
|
||||
# subdirectories that hold a mount point.
|
||||
systemd.tmpfiles.settings.preservation = {
|
||||
"/home/${username}/.config".d = {
|
||||
user = username;
|
||||
group = lib.mkForce username;
|
||||
mode = lib.mkForce "0750";
|
||||
};
|
||||
"/home/${username}/.config/systemd".d = {
|
||||
user = username;
|
||||
group = lib.mkForce username;
|
||||
mode = lib.mkForce "0750";
|
||||
};
|
||||
"/home/${username}/.config/containers".d = {
|
||||
user = username;
|
||||
group = lib.mkForce username;
|
||||
mode = lib.mkForce "0750";
|
||||
};
|
||||
"/home/${username}/.local".d = {
|
||||
user = username;
|
||||
group = lib.mkForce username;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
cStatesCapped = true;
|
||||
nativeIpv6Preference = true;
|
||||
sourceCheckoutsPersistent = true;
|
||||
userUnitDirsPersistent = true;
|
||||
rootlessPodmanEnabled = true;
|
||||
stableKernel = true;
|
||||
btopShowsRadeon = true;
|
||||
|
||||
@@ -36,6 +36,16 @@ in
|
||||
sourceCheckoutsPersistent = builtins.any (
|
||||
d: d.directory == "/home/${myvars.username}/src"
|
||||
) cfg.preservation.preserveAt."/persistent".users.${myvars.username}.directories;
|
||||
|
||||
# Directories the tmpfs root would otherwise drop.
|
||||
userUnitDirsPersistent =
|
||||
let
|
||||
dirs = cfg.preservation.preserveAt."/persistent".users.${myvars.username}.directories;
|
||||
in
|
||||
builtins.all (path: builtins.any (d: d.directory == "/home/${myvars.username}/${path}") dirs) [
|
||||
".config/systemd/user"
|
||||
".config/containers/systemd"
|
||||
];
|
||||
rootlessPodmanEnabled = cfg.virtualisation.podman.enable;
|
||||
|
||||
# A server tracks the nixpkgs default (stable/LTS) kernel, not `-latest`.
|
||||
|
||||
Reference in new issue
Block a user