aboutsummaryrefslogtreecommitdiffstats
path: root/hosts/pihlaja
diff options
context:
space:
mode:
authorPetri Hienonen <petri.hienonen@gmail.com>2024-05-23 13:56:00 +0300
committerPetri Hienonen <petri.hienonen@gmail.com>2025-11-30 12:29:57 +0200
commit08297376a85a1719518507e54fca9de954d2376a (patch)
tree3b9c58304b40248533bbb2bb5b7bad2da9da1ff0 /hosts/pihlaja
parent75c2af4aedd2ac5c2cfc74b346625fa4b265541d (diff)
downloadnixos-08297376a85a1719518507e54fca9de954d2376a.tar.zst
Agenix configuration
Diffstat (limited to '')
-rw-r--r--hosts/pihlaja/default.nix269
-rw-r--r--hosts/pihlaja/hardware-configuration.nix80
2 files changed, 349 insertions, 0 deletions
diff --git a/hosts/pihlaja/default.nix b/hosts/pihlaja/default.nix
new file mode 100644
index 0000000..8101815
--- /dev/null
+++ b/hosts/pihlaja/default.nix
@@ -0,0 +1,269 @@
+# Edit this configuration file to define what should be installed on
+# your system. Help is available in the configuration.nix(5) man page
+# and in the NixOS manual (accessible by running ‘nixos-help’).
+
+{
+ inputs,
+ outputs,
+ lib,
+ config,
+ pkgs,
+ vars,
+ ...
+}:
+
+{
+ imports = [ ./hardware-configuration.nix ];
+
+ hardware = {
+ bluetooth.enable = true;
+ keyboard.qmk.enable = true;
+ logitech.wireless.enable = true;
+ nvidia = {
+ modesetting.enable = true;
+ powerManagement = {
+ enable = true;
+ finegrained = false;
+ };
+ open = true;
+ nvidiaSettings = false;
+ package = config.boot.kernelPackages.nvidiaPackages.latest;
+ };
+ graphics = {
+ extraPackages = with pkgs; [
+ nvidia-vaapi-driver
+ cudatoolkit
+ ];
+ };
+
+ bluetooth.settings.General.Name = "pihlaja";
+ };
+
+ networking = {
+ hostName = "pihlaja";
+ interfaces.enp5s0.wakeOnLan.enable = true;
+ };
+
+ environment = {
+ sessionVariables = {
+ LIBVA_DRIVER_NAME = "nvidia";
+ VK_DRIVER_FILES = "/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json";
+ GBM_BACKEND = "nvidia-drm";
+ __GLX_VENDOR_LIBRARY_NAME = "nvidia";
+ NVD_BACKEND = "direct";
+ };
+ systemPackages = with pkgs; [
+ logiops
+ qmk_hid
+ qmk
+ via
+ qmk-udev-rules
+ ];
+ };
+
+ services.hardware.openrgb = {
+ enable = true;
+ package = pkgs.openrgb-with-all-plugins;
+ motherboard = "amd";
+ server = {
+ port = 6742;
+ };
+ };
+
+ systemd = {
+ network = {
+ enable = true;
+ wait-online.enable = false;
+ config = {
+ networkConfig = {
+ SpeedMeter = true;
+ };
+ };
+ networks = {
+ "10-wlan" = {
+ matchConfig.MACAddress = "34:cf:f6:25:c7:db";
+ linkConfig = {
+ Multicast = true;
+ };
+ networkConfig = {
+ DHCP = "yes";
+ IPv6AcceptRA = true;
+ MulticastDNS = true;
+ LinkLocalAddressing = "ipv6";
+ DNSSEC = true;
+ UseDomains = true;
+ };
+ dhcpV4Config = {
+ RouteMetric = 100;
+ UseDNS = true;
+ UseMTU = true;
+ };
+ ipv6AcceptRAConfig = {
+ UseMTU = true;
+ };
+ linkConfig.RequiredForOnline = "yes";
+ };
+ "11-lan" = {
+ matchConfig.MACAddress = "18:c0:4d:04:cf:e9";
+ linkConfig = {
+ Multicast = true;
+ };
+ networkConfig = {
+ DHCP = "yes";
+ IPv6AcceptRA = true;
+ MulticastDNS = true;
+ LinkLocalAddressing = "ipv6";
+ DNSSEC = true;
+ UseDomains = true;
+ };
+ dhcpV4Config = {
+ RouteMetric = 90;
+ UseDNS = true;
+ UseMTU = true;
+ };
+ ipv6AcceptRAConfig = {
+ RouteMetric = 80;
+ UseMTU = true;
+ };
+ linkConfig.RequiredForOnline = "no";
+ };
+ };
+ };
+ services = {
+ logiops = {
+ enable = true;
+ description = "An unofficial userspace driver for HID++ Logitech devices";
+ serviceConfig = {
+ Type = "simple";
+ ExecStart = "${pkgs.logiops}/bin/logid";
+ };
+ wantedBy = [ "multi-user.target" ];
+ };
+ };
+ };
+
+ services = {
+ godns = {
+ enable = true;
+ settings = {
+ domains = [
+ {
+ domain_name = "www.duckdns.org";
+ sub_domains = [ "pihlaja" ];
+ }
+ ];
+ ip_interface = "enp5s0";
+ interval = 300;
+ ip_type = "IPv6";
+ login_token_file = config.age.secrets.duckdns.path;
+ provider = "DuckDNS";
+ };
+ };
+ xserver = {
+ videoDrivers = [ "nvidia" ];
+ };
+ udev.packages = with pkgs; [
+ qmk
+ qmk_hid
+ qmk-udev-rules
+ via
+ ];
+ llama-cpp = {
+ enable = false;
+ openFirewall = true;
+ model = "/home/petri/Programming/DeepSeek-R1-Distill-Qwen-32B-Q8_0.gguf";
+ host = "0.0.0.0";
+ };
+ };
+ fonts.fontconfig.subpixel.rgba = "bgr";
+
+ # Configuration for logiops
+ environment.etc."logid.cfg".text = ''
+ devices: ({
+ name: "Wireless Mouse MX Master 3";
+ smartshift: {
+ on: true;
+ threshold: 12;
+ };
+ hiresscroll: {
+ hires: true;
+ target: false;
+ };
+ thumbwheel: {
+ divert: true;
+ invert: false;
+ left: {
+ threshold: 1;
+ interval: 1;
+ direction: "Left";
+ mode: "OnInterval";
+ action = {
+ type: "Keypress";
+ keys: ["KEY_VOLUMEDOWN"];
+ };
+ };
+ right: {
+ threshold: 1;
+ interval: 1;
+ direction: "Right";
+ mode: "OnInterval";
+ action = {
+ type: "Keypress";
+ keys: ["KEY_VOLUMEUP"];
+ };
+ };
+ };
+ dpi: 1500;
+ buttons: ({
+ cid: 0xc3;
+ action = {
+ type: "Gestures";
+ gestures: ({
+ direction: "Left";
+ mode: "OnRelease";
+ action = {
+ type = "Keypress";
+ keys: ["KEY_F15"];
+ };
+ }, {
+ direction: "Right";
+ mode: "OnRelease";
+ action = {
+ type = "Keypress";
+ keys: ["KEY_F16"];
+ };
+ }, {
+ direction: "Down";
+ mode: "OnRelease";
+ action = {
+ type: "Keypress";
+ keys: ["KEY_F17"];
+ };
+ }, {
+ direction: "Up";
+ mode: "OnRelease";
+ action = {
+ type: "Keypress";
+ keys: ["KEY_F18"];
+ };
+ }, {
+ direction: "None";
+ mode: "OnRelease";
+ action = {
+ type = "Keypress";
+ keys: ["KEY_PLAYPAUSE"];
+ };
+ });
+ };
+ }, {
+ cid: 0xc4;
+ action = {
+ type: "Keypress";
+ keys: ["KEY_F19"];
+ };
+ });
+ });
+ '';
+
+ system.stateVersion = "24.05"; # Did you read the comment?
+}
diff --git a/hosts/pihlaja/hardware-configuration.nix b/hosts/pihlaja/hardware-configuration.nix
new file mode 100644
index 0000000..1e81932
--- /dev/null
+++ b/hosts/pihlaja/hardware-configuration.nix
@@ -0,0 +1,80 @@
+# 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 = {
+ kernelPackages = pkgs.linuxPackages;
+ kernelParams = [
+ "NVreg_PreserveVideoMemoryAllocations=1"
+ "mitigations=off"
+ "nospectre_v2"
+ "nvidia_drm.fbdev=1"
+ "nvidia_drm.modeset=1"
+ "transparent_hugepage=always"
+ ];
+ initrd = {
+ luks.devices."luks-a47a6087-e6bf-4e8d-a034-2229259c38f5".device =
+ "/dev/disk/by-uuid/a47a6087-e6bf-4e8d-a034-2229259c38f5";
+ availableKernelModules = [
+ "cdc_acm"
+ "ahci"
+ "iwldvm"
+ "iwlwifi"
+ "nvme"
+ "sd_mod"
+ "usb_storage"
+ "usbhid"
+ "xhci_pci"
+ "nvidia"
+ "nvidia_drm"
+ "nvidia_modeset"
+ "nvidia_uvm"
+ ];
+ luks.devices."luks-1efa1182-2964-49bf-a413-fb51bd7b107f".device =
+ "/dev/disk/by-uuid/1efa1182-2964-49bf-a413-fb51bd7b107f";
+ };
+ kernelModules = [
+ "tcp_bbr"
+ "iwldvm"
+ "iwlwifi"
+ "k10temp"
+ "kvm-amd"
+ ];
+ extraModulePackages = [ ];
+ };
+
+ fileSystems."/" = {
+ device = "/dev/disk/by-uuid/eecfd181-138c-4c90-add6-2ef528d5dbb4";
+ fsType = "ext4";
+ };
+
+ fileSystems."/data" = {
+ device = "/dev/disk/by-uuid/a02a4e78-32ea-40e6-8398-087bfd8dca93";
+ fsType = "ext4";
+ options = [ "nofail" ];
+ };
+
+ fileSystems."/boot" = {
+ device = "/dev/disk/by-uuid/A4F5-0899";
+ fsType = "vfat";
+ options = [
+ "fmask=0077"
+ "dmask=0077"
+ ];
+ };
+
+ swapDevices = [ { device = "/dev/disk/by-uuid/d0e5a93d-18a7-4d24-893c-d2417c3d5043"; } ];
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}