aboutsummaryrefslogtreecommitdiff
path: root/flakes/openarc
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2021-08-23 01:50:09 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2021-08-24 00:49:51 +0200
commit5e2ec9fb8628136e7f9f618c68c0e42ab086b80e (patch)
treeee56ee4a49b7d48fc91e7baf34ca0158f9c64cff /flakes/openarc
parentdfe02d8fd52e33c7d4e1a209cf486696100b88f3 (diff)
downloadNix-5e2ec9fb8628136e7f9f618c68c0e42ab086b80e.tar.gz
Nix-5e2ec9fb8628136e7f9f618c68c0e42ab086b80e.tar.zst
Nix-5e2ec9fb8628136e7f9f618c68c0e42ab086b80e.zip
Refactor flakes using follows
Diffstat (limited to 'flakes/openarc')
-rw-r--r--flakes/openarc/default.nix20
-rw-r--r--flakes/openarc/flake.lock8
-rw-r--r--flakes/openarc/flake.nix31
3 files changed, 32 insertions, 27 deletions
diff --git a/flakes/openarc/default.nix b/flakes/openarc/default.nix
new file mode 100644
index 0000000..c6d74c6
--- /dev/null
+++ b/flakes/openarc/default.nix
@@ -0,0 +1,20 @@
1{ stdenv, automake, autoconf, libbsd, libtool, openssl, pkg-config, libmilter, file, lib, src }:
2stdenv.mkDerivation rec {
3 pname = "openarc";
4 version = "master-${src.shortRev or "unknown"}";
5 inherit src;
6 buildInputs = [ automake autoconf libbsd libtool openssl pkg-config libmilter ];
7
8 configureFlags = [
9 "--with-milter=${libmilter}"
10 ];
11 preConfigure = ''
12 autoreconf --force --install
13 sed -i -e "s@/usr/bin/file@${file}/bin/file@" ./configure
14 '';
15 meta = {
16 description = "Open source ARC implementation";
17 homepage = "https://github.com/trusteddomainproject/OpenARC";
18 platforms = lib.platforms.unix;
19 };
20}
diff --git a/flakes/openarc/flake.lock b/flakes/openarc/flake.lock
index 78c0fba..e0b78a8 100644
--- a/flakes/openarc/flake.lock
+++ b/flakes/openarc/flake.lock
@@ -18,11 +18,11 @@
18 "myuids": { 18 "myuids": {
19 "locked": { 19 "locked": {
20 "dir": "flakes/myuids", 20 "dir": "flakes/myuids",
21 "lastModified": 1609281959, 21 "lastModified": 1628207001,
22 "narHash": "sha256-SYNlHeobQAzTzK0pM5AqMn7M2WbTuzBeoD+Q3Mu+sho=", 22 "narHash": "sha256-7e12OfDv9zMOfqcAlsk1sZj2l3ZB03kcBdWUqhwVaWo=",
23 "ref": "master", 23 "ref": "master",
24 "rev": "1be9e64bb4556676f65e6e5044e04426848849c0", 24 "rev": "dfe02d8fd52e33c7d4e1a209cf486696100b88f3",
25 "revCount": 791, 25 "revCount": 865,
26 "type": "git", 26 "type": "git",
27 "url": "https://git.immae.eu/perso/Immae/Config/Nix.git" 27 "url": "https://git.immae.eu/perso/Immae/Config/Nix.git"
28 }, 28 },
diff --git a/flakes/openarc/flake.nix b/flakes/openarc/flake.nix
index fbb7fb1..f47afcf 100644
--- a/flakes/openarc/flake.nix
+++ b/flakes/openarc/flake.nix
@@ -15,30 +15,9 @@
15 15
16 outputs = { self, myuids, openarc, flake-utils, nixpkgs }: flake-utils.lib.eachDefaultSystem (system: 16 outputs = { self, myuids, openarc, flake-utils, nixpkgs }: flake-utils.lib.eachDefaultSystem (system:
17 let 17 let
18 lock = builtins.fromJSON (builtins.readFile ./flake.lock);
19 pkgs = import nixpkgs { inherit system; overlays = []; }; 18 pkgs = import nixpkgs { inherit system; overlays = []; };
20 inherit (pkgs) stdenv automake autoconf libbsd libtool openssl pkg-config libmilter file;
21 in rec { 19 in rec {
22 packages.openarc = stdenv.mkDerivation rec { 20 packages.openarc = pkgs.callPackage ./. { src = openarc; };
23 pname = "openarc";
24 version = "master-${builtins.substring 0 7 lock.nodes.openarc.locked.rev}";
25 src = openarc;
26 buildInputs = [ automake autoconf libbsd libtool openssl pkg-config libmilter ];
27
28 configureFlags = [
29 "--with-milter=${libmilter}"
30 ];
31 preConfigure = ''
32 autoreconf --force --install
33 sed -i -e "s@/usr/bin/file@${file}/bin/file@" ./configure
34 '';
35 meta = {
36 description = "Open source ARC implementation";
37 homepage = "https://github.com/trusteddomainproject/OpenARC";
38 platforms = stdenv.lib.platforms.unix;
39 };
40 };
41
42 defaultPackage = packages.openarc; 21 defaultPackage = packages.openarc;
43 legacyPackages.openarc = packages.openarc; 22 legacyPackages.openarc = packages.openarc;
44 apps.openarc = flake-utils.lib.mkApp { drv = packages.openarc; }; 23 apps.openarc = flake-utils.lib.mkApp { drv = packages.openarc; };
@@ -74,7 +53,13 @@
74 ''; 53 '';
75 }; 54 };
76 }; 55 };
77 }) // { 56 }) // rec {
57 overlays = {
58 openarc = final: prev: {
59 openarc = self.defaultPackage."${final.system}";
60 };
61 };
62 overlay = overlays.openarc;
78 nixosModule = { config, lib, pkgs, ... }: 63 nixosModule = { config, lib, pkgs, ... }:
79 let 64 let
80 cfg = config.services.openarc; 65 cfg = config.services.openarc;