mirror of
https://github.com/nix-community/impermanence
synced 2024-11-10 05:44:17 +00:00
Merge pull request #203 from nix-community/fs-var-lib-nixos-warning
nixos: Consider regular filesystem mounts in /var/lib/nixos warning
This commit is contained in:
commit
63f4d0443e
1 changed files with 5 additions and 3 deletions
|
@ -772,17 +772,19 @@ in
|
|||
let
|
||||
usersWithoutUid = attrNames (filterAttrs (n: u: u.uid == null) config.users.users);
|
||||
groupsWithoutGid = attrNames (filterAttrs (n: g: g.gid == null) config.users.groups);
|
||||
varLibNixosPersisted =
|
||||
varLibNixosPersistent =
|
||||
let
|
||||
varDirs = parentsOf "/var/lib/nixos" ++ [ "/var/lib/nixos" ];
|
||||
persistedDirs = catAttrs "dirPath" directories;
|
||||
mountedDirs = catAttrs "mountPoint" (attrValues config.fileSystems);
|
||||
persistedVarDirs = intersectLists varDirs persistedDirs;
|
||||
mountedVarDirs = intersectLists varDirs mountedDirs;
|
||||
in
|
||||
persistedVarDirs != [ ];
|
||||
persistedVarDirs != [ ] || mountedVarDirs != [ ];
|
||||
in
|
||||
mkIf (any id allPersistentStoragePaths.enableWarnings)
|
||||
(mkMerge [
|
||||
(mkIf (!varLibNixosPersisted && (usersWithoutUid != [ ] || groupsWithoutGid != [ ])) [
|
||||
(mkIf (!varLibNixosPersistent && (usersWithoutUid != [ ] || groupsWithoutGid != [ ])) [
|
||||
''
|
||||
environment.persistence:
|
||||
Neither /var/lib/nixos nor any of its parents are
|
||||
|
|
Loading…
Reference in a new issue