diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..37366c2 --- /dev/null +++ b/default.nix @@ -0,0 +1,50 @@ +{ + lib, + cmake, + example-robot-data, + jrl-cmakemodules, + python3Packages, +}: + +python3Packages.buildPythonPackage { + pname = "hpp-environments"; + version = "5.0.0"; + pyproject = false; + + src = lib.fileset.toSource { + root = ./.; + fileset = lib.fileset.unions [ + ./CMakeLists.txt + ./examples + ./meshes + ./package.xml + ./src + ./srdf + ./texture + ./urdf + ]; + }; + + strictDeps = true; + + nativeBuildInputs = [ cmake ]; + propagatedBuildInputs = [ + jrl-cmakemodules + python3Packages.boost + python3Packages.eigenpy + python3Packages.pinocchio + python3Packages.example-robot-data + ]; + + doCheck = true; + + # TODO: this requires hpp-corbaserver, which depends on hpp-environments… + #pythonImportsCheck = [ "hpp.environments" ]; + + meta = { + description = "Environments and robot descriptions for HPP"; + homepage = "https://github.com/humanoid-path-planner/hpp-environments"; + license = lib.licenses.bsd2; + maintainers = [ lib.maintainers.nim65s ]; + }; +} diff --git a/flake.lock b/flake.lock index 5ac9fdc..406cf66 100644 --- a/flake.lock +++ b/flake.lock @@ -2,7 +2,9 @@ "nodes": { "flake-parts": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib" + "nixpkgs-lib": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1717285511, @@ -34,18 +36,6 @@ "type": "github" } }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1717284937, - "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" - } - }, "root": { "inputs": { "flake-parts": "flake-parts", diff --git a/flake.nix b/flake.nix index 94c479c..b83b74b 100644 --- a/flake.nix +++ b/flake.nix @@ -1,21 +1,23 @@ { - description = "Description for the project"; + description = "Environments and robot descriptions for HPP"; + + nixConfig = { + extra-substituters = [ "https://gepetto.cachix.org" ]; + extra-trusted-public-keys = [ "gepetto.cachix.org-1:toswMl31VewC0jGkN6+gOelO2Yom0SOHzPwJMY2XiDY=" ]; + }; inputs = { - flake-parts.url = "github:hercules-ci/flake-parts"; nixpkgs.url = "github:nim65s/nixpkgs/gepetto"; + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; }; outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { - imports = [ - # To import a flake module - # 1. Add foo to inputs - # 2. Add foo as a parameter to the outputs function - # 3. Add here: foo.flakeModule - - ]; + imports = [ ]; systems = [ "x86_64-linux" "aarch64-linux" @@ -23,27 +25,10 @@ "x86_64-darwin" ]; perSystem = + { self', pkgs, ... }: { - config, - self', - inputs', - pkgs, - system, - ... - }: - { - # Per-system attributes can be defined here. The self' and inputs' - # module parameters provide easy access to attributes of the same - # system. - - # Equivalent to inputs'.nixpkgs.legacyPackages.hello; - packages.default = pkgs.hello; + packages.default = pkgs.callPackage ./. { }; + devShells.default = pkgs.mkShell { inputsFrom = [ self'.packages.default ]; }; }; - flake = { - # The usual flake attributes can be defined here, including system- - # agnostic ones like nixosModule and system-enumerating ones, although - # those are more easily expressed in perSystem. - - }; }; }