diff --git a/flake.lock b/flake.lock index 6438836..6b24660 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,82 @@ { "nodes": { + "cachix": { + "inputs": { + "devenv": [ + "wordle-solver", + "crate2nix" + ], + "flake-compat": [ + "wordle-solver", + "crate2nix" + ], + "git-hooks": "git-hooks", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1767714506, + "narHash": "sha256-WaTs0t1CxhgxbIuvQ97OFhDTVUGd1HA+KzLZUZBhe0s=", + "owner": "cachix", + "repo": "cachix", + "rev": "894c649f0daaa38bbcfb21de64be47dfa7cd0ec9", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "latest", + "repo": "cachix", + "type": "github" + } + }, + "crate2nix": { + "inputs": { + "cachix": "cachix", + "devshell": "devshell", + "flake-compat": "flake-compat_2", + "flake-parts": "flake-parts_2", + "nix-test-runner": "nix-test-runner", + "nixpkgs": [ + "wordle-solver", + "nixpkgs" + ], + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1782759041, + "narHash": "sha256-2577vxyoBa8+ZRiXr3CuPtOuEtPRYsFPSZuEc/KI/80=", + "owner": "nix-community", + "repo": "crate2nix", + "rev": "5e1ecfd2d15b34ec90c2e51fdffbe8116595a767", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "crate2nix", + "type": "github" + } + }, + "devshell": { + "inputs": { + "nixpkgs": [ + "wordle-solver", + "crate2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1768818222, + "narHash": "sha256-460jc0+CZfyaO8+w8JNtlClB2n4ui1RbHfPTLkpwhU8=", + "owner": "numtide", + "repo": "devshell", + "rev": "255a2b1725a20d060f566e4755dbf571bbbb5f76", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, "disko": { "inputs": { "nixpkgs": [ @@ -78,6 +155,20 @@ "type": "github" } }, + "flake-compat_2": { + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "revCount": 69, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -96,6 +187,123 @@ "type": "github" } }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "wordle-solver", + "crate2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1768135262, + "narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1785627969, + "narHash": "sha256-4dtXQk/NMePegK/nWp5NSeuZKLATItOq61lpEvmXqGw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "427bf4bd9435fdf21321c8cc628c24efc14c0f7a", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "wordle-solver", + "crate2nix", + "cachix", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "wordle-solver", + "crate2nix", + "cachix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1765404074, + "narHash": "sha256-+ZDU2d+vzWkEJiqprvV5PR26DVFN2vgddwG5SnPZcUM=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "2d6f58930fbcd82f6f9fd59fb6d13e37684ca529", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "wordle-solver", + "crate2nix", + "cachix", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_2": { + "inputs": { + "nixpkgs": [ + "wordle-solver", + "crate2nix", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -154,6 +362,22 @@ "type": "github" } }, + "nix-test-runner": { + "flake": false, + "locked": { + "lastModified": 1588761593, + "narHash": "sha256-FKJykltAN/g3eIceJl4SfDnnyuH2jHImhMrXS2KvGIs=", + "owner": "stoeffel", + "repo": "nix-test-runner", + "rev": "c45d45b11ecef3eb9d834c3b6304c05c49b06ca2", + "type": "github" + }, + "original": { + "owner": "stoeffel", + "repo": "nix-test-runner", + "type": "github" + } + }, "nixos-hardware": { "inputs": { "nixpkgs": "nixpkgs" @@ -201,6 +425,21 @@ "type": "github" } }, + "nixpkgs-lib_2": { + "locked": { + "lastModified": 1785031560, + "narHash": "sha256-OmshNvn2vupOFpYinLUu+1Dnpu4n7Q5N3ggGVNHpkUI=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "0e79af5e3d4dcfcd676ab5ba3f95d2e3352e078c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs-unstable": { "locked": { "lastModified": 1786247143, @@ -233,6 +472,50 @@ "type": "github" } }, + "nixpkgs_3": { + "locked": { + "lastModified": 1765186076, + "narHash": "sha256-hM20uyap1a0M9d344I692r+ik4gTMyj60cQWO+hAYP8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "addf7cf5f383a3101ecfba091b98d0a1263dc9b8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": [ + "wordle-solver", + "crate2nix", + "flake-compat" + ], + "gitignore": "gitignore_2", + "nixpkgs": [ + "wordle-solver", + "crate2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769069492, + "narHash": "sha256-Efs3VUPelRduf3PpfPP2ovEB4CXT7vHf8W+xc49RL/U=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "a1ef738813b15cf8ec759bdff5761b027e3e1d23", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "disko": "disko", @@ -246,7 +529,29 @@ "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable", "sops-nix": "sops-nix", - "spicetify-nix": "spicetify-nix" + "spicetify-nix": "spicetify-nix", + "wordle-solver": "wordle-solver" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "wordle-solver", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1787022047, + "narHash": "sha256-wNlYM/obKOkkRELrOfto1JT5CRANR6hB/RjOELp223U=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "b32685dd7c5a965aa8273adb7ddaf7f5b40d0faa", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" } }, "sops-nix": { @@ -319,6 +624,29 @@ "repo": "default", "type": "github" } + }, + "wordle-solver": { + "inputs": { + "crate2nix": "crate2nix", + "flake-parts": "flake-parts_3", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1787221463, + "narHash": "sha256-G/BsqI9hMjr/x9h7mTNS5OoBuBno8G6oF4OdrEarNgA=", + "ref": "refs/heads/main", + "rev": "90ccd230e46cbe620ac3da25b95df17c0d32c248", + "revCount": 14, + "type": "git", + "url": "https://git.jroeger.de/jonas/wordle-solver-rs" + }, + "original": { + "type": "git", + "url": "https://git.jroeger.de/jonas/wordle-solver-rs" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index d28c6b3..a02fc49 100644 --- a/flake.nix +++ b/flake.nix @@ -29,6 +29,8 @@ nix-minecraft.inputs.nixpkgs.follows = "nixpkgs"; spicetify-nix.url = "github:Gerg-L/spicetify-nix"; spicetify-nix.inputs.nixpkgs.follows = "nixpkgs"; + wordle-solver.url = "git+https://git.jroeger.de/jonas/wordle-solver-rs"; + wordle-solver.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = inputs @ { diff --git a/hosts/harbor/configuration.nix b/hosts/harbor/configuration.nix index f54a167..c0d758f 100644 --- a/hosts/harbor/configuration.nix +++ b/hosts/harbor/configuration.nix @@ -107,6 +107,8 @@ hive.wallabag.enable = true; hive.wallabag.localPort = 39184; hive.wallabag.instanceFQDN = "wallabag.jroeger.de"; + hive.wordle-solver.enable = true; + hive.wordle-solver.instanceFQDN = "wordle-solver.jroeger.de"; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions diff --git a/hosts/harbor/default.nix b/hosts/harbor/default.nix index 2902d62..bdf69d3 100644 --- a/hosts/harbor/default.nix +++ b/hosts/harbor/default.nix @@ -24,6 +24,7 @@ self.nixosModules.calibre self.nixosModules.korrosync-hive self.nixosModules.wallabag + self.nixosModules.wordle-solver ]; }; } diff --git a/modules/services/wordle-solver.nix b/modules/services/wordle-solver.nix new file mode 100644 index 0000000..e5a1012 --- /dev/null +++ b/modules/services/wordle-solver.nix @@ -0,0 +1,36 @@ +{inputs, ...}: { + flake.nixosModules.wordle-solver = { + config, + lib, + pkgs, + ... + }: let + cfg = config.hive.wordle-solver; + in { + options.hive.wordle-solver = { + enable = lib.mkEnableOption "Enable wordle-solver site"; + instanceFQDN = lib.mkOption { + type = lib.types.singleLineStr; + example = "wordle-solver.example.com"; + description = "Fully qualified domain name of the wordle-solver host"; + }; + }; + + config = lib.mkIf cfg.enable { + # Fallback server with only 403 + services.nginx.virtualHosts.${config.networking.domain} = lib.mkDefault { + default = true; + locations."/".return = 403; + forceSSL = true; + enableACME = true; + }; + + # Virtual host for wordle-solver + services.nginx.virtualHosts."${cfg.instanceFQDN}" = { + forceSSL = true; + enableACME = true; + root = "${inputs.wordle-solver.packages.${pkgs.system}.wordle-solver-web}/"; + }; + }; + }; +}