Archived
1
0
forked from rarias/bscpkgs

1 Commits

Author SHA1 Message Date
2a7f6618d2 Expose our packages in flake packages output 2025-09-16 14:46:19 +02:00
2 changed files with 27 additions and 17 deletions

View File

@@ -2,25 +2,37 @@
inputs.nixpkgs.url = "nixpkgs"; inputs.nixpkgs.url = "nixpkgs";
outputs = { self, nixpkgs, ...}: outputs = { self, nixpkgs, ...}:
let let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
# For now we only support x86 # For now we only support x86
system = "x86_64-linux"; overlays = [ self.overlays.default ];
pkgs = import nixpkgs { };
inherit system; in
overlays = [ self.overlays.default ];
};
in
{ {
bscOverlay = import ./overlay.nix; bscOverlay = import ./overlay.nix;
overlays.default = self.bscOverlay; overlays.default = self.bscOverlay;
# full nixpkgs with our overlay applied
legacyPackages.${system} = pkgs;
hydraJobs = {
inherit (self.legacyPackages.${system}.bsc-ci) test pkgs;
};
# propagate nixpkgs lib, so we can do bscpkgs.lib # propagate nixpkgs lib, so we can do bscpkgs.lib
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
# full nixpkgs with our overlay applied
legacyPackages.${system} = pkgs;
# packages added by our overlay
packages.${system} =
let
inherit (builtins) attrNames removeAttrs;
inherit (nixpkgs.lib) flip filterAttrs getAttrs pipe isDerivation;
in
# extract the names of the packages from the overlay, then get the
# actual packages from the full package set with the overlay applied
pipe (self.overlays.default null { inherit (nixpkgs) lib; } ) [
attrNames
(flip getAttrs pkgs)
(flip removeAttrs [ "bsc" ])
(filterAttrs (_: isDerivation))
];
}; };
} }

View File

@@ -88,9 +88,7 @@ in bscPkgs // {
}; };
}; };
pkgs = filterAttrs (_: isDerivation) bscPkgs; pkgs = final.runCommand "ci-pkgs" { }
pkgsList = final.runCommand "ci-pkgs" { }
"printf '%s\n' ${toString (collect isDerivation bscPkgs)} > $out"; "printf '%s\n' ${toString (collect isDerivation bscPkgs)} > $out";
tests = final.runCommand "ci-tests" { } tests = final.runCommand "ci-tests" { }
@@ -98,7 +96,7 @@ in bscPkgs // {
all = final.runCommand "ci-all" { } all = final.runCommand "ci-all" { }
'' ''
deps="${toString [ final.bsc-ci.pkgsList final.bsc-ci.tests ]}" deps="${toString [ final.bsc-ci.pkgs final.bsc-ci.tests ]}"
cat $deps cat $deps
printf '%s\n' $deps > $out printf '%s\n' $deps > $out
''; '';