Skip to content

nixos: 23.11 -> 24.05, flake.lock: Update, mastodon: -> 4.2.9 #49

nixos: 23.11 -> 24.05, flake.lock: Update, mastodon: -> 4.2.9

nixos: 23.11 -> 24.05, flake.lock: Update, mastodon: -> 4.2.9 #49

Workflow file for this run

name: "Build system config"
on:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: run nix flake checks
run: |
nix flake check --no-build | tee flake-check-output
echo "## Flake check" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
cat flake-check-output >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
- name: Build Kuschelhaufen
run: |
echo "## Build kuschelhaufen" >> $GITHUB_STEP_SUMMARY
build_cmd="nix build .#nixosConfigurations.kuschelhaufen.config.system.build.toplevel"
$build_cmd
out_path=$($build_cmd --print-out-paths)
echo -e "\x1b[32;1mSuccessfully built .#nixosConfigurations.kuschelhaufen\x1b[0m"
echo -n "\`${out_path}\`" >> $GITHUB_STEP_SUMMARY
- name: nix store diff-closures
if: github.event_name == 'pull_request'
run: |
host_drv="nixosConfigurations.kuschelhaufen.config.system.build.toplevel"
# In case this fails, the action will fail too (with the tee, the action somehow succeded even tho diff-closures failed)
# since the builds are locally cached, running it twice doesn't take much time at all
# And by doing this here, we get nice, colored, output
prev_flake="github:${GITHUB_REPOSITORY}"
final_flake="."
prev_mastodon_version=$(nix eval "${prev_flake}#mastodon.version" --quiet --raw)
final_mastodon_version=$(nix eval "${final_flake}#mastodon.version" --quiet --raw)
if [[ $prev_mastodon_version != $final_mastodon_version ]]; then
echo "**Mastodon version has changed from** $prev_mastodon_version to **${final_mastodon_version}**" >> $GITHUB_STEP_SUMMARY
fi
nix store diff-closures "${prev_flake}#${host_drv}" "${final_flake}#${host_drv}" --quiet
echo "## Closures difference" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
nix store diff-closures "github:${GITHUB_REPOSITORY}#${host_drv}" ".#${host_drv}" | sed -e 's/\x1b\[[0-9;]*m//g' >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY