# 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 = { 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; }; }; "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; }; }; }; }; 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; loadCredential = [ "login_token:${config.age.secrets.duckdns.path}" ]; settings = { domains = [ { domain_name = "www.duckdns.org"; sub_domains = [ "pihlaja" ]; } ]; login_token_file = "$CREDENTIALS_DIRECTORY/login_token"; ip_interface = "enp5s0"; interval = 300; ip_type = "IPv6"; 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? }