Simplify the build setup

This commit is contained in:
Mats Rauhala 2022-08-18 11:24:36 +03:00
parent b46cf0bf15
commit e48ec6ce3d
2 changed files with 2 additions and 24 deletions

1
cabal.project Normal file
View File

@ -0,0 +1 @@
packages: */*.cabal

View File

@ -12,7 +12,6 @@
// //
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
# pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; };
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
hp = pkgs.haskellPackages.override ( old: { hp = pkgs.haskellPackages.override ( old: {
overrides = pkgs.lib.composeExtensions ( old.overrides or (_: _: {})) (f: p: { overrides = pkgs.lib.composeExtensions ( old.overrides or (_: _: {})) (f: p: {
@ -21,30 +20,8 @@
} ); } );
in in
rec { rec {
# packages = { inherit (pkgs) build-rauhala-info rauhala-info deploy-rauhala-info; }; packages.rauhala-info = pkgs.callPackage ./rauhala.info { site = hp.build-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
'';
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; defaultPackage = packages.rauhala-info;
defaultApp = packages.build-rauhala-info;
devShell = hp.shellFor { devShell = hp.shellFor {
packages = h: [h.build-rauhala-info]; packages = h: [h.build-rauhala-info];
buildInputs = with pkgs; [ buildInputs = with pkgs; [