nixos-config

NixOS configs for my systems
Log | Files | Refs

commit 2138a215dc0066da14c662f0e46939dfb9f07ccf
parent c4b9c9c19e896d595a3fc6edad7ff6397ee9ef2f
Author: vin <vin@vineetk.net>
Date:   Fri,  7 Mar 2025 19:22:32 -0500

rename lappy to hastur

Diffstat:
Mflake.nix | 6+++---
Mhome.nix | 16++++++++--------
Ahosts/hastur/default.nix | 282+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rhosts/lappy/hardware.nix -> hosts/hastur/hardware.nix | 0
Dhosts/lappy/default.nix | 282-------------------------------------------------------------------------------
5 files changed, 293 insertions(+), 293 deletions(-)

diff --git a/flake.nix b/flake.nix @@ -43,17 +43,17 @@ ]; }; - lappy = nixpkgs.lib.nixosSystem { + hastur = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = inputs; modules = [ - ./hosts/lappy + ./hosts/hastur agenix.nixosModules.default home-manager.nixosModules.home-manager { home-manager.extraSpecialArgs = { inherit inputs; - hostname = "lappy"; + hostname = "hastur"; }; home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; diff --git a/home.nix b/home.nix @@ -650,7 +650,7 @@ set-option -sa terminal-features ',*:RGB' id = "Y2XNSCK-DQYYKWZ-DCKSCH2-QWRHQJV-5RLNTZF-RX2QOKL-RZ7J67Z-HGMK2Q2"; }; - lappy = { + hastur = { addresses = [ "tcp://192.168.1.3:22000" "tcp://10.0.13.3:22000" @@ -669,7 +669,7 @@ set-option -sa terminal-features ',*:RGB' folders = { "bin" = { - devices = [ "demiurge" "lappy" ]; + devices = [ "demiurge" "hastur" ]; path = if hostname == "demiurge" then "/data/bin" @@ -678,7 +678,7 @@ set-option -sa terminal-features ',*:RGB' }; "docs" = { - devices = [ "demiurge" "lappy" ]; + devices = [ "demiurge" "hastur" ]; path = if hostname == "demiurge" then "/data/docs" @@ -687,12 +687,12 @@ set-option -sa terminal-features ',*:RGB' }; "emacs.d" = { - devices = [ "demiurge" "lappy" ]; + devices = [ "demiurge" "hastur" ]; path = "/home/vin/.emacs.d"; }; "kasi" = { - devices = [ "demiurge" "lappy" ]; + devices = [ "demiurge" "hastur" ]; path = if hostname == "demiurge" then "/data/kasi" @@ -701,7 +701,7 @@ set-option -sa terminal-features ',*:RGB' }; "lit" = { - devices = [ "demiurge" "lappy" ]; + devices = [ "demiurge" "hastur" ]; path = if hostname == "demiurge" then "/data_warm/lit" @@ -710,7 +710,7 @@ set-option -sa terminal-features ',*:RGB' }; "pics" = { - devices = [ "demiurge" "lappy" ]; + devices = [ "demiurge" "hastur" ]; path = if hostname == "demiurge" then "/data_warm/pics" @@ -719,7 +719,7 @@ set-option -sa terminal-features ',*:RGB' }; "iphone" = { - devices = [ "demiurge" "lappy" "iphonebob" ]; + devices = [ "demiurge" "hastur" "iphonebob" ]; path = if hostname == "demiurge" then "/data_warm/iphone" diff --git a/hosts/hastur/default.nix b/hosts/hastur/default.nix @@ -0,0 +1,282 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, home-manager, lib, pkgs, inputs, ... }: + +{ + imports = + [ + ./hardware.nix + home-manager.nixosModules.default + ]; + + # boot options + boot.loader.grub = { + enable = true; + zfsSupport = true; + efiSupport = true; + efiInstallAsRemovable = true; + mirroredBoots = [{ + devices = [ "nodev" ]; + path = "/boot"; + }]; + }; + + + + # disable wifi and open some ports + networking = { + hostName = "hastur"; + hostId = "deadcafe"; + + wireless = { + enable = true; + + networks = { + OpenDyna.pskRaw = "***REDACTED_PSK***"; + + FloridaPoly = { + authProtocols = [ "WPA-EAP" ]; + auth = '' + eap=PEAP + phase2="auth=MSCHAPv2" + identity="***REDACTED_EMAIL***" + password="***REDACTED_PASSWORD***" + ''; + }; + + FloridaPoly_BYOD = {}; + + iphonebob.pskRaw = "***REDACTED_PSK***"; + Retreat_86WiFi.pskRaw = "***REDACTED_PSK***"; + Orbi-1.pskRaw = "***REDACTED_PSK***"; + SETUP-E55E.pskRaw = "***REDACTED_PSK***"; + }; + }; + + firewall = { + # allowedTCPPorts = [ ]; + # allowedUDPPorts = [ ]; + }; + + wg-quick.interfaces = { + # mullvad to miami + us-mia-wg-001 = { + address = [ + "10.70.235.16/32" + "fc00:bbbb:bbbb:bb01::7:eb0f/128" + ]; + + peers = [{ + allowedIPs = [ "0.0.0.0/0" "::0/0" ]; + endpoint = "45.134.142.219:51820"; + publicKey = "FVEKAMJqaJU2AwWn5Mg9TK9IAfJc4XDUmSzEeC/VXGs="; + }]; + + privateKey = "***REDACTED_WG_KEY***="; + }; + }; + }; + + # Set your time zone. + time.timeZone = "America/Toronto"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + }; + + # enable flakes and nix cli + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # Define a user account. + users.users.vin = { + isNormalUser = true; + + extraGroups = [ + "kvm" + "libvirtd" + "transmission" + "wheel" + ]; + + shell = pkgs.zsh; + + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEvM0xCLziR+ZT/SYE1aZM6dklbw4fEC17TWqbADIZRH kou@demiurge" + ]; + + packages = with pkgs; [ + (quartus-prime-lite.override { supportedDevices = [ "MAX 10 FPGA" ]; }) + ]; + }; + + # selectively allow unfree packages + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "quartus-prime-lite" + "quartus-prime-lite-unwrapped" + ]; + + # default packages for both me and root + environment = { + systemPackages = with pkgs; [ + doas-sudo-shim + emacs + git + wget + ]; + + pathsToLink = [ "/share/zsh" ]; + }; + + # enable bluetooth and add some udev rules + hardware = { + bluetooth.enable = true; + flipperzero.enable = true; + keyboard.qmk.enable = true; + }; + + programs = { + # for gtk in home-manager + dconf.enable = true; + + # gpg + gnupg.agent = { + enable = true; + enableSSHSupport = true; + pinentryPackage = pkgs.pinentry-rofi; + settings.default-cache-ttl = 600; + }; + + # disable nano. I don't like nano. + nano.enable = false; + + # configuration in home-manager + zsh.enable = true; + }; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + security = { + # I prefer doas over sudo for simplicity + doas = { + enable = true; + extraRules = [{ + users = ["vin"]; + keepEnv = true; + persist = true; + }]; + }; + + pki.certificates = [ + '' +-----BEGIN CERTIFICATE----- +MIIBoDCCAUagAwIBAgIRANI8aOT3LE+pzmsQWjcDOIgwCgYIKoZIzj0EAwIwLjER +MA8GA1UEChMIZGVtaXVyZ2UxGTAXBgNVBAMTEGRlbWl1cmdlIFJvb3QgQ0EwHhcN +MjUwMjE4MDUzNTA5WhcNMzUwMjE2MDUzNTA5WjAuMREwDwYDVQQKEwhkZW1pdXJn +ZTEZMBcGA1UEAxMQZGVtaXVyZ2UgUm9vdCBDQTBZMBMGByqGSM49AgEGCCqGSM49 +AwEHA0IABMv8weeXJSDLygVlBxxAHLCvQCdf2COCk0QffNeDaVlIU/NFo3IyPSqG +E3YtWEWamU/icgsJS999z3BZ5O+cTP6jRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNV +HRMBAf8ECDAGAQH/AgEBMB0GA1UdDgQWBBRM51S3OgTxXwNhdSSHw6llz0APFzAK +BggqhkjOPQQDAgNIADBFAiA9alHJ1XHLlKNRUGRL4tdFC3RZYHtoN8BmBHEfDa1S +LQIhANgsvYmyCp/Nur2RKaV25CDg3kMYVBXED2HVDy8qa+3i +-----END CERTIFICATE----- +'' + ]; + + sudo.enable = false; + }; + + services = { + # dns + dnsmasq = { + enable = true; + settings = { + server = [ + "/vpn/10.0.13.1" + "9.9.9.9" + ]; + + interface = "lo"; + listen-address = "127.0.0.1"; + bind-interfaces = true; + no-resolv = true; + }; + }; + + # graphical input + libinput = { + enable = true; + + mouse.accelProfile = "flat"; + + touchpad = { + accelProfile = "flat"; + tapping = true; + tappingButtonMap = "lrm"; + }; + }; + + # ssh + openssh = { + enable = true; + + settings = { + KbdInteractiveAuthentication = false; + PasswordAuthentication = false; + PermitRootLogin = "no"; + X11Forwarding = true; + }; + }; + + # for yubikey + pcscd.enable = true; + + # sound. for some reason, pipewire enabled itself when I tried + # using pulseaudio and home-manager, so had to disable pulseaudio. + pipewire = { + enable = true; + pulse.enable = true; + }; + + # enable better power management + tlp.enable = true; + + # udev rules + udev = { + enable = true; + extraRules = '' + # ST-Link v2.1 + SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", MODE:="0666" + ''; + }; + + # to get startx and use amdgpu driver + # WM in home-manager + xserver = { + enable = true; + autorun = false; + displayManager.startx.enable = true; + videoDrivers = [ "modesetting" ]; + }; + }; + + # create caches and use mandoc + documentation.man = { + enable = true; + generateCaches = true; + man-db.enable = false; + mandoc.enable = true; + }; + + system.stateVersion = "24.05"; +} diff --git a/hosts/lappy/hardware.nix b/hosts/hastur/hardware.nix diff --git a/hosts/lappy/default.nix b/hosts/lappy/default.nix @@ -1,282 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page, on -# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). - -{ config, home-manager, lib, pkgs, inputs, ... }: - -{ - imports = - [ - ./hardware.nix - home-manager.nixosModules.default - ]; - - # boot options - boot.loader.grub = { - enable = true; - zfsSupport = true; - efiSupport = true; - efiInstallAsRemovable = true; - mirroredBoots = [{ - devices = [ "nodev" ]; - path = "/boot"; - }]; - }; - - - - # disable wifi and open some ports - networking = { - hostName = "lappy"; - hostId = "deadcafe"; - - wireless = { - enable = true; - - networks = { - OpenDyna.pskRaw = "***REDACTED_PSK***"; - - FloridaPoly = { - authProtocols = [ "WPA-EAP" ]; - auth = '' - eap=PEAP - phase2="auth=MSCHAPv2" - identity="***REDACTED_EMAIL***" - password="***REDACTED_PASSWORD***" - ''; - }; - - FloridaPoly_BYOD = {}; - - iphonebob.pskRaw = "***REDACTED_PSK***"; - Retreat_86WiFi.pskRaw = "***REDACTED_PSK***"; - Orbi-1.pskRaw = "***REDACTED_PSK***"; - SETUP-E55E.pskRaw = "***REDACTED_PSK***"; - }; - }; - - firewall = { - # allowedTCPPorts = [ ]; - # allowedUDPPorts = [ ]; - }; - - wg-quick.interfaces = { - # mullvad to miami - us-mia-wg-001 = { - address = [ - "10.70.235.16/32" - "fc00:bbbb:bbbb:bb01::7:eb0f/128" - ]; - - peers = [{ - allowedIPs = [ "0.0.0.0/0" "::0/0" ]; - endpoint = "45.134.142.219:51820"; - publicKey = "FVEKAMJqaJU2AwWn5Mg9TK9IAfJc4XDUmSzEeC/VXGs="; - }]; - - privateKey = "***REDACTED_WG_KEY***="; - }; - }; - }; - - # Set your time zone. - time.timeZone = "America/Toronto"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - console = { - font = "Lat2-Terminus16"; - }; - - # enable flakes and nix cli - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - - # Define a user account. - users.users.vin = { - isNormalUser = true; - - extraGroups = [ - "kvm" - "libvirtd" - "transmission" - "wheel" - ]; - - shell = pkgs.zsh; - - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEvM0xCLziR+ZT/SYE1aZM6dklbw4fEC17TWqbADIZRH kou@demiurge" - ]; - - packages = with pkgs; [ - (quartus-prime-lite.override { supportedDevices = [ "MAX 10 FPGA" ]; }) - ]; - }; - - # selectively allow unfree packages - nixpkgs.config.allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ - "quartus-prime-lite" - "quartus-prime-lite-unwrapped" - ]; - - # default packages for both me and root - environment = { - systemPackages = with pkgs; [ - doas-sudo-shim - emacs - git - wget - ]; - - pathsToLink = [ "/share/zsh" ]; - }; - - # enable bluetooth and add some udev rules - hardware = { - bluetooth.enable = true; - flipperzero.enable = true; - keyboard.qmk.enable = true; - }; - - programs = { - # for gtk in home-manager - dconf.enable = true; - - # gpg - gnupg.agent = { - enable = true; - enableSSHSupport = true; - pinentryPackage = pkgs.pinentry-rofi; - settings.default-cache-ttl = 600; - }; - - # disable nano. I don't like nano. - nano.enable = false; - - # configuration in home-manager - zsh.enable = true; - }; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - security = { - # I prefer doas over sudo for simplicity - doas = { - enable = true; - extraRules = [{ - users = ["vin"]; - keepEnv = true; - persist = true; - }]; - }; - - pki.certificates = [ - '' ------BEGIN CERTIFICATE----- -MIIBoDCCAUagAwIBAgIRANI8aOT3LE+pzmsQWjcDOIgwCgYIKoZIzj0EAwIwLjER -MA8GA1UEChMIZGVtaXVyZ2UxGTAXBgNVBAMTEGRlbWl1cmdlIFJvb3QgQ0EwHhcN -MjUwMjE4MDUzNTA5WhcNMzUwMjE2MDUzNTA5WjAuMREwDwYDVQQKEwhkZW1pdXJn -ZTEZMBcGA1UEAxMQZGVtaXVyZ2UgUm9vdCBDQTBZMBMGByqGSM49AgEGCCqGSM49 -AwEHA0IABMv8weeXJSDLygVlBxxAHLCvQCdf2COCk0QffNeDaVlIU/NFo3IyPSqG -E3YtWEWamU/icgsJS999z3BZ5O+cTP6jRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNV -HRMBAf8ECDAGAQH/AgEBMB0GA1UdDgQWBBRM51S3OgTxXwNhdSSHw6llz0APFzAK -BggqhkjOPQQDAgNIADBFAiA9alHJ1XHLlKNRUGRL4tdFC3RZYHtoN8BmBHEfDa1S -LQIhANgsvYmyCp/Nur2RKaV25CDg3kMYVBXED2HVDy8qa+3i ------END CERTIFICATE----- -'' - ]; - - sudo.enable = false; - }; - - services = { - # dns - dnsmasq = { - enable = true; - settings = { - server = [ - "/vpn/10.0.13.1" - "9.9.9.9" - ]; - - interface = "lo"; - listen-address = "127.0.0.1"; - bind-interfaces = true; - no-resolv = true; - }; - }; - - # graphical input - libinput = { - enable = true; - - mouse.accelProfile = "flat"; - - touchpad = { - accelProfile = "flat"; - tapping = true; - tappingButtonMap = "lrm"; - }; - }; - - # ssh - openssh = { - enable = true; - - settings = { - KbdInteractiveAuthentication = false; - PasswordAuthentication = false; - PermitRootLogin = "no"; - X11Forwarding = true; - }; - }; - - # for yubikey - pcscd.enable = true; - - # sound. for some reason, pipewire enabled itself when I tried - # using pulseaudio and home-manager, so had to disable pulseaudio. - pipewire = { - enable = true; - pulse.enable = true; - }; - - # enable better power management - tlp.enable = true; - - # udev rules - udev = { - enable = true; - extraRules = '' - # ST-Link v2.1 - SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", MODE:="0666" - ''; - }; - - # to get startx and use amdgpu driver - # WM in home-manager - xserver = { - enable = true; - autorun = false; - displayManager.startx.enable = true; - videoDrivers = [ "modesetting" ]; - }; - }; - - # create caches and use mandoc - documentation.man = { - enable = true; - generateCaches = true; - man-db.enable = false; - mandoc.enable = true; - }; - - system.stateVersion = "24.05"; -}