2024-11-05 11:06:22 +01:00
|
|
|
{
|
|
|
|
inputs.nixpkgs.url = "github:NixOs/nixpkgs";
|
|
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
# inputs.flake-utils.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
|
|
|
outputs = {
|
|
|
|
flake-utils,
|
|
|
|
nixpkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system: let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
};
|
|
|
|
dev_serve = pkgs.writeShellScriptBin "serve" ''
|
|
|
|
${pkgs.zola}/bin/zola serve $@
|
|
|
|
'';
|
|
|
|
static_serve = pkgs.writeShellScriptBin "serve" ''
|
|
|
|
${pkgs.simple-http-server}/bin/simple-http-server -i
|
|
|
|
'';
|
|
|
|
static_homepage = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "homepage";
|
|
|
|
src = ./.;
|
|
|
|
buildPhase = ''
|
|
|
|
${pkgs.zola}/bin/zola build -o $out/
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
prod_homepage = pkgs.writeShellScriptBin "home-prod" ''
|
|
|
|
${pkgs.simple-http-server}/bin/simple-http-server -i ${static_homepage}/. $@
|
|
|
|
'';
|
|
|
|
in {
|
|
|
|
packages.default = prod_homepage;
|
|
|
|
packages.static = static_homepage;
|
|
|
|
devShells.default = pkgs.mkShell {
|
2024-11-14 11:57:59 +01:00
|
|
|
name = "ssg";
|
2024-11-05 11:06:22 +01:00
|
|
|
buildInputs = with pkgs; [
|
|
|
|
pkgs.vscode-langservers-extracted # html, css lsp
|
|
|
|
simple-http-server
|
|
|
|
dev_serve
|
|
|
|
static_serve
|
|
|
|
imagemagick
|
|
|
|
ffmpeg
|
|
|
|
zola
|
2024-11-06 15:48:42 +01:00
|
|
|
translate-shell
|
2024-11-11 09:58:02 +01:00
|
|
|
typos
|
2024-11-14 08:56:27 +01:00
|
|
|
ispell
|
2024-11-14 10:52:04 +01:00
|
|
|
inkscape
|
2024-11-05 11:06:22 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|