feat: add tailscale
This commit is contained in:
parent
f451acb559
commit
89b88b9082
3 changed files with 32 additions and 2 deletions
|
|
@ -7,4 +7,6 @@
|
||||||
|
|
||||||
services.mullvad-vpn.enable = true;
|
services.mullvad-vpn.enable = true;
|
||||||
|
|
||||||
|
services.tailscale.enable = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ in
|
||||||
terminal = "${pkgs.alacritty}/bin/alacritty";
|
terminal = "${pkgs.alacritty}/bin/alacritty";
|
||||||
menu = "${pkgs.wofi}/bin/wofi";
|
menu = "${pkgs.wofi}/bin/wofi";
|
||||||
# TODO for some reason bar only works when used with exec
|
# TODO for some reason bar only works when used with exec
|
||||||
bars = [];
|
bars = [ ];
|
||||||
startup = with pkgs; [
|
startup = with pkgs; [
|
||||||
# TODO activate with systemd prbly requires a graphical.target?
|
# TODO activate with systemd prbly requires a graphical.target?
|
||||||
# { command = "${nixosConfig.systemd.package}/bin/systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP"; }
|
# { command = "${nixosConfig.systemd.package}/bin/systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP"; }
|
||||||
|
|
@ -103,6 +103,7 @@ in
|
||||||
{ command = "${plasma5Packages.kdeconnect-kde}/bin/kdeconnect-indicator"; }
|
{ command = "${plasma5Packages.kdeconnect-kde}/bin/kdeconnect-indicator"; }
|
||||||
{ command = "${system-config-printer}/bin/system-config-printer-applet"; }
|
{ command = "${system-config-printer}/bin/system-config-printer-applet"; }
|
||||||
{ command = "${emote}/bin/emote"; }
|
{ command = "${emote}/bin/emote"; }
|
||||||
|
{ command = "${polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; }
|
||||||
];
|
];
|
||||||
input = {
|
input = {
|
||||||
"2:7:SynPS/2_Synaptics_TouchPad" = {
|
"2:7:SynPS/2_Synaptics_TouchPad" = {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, nixosConfig, ... }:
|
||||||
let
|
let
|
||||||
check-battery = pkgs.writeShellScript "check-battery" ''
|
check-battery = pkgs.writeShellScript "check-battery" ''
|
||||||
bat=/sys/class/power_supply/BAT0
|
bat=/sys/class/power_supply/BAT0
|
||||||
|
|
@ -18,6 +18,20 @@ let
|
||||||
rm $FILE
|
rm $FILE
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
tailscale-status = pkgs.writeShellScript "tailscale-status" ''
|
||||||
|
if ${nixosConfig.services.tailscale.package}/bin/tailscale status > /dev/null 2>&1; then
|
||||||
|
echo
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
tailscale-toggle = pkgs.writeShellScript "tailscale-toggle" ''
|
||||||
|
if ${nixosConfig.services.tailscale.package}/bin/tailscale status > /dev/null 2>&1; then
|
||||||
|
pkexec ${nixosConfig.services.tailscale.package}/bin/tailscale down
|
||||||
|
else
|
||||||
|
pkexec ${nixosConfig.services.tailscale.package}/bin/tailscale up --accept-routes --exit-node=j4m35-bl0nd
|
||||||
|
fi
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
xdg.configFile = {
|
xdg.configFile = {
|
||||||
|
|
@ -115,6 +129,7 @@ in
|
||||||
"modules-right": [
|
"modules-right": [
|
||||||
"tray",
|
"tray",
|
||||||
"network",
|
"network",
|
||||||
|
"custom/tailscale",
|
||||||
"pulseaudio",
|
"pulseaudio",
|
||||||
"disk",
|
"disk",
|
||||||
"custom/mem",
|
"custom/mem",
|
||||||
|
|
@ -135,6 +150,11 @@ in
|
||||||
"tooltip-format-ethernet": "{ifname} ",
|
"tooltip-format-ethernet": "{ifname} ",
|
||||||
"tooltip-format-wifi": "{essid} ({signalStrength}%) "
|
"tooltip-format-wifi": "{essid} ({signalStrength}%) "
|
||||||
},
|
},
|
||||||
|
"custom/tailscale": {
|
||||||
|
"exec": "${tailscale-status}",
|
||||||
|
"interval": 1,
|
||||||
|
"on-click": "${tailscale-toggle}",
|
||||||
|
},
|
||||||
"pulseaudio": {
|
"pulseaudio": {
|
||||||
"format": "{volume}% {icon} {format_source}",
|
"format": "{volume}% {icon} {format_source}",
|
||||||
"format-bluetooth": "{volume}% {icon} {format_source}",
|
"format-bluetooth": "{volume}% {icon} {format_source}",
|
||||||
|
|
@ -268,6 +288,13 @@ in
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.swaybar #custom-tailscale {
|
||||||
|
padding-right: 10px;
|
||||||
|
transition: none;
|
||||||
|
color: black;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
window.swaybar #pulseaudio {
|
window.swaybar #pulseaudio {
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue