From f342ac6f9d4b1d9911e0c7fa75139d0e39257720 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sat, 23 Sep 2023 13:06:15 -0700 Subject: [PATCH] Configuration for pang13 --- hosts/default.nix | 23 ++++++++++++++ hosts/desktop.nix | 5 ++++ hosts/desktop/default.nix | 5 ---- hosts/home-desktop.nix | 2 +- hosts/pang13/apps.nix | 5 ++++ hosts/pang13/default.nix | 40 +++++++++++++++++++++++++ hosts/pang13/hardware-configuration.nix | 40 +++++++++++++++++++++++++ hosts/pang13/home.nix | 9 ++++++ hosts/thinkpads/default.nix | 7 +++++ modules/polybar/default.nix | 8 +++++ 10 files changed, 138 insertions(+), 6 deletions(-) create mode 100644 hosts/pang13/apps.nix create mode 100644 hosts/pang13/default.nix create mode 100644 hosts/pang13/hardware-configuration.nix create mode 100644 hosts/pang13/home.nix diff --git a/hosts/default.nix b/hosts/default.nix index d46dd51..bacc4f3 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -45,6 +45,29 @@ in ]; }; + pang13 = lib.nixosSystem { + inherit system; + specialArgs = { inherit user; }; + modules = configImports ++ [ + ./pang13 + ./desktop.nix + { + boot.loader.grub.gfxmodeEfi = "1920x1080"; + networking.hostName = "pang13"; + } + home-manager.nixosModules.home-manager { + home-manager = { + useUserPackages = true; + extraSpecialArgs = hmArgs; + users.${user} = { + imports = desktopHmImports ++ [ + (import ./pang13/home.nix) + ]; + }; + }; + } + ]; + }; x220 = lib.nixosSystem { inherit system; diff --git a/hosts/desktop.nix b/hosts/desktop.nix index 23afc22..db12767 100644 --- a/hosts/desktop.nix +++ b/hosts/desktop.nix @@ -80,4 +80,9 @@ in twitter-color-emoji ]; }; + + hardware.opengl = { + enable = true; + driSupport32Bit = true; # Required for Touhou, Steam + }; } diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index 810905a..1cee5da 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -22,11 +22,6 @@ allowedUDPPorts = [ config.services.tailscale.port ]; }; - hardware.opengl = { - enable = true; - driSupport32Bit = true; # Required for Touhou - }; - boot.loader = { efi = { canTouchEfiVariables = true; diff --git a/hosts/home-desktop.nix b/hosts/home-desktop.nix index 6f3a0b4..5171238 100644 --- a/hosts/home-desktop.nix +++ b/hosts/home-desktop.nix @@ -7,7 +7,7 @@ in imports = [ ./apps.nix ../modules/bash - ../modules/emacs + #../modules/emacs ../modules/fcitx5 ../modules/firefox ../modules/git diff --git a/hosts/pang13/apps.nix b/hosts/pang13/apps.nix new file mode 100644 index 0000000..dfac2e4 --- /dev/null +++ b/hosts/pang13/apps.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: + +{ + home.packages = with pkgs; [ ]; +} diff --git a/hosts/pang13/default.nix b/hosts/pang13/default.nix new file mode 100644 index 0000000..b6dfe4b --- /dev/null +++ b/hosts/pang13/default.nix @@ -0,0 +1,40 @@ +{ config, pkgs, lib, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + services.blueman.enable = true; + + services.tailscale.enable = true; + + boot.loader.efi.canTouchEfiVariables = true; + + boot.loader.grub = { + enable = true; + efiSupport = true; + enableCryptodisk = true; + device = "nodev"; + useOSProber = true; + }; + + boot.initrd.luks.devices = { + crypted = { + device = "/dev/disk/by-uuid/24bc9d4e-fc76-4b70-ba95-8533c416a9d0"; + preLVM = true; + }; + }; + + # Support mounting NTFS partitions + boot.supportedFilesystems = [ "ntfs" ]; + + # audio controls and polybar module don't work on pipewire + hardware.pulseaudio = { + enable = true; + support32Bit = true; + }; + services.pipewire.enable = lib.mkForce false; +} + diff --git a/hosts/pang13/hardware-configuration.nix b/hosts/pang13/hardware-configuration.nix new file mode 100644 index 0000000..1683eb3 --- /dev/null +++ b/hosts/pang13/hardware-configuration.nix @@ -0,0 +1,40 @@ +# 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 = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-label/boot"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + hardware.system76.enableAll = true; +} diff --git a/hosts/pang13/home.nix b/hosts/pang13/home.nix new file mode 100644 index 0000000..b3d07c9 --- /dev/null +++ b/hosts/pang13/home.nix @@ -0,0 +1,9 @@ +{ ... }: + +{ + imports = [ + (import ./apps.nix) + (import ../thinkpads/i3.nix) + (import ../thinkpads/polybar.nix) + ]; +} diff --git a/hosts/thinkpads/default.nix b/hosts/thinkpads/default.nix index 144e773..f998798 100644 --- a/hosts/thinkpads/default.nix +++ b/hosts/thinkpads/default.nix @@ -22,4 +22,11 @@ enable = true; touchpad.tapping = true; }; + + # audio controls and polybar module don't work on pipewire + hardware.pulseaudio = { + enable = true; + support32Bit = true; + }; + services.pipewire.enable = false; } diff --git a/modules/polybar/default.nix b/modules/polybar/default.nix index c0fcf6d..886a697 100644 --- a/modules/polybar/default.nix +++ b/modules/polybar/default.nix @@ -82,6 +82,14 @@ in with theme.colors; exec = "/run/current-system/sw/bin/sleep 3 && /etc/profiles/per-user/elnu/bin/aozora air-quality-in-lakewood-aw-341300 --bar 2> /dev/null"; interval = 1800; }; + # Have to override because default exec doesn't work + "module/cputemp" = lib.mkForce { + type = "custom/script"; + fromat = "