Skip to content

Commit 4a54c67

Browse files
jfrocheyvan-sraka
authored andcommitted
feat(nix-install-ephemeral): add configurable max-jobs input
Add max-jobs input parameter with empty default. When set, includes max-jobs in nix config. auto-allocate-uids and use-cgroups are now only enabled when enable-sccache-sandbox-path is true.
1 parent 0024ea8 commit 4a54c67

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/actions/nix-install-ephemeral/action.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ inputs:
99
description: 'Whether to expose /nix/var/cache/sccache in the Nix sandbox'
1010
required: false
1111
default: 'false'
12+
max-jobs:
13+
description: 'Maximum number of parallel Nix builds'
14+
required: false
15+
default: ''
1216
aws-region:
1317
description: 'AWS region for the Nix binary cache S3 bucket'
1418
required: false
@@ -53,7 +57,7 @@ runs:
5357
trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
5458
${{ inputs.push-to-cache == 'true' && 'post-build-hook = /etc/nix/upload-to-cache.sh' || '' }}
5559
${{ inputs.enable-sccache-sandbox-path == 'true' && 'extra-sandbox-paths = /nix/var/cache/sccache?' || '' }}
56-
max-jobs = 1
57-
auto-allocate-uids = true
58-
use-cgroups = true
59-
experimental-features = nix-command flakes cgroups auto-allocate-uids
60+
${{ inputs.max-jobs != '' && format('max-jobs = {0}', inputs.max-jobs) || '' }}
61+
${{ inputs.enable-sccache-sandbox-path == 'true' && 'auto-allocate-uids = true' || '' }}
62+
${{ inputs.enable-sccache-sandbox-path == 'true' && 'use-cgroups = true' || '' }}
63+
experimental-features = nix-command flakes ${{ inputs.enable-sccache-sandbox-path == 'true' && 'cgroups auto-allocate-uids' || '' }}

0 commit comments

Comments
 (0)