57 lines
1.4 KiB
Nix
57 lines
1.4 KiB
Nix
{
|
|
inputs.nixpkgs.url = "nixpkgs/nixos-22.11";
|
|
|
|
outputs = { self, nixpkgs }: let
|
|
system = "x86_64-linux";
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in {
|
|
packages.${system} = {
|
|
static-site-generator = pkgs.haskellPackages.developPackage {
|
|
name = "static-site-generator";
|
|
root = ./.;
|
|
};
|
|
|
|
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 = ''
|
|
static-site-generator build --verbose
|
|
'';
|
|
|
|
installPhase = ''
|
|
cp -r dist "$out"
|
|
'';
|
|
};
|
|
};
|
|
|
|
apps.${system} = {
|
|
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
|
|
'';
|
|
in {
|
|
type = "app";
|
|
program = "${drv}/bin/watch-hakyll-site";
|
|
};
|
|
};
|
|
|
|
hydraJobs = {
|
|
static-site-generator.${system} = self.packages.${system}.static-site-generator;
|
|
website.${system} = self.packages.${system}.website;
|
|
};
|
|
};
|
|
}
|