Compare commits
No commits in common. "dc781b5bc836ddce2b3536f3d47b5624b24afad2" and "e610ca24e10996f97dcdf68297dbd0c1b9ffc4ed" have entirely different histories.
dc781b5bc8
...
e610ca24e1
3 changed files with 12 additions and 86 deletions
67
.github/workflows/build-machines-and-homes.yml
vendored
67
.github/workflows/build-machines-and-homes.yml
vendored
|
@ -3,7 +3,6 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
||||||
NIX_CONFIG: |
|
NIX_CONFIG: |
|
||||||
|
@ -17,7 +16,6 @@ env:
|
||||||
TERM: ansi
|
TERM: ansi
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets. AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets. AWS_SECRET_ACCESS_KEY }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-machines:
|
build-machines:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -29,7 +27,6 @@ jobs:
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Maximize build disk space
|
- name: Maximize build disk space
|
||||||
uses: easimon/maximize-build-space@v10
|
uses: easimon/maximize-build-space@v10
|
||||||
|
@ -42,49 +39,23 @@ jobs:
|
||||||
remove-codeql: 'true'
|
remove-codeql: 'true'
|
||||||
remove-docker-images: 'true'
|
remove-docker-images: 'true'
|
||||||
build-mount-path: /nix
|
build-mount-path: /nix
|
||||||
|
|
||||||
- name: setup binary cache key
|
- name: setup binary cache key
|
||||||
run: echo "${{ secrets.NIX_CACHE_SECRET_KEY }}" >> /home/runner/cache-priv-key.pem
|
run: echo "${{ secrets.NIX_CACHE_SECRET_KEY }}" >> /home/runner/cache-priv-key.pem
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@v30
|
uses: cachix/install-nix-action@v30
|
||||||
|
|
||||||
- name: Install Lix
|
|
||||||
run: |
|
|
||||||
sudo --preserve-env=PATH $(which nix) run \
|
|
||||||
--experimental-features "nix-command flakes" \
|
|
||||||
--extra-substituters https://cache.lix.systems --extra-trusted-public-keys "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" \
|
|
||||||
'git+https://git.lix.systems/lix-project/lix?ref=refs/tags/2.92.0' -- \
|
|
||||||
upgrade-nix \
|
|
||||||
--extra-substituters https://cache.lix.systems --extra-trusted-public-keys "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
|
|
||||||
nix --version
|
|
||||||
|
|
||||||
- name: Sync repository
|
- name: Sync repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
run: |
|
run: |
|
||||||
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
|
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
|
||||||
nix build -L "$package"
|
nix build -L "$package"
|
||||||
|
|
||||||
- name: cache
|
- name: cache
|
||||||
# https://stackoverflow.com/a/58859404
|
if: always()
|
||||||
if: '!cancelled()'
|
|
||||||
run: |
|
run: |
|
||||||
package=".#nixosConfigurations."${{ matrix.machine }}".config.system.build.toplevel"
|
nix copy --all --to 's3://nixcache?endpoint=s3.cy7.sh' --verbose
|
||||||
derivations=()
|
nix store sign --store 's3://nixcache?endpoint=s3.cy7.sh' -k /home/runner/cache-priv-key.pem --all
|
||||||
while IFS=$'\n' read derivation; do
|
|
||||||
derivations+=("$derivation")
|
|
||||||
done < <(nix path-info --derivation "$package")
|
|
||||||
|
|
||||||
for derivation in "${derivations[@]}"; do
|
|
||||||
nix copy -j8 \
|
|
||||||
--to 's3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem' \
|
|
||||||
$(nix-store --query --requisites --include-outputs "$derivation")
|
|
||||||
done
|
|
||||||
|
|
||||||
build-homes:
|
build-homes:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
@ -96,7 +67,6 @@ jobs:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
# - macos-latest
|
# - macos-latest
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Maximize build disk space
|
- name: Maximize build disk space
|
||||||
uses: easimon/maximize-build-space@v10
|
uses: easimon/maximize-build-space@v10
|
||||||
|
@ -109,45 +79,20 @@ jobs:
|
||||||
remove-codeql: 'true'
|
remove-codeql: 'true'
|
||||||
remove-docker-images: 'true'
|
remove-docker-images: 'true'
|
||||||
build-mount-path: /nix
|
build-mount-path: /nix
|
||||||
|
|
||||||
- name: setup binary cache key
|
- name: setup binary cache key
|
||||||
run: echo "${{ secrets.NIX_CACHE_SECRET_KEY }}" >> /home/runner/cache-priv-key.pem
|
run: echo "${{ secrets.NIX_CACHE_SECRET_KEY }}" >> /home/runner/cache-priv-key.pem
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@v30
|
uses: cachix/install-nix-action@v30
|
||||||
|
|
||||||
- name: Install Lix
|
|
||||||
run: |
|
|
||||||
sudo --preserve-env=PATH $(which nix) run \
|
|
||||||
--experimental-features "nix-command flakes" \
|
|
||||||
--extra-substituters https://cache.lix.systems --extra-trusted-public-keys "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" \
|
|
||||||
'git+https://git.lix.systems/lix-project/lix?ref=refs/tags/2.92.0' -- \
|
|
||||||
upgrade-nix \
|
|
||||||
--extra-substituters https://cache.lix.systems --extra-trusted-public-keys "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
|
|
||||||
nix --version
|
|
||||||
|
|
||||||
- name: Sync repository
|
- name: Sync repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
run: |
|
run: |
|
||||||
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
|
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
|
||||||
nix build -L "$package"
|
nix build -L "$package"
|
||||||
|
|
||||||
- name: cache
|
- name: cache
|
||||||
# https://stackoverflow.com/a/58859404
|
if: always()
|
||||||
if: '!cancelled()'
|
|
||||||
run: |
|
run: |
|
||||||
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
|
nix copy --all --to 's3://nixcache?endpoint=s3.cy7.sh' --verbose
|
||||||
derivations=()
|
nix store sign --store 's3://nixcache?endpoint=s3.cy7.sh' -k /home/runner/cache-priv-key.pem --all
|
||||||
while IFS=$'\n' read derivation; do
|
|
||||||
derivations+=("$derivation")
|
|
||||||
done < <(nix path-info --derivation "$package")
|
|
||||||
|
|
||||||
for derivation in "${derivations[@]}"; do
|
|
||||||
nix copy -j8 \
|
|
||||||
--to 's3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem' \
|
|
||||||
$(nix-store --query --requisites --include-outputs "$derivation")
|
|
||||||
done
|
|
||||||
|
|
27
.github/workflows/build-packages.yml
vendored
27
.github/workflows/build-packages.yml
vendored
|
@ -6,7 +6,6 @@ on:
|
||||||
description: "package to build"
|
description: "package to build"
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
env:
|
env:
|
||||||
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
||||||
NIX_CONFIG: |
|
NIX_CONFIG: |
|
||||||
|
@ -19,7 +18,6 @@ env:
|
||||||
TERM: ansi
|
TERM: ansi
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets. AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets. AWS_SECRET_ACCESS_KEY }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-packages:
|
build-packages:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -33,42 +31,23 @@ jobs:
|
||||||
# - macos-latest
|
# - macos-latest
|
||||||
# - macos-13
|
# - macos-13
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: setup binary cache key
|
- name: setup binary cache key
|
||||||
run: echo "${{ secrets.NIX_CACHE_SECRET_KEY }}" >> /home/runner/cache-priv-key.pem
|
run: echo "${{ secrets.NIX_CACHE_SECRET_KEY }}" >> /home/runner/cache-priv-key.pem
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
uses: cachix/install-nix-action@v30
|
uses: cachix/install-nix-action@v30
|
||||||
|
|
||||||
- name: Install Lix
|
|
||||||
run: |
|
|
||||||
sudo --preserve-env=PATH $(which nix) run \
|
|
||||||
--experimental-features "nix-command flakes" \
|
|
||||||
--extra-substituters https://cache.lix.systems --extra-trusted-public-keys "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" \
|
|
||||||
'git+https://git.lix.systems/lix-project/lix?ref=refs/tags/2.92.0' -- \
|
|
||||||
upgrade-nix \
|
|
||||||
--extra-substituters https://cache.lix.systems --extra-trusted-public-keys "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
|
|
||||||
nix --version
|
|
||||||
|
|
||||||
- name: Sync repository
|
- name: Sync repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- run: nix build -L ${{ matrix.package }}
|
- run: nix build -L ${{ matrix.package }}
|
||||||
|
|
||||||
- name: cache result
|
- name: cache result
|
||||||
# https://stackoverflow.com/a/58859404
|
if: always()
|
||||||
if: '!cancelled()'
|
|
||||||
run: |
|
run: |
|
||||||
nix copy -j8 \
|
nix copy --all --to 's3://nixcache?endpoint=s3.cy7.sh' --verbose
|
||||||
--to 's3://nixcache?endpoint=s3.cy7.sh&secret-key=/home/runner/cache-priv-key.pem' \
|
nix store sign --store 's3://nixcache?endpoint=s3.cy7.sh' -k /home/runner/cache-priv-key.pem --all
|
||||||
$(nix path-info --recursive --derivation "${{ matrix.package }}" |sed 's/\.drv$/.drv^*/')
|
|
||||||
|
|
||||||
- name: prepare tarball to upload
|
- name: prepare tarball to upload
|
||||||
run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result
|
run: nix run github:nixos/nixpkgs#gnutar hcvf result.tar result
|
||||||
|
|
||||||
- name: upload result
|
- name: upload result
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|
4
justfile
4
justfile
|
@ -1,7 +1,9 @@
|
||||||
update:
|
update:
|
||||||
git branch -D update || true
|
git branch -D update || true
|
||||||
git switch -c update
|
git switch -c update
|
||||||
nix flake update --commit-lock-file
|
nix flake update
|
||||||
|
git add flake.lock
|
||||||
|
git commit -s -m "flake update"
|
||||||
git push -f
|
git push -f
|
||||||
git switch main
|
git switch main
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue