From 57ebcb1dc2df20ae1c7cf190fe18b6dab895a4f5 Mon Sep 17 00:00:00 2001 From: rocketcamel Date: Tue, 1 Jul 2025 20:53:23 -0700 Subject: [PATCH] feat: add usahara host --- nix/flake.nix | 4 + nix/hosts/usahara/configuration.nix | 102 +++++++++++++++++++ nix/hosts/usahara/hardware-configuration.nix | 39 +++++++ 3 files changed, 145 insertions(+) create mode 100644 nix/hosts/usahara/configuration.nix create mode 100644 nix/hosts/usahara/hardware-configuration.nix diff --git a/nix/flake.nix b/nix/flake.nix index 82549f7..18f04dd 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -52,6 +52,10 @@ name = "kumatani"; architecture = "x86_64-linux"; } + { + name = "usahara"; + architecture = "x86_64-linux"; + } ]; in { diff --git a/nix/hosts/usahara/configuration.nix b/nix/hosts/usahara/configuration.nix new file mode 100644 index 0000000..50789e7 --- /dev/null +++ b/nix/hosts/usahara/configuration.nix @@ -0,0 +1,102 @@ +# 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, + lib, + pkgs, + meta, + ... +}: + +{ + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.grub = { + enable = true; + efiSupport = true; + useOSProber = true; + efiInstallAsRemovable = true; + device = "nodev"; + }; + + networking.hostName = meta.hostname; + networking.networkmanager.enable = true; + hardware.bluetooth.enable = true; + + time.timeZone = "America/Vancouver"; + + security.sudo = { + enable = true; + wheelNeedsPassword = false; + }; + + i18n.defaultLocale = "en_US.UTF-8"; + services.pipewire = { + enable = true; + pulse.enable = true; + }; + desktop.enable = true; + kanata.enable = true; + kanata.apple = true; + + users.users.luca = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + packages = with pkgs; [ + tree + ]; + hashedPassword = config.hashedPassword; + shell = pkgs.zsh; + openssh.authorizedKeys.keys = config.authorized_ssh; + }; + hardware.graphics.enable = true; + environment.sessionVariables = { + WLR_NO_HARDWARE_CURSORS = "1"; + NIXOS_OZONE_WL = "1"; + }; + home-manager.users.luca = { + services.kanshi = { + enable = true; + settings = [ + { + profile.name = "main"; + profile.outputs = [ + { + status = "enable"; + criteria = "HDMI-A-1"; + position = "0,0"; + mode = "1920x1080"; + scale = 1.0; + } + { + + status = "enable"; + criteria = "DP-1"; + position = "1920,0"; + mode = "1920x1080@144Hz"; + scale = 1.0; + } + ]; + } + ]; + }; + }; + + services.flatpak.enable = true; + + environment.systemPackages = + with pkgs; + config.commonPackages + ++ [ + ]; + + services.openssh.enable = true; + + system.stateVersion = "25.05"; +} diff --git a/nix/hosts/usahara/hardware-configuration.nix b/nix/hosts/usahara/hardware-configuration.nix new file mode 100644 index 0000000..b9b3979 --- /dev/null +++ b/nix/hosts/usahara/hardware-configuration.nix @@ -0,0 +1,39 @@ +# 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.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/b51a3088-9a74-4e18-9098-9bc549006dd1"; + fsType = "btrfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/A28A-9B67"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ ]; + + # 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 + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno2.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}