mirror of
https://github.com/the-nix-way/dev-templates
synced 2024-09-22 01:31:28 +02:00
Compare commits
9 Commits
19eaf10fbd
...
d6bccb7908
Author | SHA1 | Date | |
---|---|---|---|
|
d6bccb7908 | ||
|
7c3ef7b734 | ||
|
4a341f857d | ||
|
d0e18d08b9 | ||
|
8f13f3a774 | ||
|
b89f77d481 | ||
|
4ced0d9048 | ||
|
9790fbe6da | ||
|
c24a6dc989 |
@ -145,6 +145,7 @@ A dev template that's fully customizable.
|
||||
- [Java] 20.0.1+9
|
||||
- [Maven] 3.9.2
|
||||
- [Gradle] 9.0.1
|
||||
- [jdtls] 1.31.0
|
||||
|
||||
### [`kotlin`](./kotlin/)
|
||||
|
||||
@ -227,7 +228,6 @@ A dev template that's fully customizable.
|
||||
|
||||
- [Python] 3.11.4
|
||||
- [pip] 23.0.1
|
||||
- [Virtualenv] 20.19.0
|
||||
|
||||
### [`ruby`](./ruby/)
|
||||
|
||||
@ -309,6 +309,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T
|
||||
[haxe]: https://haxe.org/
|
||||
[iex]: https://hexdocs.pm/iex/IEx.html
|
||||
[java]: https://java.com
|
||||
[jdtls]: https://projects.eclipse.org/projects/eclipse.jdt.ls
|
||||
[jq]: https://jqlang.github.io/jq
|
||||
[kotlin]: https://kotlinlang.org
|
||||
[latex]: https://www.latex-project.org/
|
||||
@ -365,7 +366,6 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T
|
||||
[texlive]: https://www.tug.org/texlive/
|
||||
[tflint]: https://github.com/terraform-linters/tflint
|
||||
[vault]: https://www.vaultproject.io
|
||||
[virtualenv]: https://pypi.org/project/virtualenv
|
||||
[vulnix]: https://github.com/flyingcircusio/vulnix
|
||||
[yarn]: https://yarnpkg.com
|
||||
[vlang]: https://vlang.io/
|
||||
|
1
empty/.envrc
Normal file
1
empty/.envrc
Normal file
@ -0,0 +1 @@
|
||||
use flake
|
71
flake.nix
71
flake.nix
@ -8,24 +8,48 @@
|
||||
overlays = [
|
||||
(final: prev:
|
||||
let
|
||||
exec = pkg: "${prev.${pkg}}/bin/${pkg}";
|
||||
in
|
||||
{
|
||||
format = prev.writeScriptBin "format" ''
|
||||
${exec "nixpkgs-fmt"} **/*.nix
|
||||
'';
|
||||
|
||||
check = prev.writeScriptBin "check" ''
|
||||
for dir in `ls -d */`; do # Iterate through all the templates
|
||||
getSystem = "SYSTEM=$(nix eval --impure --raw --expr 'builtins.currentSystem')";
|
||||
forEachDir = exec: ''
|
||||
for dir in */; do
|
||||
(
|
||||
cd $dir
|
||||
cd "''${dir}"
|
||||
|
||||
nix flake check --all-systems --no-build
|
||||
${exec}
|
||||
)
|
||||
done
|
||||
'';
|
||||
in
|
||||
{
|
||||
format = final.writeShellApplication {
|
||||
name = "format";
|
||||
runtimeInputs = with final; [ nixpkgs-fmt ];
|
||||
text = "nixpkgs-fmt '**/*.nix'";
|
||||
};
|
||||
|
||||
dvt = prev.writeScriptBin "dvt" ''
|
||||
# only run this locally, as Actions will run out of disk space
|
||||
build = final.writeShellApplication {
|
||||
name = "build";
|
||||
text = ''
|
||||
${getSystem}
|
||||
|
||||
${forEachDir ''
|
||||
echo "building ''${dir}"
|
||||
nix build ".#devShells.''${SYSTEM}.default"
|
||||
''}
|
||||
'';
|
||||
};
|
||||
|
||||
check = final.writeShellApplication {
|
||||
name = "check";
|
||||
text = forEachDir ''
|
||||
echo "checking ''${dir}"
|
||||
nix flake check --all-systems --no-build
|
||||
'';
|
||||
};
|
||||
|
||||
dvt = final.writeShellApplication {
|
||||
name = "dvt";
|
||||
text = ''
|
||||
if [ -z $1 ]; then
|
||||
echo "no template specified"
|
||||
exit 1
|
||||
@ -33,30 +57,21 @@
|
||||
|
||||
TEMPLATE=$1
|
||||
|
||||
${exec "nix"} \
|
||||
nix \
|
||||
--experimental-features 'nix-command flakes' \
|
||||
flake init \
|
||||
--template \
|
||||
"github:the-nix-way/dev-templates#''${TEMPLATE}"
|
||||
'';
|
||||
};
|
||||
|
||||
update = prev.writeScriptBin "update" ''
|
||||
for dir in `ls -d */`; do # Iterate through all the templates
|
||||
(
|
||||
cd $dir
|
||||
|
||||
update = final.writeShellApplication {
|
||||
name = "update";
|
||||
text = forEachDir ''
|
||||
echo "updating ''${dir}"
|
||||
|
||||
# Update flake.lock
|
||||
nix flake update
|
||||
|
||||
echo "checking ''${dir}"
|
||||
|
||||
# Make sure things work after the update
|
||||
nix flake check --all-systems --no-build
|
||||
)
|
||||
done
|
||||
'';
|
||||
};
|
||||
})
|
||||
];
|
||||
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
@ -67,7 +82,7 @@
|
||||
{
|
||||
devShells = forEachSupportedSystem ({ pkgs }: {
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [ check format update ];
|
||||
packages = with pkgs; [ build check format update ];
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
{
|
||||
devShells = forEachSupportedSystem ({ pkgs }: {
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [ gradle jdk maven ];
|
||||
packages = with pkgs; [ gradle jdk maven jdt-language-server ];
|
||||
};
|
||||
});
|
||||
};
|
||||
|
@ -13,8 +13,12 @@
|
||||
{
|
||||
devShells = forEachSupportedSystem ({ pkgs }: {
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [ python311 virtualenv ] ++
|
||||
(with pkgs.python311Packages; [ pip ]);
|
||||
venvDir = "venv";
|
||||
packages = with pkgs; [ python311 ] ++
|
||||
(with pkgs.python311Packages; [
|
||||
pip
|
||||
venvShellHook
|
||||
]);
|
||||
};
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user