moved impermanence config for var lib private into impermanence module

This commit is contained in:
Leyla Becker 2025-07-04 23:58:58 -05:00
parent 4db136d527
commit 3b00ebe572
3 changed files with 30 additions and 22 deletions

36
flake.lock generated
View file

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1750903843,
"narHash": "sha256-Ng9+f0H5/dW+mq/XOKvB9uwvGbsuiiO6HrPdAcVglCs=",
"lastModified": 1751607816,
"narHash": "sha256-5PtrwjqCIJ4DKQhzYdm8RFePBuwb+yTzjV52wWoGSt4=",
"owner": "nix-community",
"repo": "disko",
"rev": "83c4da299c1d7d300f8c6fd3a72ac46cb0d59aae",
"rev": "da6109c917b48abc1f76dd5c9bf3901c8c80f662",
"type": "github"
},
"original": {
@ -28,11 +28,11 @@
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1751256218,
"narHash": "sha256-WC1YSV4lFT41AaEhpiQZRuofe+2WLI9PNuuqgdRmjVM=",
"lastModified": 1751688200,
"narHash": "sha256-4W+Bw2G9bTUuvAVS0g1rTdm5jyxxZoPFSSSk3S5yOPQ=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "fa40d85b15cbfb1a488ef9a119ff2d40a481c8da",
"rev": "7dc9a3c333983e3dcc19eb29b8e98184ef7e51e7",
"type": "gitlab"
},
"original": {
@ -115,11 +115,11 @@
]
},
"locked": {
"lastModified": 1751336185,
"narHash": "sha256-ptnVr2x+sl7cZcTuGx/0BOE2qCAIYHTcgfA+/h60ml0=",
"lastModified": 1751690735,
"narHash": "sha256-/FkoEVh6LzzunOYd5yZ2uo4HHzLqaKi6VH2kPus9hk0=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "96354906f58464605ff81d2f6c2ea23211cbf051",
"rev": "e8da7372fd1f0da3fe3874af3aa9ddd78662d8ae",
"type": "github"
},
"original": {
@ -227,11 +227,11 @@
]
},
"locked": {
"lastModified": 1751336244,
"narHash": "sha256-4fz6Xy9L1/9LXpueprfycJKggWZYPZfQxb5Qf8ay6As=",
"lastModified": 1751681058,
"narHash": "sha256-b9JMD1j+zqGbrWSobXq4icjOm5tdoy7dWBLSe6WTCSE=",
"owner": "nix-community",
"repo": "nix-vscode-extensions",
"rev": "0011bc2bd9af8ee1a093d13c37dc8fa862132c1b",
"rev": "0cadf3b87cce52af29c3cc98be8ee81b3c05f2c1",
"type": "github"
},
"original": {
@ -242,11 +242,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1750837715,
"narHash": "sha256-2m1ceZjbmgrJCZ2PuQZaK4in3gcg3o6rZ7WK6dr5vAA=",
"lastModified": 1751432711,
"narHash": "sha256-136MeWtckSHTN9Z2WRNRdZ8oRP3vyx3L8UxeBYE+J9w=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "98236410ea0fe204d0447149537a924fb71a6d4f",
"rev": "497ae1357f1ac97f1aea31a4cb74ad0d534ef41f",
"type": "github"
},
"original": {
@ -313,11 +313,11 @@
]
},
"locked": {
"lastModified": 1750119275,
"narHash": "sha256-Rr7Pooz9zQbhdVxux16h7URa6mA80Pb/G07T4lHvh0M=",
"lastModified": 1751606940,
"narHash": "sha256-KrDPXobG7DFKTOteqdSVeL1bMVitDcy7otpVZWDE6MA=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "77c423a03b9b2b79709ea2cb63336312e78b72e2",
"rev": "3633fc4acf03f43b260244d94c71e9e14a2f6e0d",
"type": "github"
},
"original": {

View file

@ -25,6 +25,18 @@
}
];
# fixes issues with /var/lib/private not having the correct permissions https://github.com/nix-community/impermanence/issues/254
system.activationScripts."createPersistentStorageDirs".deps = ["var-lib-private-permissions" "users" "groups"];
system.activationScripts = {
"var-lib-private-permissions" = {
deps = ["specialfs"];
text = ''
mkdir -p /persist/system/root/var/lib/private
chmod 0700 /persist/system/root/var/lib/private
'';
};
};
programs.fuse.userAllowOther = true;
boot.initrd.postResumeCommands = lib.mkAfter ''

View file

@ -28,10 +28,6 @@
};
}))
(lib.mkIf config.host.impermanence.enable {
# TODO: move this somewhere common
systemd.tmpfiles.rules = [
"d /var/lib/private 0700 root root"
];
environment.persistence."/persist/system/root" = {
enable = true;
hideMounts = true;