oizys/.github/actions/nix/action.yml
2025-01-30 10:43:33 -06:00

51 lines
1.5 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
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
- 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