bscpkgs/flake.nix
Aleix Boné c7b5ec13b8 Provide nixpkgs.lib in bscpkgs outputs
Currently, we can use bscpkgs similarly to nixpkgs either through
the flake outputs or with import bscpkgs:

```nix
# currently supported:
bscpkgs.legacyPackages.x86_64-linux.hello
let pkgs = import bscpkgs { system = "x86_64-linux"; }; in pkgs.hello
```
The missing piece is nixpkgs.lib (not pkgs.lib, the system agnostic
one). The workaround is to do bscpkgs.inputs.nixpkgs.lib instead. We can
simplify this by forwarding the lib to our outputs.

This enables us to use bscpkgs as a drop-in
replacing the inputs to our flake from nixpkgs to bscpkgs.
(inputs.nixpkgs.url = "<*BSC*pkgs url>").


Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
Tested-by: Aleix Boné <abonerib@bsc.es>
2025-09-12 14:28:42 +02:00

21 lines
455 B
Nix

{
inputs.nixpkgs.url = "nixpkgs";
outputs = { self, nixpkgs, ...}:
let
pkgs = import nixpkgs {
# For now we only support x86
system = "x86_64-linux";
overlays = [ self.overlays.default ];
};
in
{
bscOverlay = import ./overlay.nix;
overlays.default = self.bscOverlay;
legacyPackages.x86_64-linux = pkgs;
# propagate nixpkgs lib, so we can do bscpkgs.lib
inherit (nixpkgs) lib;
};
}