Skip to content

Commit

Permalink
build: tidy nix files
Browse files Browse the repository at this point in the history
Removes unnesercary nixpkgs overlays and version number.
  • Loading branch information
headblockhead committed Oct 13, 2024
1 parent 977978b commit 5c876c6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 74 deletions.
5 changes: 1 addition & 4 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
}:

stdenv.mkDerivation {
pname = "squirrel";
version = "0.0.0";

name = "squirrel";
src = ./.;

nativeBuildInputs = [ cmake gnumake ];
Expand All @@ -31,7 +29,6 @@ stdenv.mkDerivation {
meta = with lib; {
homepage = "https://github.com/headblockhead/squirrel";
description = "Keyboard firmware library inspired by QMK.";
licencse = licenses.mit;
platforms = with platforms; linux;
};
}
Expand Down
53 changes: 1 addition & 52 deletions flake.lock

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

15 changes: 3 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,13 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
xc.url = "github:joerdav/xc";
};
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
(final: prev: {
xc = inputs.xc.packages.x86_64-linux.xc;
picotool = pkgs.callPackage ./picotool.nix {
pico-sdk = pkgs.callPackage ./pico-sdk.nix { };
};
pico-sdk = pkgs.callPackage ./pico-sdk.nix { };
})
];
};
in
{
Expand All @@ -36,8 +26,9 @@
cacert
];
};
# The firmware (nix build)
# The library (nix build)
packages.squirrel = pkgs.callPackage ./default.nix { };
# The tests (nix flake check)
checks.squirrel-tests = pkgs.callPackage ./tests.nix { };
}
);
Expand Down
10 changes: 4 additions & 6 deletions tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
}:

stdenv.mkDerivation {
pname = "squirrel-tests";
version = "0.0.0";

name = "squirrel-tests";
src = ./.;

nativeBuildInputs = [ cmake gnumake gcovr ];
Expand All @@ -22,13 +20,13 @@ stdenv.mkDerivation {
];

installPhase = ''
ctest -T Test -T Coverage --timeout 60 # tests should never take longer than 60 seconds each to complete.
cp -r . $out'';
mkdir -p $out # Output directory must be created for the build to succeed
ctest -T Test -T Coverage --timeout 60
'';

meta = with lib; {
homepage = "https://github.com/headblockhead/squirrel";
description = "Keyboard firmware library inspired by QMK.";
licencse = licenses.mit;
platforms = with platforms; linux;
};
}
Expand Down

0 comments on commit 5c876c6

Please sign in to comment.