refactor: update niri, write config in kdl, remove niri-flake

• Updated input 'nixpkgs':
  → 'github:NixOS/nixpkgs/0254eab410b90ef2420c1059f908ae777e3b02f9?narHash=sha256-/US2Ei9JHXHVBAxV4FX49Q7H5s4UNBrIiOA6Xjzgq44%3D' (2025-12-06)

• Updated input 'home-manager':
    'github:nix-community/home-manager/f4cb25928fafa9ae68660fe71f730fc820a59028?narHash=sha256-5xOuutXM7UPTUcn3uDAD8UlPQsXmqPrX81cXoDOAGcA%3D' (2025-11-26)
  → 'github:nix-community/home-manager/89c9508bbe9b40d36b3dc206c2483ef176f15173?narHash=sha256-rB45jv4uwC90vM9UZ70plfvY/2Kdygs%2BzlQ07dGQFk4%3D' (2025-12-17)

• Updated input 'nixpkgs-master':
    'github:nixos/nixpkgs/6812bcfd614abedbdb3f68d7b6554eda6ca3e014?narHash=sha256-sNF/PZcuzYBHKRBkerEiPf5mkZM15A3fWD%2BlqpwKc60%3D' (2025-12-15)
  → 'github:nixos/nixpkgs/e50ab9bb181f9fb3ce00e7a6007c70ddaa007203?narHash=sha256-acPMRCAPgPykzkwATwD1EfF7xgmbraAvIJyCeR6bKxc%3D' (2025-12-18)

Signed-off-by: Ryan Yin <xiaoyin_c@qq.com>
This commit is contained in:
Ryan Yin
2025-12-18 22:56:55 +08:00
parent 307f5a490c
commit f3e0f2cd88
19 changed files with 722 additions and 916 deletions

View File

@@ -13,11 +13,11 @@
zramSwap.memoryPercent = lib.mkForce 75;
# Workaround for Mesa 25.3.0 regression
# Workaround for Mesa 25.3.1 regression
# https://github.com/nix-community/nixos-apple-silicon/issues/380
# https://github.com/NixOS/nixpkgs/pull/461866
hardware.graphics.package =
assert pkgs.mesa.version == "25.3.0";
assert pkgs.mesa.version == "25.3.1";
(import nixpkgs-mesa { localSystem = pkgs.stdenv.hostPlatform; }).mesa;
nix.settings = {

View File

@@ -1,6 +1,7 @@
{ config, niri, ... }:
{ config, ... }:
let
hostName = "shoukei"; # Define your hostname.
mkSymlink = config.lib.file.mkOutOfStoreSymlink;
in
{
programs.ssh.matchBlocks."github.com".identityFile =
@@ -11,44 +12,6 @@ in
"${config.home.homeDirectory}/nix-config/hosts/12kingdoms-shoukei/hypr-hardware.conf"
];
modules.desktop.niri = {
settings =
let
inherit (niri.lib.kdl)
node
plain
leaf
flag
;
in
[
(node "output" "eDP-1" [
(leaf "scale" 1.5)
(leaf "transform" "normal")
(leaf "mode" "2560x1600@60")
(leaf "position" {
x = 0;
y = 0;
})
])
# ============= Named Workspaces =============
(node "workspace" "1terminal" [ (leaf "open-on-output" "eDP-1") ])
(node "workspace" "2browser" [ (leaf "open-on-output" "eDP-1") ])
(node "workspace" "3chat" [ (leaf "open-on-output" "eDP-1") ])
(node "workspace" "4music" [ (leaf "open-on-output" "eDP-1") ])
(node "workspace" "5mail" [ (leaf "open-on-output" "eDP-1") ])
(node "workspace" "6file" [ (leaf "open-on-output" "eDP-1") ])
(node "workspace" "0other" [ (leaf "open-on-output" "eDP-1") ])
# Settings for debugging. Not meant for normal use.
# These can change or stop working at any point with little notice.
(plain "debug" [
# Override the DRM device that niri will use for all rendering.
# Fix: niri fails to correctly detect the primary render device
(leaf "render-drm-device" "/dev/dri/renderD128")
])
];
};
xdg.configFile."niri/niri-hardware.kdl".source =
mkSymlink "${config.home.homeDirectory}/nix-config/hosts/12kingdoms-shoukei/niri-hardware.kdl";
}

View File

@@ -0,0 +1,15 @@
output "eDP-1" {
scale 1.500000
transform "normal"
mode "2560x1600@60"
position x=0 y=0
}
workspace "1terminal" { open-on-output "eDP-1"; }
workspace "2browser" { open-on-output "eDP-1"; }
workspace "3chat" { open-on-output "eDP-1"; }
workspace "4music" { open-on-output "eDP-1"; }
workspace "5mail" { open-on-output "eDP-1"; }
workspace "6file" { open-on-output "eDP-1"; }
workspace "0other" { open-on-output "eDP-1"; }
debug { render-drm-device "/dev/dri/renderD128"; }

