ctucx.git: nixfiles

ctucx' nixfiles

commit 929cbf4a4ebd5bb79c3d5d52ef7d99e1b60d2100
parent 85c8aa92f6cdc3b9a7dc2fe4808bcce78e7ca47b
Author: Leah (ctucx) <leah@ctu.cx>
Date: Wed, 12 Jan 2022 18:08:36 +0100

machines: add coladose, stasicontainer
4 files changed, 206 insertions(+), 0 deletions(-)
A
machines/coladose/configuration.nix
|
66
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
machines/coladose/hardware-configuration.nix
|
31
+++++++++++++++++++++++++++++++
A
machines/stasicontainer/configuration.nix
|
75
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
machines/stasicontainer/hardware-configuration.nix
|
34
++++++++++++++++++++++++++++++++++
diff --git a/machines/coladose/configuration.nix b/machines/coladose/configuration.nix
@@ -0,0 +1,66 @@
+{ config, pkgs, lib, ... }:
+
+{
+  imports = [
+    ./hardware-configuration.nix
+    ../../configurations/mobile-device.nix
+    ../../configurations/common.nix
+    ../../configurations/bluetooth.nix
+    ../../configurations/desktop-sway.nix
+  ];
+
+  hardware.cpu.intel.updateMicrocode = true;
+
+  boot = {
+    loader = {
+      systemd-boot.enable = true;
+      efi.canTouchEfiVariables = true;
+    };
+
+    consoleLogLevel               = 3;
+    kernel.sysctl."vm.swappiness" = 0;
+    kernel.sysctl."kernel/sysrq"  = 1;
+    kernelModules                 = [ "tpm-rng" ];
+    kernelParams = [
+      "quiet"
+      "scsi_mod.use_blk_mq=1"
+      "modeset"
+      "nofb"
+      "rd.systemd.show_status=auto"
+      "rd.udev.log_priority=3"
+      "pti=off"
+      "spectre_v2=off"
+    ];
+
+    extraModprobeConfig = lib.mkMerge [
+      "options ec_sys write_support=1"
+      "options iwlwifi power_save=0 uapsd_disable=1"
+    ];
+
+    initrd.availableKernelModules = [ "i915" ];
+  };
+
+  networking = {
+    hostName                       = "coladose";
+#   domain                         = "ctu.cx";
+
+    dhcpcd = {
+      enable = true;
+      extraConfig = ''
+        duid 04:ea:56:f3:0b:5b
+      '';
+    };
+
+    wireless = {
+      iwd.enable = true;
+    };
+
+    firewall = {
+      enable = true;
+#      allowedTCPPorts = [ ];
+    };
+  };
+
+  home-manager.users.leah.home.stateVersion = "21.05";
+  system.stateVersion = "21.05"; # Did you read the comment?
+}
diff --git a/machines/coladose/hardware-configuration.nix b/machines/coladose/hardware-configuration.nix
@@ -0,0 +1,31 @@
+# Do not modify this file!  It was generated by ‘nixos-generate-config’
+# and may be overwritten by future invocations.  Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, lib, pkgs, modulesPath, ... }:
+
+{
+  imports =
+    [ (modulesPath + "/installer/scan/not-detected.nix")
+    ];
+
+  boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ];
+  boot.initrd.kernelModules = [ ];
+  boot.kernelModules = [ ];
+  boot.extraModulePackages = [ ];
+
+  fileSystems."/" =
+    { device = "/dev/disk/by-uuid/1d97b287-1602-4b1d-8300-67d065f8b43b";
+      fsType = "ext4";
+    };
+
+  boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/61d7aff2-1d45-41cc-8e2b-0ac8dd17946e";
+
+  fileSystems."/boot" =
+    { device = "/dev/disk/by-uuid/863E-0E85";
+      fsType = "vfat";
+    };
+
+  swapDevices = [ ];
+
+  powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
+}
diff --git a/machines/stasicontainer/configuration.nix b/machines/stasicontainer/configuration.nix
@@ -0,0 +1,75 @@
+{ config, pkgs, lib, ... }:
+
+{
+  imports = [
+    ./hardware-configuration.nix
+    ../../configurations/common.nix
+    ../../configurations/desktop-sway.nix
+    ../../configurations/programs/ddcutil.nix
+    ../../configurations/programs/spotifyd.nix
+    ../../configurations/desktop-speakers.nix
+    ../../configurations/sdr.nix
+  ];
+
+  hardware.cpu.intel.updateMicrocode = true;
+
+  boot = {
+    loader = {
+      systemd-boot.enable = true;
+      efi.canTouchEfiVariables = true;
+    };
+
+    consoleLogLevel               = 3;
+    kernel.sysctl."vm.swappiness" = 0;
+    kernel.sysctl."kernel/sysrq"  = 1;
+    extraModulePackages           = with config.boot.kernelPackages; [ ddcci-driver ];
+    kernelModules                 = [ "tpm-rng" "ddcci-backlight" ];
+    kernelParams = [
+      "quiet"
+      "scsi_mod.use_blk_mq=1"
+      "modeset"
+      "nofb"
+      "rd.systemd.show_status=auto"
+      "rd.udev.log_priority=3"
+      "pti=off"
+      "spectre_v2=off"
+    ];
+
+    extraModprobeConfig = lib.mkMerge [
+      "options ec_sys write_support=1"
+    ];
+
+    initrd.availableKernelModules = [ "i915" ];
+  };
+
+  networking = {
+#    useNetworkd = true;
+#    useDHCP     = false;
+    hostName    = "stasicontainer";
+#   domain      = "ctu.cx";
+
+    interfaces.eno1 = {
+      useDHCP          = true;
+      wakeOnLan.enable = true;
+    };
+
+    dhcpcd = {
+      enable = true;
+      extraConfig = ''
+        duid e8:6a:64:f4:49:e7
+      '';
+    };
+
+#    wireless = {
+#      iwd.enable = true;
+#    };
+
+    firewall = {
+      enable = true;
+      allowedTCPPorts = [ 8000 ];
+    };
+  };
+
+  home-manager.users.leah.home.stateVersion = "21.11";
+  system.stateVersion = "21.11"; # Did you read the comment?
+}
diff --git a/machines/stasicontainer/hardware-configuration.nix b/machines/stasicontainer/hardware-configuration.nix
@@ -0,0 +1,34 @@
+# Do not modify this file!  It was generated by ‘nixos-generate-config’
+# and may be overwritten by future invocations.  Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, lib, pkgs, modulesPath, ... }:
+
+{
+  imports =
+    [ (modulesPath + "/installer/scan/not-detected.nix")
+    ];
+
+  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
+  boot.initrd.kernelModules = [ ];
+  boot.kernelModules = [ "kvm-intel" ];
+  boot.extraModulePackages = [ ];
+
+  fileSystems."/" =
+    { device = "/dev/disk/by-uuid/3d7e34de-89f3-4658-a315-80b9d0aadf62";
+      fsType = "ext4";
+    };
+
+  boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/20abb5f4-b84b-4d93-996d-7b7b4d90b1f0";
+
+  fileSystems."/boot" =
+    { device = "/dev/disk/by-uuid/C3ED-47DE";
+      fsType = "vfat";
+    };
+
+  swapDevices = [ ];
+
+  powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
+  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+  # high-resolution display
+  hardware.video.hidpi.enable = lib.mkDefault true;
+}