2021-06-13 06:02:29 +02:00
|
|
|
{
|
2023-03-11 16:51:23 +01:00
|
|
|
inputs.nixpkgs.url = "nixpkgs/nixos-22.11";
|
2021-06-13 06:02:29 +02:00
|
|
|
|
2023-03-11 16:51:23 +01:00
|
|
|
outputs = { self, nixpkgs }: let
|
2022-11-01 17:51:36 +01:00
|
|
|
system = "x86_64-linux";
|
2023-03-11 16:51:23 +01:00
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
2022-11-05 19:19:55 +01:00
|
|
|
in {
|
2023-03-11 16:51:23 +01:00
|
|
|
packages.${system} = {
|
|
|
|
static-site-generator = pkgs.haskellPackages.developPackage {
|
|
|
|
name = "static-site-generator";
|
|
|
|
root = ./.;
|
|
|
|
};
|
2022-11-01 17:51:36 +01:00
|
|
|
|
2023-03-11 16:51:23 +01:00
|
|
|
default = self.packages.${system}.website;
|
|
|
|
website = pkgs.stdenvNoCC.mkDerivation {
|
|
|
|
name = "website";
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
self.packages.${system}.static-site-generator
|
|
|
|
graphviz
|
|
|
|
];
|
|
|
|
|
|
|
|
src = pkgs.nix-gitignore.gitignoreSourcePure [
|
|
|
|
".gitignore"
|
|
|
|
".git"
|
|
|
|
".github"
|
|
|
|
] ./.;
|
|
|
|
|
|
|
|
buildPhase = ''
|
2023-03-12 22:26:50 +01:00
|
|
|
static-site-generator build --verbose
|
2023-03-11 16:51:23 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
cp -r dist "$out"
|
|
|
|
'';
|
|
|
|
};
|
2022-11-01 17:51:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
apps.${system} = {
|
2023-03-11 16:51:23 +01:00
|
|
|
default = self.apps.${system}.watch-hakyll-site;
|
|
|
|
watch-hakyll-site = let
|
|
|
|
ssg = self.packages.${system}.static-site-generator;
|
|
|
|
drv = pkgs.writeScriptBin "watch-hakyll-site" ''
|
|
|
|
${ssg}/bin/static-site-generator watch
|
|
|
|
'';
|
2022-11-01 17:51:36 +01:00
|
|
|
in {
|
|
|
|
type = "app";
|
2023-03-11 16:51:23 +01:00
|
|
|
program = "${drv}/bin/watch-hakyll-site";
|
2022-11-01 17:51:36 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
hydraJobs = {
|
2023-03-11 16:51:23 +01:00
|
|
|
static-site-generator.${system} = self.packages.${system}.static-site-generator;
|
2022-11-01 17:51:36 +01:00
|
|
|
website.${system} = self.packages.${system}.website;
|
|
|
|
};
|
|
|
|
};
|
2021-06-13 06:02:29 +02:00
|
|
|
}
|