feat: added devenv to templates and removed .envrc entries from .gitignore
This commit is contained in:
parent
00d911f776
commit
6af6dd594f
4 changed files with 61 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -65,3 +65,5 @@ tags
|
|||
[._]*.un~
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/direnv,terraform,vim
|
||||
|
||||
!templates/**
|
||||
|
|
|
|||
3
templates/devenv/.envrc
Normal file
3
templates/devenv/.envrc
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
watch_file flake.nix flake.lock
|
||||
|
||||
use flake . --no-purel-eval
|
||||
53
templates/devenv/flake.nix
Normal file
53
templates/devenv/flake.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:cachix/devenv-nixpkgs/rolling";
|
||||
devenv.inputs.nixpkgs.follows = "nixpkgs";
|
||||
devenv.url = "github:cachix/devenv";
|
||||
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||
};
|
||||
outputs = {
|
||||
flake-utils,
|
||||
nixpkgs,
|
||||
treefmt-nix,
|
||||
devenv,
|
||||
...
|
||||
} @ inputs:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
|
||||
treefmtConfig = {...}: {
|
||||
projectRootFile = "flake.nix";
|
||||
programs = {
|
||||
alejandra.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
treefmtEval = treefmt-nix.lib.evalModule pkgs (treefmtConfig {inherit pkgs;});
|
||||
in {
|
||||
formatter = treefmtEval.config.build.wrapper;
|
||||
|
||||
devShells.default = devenv.lib.mkShell {
|
||||
inherit inputs pkgs;
|
||||
|
||||
modules = [
|
||||
({pkgs, ...}: {
|
||||
languages = {};
|
||||
|
||||
packages = with pkgs; [];
|
||||
|
||||
processes = {};
|
||||
|
||||
scripts = {};
|
||||
|
||||
services = {};
|
||||
|
||||
tasks = {};
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
3
templates/devshell/.envrc
Normal file
3
templates/devshell/.envrc
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
watch_file flake.nix flake.lock
|
||||
|
||||
use flake
|
||||
Loading…
Add table
Add a link
Reference in a new issue