oizys/.github/actions/nix/action.yml

53 lines
1.7 KiB
YAML

# adapted from https://github.com/azuwis/actions/tree/7236424fa0fdc8d82df7cd4bff831a9d2338ce9e/nix
name: Install Nix and setup cache
inputs:
nix_conf:
description: Extra nix.conf config
default: |
accept-flake-config = true
experimental-features = nix-command flakes pipe-operator
extra-substituters = https://nix-cache.dayl.in
extra-trusted-public-keys = nix-cache.dayl.in-1:lj22Sov7m1snupBz/43O1fxyEfy/S7cxBpweD7iREcs
build-dir = /nix/var
stalled-download-timeout = 0
download-attempts = 10
clean:
description: Clean up disk space
default: false
btrfs:
description: Use BTRFS to setup RAID0
default: false
# attic_token:
# description: token to access attic cache
runs:
using: composite
steps:
- shell: bash
env:
CLEAN: ${{ inputs.clean }}
BTRFS: ${{ inputs.btrfs }}
run: exec ${{ github.action_path }}/prepare.sh
- name: Install Lix
uses: daylinmorgan/lix-gha-installer-action@latest
with:
extra-conf: ${{ inputs.nix_conf }}
# - name: Install and login to attic cache
# shell: bash
# run: |
# nix profile install "nixpkgs#attic-client"
# attic login oizys https://attic.dayl.in "${{ inputs.attic_token}}"
- name: "Show Nix Info"
shell: bash
run: nix run "nixpkgs#nix-info" -- -m
# https://git.lix.systems/lix-project/lix/issues/545
# https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces
- name: "Revert ubuntu change that broke lix tests"
shell: bash
run: |
sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0