diff --git a/hmModules/niri/config.kdl b/hmModules/niri/config.kdl index c0045cd..d06c32d 100644 --- a/hmModules/niri/config.kdl +++ b/hmModules/niri/config.kdl @@ -351,11 +351,13 @@ binds { Mod+B { spawn "firefox"; } Mod+RETURN { spawn "emacsclient" "-c" "--eval" "(ccr/start-eshell)"; } Mod+M { spawn "emacsclient" "-c" "--eval" "(notmuch-search \"tag:new\")"; } - Mod+G { spawn "emacsclient" "-c" "--eval" "(switch-to-buffer (gptel \"*ChatGPT*\"))" "-F" "((name . \"GPTel - Emacs\") (width . 150) (height . 60))'"; } + // Mod+G { spawn "emacsclient" "-c" "--eval" "(switch-to-buffer (gptel \"*ChatGPT*\"))" "-F" "((name . \"GPTel - Emacs\") (width . $NIRI_GPTEL_COLS) (height . $NIRI_GPTEL_ROWS))'"; } + Mod+G { spawn "run-floating-gptel"; } Mod+Shift+C { spawn "emacsclient" "-c" "--eval" "(org-roam-dailies-capture-today)"; } Mod+Alt+L { spawn "swaylock"; } Mod+Space { spawn "rofi" "-show" "menu" "-modi" "menu:rofi-power-menu"; } - Mod+Ctrl+b { spawn "foot" "--title='bTop'" "-W" "210x60" "btop";} + // Mod+Ctrl+b { spawn "foot" "--title='bTop'" "-W" "$NIRI_BTOP_COLSx$NIRI_BTOP_ROWS" "btop";} + Mod+Ctrl+b { spawn "run-floating-btop"; } // Example volume keys mappings for PipeWire & WirePlumber. // The allow-when-locked=true property makes them work even when the session is locked. diff --git a/hmModules/niri/default.nix b/hmModules/niri/default.nix index 9210926..ded045b 100644 --- a/hmModules/niri/default.nix +++ b/hmModules/niri/default.nix @@ -2,13 +2,52 @@ pkgs, lib, config, + hostname, ... }: +let + niriVars = + { + picard = { + floating-gptel = { + rows = "60"; + cols = "150"; + }; + floating-btop = { + rows = "210"; + cols = "60"; + }; + }; + kirk = { + floating-gptel = { + rows = "40"; + cols = "140"; + }; + floating-btop = { + rows = "40"; + cols = "140"; + }; + }; + } + ."${hostname}" or niriVars.kirk; + run-floating-gptel = + with niriVars.floating-gptel; + pkgs.writeScriptBin "run-floating-gptel" '' + emacsclient -c --eval '(switch-to-buffer (gptel "*GptEl*"))' -F '((name . "GPTel - Emacs") (width . ${cols}) (height . ${rows}))' + ''; + run-floating-btop = + with niriVars.floating-btop; + pkgs.writeScriptBin "run-floating-btop" '' + foot --title='bTop' -W ${rows}x${cols} btop + ''; +in { home.packages = with pkgs; [ niri waypaper xwayland-satellite + run-floating-gptel + run-floating-btop ]; systemd.user.targets.niri-session = { Unit = { diff --git a/hosts/picard/default.nix b/hosts/picard/default.nix index 9c2f4a1..104a454 100644 --- a/hosts/picard/default.nix +++ b/hosts/picard/default.nix @@ -41,7 +41,6 @@ "adb" "prometheus-exporters" "promtail" - "dump1090" ] ++ [ ./disko.nix ]; diff --git a/modules/dump1090/default.nix b/modules/dump1090/default.nix deleted file mode 100644 index d6f2456..0000000 --- a/modules/dump1090/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ pkgs, lib, ... }: -{ - systemd.services.dump1090-fa = { - description = "dump1090 ADS-B receiver (FlightAware customization)"; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - - serviceConfig = { - DynamicUser = true; - SupplementaryGroups = "plugdev"; - ExecStart = lib.escapeShellArgs [ - (lib.getExe pkgs.dump1090) - "--net" - "--write-json" - "%t/dump1090-fa" - ]; - RuntimeDirectory = "dump1090-fa"; - WorkingDirectory = "%t/dump1090-fa"; - RuntimeDirectoryMode = 755; - }; - }; - - services.nginx = { - enable = true; - - virtualHosts."dump1090-fa" = { - listen = [ - { - addr = "0.0.0.0"; - port = 8080; - } - ]; - locations = { - "/".alias = "${pkgs.dump1090}/share/dump1090/"; - "/data/".alias = "/run/dump1090-fa/"; - }; - }; - }; - - # TODO before upstreaming in nixpkgs - # - add `meta.mainProgram` to dump1090 - # - rename dump1090 to dump1090-fa - # - optionally create an alias for dump1090 - # - securing the systemd service (`systemd-analyze security dump1090-fa`) -}