Skip to content

Commit

Permalink
draw layout
Browse files Browse the repository at this point in the history
fix

re-organize
  • Loading branch information
juliamertz committed Oct 11, 2024
1 parent ed9543e commit fb37876
Show file tree
Hide file tree
Showing 6 changed files with 1,686 additions and 6 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/draw.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Draw keymaps
on:
workflow_dispatch:
push:
paths:
- "**.lock"
- "glove80.keymap"

jobs:
draw:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Set to 2 if amending, or 1 if creating a new commit
fetch-depth: 1
submodules: recursive

- name: Install nix
uses: cachix/install-nix-action@v25
- name: Setup nix cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Draw keymaps
run: |
nix build .#visual
cp result/layout.svg img/layout.svg
- name: Commit changes
id: commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[Draw] ${{ github.event.head_commit.message || '(Manually triggered)' }}"
file_pattern: img/**

- name: Summarize
run: |
sha="${{ steps.commit.outputs.commit_hash }}"
url="${{ github.server_url }}/${{ github.repository }}/commit/$sha"
echo "## Summary" >> $GITHUB_STEP_SUMMARY
if [[ -z "$sha" ]]; then
echo "Nothing to commit!" >> $GITHUB_STEP_SUMMARY
else
echo "[\`${sha:0:6}\`]($url) pushed to \`${{ github.ref_name }}\`." >> $GITHUB_STEP_SUMMARY
fi
echo >> $GITHUB_STEP_SUMMARY
133 changes: 132 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
url = "github:juliamertz/glove80-firmware-updater";
inputs.nixpkgs.follows = "nixpkgs";
};

keymap-drawer = {
url = "github:caksoylar/keymap-drawer";
flake = false;
};
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs =
Expand All @@ -35,13 +44,14 @@
...
}:
let
inherit (pkgs) callPackage;
inherit (pkgs) callPackage writeShellScriptBin;
inherit (config) packages;
firmwareLoader = firmware-loader.packages.${system}.default;
in
{
packages.firmware = callPackage ./firmware.nix { inherit inputs; };
packages.flash = pkgs.writeShellScriptBin "flash" ''
packages.firmware = callPackage ./packages/firmware.nix { inherit inputs; };
packages.visual = callPackage ./packages/visual.nix { inherit inputs; };
packages.flash = writeShellScriptBin "flash" ''
${lib.getExe firmwareLoader} --file ${packages.firmware}/glove80.uf2
'';

Expand Down
Loading

0 comments on commit fb37876

Please sign in to comment.