description = "Open source ARC implementation";
inputs.myuids = {
- url = "https://git.immae.eu/perso/Immae/Config/Nix.git";
- type = "git";
- dir = "flakes/myuids";
+ url = "path:../myuids";
};
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
outputs = { self, myuids, openarc, flake-utils, nixpkgs }: flake-utils.lib.eachDefaultSystem (system:
let
- lock = builtins.fromJSON (builtins.readFile ./flake.lock);
pkgs = import nixpkgs { inherit system; overlays = []; };
- inherit (pkgs) stdenv automake autoconf libbsd libtool openssl pkg-config libmilter file;
in rec {
- packages.openarc = stdenv.mkDerivation rec {
- pname = "openarc";
- version = "master-${builtins.substring 0 7 lock.nodes.openarc.locked.rev}";
- src = openarc;
- buildInputs = [ automake autoconf libbsd libtool openssl pkg-config libmilter ];
-
- configureFlags = [
- "--with-milter=${libmilter}"
- ];
- preConfigure = ''
- autoreconf --force --install
- sed -i -e "s@/usr/bin/file@${file}/bin/file@" ./configure
- '';
- meta = {
- description = "Open source ARC implementation";
- homepage = "https://github.com/trusteddomainproject/OpenARC";
- platforms = stdenv.lib.platforms.unix;
- };
- };
-
+ packages.openarc = pkgs.callPackage ./. { src = openarc; };
defaultPackage = packages.openarc;
legacyPackages.openarc = packages.openarc;
apps.openarc = flake-utils.lib.mkApp { drv = packages.openarc; };
'';
};
};
- }) // {
- nixosModules = (if builtins.pathExists ./private.nix then import ./private.nix nixpkgs else {});
+ }) // rec {
+ overlays = {
+ openarc = final: prev: {
+ openarc = self.defaultPackage."${final.system}";
+ };
+ };
+ overlay = overlays.openarc;
nixosModule = { config, lib, pkgs, ... }:
let
cfg = config.services.openarc;
- defaultSock = "local:/run/openarc/openarc.sock";
- args = [ "-f" "-p" cfg.socket ] ++ lib.optionals (cfg.configFile != null) [ "-c" cfg.configFile ];
+ defaultSock = "/run/openarc/openarc.sock";
+ args = [ "-f" "-p" "local:${cfg.socket}" ] ++ lib.optionals (cfg.configFile != null) [ "-c" cfg.configFile ];
in {
+ # Necessary for situations where flake gets included multiple times
+ key = builtins.hashString "sha256" (builtins.path { path = self.sourceInfo.outPath; name = "source"; });
options = {
services.openarc = {
enable = lib.mkOption {
};
config = lib.mkIf cfg.enable {
+ nixpkgs.overlays = [ self.overlay ];
users.users = lib.optionalAttrs (cfg.user == "openarc") {
openarc = {
group = cfg.group;
openarc.gid = myuids.lib.gids.openarc;
};
- environment.systemPackages = [ self.defaultPackage."${pkgs.system}" ];
+ environment.systemPackages = [ pkgs.openarc ];
systemd.services.openarc = {
description = "OpenARC daemon";