nixos-config

NixOS configs for my systems
Log | Files | Refs

desktop.nix (3280B)


      1 {
      2   config,
      3   home-manager,
      4   lib,
      5   pkgs,
      6   inputs,
      7   llama-cpp,
      8   ...
      9 }:
     10 
     11 {
     12   imports = [
     13     home-manager.nixosModules.default
     14   ];
     15 
     16   # boot options
     17   boot = {
     18     kernel.sysctl = {
     19       "net.ipv4.ip_forward" = true;
     20       "net.ipv6.conf.all.forwarding" = true;
     21     };
     22 
     23     kernelPackages = pkgs.linuxPackages_6_17;
     24 
     25     loader = {
     26       systemd-boot.enable = true;
     27       efi.canTouchEfiVariables = true;
     28     };
     29 
     30     supportedFilesystems = [ "zfs" ];
     31 
     32     zfs = {
     33       devNodes = "/dev/disk/by-partuuid";
     34       forceImportRoot = false;
     35     };
     36   };
     37 
     38   services = {
     39     # vpn
     40     # TODO replace with wireguard again
     41     tailscale = {
     42       enable = true;
     43       disableTaildrop = true;
     44       disableUpstreamLogging = true;
     45       extraUpFlags = [ "--login-server=https://controlplane.tailscale.com" ];
     46       openFirewall = true;
     47       useRoutingFeatures = "both";
     48     };
     49 
     50     # automatically scrub zfs pools (every week by default)
     51     zfs.autoScrub.enable = true;
     52 
     53     # graphical input
     54     libinput = {
     55       enable = true;
     56 
     57       mouse.accelProfile = "flat";
     58 
     59       touchpad = {
     60         accelProfile = "flat";
     61         tapping = true;
     62         tappingButtonMap = "lrm";
     63       };
     64     };
     65 
     66     # ssh
     67     openssh = {
     68       enable = true;
     69 
     70       settings = {
     71         KbdInteractiveAuthentication = false;
     72         PasswordAuthentication = true;
     73         PermitRootLogin = "no";
     74         X11Forwarding = true;
     75       };
     76     };
     77 
     78     # for yubikey
     79     pcscd.enable = true;
     80 
     81     # sound. for some reason, pipewire enabled itself when I tried
     82     # using pulseaudio and home-manager, so had to disable pulseaudio.
     83     pipewire = {
     84       enable = true;
     85       alsa.enable = true;
     86       audio.enable = true;
     87       pulse.enable = true;
     88       wireplumber = {
     89         enable = true;
     90         extraConfig = {
     91           "51-set-default-eq.conf" = {
     92             text = ''
     93               monitor.rules = [
     94                 {
     95                   matches = [
     96                     {
     97                       # This rule matches the node with the name of your sink (node 35)
     98                       "node.name" = "effect_input.eq6"
     99                     }
    100                   ]
    101                   actions = {
    102                     update-props = {
    103                       # This sets a very high priority, making it the default.
    104                       # Standard hardware is usually around 1000.
    105                       "priority.session" = 2001
    106                     }
    107                   }
    108                 }
    109               ]
    110             '';
    111           };
    112         };
    113       };
    114     };
    115 
    116     displayManager = {
    117       enable = true;
    118       ly.enable = true;
    119     };
    120 
    121     xserver = {
    122       enable = true;
    123       autorun = false;
    124       displayManager.setupCommands = ''
    125         xinput set-prop "Logitech USB Receiver Mouse" "libinput Accel Profile Enabled" 0 1 0
    126         xsetwacom set "Wacom One by Wacom S Pen stylus" MapToOutput 2304x1440+560+0
    127 
    128         #xrandr --output HDMI-1 --mode 1920x1080 --left-of DP-1
    129 
    130         xwallpaper --zoom ~/pics/wp/elite_milky_way_below2.png
    131       '';
    132       modules = [ pkgs.xf86_input_wacom ];
    133       wacom.enable = true;
    134 
    135       # config managed separately
    136       windowManager.stumpwm.enable = true;
    137     };
    138   };
    139 
    140   # extra systemd stuff
    141   systemd.services.sshd.after = [ "tailscaled-autoconnect.service" ];
    142 }