kinklist/flake.nix

58 lines
1.4 KiB
Nix

# SPDX-License-Identifier: Unlicense
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default";
devshell.url = "github:numtide/devshell";
};
outputs =
inputs@{
flake-parts,
devshell,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
imports = [
devshell.flakeModule
];
perSystem =
{
system,
pkgs,
inputs',
...
}:
{
_module.args.pkgs = inputs.nixpkgs.legacyPackages.${system};
devshells.default = {
packages = with pkgs; [
http-server
prettier
vscode-langservers-extracted
typescript-language-server
typescript
nodejs_24
];
commands = [
{
help = "Launch HTTP server for local testing";
name = "run";
command = "http-server src -c-1";
}
{
help = "Build files for deployment to server";
name = "build";
command = "mkdir artifacts; cp -r src/* artifacts; ${pkgs.zip}/bin/zip -r9 bundle.zip artifacts";
}
];
};
};
};
}