diff --git a/flake.lock b/flake.lock index ef154e3..c5ca9f5 100644 --- a/flake.lock +++ b/flake.lock @@ -41,6 +41,26 @@ "type": "github" } }, + "nixos-hardware": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1790948122, + "narHash": "sha256-fDMYyzY1lI5b8RuCMrvoaIgTeRwNnTG4dNk1ucROlQE=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "0953bb1a609df63013176e3463393f8df993d3ef", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1790689126, @@ -102,6 +122,7 @@ "root": { "inputs": { "home-manager": "home-manager", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nixvim": "nixvim", "noctalia": "noctalia" diff --git a/flake.nix b/flake.nix index cf7edb1..84bc252 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,10 @@ url = "github:noctalia-dev/noctalia-shell"; inputs.nixpkgs.follows = "nixpkgs"; }; + nixos-hardware = { + url = "github:NixOS/nixos-hardware"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nixvim = { url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs"; @@ -52,6 +56,7 @@ default = mkHost "default"; neon = mkHost "neon"; argon = mkHost "argon"; + krypton = mkHost "krypton"; }; }; } diff --git a/hosts/krypton/configuration.nix b/hosts/krypton/configuration.nix new file mode 100644 index 0000000..a711fe0 --- /dev/null +++ b/hosts/krypton/configuration.nix @@ -0,0 +1,35 @@ +# krypton: framework 13 pro, intel core ultra x7 358H + +{ inputs, ... }: + +{ + imports = [ + inputs.nixos-hardware.nixosModules.framework-intel-core-ultra-series3 + ../../modules/nixos/appimage.nix + ../../modules/nixos/astro.nix + ../../modules/nixos/audio.nix + ../../modules/nixos/bootloader.nix + ../../modules/nixos/certificates.nix + ../../modules/nixos/docker.nix + ../../modules/nixos/gnupg.nix + ../../modules/nixos/locales.nix + ../../modules/nixos/networking.nix + ../../modules/nixos/niri.nix + ../../modules/nixos/noctalia.nix + ../../modules/nixos/openssh.nix + ../../modules/nixos/packages.nix + ../../modules/nixos/protonvpn.nix + ../../modules/nixos/sddm.nix + ../../modules/nixos/services.nix + ../../modules/nixos/settings.nix + ../../modules/nixos/steam.nix + ../../modules/nixos/users.nix + ../../modules/nixos/vial.nix + ]; + + # host-specific niri config (input devices, laptop binds) + home-manager.users.aaron.imports = [ ./niri.nix ]; + + networking.hostName = "krypton"; + system.stateVersion = "26.05"; # don't change +} diff --git a/hosts/krypton/hardware-configuration.nix b/hosts/krypton/hardware-configuration.nix new file mode 100644 index 0000000..7b44bf5 --- /dev/null +++ b/hosts/krypton/hardware-configuration.nix @@ -0,0 +1,60 @@ +# 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" + "thunderbolt" + "nvme" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.initrd.luks.devices."cryptroot" = { + device = "/dev/disk/by-label/nixcrypt"; + allowDiscards = true; + bypassWorkqueues = true; + }; + + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/nixroot"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-label/nixboot"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + fileSystems."/home" = { + device = "/dev/disk/by-label/nixhome"; + fsType = "ext4"; + }; + + swapDevices = [ + { device = "/dev/disk/by-label/nixswap"; } + ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/krypton/niri.nix b/hosts/krypton/niri.nix new file mode 100644 index 0000000..29e4b39 --- /dev/null +++ b/hosts/krypton/niri.nix @@ -0,0 +1,24 @@ +# krypton: framework 13 laptop, the built-in display is auto-configured by niri + +{ lib, ... }: + +{ + wayland.windowManager.niri.settings = { + input.touchpad = { + tap = { }; + natural-scroll = { }; + }; + + layout.gaps = lib.mkForce 10; + + binds = { + "Print".screenshot = { }; + "Ctrl+Print".screenshot-screen = { }; + "Mod+Shift+P".power-off-monitors = { }; + + # finer brightness steps + "XF86MonBrightnessUp".spawn-sh = lib.mkForce "brightnessctl --class=backlight set +1%"; + "XF86MonBrightnessDown".spawn-sh = lib.mkForce "brightnessctl --class=backlight set 1%-"; + }; + }; +}