about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2022-11-10 13:41:58 +0000
committerDavid Morgan <djm_uk@protonmail.com>2022-11-10 13:41:58 +0000
commit5cf952800fbc8b4cd8adec4ff2d5f338d127111e (patch)
tree4827198f6d6f4b65cead761d5aa0a263a95aab4c
parentaf68928f3ac50e80c96be074dfb747e978e0966a (diff)
downloaddotfiles-5cf952800fbc8b4cd8adec4ff2d5f338d127111e.tar.gz
Add djmuk2 config
-rw-r--r--nix-conf/machines/djmuk2/configuration.nix70
-rw-r--r--nix-conf/machines/djmuk2/hardware-configuration.nix14
2 files changed, 84 insertions, 0 deletions
diff --git a/nix-conf/machines/djmuk2/configuration.nix b/nix-conf/machines/djmuk2/configuration.nix
new file mode 100644
index 0000000..d115655
--- /dev/null
+++ b/nix-conf/machines/djmuk2/configuration.nix
@@ -0,0 +1,70 @@
+{ config, pkgs, ... }: {
+  imports = [
+    ./hardware-configuration.nix
+  ];
+
+  boot.cleanTmpDir = true;
+  zramSwap.enable = true;
+
+  networking.hostName = "djmuk2";
+  networking.firewall = {
+    enable = true;
+    allowedTCPPorts = [ 113 ];
+  };
+
+  services.openssh = {
+    enable = true;
+    permitRootLogin = "no";
+    passwordAuthentication = false;
+    kbdInteractiveAuthentication = false;
+    extraConfig = ''
+      #AllowTcpForwarding yes
+      X11Forwarding no
+      AllowAgentForwarding no
+      AllowStreamLocalForwarding no
+      AuthenticationMethods publickey
+      AllowUsers djm
+    '';
+  };
+  services.sshguard.enable = true;
+  services.oidentd.enable = true;
+
+  services.locate = {
+    enable = true;
+    locate = pkgs.plocate;
+    localuser = null;
+  };
+
+  users.users.djm =
+   { isNormalUser = true;
+     home = "/home/djm";
+     description = "David Morgan";
+     extraGroups = [ "wheel" "plocate" ];
+     shell = pkgs.zsh;
+     openssh.authorizedKeys.keys = [
+      "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCurCpxZCHtByB5wXzsjTXwMyDSB4+B8rq5XY6EGss58NwD8jc5cII4i+QUbCOGTiAggSZUSC9YIP24hjpOeNT/IYs5m7Qn1B9MtBAiUSrIYew8eDwnMLlPzN+k2x9zCrJeCHIvGJaFHPXTh1Lf5Jt2fPVGW9lksE/XUVOe6ht4N/b+nqqszXFhc8Ug6le2bC1YeTCVEf8pjlh/I7DkDBl6IB8uEXc3X2vxxbV0Z4vlBrFkkAywcD3j5VlS/QYfBr4BICNmq/sO3fMkbMbtAPwuFxeL4+h6426AARQZiSS0qVEc8OoFRBVx3GEH5fqVAWfB1geyLzei22HbjUcT9+xN davidmo@gendros"
+      "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK9UDTaVnUOU/JknrNdihlhhGOk53LmHq9I1ASri3aga djm@gaius"
+     ];
+   };
+
+   security.sudo.extraConfig = ''
+     djm ALL=(ALL) NOPASSWD: ALL
+   '';
+   security.doas = {
+     enable = true;
+     extraRules = [ { users = [ "djm" ]; noPass = true; keepEnv = true; } ];
+   };
+
+   environment.systemPackages = with pkgs; [
+     #procmail
+     git
+     vim
+     wget
+   ];
+   environment.variables = { EDITOR = "vim"; VISUAL = "vim"; };
+
+   nix.trustedUsers = [ "root" "djm" ];
+
+   system.stateVersion = "22.05";
+}
+
diff --git a/nix-conf/machines/djmuk2/hardware-configuration.nix b/nix-conf/machines/djmuk2/hardware-configuration.nix
new file mode 100644
index 0000000..e27e899
--- /dev/null
+++ b/nix-conf/machines/djmuk2/hardware-configuration.nix
@@ -0,0 +1,14 @@
+{ modulesPath, ... }:
+{
+  imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
+  boot.loader.grub = {
+    efiSupport = true;
+    efiInstallAsRemovable = true;
+    device = "nodev";
+  };
+  fileSystems."/boot" = { device = "/dev/disk/by-uuid/4875-017B"; fsType = "vfat"; };
+  boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" ];
+  boot.initrd.kernelModules = [ "nvme" ];
+  fileSystems."/" = { device = "/dev/mapper/ocivolume-root"; fsType = "xfs"; };
+  
+}