Allow nix-command and flakes experimental Nix commands
Some checks failed
/ push (push) Failing after 1m2s
Some checks failed
/ push (push) Failing after 1m2s
This commit is contained in:
parent
ae4d04bc3d
commit
9b44b726c0
1 changed files with 20 additions and 7 deletions
|
@ -9,6 +9,19 @@ let
|
|||
finalImageTag = "2.22.0";
|
||||
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
|
||||
{
|
||||
packages.forgejo-nix-action = pkgs.dockerTools.buildImage {
|
||||
|
@ -18,14 +31,14 @@ in
|
|||
|
||||
copyToRoot = pkgs.buildEnv {
|
||||
name = "image-root";
|
||||
paths = [ pkgs.coreutils pkgs.attic-client pkgs.docker-client ];
|
||||
pathsToLink = [ "/bin" ];
|
||||
paths = with pkgs; [ coreutils attic-client docker-client nixConfDrv ];
|
||||
pathsToLink = [ "/bin" "/etc/nix" ];
|
||||
};
|
||||
|
||||
config = {
|
||||
Env = [
|
||||
"PATH=/bin:/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin"
|
||||
];
|
||||
};
|
||||
# config = {
|
||||
# Env = [
|
||||
# "PATH=/bin:/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin"
|
||||
# ];
|
||||
# };
|
||||
};
|
||||
})
|
||||
|
|
Reference in a new issue