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
|
let
|
||||||
usersWithoutUid = attrNames (filterAttrs (n: u: u.uid == null) config.users.users);
|
usersWithoutUid = attrNames (filterAttrs (n: u: u.uid == null) config.users.users);
|
||||||
groupsWithoutGid = attrNames (filterAttrs (n: g: g.gid == null) config.users.groups);
|
groupsWithoutGid = attrNames (filterAttrs (n: g: g.gid == null) config.users.groups);
|
||||||
varLibNixosPersisted =
|
varLibNixosPersistent =
|
||||||
let
|
let
|
||||||
varDirs = parentsOf "/var/lib/nixos" ++ [ "/var/lib/nixos" ];
|
varDirs = parentsOf "/var/lib/nixos" ++ [ "/var/lib/nixos" ];
|
||||||
persistedDirs = catAttrs "dirPath" directories;
|
persistedDirs = catAttrs "dirPath" directories;
|
||||||
|
mountedDirs = catAttrs "mountPoint" (attrValues config.fileSystems);
|
||||||
persistedVarDirs = intersectLists varDirs persistedDirs;
|
persistedVarDirs = intersectLists varDirs persistedDirs;
|
||||||
|
mountedVarDirs = intersectLists varDirs mountedDirs;
|
||||||
in
|
in
|
||||||
persistedVarDirs != [ ];
|
persistedVarDirs != [ ] || mountedVarDirs != [ ];
|
||||||
in
|
in
|
||||||
mkIf (any id allPersistentStoragePaths.enableWarnings)
|
mkIf (any id allPersistentStoragePaths.enableWarnings)
|
||||||
(mkMerge [
|
(mkMerge [
|
||||||
(mkIf (!varLibNixosPersisted && (usersWithoutUid != [ ] || groupsWithoutGid != [ ])) [
|
(mkIf (!varLibNixosPersistent && (usersWithoutUid != [ ] || groupsWithoutGid != [ ])) [
|
||||||
''
|
''
|
||||||
environment.persistence:
|
environment.persistence:
|
||||||
Neither /var/lib/nixos nor any of its parents are
|
Neither /var/lib/nixos nor any of its parents are
|
||||||
|
|
Loading…
Reference in a new issue