about summary refs log tree commit diff stats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/impermanence/default.nix33
-rw-r--r--system/network/default.nix12
-rw-r--r--system/users/default.nix1
3 files changed, 34 insertions, 12 deletions
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"
       ];
diff --git a/system/network/default.nix b/system/network/default.nix
index b613c76a..2a68d7ce 100644
--- a/system/network/default.nix
+++ b/system/network/default.nix
@@ -1,5 +1,10 @@
 # vim: ts=2
-{config, ...}: {
+{
+  config,
+  lib,
+  ...
+}:
+{
   systemd.network = {
     networks = {
       "tap0" = {
@@ -40,3 +45,8 @@
     };
   };
 }
+// lib.mkIf config.networking.networkmanager.enable {
+  users.users.soispha.extraGroups = [
+    "networkmanager" # allows to configure networkmanager as this user
+  ];
+}
diff --git a/system/users/default.nix b/system/users/default.nix
index d2fc27fd..96925671 100644
--- a/system/users/default.nix
+++ b/system/users/default.nix
@@ -34,7 +34,6 @@ in {
         extraGroups = [
           "plugdev" # although deprecated, this helps with old udev rules, that still use this group. TODO check for an open issue
           "wheel"
-          "networkmanager" # if I activate network-manager, this will help
           "libvirtd" # needed to run libvirt stuff as this user
           "scanner" # needed for permission to access the scanner
         ];