From b120a381abcdd77ff683996020788eb51bca5d53 Mon Sep 17 00:00:00 2001 From: Alex van de Sandt Date: Sun, 14 Jun 2026 11:18:08 -0500 Subject: [PATCH 1/8] Add laptop config --- flake.nix | 7 +- home.nix | 2 +- .../flock/configuration.nix | 0 .../flock/hardware-configuration.nix | 0 systems/perch/configuration.nix | 185 ++++++++++++++++++ systems/perch/hardware-configuration.nix | 33 ++++ 6 files changed, 225 insertions(+), 2 deletions(-) rename configuration.nix => systems/flock/configuration.nix (100%) rename hardware-configuration.nix => systems/flock/hardware-configuration.nix (100%) create mode 100644 systems/perch/configuration.nix create mode 100644 systems/perch/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 2846d3e..5a783cc 100644 --- a/flake.nix +++ b/flake.nix @@ -43,9 +43,14 @@ nixosConfigurations = { flock = nixpkgs.lib.nixosSystem { inherit system; - modules = [ ./configuration.nix ]; + modules = [ ./systems/flock/configuration.nix ]; specialArgs = { inherit hyprland; }; }; + perch = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ ./systems/perch/configuration.nix ]; + specialArgs = { inherit hyprland; }; + }; }; homeConfigurations."igneous" = home-manager.lib.homeManagerConfiguration { inherit pkgs; diff --git a/home.nix b/home.nix index c1157f7..731a6f7 100644 --- a/home.nix +++ b/home.nix @@ -27,7 +27,7 @@ # You should not change this value, even if you update Home Manager. If you do # want to update the value, then make sure to first check the Home Manager # release notes. - home.stateVersion = "25.05"; # Please read the comment before changing. + home.stateVersion = "26.05"; # Please read the comment before changing. # Let Home Manager install and manage itself. programs.home-manager.enable = true; diff --git a/configuration.nix b/systems/flock/configuration.nix similarity index 100% rename from configuration.nix rename to systems/flock/configuration.nix diff --git a/hardware-configuration.nix b/systems/flock/hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to systems/flock/hardware-configuration.nix diff --git a/systems/perch/configuration.nix b/systems/perch/configuration.nix new file mode 100644 index 0000000..f1ddff1 --- /dev/null +++ b/systems/perch/configuration.nix @@ -0,0 +1,185 @@ +{ + config, + pkgs, + hyprland, + ... +}: +{ + imports = [ + ./hardware-configuration.nix + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Use latest kernel. + boot.kernelPackages = pkgs.linuxPackages_latest; + + # Enable container management + boot.enableContainers = true; + + networking.hostName = "perch"; + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "America/Chicago"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + # Enable hyprland + programs.hyprland = { + enable = true; + package = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + portalPackage = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; + xwayland.enable = true; + withUWSM = true; + }; + + # Use hyprland cachix + nix.settings = { + substituters = [ "https://hyprland.cachix.org" ]; + trusted-substituters = [ "https://hyprland.cachix.org" ]; + trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; + }; + + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + }; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + # Enable OpenGL + hardware.graphics.enable = true; + + # Load NVIDIA drivers + services.xserver.videoDrivers = [ "nvidia" ]; + + hardware.nvidia = { + # Required + modesetting.enable = true; + + # Disable open-source kernel module, 1070 not compatible + open = false; + + # Enable the settings menu via `nvidia-settings` + nvidiaSettings = true; + + # Use legacy driver for GTX 1070 + package = config.boot.kernelPackages.nvidiaPackages.legacy_580; + }; + + # Enable sound with pipewire. + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.igneous = { + isNormalUser = true; + description = "joan"; + shell = pkgs.zsh; + extraGroups = [ + "dialout" + "input" + "networkmanager" + "wheel" + ]; + }; + + # Enable automatic login for the user. + services.displayManager.autoLogin.enable = true; + services.displayManager.autoLogin.user = "igneous"; + + # Install firefox. + programs.firefox.enable = true; + + programs.neovim = { + enable = true; + defaultEditor = true; + }; + + programs.vim.enable = true; + + environment.systemPackages = with pkgs; [ + fd + git + htop + pavucontrol + ripgrep + unzip + ]; + + fonts.packages = with pkgs; [ + iosevka + nerd-fonts.iosevka + ]; + fonts.fontconfig.defaultFonts = { + monospace = [ + "Berkeley Mono" + "iosevka" + ]; + }; + + # Lets zsh completions work + environment.pathsToLink = [ "/share/zsh" ]; + + programs.zsh = { + enable = true; + enableCompletion = false; + enableGlobalCompInit = false; + }; + + security.polkit.enable = true; + + nixpkgs.config.allowUnfreePredicate = + pkg: + builtins.elem (pkgs.lib.getName pkg) [ + "1password" + "1password-cli" + "chromium" + "nvidia-settings" + "nvidia-kernel-modules" + "nvidia-x11" + "steam" + "steam-original" + "steam-unwrapped" + "steam-run" + ]; + programs.steam = { + enable = true; + }; + programs._1password = { + enable = true; + }; + programs._1password-gui = { + enable = true; + polkitPolicyOwners = [ "igneous" ]; + }; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "26.05"; # Did you read the comment? + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; +} diff --git a/systems/perch/hardware-configuration.nix b/systems/perch/hardware-configuration.nix new file mode 100644 index 0000000..3ce143d --- /dev/null +++ b/systems/perch/hardware-configuration.nix @@ -0,0 +1,33 @@ +# 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 = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/19469c1e-0853-436d-ad19-008851f25634"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/DF5B-2BFE"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/869fda50-c696-434b-9253-d56d9d65960c"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} -- 2.51.2 From fe4140638c4684c525ab98b61d7bb22b7b998dac Mon Sep 17 00:00:00 2001 From: Alex van de Sandt Date: Sun, 14 Jun 2026 11:46:36 -0500 Subject: [PATCH 2/8] Add nixos-hardware framework config --- flake.lock | 21 +++++++++++++++++++++ flake.nix | 18 +++++++++++++----- systems/perch/configuration.nix | 3 +++ 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 4bac0d2..7b5220c 100644 --- a/flake.lock +++ b/flake.lock @@ -451,6 +451,26 @@ "type": "github" } }, + "nixos-hardware": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1781168557, + "narHash": "sha256-LOnLQ2tpYF9gqIDDr3+j3DbpJJr/QCH6zPRT2GzEUOE=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "6358ff76821101c178e3ab4919a62799bfe3652e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1780749050, @@ -547,6 +567,7 @@ "home-manager": "home-manager", "hyprcursor-phinger": "hyprcursor-phinger", "hyprland": "hyprland", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_2", "nixvim": "nixvim", "zen-browser": "zen-browser" diff --git a/flake.nix b/flake.nix index 5a783cc..16ad2ef 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,10 @@ hyprland = { url = "github:hyprwm/Hyprland"; }; + nixos-hardware = { + url = "github:NixOS/nixos-hardware"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nixvim = { url = "github:nix-community/nixvim"; }; @@ -31,6 +35,7 @@ home-manager, hyprcursor-phinger, hyprland, + nixos-hardware, nixvim, zen-browser, ... @@ -46,11 +51,14 @@ modules = [ ./systems/flock/configuration.nix ]; specialArgs = { inherit hyprland; }; }; - perch = nixpkgs.lib.nixosSystem { - inherit system; - modules = [ ./systems/perch/configuration.nix ]; - specialArgs = { inherit hyprland; }; - }; + perch = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + ./systems/perch/configuration.nix + nixos-hardware.nixosModules.framework-16-7040-amd + ]; + specialArgs = { inherit hyprland; }; + }; }; homeConfigurations."igneous" = home-manager.lib.homeManagerConfiguration { inherit pkgs; diff --git a/systems/perch/configuration.nix b/systems/perch/configuration.nix index f1ddff1..c470c74 100644 --- a/systems/perch/configuration.nix +++ b/systems/perch/configuration.nix @@ -5,6 +5,9 @@ ... }: { + # Firmware update service + services.fwupd.enable = true; + imports = [ ./hardware-configuration.nix ]; -- 2.51.2 From a4e4c64c150fd7c38b365362bb32efc6737ca107 Mon Sep 17 00:00:00 2001 From: Alex van de Sandt Date: Sun, 14 Jun 2026 12:41:27 -0500 Subject: [PATCH 3/8] Use correct monitor resolution --- desktop/hyprland.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/hyprland.nix b/desktop/hyprland.nix index 7ddf4c1..b34d797 100644 --- a/desktop/hyprland.nix +++ b/desktop/hyprland.nix @@ -7,7 +7,7 @@ settings = { # monitor settings https://wiki.hypr.land/0.54.0/Configuring/Monitors/ - monitor = [ "HDMI-A-2, 2560x1440@144.00Hz, auto, auto, cm, auto" ]; + monitor = [ "eDP-1, preferred, auto, auto, cm, auto" ]; # keywords https://wiki.hypr.land/0.54.0/Configuring/Keywords/ "$terminal" = "kitty"; -- 2.51.2 From 42600d7ab074e9f9a7d226a75121db883a352a05 Mon Sep 17 00:00:00 2001 From: Alex van de Sandt Date: Sun, 14 Jun 2026 13:48:01 -0500 Subject: [PATCH 4/8] Disable xwayland scaling --- desktop/hyprland.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/desktop/hyprland.nix b/desktop/hyprland.nix index b34d797..37141b7 100644 --- a/desktop/hyprland.nix +++ b/desktop/hyprland.nix @@ -131,6 +131,9 @@ follow_mouse = 0; }; + # Don't scale xwayland apps, fix for discord & steam + xwayland.force_zero_scaling = true; + # keybindings, https://wiki.hypr.land/0.54.0/Configuring/Binds/ bindu = [ "$mainMod, return, exec, $terminal" -- 2.51.2 From 9204e50745c59a278735888f1589c260fbf20769 Mon Sep 17 00:00:00 2001 From: Alex van de Sandt Date: Sun, 14 Jun 2026 13:48:11 -0500 Subject: [PATCH 5/8] Enable battery state in waybar --- desktop/waybar/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/desktop/waybar/default.nix b/desktop/waybar/default.nix index 9d5e0dd..d12df51 100644 --- a/desktop/waybar/default.nix +++ b/desktop/waybar/default.nix @@ -21,6 +21,7 @@ "cpu" "memory" "temperature" + "battery" "clock" "tray" "custom/power" @@ -94,6 +95,10 @@ ]; }; + battery = { + format = "{capacity}% {icon}"; + }; + clock = { tooltip-format = "{calendar}"; format = "{0:%H:%M} {0:%Y-%m-%d}"; -- 2.51.2 From 11d0617118f85155a55fb492c145b4f31933a628 Mon Sep 17 00:00:00 2001 From: Alex van de Sandt Date: Sun, 14 Jun 2026 13:55:23 -0500 Subject: [PATCH 6/8] Move window title to left --- desktop/waybar/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/desktop/waybar/default.nix b/desktop/waybar/default.nix index d12df51..ea131a3 100644 --- a/desktop/waybar/default.nix +++ b/desktop/waybar/default.nix @@ -10,8 +10,6 @@ modules-left = [ "hyprland/workspaces" "hyprland/submap" - ]; - modules-center = [ "hyprland/window" ]; modules-right = [ @@ -29,7 +27,7 @@ "hyprland/window" = { rewrite = { - "(.*) — Mozilla Firefox" = "🌎 $1"; + "(.*) — (Zen Browser|Mozilla Firefox)" = "🌎 $1"; "(.*) - Discord" = "💬 $1"; }; separate-outputs = true; -- 2.51.2 From c437cf51581e930ab51873fd54ed91cc4572903c Mon Sep 17 00:00:00 2001 From: Alex van de Sandt Date: Sun, 14 Jun 2026 14:33:37 -0500 Subject: [PATCH 7/8] And binds for backlight control --- desktop/hyprland.nix | 14 +++++++++----- home.nix | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/desktop/hyprland.nix b/desktop/hyprland.nix index 37141b7..13a5ccd 100644 --- a/desktop/hyprland.nix +++ b/desktop/hyprland.nix @@ -205,16 +205,20 @@ ]; bindel = [ - # Laptop multimedia keys for volume and LCD brightness + # Volume control ",XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+" ",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" ",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + # Backlight brightness + ",XF86MonBrightnessUp, exec, brightnessctl set 10%+" + ",XF86MonBrightnessDown, exec, brightnessctl set 10%-" + # Requires playerctl - ", XF86AudioNext, exec, playerctl next" - ", XF86AudioPause, exec, playerctl play-pause" - ", XF86AudioPlay, exec, playerctl play-pause" - ", XF86AudioPrev, exec, playerctl previous" + # ", XF86AudioNext, exec, playerctl next" + # ", XF86AudioPause, exec, playerctl play-pause" + # ", XF86AudioPlay, exec, playerctl play-pause" + # ", XF86AudioPrev, exec, playerctl previous" ]; windowrule = [ diff --git a/home.nix b/home.nix index 731a6f7..c4492db 100644 --- a/home.nix +++ b/home.nix @@ -41,6 +41,7 @@ ]; home.packages = with pkgs; [ + brightnessctl hyprpaper hyprshutdown jq -- 2.51.2 From e1f8d3fd1204991d2209f715fe3b5ded99db6b3e Mon Sep 17 00:00:00 2001 From: Alex van de Sandt Date: Wed, 24 Jun 2026 11:46:07 -0500 Subject: [PATCH 8/8] Enable bluetooth --- systems/perch/configuration.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/systems/perch/configuration.nix b/systems/perch/configuration.nix index c470c74..2ea0b38 100644 --- a/systems/perch/configuration.nix +++ b/systems/perch/configuration.nix @@ -185,4 +185,10 @@ "nix-command" "flakes" ]; + + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + services.blueman.enable = true; } -- 2.51.2