styx will do the heavy lifting

This commit is contained in:
Daylin Morgan 2024-01-24 13:33:48 -06:00
parent 246f47af20
commit d8972aae6c
Signed by: daylin
GPG Key ID: C1E52E7DD81DF79F
2 changed files with 28 additions and 19 deletions

View File

@ -38,7 +38,7 @@ jobs:
https://hyprland.cachix.org
https://nixpkgs-wayland.cachix.org
https://daylin.cachix.org
cache.nixos.org
https://cache.nixos.org
- uses: DeterminateSystems/magic-nix-cache-action@v2
- uses: cachix/cachix-action@v14
@ -48,16 +48,11 @@ jobs:
- name: Build
shell: bash
run: |
# for host in algiz othalan mannaz
for host in ${HOSTS[@]}
do
cachix watch-exec daylin \
-- \
nix build \
".#nixosConfigurations.$host.config.system.build.toplevel" \
--print-build-logs
./modules/styx/styx cache --host $host --flake .
done
- name: Push
env:
CACHIX_ACTIVATE_TOKEN: "${{ secrets.CACHIX_ACTIVATE_TOKEN }}"
run: cachix push daylin ./result
# - name: Push
# env:
# CACHIX_ACTIVATE_TOKEN: "${{ secrets.CACHIX_ACTIVATE_TOKEN }}"
# run: cachix push daylin ./result

View File

@ -4,7 +4,8 @@ set -e
# rewrite as python script?
FLAKE_PATH=$HOME/nixcfg
HOSTNAME=${HOSTNAME:-$(hostname)}
FLAKE_PATH=${FLAKE_PATH-:$HOME/nixcfg}
DIM="$(tput dim)"
BOLD="$(tput bold)"
@ -69,6 +70,14 @@ dry() {
nix build "$FLAKE_PATH#nixosConfigurations.$(hostname).config.system.build.toplevel" --dry-run
}
cache() {
cachix watch-exec daylin \
-- \
nix build "$FLAKE_PATH#nixosConfigurations.${HOSTNAME}.config.system.build.toplevel" \
--print-build-logs
}
if [[ $# -eq 0 ]]; then
log no command specified see below for help
help
@ -76,17 +85,20 @@ fi
while [[ $# -gt 0 ]]; do
case $1 in
fmt | boot | switch | store | build | dry)
fmt | boot | switch | store | build | dry | cache)
cmd=$1
shift
;;
-h | --help)
help
-f | --flake)
FLAKE_PATH="$2"
shift; shift;
;;
--)
# stop parsing and foward the rest of the args
shift
break
-h | --host)
HOSTNAME="$2"
shift; shift;
;;
--help)
help
;;
-*,--*)
error "unknown flag: ${BOLD}$1${RESET}"
@ -103,4 +115,6 @@ if [[ $# -gt 0 ]]; then
echo "forwarding args: ${BOLD}$*${RESET}"
fi
$cmd "$@"