diff options
author | Alexander Foremny <aforemny@posteo.de> | 2024-02-20 07:00:30 +0100 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2024-02-21 03:31:19 +0100 |
commit | 606d121ba0b5f36f9a6419c48e6986a27ac1f5b0 (patch) | |
tree | 20527011bd419f3685b060908145ace2429ddf99 /modules | |
parent | b4655bed9ca84e44295a0c52e70b0a8483ed004b (diff) |
add abuilder service
Diffstat (limited to 'modules')
-rw-r--r-- | modules/abuilder/default.nix | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/abuilder/default.nix b/modules/abuilder/default.nix new file mode 100644 index 0000000..a4dc76a --- /dev/null +++ b/modules/abuilder/default.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: +let cfg = config.services.abuilder; in +{ + options.services.abuilder = { + enable = lib.mkEnableOption "abuilder build daemon"; + repositories = lib.mkOption { + type = lib.types.listOf lib.types.path; + default = [ ]; + }; + }; + + config = lib.mkIf cfg.enable (lib.mkMerge [ + { + environment.systemPackages = [ pkgs.abuilder ]; + + # TODO harden `systemd.services.abuilder` + systemd.services."abuilder".after = [ "network.target" ]; + systemd.services."abuilder".environment.ABUILDER_STATE = "/var/lib/abuilder"; + systemd.services."abuilder".environment.ABUILDER_URLS = lib.concatStringsSep ":" cfg.repositories; + systemd.services."abuilder".environment.NIX_PATH = "nixpkgs=/etc/nixos/nixpkgs"; + systemd.services."abuilder".path = [ pkgs.git pkgs.nix ]; + systemd.services."abuilder".script = "${pkgs.abuilder}/bin/abuilder"; + systemd.services."abuilder".wantedBy = [ "multi-user.target" ]; + } + ]); +} |