noogle/flake.nix

43 lines
1.1 KiB
Nix
Raw Normal View History

2022-11-26 12:36:08 +03:00
{
inputs.dream2nix.url = "github:nix-community/dream2nix";
inputs.nixdoc-fork.url = "github:hsjobeki/nixdoc";
2022-12-18 19:31:42 +03:00
outputs = {self, nixpkgs,...}@inp:
2022-11-26 12:36:08 +03:00
let
system = "x86_64-linux";
2022-12-18 19:31:42 +03:00
pkgs = inp.nixpkgs.legacyPackages.${system};
2022-11-26 12:36:08 +03:00
inherit (builtins.fromJSON (builtins.readFile ./package.json)) name;
in
(inp.dream2nix.lib.makeFlakeOutputs {
2022-11-26 12:36:08 +03:00
systemsFromFile = ./nix_systems;
config.projectRoot = ./.;
source = ./.;
settings = [
{
subsystemInfo.nodejs = 18;
}
];
packageOverrides = {
${name}.staticPage = {
preBuild = ''
cp ${inp.nixdoc-fork.packages.${system}.data} ./models/lib.json
'';
2022-11-26 12:36:08 +03:00
installPhase = ''
runHook preInstall
npm run export
mkdir -p $out/static
cp -r ./out/* $out/static/
runHook postInstall
'';
};
};
2022-12-18 19:31:42 +03:00
})
// {
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [nodejs-18_x ];
};
};
2022-11-26 12:36:08 +03:00
}