From 9a03d585e4611634b41467200592eb5abb729e7e Mon Sep 17 00:00:00 2001 From: KnightArtorias Date: Thu, 11 Dec 2025 00:48:55 +0000 Subject: [PATCH] Add host type and hostname to vars for easy reference by submodules --- flake.nix | 15 +++++- home-manager/roles/desktop/niri/default.nix | 2 +- .../crow/host-configs/niri/config.kdl | 52 ++++++------------- 3 files changed, 30 insertions(+), 39 deletions(-) diff --git a/flake.nix b/flake.nix index 7b414b3..71764be 100644 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,8 @@ # Generic NixOS config mkNixOSConfig = { path, + type, + hostname, extraModules ? [], }: nixpkgs.lib.nixosSystem { @@ -35,12 +37,21 @@ path ] ++ extraModules; + + vars.type = type; + vars.hostname = hostname; }; # Additional modules for physical hosts - mkPhysicalNixOSConfig = path: + mkPhysicalNixOSConfig = { + path, + type, + hostname, + }: mkNixOSConfig { path = path; + type = type; + hostname = hostname; extraModules = [ ./hosts/physical ]; }; @@ -61,7 +72,7 @@ # Collection of all of our configs nixosConfigurations = { # =========== Desktops =========== - crow = mkPhysicalNixOSConfig ./hosts/physical/crow; + crow = mkPhysicalNixOSConfig ./hosts/physical/crow "physical" "crow"; }; }; } diff --git a/home-manager/roles/desktop/niri/default.nix b/home-manager/roles/desktop/niri/default.nix index bc5c535..9cf5861 100644 --- a/home-manager/roles/desktop/niri/default.nix +++ b/home-manager/roles/desktop/niri/default.nix @@ -6,7 +6,7 @@ ../tiling ]; - xdg.configFile."niri/config.kdl".source = ../../../../${vars.path}/host-configs/niri/config.kdl + xdg.configFile."niri/config.kdl".source = ../../../../hosts/${vars.type}/${vars.hostname}/host-configs/niri/config.kdl; programs.zsh = { profileExtra = '' diff --git a/hosts/physical/crow/host-configs/niri/config.kdl b/hosts/physical/crow/host-configs/niri/config.kdl index 0af16c7..0430738 100644 --- a/hosts/physical/crow/host-configs/niri/config.kdl +++ b/hosts/physical/crow/host-configs/niri/config.kdl @@ -8,19 +8,6 @@ // https://yalter.github.io/niri/Configuration:-Input input { keyboard { - xkb { - // You can set rules, model, layout, variant and options. - // For more information, see xkeyboard-config(7). - - // For example: - // layout "us,ru" - // options "grp:win_space_toggle,compose:ralt,ctrl:nocaps" - - // If this section is empty, niri will fetch xkb settings - // from org.freedesktop.locale1. You can control these using - // localectl set-x11-keymap. - } - // Enable numlock on startup, omitting this setting disables it. numlock } @@ -42,31 +29,9 @@ input { // disabled-on-external-mouse } - mouse { - // off - // natural-scroll - // accel-speed 0.2 - // accel-profile "flat" - // scroll-method "no-scroll" - } - - trackpoint { - // off - // natural-scroll - // accel-speed 0.2 - // accel-profile "flat" - // scroll-method "on-button-down" - // scroll-button 273 - // scroll-button-lock - // middle-emulation - } - - // Uncomment this to make the mouse warp to the center of newly focused windows. - // warp-mouse-to-focus - // Focus windows and outputs automatically when moving the mouse into them. // Setting max-scroll-amount="0%" makes it work only on windows already fully on screen. - // focus-follows-mouse max-scroll-amount="0%" + focus-follows-mouse max-scroll-amount="0%" } // You can configure outputs by their name, which you can find @@ -106,6 +71,21 @@ input { position x=1280 y=0 } +output "HDMI-A-1" { + mode "1920x1080@60.00" + position x=0 y=-180 +} + +output "DP-2" { + mode "2560x1440@144.00" + position x=1920 y=0 +} + +output "DP-1" { + mode "1680x1050@60.00" + position x=4480 y=-195 +} + // Settings that influence how windows are positioned and sized. // Find more information on the wiki: // https://yalter.github.io/niri/Configuration:-Layout