From 2c0c99180ea727c9a5dfb06252032e7ff059debb Mon Sep 17 00:00:00 2001 From: Nickolaj Jepsen Date: Sat, 13 Dec 2025 19:41:40 +0100 Subject: [PATCH] feat: add a fmt github action --- .github/workflows/fmt.yml | 32 ++++++++++++++++++++++++++++++++ README.md | 7 ++++++- justfile | 4 ++-- modules/desktop/dms/bar.nix | 16 ++++++++++------ 4 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/fmt.yml diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml new file mode 100644 index 0000000..133e635 --- /dev/null +++ b/.github/workflows/fmt.yml @@ -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 diff --git a/README.md b/README.md index 210ee9b..daf27d3 100644 --- a/README.md +++ b/README.md @@ -51,14 +51,17 @@ just bootstrap-flash /dev/sdX ## Adding a New Host 1. Run the new-host command: + ```bash just new-host ``` + This creates: - `hosts//` directory - `secrets/hosts//` with SSH keys 2. Add host configuration in `hosts/default.nix`: + ```nix = mkSystem { hostname = ""; @@ -72,6 +75,7 @@ just bootstrap-flash /dev/sdX - Other host-specific modules as needed 4. Generate hardware config: + ```bash just factor # Or for remote: @@ -120,6 +124,7 @@ just age -e -o ### Formatting Code is formatted using `treefmt-nix` with: + - **alejandra** - Nix formatter - **deadnix** - Remove unused Nix code - **statix** - Nix linter @@ -173,4 +178,4 @@ Heavily inspired by / stolen from [Flexoki](https://stephango.com/flexoki) | magenta | #CE5D97 | | magenta-alt | #A02F6F | | white | #DAD8CE | -| white-alt | #F2F0E5 | \ No newline at end of file +| white-alt | #F2F0E5 | diff --git a/justfile b/justfile index 57c301b..0749cbd 100644 --- a/justfile +++ b/justfile @@ -94,12 +94,12 @@ bootstrap-flash device: echo "Error: {{ device }} is not a block device" exit 1 fi - + # Build the ISO first if needed if [ ! -d "result/iso" ]; then just bootstrap-iso fi - + iso_file=$(ls -1 result/iso/*.iso | head -1) echo "Flashing $iso_file to {{ device }}..." echo "WARNING: This will ERASE ALL DATA on {{ device }}" diff --git a/modules/desktop/dms/bar.nix b/modules/desktop/dms/bar.nix index 33ef095..cd80d57 100644 --- a/modules/desktop/dms/bar.nix +++ b/modules/desktop/dms/bar.nix @@ -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"