move nextcloud to home manager

This commit is contained in:
Hadi 2024-06-18 14:32:35 +02:00 committed by GitHub
parent b5ae490899
commit 6c936a12f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 8 additions and 31 deletions

View File

@ -24,6 +24,5 @@ variables=$(echo "$variables" | sed 's/112569860+anotherhadi@users.noreply.githu
variables=$(echo "$variables" | sed 's/hadi/your_username/') variables=$(echo "$variables" | sed 's/hadi/your_username/')
variables=$(echo "$variables" | sed 's/Hadi/your_username/') variables=$(echo "$variables" | sed 's/Hadi/your_username/')
variables=$(echo "$variables" | sed 's/sops = true/sops = false/') variables=$(echo "$variables" | sed 's/sops = true/sops = false/')
variables=$(echo "$variables" | sed 's/nextcloud = true/nextcloud = false/')
variables=$(echo "$variables" | sed 's/obsidian = true/obsidian = false/') variables=$(echo "$variables" | sed 's/obsidian = true/obsidian = false/')
echo "$variables" >"$GUEST_CONFIG/variables.nix" echo "$variables" >"$GUEST_CONFIG/variables.nix"

View File

@ -7,6 +7,7 @@
./programs/btop ./programs/btop
./programs/cava ./programs/cava
./programs/kitty ./programs/kitty
./programs/nextcloud
./programs/nvim ./programs/nvim
./programs/qutebrowser ./programs/qutebrowser
./programs/spicetify ./programs/spicetify

View File

@ -0,0 +1,6 @@
{
services.nextcloud-client = {
enable = true;
startInBackground = true;
};
}

View File

@ -1,43 +1,16 @@
# File runned at startup by Hyprland # File runned at startup by Hyprland
{ pkgs, config, ... }: { pkgs, config, ... }:
let let
nextcloud-watch = pkgs.writeShellScriptBin "nextcloud-watch" ''
# Start nextcloud if I'm on my local network
while true;do
sleep 120
ssid=$(nmcli -t -f name connection show --active | head -n1)
nextcloud_status=$(ps -aux | grep -E "/bin/nextcloud --background$")
if [[ $nextcloud_status == "" ]]; then
service_status="inactive"
else
service_status="active"
fi
if [[ $ssid == "inthecloud" || $ssid == "Wired connection 2" ]]; then
if [[ $service_status == "inactive" ]]; then
${pkgs.nextcloud-client}/bin/nextcloud --background
fi
else
if [[ $service_status == "active" ]]; then
nextcloud_pid=$(pgrep -n nextcloud)
kill $nextcloud_pid
fi
fi
done
'';
startup = pkgs.writeShellScriptBin "startup" '' startup = pkgs.writeShellScriptBin "startup" ''
# Because HM enabling services suck. # Because HM enabling services suck.
[[ ${toString config.var.sops} == "1" ]] && systemctl --user start sops-nix [[ ${toString config.var.sops} == "1" ]] && systemctl --user start sops-nix
[[ ${toString config.var.nextcloud} == "1" ]] && nextcloud-watch &
notify-system & notify-system &
${pkgs.waybar}/bin/waybar & ${pkgs.waybar}/bin/waybar &
wlr-randr --output "Unknown-1" --off # REMOVE WEIRD GHOST MONITOR wlr-randr --output "Unknown-1" --off # FIX: REMOVE WEIRD GHOST MONITOR
''; '';
in { home.packages = with pkgs; [ startup nextcloud-watch nextcloud-client ]; } in { home.packages = with pkgs; [ startup nextcloud-watch nextcloud-client ]; }

View File

@ -22,7 +22,6 @@
autoUpgrade = false; autoUpgrade = false;
autoGarbageCollector = false; autoGarbageCollector = false;
nextcloud = true;
# change the sops configuration if you want to enable that: # change the sops configuration if you want to enable that:
sops = true; sops = true;
# change the nvim's obsidian configuration if you want to enable that: # change the nvim's obsidian configuration if you want to enable that:

View File

@ -22,7 +22,6 @@
autoUpgrade = false; autoUpgrade = false;
autoGarbageCollector = false; autoGarbageCollector = false;
nextcloud = false;
sops = true; sops = true;
obsidian = false; obsidian = false;