diff --git a/roles/desktop/services/flatpak.nix b/roles/desktop/services/flatpak.nix index fa658bf..3ff7152 100644 --- a/roles/desktop/services/flatpak.nix +++ b/roles/desktop/services/flatpak.nix @@ -2,11 +2,18 @@ { services.flatpak.enable = true; - system.activationScripts = { - flatpak.text = '' - echo "adding flatpak repos..." - repo=${pkgs.fetchurl { url = "https://dl.flathub.org/repo/flathub.flatpakrepo"; hash = "sha256-M3HdJQ5h2eFjNjAHP+/aFTzUQm9y9K+gwzc64uj+oDo="; } } - ${pkgs.flatpak}/bin/flatpak remote-add --if-not-exists flathub $repo - ''; + + /* + Create systemd service that adds flathub after getting network + This adds it automatically, which avoids the whack ass way I was + doing that before + */ + systemd.services.flathub-add = { + description = "Add flathub repo to system flatpak install"; + script = "${pkgs.flatpak}/bin/flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo"; + serviceConfig.Type = "oneshot"; + wantedBy = [ "network-online.target" ]; + # Run after networking is working + after = [ "NetworkManager-wait-online.service" ]; }; }