Less overlays

This commit is contained in:
Mats Rauhala 2022-08-18 10:57:08 +03:00
parent 3bc2738ef6
commit b46cf0bf15

View File

@ -8,45 +8,43 @@
outputs = { self, nixpkgs, flake-utils }:
{
overlay = final: prev: {
deploy-rauhala-info = with final; runCommand "deploy-rauhala-info.sh" { inherit bash ipfs; }
}
//
flake-utils.lib.eachDefaultSystem (system:
let
# pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; };
pkgs = nixpkgs.legacyPackages.${system};
hp = pkgs.haskellPackages.override ( old: {
overrides = pkgs.lib.composeExtensions ( old.overrides or (_: _: {})) (f: p: {
build-rauhala-info = f.callPackage ./site {};
});
} );
in
rec {
# packages = { inherit (pkgs) build-rauhala-info rauhala-info deploy-rauhala-info; };
packages.build-rauhala-info = pkgs.runCommand "site" { buildInputs = [pkgs.makeWrapper]; }
''
mkdir -p $out/bin/
cp ${hp.build-rauhala-info}/bin/site $out/bin/
wrapProgram $out/bin/site --prefix PATH : ${ pkgs.lib.makeBinPath [ pkgs.ipfs ] }
'';
apps.build-rauhala-info = flake-utils.lib.mkApp {
drv = packages.build-rauhala-info;
exePath = "/bin/site";
};
packages.deploy-rauhala-info = with pkgs; runCommand "deploy-rauhala-info.sh" { inherit bash ipfs; }
''
mkdir -p $out/bin/
substituteAll ${./support/deploy-rauhala-info.sh} $out/bin/deploy-rauhala-info.sh
chmod u+x $out/bin/deploy-rauhala-info.sh
'';
build-rauhala-info = final.runCommand "site" { buildInputs = [final.makeWrapper]; }
''
mkdir -p $out/bin/
cp ${final.haskellPackages.build-rauhala-info}/bin/site $out/bin/
wrapProgram $out/bin/site --prefix PATH : ${ final.lib.makeBinPath [ final.ipfs ] }
'';
rauhala-info = final.callPackage ./rauhala.info { site = final.build-rauhala-info; };
haskellPackages = prev.haskellPackages.override ( old: {
overrides = final.lib.composeExtensions ( old.overrides or (_: _: {})) (f: p: {
build-rauhala-info = f.callPackage ./site {};
});
} );
};
}
//
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; };
hp = pkgs.haskellPackages;
in
rec {
packages = { inherit (pkgs) build-rauhala-info rauhala-info deploy-rauhala-info; };
applications.build-rauhala-info = flake-utils.lib.mkApp {
drv = packages.build-rauhala-info;
exePath = "/bin/site";
};
applications.deploy-rauhala-info = flake-utils.lib.mkApp {
drv = packages.deploy-rauhala-info;
packages.rauhala-info = pkgs.callPackage ./rauhala.info { site = packages.build-rauhala-info; };
apps.deploy-rauhala-info = flake-utils.lib.mkApp {
drv = pkgs.deploy-rauhala-info;
exePath = "/bin/deploy-rauhala-info.sh";
};
defaultPackage = packages.rauhala-info;
defaultApp = applications.build-rauhala-info;
defaultApp = packages.build-rauhala-info;
devShell = hp.shellFor {
packages = h: [h.build-rauhala-info];
buildInputs = with pkgs; [