Compare commits
No commits in common. "3237b034b9a6d661b42ccaa071b52f2586e28ac8" and "ca4fb5f7ff097246a5f02176c666950a7aabc2b2" have entirely different histories.
3237b034b9
...
ca4fb5f7ff
8 changed files with 611 additions and 665 deletions
|
@ -7,7 +7,6 @@
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
audio = "~/.local/bin/audio";
|
audio = "~/.local/bin/audio";
|
||||||
cat = "${pkgs.coreutils}/bin/cat";
|
|
||||||
clipse = "${pkgs.clipse}/bin/clipse";
|
clipse = "${pkgs.clipse}/bin/clipse";
|
||||||
codium = "${config.home-manager.users.${config.custom.username}.programs.vscode.package}/bin/codium";
|
codium = "${config.home-manager.users.${config.custom.username}.programs.vscode.package}/bin/codium";
|
||||||
firefox-esr = "${config.home-manager.users.${config.custom.username}.programs.firefox.finalPackage}/bin/firefox-esr";
|
firefox-esr = "${config.home-manager.users.${config.custom.username}.programs.firefox.finalPackage}/bin/firefox-esr";
|
||||||
|
@ -29,7 +28,6 @@ with lib; let
|
||||||
onlyoffice = "${pkgs.onlyoffice-bin}/bin/onlyoffice-desktopeditors --system-title-bar --xdg-desktop-portal";
|
onlyoffice = "${pkgs.onlyoffice-bin}/bin/onlyoffice-desktopeditors --system-title-bar --xdg-desktop-portal";
|
||||||
pkill = "${pkgs.procps}/bin/pkill";
|
pkill = "${pkgs.procps}/bin/pkill";
|
||||||
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
||||||
remote = config.home-manager.users.${config.custom.username}.home.file.".local/bin/remote".source;
|
|
||||||
rofi-rbw = "${pkgs.rofi-rbw}/bin/rofi-rbw";
|
rofi-rbw = "${pkgs.rofi-rbw}/bin/rofi-rbw";
|
||||||
rm = "${pkgs.coreutils}/bin/rm";
|
rm = "${pkgs.coreutils}/bin/rm";
|
||||||
screenshot = "~/.local/bin/screenshot";
|
screenshot = "~/.local/bin/screenshot";
|
||||||
|
@ -40,6 +38,7 @@ with lib; let
|
||||||
systemctl = "${pkgs.systemd}/bin/systemctl";
|
systemctl = "${pkgs.systemd}/bin/systemctl";
|
||||||
toggle = "~/.local/bin/toggle";
|
toggle = "~/.local/bin/toggle";
|
||||||
virt-manager = "${config.programs.virt-manager.package}/bin/virt-manager";
|
virt-manager = "${config.programs.virt-manager.package}/bin/virt-manager";
|
||||||
|
vm = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vm".source;
|
||||||
vrr = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vrr".source;
|
vrr = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vrr".source;
|
||||||
walker = "${config.home-manager.users.${config.custom.username}.programs.walker.package}/bin/walker";
|
walker = "${config.home-manager.users.${config.custom.username}.programs.walker.package}/bin/walker";
|
||||||
waydroid = "${pkgs.waydroid}/bin/waydroid";
|
waydroid = "${pkgs.waydroid}/bin/waydroid";
|
||||||
|
@ -51,18 +50,7 @@ with lib; let
|
||||||
in {
|
in {
|
||||||
options.custom.desktops.hyprland.binds.enable = mkOption {default = false;};
|
options.custom.desktops.hyprland.binds.enable = mkOption {default = false;};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
|
||||||
age.secrets = let
|
|
||||||
secret = filename: {
|
|
||||||
file = "${inputs.self}/secrets/${filename}";
|
|
||||||
owner = config.custom.username;
|
|
||||||
group = "users";
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
"desktop/vm/myndows.pass" = secret "desktop/vm/myndows.pass";
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.${config.custom.username} = {
|
|
||||||
wayland.windowManager.hyprland.settings = let
|
wayland.windowManager.hyprland.settings = let
|
||||||
# Reverse mods and key for alphabetical sorting
|
# Reverse mods and key for alphabetical sorting
|
||||||
#?? key <"KEY"> <"MODS"|null> <"DISPATCHER"> <"PARAMS"|null>
|
#?? key <"KEY"> <"MODS"|null> <"DISPATCHER"> <"PARAMS"|null>
|
||||||
|
@ -266,11 +254,12 @@ in {
|
||||||
(key "V" "Super" "exec" "${kitty} --app-id clipboard --override font_size=12 ${clipse}")
|
(key "V" "Super" "exec" "${kitty} --app-id clipboard --override font_size=12 ${clipse}")
|
||||||
(key "V" "Super+Shift" "exec" "${clipse} --clear && ${notify-send} clipse 'Clipboard cleared' --urgency low")
|
(key "V" "Super+Shift" "exec" "${clipse} --clear && ${notify-send} clipse 'Clipboard cleared' --urgency low")
|
||||||
(key "W" "Super" "togglespecialworkspace" "vm")
|
(key "W" "Super" "togglespecialworkspace" "vm")
|
||||||
(key "W" "Super+Ctrl" "exec" ''${remote} --vm --username Myned --password "$(${cat} ${config.age.secrets."desktop/vm/myndows.pass".path})" ${
|
(key "W" "Super+Ctrl" "exec" "${vm} -x ${
|
||||||
if config.custom.hidpi
|
if config.custom.hidpi
|
||||||
then "--scale 140"
|
then "/scale:140 +f"
|
||||||
else ""
|
else ""
|
||||||
} myndows'')
|
}")
|
||||||
|
(key "W" "Super+Ctrl+Shift" "exec" "${vm} ${virt-manager} --show-domain-console myndows")
|
||||||
(key "W" "Super+Shift" "movetoworkspacesilent" "special:vm")
|
(key "W" "Super+Shift" "movetoworkspacesilent" "special:vm")
|
||||||
(key "X" "Super" "workspace" "+1")
|
(key "X" "Super" "workspace" "+1")
|
||||||
(key "X" "Super+Shift" "movetoworkspacesilent" "+1")
|
(key "X" "Super+Shift" "movetoworkspacesilent" "+1")
|
||||||
|
@ -279,5 +268,4 @@ in {
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ in {
|
||||||
gaps_out = config.custom.gap;
|
gaps_out = config.custom.gap;
|
||||||
layout = "master";
|
layout = "master";
|
||||||
#// no_border_on_floating = true;
|
#// no_border_on_floating = true;
|
||||||
#// resize_corner = 3; # Bottom-right
|
resize_corner = 3; # Bottom-right
|
||||||
resize_on_border = true;
|
resize_on_border = true;
|
||||||
snap.enabled = true;
|
snap.enabled = true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
inputs,
|
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
|
@ -25,7 +24,6 @@ with lib; let
|
||||||
pkill = "${pkgs.procps}/bin/pkill";
|
pkill = "${pkgs.procps}/bin/pkill";
|
||||||
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
||||||
power = config.home-manager.users.${config.custom.username}.home.file.".local/bin/power".source;
|
power = config.home-manager.users.${config.custom.username}.home.file.".local/bin/power".source;
|
||||||
remote = config.home-manager.users.${config.custom.username}.home.file.".local/bin/remote".source;
|
|
||||||
rfkill = "${pkgs.util-linux}/bin/rfkill";
|
rfkill = "${pkgs.util-linux}/bin/rfkill";
|
||||||
sleep = "${pkgs.coreutils}/bin/sleep";
|
sleep = "${pkgs.coreutils}/bin/sleep";
|
||||||
swaync-client = "${config.home-manager.users.${config.custom.username}.services.swaync.package}/bin/swaync-client";
|
swaync-client = "${config.home-manager.users.${config.custom.username}.services.swaync.package}/bin/swaync-client";
|
||||||
|
@ -34,6 +32,7 @@ with lib; let
|
||||||
systemd-inhibit = "${pkgs.systemd}/bin/systemd-inhibit";
|
systemd-inhibit = "${pkgs.systemd}/bin/systemd-inhibit";
|
||||||
tailscale = "${pkgs.tailscale}/bin/tailscale";
|
tailscale = "${pkgs.tailscale}/bin/tailscale";
|
||||||
tr = "${pkgs.coreutils}/bin/tr";
|
tr = "${pkgs.coreutils}/bin/tr";
|
||||||
|
vm = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vm".source;
|
||||||
vpn = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vpn".source;
|
vpn = config.home-manager.users.${config.custom.username}.home.file.".local/bin/vpn".source;
|
||||||
wttrbar = "${pkgs.wttrbar}/bin/wttrbar";
|
wttrbar = "${pkgs.wttrbar}/bin/wttrbar";
|
||||||
|
|
||||||
|
@ -41,18 +40,7 @@ with lib; let
|
||||||
in {
|
in {
|
||||||
options.custom.programs.waybar.enable = mkOption {default = false;};
|
options.custom.programs.waybar.enable = mkOption {default = false;};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
|
||||||
age.secrets = let
|
|
||||||
secret = filename: {
|
|
||||||
file = "${inputs.self}/secrets/${filename}";
|
|
||||||
owner = config.custom.username;
|
|
||||||
group = "users";
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
"desktop/vm/myndows.pass" = secret "desktop/vm/myndows.pass";
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.${config.custom.username} = {
|
|
||||||
# https://github.com/Alexays/Waybar
|
# https://github.com/Alexays/Waybar
|
||||||
# https://www.nerdfonts.com/cheat-sheet
|
# https://www.nerdfonts.com/cheat-sheet
|
||||||
programs.waybar = {
|
programs.waybar = {
|
||||||
|
@ -160,11 +148,11 @@ in {
|
||||||
"custom/vm" = {
|
"custom/vm" = {
|
||||||
interval = 5;
|
interval = 5;
|
||||||
exec = "~/.config/waybar/scripts/vm.sh";
|
exec = "~/.config/waybar/scripts/vm.sh";
|
||||||
on-click = ''${remote} --vm --username Myned --password "$(${cat} ${config.age.secrets."desktop/vm/myndows.pass".path})" ${
|
on-click = "${vm} -x ${
|
||||||
if config.custom.hidpi
|
if config.custom.hidpi
|
||||||
then "--scale 140"
|
then "/scale:140"
|
||||||
else ""
|
else ""
|
||||||
} myndows'';
|
}";
|
||||||
};
|
};
|
||||||
|
|
||||||
"custom/vpn" = {
|
"custom/vpn" = {
|
||||||
|
@ -422,5 +410,4 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,15 +143,6 @@ in {
|
||||||
libnotify
|
libnotify
|
||||||
power-profiles-daemon
|
power-profiles-daemon
|
||||||
])
|
])
|
||||||
(bash "remote" [
|
|
||||||
argc
|
|
||||||
coreutils
|
|
||||||
freerdp3
|
|
||||||
iputils
|
|
||||||
libnotify
|
|
||||||
libvirt
|
|
||||||
remmina
|
|
||||||
])
|
|
||||||
(bash "scratchpad" [
|
(bash "scratchpad" [
|
||||||
coreutils
|
coreutils
|
||||||
libnotify
|
libnotify
|
||||||
|
@ -175,6 +166,14 @@ in {
|
||||||
jq
|
jq
|
||||||
libnotify
|
libnotify
|
||||||
])
|
])
|
||||||
|
(bash "vm" [
|
||||||
|
coreutils
|
||||||
|
freerdp3
|
||||||
|
iputils
|
||||||
|
libnotify
|
||||||
|
libvirt
|
||||||
|
remmina
|
||||||
|
])
|
||||||
(bash "vpn" [
|
(bash "vpn" [
|
||||||
gnused
|
gnused
|
||||||
jq
|
jq
|
||||||
|
|
|
@ -1,73 +0,0 @@
|
||||||
#! /usr/bin/env bash
|
|
||||||
|
|
||||||
# @describe Wrapper for connecting to remote desktops
|
|
||||||
#
|
|
||||||
# https://github.com/sigoden/argc
|
|
||||||
|
|
||||||
# @meta combine-shorts
|
|
||||||
# @option -C --client=remmina Remote desktop client to connect with (remmina or <x|w|sdl>-freerdp)
|
|
||||||
# @option -P --password Password to connect with
|
|
||||||
# @option -S --scale=100 Set FreeRDP resolution scale
|
|
||||||
# @option -U --username! Username to connect with
|
|
||||||
# @flag -v --vm Handle libvirt VM domain state for connection
|
|
||||||
# @arg host! Remote host/VM to connect to
|
|
||||||
|
|
||||||
eval "$(argc --argc-eval "$0" "$@")"
|
|
||||||
|
|
||||||
# Handle VM state
|
|
||||||
#!! Requires libvirt networking with hostname resolution
|
|
||||||
if [[ "${argc_vm:-}" ]]; then
|
|
||||||
state="$(virsh domstate "${argc_host:-}")"
|
|
||||||
|
|
||||||
if [[ "$state" == "paused" ]]; then
|
|
||||||
virsh resume "${argc_host:-}"
|
|
||||||
notify-send "> remote" "${argc_host:-} resumed" --urgency low
|
|
||||||
elif [[ "$state" == "shut off" ]]; then
|
|
||||||
virsh start "${argc_host:-}"
|
|
||||||
notify-send "> remote" "${argc_host:-} starting..." --urgency low
|
|
||||||
|
|
||||||
# Wait for guest to become available
|
|
||||||
#!! Requires ICMP firewall access on guest
|
|
||||||
c=0
|
|
||||||
while ! ping -c 1 "${argc_host:-}"; do
|
|
||||||
if ((c > 60)); then
|
|
||||||
notify-send "> remote" "${argc_host:-} timed out" --urgency critical
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
((c += 1))
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
else
|
|
||||||
notify-send "> remote" "${argc_host:-} online" --urgency low
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${argc_client:-}" == "remmina" ]]; then
|
|
||||||
remmina --connect "rdp://${argc_username:-}:${argc_password:-}@${argc_host:-}"
|
|
||||||
elif [[ "${argc_client:-}" =~ ^.+freerdp$ ]]; then
|
|
||||||
export SDL_VIDEODRIVER=wayland
|
|
||||||
|
|
||||||
flags=(
|
|
||||||
"/cert:ignore"
|
|
||||||
"/v:${argc_host:-}"
|
|
||||||
"/u:${argc_username:-}"
|
|
||||||
"/p:${argc_password:-}"
|
|
||||||
"/kbd:remap:015b=0154" # VK_LWIN=<00> #?? xfreerdp /list:kbd-scancode
|
|
||||||
"/scale:${argc_scale:-}"
|
|
||||||
"/dynamic-resolution"
|
|
||||||
"/sound"
|
|
||||||
"+auto-reconnect"
|
|
||||||
"+clipboard"
|
|
||||||
"+menu-anims"
|
|
||||||
"-grab-keyboard"
|
|
||||||
"-grab-mouse"
|
|
||||||
)
|
|
||||||
|
|
||||||
"${argc_client:-}" "${flags[@]}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Suspend VM after connection ends
|
|
||||||
if [[ "${argc_vm:-}" ]]; then
|
|
||||||
virsh suspend "${argc_host:-}"
|
|
||||||
notify-send "> remote" "${argc_host:-} paused" --urgency low
|
|
||||||
fi
|
|
57
options/custom/scripts/vm.sh
Normal file
57
options/custom/scripts/vm.sh
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
# Start/resume VM if needed and launch viewer
|
||||||
|
#?? man xfreerdp
|
||||||
|
|
||||||
|
state="$(virsh domstate myndows)"
|
||||||
|
|
||||||
|
if [[ "$state" == 'paused' ]]; then
|
||||||
|
virsh resume myndows
|
||||||
|
notify-send '> vm' 'Resumed' --urgency low
|
||||||
|
elif [[ "$state" == 'shut off' ]]; then
|
||||||
|
virsh start myndows
|
||||||
|
notify-send '> vm' 'Starting...' --urgency low
|
||||||
|
|
||||||
|
# Wait for guest to become available
|
||||||
|
#!! Requires ICMP firewall access on guest
|
||||||
|
while ! ping -c 1 myndows; do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
else
|
||||||
|
notify-send '> vm' 'Online' --urgency low
|
||||||
|
fi
|
||||||
|
|
||||||
|
flags=(
|
||||||
|
'/cert:ignore'
|
||||||
|
'/v:myndows'
|
||||||
|
'/u:Myned'
|
||||||
|
'/p:'
|
||||||
|
'/kbd:remap:015b=0154' # VK_LWIN=<00> #?? xfreerdp /list:kbd-scancode
|
||||||
|
'/dynamic-resolution'
|
||||||
|
'/sound'
|
||||||
|
'+auto-reconnect'
|
||||||
|
'+clipboard'
|
||||||
|
'+menu-anims'
|
||||||
|
'-grab-keyboard'
|
||||||
|
'-grab-mouse'
|
||||||
|
)
|
||||||
|
|
||||||
|
if [[ "${1-}" == '-s' ]]; then
|
||||||
|
SDL_VIDEODRIVER=wayland sdl-freerdp "${flags[@]}" "${@:2}"
|
||||||
|
virsh suspend myndows
|
||||||
|
notify-send '> vm' 'Paused' --urgency low
|
||||||
|
elif [[ "${1-}" == '-w' ]]; then
|
||||||
|
wlfreerdp "${flags[@]}" "${@:2}"
|
||||||
|
virsh suspend myndows
|
||||||
|
notify-send '> vm' 'Paused' --urgency low
|
||||||
|
elif [[ "${1-}" == '-x' ]]; then
|
||||||
|
xfreerdp "${flags[@]}" "${@:2}"
|
||||||
|
virsh suspend myndows
|
||||||
|
notify-send '> vm' 'Paused' --urgency low
|
||||||
|
elif [[ "${1-}" == '-e' ]]; then
|
||||||
|
"$@"
|
||||||
|
virsh suspend myndows
|
||||||
|
notify-send '> vm' 'Paused' --urgency low
|
||||||
|
else
|
||||||
|
"$@"
|
||||||
|
fi
|
|
@ -1,11 +0,0 @@
|
||||||
age-encryption.org/v1
|
|
||||||
-> ssh-ed25519 8E6j8Q 8osU9NmgeeyA6MiQv1gNNDFvAheWZINmFoxTPgsr1Dw
|
|
||||||
OjviEydBFd1u9doZYGDdqQkMYe4pq7Q9U2qqBTqEcwY
|
|
||||||
-> ssh-ed25519 sfxzoQ 4ve1W5A9VYReikSUNX2J5hRSvQXvteVl5AXL+rH5tHw
|
|
||||||
cA1A8vrUXexDu4Z67TmUoHyRqKbC4PIrKRlb5PZyWbg
|
|
||||||
-> ssh-ed25519 g5GcDQ zhhW9p+0Bgs24yLBZgl51mKyYuZwm9sbj7UWPt5/ZTw
|
|
||||||
pYYHhUX7VVVkoB1EewK27cacZf4eNZJg73zogfQbTVg
|
|
||||||
-> ssh-ed25519 T/dATA nhTYHjuLQxq9Kn2xHLpPNOYiAnEsut+6pxY35ooMAik
|
|
||||||
Dgr+wBPVI9lD2+SLsvkom+0WJ3XlRZsysMQoMjVeCZA
|
|
||||||
--- 234YbLb3XbZts393OGxe2Gmxrup7cbcQGXAb5gQLrhQ
|
|
||||||
Ëú0gÿŸ(]/u&*EǵijeæðtAP¦áŽ—Üîö¸ˆéäÈ™åýZ8Ÿ*
|
|
|
@ -55,7 +55,6 @@ in {
|
||||||
"desktop/bitwarden/client_secret".publicKeys = desktop;
|
"desktop/bitwarden/client_secret".publicKeys = desktop;
|
||||||
"desktop/users/myned.pass".publicKeys = desktop;
|
"desktop/users/myned.pass".publicKeys = desktop;
|
||||||
"desktop/users/root.pass".publicKeys = desktop;
|
"desktop/users/root.pass".publicKeys = desktop;
|
||||||
"desktop/vm/myndows.pass".publicKeys = desktop;
|
|
||||||
|
|
||||||
### SBC
|
### SBC
|
||||||
"sbc/borgmatic/borgbase.mypi3".publicKeys = sbc;
|
"sbc/borgmatic/borgbase.mypi3".publicKeys = sbc;
|
||||||
|
|
Loading…
Add table
Reference in a new issue