From e11bde3e40a11d88eba2374ff9363758af050748 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Mon, 7 Oct 2024 13:26:58 +0200 Subject: [PATCH 1/2] nix: move package to nixpkgs --- .github/workflows/nix.yml | 18 ++++++++--------- flake.lock | 35 +++++--------------------------- flake.nix | 42 ++++++++++++++++++--------------------- 3 files changed, 33 insertions(+), 62 deletions(-) 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/flake.lock b/flake.lock index f9d638d..291df13 100644 --- a/flake.lock +++ b/flake.lock @@ -20,41 +20,17 @@ "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" } @@ -62,7 +38,6 @@ "root": { "inputs": { "flake-parts": "flake-parts", - "hpp-util": "hpp-util", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 7a91728..aec2e84 100644 --- a/flake.nix +++ b/flake.nix @@ -1,28 +1,17 @@ { description = "Classes for doing statistics"; - 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-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" @@ -30,18 +19,25 @@ "x86_64-darwin" ]; perSystem = + { pkgs, self', ... }: { - self', - system, - pkgs, - ... - }: - { + devShells.default = pkgs.mkShell { inputsFrom = [ self'.packages.default ]; }; packages = { - inherit (pkgs) cachix; - default = pkgs.callPackage ./. { hpp-util = inputs.hpp-util.packages.${system}.default; }; + default = self'.packages.hpp-statistics; + hpp-statistics = pkgs.hpp-statistics.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 ]; }; }; }; } From 1f66b17e0e8995f25cfef8fe29029a42e96e25d3 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Mon, 7 Oct 2024 13:51:33 +0200 Subject: [PATCH 2/2] git rm default.nix --- default.nix | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 default.nix diff --git a/default.nix b/default.nix deleted file mode 100644 index 7b39185..0000000 --- a/default.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ - lib, - stdenv, - cmake, - hpp-util, -}: - -stdenv.mkDerivation { - pname = "hpp-statistics"; - 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 = [ hpp-util ]; - - doCheck = true; - - meta = { - description = "Classes for doing statistics"; - homepage = "https://github.com/humanoid-path-planner/hpp-statistics"; - license = lib.licenses.bsd2; - maintainers = [ lib.maintainers.nim65s ]; - }; -}