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

48 lines
1.3 KiB
YAML
Raw Normal View History

2024-11-18 12:05:43 -06:00
# 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
2025-01-19 23:33:42 -06:00
experimental-features = nix-command flakes pipe-operator
2025-01-17 12:28:06 -06:00
build-dir = /nix/var
2024-11-18 12:05:43 -06:00
keep-derivations = true
keep-outputs = true
clean:
description: Clean up disk space
default: false
btrfs:
description: Use BTRFS to setup RAID0
default: false
2024-11-18 12:10:46 -06:00
attic_token:
description: token to access attic cache
2024-12-27 15:39:26 -06:00
2024-11-18 12:05:43 -06:00
runs:
using: composite
steps:
- shell: bash
env:
CLEAN: ${{ inputs.clean }}
BTRFS: ${{ inputs.btrfs }}
run: exec ${{ github.action_path }}/prepare.sh
2025-01-19 23:33:42 -06:00
# - uses: DeterminateSystems/nix-installer-action@v15
# with:
# source-url: https://install.lix.systems/lix/lix-installer-x86_64-linux
# extra-conf: ${{ inputs.nix_conf }}
2025-01-20 00:23:36 -06:00
- uses: daylinmorgan/lix-gha-installer-action@released
with:
extra-conf: ${{ inputs.nix_conf }}
2024-11-18 12:05:43 -06:00
- name: Install and login to attic cache
2024-11-18 12:13:04 -06:00
shell: bash
2024-11-18 12:05:43 -06:00
run: |
nix profile install "nixpkgs#attic-client"
2024-11-18 12:10:46 -06:00
attic login oizys https://attic.dayl.in "${{ inputs.attic_token}}"
2025-01-17 12:28:06 -06:00
- name: "Show Nix Info"
2025-01-17 12:30:57 -06:00
shell: bash
run: nix run "nixpkgs#nix-info" -- -m