summaryrefslogtreecommitdiff
path: root/hosts/local/master
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-05-17 07:24:14 +0000
committerpolwex <polwex@sortug.com>2025-05-17 07:24:14 +0000
commit9d89a55dff02122ebef9d8c7b388707084bac2fa (patch)
tree015a6a49ddc1f484960e7977e624d1d971a45453 /hosts/local/master
parentbb5002c60d57600ecb812720106a88df80d07362 (diff)
parent3efdd55d5cc2e784c6934e9d133f16844c324aad (diff)
Merge branch 'master' of mygit:/polwex/nixconf
Diffstat (limited to 'hosts/local/master')
-rw-r--r--hosts/local/master/configuration.nix51
-rw-r--r--hosts/local/master/hardware-configuration.nix48
-rw-r--r--hosts/local/master/keyboard.nix4
-rw-r--r--hosts/local/master/rgb.nix15
-rw-r--r--hosts/local/master/rtl8188gu.nix56
5 files changed, 140 insertions, 34 deletions
diff --git a/hosts/local/master/configuration.nix b/hosts/local/master/configuration.nix
index 375c10b..83de833 100644
--- a/hosts/local/master/configuration.nix
+++ b/hosts/local/master/configuration.nix
@@ -9,18 +9,19 @@
../../unfree.nix
#../../android.nix
../gui.nix
- ../i3.nix
+ # ../i3.nix
# ../gnome.nix
- # ../wayland.nix
+ ../wayland.nix
../nvidia.nix
./keyboard.nix
- ./rgb.nix
+ # ./rgb.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# boot.kernelPackages = pkgs.linuxPackages_latest;
+ boot.kernelPackages = pkgs.linuxPackages_zen;
boot.kernelParams = ["intel_pstate=active"];
# boot.supportedFilesystems = ["ntfs"];
services.fprintd.enable = true;
@@ -34,8 +35,14 @@
time.timeZone = "Asia/Bangkok";
# Enable the OpenSSH daemon.
- # services.openssh.enable = true;
- # services.openssh.ports = [5555];
+ services.openssh = {
+ enable = true;
+ ports = [5555];
+ settings.PasswordAuthentication = false;
+ };
+ services.tailscale = {
+ enable = true;
+ };
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
@@ -46,11 +53,13 @@
#
#
environment.systemPackages = [
- pkgs.nodejs
- pkgs.python312
+ # for AI IDE shit
+ # pkgs.nodejs
+ # pkgs.python312
# pkgs.openrgb-with-all-plugins
];
-
+ environment.etc."X11/xorg.conf.d/20-nvidia.conf".source = ./xorg.conf;
+ services.xserver.displayManager.xserverArgs = ["-config ${./xorg.conf}"];
system.stateVersion = "23.11"; # Did you read the comment?
#debugging segfaults
@@ -71,4 +80,30 @@
# Ensure the script is copied to the system
# environment.etc."startup.sh".source = ./startup.sh;
+ # temp!
+ # run vllm through docker (its broken in nixpkgs, but this may be better anyway?)
+ # virtualisation.oci-containers = {
+ # backend = "podman";
+ # containers = {
+ # vllm = {
+ # autoStart = false;
+ # image = "vllm/vllm-openai:latest";
+ # ports = ["5000:5000"];
+ # extraOptions = [
+ # "--runtime"
+ # "nvidia"
+ # "--gpus"
+ # "all"
+ # "--ipc"
+ # "host"
+ # "--pull=always"
+ # "--network=host"
+ # ];
+ # cmd = [
+ # "--model"
+ # "mistralai/Mistral-7B-v0.1"
+ # ];
+ # };
+ # };
+ # };
}
diff --git a/hosts/local/master/hardware-configuration.nix b/hosts/local/master/hardware-configuration.nix
index 6e2ed9f..8439f01 100644
--- a/hosts/local/master/hardware-configuration.nix
+++ b/hosts/local/master/hardware-configuration.nix
@@ -1,32 +1,38 @@
# 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")
- ];
+ config,
+ lib,
+ pkgs,
+ modulesPath,
+ ...
+}: let
+ rtl8188gu = config.boot.kernelPackages.callPackage ./rtl8188gu.nix {};
+in {
+ imports = [
+ (modulesPath + "/installer/scan/not-detected.nix")
+ ];
- boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
- boot.initrd.kernelModules = [ ];
- boot.kernelModules = [ "kvm-intel" ];
- boot.extraModulePackages = [ ];
+ boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
+ boot.initrd.kernelModules = [];
+ boot.kernelModules = ["kvm-intel"];
+ boot.extraModulePackages = [];
- fileSystems."/" =
- { device = "/dev/disk/by-uuid/3f1343f2-1ba3-4c57-b95e-bb808d3dffd3";
- fsType = "ext4";
- };
+ fileSystems."/" = {
+ device = "/dev/disk/by-uuid/3f1343f2-1ba3-4c57-b95e-bb808d3dffd3";
+ fsType = "ext4";
+ };
- fileSystems."/boot" =
- { device = "/dev/disk/by-uuid/C676-FD24";
- fsType = "vfat";
- options = [ "fmask=0077" "dmask=0077" ];
- };
+ fileSystems."/boot" = {
+ device = "/dev/disk/by-uuid/C676-FD24";
+ fsType = "vfat";
+ options = ["fmask=0077" "dmask=0077"];
+ };
- swapDevices =
- [ { device = "/dev/disk/by-uuid/e34d7981-458b-462a-b551-007bce4f40f9"; }
- ];
+ swapDevices = [
+ {device = "/dev/disk/by-uuid/e34d7981-458b-462a-b551-007bce4f40f9";}
+ ];
# 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
diff --git a/hosts/local/master/keyboard.nix b/hosts/local/master/keyboard.nix
index d6ba135..f148d74 100644
--- a/hosts/local/master/keyboard.nix
+++ b/hosts/local/master/keyboard.nix
@@ -31,10 +31,10 @@
keyboards = {
wirelessThinkpad = {
device = "/dev/input/by-id/usb-Lenovo_TrackPoint_Keyboard_II-event-kbd";
- config = builtins.readFile ./thinkpad2.kbd;
+ config = builtins.readFile ./thinkpad.kbd;
};
wiredThinkpad = {
- device = "/dev/input/by-id/usb-Lenovo_ThinkPad_Compact_USB_Keyboard_with_TrackPoint-event-kbd";
+ device = "/dev/input/by-id/usb-Lenovo_ThinkPad_Compact_usb_Keyboard_with_TrackPoint-event-kbd";
config = builtins.readFile ./thinkpad.kbd;
};
};
diff --git a/hosts/local/master/rgb.nix b/hosts/local/master/rgb.nix
index 66dbbfb..cd5ffae 100644
--- a/hosts/local/master/rgb.nix
+++ b/hosts/local/master/rgb.nix
@@ -14,9 +14,18 @@
in {
# config = {
# services.udev.packages = [pkgs.openrgb];
- services.hardware.openrgb.enable = true;
- # boot.kernelModules = ["i2c-dev"];
- # hardware.i2c.enable = true;
+ services.hardware.openrgb = {
+ enable = true;
+ motherboard = "intel";
+ package = pkgs.openrgb-with-all-plugins;
+ };
+ boot.kernelParams = ["acpi_enforce_resources=lax"];
+ boot.kernelModules = ["i2c-dev" "i2c-pii4"];
+ hardware.i2c.enable = true;
+ environment.systemPackages = with pkgs; [
+ i2c-tools
+ liquidctl
+ ];
# systemd.services.no-rgb = {
# description = "no-rgb";
diff --git a/hosts/local/master/rtl8188gu.nix b/hosts/local/master/rtl8188gu.nix
new file mode 100644
index 0000000..74aa78a
--- /dev/null
+++ b/hosts/local/master/rtl8188gu.nix
@@ -0,0 +1,56 @@
+{
+ stdenv,
+ lib,
+ fetchFromGitHub,
+ kernel,
+ bc,
+}: let
+ modDestDir = "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/net/wireless/realtek/rtl8188gu";
+in
+ stdenv.mkDerivation rec {
+ name = "r8188gu-${kernel.version}-${version}";
+ # on update please verify that the source matches the realtek version
+ version = "1.0";
+
+ src = fetchFromGitHub {
+ owner = "McMCCRU";
+ repo = "rtl8188gu";
+ rev = "bb3292dbb72ba6675b5465245eee0e69912f6e76";
+ hash = "sha256-ixu8v3ikTdqlNBEp6YrvuoDWKyi0RxjySXr+fTuO77Q=";
+ };
+
+ hardeningDisable = ["pic"];
+
+ nativeBuildInputs = kernel.moduleBuildDependencies ++ [bc];
+
+ preBuild =
+ ''
+ makeFlagsArray+=("KVER=${kernel.modDirVersion}")
+ makeFlagsArray+=("KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build")
+ makeFlagsArray+=("modules")
+
+ # try to make it work for v5.8 - but update_mgmt_frame_registrations is too different
+ #find -type f -exec sed -i 's/sha256_/rtl_sha256_/g ; s/timespec/timespec64/ ; s/getboottime/getboottime64/ ; s/mgmt_frame_register/update_mgmt_frame_registrations/g' {} \+
+ find -type f -exec sed -i 's/timespec/timespec64/ ; s/getboottime/getboottime64/ ; s/entry = proc_create_data.*/entry = NULL;/' {} \+
+ ''
+ + lib.optionalString stdenv.hostPlatform.isAarch64 ''
+ makeFlagsArray+=("ARCH=arm64")
+ '';
+
+ enableParallelBuilding = true;
+
+ installPhase = ''
+ mkdir -p ${modDestDir}
+ find . -name '*.ko' -exec cp --parents '{}' ${modDestDir} \;
+ find ${modDestDir} -name '*.ko' -exec xz -f '{}' \;
+ '';
+
+ meta = with lib; {
+ description = "Realtek RTL8188GU driver";
+ longDescription = ''
+ A kernel module for Realtek 8188 network cards.
+ '';
+ license = licenses.gpl2Plus;
+ platforms = platforms.linux;
+ };
+ }