Add host type and hostname to vars for easy reference by submodules

This commit is contained in:
KnightArtorias 2025-12-11 00:48:55 +00:00
parent a31df4e136
commit 9a03d585e4
3 changed files with 30 additions and 39 deletions

View file

@ -23,6 +23,8 @@
# Generic NixOS config # Generic NixOS config
mkNixOSConfig = { mkNixOSConfig = {
path, path,
type,
hostname,
extraModules ? [], extraModules ? [],
}: }:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
@ -35,12 +37,21 @@
path path
] ]
++ extraModules; ++ extraModules;
vars.type = type;
vars.hostname = hostname;
}; };
# Additional modules for physical hosts # Additional modules for physical hosts
mkPhysicalNixOSConfig = path: mkPhysicalNixOSConfig = {
path,
type,
hostname,
}:
mkNixOSConfig { mkNixOSConfig {
path = path; path = path;
type = type;
hostname = hostname;
extraModules = [ ./hosts/physical ]; extraModules = [ ./hosts/physical ];
}; };
@ -61,7 +72,7 @@
# Collection of all of our configs # Collection of all of our configs
nixosConfigurations = { nixosConfigurations = {
# =========== Desktops =========== # =========== Desktops ===========
crow = mkPhysicalNixOSConfig ./hosts/physical/crow; crow = mkPhysicalNixOSConfig ./hosts/physical/crow "physical" "crow";
}; };
}; };
} }

View file

@ -6,7 +6,7 @@
../tiling ../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 = { programs.zsh = {
profileExtra = '' profileExtra = ''

View file

@ -8,19 +8,6 @@
// https://yalter.github.io/niri/Configuration:-Input // https://yalter.github.io/niri/Configuration:-Input
input { input {
keyboard { 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. // Enable numlock on startup, omitting this setting disables it.
numlock numlock
} }
@ -42,31 +29,9 @@ input {
// disabled-on-external-mouse // 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. // 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. // 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 // You can configure outputs by their name, which you can find
@ -106,6 +71,21 @@ input {
position x=1280 y=0 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. // Settings that influence how windows are positioned and sized.
// Find more information on the wiki: // Find more information on the wiki:
// https://yalter.github.io/niri/Configuration:-Layout // https://yalter.github.io/niri/Configuration:-Layout