diff --git a/default.nix b/default.nix index ec1e0c6..9859d16 100644 --- a/default.nix +++ b/default.nix @@ -7,8 +7,6 @@ stdenv.mkDerivation { pname = "squirrel"; - version = "0.0.0"; - src = ./.; nativeBuildInputs = [ cmake gnumake ]; @@ -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; }; } diff --git a/flake.nix b/flake.nix index a665722..fce6bf2 100644 --- a/flake.nix +++ b/flake.nix @@ -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 { @@ -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 { }; } ); diff --git a/tests.nix b/tests.nix index 920b948..a2fc0db 100644 --- a/tests.nix +++ b/tests.nix @@ -8,8 +8,6 @@ stdenv.mkDerivation { pname = "squirrel-tests"; - version = "0.0.0"; - src = ./.; nativeBuildInputs = [ cmake gnumake gcovr ]; @@ -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; }; }