feat: serve path script, pkgs lib overlay

This commit is contained in:
dusk 2021-05-15 02:39:30 +03:00
parent d7671bf1ba
commit c73ac62ffb
Signed by: dusk
GPG Key ID: 1D8F8FAF2294D6EA
2 changed files with 16 additions and 1 deletions

View File

@ -5,15 +5,22 @@
let let
tagsPath = ./tags.nix; tagsPath = ./tags.nix;
libPath = ./lib.nix; libPath = ./lib.nix;
pkgsLibPath = ./pkgs-lib.nix;
lib = import libPath; lib = import libPath;
in in
{ {
lib = { lib = {
inherit tagsPath libPath; inherit tagsPath libPath pkgsLibPath;
tags = import tagsPath { format = true; inherit lib; }; tags = import tagsPath { format = true; inherit lib; };
core = lib; core = lib;
}; };
overlays = {
pkgsLib = (final: prev: {
htmlNix = import pkgsLibPath { inherit lib; pkgs = prev; };
});
};
}; };
} }

8
pkgs-lib.nix Normal file
View File

@ -0,0 +1,8 @@
{ lib ? import ./lib.nix, pkgs }:
let pkgBin = name: "${pkgs.${name}}/bin/${name}"; in
{
mkServePathScript = path: pkgs.writeScriptBin "serve" { } ''
#!${pkgBin "bash"}
${pkgBin "miniserve"} --index index.html ${path}
'';
}