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] 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