nani.wtf/flake.nix

57 lines
1.4 KiB
Nix
Raw Permalink Normal View History

2021-06-13 06:02:29 +02:00
{
inputs.nixpkgs.url = "nixpkgs/nixos-22.11";
2021-06-13 06:02:29 +02:00
outputs = { self, nixpkgs }: let
2022-11-01 17:51:36 +01:00
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
2022-11-05 19:19:55 +01:00
in {
packages.${system} = {
static-site-generator = pkgs.haskellPackages.developPackage {
name = "static-site-generator";
root = ./.;
};
2022-11-01 17:51:36 +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 = ''
static-site-generator build --verbose
'';
installPhase = ''
cp -r dist "$out"
'';
};
2022-11-01 17:51:36 +01:00
};
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
'';
2022-11-01 17:51:36 +01:00
in {
type = "app";
program = "${drv}/bin/watch-hakyll-site";
2022-11-01 17:51:36 +01:00
};
};
hydraJobs = {
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
}