feat(template): +nodejs
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
{
|
||||
### DEV SHELL ###
|
||||
devShells.${system} = {
|
||||
default = import ./devshell/default.nix { inherit pkgs; };
|
||||
default = import ./devshell/default.nix { inherit pkgs; };
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
@@ -7,4 +7,8 @@
|
||||
path = ./avarage;
|
||||
description = "avarage dev flake template";
|
||||
};
|
||||
nodejs = {
|
||||
path = ./nodejs;
|
||||
description = "nodejs dev flake template";
|
||||
};
|
||||
}
|
||||
|
||||
24
template/nodejs/devshell/default.nix
Normal file
24
template/nodejs/devshell/default.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ pkgs }:
|
||||
let
|
||||
deps = with pkgs; [ nodejs ];
|
||||
|
||||
depsText = builtins.concatStringsSep ", "
|
||||
(map (p: p.pname or p.name) deps);
|
||||
|
||||
dev-help = pkgs.writeShellScriptBin "dev-help" /* sh */ ''
|
||||
printf '%s\n' \
|
||||
'Welcome to Nodejs devshell!' \
|
||||
'dependencies: ${depsText}' \
|
||||
'dev-help - this message'
|
||||
'';
|
||||
in
|
||||
pkgs.mkShell {
|
||||
buildInputs = [ dev-help ] ++ deps;
|
||||
nativeBuildInputs = [ pkgs.pkg-config ];
|
||||
|
||||
shellHook = ''
|
||||
dev-help
|
||||
'';
|
||||
|
||||
PAGER = "${pkgs.hectic.nvim-pager}/bin/pager";
|
||||
}
|
||||
1014
template/nodejs/flake.lock
generated
Normal file
1014
template/nodejs/flake.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
28
template/nodejs/flake.nix
Normal file
28
template/nodejs/flake.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
description = "";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||
util = {
|
||||
url = "github:hectic-lab/util.nix";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, util }:
|
||||
let
|
||||
overlays = [ util.overlays.default ];
|
||||
in
|
||||
util.lib.forAllSystemsWithPkgs overlays ({ system, pkgs }:
|
||||
let
|
||||
lib = pkgs.lib;
|
||||
in
|
||||
{
|
||||
### DEV SHELL ###
|
||||
devShells.${system} = {
|
||||
default = import ./devshell/default.nix { inherit pkgs; };
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -27,7 +27,7 @@
|
||||
{
|
||||
### DEV SHELL ###
|
||||
devShells.${system} = {
|
||||
default = import ./devshell/default.nix { inherit pkgs; };
|
||||
default = import ./devshell/default.nix { inherit pkgs; };
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user