From 85218c54ba81680874189ddaaec8d66769095722 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Fri, 17 Apr 2026 16:23:44 +0200 Subject: [PATCH] nix: switch to flakoboros --- .github/workflows/nix.yml | 18 +- .github/workflows/update-flake-lock.yml | 33 +- flake.lock | 520 +++++++++++++++++++++++- flake.nix | 90 +--- 4 files changed, 559 insertions(+), 102 deletions(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 4c2353332..6eba67060 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -1,5 +1,4 @@ name: "CI - Nix" - on: push: branches: @@ -11,28 +10,25 @@ jobs: nix: runs-on: "${{ matrix.os }}-latest" strategy: + fail-fast: false matrix: - os: [ubuntu, macos] + os: [ubuntu] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: cachix/install-nix-action@v31 - - uses: cachix/cachix-action@v16 + - uses: cachix/cachix-action@v17 with: name: gepetto authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix flake check -L - run: nix build -L - check: if: always() name: check-macos-linux-nix - + runs-on: ubuntu-latest needs: - nix - - runs-on: Ubuntu-latest - steps: - - name: Decide whether the needed jobs succeeded or failed - uses: re-actors/alls-green@release/v1 + - uses: re-actors/alls-green@release/v1 with: jobs: ${{ toJSON(needs) }} diff --git a/.github/workflows/update-flake-lock.yml b/.github/workflows/update-flake-lock.yml index 0baf5314f..4dabd2cbc 100644 --- a/.github/workflows/update-flake-lock.yml +++ b/.github/workflows/update-flake-lock.yml @@ -1,20 +1,31 @@ name: update-flake-lock - on: workflow_dispatch: schedule: - cron: '0 11 11 * *' - jobs: - lockfile: - runs-on: ubuntu-latest + update-flake-inputs: + runs-on: ubuntu-slim + permissions: + contents: write + pull-requests: write steps: + - name: Generate GitHub App Token + id: app-token + uses: actions/create-github-app-token@v3 + with: + app-id: ${{ secrets.GEPETTO_NIX_APP_ID }} + private-key: ${{ secrets.GEPETTO_NIX_APP_PRIVATE_KEY }} - name: Checkout repository - uses: actions/checkout@v4 - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main - - name: Update flake.lock - uses: DeterminateSystems/update-flake-lock@main + uses: actions/checkout@v6 + with: + token: ${{ steps.app-token.outputs.token }} + - name: Setup Nix + uses: cachix/install-nix-action@v31 + - name: Update flake inputs + uses: mic92/update-flake-inputs@v1 with: - pr-labels: "no changelog" - token: ${{ secrets.GH_TOKEN_FOR_UPDATES }} + github-token: ${{ steps.app-token.outputs.token }} + pr-labels: 'no-changelog' + git-author-name: 'hrp2-14' + git-author-email: '40568249+hrp2-14@users.noreply.github.com' diff --git a/flake.lock b/flake.lock index 1d2a14a04..463b8ac4d 100644 --- a/flake.lock +++ b/flake.lock @@ -1,15 +1,31 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1756770412, - "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", + "lastModified": 1775087534, + "narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "4524271976b625a4a605beefd893f270620fd751", + "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b", "type": "github" }, "original": { @@ -18,13 +34,278 @@ "type": "github" } }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "gepetto", + "system-manager", + "userborn", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1768135262, + "narHash": "sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flakoboros": { + "inputs": { + "flake-parts": "flake-parts", + "nix-ros-overlay": "nix-ros-overlay", + "nixpkgs": [ + "gepetto", + "gazebros2nix", + "flakoboros", + "nix-ros-overlay", + "nixpkgs" + ], + "systems": [ + "gepetto", + "gazebros2nix", + "flakoboros", + "nix-ros-overlay", + "flake-utils", + "systems" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1776113076, + "narHash": "sha256-rQp/6mgQc4szevay50RbGXOXwL3xC7oHktywFPrmbAM=", + "owner": "gepetto", + "repo": "flakoboros", + "rev": "07a89fe2a47f2f0364e795cf3e69c045de14a3b2", + "type": "github" + }, + "original": { + "owner": "gepetto", + "repo": "flakoboros", + "type": "github" + } + }, + "gazebros2nix": { + "inputs": { + "flake-parts": [ + "gepetto", + "gazebros2nix", + "flakoboros", + "flake-parts" + ], + "flakoboros": "flakoboros", + "nix-ros-overlay": [ + "gepetto", + "gazebros2nix", + "flakoboros", + "nix-ros-overlay" + ], + "nixpkgs": [ + "gepetto", + "gazebros2nix", + "flakoboros", + "nixpkgs" + ], + "pyproject-build-systems": "pyproject-build-systems", + "pyproject-nix": "pyproject-nix", + "systems": [ + "gepetto", + "gazebros2nix", + "flakoboros", + "systems" + ], + "treefmt-nix": [ + "gepetto", + "gazebros2nix", + "flakoboros", + "treefmt-nix" + ], + "uv2nix": "uv2nix" + }, + "locked": { + "lastModified": 1776113232, + "narHash": "sha256-VtzAiez4xLmUY/TrQ31ECKjnOFDrnorQcu6WfsAF2nk=", + "owner": "gepetto", + "repo": "gazebros2nix", + "rev": "43783392a112e894b857bdb56ede7044437069f4", + "type": "github" + }, + "original": { + "owner": "gepetto", + "repo": "gazebros2nix", + "type": "github" + } + }, + "gepetto": { + "inputs": { + "flake-parts": [ + "gepetto", + "gazebros2nix", + "flake-parts" + ], + "flakoboros": [ + "gepetto", + "gazebros2nix", + "flakoboros" + ], + "gazebros2nix": "gazebros2nix", + "home-manager": "home-manager", + "nix-ros-overlay": [ + "gepetto", + "gazebros2nix", + "nix-ros-overlay" + ], + "nix-system-graphics": "nix-system-graphics", + "nixpkgs": [ + "gepetto", + "gazebros2nix", + "nixpkgs" + ], + "system-manager": "system-manager", + "systems": [ + "gepetto", + "gazebros2nix", + "systems" + ], + "treefmt-nix": [ + "gepetto", + "gazebros2nix", + "treefmt-nix" + ] + }, + "locked": { + "lastModified": 1776439396, + "narHash": "sha256-Xdacv4wZh14NuMq/c+P190u5EqL4cNWMCB09XMfIiQw=", + "owner": "gepetto", + "repo": "nix", + "rev": "027eb2ef12293a4662e7674748fd2e784edb68db", + "type": "github" + }, + "original": { + "owner": "gepetto", + "repo": "nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "gepetto", + "system-manager", + "userborn", + "pre-commit-hooks-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "gepetto", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775425411, + "narHash": "sha256-KY6HsebJHEe5nHOWP7ur09mb0drGxYSzE3rQxy62rJo=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "0d02ec1d0a05f88ef9e74b516842900c41f0f2fe", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-25.11", + "repo": "home-manager", + "type": "github" + } + }, + "nix-ros-overlay": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1775764892, + "narHash": "sha256-l1UbHppd5KaU4K/TQPIXf9wnVifH4Tgrx5z2GFoq/bw=", + "owner": "lopsided98", + "repo": "nix-ros-overlay", + "rev": "0a4e8cf51001d2d1c613f95dadd3853da42c0164", + "type": "github" + }, + "original": { + "owner": "lopsided98", + "ref": "develop", + "repo": "nix-ros-overlay", + "type": "github" + } + }, + "nix-system-graphics": { + "inputs": { + "nixpkgs": [ + "gepetto", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1763296639, + "narHash": "sha256-K9JBscC7ApwCnl0wR0sVkxrKFsoDYVqXN5fOujvyBWA=", + "owner": "soupglasses", + "repo": "nix-system-graphics", + "rev": "ac37f0f3ec0cb15d63a520918433c794d01d9dac", + "type": "github" + }, + "original": { + "owner": "soupglasses", + "repo": "nix-system-graphics", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1758690382, - "narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=", + "lastModified": 1771369470, + "narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e643668fd71b949c53f8626614b21ff71a07379d", + "rev": "0182a361324364ae3f436a63005877674cf45efb", "type": "github" }, "original": { @@ -36,11 +317,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1754788789, - "narHash": "sha256-x2rJ+Ovzq0sCMpgfgGaaqgBSwY+LST+WbZ6TytnT9Rk=", + "lastModified": 1774748309, + "narHash": "sha256-+U7gF3qxzwD5TZuANzZPeJTZRHS29OFQgkQ2kiTJBIQ=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "a73b9c743612e4244d865a2fdee11865283c04e6", + "rev": "333c4e0545a6da976206c74db8773a1645b5870a", "type": "github" }, "original": { @@ -49,10 +330,227 @@ "type": "github" } }, + "pre-commit-hooks-nix": { + "inputs": { + "flake-compat": [ + "gepetto", + "system-manager", + "userborn", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "gepetto", + "system-manager", + "userborn", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769069492, + "narHash": "sha256-Efs3VUPelRduf3PpfPP2ovEB4CXT7vHf8W+xc49RL/U=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "a1ef738813b15cf8ec759bdff5761b027e3e1d23", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "pyproject-build-systems": { + "inputs": { + "nixpkgs": [ + "gepetto", + "gazebros2nix", + "nixpkgs" + ], + "pyproject-nix": [ + "gepetto", + "gazebros2nix", + "pyproject-nix" + ], + "uv2nix": [ + "gepetto", + "gazebros2nix", + "uv2nix" + ] + }, + "locked": { + "lastModified": 1773870109, + "narHash": "sha256-ZoTdqZP03DcdoyxvpFHCAek4bkPUTUPUF3oCCgc3dP4=", + "owner": "pyproject-nix", + "repo": "build-system-pkgs", + "rev": "b6e74f433b02fa4b8a7965ee24680f4867e2926f", + "type": "github" + }, + "original": { + "owner": "pyproject-nix", + "repo": "build-system-pkgs", + "type": "github" + } + }, + "pyproject-nix": { + "inputs": { + "nixpkgs": [ + "gepetto", + "gazebros2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775439158, + "narHash": "sha256-NHY9SJNU019n+8NCabBDtmuzRFeE2gZlYKHowp9bV24=", + "owner": "pyproject-nix", + "repo": "pyproject.nix", + "rev": "fb6b728260f3f32761367e9fd1e1a25b4245bcd0", + "type": "github" + }, + "original": { + "owner": "pyproject-nix", + "repo": "pyproject.nix", + "type": "github" + } + }, "root": { "inputs": { - "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs" + "gepetto": "gepetto" + } + }, + "system-manager": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": [ + "gepetto", + "nixpkgs" + ], + "userborn": "userborn" + }, + "locked": { + "lastModified": 1776108115, + "narHash": "sha256-QDa17vvigUyEAk/kTkDHOBFqmbWIe7aZDCjSgl9BG2c=", + "owner": "numtide", + "repo": "system-manager", + "rev": "e028253c2f1ea1b3eba2ce84ae8f770d823fe4ac", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "system-manager", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "gepetto", + "gazebros2nix", + "flakoboros", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775636079, + "narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "userborn": { + "inputs": { + "flake-compat": [ + "gepetto", + "system-manager", + "flake-compat" + ], + "flake-parts": "flake-parts_2", + "nixpkgs": [ + "gepetto", + "system-manager", + "nixpkgs" + ], + "pre-commit-hooks-nix": "pre-commit-hooks-nix", + "systems": "systems_2" + }, + "locked": { + "lastModified": 1770377964, + "narHash": "sha256-q2pnlX2IW0kg80GLFnwWd/GigIpkuZnyKPLhrgJql3E=", + "owner": "jfroche", + "repo": "userborn", + "rev": "55c2cd7952c207a62736a5bbd9499ea73da18d24", + "type": "github" + }, + "original": { + "owner": "jfroche", + "ref": "system-manager", + "repo": "userborn", + "type": "github" + } + }, + "uv2nix": { + "inputs": { + "nixpkgs": [ + "gepetto", + "gazebros2nix", + "nixpkgs" + ], + "pyproject-nix": [ + "gepetto", + "gazebros2nix", + "pyproject-nix" + ] + }, + "locked": { + "lastModified": 1775706324, + "narHash": "sha256-BTb4sydzX2B5/oNbvCdQFeSbk97xEnbb8bk84CiKCOs=", + "owner": "pyproject-nix", + "repo": "uv2nix", + "rev": "5707df99097375896a3dda811d492a2fabe63500", + "type": "github" + }, + "original": { + "owner": "pyproject-nix", + "repo": "uv2nix", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 43929db52..c6fc54c96 100644 --- a/flake.nix +++ b/flake.nix @@ -1,78 +1,30 @@ { description = "Versatile and efficient framework for constrained trajectory optimization"; - inputs = { - flake-parts.url = "github:hercules-ci/flake-parts"; - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - }; + inputs.gepetto.url = "github:gepetto/nix"; outputs = inputs: - inputs.flake-parts.lib.mkFlake { inherit inputs; } { - systems = inputs.nixpkgs.lib.systems.flakeExposed; - perSystem = - { - lib, - pkgs, - self', - ... - }: - { - apps.default = { - type = "app"; - program = pkgs.python3.withPackages (_: [ self'.packages.default ]); - }; - packages = { - default = self'.packages.py-aligator; - aligator = pkgs.aligator.overrideAttrs (super: { - src = lib.fileset.toSource { - root = ./.; - fileset = lib.fileset.unions [ - ./bench - ./bindings - ./CMakeLists.txt - ./extra-python-macros.cmake - ./doc - ./examples - ./include - ./package.xml - ./src - ./tests - ]; - }; - buildInputs = (super.buildInputs or []) ++ [ - pkgs.mimalloc - ]; - checkInputs = super.checkInputs ++ [ - pkgs.catch2_3 - ]; - }); - py-aligator = pkgs.python3Packages.toPythonModule (self'.packages.aligator.overrideAttrs (super:{ - cmakeFlags = super.cmakeFlags ++ [ - (lib.cmakeBool "BUILD_PYTHON_INTERFACE" true) - (lib.cmakeBool "BUILD_STANDALONE_PYTHON_INTERFACE" true) - ]; - nativeBuildInputs = super.nativeBuildInputs ++ [ - pkgs.python3Packages.python - ]; - propagatedBuildInputs = super.propagatedBuildInputs ++ [ - self'.packages.aligator - pkgs.python3Packages.crocoddyl - pkgs.python3Packages.pinocchio - ]; - nativeCheckInputs = [ - pkgs.ctestCheckHook - pkgs.python3Packages.pythonImportsCheckHook - ]; - checkInputs = super.checkInputs++ [ - pkgs.python3Packages.matplotlib - pkgs.python3Packages.pytest - ]; - disabledTests = lib.optionals pkgs.stdenv.hostPlatform.isDarwin [ - "aligator-test-py-rollout" - ]; - })); + inputs.gepetto.lib.mkFlakoboros inputs ( + { lib, ... }: + { + overrideAttrs.aligator = { + src = lib.fileset.toSource { + root = ./.; + fileset = lib.fileset.unions [ + ./bench + ./bindings + ./CMakeLists.txt + ./extra-python-macros.cmake + ./doc + ./examples + ./include + ./package.xml + ./src + ./tests + ]; }; }; - }; + } + ); }