From 4d1a37c96bd5dbf31e543adad294edc0b0c3cae2 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 20 May 2023 07:43:36 +0200 Subject: Fix(system): Add configs for networkmanager only if it's enabled --- system/impermanence/default.nix | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'system/impermanence/default.nix') diff --git a/system/impermanence/default.nix b/system/impermanence/default.nix index 71b023ff..3c859688 100644 --- a/system/impermanence/default.nix +++ b/system/impermanence/default.nix @@ -1,19 +1,32 @@ -{...}: { +{ + config, + lib, + ... +}: let + networkmanager = + if config.networking.networkmanager.enable + then [ + "/etc/NetworkManager" # store the networkmanager configs + ] + else []; + directories = + [ + "/etc/nixos" + "/var/log" + # TODO the following entries need to be checked + #"/var/lib/bluetooth" + #"/var/lib/nixos" + #"/var/lib/systemd/coredump" + ] + ++ networkmanager; +in { # needed for the hm impermanence config programs.fuse.userAllowOther = true; environment.persistence = { "/srv" = { hideMounts = true; - directories = [ - "/etc/nixos" - "/var/log" - "/etc/NetworkManager" # this shouldn't hurt even if networkmanager isn't installed - # TODO this needs to be checked - #"/var/lib/bluetooth" - #"/var/lib/nixos" - #"/var/lib/systemd/coredump" - ]; + inherit directories; files = [ "/etc/machine-id" ]; -- cgit 1.4.1