diff options
| -rw-r--r-- | home/desktop/connect.nix | 32 | ||||
| -rw-r--r-- | home/desktop/default.nix | 1 | ||||
| -rw-r--r-- | pkgs/default.nix | 1 | ||||
| -rw-r--r-- | pkgs/xfconnect-indicator/default.nix | 45 |
4 files changed, 79 insertions, 0 deletions
diff --git a/home/desktop/connect.nix b/home/desktop/connect.nix new file mode 100644 index 0000000..50b5934 --- /dev/null +++ b/home/desktop/connect.nix @@ -0,0 +1,32 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.local.desktop; +in { + config = mkIf cfg.enable { + services.kdeconnect = { + enable = true; + }; + + systemd.user.services.xfconnect-indicator = { + Install.WantedBy = ["default.target"]; + + Unit = { + After = ["graphical-session.target" "kdeconnect.service"]; + Requires = ["dbus.service"]; + WantedBy = ["graphical-session.target"]; + }; + + Service = { + ExecStart = "${lib.getExe pkgs.local.xfconnect-indicator} -s"; + TimeoutStartSec = "10s"; + Restart = "on-failure"; + RestartSec = "3s"; + }; + }; + }; +} diff --git a/home/desktop/default.nix b/home/desktop/default.nix index 5f2d34e..e296b97 100644 --- a/home/desktop/default.nix +++ b/home/desktop/default.nix @@ -8,6 +8,7 @@ in { imports = [ ./athena.nix + ./connect.nix ./firefox.nix ./sway.nix ]; diff --git a/pkgs/default.nix b/pkgs/default.nix index 8bd9e2c..cfc0dda 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -26,6 +26,7 @@ in { tmux-lift = callPackage ./tmux-lift {}; tmux-open = callPackage ./tmux-open {}; tmux-pass = callPackage ./tmux-pass.nix {}; + xfconnect-indicator = callPackage ./xfconnect-indicator {}; sysret-static = callPackage ./zola-static { site = "sysret.org"; diff --git a/pkgs/xfconnect-indicator/default.nix b/pkgs/xfconnect-indicator/default.nix new file mode 100644 index 0000000..f7f4262 --- /dev/null +++ b/pkgs/xfconnect-indicator/default.nix @@ -0,0 +1,45 @@ +{ + fetchFromGitHub, + gobject-introspection, + gtk3, + lib, + libappindicator-gtk3, + python3, + stdenv, + wrapGAppsHook3, +}: +stdenv.mkDerivation { + pname = "xfconnect-indicator"; + version = "0+master"; + + src = fetchFromGitHub { + repo = "xfconnect-indicator"; + owner = "juanramoncastan"; + + rev = "3e7a372042d00cba39684809f846a1c4317980b7"; + hash = "sha256-kLZQ1LTlxgtCbghpRjnCMjegUAJ2mn9NJ3toERKVSZM="; + }; + + buildInputs = [ + gobject-introspection + gtk3 + libappindicator-gtk3 + (python3.withPackages (py: [py.dbus-python py.pygobject3])) + ]; + + nativeBuildInputs = [ + wrapGAppsHook3 + ]; + + buildPhase = '' + mkdir -p $out/bin + cp -r source/share $out + cp source/bin/xfconnect-indicator.py $out/bin/xfconnect-indicator + chmod +x $out/bin/xfconnect-indicator + ''; + + meta = { + license = lib.licenses.gpl3; + mainProgram = "xfconnect-indicator"; + }; +} |
