using nix run instead of installing attic #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-linux-outputs | |
on: | |
push: | |
branches: | |
- 'master' | |
paths: | |
- nixos/** | |
- home/** | |
- .github/workflows/linux.yml | |
- roles/** | |
- '!nixos/**.md' | |
- '!home/**.md' | |
- '!**.md' | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * Sat" | |
jobs: | |
build-linux-env: | |
name: Build Linux outputs | |
runs-on: [self-hosted, linux, x64] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v27 | |
with: | |
nix_path: nixpkgs=channel:nixpkgs-unstable | |
extra_nix_config: | | |
extra-substituters = http://100.69.64.103/nixos | |
extra-trusted-public-keys = nixos:ZffGHlb0Ng3oXu8cLT9msyOB/datC4r+/K9nImONIec= | |
- name: Setup Nix Magic Cache | |
uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Build Linux outputs | |
run: | | |
sudo -s /bin/bash -- <<EOF | |
source /home/docker/.nix-profile/etc/profile.d/nix-daemon.sh | |
USER=root /home/docker/.nix-profile/bin/nix run nixpkgs#cachix -- use heywoodlh-helix | |
/home/docker/.nix-profile/bin/nix build "github:zhaofengli/attic#attic-client" | |
/home/docker/.nix-profile/bin/nix run "github:zhaofengli/attic#attic-client" -- push nixos ./result | |
/home/docker/.nix-profile/bin/nix run nixpkgs#nixos-rebuild -- build --flake .#nixos-desktop-intel | |
/home/docker/.nix-profile/bin/nix run "github:zhaofengli/attic#attic-client" -- push nixos ./result | |
/home/docker/.nix-profile/bin/nix run nixpkgs#nixos-rebuild -- build --flake .#nixos-server-intel | |
/home/docker/.nix-profile/bin/nix run "github:zhaofengli/attic#attic-client" -- push nixos ./result | |
/home/docker/.nix-profile/bin/nix build .#homeConfigurations.heywoodlh.activationPackage --impure | |
/home/docker/.nix-profile/bin/nix run "github:zhaofengli/attic#attic-client" -- push nixos ./result | |
/home/docker/.nix-profile/bin/nix build .#homeConfigurations.heywoodlh-server.activationPackage --impure | |
/home/docker/.nix-profile/bin/nix run "github:zhaofengli/attic#attic-client" -- push nixos ./result | |
EOF | |
build-linux-arm64-env: | |
name: Build Linux outputs | |
runs-on: [self-hosted, linux, arm64] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v27 | |
with: | |
nix_path: nixpkgs=channel:nixpkgs-unstable | |
extra_nix_config: | | |
extra-substituters = http://100.69.64.103/nixos | |
extra-trusted-public-keys = nixos:ZffGHlb0Ng3oXu8cLT9msyOB/datC4r+/K9nImONIec= | |
- name: Setup Nix Magic Cache | |
uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Build Linux outputs | |
run: | | |
sudo -s /bin/bash -- <<EOF | |
source /home/docker/.nix-profile/etc/profile.d/nix-daemon.sh | |
USER=root /home/docker/.nix-profile/bin/nix run nixpkgs#cachix -- use heywoodlh-helix | |
/home/docker/.nix-profile/bin/nix build "github:zhaofengli/attic#attic-client" | |
/home/docker/.nix-profile/bin/nix run "github:zhaofengli/attic#attic-client" -- push nixos ./result | |
/home/docker/.nix-profile/bin/nix run nixpkgs#nixos-rebuild -- build --flake .#nixos-arm64-test | |
/home/docker/.nix-profile/bin/nix run "github:zhaofengli/attic#attic-client" -- push nixos ./result | |
/home/docker/.nix-profile/bin/nix run nixpkgs#nixos-rebuild -- build --flake .#nixos-mac-mini | |
/home/docker/.nix-profile/bin/nix run "github:zhaofengli/attic#attic-client" -- push nixos ./result | |
/home/docker/.nix-profile/bin/nix build .#homeConfigurations.heywoodlh.activationPackage --impure | |
/home/docker/.nix-profile/bin/nix run "github:zhaofengli/attic#attic-client" -- push nixos ./result | |
/home/docker/.nix-profile/bin/nix build .#homeConfigurations.heywoodlh-server.activationPackage --impure | |
/home/docker/.nix-profile/bin/nix run "github:zhaofengli/attic#attic-client" -- push nixos ./result | |
EOF |