adding sops to fix gotify-desktop after long last

This commit is contained in:
2026-09-25 20:47:41 +01:00
parent e3fc39cf43
commit 8b33848660
6 changed files with 70 additions and 4 deletions

21
flake.lock generated
View File

@@ -1069,6 +1069,7 @@
"otter-launcher": "otter-launcher_2", "otter-launcher": "otter-launcher_2",
"quickshell": "quickshell", "quickshell": "quickshell",
"sls-steam": "sls-steam", "sls-steam": "sls-steam",
"sops-nix": "sops-nix",
"woomer": "woomer_2", "woomer": "woomer_2",
"wrappers": "wrappers_3", "wrappers": "wrappers_3",
"wshowkeys": "wshowkeys_2" "wshowkeys": "wshowkeys_2"
@@ -1092,6 +1093,26 @@
"type": "github" "type": "github"
} }
}, },
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1790247521,
"narHash": "sha256-TNfgoHsqsYYvaJImlWctfRkh4PseTagzegU1Dgdbehw=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "2bd00bd9bb35fe6d114888c8f1c2e946c541dd8f",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
},
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,

View File

@@ -40,6 +40,12 @@
}; };
wshowkeys.url = "github:DreamMaoMao/wshowkeys"; wshowkeys.url = "github:DreamMaoMao/wshowkeys";
# Secrets and stuff
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# Flake parts # Flake parts
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
import-tree.url = "github:vic/import-tree"; import-tree.url = "github:vic/import-tree";

View File

@@ -15,11 +15,10 @@ inputs,
}: { }: {
packages = { packages = {
gotify-desktop = let gotify-desktop = let
# Requires gpg keyring cert in order to get api key
config-file = pkgs.writeText "config.toml" '' config-file = pkgs.writeText "config.toml" ''
[gotify] [gotify]
url = "wss://ntfy.voidarc.co.uk:443" url = "wss://ntfy.voidarc.co.uk:443"
token = { command = "${pkgs.gnupg}/bin/gpg --quiet --batch --decrypt ${./gotify-key.secret}" } token = { command = "cat /run/secrets/gotify-desktop-key.txt"}
[notification] [notification]
min_priority = 1 min_priority = 1
''; '';

View File

@@ -0,0 +1,23 @@
{
self,
inputs,
...
}: {
flake.nixosModules.sops = {config, ...}: {
imports = [inputs.sops-nix.nixosModules.sops];
sops = {
age.keyFile = "/etc/sops/age/keys.txt";
defaultSopsFile = ./secrets.yaml;
secrets = {
gotify-desktop-key = {
path = "/run/secrets/gotify-desktop-key.txt";
};
};
templates = {
"gotify-desktop-key" = config.sops.placeholder.gotify-desktop-key;
};
};
};
}

View File

@@ -0,0 +1,16 @@
gotify-desktop-key: ENC[AES256_GCM,data:kMCJfkrf5jKAgjX9hT9S,iv:T/zDp94522MeW6V3874JgyaQCx5H1qY+DsZOoPBaC1w=,tag:Csu+9imWiMBYXaE0uXzMsg==,type:str]
sops:
age:
- enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBKR3ZQTzVxWWFFam91Y1V0
VGdnSkZFcmJ6RG1JOHp3R1puY2ZRazkxbmlZCjYyek5QOWEzaWg2bnpXc0ZrNks0
QUl2Nk45R1h6WjFTSWlveUF5RHlRcEUKLS0tIE5mYmQ1aWpvNGNjYzJrUW9DSXpm
MS8ralY4WDI1YjhNSmRWYWxYL3VkbDAKQuLvaHiUXkwiaOif10vrl3LFh/4mKQUV
Y3HJ9Jr3DAyokEzN7S/S1v50coM1bE4d74SS/V1uIw0nYdZRUGrZww==
-----END AGE ENCRYPTED FILE-----
recipient: age1rg4rsns375z2zj4tv8cyqtjl504fw8tprlmj2w057dz6ztttjstsgjvkvy
lastmodified: "2026-09-25T19:37:14Z"
mac: ENC[AES256_GCM,data:OMk7qEbx9F/qa6zERu23fNyTzfxbTJZnPyPdVbXhZvjX+KB8pFE1bks6Qfw/C0TwcYsUBIFgr/YO0IaBLStkdoADpeqN4wRbunwTCND0w6V3ZOGza7+5UiT0Zp2KEamuTTco4mDdBUoBkid+aW0jlqAfKtZ4v9VH34IsEOjT2T8=,iv:uqMTZj/rsMFmOWy4aXblmsZ4TVji2i8SfqpCs21VQOU=,tag:x4LtAV6+i8npKygjWjDRpQ==,type:str]
unencrypted_suffix: _unencrypted
version: 3.13.3

View File

@@ -11,6 +11,7 @@
network network
omnisearch omnisearch
tailscale tailscale
sops
]; ];
in { in {
imports = modules; imports = modules;