diff --git a/.gitignore b/.gitignore index 4a848dc..ecfa367 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ target *.po~ /dist/templates/localized + +result diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..9b33e71 --- /dev/null +++ b/default.nix @@ -0,0 +1,36 @@ +{ lib, rustPlatform, sqlite, openssl, gettext, pkg-config }: + +rustPlatform.buildRustPackage rec { + pname = "hagrid"; + version = "1.0.0"; + + src = ./.; + cargoLock = { + lockFile = ./Cargo.lock; + outputHashes = { + "rocket_i18n-0.5.0" = "sha256-EbUE8Z3TQBnDnptl9qWK6JvsACCgP7EXTxcA7pouYbc="; + }; + }; + + postInstall = '' + cp -r dist $out + ''; + + nativeBuildInputs = [ + pkg-config + gettext + ]; + + buildInputs = [ + sqlite + openssl + ]; + + meta = with lib; { + description = "A verifying keyserver"; + homepage = "https://gitlab.com/keys.openpgp.org/hagrid"; + license = with licenses; [ gpl3 ]; + maintainers = with maintainers; [ valodim ]; + platforms = platforms.all; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8583bbc --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1739357830, + "narHash": "sha256-9xim3nJJUFbVbJCz48UP4fGRStVW5nv4VdbimbKxJ3I=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0ff09db9d034a04acd4e8908820ba0b410d7a33a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "utils": "utils" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "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" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..396cbb9 --- /dev/null +++ b/flake.nix @@ -0,0 +1,16 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + utils.url = "github:numtide/flake-utils"; + }; + outputs = { self, nixpkgs, utils }: + utils.lib.eachDefaultSystem (system: let + pkgs = nixpkgs.legacyPackages."${system}"; + in rec { + packages.hagrid = pkgs.callPackage ./. { }; + packages.default = packages.hagrid; + }) // { + overlays.hagrid = (final: prev: { hagrid = self.packages."${final.system}".hagrid; }); + overlays.default = self.overlays.hagrid; + }; +}