2022-07-12 01:17:54 +02:00
|
|
|
{
|
2022-07-29 00:11:05 +02:00
|
|
|
description =
|
|
|
|
"Ready-made templates for easily creating flake-driven environments";
|
2022-07-12 01:17:54 +02:00
|
|
|
|
2022-07-29 00:42:22 +02:00
|
|
|
inputs = {
|
2022-08-13 17:32:50 +02:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
2022-07-29 00:42:22 +02:00
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
2022-07-28 23:20:46 +02:00
|
|
|
|
2022-08-20 12:06:53 +02:00
|
|
|
outputs = { self, flake-utils, nixpkgs }:
|
2022-07-31 23:12:51 +02:00
|
|
|
{
|
2022-07-29 00:42:22 +02:00
|
|
|
templates = {
|
2022-07-31 20:23:05 +02:00
|
|
|
cue = {
|
|
|
|
path = ./cue;
|
|
|
|
description = "Cue development environment";
|
|
|
|
};
|
|
|
|
|
2022-07-29 01:35:35 +02:00
|
|
|
dhall = {
|
|
|
|
path = ./dhall;
|
|
|
|
description = "Dhall development environment";
|
|
|
|
};
|
|
|
|
|
|
|
|
elixir = {
|
2022-07-29 01:59:25 +02:00
|
|
|
path = ./elixir;
|
2022-07-29 01:35:35 +02:00
|
|
|
description = "Elixir development environment";
|
|
|
|
};
|
|
|
|
|
2022-07-31 21:10:16 +02:00
|
|
|
elm = {
|
|
|
|
path = ./elm;
|
|
|
|
description = "Elm development environment";
|
|
|
|
};
|
|
|
|
|
2022-07-29 00:42:22 +02:00
|
|
|
gleam = {
|
|
|
|
path = ./gleam;
|
|
|
|
description = "Gleam development environment";
|
|
|
|
};
|
2022-07-12 01:17:54 +02:00
|
|
|
|
2022-08-23 11:07:14 +02:00
|
|
|
go = {
|
|
|
|
path = ./go;
|
|
|
|
description = "Go (Golang) development environment";
|
2022-07-29 00:42:22 +02:00
|
|
|
};
|
2022-07-28 23:42:40 +02:00
|
|
|
|
2022-07-31 20:52:37 +02:00
|
|
|
hashi = {
|
|
|
|
path = ./hashi;
|
|
|
|
description = "HashiCorp DevOps tools development environment";
|
|
|
|
};
|
|
|
|
|
2022-08-01 00:00:58 +02:00
|
|
|
haskell = {
|
|
|
|
path = ./haskell;
|
|
|
|
description = "Haskell development environment";
|
|
|
|
};
|
|
|
|
|
2022-07-29 00:42:22 +02:00
|
|
|
java = {
|
|
|
|
path = ./java;
|
|
|
|
description = "Java development environment";
|
|
|
|
};
|
2022-07-29 00:14:21 +02:00
|
|
|
|
2022-07-29 01:21:18 +02:00
|
|
|
kotlin = {
|
|
|
|
path = ./kotlin;
|
|
|
|
description = "Kotlin development environment";
|
|
|
|
};
|
|
|
|
|
2022-08-01 03:04:16 +02:00
|
|
|
nickel = {
|
|
|
|
path = ./nickel;
|
|
|
|
description = "Nickel development environment";
|
|
|
|
};
|
|
|
|
|
2022-07-31 21:01:58 +02:00
|
|
|
nim = {
|
|
|
|
path = ./nim;
|
|
|
|
description = "Nim development environment";
|
|
|
|
};
|
|
|
|
|
2022-07-29 00:42:22 +02:00
|
|
|
nix = {
|
|
|
|
path = ./nix;
|
|
|
|
description = "Nix development environment";
|
|
|
|
};
|
2022-07-28 23:37:55 +02:00
|
|
|
|
2022-07-29 00:42:22 +02:00
|
|
|
node = {
|
|
|
|
path = ./node;
|
|
|
|
description = "Node.js development environment";
|
|
|
|
};
|
2022-07-28 23:20:46 +02:00
|
|
|
|
2022-07-31 21:59:08 +02:00
|
|
|
opa = {
|
|
|
|
path = ./opa;
|
|
|
|
description = "Open Policy Agent development environment";
|
|
|
|
};
|
|
|
|
|
2022-07-29 02:49:09 +02:00
|
|
|
protobuf = {
|
|
|
|
path = ./protobuf;
|
|
|
|
description = "Protobuf development environment";
|
|
|
|
};
|
|
|
|
|
2022-07-31 22:33:11 +02:00
|
|
|
python = {
|
|
|
|
path = ./python;
|
|
|
|
description = "Python development environment";
|
|
|
|
};
|
|
|
|
|
2022-07-31 22:18:29 +02:00
|
|
|
ruby = {
|
|
|
|
path = ./ruby;
|
|
|
|
description = "Ruby development environment";
|
|
|
|
};
|
|
|
|
|
2022-07-29 00:42:22 +02:00
|
|
|
rust = {
|
|
|
|
path = ./rust;
|
|
|
|
description = "Rust development environment";
|
|
|
|
};
|
2022-07-28 23:54:27 +02:00
|
|
|
|
2022-07-29 00:42:22 +02:00
|
|
|
scala = {
|
|
|
|
path = ./scala;
|
|
|
|
description = "Scala development environment";
|
|
|
|
};
|
|
|
|
|
|
|
|
zig = {
|
|
|
|
path = ./zig;
|
|
|
|
description = "Zig development environment";
|
|
|
|
};
|
2022-07-28 23:20:46 +02:00
|
|
|
};
|
2022-07-31 23:12:51 +02:00
|
|
|
} // flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
inherit (pkgs) mkShell writeScriptBin;
|
2022-08-03 08:35:52 +02:00
|
|
|
exec = pkg: "${pkgs.${pkg}}/bin/${pkg}";
|
2022-07-31 23:12:51 +02:00
|
|
|
|
|
|
|
format = writeScriptBin "format" ''
|
2022-08-20 14:55:36 +02:00
|
|
|
${exec "nixpkgs-fmt"} **/*.nix
|
2022-07-31 23:12:51 +02:00
|
|
|
'';
|
2022-08-02 12:52:51 +02:00
|
|
|
|
2022-07-31 23:12:51 +02:00
|
|
|
update = writeScriptBin "update" ''
|
|
|
|
for dir in `ls -d */`; do # Iterate through all the templates
|
|
|
|
(
|
|
|
|
cd $dir
|
2022-08-03 08:35:52 +02:00
|
|
|
${exec "nix"} flake update # Update flake.lock
|
2022-08-20 12:06:53 +02:00
|
|
|
${
|
|
|
|
exec "direnv"
|
|
|
|
} reload # Make sure things work after the update
|
2022-07-31 23:12:51 +02:00
|
|
|
)
|
|
|
|
done
|
|
|
|
'';
|
2022-08-20 13:47:43 +02:00
|
|
|
in
|
|
|
|
{
|
2022-08-20 12:06:53 +02:00
|
|
|
devShells = { default = mkShell { buildInputs = [ format update ]; }; };
|
|
|
|
});
|
2022-07-12 01:17:54 +02:00
|
|
|
}
|