1
0
Fork 0
mirror of https://github.com/lopsided98/nix-ros-overlay.git synced 2025-07-13 21:50:38 +03:00
nix-ros-overlay/release.nix
Michal Sojka 2dd34bfa6f release.nix: Remove few top-level attributes preventing evaluation in Hydra
While doing that, refactor the code to have simpler expressions.
2024-11-20 20:13:44 -05:00

25 lines
816 B
Nix

let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
lockedNixpkgs = builtins.fetchTarball {
url = "https://github.com/lopsided98/nixpkgs/archive/${lock.nodes.nixpkgs.locked.rev}.tar.gz";
sha256 = lock.nodes.nixpkgs.locked.narHash;
};
in
{ nixpkgs ? lockedNixpkgs, nix-ros-overlay ? ./., distro ? null, system ? builtins.currentSystem }:
let
rosPackages = (import nix-ros-overlay { inherit nixpkgs system; }).rosPackages;
releaseDistros = builtins.mapAttrs (_: a: removeAttrs a [
"lib"
"python"
"python3"
"python2"
"pythonPackages"
"python2Packages"
"python3Packages"
"boost"
]) rosPackages;
releasePackages = removeAttrs releaseDistros [
"lib"
"mkRosDistroOverlay"
];
in if distro == null then releasePackages else releasePackages.${distro}