I’m trying to use the Jenkins service on NixOS, and git-lfs
is causing me problems.
I saw it has a list of packages with some default ones, and git-lfs
is indeed missing:
packages = mkOption {
default = [ pkgs.stdenv pkgs.git pkgs.jdk11 config.programs.ssh.package pkgs.nix ];
type = types.listOf types.package;
};
I thought “I could copy those over and add
pkgs.git-lfs
, but if the defaults change, I won’t see the drift until it causes problems”.
So I tried to append git-lfs
to the default packages like this:
services.jenkins = {
enable = true;
home = "/home/jenkins";
port = 10420;
extraGroups = [ "docker" ];
packages = config.services.jenkins.packages.default ++ [ pkgs.git-lfs ];
};
This errored out with
infinite recursion encountered
.
Then I saw this GH issue and learned about mkOption { apply = old: ... };
, so I tried:
services.jenkins = {
enable = true;
home = "/home/jenkins";
port = 10420;
extraGroups = [ "docker" ];
packages = lib.mkOption {
apply = old: old ++ [ pkgs.git-lfs ];
type = lib.types.listOf lib.types.package;
};
};
This errored out with the same infinite recursion error.
I’d love help understanding:
a) Why this causes an infinite recursion
I can imagine in the first example I’m creating a definition of packages
that depends on packages
's itself, where perhaps something like what we do with overlays is necessary. The problem is this is what I expected the mkOption
version to be, so I’m confused.