2021-11-26 16:52:39 +02:00
|
|
|
{
|
|
|
|
description = "rauhala.info";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
|
2022-08-18 10:37:28 +03:00
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
2021-11-26 16:52:39 +02:00
|
|
|
{
|
|
|
|
overlay = final: prev: {
|
2021-11-26 21:47:20 +02:00
|
|
|
deploy-rauhala-info = with final; 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 ] }
|
|
|
|
'';
|
2021-11-26 16:52:39 +02:00
|
|
|
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 {
|
2021-11-26 21:47:20 +02:00
|
|
|
packages = { inherit (pkgs) build-rauhala-info rauhala-info deploy-rauhala-info; };
|
2021-11-26 16:52:39 +02:00
|
|
|
applications.build-rauhala-info = flake-utils.lib.mkApp {
|
|
|
|
drv = packages.build-rauhala-info;
|
|
|
|
exePath = "/bin/site";
|
|
|
|
};
|
2021-11-26 21:47:20 +02:00
|
|
|
applications.deploy-rauhala-info = flake-utils.lib.mkApp {
|
|
|
|
drv = packages.deploy-rauhala-info;
|
|
|
|
exePath = "/bin/deploy-rauhala-info.sh";
|
|
|
|
};
|
2021-11-26 16:52:39 +02:00
|
|
|
defaultPackage = packages.rauhala-info;
|
|
|
|
defaultApp = applications.build-rauhala-info;
|
|
|
|
devShell = hp.shellFor {
|
|
|
|
packages = h: [h.build-rauhala-info];
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
ghcid
|
|
|
|
cabal-install
|
|
|
|
stylish-haskell
|
|
|
|
entr
|
2022-08-18 10:37:28 +03:00
|
|
|
haskell-language-server
|
2021-11-26 21:47:20 +02:00
|
|
|
ipfs
|
2021-11-26 16:52:39 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|