summaryrefslogtreecommitdiff
path: root/modules/root
diff options
context:
space:
mode:
Diffstat (limited to 'modules/root')
-rw-r--r--modules/root/default.nix1
-rw-r--r--modules/root/doas.nix6
-rw-r--r--modules/root/docker.nix4
-rw-r--r--modules/root/normaluser.nix8
-rw-r--r--modules/root/software.nix6
5 files changed, 18 insertions, 7 deletions
diff --git a/modules/root/default.nix b/modules/root/default.nix
index 05453b4..b03fab4 100644
--- a/modules/root/default.nix
+++ b/modules/root/default.nix
@@ -9,6 +9,7 @@
./hosts.nix
./localization.nix
./nix.nix
+ ./normaluser.nix
./pipewire.nix
./software.nix
./virtualisation.nix
diff --git a/modules/root/doas.nix b/modules/root/doas.nix
index 2af324e..54cf63a 100644
--- a/modules/root/doas.nix
+++ b/modules/root/doas.nix
@@ -4,10 +4,10 @@
sudo.enable = lib.mkEnableOption "enables sudo";
};
- config = lib.mkIf config.doas.enable {
- security.doas.enable = true;
+ config = {
security.sudo.enable = config.sudo.enable;
- security.doas.extraRules = [{
+ security.doas.enable = config.doas.enable;
+ security.doas.extraRules = lib.mkIf config.doas.enable [{
groups = ["wheel"];
keepEnv = true;
noPass = true;
diff --git a/modules/root/docker.nix b/modules/root/docker.nix
index d4b6272..2499699 100644
--- a/modules/root/docker.nix
+++ b/modules/root/docker.nix
@@ -1,4 +1,4 @@
-{ pkgs, lib, config, ... }: {
+{ pkgs, lib, config, userDetails, ... }: {
options = {
docker.enable = lib.mkEnableOption "enables docker";
docker.btrfsSupport = lib.mkEnableOption "changes docker storageDriver to btrfs";
@@ -13,5 +13,7 @@
environment.systemPackages = with pkgs; [
docker-compose
];
+
+ users.groups.docker.members = [ userDetails.username ];
};
}
diff --git a/modules/root/normaluser.nix b/modules/root/normaluser.nix
new file mode 100644
index 0000000..5d436e8
--- /dev/null
+++ b/modules/root/normaluser.nix
@@ -0,0 +1,8 @@
+{ userDetails, ... }: {
+ users.users.${userDetails.username} = {
+ description = userDetails.fullname;
+ home = userDetails.home.root;
+ isNormalUser = true;
+ extraGroups = [ "wheel" ];
+ };
+}
diff --git a/modules/root/software.nix b/modules/root/software.nix
index c991456..4aa6f64 100644
--- a/modules/root/software.nix
+++ b/modules/root/software.nix
@@ -80,11 +80,11 @@
];
# More desktop
- programs.dconf.enable = lib.mkIf config.software.desktop.enable true; # For home-manager to configure gtk TODO this should be there instead
+ programs.dconf.enable = config.software.desktop.enable; # For home-manager to configure gtk TODO this should be there instead
# More utilities
- programs.zsh.enable = lib.mkIf config.software.utils.enable true;
+ programs.zsh.enable = config.software.utils.enable;
users.defaultUserShell = lib.mkIf config.software.utils.enable pkgs.zsh;
- services.openssh.enable = lib.mkIf config.software.utils.enable true;
+ services.openssh.enable = config.software.utils.enable;
};
}