Skip to content

Commit

Permalink
Fix CI build failures and update README
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Jiroh Halili <[email protected]>
  • Loading branch information
ajhalili2006 committed Jan 2, 2025
1 parent ebd3295 commit 4e6f8db
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 11 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/update-flakes.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Nix Flake Builds

on:
schedule:
- cron: "30 */6 * * *"
- cron: "30 6 * * 5"
push:
branches: [main]

permissions:
contents: write
actions: write

jobs:
update-lockfile:
permissions:
contents: write
actions: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -21,11 +23,11 @@ jobs:

- name: Update flake
run: |
echo ::addgroup::Updating lockfile
echo ::group::Updating lockfile
nix flake update
echo ::endgroup::
echo ::addgroup::Metadata
echo ::group::Metadata
nix flake metadata
echo ::endgroup::
Expand All @@ -34,9 +36,12 @@ jobs:
git config --global user.name "RecapTimeBot"
git config --global user.email "[email protected]"
git add flake.lock
git commit -m "Update flake.lock" || echo "No changes to commit"
git commit -m "Update flake.lock [skip-ci]" || echo "No changes to commit"
git push
build-iso:
concurrency:
cancel-in-progress: false
group: recoverykit-iso-builds
needs: [update-lockfile]
name: Build recovery ISO
runs-on: ubuntu-latest
Expand All @@ -54,9 +59,9 @@ jobs:

- run: |
mkdir dist
echo ::addgroup::Building amd64 minimal ISO file
echo ::group::Building amd64 minimal ISO file
nix build .#nixosConfigurations.recoverykit-amd64.config.system.build.isoImage --verbose --show-trace
cp result/iso/*.iso ./out/ -rv
cp result/iso/*.iso ./dist/ -rv
echo ::endgroup
- name: Upload as artifact
Expand Down
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,32 @@
This is @ajhalili2006's NixOS + Home Manager configuration for his laptop
and homelabs, in sync with the [nixpkgs-specific dotfiles repository].

[dotfiles repository]: https://github.com/andreijiroh-dev/dotfiles/tree/nixpkgs
[nixpkgs-specific dotfiles repository]: https://github.com/andreijiroh-dev/dotfiles/tree/nixpkgs

## CI Status

| Workflow Name and Type | CI Platform | Badge/Link |
| --- | --- | --- |
| Nix Flake Builds (push) | GitHub Actions | [![Nix Flake Builds](https://github.com/andreijiroh-dev/nixops-config/actions/workflows/update-flakes.yml/badge.svg)](https://github.com/andreijiroh-dev/nixops-config/actions/workflows/update-flakes.yml) |
| Nix Flake Builds (schedule, every 06:30 UTC Saturday) | GitHub Actions | [![Nix Flake Builds](https://github.com/andreijiroh-dev/nixops-config/actions/workflows/update-flakes.yml/badge.svg?event=schedule)](https://github.com/andreijiroh-dev/nixops-config/actions/workflows/update-flakes.yml) |

## Usage

### Updating or installing NixOS
### Installing NixOS

It is recommended to install NixOS using either the Calamares-based graphical
installer or manually through the `nixos-install` utility, especially
when you have consider partitioning on your drive to ensure that you can roll back
safely in case things go wrong.

After installation, proceed with the steps in updating configuration below.

### Updating configuration or upgrading NixOS system

```bash
EDITOR="nano" # or code if you do
$EDITOR <path/to/nixfile.nix>

# update the flake.lock file manually
nix flake update

Expand All @@ -27,6 +46,18 @@ nix flake update
sudo nixos-rebuild --flake .#{hostname} <switch|boot|build>
```

### Building a minimial ISO for recovery

Currently available as `amd64` (`x86-64`) Linux ISO only for now.

```bash
# Build using the sources as remote
nix build github:andreijiroh-dev/nixops-config/main#nixosConfigurations.recoverykit-amd64.config.system.build.isoImage

# ...or via a local clone
nix build .#nixosConfigurations.recoverykit-amd64.config.system.build.isoImage
```

## License

MPL-2.0

0 comments on commit 4e6f8db

Please sign in to comment.