rauhala.info/flake.nix

61 lines
2.0 KiB
Nix
Raw Normal View History

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";
};
outputs = { self, nixpkgs, flake-utils }:
2021-11-26 16:52:39 +02:00
{
}
//
flake-utils.lib.eachDefaultSystem (system:
let
2022-08-18 10:57:08 +03:00
# 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 {};
});
} );
2021-11-26 16:52:39 +02:00
in
rec {
2022-08-18 10:57:08 +03:00
# 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 {
2021-11-26 16:52:39 +02:00
drv = packages.build-rauhala-info;
exePath = "/bin/site";
};
2022-08-18 10:57:08 +03:00
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;
2021-11-26 21:47:20 +02:00
exePath = "/bin/deploy-rauhala-info.sh";
};
2021-11-26 16:52:39 +02:00
defaultPackage = packages.rauhala-info;
2022-08-18 10:57:08 +03:00
defaultApp = packages.build-rauhala-info;
2021-11-26 16:52:39 +02:00
devShell = hp.shellFor {
packages = h: [h.build-rauhala-info];
buildInputs = with pkgs; [
ghcid
cabal-install
stylish-haskell
entr
haskell-language-server
2021-11-26 21:47:20 +02:00
ipfs
2021-11-26 16:52:39 +02:00
];
};
});
}