@@ -0,0 +1,41 @@
1+{ stdenv, lib, fetchFromGitHub, rustPlatform, pkg-config
2+, withGui ? true, webkitgtk, Cocoa, WebKit
3+}:
4+
5+rustPlatform.buildRustPackage rec {
6+ pname = "alfis";
7+ version = "0.6.5";
8+
9+ src = fetchFromGitHub {
10+ owner = "Revertron";
11+ repo = "Alfis";
12+ rev = "v${version}";
13+ sha256 = "1g95yvkvlj78bqrk3p2xbhrmg1hrlgbyr1a4s7vg45y60zys2c2j";
14+ };
15+
16+ cargoSha256 = "1n7kb1lyghpkgdgd58pw8ldvfps30rnv5niwx35pkdg74h59hqgj";
17+
18+ cargoBuildFlags = [ "--no-default-features" ]
19+ ++ lib.optional withGui "--features webgui";
20+
21+ cargoTestFlags = [ "--no-default-features" ]
22+ ++ lib.optional withGui "--features webgui";
23+
24+ checkFlags = [
25+ # these want internet access, disable them
26+ "--skip=dns::client::tests::test_tcp_client"
27+ "--skip=dns::client::tests::test_udp_client"
28+ ];
29+
30+ nativeBuildInputs = [ pkg-config ];
31+ buildInputs = lib.optional (withGui && stdenv.isLinux) webkitgtk
32+ ++ lib.optionals (withGui && stdenv.isDarwin) [ Cocoa WebKit ];
33+
34+ meta = with lib; {
35+ description = "Alternative Free Identity System";
36+ homepage = "https://alfis.name";
37+ license = licenses.agpl3Only;
38+ maintainers = with maintainers; [ misuzu ];
39+ platforms = platforms.unix;
40+ };
41+}