gitlab-runner: get nix ssh cache as pub key
This commit is contained in:
parent
734a94fa8d
commit
b3e0af1da6
4 changed files with 15 additions and 6 deletions
|
@ -4,6 +4,7 @@ let
|
|||
{
|
||||
authenticationTokenConfigFile,
|
||||
nixCacheSshPrivateKeyPath ? null,
|
||||
nixCacheSshPublicKeyPath ? null,
|
||||
...
|
||||
}:
|
||||
pkgs.writeScriptBin "install-nix" ''
|
||||
|
@ -32,10 +33,9 @@ let
|
|||
)
|
||||
}
|
||||
|
||||
${lib.optionalString (nixCacheSshPrivateKeyPath != null) ''
|
||||
${lib.optionalString (nixCacheSshPrivateKeyPath != null && nixCacheSshPublicKeyPath != null) ''
|
||||
NIX_CACHE_SSH_PRIVATE_KEY_PATH="${nixCacheSshPrivateKeyPath}"
|
||||
NIX_CACHE_SSH_PUBLIC_KEY="# nix-cache.wopus.dev:22 SSH-2.0-OpenSSH_10.0
|
||||
nix-cache.wopus.dev ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINU71N5QxdCmM7N25SnOg6u+YLmv92znpeDcyIDamldI"
|
||||
NIX_CACHE_SSH_PUBLIC_KEY_PATH="${nixCacheSshPublicKeyPath}"
|
||||
. ${./gitlab-runner/nix-cache-start}
|
||||
''}
|
||||
'';
|
||||
|
@ -45,6 +45,7 @@ rec {
|
|||
{
|
||||
authenticationTokenConfigFile,
|
||||
nixCacheSshPrivateKeyPath ? null,
|
||||
nixCacheSshPublicKeyPath ? null,
|
||||
...
|
||||
}@args:
|
||||
{
|
||||
|
@ -67,6 +68,9 @@ rec {
|
|||
]
|
||||
++ lib.optionals (nixCacheSshPrivateKeyPath != null) [
|
||||
"${nixCacheSshPrivateKeyPath}:${nixCacheSshPrivateKeyPath}"
|
||||
]
|
||||
++ lib.optionals (nixCacheSshPublicKeyPath != null) [
|
||||
"${nixCacheSshPublicKeyPath}:${nixCacheSshPublicKeyPath}"
|
||||
];
|
||||
# dockerDisableCache = true;
|
||||
preBuildScript = "\". ${lib.getExe (installNixScript args)}\"";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue