mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-22 08:06:50 +01:00
feat: add a fmt github action
This commit is contained in:
parent
76055bdf3f
commit
2c0c99180e
4 changed files with 50 additions and 9 deletions
32
.github/workflows/fmt.yml
vendored
Normal file
32
.github/workflows/fmt.yml
vendored
Normal 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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -76,9 +76,11 @@
|
|||
{
|
||||
id = "secondary-left";
|
||||
name = "Secondary Bar (Left)";
|
||||
screenPreferences = builtins.map (monitor: {
|
||||
inherit (monitor) name;
|
||||
}) leftMonitors;
|
||||
screenPreferences =
|
||||
builtins.map (monitor: {
|
||||
inherit (monitor) name;
|
||||
})
|
||||
leftMonitors;
|
||||
showOnLastDisplay = false;
|
||||
leftWidgets = [];
|
||||
centerWidgets = [];
|
||||
|
|
@ -92,9 +94,11 @@
|
|||
{
|
||||
id = "secondary-right";
|
||||
name = "Secondary Bar (Right)";
|
||||
screenPreferences = builtins.map (monitor: {
|
||||
inherit (monitor) name;
|
||||
}) rightMonitors;
|
||||
screenPreferences =
|
||||
builtins.map (monitor: {
|
||||
inherit (monitor) name;
|
||||
})
|
||||
rightMonitors;
|
||||
showOnLastDisplay = false;
|
||||
leftWidgets = [
|
||||
"workspaceSwitcher"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue