add boilerplate generation CLI
This commit is contained in:
parent
29288276ea
commit
789083d32f
5 changed files with 293 additions and 0 deletions
32
modules/packages/boilerplate/default.nix
Normal file
32
modules/packages/boilerplate/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ self, inputs, ... }:
|
||||
{
|
||||
perSystem =
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
packages.boilerplate = pkgs.stdenvNoCC.mkDerivation {
|
||||
pname = "boilerplate";
|
||||
version = "0.1.0";
|
||||
|
||||
src = ./.;
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
substituteInPlace boilerplate.py \
|
||||
--replace-fail '#!/usr/bin/env python3' '#!${pkgs.python3}/bin/python3'
|
||||
install -Dm755 boilerplate.py "$out/bin/boilerplate"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Generate boilerplate Nix modules";
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = "boilerplate";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue