From ce0dbf6b249956700c6a1705bf4ad85a09d53e8c Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Sun, 15 Feb 2026 21:27:00 +0100 Subject: feat: witryna 0.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switch, cleanup, and status CLI commands. Persistent build state via state.json. Post-deploy hooks on success and failure with WITRYNA_BUILD_STATUS. Dependency diet (axum→tiny_http, clap→argh, tracing→log). Drop built-in rate limiting. Nix flake with NixOS module. Arch Linux PKGBUILD. Centralized version management. Co-Authored-By: Claude Opus 4.6 --- flake.nix | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..42ff254 --- /dev/null +++ b/flake.nix @@ -0,0 +1,68 @@ +{ + description = "Witryna - Git-based static site deployment orchestrator"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + + outputs = { self, nixpkgs }: + let + supportedSystems = [ "x86_64-linux" "aarch64-linux" ]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + in + { + packages = forAllSystems (system: + let pkgs = nixpkgs.legacyPackages.${system}; in + { + witryna = pkgs.rustPlatform.buildRustPackage { + pname = "witryna"; + version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version; + src = ./.; + cargoLock.lockFile = ./Cargo.lock; + nativeBuildInputs = [ pkgs.installShellFiles pkgs.pkg-config ]; + buildInputs = [ pkgs.openssl ]; + nativeCheckInputs = [ pkgs.git ]; + postInstall = '' + installManPage man/witryna.1 + installManPage man/witryna.toml.5 + mkdir -p $out/share/doc/witryna/examples + cp -r examples/* $out/share/doc/witryna/examples/ + cp README.md $out/share/doc/witryna/ + ''; + meta = with pkgs.lib; { + description = "Minimalist Git-based static site deployment orchestrator"; + homepage = "https://git.craftknight.com/dawid/witryna"; + license = licenses.mit; + mainProgram = "witryna"; + }; + }; + default = self.packages.${system}.witryna; + } + ); + + nixosModules.witryna = import ./nix/module.nix self; + nixosModules.default = self.nixosModules.witryna; + + # NixOS VM test - verifies the module works + checks.x86_64-linux.nixos-test = nixpkgs.legacyPackages.x86_64-linux.nixosTest { + name = "witryna"; + nodes.machine = { pkgs, ... }: { + imports = [ self.nixosModules.witryna ]; + environment.systemPackages = [ pkgs.podman ]; + virtualisation.podman.enable = true; + services.witryna = { + enable = true; + configFile = pkgs.writeText "witryna.toml" '' + listen_address = "127.0.0.1:8080" + base_dir = "/var/lib/witryna" + log_dir = "/var/log/witryna" + log_level = "debug" + container_runtime = "podman" + ''; + }; + }; + testScript = '' + machine.wait_for_unit("witryna.service") + machine.succeed("curl -sf http://127.0.0.1:8080/health") + ''; + }; + }; +} -- cgit v1.2.3