configuration.nix/home/wm/niri/default.nix

65 lines
2.2 KiB
Nix
Raw Normal View History

2024-09-24 19:38:01 +05:30
{ lib, pkgs, config, ... }: {
home.packages = [ pkgs.niri ];
xdg.portal = {
extraPortals = [ pkgs.xdg-desktop-portal-gnome ];
configPackages = [ pkgs.niri ];
2024-09-24 20:45:46 +05:30
config = {
niri = {
default = [ "gnome" "gtk" ];
"org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ];
};
};
2024-09-24 19:38:01 +05:30
};
programs.zsh.profileExtra = ''
if [ -z $DISPLAY ] && [ -z $WAYLAND_DISPLAY ] && [ "$(tty)" = "/dev/tty1" ] ; then
exec ${lib.getExe pkgs.niri} --session
fi
'';
xdg.configFile."niri/config.kdl".source = pkgs.substituteAll {
src = ./config.kdl;
dbus_update_activation_env_cmd = "${pkgs.dbus}/bin/dbus-update-activation-environment";
systemctl_cmd = "${pkgs.systemd}/bin/systemctl";
loginctl_cmd = "${pkgs.systemd}/bin/loginctl";
wpaperctl_cmd = "${pkgs.wpaperd}/bin/wpaperctl";
kitty_cmd = "${lib.getExe pkgs.kitty}";
tmux_cmd = "${lib.getExe pkgs.tmux}";
rofi_cmd = "${lib.getExe config.programs.rofi.package}";
yazi_cmd = "${lib.getExe pkgs.yazi}";
firefox_cmd = "${lib.getExe config.programs.firefox.finalPackage}";
librewolf_cmd = "${lib.getExe pkgs.librewolf}";
wpctl_cmd = "${pkgs.wireplumber}/bin/wpctl";
2024-09-24 20:45:46 +05:30
brightnessctl_cmd = "${lib.getExe pkgs.brightnessctl}";
power_menu_cmd = "${pkgs.misc-scripts}/bin/power-menu";
tmux_sessions_cmd = "${pkgs.misc-scripts}/bin/tmux-sessions";
youtube_cmd = "${pkgs.youtube}/bin/youtube";
bluetooth_cmd = "${pkgs.rofi-bluetooth}/bin/rofi-bluetooth";
2024-09-24 19:38:01 +05:30
screenshot_path = "${config.xdg.userDirs.pictures}/Screenshots";
};
systemd.user = {
targets.niri-session = {
Unit = {
After = [ "graphical-session-pre.target" ];
BindsTo = [ "graphical-session.target" ];
Description = "Niri compositor session";
Documentation = "man:systemd.special(7)";
Wants = [ "graphical-session-pre.target" ];
};
};
targets.niri-shutdown = {
Unit = {
Description = "Shutdown running niri session";
DefaultDependencies = "no";
StopWhenUnneeded = true;
Conflicts = [ "graphical-session.target" "graphical-session-pre.target" ];
After = [ "graphical-session.target" "graphical-session-pre.target" ];
};
};
};
}