View File

@@ -1,4 +1,7 @@
{ config, niri, ... }:
{ config, ... }:
let
mkSymlink = config.lib.file.mkOutOfStoreSymlink;
in
{
programs.ssh.matchBlocks."github.com".identityFile = "${config.home.homeDirectory}/.ssh/idols-ai";
@@ -7,71 +10,6 @@
modules.desktop.hyprland.settings.source = [
"${config.home.homeDirectory}/nix-config/hosts/idols-ai/hypr-hardware.conf"
];
modules.desktop.niri = {
settings =
let
inherit (niri.lib.kdl)
node
plain
leaf
flag
;
in
[
# running `niri msg outputs` to find outputs
(node "output" "DP-2" [
# Uncomment this line to disable this output.
# (flag "off")
# Scale is a floating-point number, but at the moment only integer values work.
(leaf "scale" 1.5)
# Transform allows to rotate the output counter-clockwise, valid values are:
# normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270.
(leaf "transform" "normal")
# Resolution and, optionally, refresh rate of the output.
# The format is "<width>x<height>" or "<width>x<height>@<refresh rate>".
# If the refresh rate is omitted, niri will pick the highest refresh rate
# for the resolution.
# If the mode is omitted altogether or is invalid, niri will pick one automatically.
# Run `niri msg outputs` while inside a niri instance to list all outputs and their modes.
(leaf "mode" "3840x2160@144")
# Position of the output in the global coordinate space.
# This affects directional monitor actions like "focus-monitor-left", and cursor movement.
# The cursor can only move between directly adjacent outputs.
# Output scale has to be taken into account for positioning:
# outputs are sized in logical, or scaled, pixels.
# For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080,
# so to put another output directly adjacent to it on the right, set its x to 1920.
# It the position is unset or results in an overlap, the output is instead placed
# automatically.
(leaf "position" {
x = 0;
y = 0;
})
])
(node "output" "HDMI-A-1" [
(leaf "scale" 1.5)
(leaf "transform" "normal")
(leaf "mode" "3840x2160@60")
(leaf "position" {
x = 2560; # on the right of DP-2
y = 0;
})
])
# ============= Named Workspaces =============
(node "workspace" "2browser" [ (leaf "open-on-output" "DP-2") ])
(node "workspace" "4gaming" [ (leaf "open-on-output" "DP-2") ])
(node "workspace" "5music" [ (leaf "open-on-output" "DP-2") ])
(node "workspace" "1terminal" [ (leaf "open-on-output" "HDMI-A-1") ])
(node "workspace" "3chat" [ (leaf "open-on-output" "HDMI-A-1") ])
(node "workspace" "6file" [ (leaf "open-on-output" "HDMI-A-1") ])
(node "workspace" "0other" [ (leaf "open-on-output" "HDMI-A-1") ])
];
};
xdg.configFile."niri/niri-hardware.kdl".source =
mkSymlink "${config.home.homeDirectory}/nix-config/hosts/idols-ai/niri-hardware.kdl";
}

View File

@@ -0,0 +1,47 @@
// running `niri msg outputs` to find outputs
output "DP-2" {
// Uncomment this line to disable this output.
// off
// Scale is a floating-point number, but at the moment only integer values work.
scale 1.5
// Transform allows to rotate the output counter-clockwise, valid values are:
// normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270.
transform "normal"
// Resolution and, optionally, refresh rate of the output.
// The format is "<width>x<height>" or "<width>x<height>@<refresh rate>".
// If the refresh rate is omitted, niri will pick the highest refresh rate
// for the resolution.
// If the mode is omitted altogether or is invalid, niri will pick one automatically.
// Run `niri msg outputs` while inside a niri instance to list all outputs and their modes.
mode "3840x2160@144"
// Position of the output in the global coordinate space.
// This affects directional monitor actions like "focus-monitor-left", and cursor movement.
// The cursor can only move between directly adjacent outputs.
// Output scale has to be taken into account for positioning:
// outputs are sized in logical, or scaled, pixels.
// For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080,
// so to put another output directly adjacent to it on the right, set its x to 1920.
// It the position is unset or results in an overlap, the output is instead placed
// automatically.
position x=0 y=0
}
output "HDMI-A-1" {
scale 1.5
transform "normal"
mode "3840x2160@60"
position x=2560 y=0 // on the right of DP-2
}
// ============= Named Workspaces =============
workspace "2browser" { open-on-output "DP-2"; }
workspace "4gaming" { open-on-output "DP-2"; }
workspace "5music" { open-on-output "DP-2"; }
workspace "1terminal" { open-on-output "HDMI-A-1"; }
workspace "3chat" { open-on-output "HDMI-A-1"; }
workspace "6file" { open-on-output "HDMI-A-1"; }
workspace "0other" { open-on-output "HDMI-A-1"; }