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 2a86c27
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
3 changes: 0 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

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

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
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
8 changes: 3 additions & 5 deletions tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

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

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 2a86c27

Please sign in to comment.