chore: improve flake & ci (#28)
All checks were successful
Publish nightly release / build (push) Successful in 1m15s

Reviewed-on: #28
This commit is contained in:
Naxdy 2024-10-27 20:49:20 +00:00
parent 8f8d47704d
commit 6475e844a9
Signed by: git.naxdy.org
GPG key ID: 05379DCFAACD8AC2
3 changed files with 28 additions and 26 deletions

View file

@ -10,8 +10,6 @@ jobs:
check:
runs-on: nix-flakes
steps:
- uses: actions/checkout@v4
@ -25,4 +23,4 @@ jobs:
- name: Run Clippy
run: |
nix build .#clippy --print-build-logs -j auto
nix flake check . --print-build-logs -j auto

View file

@ -21,9 +21,9 @@ jobs:
cache: "${{ vars.PUBLIC_BINARY_CACHE_NAME }}"
- uses: actions/checkout@v4
- name: Run Clippy
- name: Run flake checks
run: |
nix build .#clippy --print-build-logs -j auto
nix flake check . --print-build-logs -j auto
- name: Build firmware image
run: |
@ -38,7 +38,7 @@ jobs:
git tag nightly -m "Nightly Release"
git checkout nightly
git push --set-upstream origin nightly --force
- name: Publish nightly release
uses: https://gitea.com/actions/gitea-release-action@v1.3.0
with:

View file

@ -47,33 +47,37 @@
CARGO_BUILD_TARGET = "thumbv6m-none-eabi";
in
{
packages.default = self.packages.${system}.naxgcc-fw-uf2;
packages = {
default = self.packages.${system}.naxgcc-fw-uf2;
packages.naxgcc-fw-uf2 = pkgs.runCommandLocal "${self.packages.${system}.naxgcc-fw.pname}-uf2-${self.packages.${system}.naxgcc-fw.version}" { } ''
mkdir -p $out/bin
${pkgs.elf2uf2-rs}/bin/elf2uf2-rs ${self.packages.${system}.naxgcc-fw}/bin/${self.packages.${system}.naxgcc-fw.pname} $out/bin/${self.packages.${system}.naxgcc-fw.pname}.uf2
'';
naxgcc-fw-uf2 = pkgs.runCommandLocal "${self.packages.${system}.naxgcc-fw.pname}-uf2-${self.packages.${system}.naxgcc-fw.version}" { } ''
mkdir -p $out/bin
${pkgs.elf2uf2-rs}/bin/elf2uf2-rs ${self.packages.${system}.naxgcc-fw}/bin/${self.packages.${system}.naxgcc-fw.pname} $out/bin/${self.packages.${system}.naxgcc-fw.pname}.uf2
'';
packages.naxgcc-fw = pkgs.callPackage
({ mode ? "build" }: naersk_lib.buildPackage {
pname = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.name;
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;
naxgcc-fw = pkgs.callPackage
({ mode ? "build" }: naersk_lib.buildPackage {
pname = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.name;
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;
inherit mode;
inherit mode;
src = self;
src = self;
cargoBuildOptions = _orig: _orig ++ [
"--target=${CARGO_BUILD_TARGET}"
];
cargoBuildOptions = _orig: _orig ++ [
"--target=${CARGO_BUILD_TARGET}"
];
# if a tree falls in the forest and no one is around to hear it, does it make a sound?
DEFMT_LOG = "off";
})
{ };
# if a tree falls in the forest and no one is around to hear it, does it make a sound?
DEFMT_LOG = "off";
})
{ };
};
packages.clippy = self.packages.${system}.naxgcc-fw.override {
mode = "clippy";
checks = {
clippy = self.packages.${system}.naxgcc-fw.override {
mode = "clippy";
};
};
devShells.default = pkgs.mkShell {