Use devenv

This commit is contained in:
Invariantspace 2025-03-20 11:16:32 +08:00
parent c6d125fca9
commit 458c94c1fe
Signed by: macronova
GPG key ID: CE969670FB4B4A56
12 changed files with 86 additions and 155 deletions

43
template/devenv/flake.nix Normal file
View file

@ -0,0 +1,43 @@
{
inputs = {
devenv.url = "github:cachix/devenv";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-python.url = "github:cachix/nixpkgs-python";
};
outputs = inputs @ {
self,
devenv,
flake-utils,
nixpkgs,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in {
packages = {
devenv-up = self.devShells.${system}.default.config.procfileScript;
devenv-test = self.devShells.${system}.default.config.test;
};
devShells.default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
{
git-hooks.hooks.alejandra.enable = true;
languages = {
nix.enable = true;
# python.enable = true;
# r.enable = true;
# rust.enable = true;
# typst.enable = true;
};
}
];
};
});
}