diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 9488350..cc47550 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -1,6 +1,7 @@ -name: "Nix CI" +name: "CI - Nix" -on: [pull_request, push] +on: + push: jobs: tests: @@ -11,10 +12,9 @@ jobs: os: [ubuntu] steps: - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - - run: nix --accept-flake-config build -L - - run: nix --accept-flake-config run .#cachix push gepetto $(readlink result) - if: github.repository_owner == 'humanoid-path-planner' - env: - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + - uses: cachix/install-nix-action@v27 + - uses: cachix/cachix-action@v15 + with: + name: gepetto + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix build -L diff --git a/default.nix b/default.nix deleted file mode 100644 index daae89a..0000000 --- a/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - lib, - stdenv, - cmake, - example-robot-data, - hpp-environments, - hpp-util, - pinocchio, -}: - -stdenv.mkDerivation { - pname = "hpp-pinocchio"; - version = "5.0.0"; - - src = lib.fileset.toSource { - root = ./.; - fileset = lib.fileset.unions [ - ./CMakeLists.txt - ./doc - ./include - ./package.xml - ./src - ./tests - ]; - }; - - strictDeps = true; - - nativeBuildInputs = [ cmake ]; - propagatedBuildInputs = [ - example-robot-data - hpp-environments - hpp-util - pinocchio - ]; - - doCheck = true; - - meta = { - description = "Wrapping of Pinocchio library into HPP"; - homepage = "https://github.com/humanoid-path-planner/hpp-pinocchio"; - license = lib.licenses.bsd2; - maintainers = [ lib.maintainers.nim65s ]; - }; -} diff --git a/flake.lock b/flake.lock index 91fbf65..291df13 100644 --- a/flake.lock +++ b/flake.lock @@ -20,64 +20,17 @@ "type": "github" } }, - "hpp-environments": { - "inputs": { - "flake-parts": [ - "flake-parts" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1719769478, - "narHash": "sha256-ajfsBa57ORnkhtLgolKT+GQNQJ7IQWwDGsadidrm9sY=", - "owner": "humanoid-path-planner", - "repo": "hpp-environments", - "rev": "f603465de459b8b830043ea22a1402f9d5e006bf", - "type": "github" - }, - "original": { - "owner": "humanoid-path-planner", - "repo": "hpp-environments", - "type": "github" - } - }, - "hpp-util": { - "inputs": { - "flake-parts": [ - "flake-parts" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1719769497, - "narHash": "sha256-cYONa7WTagNZCITtocdII+WcfdzZnvznFUyb7YLodIw=", - "owner": "humanoid-path-planner", - "repo": "hpp-util", - "rev": "8811dcadeec6b1e52b4cd59da39ad2e170f17ad7", - "type": "github" - }, - "original": { - "owner": "humanoid-path-planner", - "repo": "hpp-util", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1719674427, - "narHash": "sha256-z2hCpVyfnmYTA5iabf1SW4peFV9itE1JJcXNBKIFkDg=", - "owner": "nim65s", + "lastModified": 1727174734, + "narHash": "sha256-xa3TynMF5vaWonmTOg/Ejc1Fmo0GkQnCaVRVkBc3z2I=", + "owner": "gepetto", "repo": "nixpkgs", - "rev": "b81610d293fac26c2ec6a81718a979bc25f8c155", + "rev": "0ad139a0e4372abc12320c8c92ee90e0e5e296e1", "type": "github" }, "original": { - "owner": "nim65s", - "ref": "gepetto", + "owner": "gepetto", "repo": "nixpkgs", "type": "github" } @@ -85,8 +38,6 @@ "root": { "inputs": { "flake-parts": "flake-parts", - "hpp-environments": "hpp-environments", - "hpp-util": "hpp-util", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index f174c8a..3326d48 100644 --- a/flake.nix +++ b/flake.nix @@ -1,33 +1,17 @@ { description = "Wrapping of Pinocchio library into HPP"; - nixConfig = { - extra-substituters = [ "https://gepetto.cachix.org" ]; - extra-trusted-public-keys = [ "gepetto.cachix.org-1:toswMl31VewC0jGkN6+gOelO2Yom0SOHzPwJMY2XiDY=" ]; - }; - inputs = { - nixpkgs.url = "github:nim65s/nixpkgs/gepetto"; + nixpkgs.url = "github:gepetto/nixpkgs"; flake-parts = { url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; }; - hpp-environments = { - url = "github:humanoid-path-planner/hpp-environments"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.flake-parts.follows = "flake-parts"; - }; - hpp-util = { - url = "github:humanoid-path-planner/hpp-util"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.flake-parts.follows = "flake-parts"; - }; }; outputs = - inputs@{ flake-parts, ... }: - flake-parts.lib.mkFlake { inherit inputs; } { - imports = [ ]; + inputs: + inputs.flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "x86_64-linux" "aarch64-linux" @@ -35,21 +19,25 @@ "x86_64-darwin" ]; perSystem = + { pkgs, self', ... }: { - self', - pkgs, - system, - ... - }: - { + devShells.default = pkgs.mkShell { inputsFrom = [ self'.packages.default ]; }; packages = { - inherit (pkgs) cachix; - default = pkgs.callPackage ./. { - hpp-environments = inputs.hpp-environments.packages.${system}.default; - hpp-util = inputs.hpp-util.packages.${system}.default; - }; + default = self'.packages.hpp-pinocchio; + hpp-pinocchio = pkgs.hpp-pinocchio.overrideAttrs (_: { + src = pkgs.lib.fileset.toSource { + root = ./.; + fileset = pkgs.lib.fileset.unions [ + ./CMakeLists.txt + ./doc + ./include + ./package.xml + ./src + ./tests + ]; + }; + }); }; - devShells.default = pkgs.mkShell { inputsFrom = [ self'.packages.default ]; }; }; }; }