From 40bdd383a06dc554c1b9d44ee5f41695b1165263 Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Mon, 25 Aug 2025 01:52:53 +0530 Subject: [PATCH] feat(nixos): add SpotyBooty service with Discord token support --- flake.lock | 177 ++++++++++++++++++++++++++---- flake.nix | 5 + nixos/default.nix | 2 +- nixos/mirai/services/default.nix | 6 +- nixos/mirai/services/sigmabot.nix | 18 +++ overlays.nix | 1 + secrets/secrets.yaml | 6 +- 7 files changed, 185 insertions(+), 30 deletions(-) create mode 100644 nixos/mirai/services/sigmabot.nix diff --git a/flake.lock b/flake.lock index 4f1637a9..dd2e3d25 100644 --- a/flake.lock +++ b/flake.lock @@ -65,6 +65,22 @@ } }, "advisory-db_5": { + "flake": false, + "locked": { + "lastModified": 1755861653, + "narHash": "sha256-zkStY/nTObqgAAintcpud3qb0kWD+ulIuQitawB3Bi4=", + "owner": "rustsec", + "repo": "advisory-db", + "rev": "4f41cf997750198dcde6b7b6b58a232fe4f925d4", + "type": "github" + }, + "original": { + "owner": "rustsec", + "repo": "advisory-db", + "type": "github" + } + }, + "advisory-db_6": { "flake": false, "locked": { "lastModified": 1753275806, @@ -80,7 +96,7 @@ "type": "github" } }, - "advisory-db_6": { + "advisory-db_7": { "flake": false, "locked": { "lastModified": 1746469888, @@ -373,6 +389,21 @@ } }, "crane_6": { + "locked": { + "lastModified": 1755993354, + "narHash": "sha256-FCRRAzSaL/+umLIm3RU3O/+fJ2ssaPHseI2SSFL8yZU=", + "owner": "ipetkov", + "repo": "crane", + "rev": "25bd41b24426c7734278c2ff02e53258851db914", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "crane_7": { "locked": { "lastModified": 1754269165, "narHash": "sha256-0tcS8FHd4QjbCVoxN9jI+PjHgA4vc/IjkUSp+N3zy0U=", @@ -387,7 +418,7 @@ "type": "github" } }, - "crane_7": { + "crane_8": { "locked": { "lastModified": 1746291859, "narHash": "sha256-DdWJLA+D5tcmrRSg5Y7tp/qWaD05ATI4Z7h22gd1h7Q=", @@ -402,7 +433,7 @@ "type": "github" } }, - "crane_8": { + "crane_9": { "locked": { "lastModified": 1754269165, "narHash": "sha256-0tcS8FHd4QjbCVoxN9jI+PjHgA4vc/IjkUSp+N3zy0U=", @@ -1009,6 +1040,24 @@ "inputs": { "systems": "systems_20" }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_18": { + "inputs": { + "systems": "systems_21" + }, "locked": { "lastModified": 1726560853, "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", @@ -1023,9 +1072,9 @@ "type": "github" } }, - "flake-utils_18": { + "flake-utils_19": { "inputs": { - "systems": "systems_21" + "systems": "systems_22" }, "locked": { "lastModified": 1731533236, @@ -2085,7 +2134,7 @@ "nix-github-actions_4": { "inputs": { "nixpkgs": [ - "tmux-float", + "spotybooty", "nixpkgs" ] }, @@ -2104,6 +2153,27 @@ } }, "nix-github-actions_5": { + "inputs": { + "nixpkgs": [ + "tmux-float", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1737420293, + "narHash": "sha256-F1G5ifvqTpJq7fdkT34e/Jy9VCyzd5XfJ9TO8fHhJWE=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "f4158fa080ef4503c8f4c820967d946c2af31ec9", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nix-github-actions_6": { "inputs": { "nixpkgs": [ "zeronsd", @@ -2741,6 +2811,7 @@ "rest-nvim": "rest-nvim", "rust-overlay": "rust-overlay_8", "sops-nix": "sops-nix", + "spotybooty": "spotybooty", "tmux-float": "tmux-float", "tree-sitter-d2": "tree-sitter-d2", "tree-sitter-just": "tree-sitter-just", @@ -2792,6 +2863,27 @@ } }, "rust-overlay_10": { + "inputs": { + "nixpkgs": [ + "tmux-float", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754276100, + "narHash": "sha256-VmYP9Jo0U234xtGTGtihqNHfGy1JZ1h9WaaJlIuzgCk=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "dc2d2489572fa8a3b86c15ff9fd01f99b90cb90d", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_11": { "inputs": { "nixpkgs": [ "zeronsd", @@ -2812,7 +2904,7 @@ "type": "github" } }, - "rust-overlay_11": { + "rust-overlay_12": { "inputs": { "nixpkgs": [ "zjstatus", @@ -2983,16 +3075,16 @@ "rust-overlay_9": { "inputs": { "nixpkgs": [ - "tmux-float", + "spotybooty", "nixpkgs" ] }, "locked": { - "lastModified": 1754276100, - "narHash": "sha256-VmYP9Jo0U234xtGTGtihqNHfGy1JZ1h9WaaJlIuzgCk=", + "lastModified": 1756003222, + "narHash": "sha256-lmEMhIIbjt8Wp1EYbNqCojuU9ygyDFv8Tu0X1k8qIMc=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "dc2d2489572fa8a3b86c15ff9fd01f99b90cb90d", + "rev": "88ceedecde53e809b4bf8b5fd10d181889d9bac7", "type": "github" }, "original": { @@ -3021,6 +3113,28 @@ "type": "github" } }, + "spotybooty": { + "inputs": { + "advisory-db": "advisory-db_5", + "crane": "crane_6", + "flake-utils": "flake-utils_16", + "nix-github-actions": "nix-github-actions_4", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay_9" + }, + "locked": { + "lastModified": 1756059230, + "narHash": "sha256-9xvC8WYCB/JgYvYFJMxCPY98ZHzvf3/oema6HtBTRRU=", + "path": "/home/servius/Projects/SpotyBooty", + "type": "path" + }, + "original": { + "path": "/home/servius/Projects/SpotyBooty", + "type": "path" + } + }, "systems": { "locked": { "lastModified": 1689347949, @@ -3231,6 +3345,21 @@ "type": "github" } }, + "systems_22": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "systems_3": { "locked": { "lastModified": 1681028828, @@ -3338,14 +3467,14 @@ }, "tmux-float": { "inputs": { - "advisory-db": "advisory-db_5", - "crane": "crane_6", - "flake-utils": "flake-utils_16", - "nix-github-actions": "nix-github-actions_4", + "advisory-db": "advisory-db_6", + "crane": "crane_7", + "flake-utils": "flake-utils_17", + "nix-github-actions": "nix-github-actions_5", "nixpkgs": [ "nixpkgs" ], - "rust-overlay": "rust-overlay_9" + "rust-overlay": "rust-overlay_10" }, "locked": { "lastModified": 1754282648, @@ -3539,14 +3668,14 @@ }, "zeronsd": { "inputs": { - "advisory-db": "advisory-db_6", - "crane": "crane_7", - "flake-utils": "flake-utils_17", - "nix-github-actions": "nix-github-actions_5", + "advisory-db": "advisory-db_7", + "crane": "crane_8", + "flake-utils": "flake-utils_18", + "nix-github-actions": "nix-github-actions_6", "nixpkgs": [ "nixpkgs" ], - "rust-overlay": "rust-overlay_10" + "rust-overlay": "rust-overlay_11" }, "locked": { "lastModified": 1746544539, @@ -3593,12 +3722,12 @@ }, "zjstatus": { "inputs": { - "crane": "crane_8", - "flake-utils": "flake-utils_18", + "crane": "crane_9", + "flake-utils": "flake-utils_19", "nixpkgs": [ "nixpkgs" ], - "rust-overlay": "rust-overlay_11" + "rust-overlay": "rust-overlay_12" }, "locked": { "lastModified": 1754932774, diff --git a/flake.nix b/flake.nix index 7e00d459..7063ec4b 100644 --- a/flake.nix +++ b/flake.nix @@ -202,6 +202,11 @@ url = "github:ggml-org/llama.cpp/b6178?submodules=1"; flake = false; }; + spotybooty = { + # url = "git+ssh://gitea@git.darksailor.dev/servius/SpotyBooty"; + url = "path:/home/servius/Projects/SpotyBooty"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { diff --git a/nixos/default.nix b/nixos/default.nix index 09cbcba1..1705ac6d 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -11,7 +11,7 @@ nixpkgs.lib.nixosSystem { system = device.system; specialArgs = { - inherit device; + inherit device inputs; stablePkgs = inputs.nixpkgs-stable.legacyPackages.${device.system}; lanzaboote = inputs.lanzaboote; }; diff --git a/nixos/mirai/services/default.nix b/nixos/mirai/services/default.nix index ab289a37..f35b14ff 100644 --- a/nixos/mirai/services/default.nix +++ b/nixos/mirai/services/default.nix @@ -3,6 +3,7 @@ ./atuin.nix ./authelia.nix ./caddy.nix + ./excalidraw.nix ./fail2ban.nix ./flaresolverr.nix ./gitea.nix @@ -11,14 +12,13 @@ ./llama.nix ./lldap.nix ./minecraft.nix - ./nextcloud.nix - # ./paperless.nix ./prowlarr.nix ./resolved.nix ./searxng.nix + ./sigmabot.nix ./tailscale.nix - ./excalidraw.nix + # ./paperless.nix ]; services = { nix-serve = { diff --git a/nixos/mirai/services/sigmabot.nix b/nixos/mirai/services/sigmabot.nix new file mode 100644 index 00000000..b39c7cff --- /dev/null +++ b/nixos/mirai/services/sigmabot.nix @@ -0,0 +1,18 @@ +{ + config, + inputs, + ... +}: { + imports = [ + inputs.spotybooty.nixosModules.default + ]; + sops = { + secrets."discord/token".owner = config.services.spotybooty.user; + }; + services.spotybooty = { + enable = true; + logLevel = "info"; + tokenFile = config.sops.secrets."discord/token".path; + openFirewall = true; + }; +} diff --git a/overlays.nix b/overlays.nix index b36e60cc..157bbcc2 100644 --- a/overlays.nix +++ b/overlays.nix @@ -286,6 +286,7 @@ in [ inputs.nur.overlays.default inputs.rust-overlay.overlays.default inputs.nix-minecraft.overlay + inputs.spotybooty.overlays.default jellyfin libfprint misc-applications diff --git a/secrets/secrets.yaml b/secrets/secrets.yaml index b0d2061b..216f4e1f 100644 --- a/secrets/secrets.yaml +++ b/secrets/secrets.yaml @@ -63,6 +63,8 @@ minecraft: grafana: adminPassword: ENC[AES256_GCM,data:im6FJVlVUoZg+9W6KmsqtloH4nB6AhXOcia5waRyFKj2DoQlt4jhPH1CFvw=,iv://D6aD/fGl7h4KmtQcQ0TQLWLfKdIs4+EMg2LWjPHvg=,tag:6gHu/V0V0a8GpcgA/hUwXg==,type:str] secretKey: ENC[AES256_GCM,data:LD0x8Fa6SU1+6mwxLkKa/o+ZqeuRIr7o/AKS7EmrDYj0vzrA3/FjViVJNfkOJDch9TbVyjIpk2ZLwxHXOZx7MA==,iv:t6UwZj2JZpMIDsDDeJ4rZah4aBoMIKaoiu9VU2VhViE=,tag:MIz/b8JWYtOpUCcg6gYhJg==,type:str] +discord: + token: ENC[AES256_GCM,data:M6TayHpIa0J1w3zVRKPPU0P/f18UXOpxzU7fjKNCx8YxzSAaQfY52S5XpiqDgjPWfWdSxzG2VVDqu1708Vwofa8IRKwWafam,iv:x0ySoaS68aLRVUcQin096RoeQGRELvNwdFJxezPj/cA=,tag:Omv5uL97y7ZTI8juVJFNug==,type:str] sops: age: - recipient: age1pw7kluxp7872c63ne4jecq75glj060jkmqwzkk6esatuyck9egfswufdpk @@ -74,7 +76,7 @@ sops: VGZKdHpVeFRpQUxtSEkyaEhLMlBJcGsKLb0DvPNZosPBUuiX6qz1s5IO5INQh8CK ZtXTVClwMSmaUYhdSB2gKFrKVZHXTJZ4oAL5t/BpC0pOHyr+o96T3Q== -----END AGE ENCRYPTED FILE----- - lastmodified: "2025-08-21T20:44:51Z" - mac: ENC[AES256_GCM,data:ijXIVQHCDhKvCA7no5/3zYTdW1RGcwDpDMGXmiedNZN3XlaMnbcCEWfHKuqvJJiTsjSVWbvsO8fQCabXwMoQSPeF/ymOGo1NIiTgsBfstUA1dT/5qw2ChsswyjHuTy9/jtsXsN/o2x6OKuZCm4iD2FAQf+al4r4Kcx0HAfJFhQA=,iv:oetw6XMfRzrSOwXrPrrYagCCQ2yujEvhhuXhRtimAxc=,tag:sPldkLWoLeYe7eYZDhM4zw==,type:str] + lastmodified: "2025-08-24T09:09:52Z" + mac: ENC[AES256_GCM,data:zpLVBjoJz4bd3vG1c3fILeVMLznt+2RQm7QBIutxVJLWBkLdRQ0fIBcaOI+ZNd8+17bhgK2roVpTyKb7qlZ30XU4kCGGCE6/8YveDvSwtN8wDNS2USIRfGbtYljOwvXaCCXt0y/YwNnwYtY8RLWcuQg8vhfk6yIPyZcx1CIbHFU=,iv:W/6zntv7Mto06xldzrucQOIwvEKw9n+zRz1M1ZRm0TU=,tag:YGzEK7d5vFgrlLaIS5zPkw==,type:str] unencrypted_suffix: _unencrypted version: 3.10.2