diff options
| -rw-r--r-- | accounts/gkleen@sif/default.nix | 13 | ||||
| -rw-r--r-- | accounts/gkleen@sif/niri.nix | 21 | ||||
| -rw-r--r-- | accounts/gkleen@sif/systemd.nix | 28 |
3 files changed, 54 insertions, 8 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index f4a121c4..ccb772e9 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix | |||
| @@ -345,6 +345,19 @@ in { | |||
| 345 | "kitty_mod+t" = "new_tab_with_cwd"; | 345 | "kitty_mod+t" = "new_tab_with_cwd"; |
| 346 | }; | 346 | }; |
| 347 | }; | 347 | }; |
| 348 | alacritty = { | ||
| 349 | enable = true; | ||
| 350 | theme = "kitty"; | ||
| 351 | settings = { | ||
| 352 | font = { | ||
| 353 | normal = { | ||
| 354 | family = "Fira Mono"; | ||
| 355 | style = "Medium"; | ||
| 356 | }; | ||
| 357 | size = 10; | ||
| 358 | }; | ||
| 359 | }; | ||
| 360 | }; | ||
| 348 | fuzzel = { | 361 | fuzzel = { |
| 349 | enable = true; | 362 | enable = true; |
| 350 | settings = { | 363 | settings = { |
diff --git a/accounts/gkleen@sif/niri.nix b/accounts/gkleen@sif/niri.nix index 80abfc1a..a27b4137 100644 --- a/accounts/gkleen@sif/niri.nix +++ b/accounts/gkleen@sif/niri.nix | |||
| @@ -6,7 +6,8 @@ let | |||
| 6 | sleaf = name: arg: kdl.node name [arg] []; | 6 | sleaf = name: arg: kdl.node name [arg] []; |
| 7 | 7 | ||
| 8 | niri = cfg.package; | 8 | niri = cfg.package; |
| 9 | terminal = lib.getExe config.programs.kitty.package; | 9 | spawnTerminal = { command ? lib.getExe config.programs.zsh.package, extraArgs ? [] }: |
| 10 | [(lib.getExe config.programs.alacritty.package) "msg" "--socket" "/run/user/1000/alacritty.sock" "create-window"] ++ lib.toList extraArgs ++ ["--command" (lib.getExe' hostConfig.systemd.package "systemd-run") "--user" "--pty" "--same-dir" "--wait" "--collect" "--quiet" "--service-type=exec" "--expand-environment=no"] ++ lib.toList command; | ||
| 10 | 11 | ||
| 11 | focus_or_spawn = pkgs.writeShellApplication { | 12 | focus_or_spawn = pkgs.writeShellApplication { |
| 12 | name = "focus-or-spawn"; | 13 | name = "focus-or-spawn"; |
| @@ -425,8 +426,8 @@ in { | |||
| 425 | } | 426 | } |
| 426 | { name = "term"; | 427 | { name = "term"; |
| 427 | key = "Mod+Control+Return"; | 428 | key = "Mod+Control+Return"; |
| 428 | app-id = "kitty-scratch"; | 429 | app-id = "alacritty-scratch"; |
| 429 | spawn = [ "kitty" "--app-id" "kitty-scratch" ]; | 430 | spawn = spawnTerminal { extraArgs = ["--class" "alacritty-scratch"]; }; |
| 430 | } | 431 | } |
| 431 | { name = "edit"; | 432 | { name = "edit"; |
| 432 | match = [ { title = "^scratch$"; app-id = "^emacs$"; } ]; | 433 | match = [ { title = "^scratch$"; app-id = "^emacs$"; } ]; |
| @@ -656,7 +657,8 @@ in { | |||
| 656 | ]) | 657 | ]) |
| 657 | (plain "window-rule" [ | 658 | (plain "window-rule" [ |
| 658 | (sleaf "match" { app-id = "^kitty$"; }) | 659 | (sleaf "match" { app-id = "^kitty$"; }) |
| 659 | (sleaf "match" { app-id = "^kitty-play$"; }) | 660 | (sleaf "match" { app-id = "^alacritty$"; }) |
| 661 | (sleaf "match" { app-id = "^(kitty|alacritty)-play$"; }) | ||
| 660 | (plain "default-column-width" [(sleaf "proportion" (1. / 3.))]) | 662 | (plain "default-column-width" [(sleaf "proportion" (1. / 3.))]) |
| 661 | ]) | 663 | ]) |
| 662 | 664 | ||
| @@ -677,7 +679,7 @@ in { | |||
| 677 | (plain "default-column-width" [(sleaf "proportion" 1.)]) | 679 | (plain "default-column-width" [(sleaf "proportion" 1.)]) |
| 678 | ]) | 680 | ]) |
| 679 | (plain "window-rule" [ | 681 | (plain "window-rule" [ |
| 680 | (sleaf "match" { app-id = "^kitty-play$"; }) | 682 | (sleaf "match" { app-id = "^(kitty|alacritty)-play$"; }) |
| 681 | (sleaf "open-on-workspace" "vid") | 683 | (sleaf "open-on-workspace" "vid") |
| 682 | (sleaf "open-focused" false) | 684 | (sleaf "open-focused" false) |
| 683 | ]) | 685 | ]) |
| @@ -754,7 +756,7 @@ in { | |||
| 754 | (lib.mapAttrsToList bind (with config.lib.niri.actions; { | 756 | (lib.mapAttrsToList bind (with config.lib.niri.actions; { |
| 755 | "Mod+Slash".action = show-hotkey-overlay; | 757 | "Mod+Slash".action = show-hotkey-overlay; |
| 756 | 758 | ||
| 757 | "Mod+Return".action = spawn terminal; | 759 | "Mod+Return".action = spawn (spawnTerminal {}); |
| 758 | "Mod+Shift+Return".action = | 760 | "Mod+Shift+Return".action = |
| 759 | let | 761 | let |
| 760 | nushellKitty = pkgs.symlinkJoin { | 762 | nushellKitty = pkgs.symlinkJoin { |
| @@ -784,9 +786,12 @@ in { | |||
| 784 | })); | 786 | })); |
| 785 | "Mod+Alt+L".action = spawn (lib.getExe (pkgs.writeShellApplication { | 787 | "Mod+Alt+L".action = spawn (lib.getExe (pkgs.writeShellApplication { |
| 786 | name = "queue-yt-dlp"; | 788 | name = "queue-yt-dlp"; |
| 787 | runtimeInputs = with pkgs; [ wl-clipboard-rs config.programs.kitty.package ]; | 789 | runtimeInputs = with pkgs; [ wl-clipboard-rs ]; |
| 788 | text = '' | 790 | text = '' |
| 789 | exec -- kitty --app-id kitty-play --directory "$HOME"/media mpv "$(wl-paste)" | 791 | exec -- ${lib.concatStringsSep " " (spawnTerminal { |
| 792 | extraArgs = [ "--class" "alacritty-play" "--working-directory" "\"$HOME\"/media" ]; | ||
| 793 | command = ["mpv" "\"$(wl-paste)\""]; | ||
| 794 | })} | ||
| 790 | ''; | 795 | ''; |
| 791 | })); | 796 | })); |
| 792 | "Mod+Alt+M".action = spawn (lib.getExe' pkgs.screen-message "sm") "-n" "Fira Mono" "-a" "1" "-f" "#fff" "-b" "#000"; | 797 | "Mod+Alt+M".action = spawn (lib.getExe' pkgs.screen-message "sm") "-n" "Fira Mono" "-a" "1" "-f" "#fff" "-b" "#000"; |
diff --git a/accounts/gkleen@sif/systemd.nix b/accounts/gkleen@sif/systemd.nix index 51671b20..2ccbaea0 100644 --- a/accounts/gkleen@sif/systemd.nix +++ b/accounts/gkleen@sif/systemd.nix | |||
| @@ -389,6 +389,25 @@ in { | |||
| 389 | WantedBy = lib.mkForce ["tray.target"]; | 389 | WantedBy = lib.mkForce ["tray.target"]; |
| 390 | }; | 390 | }; |
| 391 | }; | 391 | }; |
| 392 | alacritty = { | ||
| 393 | Unit = { | ||
| 394 | Requisite = ["graphical-session.target"]; | ||
| 395 | After = [ "graphical-session.target" ]; | ||
| 396 | }; | ||
| 397 | Service = { | ||
| 398 | ExecStart = "${lib.getExe pkgs.alacritty} --daemon --socket %t/alacritty-activated.sock"; | ||
| 399 | }; | ||
| 400 | }; | ||
| 401 | alacritty-proxy = { | ||
| 402 | Unit = { | ||
| 403 | Requires = ["alacritty.service" "alacritty-proxy.socket"]; | ||
| 404 | After = ["alacritty.service" "alacritty-proxy.socket"]; | ||
| 405 | }; | ||
| 406 | Service = { | ||
| 407 | Type = "notify"; | ||
| 408 | ExecStart = "${config.systemd.package}/lib/systemd/systemd-socket-proxyd %t/alacritty-activated.sock"; | ||
| 409 | }; | ||
| 410 | }; | ||
| 392 | } // listToAttrs (map ({host, port}: nameValuePair "proxy-to-autossh-socks@${toString port}" { | 411 | } // listToAttrs (map ({host, port}: nameValuePair "proxy-to-autossh-socks@${toString port}" { |
| 393 | Unit = { | 412 | Unit = { |
| 394 | BindsTo = ["autossh-socks@${host}:${toString (port + 1)}.service" "proxy-to-autossh-socks@${toString port}.socket"]; | 413 | BindsTo = ["autossh-socks@${host}:${toString (port + 1)}.service" "proxy-to-autossh-socks@${toString port}.socket"]; |
| @@ -433,6 +452,15 @@ in { | |||
| 433 | WantedBy = ["sockets.target"]; | 452 | WantedBy = ["sockets.target"]; |
| 434 | }; | 453 | }; |
| 435 | }; | 454 | }; |
| 455 | "alacritty-proxy" = { | ||
| 456 | Socket = { | ||
| 457 | SocketMode = "0600"; | ||
| 458 | ListenStream = "%t/alacritty.sock"; | ||
| 459 | }; | ||
| 460 | Install = { | ||
| 461 | WantedBy = ["sockets.target"]; | ||
| 462 | }; | ||
| 463 | }; | ||
| 436 | }; | 464 | }; |
| 437 | timers = { | 465 | timers = { |
| 438 | "sync-keepass@store.kdbx" = { | 466 | "sync-keepass@store.kdbx" = { |
