Allow nix-command and flakes experimental Nix commands
Some checks failed
/ push (push) Failing after 1m2s

This commit is contained in:
Pim Kunis 2024-04-28 17:03:58 +02:00
parent ae4d04bc3d
commit 9b44b726c0

View file

@ -9,6 +9,19 @@ let
finalImageTag = "2.22.0"; finalImageTag = "2.22.0";
finalImageName = "nix"; finalImageName = "nix";
}; };
nixConf = pkgs.writeText "nix.conf" ''
build-users-group = nixbld
sandbox = false
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
experimental-features = nix-command flakes
'';
nixConfDrv = pkgs.stdenv.mkDerivation {
name = "nix.conf";
dontUnpack = true;
installPhase = "install -Dm755 ${nixConf} $out/etc/nix/nix.conf";
};
in in
{ {
packages.forgejo-nix-action = pkgs.dockerTools.buildImage { packages.forgejo-nix-action = pkgs.dockerTools.buildImage {
@ -18,14 +31,14 @@ in
copyToRoot = pkgs.buildEnv { copyToRoot = pkgs.buildEnv {
name = "image-root"; name = "image-root";
paths = [ pkgs.coreutils pkgs.attic-client pkgs.docker-client ]; paths = with pkgs; [ coreutils attic-client docker-client nixConfDrv ];
pathsToLink = [ "/bin" ]; pathsToLink = [ "/bin" "/etc/nix" ];
}; };
config = { # config = {
Env = [ # Env = [
"PATH=/bin:/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin" # "PATH=/bin:/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin"
]; # ];
}; # };
}; };
}) })