about summary refs log tree commit diff
diff options
context:
space:
mode:
authordevhell <devhell@mailfresser.de>2021-02-01 16:41:59 +0000
committerdevhell <devhell@mailfresser.de>2021-02-01 16:41:59 +0000
commit310feaac45980531979ef8640a6c3481021fb855 (patch)
tree71664056a16160897080858aa6bd06dfc4823fe1
parente96877eb761375075c138085c99d36b7f336d274 (diff)
machines: Add herja
Shiny new machine needs NixOS love. <3
-rw-r--r--machines/default.nix7
-rw-r--r--machines/devhell/herja.nix197
2 files changed, 201 insertions, 3 deletions
diff --git a/machines/default.nix b/machines/default.nix
index 00036e8b..75b5d5fd 100644
--- a/machines/default.nix
+++ b/machines/default.nix
@@ -13,9 +13,10 @@ with import ../lib;
   };
   devhell = {
     eir       = callMachine devhell/eir.nix {};
-    sigrun = callMachine devhell/sigrun.nix {};
-    hildr      = callMachine devhell/hildr.nix {};
-    gunnr      = callMachine devhell/gunnr.nix {};
+    sigrun    = callMachine devhell/sigrun.nix {};
+    hildr     = callMachine devhell/hildr.nix {};
+    gunnr     = callMachine devhell/gunnr.nix {};
+    herja     = callMachine devhell/herja.nix {}; 
   };
   profpatsch = {
     shiki = callMachine ./profpatsch/shiki.nix {};
diff --git a/machines/devhell/herja.nix b/machines/devhell/herja.nix
new file mode 100644
index 00000000..d653a8a6
--- /dev/null
+++ b/machines/devhell/herja.nix
@@ -0,0 +1,197 @@
+{ config, pkgs, lib, ... }:
+
+{
+  vuizvui.user.devhell.profiles.base.enable = true;
+  vuizvui.system.kernel.bfq.enable = true;
+
+  boot = {
+    loader = {
+      timeout = 2;
+      systemd-boot = {
+        enable = true;
+      };
+
+      efi.canTouchEfiVariables = true;
+    };
+
+    initrd = {
+      availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
+      kernelModules = [ "fuse" ];
+    };
+
+    kernelModules = [ "kvm-amd" ];
+    extraModulePackages = [ ];
+  };
+
+  hardware = {
+    cpu.amd.updateMicrocode = true;
+    opengl = {
+      enable = true;
+      extraPackages = [ pkgs.libvdpau-va-gl pkgs.vaapiVdpau pkgs.amdvlk ];
+    };
+  };
+
+  fileSystems."/" = {
+    device = "/dev/disk/by-uuid/34c21c91-6722-427d-882b-6da0e2f57f50";
+    fsType = "btrfs";
+    options = [
+      "space_cache"
+      "compress=zstd"
+      "noatime"
+      "autodefrag"
+    ];
+  };
+
+  fileSystems."/boot" = {
+    device = "/dev/disk/by-uuid/18B4-40B0";
+    fsType = "vfat";
+  };
+
+  # FIXME Check if this is still necessary in the future
+  systemd.services.systemd-networkd-wait-online.enable = false;
+
+  # XXX Make networkd ignore virtual network interfaces
+  systemd.network.networks."99-libvirt" = {
+    matchConfig.Name = "virbr* vnet*";
+    linkConfig.Unmanaged = true;
+  };
+
+  networking = {
+    hostName = "herja";
+    wireless.enable = true;
+    useNetworkd = true;
+    interfaces = {
+      enp2s0f0.useDHCP = true;
+      wlp3s0.useDHCP = true;
+    };
+  };
+
+  powerManagement = {
+    powertop.enable = true;
+    cpuFreqGovernor = "powersave";
+  };
+
+  nix = {
+    maxJobs = lib.mkDefault 8;
+    extraOptions = ''
+      auto-optimise-store = true
+    '';
+  };
+
+  i18n = {
+    defaultLocale = "en_GB.UTF-8";
+  };
+
+  console = {
+    font = "Lat2-Terminus16";
+    keyMap = "uk";
+  };
+
+  #### Machine-specific service configuration ####
+
+  vuizvui.user.devhell.profiles.services.enable = true;
+
+  services = {
+    thermald.enable = true;
+    gnome3.gnome-keyring.enable = true;
+    printing = {
+      enable = true;
+      drivers = [ pkgs.foo2zjs pkgs.cups-brother-hl1110 ];
+    };
+    offlineimap = {
+      enable = true;
+      install = true;
+      path = [ pkgs.notmuch ];
+    };
+    syncthing = {
+      enable = true;
+      user = "dev";
+      dataDir = "/home/dev/syncthing/";
+    };
+  };
+
+#  services.actkbd = {
+#    enable = true;
+#    bindings = [
+#      { keys = [ 224 ]; events = [ "key" ]; command = "${pkgs.light}/bin/light -U 5"; }
+#      { keys = [ 225 ]; events = [ "key" ]; command = "${pkgs.light}/bin/light -A 5"; }
+#    ];
+#  };
+
+  services.acpid = {
+    enable = true;
+#    lidEventCommands = ''
+#      LID="/proc/acpi/button/lid/LID/state"
+#      state=`cat $LID | ${pkgs.gawk}/bin/awk '{print $2}'`
+#      case "$state" in
+#        *open*) ;;
+#        *close*) systemctl suspend ;;
+#        *) logger -t lid-handler "Failed to detect lid state ($state)" ;;
+#      esac
+#    '';
+  };
+
+  services.xserver = {
+    enable = true;
+    layout = "gb";
+    videoDrivers = [ "modesetting" ];
+
+    libinput = {
+      enable = true;
+      disableWhileTyping = true;
+      middleEmulation = true;
+    };
+#    synaptics = {
+#      enable = true;
+#      twoFingerScroll = true;
+#      palmDetect = true;
+#    };
+
+    # XXX: Factor out and make DRY, because a lot of the stuff here is
+    # duplicated in the other machine configurations.
+    displayManager.sessionCommands = ''
+      ${pkgs.xbindkeys}/bin/xbindkeys &
+      ${pkgs.nitrogen}/bin/nitrogen --restore &
+      ${pkgs.rofi}/bin/rofi &
+      ${pkgs.xorg.xrdb}/bin/xrdb "${pkgs.writeText "xrdb.conf" ''
+        Xft.dpi:                     96
+        Xft.antialias:               true
+        Xft.hinting:                 full
+        Xft.hintstyle:               hintslight
+        Xft.rgba:                    rgb
+        Xft.lcdfilter:               lcddefault
+        Xft.autohint:                1
+        Xcursor.theme:               Vanilla-DMZ-AA
+        Xcursor.size:                22
+        *.charClass:33:48,35:48,37:48,43:48,45-47:48,61:48,63:48,64:48,95:48,126:48,35:48,58:48
+      ''}"
+    '';
+  };
+
+  #### Machine-specific packages configuration ####
+
+  vuizvui.user.devhell.profiles.packages.enable = true;
+
+  nixpkgs.config.mpv.vaapiSupport = true;
+
+  programs = {
+    light.enable = true;
+    wavemon.enable = true;
+  };
+
+  environment.systemPackages = with pkgs; [
+    aircrackng
+    horst
+    ipmitool
+    iw
+    libva
+    libvdpau-va-gl
+    minicom
+    pmtools
+    pmutils
+    teams
+    vaapiVdpau
+    vdpauinfo
+    xbindkeys
+  ];
+}