diff --git a/.gitignore b/.gitignore index 8cce44f..df8b0ec 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ /result /HACKSTATION.qcow2 /result-man +.gitsecret/keys/random_seed +!*.secret +modules/features/gotify-desktop/gotify-key diff --git a/.gitsecret/keys/pubring.kbx b/.gitsecret/keys/pubring.kbx new file mode 100644 index 0000000..aea4e94 Binary files /dev/null and b/.gitsecret/keys/pubring.kbx differ diff --git a/.gitsecret/keys/pubring.kbx~ b/.gitsecret/keys/pubring.kbx~ new file mode 100644 index 0000000..f6698c3 Binary files /dev/null and b/.gitsecret/keys/pubring.kbx~ differ diff --git a/.gitsecret/keys/trustdb.gpg b/.gitsecret/keys/trustdb.gpg new file mode 100644 index 0000000..bbf1b13 Binary files /dev/null and b/.gitsecret/keys/trustdb.gpg differ diff --git a/.gitsecret/paths/mapping.cfg b/.gitsecret/paths/mapping.cfg new file mode 100644 index 0000000..f5ee8a2 --- /dev/null +++ b/.gitsecret/paths/mapping.cfg @@ -0,0 +1 @@ +modules/features/gotify-desktop/gotify-key:f6129ad401b60d5a491d582169088600bb58a537d232b93c22923aede129d5cc diff --git a/modules/features/gotify-desktop/default.nix b/modules/features/gotify-desktop/default.nix new file mode 100644 index 0000000..a3aa8ad --- /dev/null +++ b/modules/features/gotify-desktop/default.nix @@ -0,0 +1,46 @@ +{ + self, + inputs, + ... +}: { + flake.nixosModules.gotify-desktop = { + pkgs, + lib, + ... + }: { + environment.systemPackages = [ + self.packages.${pkgs.stdenv.hostPlatform.system}.gotify-desktop + ]; + }; + perSystem = { + pkgs, + lib, + self', + ... + }: { + packages = { + gotify-desktop = let + # Requires gpg keyring cert in order to get api key + config-file = pkgs.writeText "config.toml" '' + [gotify] + url = "wss://ntfy.voidarc.co.uk:443" + token = { command = "${pkgs.gnupg}/bin/gpg --quiet --batch --decrypt ${./gotify-key.secret}" } + [notification] + min_priority = 1 + ''; + in + inputs.wrappers.lib.wrapPackage ({ + config, + wlib, + lib, + ... + }: { + inherit pkgs; + package = inputs.gotify-desktop.packages.${pkgs.stdenv.hostPlatform.system}.default; + flags = { + "-c" = config-file; + }; + }); + }; + }; +} diff --git a/modules/features/gotify-desktop/gotify-key.secret b/modules/features/gotify-desktop/gotify-key.secret new file mode 100644 index 0000000..dcae609 Binary files /dev/null and b/modules/features/gotify-desktop/gotify-key.secret differ