mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 00:33:00 +00:00
Separate WM dependencies via systemd
This commit is contained in:
parent
47d967bfc9
commit
a343383c49
18 changed files with 124 additions and 95 deletions
|
|
@ -26,7 +26,7 @@
|
||||||
# desktop environment and display manager
|
# desktop environment and display manager
|
||||||
../../modules/nixos/desktop/dm/tuigreet.nix
|
../../modules/nixos/desktop/dm/tuigreet.nix
|
||||||
../../modules/nixos/desktop/de/niri.nix
|
../../modules/nixos/desktop/de/niri.nix
|
||||||
../../modules/nixos/desktop/de/hyprland.nix
|
../../modules/nixos/desktop/de/kde.nix
|
||||||
|
|
||||||
# desktop programs
|
# desktop programs
|
||||||
../../modules/nixos/programs/zsh.nix
|
../../modules/nixos/programs/zsh.nix
|
||||||
|
|
|
||||||
|
|
@ -10,4 +10,8 @@
|
||||||
serviceMode = "user";
|
serviceMode = "user";
|
||||||
userName = "js0ny";
|
userName = "js0ny";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.plasma6.excludePackages = with pkgs.kdePackages; [
|
||||||
|
kate # kate and kwrite
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,8 @@ in {
|
||||||
prismlauncher
|
prismlauncher
|
||||||
obsidian
|
obsidian
|
||||||
file-roller
|
file-roller
|
||||||
siyuan
|
steamtinkerlaunch
|
||||||
|
scanmem
|
||||||
]
|
]
|
||||||
++ (mkFcitxIM [
|
++ (mkFcitxIM [
|
||||||
pkgs.neovim-qt
|
pkgs.neovim-qt
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,10 @@
|
||||||
krunner = {
|
krunner = {
|
||||||
position = "center";
|
position = "center";
|
||||||
};
|
};
|
||||||
workspace = {
|
# workspace = {
|
||||||
iconTheme = "${config.my.desktop.style.iconTheme.dark}";
|
# iconTheme = "${config.my.desktop.style.iconTheme.dark}";
|
||||||
colorScheme = "BreezeDark";
|
# colorScheme = "BreezeDark";
|
||||||
};
|
# };
|
||||||
kwin = {
|
kwin = {
|
||||||
virtualDesktops.number = 8;
|
virtualDesktops.number = 8;
|
||||||
titlebarButtons = {
|
titlebarButtons = {
|
||||||
|
|
@ -139,18 +139,4 @@
|
||||||
};
|
};
|
||||||
inputMode = "vi";
|
inputMode = "vi";
|
||||||
};
|
};
|
||||||
programs.konsole = {
|
|
||||||
enable = true;
|
|
||||||
defaultProfile = "Default";
|
|
||||||
profiles = {
|
|
||||||
Default = {
|
|
||||||
command = "${pkgs.fish}/bin/fish";
|
|
||||||
colorScheme = "catppuccin-mocha";
|
|
||||||
font = {
|
|
||||||
name = "Maple Mono NF CN";
|
|
||||||
size = 12;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
nixcfgs/users/js0ny/programs/desktop/wayland-wm/dunst.nix
Normal file
12
nixcfgs/users/js0ny/programs/desktop/wayland-wm/dunst.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
{lib, ...}: {
|
||||||
|
services.dunst.enable = true;
|
||||||
|
systemd.user.services.dunst = {
|
||||||
|
Install.WantedBy = lib.mkForce ["niri.service"];
|
||||||
|
Service = {
|
||||||
|
# Disable on KDE
|
||||||
|
ExecCondition = lib.mkForce ''
|
||||||
|
/bin/sh -c '[ "$XDG_CURRENT_DESKTOP" != "KDE" ] && [ "$XDG_CURRENT_DESKTOP" != "Plasma" ]'
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -21,11 +21,7 @@
|
||||||
ecosystem = {
|
ecosystem = {
|
||||||
no_update_news = true;
|
no_update_news = true;
|
||||||
};
|
};
|
||||||
# exec-once = [
|
exec-once = ["systemctl --user start waylandwm-session.target"];
|
||||||
# "waybar"
|
|
||||||
# "dunst"
|
|
||||||
# "${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent"
|
|
||||||
# ];
|
|
||||||
general = {
|
general = {
|
||||||
gaps_in = 2;
|
gaps_in = 2;
|
||||||
gaps_out = 2;
|
gaps_out = 2;
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
in {
|
in {
|
||||||
services.kanshi = {
|
services.kanshi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
systemdTarget = "niri.service";
|
||||||
settings = [
|
settings = [
|
||||||
# Outputs
|
# Outputs
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
spawn-at-startup = [
|
spawn-at-startup = [
|
||||||
{argv = ["fcitx5"];}
|
{argv = ["systemctl" " --user" "start" "waylandwm-session.target"];}
|
||||||
{argv = ["swww-daemon"];}
|
|
||||||
# polkit/portal helpers
|
|
||||||
# {argv = ["${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent"];}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
input = {
|
input = {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
{pkgs, ...}: let
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
# swayidleWrapper = pkgs.writeShellScriptBin "swayidle-wrapper" ''
|
# swayidleWrapper = pkgs.writeShellScriptBin "swayidle-wrapper" ''
|
||||||
# ${pkgs.swayidle}/bin/swayidle -w \
|
# ${pkgs.swayidle}/bin/swayidle -w \
|
||||||
# timeout 300 'swaylock -f' \
|
# timeout 300 'swaylock -f' \
|
||||||
|
|
@ -42,6 +46,8 @@ in {
|
||||||
./hyprlock.nix
|
./hyprlock.nix
|
||||||
./swayidle.nix
|
./swayidle.nix
|
||||||
./sunsetr.nix
|
./sunsetr.nix
|
||||||
|
./systemd.nix
|
||||||
|
./dunst.nix
|
||||||
];
|
];
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
swayidle # Screensaver
|
swayidle # Screensaver
|
||||||
|
|
@ -50,14 +56,15 @@ in {
|
||||||
brightnessctl
|
brightnessctl
|
||||||
playerctl
|
playerctl
|
||||||
powerprofiles-next
|
powerprofiles-next
|
||||||
blueman
|
|
||||||
];
|
];
|
||||||
xdg.portal = {
|
xdg.portal = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraPortals = with pkgs; [xdg-desktop-portal-wlr xdg-desktop-portal-gtk];
|
extraPortals = with pkgs; [xdg-desktop-portal-wlr xdg-desktop-portal-gtk];
|
||||||
};
|
};
|
||||||
services.cliphist.enable = true;
|
# TODO: Allow launching components from all wayland-wm sessions
|
||||||
services.dunst.enable = true;
|
# services.cliphist.enable = true; # use elephant + walker
|
||||||
services.network-manager-applet.enable = true;
|
services.network-manager-applet.enable = true;
|
||||||
catppuccin.dunst.enable = false;
|
services.blueman-applet.enable = true;
|
||||||
|
services.blueman-applet.systemdTargets = ["niri.service"];
|
||||||
|
systemd.user.services.network-manager-applet.Install.WantedBy = lib.mkForce ["niri.service"];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
systemd.user.services.hyprpolkitagent = {
|
systemd.user.services.hyprpolkitagent = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Hyprland Polkit Authentication Agent";
|
Description = "Hyprland Polkit Authentication Agent";
|
||||||
PartOf = ["graphical-session.target"];
|
PartOf = ["waylandwm-session.target"];
|
||||||
After = ["graphical-session.target"];
|
After = ["graphical-session.target"];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
Install = {
|
Install = {
|
||||||
WantedBy = ["graphical-session.target"];
|
WantedBy = ["waylandwm-session.target"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
|
# Expose CLI tool
|
||||||
|
home.packages = [pkgs.sunsetr];
|
||||||
|
|
||||||
systemd.user.services.sunsetr = {
|
systemd.user.services.sunsetr = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Sunsetr blue-light filtering";
|
Description = "Sunsetr blue-light filtering";
|
||||||
PartOf = ["graphical-session.target"];
|
PartOf = ["waylandwm-session.target"];
|
||||||
After = ["graphical-session.target"];
|
After = ["graphical-session.target"];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -15,7 +18,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
Install = {
|
Install = {
|
||||||
WantedBy = ["graphical-session.target"];
|
WantedBy = ["niri.service"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
services.swayidle = {
|
services.swayidle = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
systemdTarget = "waylandwm-session.target";
|
||||||
timeouts = [
|
timeouts = [
|
||||||
{
|
{
|
||||||
timeout = 300;
|
timeout = 300;
|
||||||
|
|
|
||||||
13
nixcfgs/users/js0ny/programs/desktop/wayland-wm/systemd.nix
Normal file
13
nixcfgs/users/js0ny/programs/desktop/wayland-wm/systemd.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
{lib, ...}: {
|
||||||
|
systemd.user.targets.waylandwm-session = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Window Manager session, used to run services tied to the WM lifecycle";
|
||||||
|
Documentation = ["man:systemd.special(7)"];
|
||||||
|
|
||||||
|
BindsTo = ["niri.service"];
|
||||||
|
After = ["niri.service"];
|
||||||
|
|
||||||
|
PartOf = ["graphical-session.target"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
systemd = {
|
systemd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
target = "graphical-session.target";
|
target = "niri.service";
|
||||||
};
|
};
|
||||||
style = ''
|
style = ''
|
||||||
* {
|
* {
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
imports = [./konsole.nix];
|
||||||
|
|
||||||
# Manually merge dolphin config to existing file
|
# Manually merge dolphin config to existing file
|
||||||
home.activation.mergeDolphinrc = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
home.activation.mergeDolphinrc = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
if [ -f ~/.config/dolphinrc-override ]; then
|
if [ -f ~/.config/dolphinrc-override ]; then
|
||||||
|
|
|
||||||
22
nixcfgs/users/js0ny/programs/konsole.nix
Normal file
22
nixcfgs/users/js0ny/programs/konsole.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
# Dependency: plasma-manager
|
||||||
|
# Required by dolphin's terminal integration
|
||||||
|
programs.konsole = {
|
||||||
|
enable = true;
|
||||||
|
defaultProfile = "Default";
|
||||||
|
profiles = {
|
||||||
|
Default = {
|
||||||
|
command = lib.getExe config.my.desktop.preferredApps.interactiveShell;
|
||||||
|
colorScheme = "catppuccin-mocha";
|
||||||
|
font = {
|
||||||
|
name = "Maple Mono NF CN";
|
||||||
|
size = 12;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -3,14 +3,20 @@
|
||||||
# * when `rga-fzf`: nvim wrapper failed to launch
|
# * when `rga-fzf`: nvim wrapper failed to launch
|
||||||
# * nvim wrapper reports error on parsing filename with spaces
|
# * nvim wrapper reports error on parsing filename with spaces
|
||||||
gvim = "neovide.desktop";
|
gvim = "neovide.desktop";
|
||||||
simpleText = [
|
simpleText =
|
||||||
"text/plain"
|
[
|
||||||
"text/x-csrc" # .c
|
"text/plain"
|
||||||
"text/x-chdr" # .h
|
"text/x-csrc" # .c
|
||||||
"text/javascript"
|
"text/x-chdr" # .h
|
||||||
"text/x-python"
|
"text/javascript"
|
||||||
"application/yaml" # .yaml, .yml
|
"text/x-python"
|
||||||
];
|
"application/yaml" # .yaml, .yml
|
||||||
|
"text/x-patch" # .patch .diff
|
||||||
|
]
|
||||||
|
++ [
|
||||||
|
"text/csv"
|
||||||
|
"text/markdown"
|
||||||
|
];
|
||||||
image = [
|
image = [
|
||||||
"image/jpeg"
|
"image/jpeg"
|
||||||
"image/jpg"
|
"image/jpg"
|
||||||
|
|
@ -44,62 +50,40 @@
|
||||||
audioPlayers = "mpv.desktop;org.kde.elisa";
|
audioPlayers = "mpv.desktop;org.kde.elisa";
|
||||||
browsers = "firefox.desktop;chromium-browser.desktop";
|
browsers = "firefox.desktop;chromium-browser.desktop";
|
||||||
archiveManager = "org.gnome.FileRoller.desktop;org.kde.ark.desktop;peazip.desktop";
|
archiveManager = "org.gnome.FileRoller.desktop;org.kde.ark.desktop;peazip.desktop";
|
||||||
|
mkAssoc = app: mimes:
|
||||||
|
builtins.listToAttrs (map (mime: {
|
||||||
|
name = mime;
|
||||||
|
value = app;
|
||||||
|
})
|
||||||
|
mimes);
|
||||||
in {
|
in {
|
||||||
xdg.configFile."mimeapps.list".force = true;
|
xdg.configFile."mimeapps.list".force = true;
|
||||||
xdg.mime.enable = true;
|
xdg.mime.enable = true;
|
||||||
xdg.mimeApps = {
|
xdg.mimeApps = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# In Dolphin, middle click to open with 2nd order default app
|
# In Dolphin, middle click to open with 2nd order default app
|
||||||
defaultApplications = {
|
defaultApplications =
|
||||||
# PDF
|
mkAssoc "org.kde.okular.desktop" ["application/pdf"]
|
||||||
"application/pdf" = "org.kde.okular.desktop";
|
// mkAssoc gvim simpleText
|
||||||
# Plain text
|
// {
|
||||||
"text/plain" = gvim;
|
"inode/directory" = "org.kde.dolphin.desktop";
|
||||||
# Source Code - C
|
}
|
||||||
"text/x-csrc" = gvim; # .c
|
// mkAssoc imageViewers image
|
||||||
"text/x-chdr" = gvim; # .h
|
// mkAssoc "onlyoffice-desktopeditors.desktop" [
|
||||||
"text/javascript" = gvim;
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
"text/x-python" = gvim;
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
||||||
"application/yaml" = gvim; # .yaml, .yml
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
||||||
# CSV
|
]
|
||||||
"text/csv" = gvim;
|
|
||||||
"text/markdown" = gvim;
|
|
||||||
# File Explorer
|
|
||||||
"inode/directory" = "org.kde.dolphin.desktop";
|
|
||||||
"image/jpeg" = imageViewers;
|
|
||||||
"image/jpg" = imageViewers;
|
|
||||||
"image/png" = imageViewers;
|
|
||||||
"image/gif" = imageViewers;
|
|
||||||
"image/bmp" = imageViewers;
|
|
||||||
"image/avif" = imageViewers;
|
|
||||||
"image/webp" = imageViewers;
|
|
||||||
|
|
||||||
# Microsoft Office
|
|
||||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = "onlyoffice-desktopeditors.desktop";
|
|
||||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = "onlyoffice-desktopeditors.desktop";
|
|
||||||
"application/vnd.openxmlformats-officedocument.presentationml.presentation" = "onlyoffice-desktopeditors.desktop";
|
|
||||||
|
|
||||||
# Audio:
|
# Audio:
|
||||||
# music: elisa: fully featured, good cjk support
|
# music: elisa: fully featured, good cjk support
|
||||||
# audio: mpv: simple and fast
|
# audio: mpv: simple and fast
|
||||||
"audio/flac" = audioPlayers;
|
// mkAssoc audioPlayers audio
|
||||||
"audio/vnd.wave" = audioPlayers; # .wav
|
// mkAssoc browsers browser
|
||||||
|
// mkAssoc "org.telegram.desktop.desktop" [
|
||||||
# Browser
|
"x-scheme-handler/tg"
|
||||||
"text/html" = browsers;
|
"x-scheme-handler/tonsite"
|
||||||
"x-scheme-handler/http" = browsers;
|
]
|
||||||
"x-scheme-handler/https" = browsers;
|
// mkAssoc archiveManager archive;
|
||||||
# URL Scheme
|
|
||||||
"x-scheme-handler/tg" = "org.telegram.desktop.desktop";
|
|
||||||
"x-scheme-handler/tonsite" = "org.telegram.desktop.desktop";
|
|
||||||
|
|
||||||
# Archives
|
|
||||||
"application/zip" = archiveManager;
|
|
||||||
"application/x-rar" = archiveManager;
|
|
||||||
"application/x-7z-compressed" = archiveManager;
|
|
||||||
"application/x-tar" = archiveManager;
|
|
||||||
"application/x-zstd-compressed-tar" = archiveManager; # .tar.zst
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
home.sessionVariables.BROWSER = "firefox";
|
home.sessionVariables.BROWSER = "firefox";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
./programs/walker.nix
|
./programs/walker.nix
|
||||||
|
|
||||||
# Desktop Linux
|
# Desktop Linux
|
||||||
./programs/desktop/wayland-wm/hyprland
|
./programs/desktop/plasma
|
||||||
./programs/desktop/wayland-wm/niri
|
./programs/desktop/wayland-wm/niri
|
||||||
|
|
||||||
../../modules/home/do-not-track.nix
|
../../modules/home/do-not-track.nix
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue