feat: add a fmt github action

This commit is contained in:
Nickolaj Jepsen 2025-12-13 19:41:40 +01:00
parent 76055bdf3f
commit 2c0c99180e
4 changed files with 50 additions and 9 deletions

32
.github/workflows/fmt.yml vendored Normal file
View file

@ -0,0 +1,32 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check formatting
run: nix fmt -- --fail-on-change
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Run nix flake check
run: nix flake check

View file

@ -51,14 +51,17 @@ just bootstrap-flash /dev/sdX
## Adding a New Host
1. Run the new-host command:
```bash
just new-host <hostname> <username>
```
This creates:
- `hosts/<hostname>/` directory
- `secrets/hosts/<hostname>/` with SSH keys
2. Add host configuration in `hosts/default.nix`:
```nix
<hostname> = mkSystem {
hostname = "<hostname>";
@ -72,6 +75,7 @@ just bootstrap-flash /dev/sdX
- Other host-specific modules as needed
4. Generate hardware config:
```bash
just factor <hostname>
# Or for remote:
@ -120,6 +124,7 @@ just age -e <file> -o <output.age>
### Formatting
Code is formatted using `treefmt-nix` with:
- **alejandra** - Nix formatter
- **deadnix** - Remove unused Nix code
- **statix** - Nix linter

View file

@ -76,9 +76,11 @@
{
id = "secondary-left";
name = "Secondary Bar (Left)";
screenPreferences = builtins.map (monitor: {
screenPreferences =
builtins.map (monitor: {
inherit (monitor) name;
}) leftMonitors;
})
leftMonitors;
showOnLastDisplay = false;
leftWidgets = [];
centerWidgets = [];
@ -92,9 +94,11 @@
{
id = "secondary-right";
name = "Secondary Bar (Right)";
screenPreferences = builtins.map (monitor: {
screenPreferences =
builtins.map (monitor: {
inherit (monitor) name;
}) rightMonitors;
})
rightMonitors;
showOnLastDisplay = false;
leftWidgets = [
"workspaceSwitcher"