{ 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") ''; }; }; }