feat: init
This commit is contained in:
commit
06c3330999
16 changed files with 3817 additions and 0 deletions
27
templates/default/nix/devshells/default.nix
Normal file
27
templates/default/nix/devshells/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
pkgs,
|
||||
flake,
|
||||
system,
|
||||
}:
|
||||
pkgs.mkShell {
|
||||
# Add build dependencies
|
||||
packages = [
|
||||
flake.formatter.${system}
|
||||
pkgs.jq
|
||||
];
|
||||
|
||||
# Add environment variables
|
||||
env = { };
|
||||
|
||||
# Load custom bash code
|
||||
shellHook =
|
||||
# TODO(blocked/upstream): remove this once https://github.com/isbecker/treefmt-vscode/issues/3 is resolved
|
||||
(flake.inputs.nixago.lib.${system}.make {
|
||||
data = flake.formatter.${system}.settings;
|
||||
output = "treefmt.toml";
|
||||
format = "toml";
|
||||
}).shellHook
|
||||
+ ''
|
||||
echo $(git rev-parse --show-toplevel)
|
||||
'';
|
||||
}
|
34
templates/default/nix/devshells/rust.nix
Normal file
34
templates/default/nix/devshells/rust.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
flake,
|
||||
system,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
craneLib = flake.lib.mkCraneLib { inherit pkgs system; };
|
||||
in
|
||||
craneLib.devShell {
|
||||
inputsFrom =
|
||||
[
|
||||
flake.devShells.${system}.default
|
||||
]
|
||||
# Inherit inputs from rust-workspace on the platforms it's available.
|
||||
++ (pkgs.lib.lists.optionals
|
||||
(pkgs.lib.meta.availableOn pkgs.stdenv.hostPlatform flake.packages.${system}.rust-workspace)
|
||||
(
|
||||
[
|
||||
flake.packages.${system}.rust-workspace
|
||||
|
||||
]
|
||||
++ (builtins.attrValues flake.packages.${system}.rust-workspace.passthru.tests)
|
||||
)
|
||||
);
|
||||
|
||||
# Additional dev-shell environment variables can be set directly
|
||||
# MY_CUSTOM_DEVELOPMENT_VAR = "something else";
|
||||
|
||||
# Extra inputs can be added here; cargo and rustc are provided by default.
|
||||
packages = [
|
||||
pkgs.natscli
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue