1
1
Fork 0

niri: switch to floating pr

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2024-12-28 13:30:52 -05:00
parent cf486d7735
commit d1fb8dcc5a
Signed by: Myned
GPG key ID: C7224454F7881A34
5 changed files with 34 additions and 5 deletions

View file

@ -57,7 +57,8 @@
hyprpaper = flake "github:hyprwm/hyprpaper" // unstable "nixpkgs";
hyprpicker = flake "github:hyprwm/hyprpicker" // unstable "nixpkgs";
jovian-nixos = flake "github:Jovian-Experiments/Jovian-NixOS" // unstable "nixpkgs";
niri = flake "github:sodiboo/niri-flake" // unstable "nixpkgs";
niri = flake "github:YaLTeR/niri/floating" // unstable "nixpkgs";
niri-flake = flake "github:sodiboo/niri-flake" // unstable "nixpkgs";
nix-flatpak = flake "github:gmodena/nix-flatpak?ref=v0.5.1";
nix-index-database-unstable = flake "github:nix-community/nix-index-database" // unstable "nixpkgs";
nix-vscode-extensions = flake "github:nix-community/nix-vscode-extensions" // unstable "nixpkgs";
@ -119,7 +120,7 @@
inputs.arion.nixosModules.arion
inputs.disko.nixosModules.disko
inputs.fw-fanctrl.nixosModules.default
inputs.niri.nixosModules.niri
inputs.niri-flake.nixosModules.niri
inputs.stylix.nixosModules.stylix
];

View file

@ -96,6 +96,10 @@
url = "github:Rawa/lifx-cli";
};
niri = {
inputs.nixpkgs.follows = "nixpkgs-unstable";
url = "github:YaLTeR/niri/floating";
};
niri-flake = {
inputs.nixpkgs.follows = "nixpkgs-unstable";
url = "github:sodiboo/niri-flake";
};

View file

@ -39,6 +39,7 @@ in {
wallpaper = mkOption {default = false;};
browser = {
# TODO: Use lib.getExe' instead of /bin/ everywhere
# HACK: Find first matching package in final home-manager list
command = mkOption {
default = "${lib.findFirst (pkg:

View file

@ -113,6 +113,7 @@ in {
(key "E" "Ctrl+Alt" (spawn [pkill "codium"]))
(key "E" "Mod" (spawn codium))
(key "Equal" "Mod" (spawn [swayosd-client "--output-volume" "raise"]))
(key "Escape" "Mod" toggle-window-floating)
(key "Escape" "Mod+Alt" (spawn ["lifx" "state" "--color" "red"]))
(key "F" "Mod" (spawn [nautilus "--new-window"]))
(key "G" "Ctrl+Alt" (spawn [pkill "steam"]))
@ -145,6 +146,7 @@ in {
(key "Space" "Ctrl+Alt" (spawn ["lifx" "toggle"]))
(key "T" "Ctrl+Alt" (spawn [pkill "kitty"]))
(key "T" "Mod" (spawn kitty))
(key "Tab" "Mod" switch-focus-between-floating-and-tiling)
(key "Up" "Mod" (spawn [swayosd-client "--brightness" "raise"]))
(key "V" "Mod" (spawn virt-manager))
(key "V" "Mod+Ctrl" (spawn vm))

View file

@ -7,6 +7,9 @@
}:
with lib; let
cfg = config.custom.desktops.niri;
# TODO: Use let bindings for hm config everywhere
hm = config.home-manager.users.${config.custom.username};
in {
options.custom.desktops.niri = {
enable = mkOption {default = false;};
@ -35,10 +38,11 @@ in {
# https://github.com/sodiboo/niri-flake/blob/main/docs.md
programs.niri = {
enable = true;
package = pkgs.niri; # nixpkgs
#// package = pkgs.niri; # nixpkgs
package = inputs.niri.packages.${pkgs.system}.default;
};
nixpkgs.overlays = [inputs.niri.overlays.niri];
nixpkgs.overlays = [inputs.niri-flake.overlays.niri];
#!! Disabled bundled KDE polkit agent
# https://github.com/sodiboo/niri-flake?tab=readme-ov-file#additional-notes
@ -48,7 +52,24 @@ in {
custom.services.xwayland-satellite.enable = cfg.xwayland;
home-manager.users.${config.custom.username} = {
programs.niri.package = config.programs.niri.package;
programs.niri = {
package = config.programs.niri.package;
# https://github.com/YaLTeR/niri/wiki/Configuration:-Overview
# HACK: Prepend validated kdl config not currently implemented in settings module for e.g. custom build
# https://github.com/sodiboo/niri-flake/blob/main/settings.nix
config = with inputs.niri-flake.lib;
(internal.settings-module {config = hm;}).options.programs.niri.config.default
# https://github.com/sodiboo/niri-flake/blob/main/default-config.kdl.nix
++ (with kdl; [
# TODO: Migrate to niri.settings when released
# https://github.com/YaLTeR/niri/pull/871
(plain "window-rule" [
(leaf "match" {title = "^Picture.in.[Pp]icture$";})
(leaf "open-floating" true)
])
]);
};
};
};
}