diff --git a/docs/scripts/create_guest_config.sh b/docs/scripts/create_guest_config.sh index 362d896..e934778 100644 --- a/docs/scripts/create_guest_config.sh +++ b/docs/scripts/create_guest_config.sh @@ -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/sops = true/sops = false/') -variables=$(echo "$variables" | sed 's/nextcloud = true/nextcloud = false/') variables=$(echo "$variables" | sed 's/obsidian = true/obsidian = false/') echo "$variables" >"$GUEST_CONFIG/variables.nix" diff --git a/home/laptop.nix b/home/laptop.nix index 100dd56..152ad5e 100644 --- a/home/laptop.nix +++ b/home/laptop.nix @@ -7,6 +7,7 @@ ./programs/btop ./programs/cava ./programs/kitty + ./programs/nextcloud ./programs/nvim ./programs/qutebrowser ./programs/spicetify diff --git a/home/programs/nextcloud/default.nix b/home/programs/nextcloud/default.nix new file mode 100644 index 0000000..4f8a01a --- /dev/null +++ b/home/programs/nextcloud/default.nix @@ -0,0 +1,6 @@ +{ + services.nextcloud-client = { + enable = true; + startInBackground = true; + }; +} \ No newline at end of file diff --git a/home/scripts/startup/default.nix b/home/scripts/startup/default.nix index 525946b..608f1cd 100644 --- a/home/scripts/startup/default.nix +++ b/home/scripts/startup/default.nix @@ -1,43 +1,16 @@ # File runned at startup by Hyprland { pkgs, config, ... }: 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" '' # Because HM enabling services suck. [[ ${toString config.var.sops} == "1" ]] && systemctl --user start sops-nix - [[ ${toString config.var.nextcloud} == "1" ]] && nextcloud-watch & - notify-system & ${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 ]; } diff --git a/hosts/laptop/variables.nix b/hosts/laptop/variables.nix index 0137fe5..30bd44e 100644 --- a/hosts/laptop/variables.nix +++ b/hosts/laptop/variables.nix @@ -22,7 +22,6 @@ autoUpgrade = false; autoGarbageCollector = false; - nextcloud = true; # change the sops configuration if you want to enable that: sops = true; # change the nvim's obsidian configuration if you want to enable that: diff --git a/hosts/server/variables.nix b/hosts/server/variables.nix index 738f241..c4457f2 100644 --- a/hosts/server/variables.nix +++ b/hosts/server/variables.nix @@ -22,7 +22,6 @@ autoUpgrade = false; autoGarbageCollector = false; - nextcloud = false; sops = true; obsidian = false;