From 7dd1c8d2d4d53f8f9d25243a426185957ac81768 Mon Sep 17 00:00:00 2001 From: Lily Anderson Date: Fri, 13 Feb 2026 19:15:24 -0600 Subject: [PATCH] imported laptop configs --- modules/hosts/laptop/configuration.nix | 72 ++++++++ .../hosts/laptop/hardware-configuration.nix | 45 +++++ modules/hosts/laptop/laptop.nix | 14 ++ modules/nixosModules/applications.nix | 7 + modules/nixosModules/fonts.nix | 14 ++ modules/nixosModules/localization.nix | 26 +++ modules/wrappedPrograms/niri.nix | 164 ++++++++++++++++++ modules/wrappedPrograms/wlr-which-key.nix | 30 ++++ result | 1 + 9 files changed, 373 insertions(+) create mode 100644 modules/hosts/laptop/configuration.nix create mode 100644 modules/hosts/laptop/hardware-configuration.nix create mode 100644 modules/hosts/laptop/laptop.nix create mode 100644 modules/nixosModules/applications.nix create mode 100644 modules/nixosModules/fonts.nix create mode 100644 modules/nixosModules/localization.nix create mode 100644 modules/wrappedPrograms/niri.nix create mode 100644 modules/wrappedPrograms/wlr-which-key.nix create mode 120000 result diff --git a/modules/hosts/laptop/configuration.nix b/modules/hosts/laptop/configuration.nix new file mode 100644 index 0000000..e5e15a7 --- /dev/null +++ b/modules/hosts/laptop/configuration.nix @@ -0,0 +1,72 @@ +{self, inputs, ...}: { + flake.nixosModules.laptopConfig = { pkgs, ... }: { + imports = + [ # Include the results of the hardware scan. +#./hardware-configuration.nix +# ../../modules/nixos/localization.nix +# ../../modules/nixos/applications.nix +# ../../modules/nixos/fonts.nix +# ../../modules/nixos/programming.nix + ]; + +# Bootloader. + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + networking.hostName = "lily-laptop"; networking.networkmanager.enable = true; + +# Enable the X11 windowing system. +# You can disable this if you're only using the Wayland session. + services.xserver.enable = true; + services.displayManager.sddm.enable = true; + #services.displayManager.cosmic-greeter.enable = true; + services.desktopManager.cosmic.enable = true; + services.desktopManager.plasma6.enable = true; + +# Enable CUPS to print documents. + services.printing.enable = true; + +# 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; + }; + programs = { + firefox.enable = true; + niri = { + enable = true; + package = self.packages.${pkgs.stdenv.hostPlatform.system}.niri; + }; + }; + nixpkgs.config.allowUnfree = true; + environment.systemPackages = [ + pkgs.vim + pkgs.noctalia-shell + pkgs.quickshell + pkgs.git + pkgs.gimp + pkgs.home-manager + pkgs.bluez + pkgs.kdePackages.plasma-keyboard + pkgs.kdePackages.bluedevil + pkgs.kdePackages.bluez-qt + pkgs.lf + pkgs.fuzzel + pkgs.alacritty + + self.packages.${pkgs.stdenv.hostPlatform.system}.nh +# wget + ]; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + system.stateVersion = "25.11"; # Did you read the com + }; + } + diff --git a/modules/hosts/laptop/hardware-configuration.nix b/modules/hosts/laptop/hardware-configuration.nix new file mode 100644 index 0000000..f35841a --- /dev/null +++ b/modules/hosts/laptop/hardware-configuration.nix @@ -0,0 +1,45 @@ +{ + flake.nixosModules.laptopHardware = { config, lib, modulesPath, ... }: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot = { + initrd = { + availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; + kernelModules = [ ]; + luks.devices."luks-fbc12fd4-a2b8-44b1-a89a-e502662b1fce".device = "/dev/disk/by-uuid/fbc12fd4-a2b8-44b1-a89a-e502662b1fce"; + }; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + }; + + fileSystems = { + "/" = { + device = "/dev/mapper/luks-fbc12fd4-a2b8-44b1-a89a-e502662b1fce"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + "/home" = { + device = "/dev/mapper/luks-fbc12fd4-a2b8-44b1-a89a-e502662b1fce"; + fsType = "btrfs"; + options = [ "subvol=@home" ]; + }; + "/media/nvme" = { + device = "/dev/mapper/luks-fbc12fd4-a2b8-44b1-a89a-e502662b1fce"; + fsType = "btrfs"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/C51E-CE6C"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; +} + diff --git a/modules/hosts/laptop/laptop.nix b/modules/hosts/laptop/laptop.nix new file mode 100644 index 0000000..7a9b1e1 --- /dev/null +++ b/modules/hosts/laptop/laptop.nix @@ -0,0 +1,14 @@ +{ inputs, self, ... }: { + flake.nixosConfigurations.lily-laptop = inputs.nixpkgs.lib.nixosSystem { + modules = [ + self.nixosModules.laptopConfig + self.nixosModules.laptopHardware + + self.nixosModules.lily + + self.nixosModules.localization + self.nixosModules.applications + self.nixosModules.fonts + ]; + }; +} diff --git a/modules/nixosModules/applications.nix b/modules/nixosModules/applications.nix new file mode 100644 index 0000000..17345f8 --- /dev/null +++ b/modules/nixosModules/applications.nix @@ -0,0 +1,7 @@ +{self, inputs, ...}: { + flake.nixosModules.applications = { pkgs, ... }: { + environment.systemPackages = with pkgs; [ + libreoffice-fresh + ]; + }; +} diff --git a/modules/nixosModules/fonts.nix b/modules/nixosModules/fonts.nix new file mode 100644 index 0000000..7598c1f --- /dev/null +++ b/modules/nixosModules/fonts.nix @@ -0,0 +1,14 @@ +{self, inputs, ...}: { + flake.nixosModules.fonts = { pkgs, ... }: { + fonts.packages = with pkgs; [ + nerd-fonts.jetbrains-mono + nerd-fonts.noto + corefonts + unifont + font-awesome + noto-fonts + noto-fonts-cjk-sans + noto-fonts-cjk-serif + ]; + }; +} diff --git a/modules/nixosModules/localization.nix b/modules/nixosModules/localization.nix new file mode 100644 index 0000000..2f561ad --- /dev/null +++ b/modules/nixosModules/localization.nix @@ -0,0 +1,26 @@ +{self, inputs, ...}: { + flake.nixosModules.localization = { pkgs, ... }: { + time.timeZone = "America/Chicago"; + + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + }; +} + diff --git a/modules/wrappedPrograms/niri.nix b/modules/wrappedPrograms/niri.nix new file mode 100644 index 0000000..ffce724 --- /dev/null +++ b/modules/wrappedPrograms/niri.nix @@ -0,0 +1,164 @@ +{ inputs, self, lib, ... }: let +inherit (lib) getExe; +in { + perSystem = { pkgs, self', ... }: { + packages.niri = + (inputs.wrappers.wrapperModules.niri.apply { + inherit pkgs; + settings = { + prefer-no-csd = null; + + input = { + focus-follows-mouse = null; + + keyboard = { + xkb = { + layout = "us"; + options = "grp:alt_shift_toggle,caps:escape"; + }; + repeat-rate = 40; + repeat-delay = 250; + }; + + touchpad = { + natural-scroll = null; + tap = null; + }; + + mouse = { + accel-profile = "flat"; + }; + }; + + binds = { + "Mod+Return".spawn = ''${getExe pkgs.alacritty}''; + + "Mod+O".toggle-overview = null; + "Mod+Shift+Slash".show-hotkey-overlay = null; + "Mod+Shift+Q".quit = null; + + "Mod+Q".close-window = null; + "Mod+F".maximize-column = null; + "Mod+G".fullscreen-window = null; + "Mod+Shift+F".toggle-window-floating = null; + "Mod+C".center-column = null; + + "Mod+H".focus-column-left = null; + "Mod+L".focus-column-right = null; + "Mod+K".focus-window-up = null; + "Mod+J".focus-window-down = null; + + "Mod+Left".focus-column-left = null; + "Mod+Right".focus-column-right = null; + "Mod+Up".focus-window-up = null; + "Mod+Down".focus-window-down = null; + + "Mod+Shift+H".move-column-left = null; + "Mod+Shift+L".move-column-right = null; + "Mod+Shift+K".move-window-up = null; + "Mod+Shift+J".move-window-down = null; + + "Mod+1".focus-workspace = "w0"; + "Mod+2".focus-workspace = "w1"; + "Mod+3".focus-workspace = "w2"; + "Mod+4".focus-workspace = "w3"; + "Mod+5".focus-workspace = "w4"; + "Mod+6".focus-workspace = "w5"; + "Mod+7".focus-workspace = "w6"; + "Mod+8".focus-workspace = "w7"; + "Mod+9".focus-workspace = "w8"; + "Mod+0".focus-workspace = "w9"; + + "Mod+Shift+1".move-column-to-workspace = "w0"; + "Mod+Shift+2".move-column-to-workspace = "w1"; + "Mod+Shift+3".move-column-to-workspace = "w2"; + "Mod+Shift+4".move-column-to-workspace = "w3"; + "Mod+Shift+5".move-column-to-workspace = "w4"; + "Mod+Shift+6".move-column-to-workspace = "w5"; + "Mod+Shift+7".move-column-to-workspace = "w6"; + "Mod+Shift+8".move-column-to-workspace = "w7"; + "Mod+Shift+9".move-column-to-workspace = "w8"; + "Mod+Shift+0".move-column-to-workspace = "w9"; + + "Mod+S".spawn-sh = "noctalia-shell ipc call launcher toggle"; + "Mod+V".spawn-sh = ''${pkgs.alsa-utils}/bin/amixer sset Capture toggle''; + + "XF86AudioRaiseVolume".spawn-sh = "wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%+"; + "XF86AudioLowerVolume".spawn-sh = "wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%-"; + + "Mod+Ctrl+H".set-column-width = "-5%"; + "Mod+Ctrl+L".set-column-width = "+5%"; + "Mod+Ctrl+J".set-window-height = "-5%"; + "Mod+Ctrl+K".set-window-height = "+5%"; + + "Mod+WheelScrollDown".focus-column-left = null; + "Mod+WheelScrollUp".focus-column-right = null; + "Mod+Ctrl+WheelScrollDown".focus-workspace-down = null; + "Mod+Ctrl+WheelScrollUp".focus-workspace-up = null; + + "Mod+Ctrl+S".spawn-sh = ''${getExe pkgs.grim} -l 0 - | ${pkgs.wl-clipboard}/bin/wl-copy''; + + "Mod+Shift+E".spawn-sh = ''${pkgs.wl-clipboard}/bin/wl-paste | ${getExe pkgs.swappy} -f -''; + + "Mod+Shift+S".spawn-sh = getExe (pkgs.writeShellApplication { + name = "screenshot"; + text = '' + ${getExe pkgs.grim} -g "$(${getExe pkgs.slurp} -w 0)" - \ + | ${pkgs.wl-clipboard}/bin/wl-copy + ''; + }); + + "Mod+d".spawn-sh = self.mkWhichKeyExe pkgs [ + { + key = "b"; + desc = "Bluetooth"; + cmd = "noctalia-shell ipc call bluetooth togglePanel"; + } + { + key = "w"; + desc = "Wifi"; + cmd = "noctalia-shell ipc call wifi togglePanel"; + } + { + key = "f"; + desc = "Firefox"; + cmd = "firefox"; + } + ]; + }; + + layout = { + gaps = 5; + + focus-ring = { + width = 2; + #active-color = "#${self.themeNoHash.base09}"; + }; + }; + + workspaces = let + settings = {layout.gaps = 5;}; + in { + "w0" = settings; + "w1" = settings; + "w2" = settings; + "w3" = settings; + "w4" = settings; + "w5" = settings; + "w6" = settings; + "w7" = settings; + "w8" = settings; + "w9" = settings; + }; + + xwayland-satellite.path = + getExe pkgs.xwayland-satellite; + + spawn-at-startup = [ + (builtins.toString (getExe pkgs.noctalia-shell)) + #(builtins.toString (getExe self'.packages.start-noctalia-shell)) + ]; + }; + }).wrapper; + }; +} diff --git a/modules/wrappedPrograms/wlr-which-key.nix b/modules/wrappedPrograms/wlr-which-key.nix new file mode 100644 index 0000000..9f7e58b --- /dev/null +++ b/modules/wrappedPrograms/wlr-which-key.nix @@ -0,0 +1,30 @@ +{inputs, lib, self, ...}: let +inherit (lib) getExe; +mkWhichKey = pkgs: menu: +(self.wrapperModules.which-key.apply { + inherit pkgs; + settings = { + inherit menu; + anchor = "bottom-right"; + }; + }).wrapper; +in { + flake.mkWhichKeyExe = pkgs: menu: getExe (mkWhichKey pkgs menu); + flake.wrapperModules.which-key = inputs.wrappers.lib.wrapModule ( + { config, lib, ... }: let + yamlFormat = config.pkgs.formats.yaml {}; + in { + options = { + settings = lib.mkOption { + type = yamlFormat.type; + }; + }; + config = { + package = config.pkgs.wlr-which-key; + args = [ + (toString (yamlFormat.generate "config.yaml" config.settings)) + ]; + }; + }); +} + diff --git a/result b/result new file mode 120000 index 0000000..c5d131d --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/0s0qmgwdb22ldf2lmg2vnkfb5455z3cd-nixos-system-lily-laptop-26.05.20260211.ec7c70d \ No newline at end of file