summaryrefslogtreecommitdiff
path: root/hosts/common
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/common')
-rw-r--r--hosts/common/default.nix6
-rw-r--r--hosts/common/security.nix17
-rw-r--r--hosts/common/users.nix18
3 files changed, 41 insertions, 0 deletions
diff --git a/hosts/common/default.nix b/hosts/common/default.nix
new file mode 100644
index 0000000..32dad83
--- /dev/null
+++ b/hosts/common/default.nix
@@ -0,0 +1,6 @@
+{
+ imports = [
+ ./security.nix
+ ./users.nix
+ ];
+}
diff --git a/hosts/common/security.nix b/hosts/common/security.nix
new file mode 100644
index 0000000..debd6b7
--- /dev/null
+++ b/hosts/common/security.nix
@@ -0,0 +1,17 @@
+{ lib, config, ... }:
+
+with builtins; with lib;
+{
+ security.sudo = {
+ configFile = ''
+ Defaults env_reset
+ Defaults secure_path = /run/wrappers/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin
+ Defaults editor = /run/current-system/sw/bin/vim,!env_editor
+ '';
+ execWheelOnly = true;
+ extraRules = [
+ { users = [ "root" ]; groups = [ "root" ]; commands = [ "ALL" ]; }
+ { users = [ "seth" ]; commands = [ "ALL" ]; }
+ ];
+ };
+}
diff --git a/hosts/common/users.nix b/hosts/common/users.nix
new file mode 100644
index 0000000..1dd219e
--- /dev/null
+++ b/hosts/common/users.nix
@@ -0,0 +1,18 @@
+{ config, lib, pkgs, ... }:
+
+with config; with lib; with pkgs;
+{
+ users = {
+ defaultUserShell = bash;
+ mutableUsers = false;
+
+ users = {
+
+ root = {
+ home = "/root";
+ uid = ids.uids.root;
+ group = "root";
+ initialHashedPassword = mkDefault "!";
+ };
+
+}