Reformat all projects; switch to overlay format

This commit is contained in:
Luc Perkins 2022-08-20 15:54:34 +03:00
parent bf45826289
commit fca8041d90
No known key found for this signature in database
GPG key ID: 4F102D0C16E232F2
30 changed files with 532 additions and 600 deletions

View file

@ -35,8 +35,7 @@ Once your preferred template has been initialized, you can use the provided shel
| [Elixir] | [`elixir`](./elixir/) | | [Elixir] | [`elixir`](./elixir/) |
| [Elm] | [`elm`](./elm/) | | [Elm] | [`elm`](./elm/) |
| [Gleam] | [`gleam`](./gleam/) | | [Gleam] | [`gleam`](./gleam/) |
| [Go] 1.17 | [`go1_17`](./go1.17/) | | [Go] | [`go`](./go/) |
| [Go] 1.18 | [`go1_18`](./go1.18/) |
| [Hashicorp] tools | [`hashi`](./hashi/) | | [Hashicorp] tools | [`hashi`](./hashi/) |
| [Java] | [`java`](./java/) | | [Java] | [`java`](./java/) |
| [Kotlin] | [`kotlin`](./kotlin/) | | [Kotlin] | [`kotlin`](./kotlin/) |
@ -96,15 +95,9 @@ The sections below list what each template includes. In all cases, you're free t
- [Gleam] 0.22.1 - [Gleam] 0.22.1
### [`go1.17`](./go1.17/) ### [`go`](./go/)
- [Go] 1.17 - [Go] 1.19
- Standard Go tools ([goimports], [godoc], and others)
- [golangci-lint]
### [`go1.18`](./go1.18/)
- [Go] 1.18
- Standard Go tools ([goimports], [godoc], and others) - Standard Go tools ([goimports], [godoc], and others)
- [golangci-lint] - [golangci-lint]

View file

@ -6,31 +6,38 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
jdk = "jdk17"; javaVersion = 17;
overlays = [
config = { (self: super: rec {
packageOverrides = p: { jdk = super."jdk${toString javaVersion}";
boot = p.boot.override { jdk = p.${jdk}; }; boot = super.boot.override {
clojure = p.clojure.override { jdk = p.${jdk}; }; inherit jdk;
leiningen = p.leiningen.override { jdk = p.${jdk}; };
}; };
}; clojure = super.clojure.override {
inherit jdk;
pkgs = import nixpkgs { inherit config system; };
inherit (pkgs) boot clojure leiningen mkShell;
in
{
devShells = {
default = mkShell {
buildInputs = [ boot clojure leiningen ];
shellHook = ''
${clojure}/bin/clj --version
'';
}; };
}; leiningen = super.leiningen.override {
}); inherit jdk;
};
})
];
pkgs = import nixpkgs { inherit overlays system; };
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ boot clojure leiningen ];
shellHook = ''
${pkgs.clojure}/bin/clj --version
'';
};
});
} }

View file

@ -6,21 +6,23 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
flake-utils.lib.eachDefaultSystem (system: { self
let , flake-utils
pkgs = import nixpkgs { inherit system; }; , nixpkgs
inherit (pkgs) cue mkShell; }:
in
{
devShells = {
default = mkShell {
buildInputs = [ cue ];
shellHook = '' flake-utils.lib.eachDefaultSystem (system:
${cue}/bin/cue version let
''; pkgs = import nixpkgs { inherit system; };
}; in
}; {
}); devShell = pkgs.mkShell {
buildInputs = with pkgs; [ cue ];
shellHook = ''
${pkgs.cue}/bin/cue version
'';
};
});
} }

View file

@ -6,47 +6,39 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
dhall = pkgs.dhall;
inherit (pkgs) mkShell; # Helper function for building dhall-* tools
inherit (pkgs.lib) optionals; mkDhallTools = ls:
inherit (pkgs.stdenv) isLinux; builtins.map (tool: pkgs.haskellPackages."dhall-${tool}") ls;
# Helper function for building dhall-* tools dhallTools = mkDhallTools [
mkDhallTools = ls: "bash"
builtins.map (tool: pkgs.haskellPackages."dhall-${tool}") ls; "docs"
"json"
"lsp-server"
"nix"
"nixpkgs"
"openapi"
"toml"
"yaml"
] ++ pkgs.lib.optionals (pkgs.stdenv.isLinux) (mkDhallTools [ "csv" "text" ]); # Linux only
in
{
devShell = pkgs.mkShell {
buildInputs = (with pkgs; [ dhall ]) ++ dhallTools;
# dhall-* tools available only on all platforms shellHook = ''
dhallToolsCommon = mkDhallTools [ echo "dhall `${pkgs.dhall}/bin/dhall --version`"
"bash" '';
"docs" };
"json" });
"lsp-server"
"nix"
"nixpkgs"
"openapi"
"toml"
"yaml"
];
# dhall-* tools available only on Linux
dhallToolsLinux = optionals isLinux (mkDhallTools [ "csv" "text" ]);
dhallTools = dhallToolsCommon ++ dhallToolsLinux;
in
{
devShells = {
default = mkShell {
buildInputs = [ dhall ] ++ dhallTools;
shellHook = ''
echo "dhall `${dhall}/bin/dhall --version`"
'';
};
};
});
} }

View file

@ -6,32 +6,27 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
in
{
devShell = pkgs.mkShell {
buildInputs = (with pkgs; [ elixir ]) ++
pkgs.lib.optionals (pkgs.stdenv.isLinux) (with pkgs; [ gigalixir inotify-tools libnotify ]) ++ # Linux only
pkgs.lib.optionals (pkgs.stdenv.isDarwin) (with pkgs; [ terminal-notifier ]) ++ # macOS only
(with pkgs.darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices ]);
inherit (pkgs) shellHook = ''
darwin gigalixir inotify-tools libnotify mkShell terminal-notifier; ${pkgs.elixir}/bin/mix --version
inherit (pkgs.beam.packages.erlangR25) elixir elixir_ls; ${pkgs.elixir}/bin/iex --version
inherit (pkgs.darwin.apple_sdk.frameworks) CoreFoundation CoreServices; '';
inherit (pkgs.lib) optionals; };
inherit (pkgs.stdenv) isDarwin isLinux; });
linuxDeps = optionals isLinux [ gigalixir inotify-tools libnotify ];
darwinDeps = optionals isDarwin [ terminal-notifier ]
++ [ CoreFoundation CoreServices ];
in
{
devShells = {
default = mkShell {
buildInputs = [ elixir elixir_ls ] ++ linuxDeps ++ darwinDeps;
shellHook = ''
${elixir}/bin/mix --version
${elixir}/bin/iex --version
'';
};
};
});
} }

View file

@ -6,23 +6,23 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
inherit (pkgs) mkShell; in
{
devShell = pkgs.mkShell {
buildInputs = (with pkgs.elmPackages; [ elm ]) ++ (with pkgs; [ elm2nix ]);
elm = pkgs.elmPackages.elm; shellHook = with pkgs.elmPackages; ''
in echo "elm `${elm}/bin/elm --version`"
{ '';
devShells = { };
default = mkShell { });
buildInputs = [ elm ] ++ (with pkgs; [ elm2nix ]);
shellHook = ''
echo "elm `${elm}/bin/elm --version`"
'';
};
};
});
} }

View file

@ -6,23 +6,23 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
gleamPkg = pkgs.gleam; in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ gleam ];
inherit (pkgs) mkShell; shellHook = ''
in ${pkgs.gleam}/bin/gleam --version
{ '';
devShells = { };
default = mkShell { });
buildInputs = [ gleamPkg ];
shellHook = ''
${gleamPkg}/bin/gleam --version
'';
};
};
});
} }

39
go/flake.nix Normal file
View file

@ -0,0 +1,39 @@
{
description = "A Nix-flake-based Go 1.17 development environment";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system:
let
goVersion = 19;
overlays = [ (self: super: { go = super."go_1_${toString goVersion}"; }) ];
pkgs = import nixpkgs { inherit overlays system; };
in
{
devShell = pkgs.mkShellNoCC {
buildInputs = with pkgs; [
# go 1.17.1 (specified by overlay)
go
# goimports, godoc, etc.
gotools
# https://github.com/golangci/golangci-lint
golangci-lint
];
shellHook = ''
${pkgs.go}/bin/go version
'';
};
});
}

View file

@ -1,42 +0,0 @@
{
description = "A Nix-flake-based Go 1.17 development environment";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
goPkg = pkgs.go_1_17;
inherit (pkgs) mkShellNoCC;
in
{
apps.default = {
type = "app";
program = "${goPkg}/bin/go";
};
devShells = {
default = mkShellNoCC {
buildInputs = with pkgs; [
# go 1.17.1
goPkg
# goimports, godoc, etc.
gotools
# https://github.com/golangci/golangci-lint
golangci-lint
];
shellHook = ''
${goPkg}/bin/go version
'';
};
};
});
}

View file

@ -1 +0,0 @@
use flake .

View file

@ -1,42 +0,0 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1660984654,
"narHash": "sha256-fDcsh8rm2o8cj+WFL8Y2cAqnsej0UGJa+Sy8U2nFg0Q=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "392c83491dcc21d17ab8ea1f809f8f7bd567a5a3",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,42 +0,0 @@
{
description = "A Nix-flake-based Go 1.18 development environment";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
goPkg = pkgs.go_1_18;
inherit (pkgs) mkShellNoCC;
in
{
apps.default = {
type = "app";
program = "${goPkg}/bin/go";
};
devShells = {
default = mkShellNoCC {
buildInputs = with pkgs; [
# go 1.18.3
goPkg
# goimports, godoc, etc.
gotools
# https://github.com/golangci/golangci-lint
golangci-lint
];
shellHook = ''
${goPkg}/bin/go version
'';
};
};
});
}

View file

@ -7,16 +7,19 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
in
inherit (pkgs) {
damon levant mkShell nomad nomad-autoscaler nomad-pack packer devShell = pkgs.mkShell {
terraform vault; buildInputs = with pkgs; [
hashiTools = [
packer packer
terraform terraform
nomad nomad
@ -25,22 +28,15 @@
nomad-pack nomad-pack
levant levant
damon damon
terragrunt
]; ];
relatedTools = with pkgs; [ terragrunt ]; shellHook = with pkgs; ''
in echo "packer `${packer}/bin/packer --version`"
{ ${terraform}/bin/terraform --version
devShells = { ${nomad}/bin/nomad --version
default = mkShell { ${vault}/bin/vault --version
buildInputs = hashiTools ++ relatedTools; '';
};
shellHook = '' });
echo "packer `${packer}/bin/packer --version`"
${terraform}/bin/terraform --version
${nomad}/bin/nomad --version
${vault}/bin/vault --version
'';
};
};
});
} }

View file

@ -6,22 +6,24 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
flake-utils.lib.eachDefaultSystem (system: { self
let , flake-utils
pkgs = import nixpkgs { inherit system; }; , nixpkgs
inherit (pkgs) cabal-install ghc mkShell; }:
in
{
devShells = {
default = mkShell {
buildInputs = [ cabal-install ghc ];
shellHook = '' flake-utils.lib.eachDefaultSystem (system:
${ghc}/bin/ghc --version let
${cabal-install}/bin/cabal --version pkgs = import nixpkgs { inherit system; };
''; in
}; {
}; devShell = pkgs.mkShell {
}); buildInputs = with pkgs; [ cabal-install ghc ];
shellHook = with pkgs; ''
${ghc}/bin/ghc --version
${cabal-install}/bin/cabal --version
'';
};
});
} }

View file

@ -6,31 +6,37 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
jdk = pkgs.jdk17; javaVersion = 17;
config = { overlays = [
packageOverrides = p: { (self: super: rec {
gradle = (p.gradle.override { java = jdk; }); jdk = super."jdk${toString javaVersion}";
gradle = super.gradle.override {
java = jdk;
}; };
}; maven = super.maven.override {
inherit jdk;
pkgs = import nixpkgs { inherit config jdk system; };
java = jdk;
buildTools = with pkgs; [ ant gradle maven ];
inherit (pkgs) mkShell;
in
{
devShells = {
default = mkShell {
buildInputs = [ java ] ++ buildTools;
shellHook = ''
${java}/bin/java -version
'';
}; };
}; })
}); ];
pkgs = import nixpkgs { inherit overlays system; };
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ gradle jdk maven ];
shellHook = ''
${pkgs.jdk}/bin/java -version
'';
};
});
} }

View file

@ -6,35 +6,37 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
jdk = pkgs.jdk17; javaVersion = 17;
config = { overlays = [
packageOverrides = p: { (self: super: rec {
gradle = (p.gradle.override { java = jdk; }); jdk = pkgs."jdk${toString javaVersion}";
gradle = super.gradle.override {
kotlin = (p.kotlin.override { jre = jdk; }); java = jdk;
}; };
}; kotlin = super.kotlin.override {
jre = jdk;
pkgs = import nixpkgs { inherit config system; };
inherit (pkgs) mkShell;
kotlin = pkgs.kotlin;
buildTools = with pkgs; [ gradle ];
otherTools = with pkgs; [ gcc ncurses patchelf zlib ];
in
{
devShells = {
default = mkShell {
buildInputs = [ kotlin ] ++ buildTools ++ otherTools;
shellHook = ''
${kotlin}/bin/kotlin -version
'';
}; };
}; })
}); ];
pkgs = import nixpkgs { inherit overlays system; };
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ kotlin gradle gcc ncurses patchelf zlib ];
shellHook = ''
${pkgs.kotlin}/bin/kotlin -version
'';
};
});
} }

View file

@ -6,21 +6,23 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
flake-utils.lib.eachDefaultSystem (system: { self
let , flake-utils
pkgs = import nixpkgs { inherit system; }; , nixpkgs
inherit (pkgs) mkShell nickel; }:
in
{
devShells = {
default = mkShell {
buildInputs = [ nickel ];
shellHook = '' flake-utils.lib.eachDefaultSystem (system:
${nickel}/bin/nickel --version let
''; pkgs = import nixpkgs { inherit system; };
}; in
}; {
}); devShell = pkgs.mkShell {
buildInputs = with pkgs; [ nickel ];
shellHook = ''
${pkgs.nickel}/bin/nickel --version
'';
};
});
} }

View file

@ -6,21 +6,23 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
flake-utils.lib.eachDefaultSystem (system: { self
let , flake-utils
pkgs = import nixpkgs { inherit system; }; , nixpkgs
inherit (pkgs) mkShell nim; }:
in
{
devShells = {
default = mkShell {
buildInputs = [ nim ];
shellHook = '' flake-utils.lib.eachDefaultSystem (system:
${nim}/bin/nim --version let
''; pkgs = import nixpkgs { inherit system; };
}; in
}; {
}); devShell = pkgs.mkShell {
buildInputs = with pkgs; [ nim ];
shellHook = ''
${pkgs.nim}/bin/nim --version
'';
};
});
} }

View file

@ -6,26 +6,27 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
in
dhallNix = pkgs.haskellPackages.dhall-nix; {
devShell = {
nixRelatedTools = with pkgs; [ buildInputs = with pkgs; [
cachix cachix
dhallNix
lorri lorri
niv niv
nixfmt nixfmt
statix statix
vulnix vulnix
haskellPackages.dhall-nix
]; ];
};
inherit (pkgs) mkShell; });
in
{
devShells = { default = mkShell { buildInputs = nixRelatedTools; }; };
});
} }

View file

@ -6,26 +6,30 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
nodeOverlay = self: super: rec { overlays = [
(self: super: rec {
nodejs = super.nodejs-18_x; nodejs = super.nodejs-18_x;
pnpm = super.nodePackages.pnpm; pnpm = super.nodePackages.pnpm;
yarn = (super.yarn.override { inherit nodejs; }); yarn = (super.yarn.override { inherit nodejs; });
}; })
overlays = [ nodeOverlay ]; ];
pkgs = import nixpkgs { inherit overlays system; }; pkgs = import nixpkgs { inherit overlays system; };
in in
{ {
devShells = { devShell = pkgs.mkShell {
default = pkgs.mkShell { buildInputs = with pkgs; [ node2nix nodejs pnpm yarn ];
buildInputs = with pkgs; [ node2nix nodejs pnpm yarn ];
shellHook = '' shellHook = ''
echo "node `${pkgs.nodejs}/bin/node --version`" echo "node `${pkgs.nodejs}/bin/node --version`"
''; '';
}; };
}; });
});
} }

View file

@ -6,24 +6,24 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
flake-utils.lib.eachDefaultSystem (system: { self
let , flake-utils
pkgs = import nixpkgs { inherit system; }; , nixpkgs
inherit (pkgs) mkShell; }:
ocaml = pkgs.ocamlPackages.ocaml;
ocamlTools = with pkgs.ocamlPackages;
[ dune_3 odoc ] ++ (with pkgs; [ ocamlformat ]);
in
{
devShells = {
default = mkShell {
buildInputs = [ ocaml ] ++ ocamlTools;
shellHook = '' flake-utils.lib.eachDefaultSystem (system:
${ocaml}/bin/ocaml --version let
''; pkgs = import nixpkgs { inherit system; };
}; in
}; {
}); devShell = pkgs.mkShell {
buildInputs = with pkgs; [ ocaml ocamlformat ] ++
(with pkgs.ocamlPackages; [ dune_3 odoc ]);
shellHook = ''
${pkgs.ocaml}/bin/ocaml --version
'';
};
});
} }

View file

@ -6,23 +6,23 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
inherit (pkgs) conftest mkShell open-policy-agent; in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ open-policy-agent conftest ];
opaTools = [ conftest open-policy-agent ]; shellHook = ''
in ${pkgs.open-policy-agent}/bin/opa version
{ '';
devShells = { };
default = mkShell { });
buildInputs = opaTools;
shellHook = ''
${open-policy-agent}/bin/opa version
'';
};
};
});
} }

View file

@ -6,22 +6,23 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
inherit (pkgs) buf mkShell protobuf; in
in {
{ devShell = pkgs.mkShell {
devShells = { buildInputs = with pkgs; [ buf protobuf ];
default = mkShell {
buildInputs = [ buf protobuf ];
shellHook = '' shellHook = with pkgs; ''
echo "buf `${buf}/bin/buf --version`" echo "buf `${buf}/bin/buf --version`"
${protobuf}/bin/protoc --version ${protobuf}/bin/protoc --version
''; '';
}; };
}; });
});
} }

View file

@ -7,29 +7,31 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, mach-nix, nixpkgs }: outputs =
{ self
, flake-utils
, mach-nix
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = import nixpkgs { inherit system; }; overlays = [
inherit (pkgs) mkShell; (self: super: {
machNix = mach-nix.defaultPackage.${system};
python = super.python311;
})
];
python = pkgs.python311; pkgs = import nixpkgs { inherit overlays system; };
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ python machNix virtualenv ] ++
(with pkgs.python311Packages; [ pip ]);
machNix = mach-nix.defaultPackage.${system}; shellHook = ''
${pkgs.python}/bin/python --version
pythonTools = with pkgs; '';
[ virtualenv ] ++ (with pkgs.python311Packages; [ pip ]); };
nixTools = [ machNix ]; });
in
{
devShells = {
default = mkShell {
buildInputs = [ python ] ++ pythonTools ++ nixTools;
shellHook = ''
${python}/bin/python --version
'';
};
};
});
} }

View file

@ -6,23 +6,27 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = import nixpkgs { inherit system; }; overlays = [
inherit (pkgs) mkShell; (self: super: {
ruby = super.ruby_3_1;
})
];
pkgs = import nixpkgs { inherit overlays system; };
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ ruby ];
ruby = pkgs.ruby_3_1; shellHook = ''
in ${pkgs.ruby}/bin/ruby --version
{ '';
devShells = { };
default = mkShell { });
buildInputs = [ ruby ];
shellHook = ''
${ruby}/bin/ruby --version
'';
};
};
});
} }

View file

@ -7,41 +7,48 @@
rust-overlay.url = "github:oxalica/rust-overlay"; rust-overlay.url = "github:oxalica/rust-overlay";
}; };
outputs = { self, flake-utils, nixpkgs, rust-overlay }: outputs =
{ self
, flake-utils
, nixpkgs
, rust-overlay
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
overlays = [ (import rust-overlay) ]; overlays = [
(import rust-overlay)
(self: super: {
rustToolchain =
let
rust = super.rust-bin;
in
if builtins.pathExists ./rust-toolchain.toml then
rust.fromRustupToolchainFile ./rust-toolchain.toml
else if builtins.pathExists ./rust-toolchain then
rust.fromRustupToolchainFile ./rust-toolchain
else
rust.stable.latest.default;
})
];
pkgs = import nixpkgs { inherit system overlays; }; pkgs = import nixpkgs { inherit system overlays; };
in
{
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
rustToolchain
openssl
pkg-config
cargo-audit
cargo-deny
cargo-cross
rust-analyzer
] ++ pkgs.lib.optionals (pkgs.stdenv.isLinux) (with pkgs; [ cargo-watch ]); # Currently broken on macOS
inherit (pkgs) mkShell rust-bin; shellHook = ''
inherit (pkgs.lib) optionals; ${pkgs.rustToolchain}/bin/cargo --version
inherit (pkgs.stdenv) isLinux; '';
};
rust = });
if builtins.pathExists ./rust-toolchain.toml then
rust-bin.fromRustupToolchainFile ./rust-toolchain.toml
else if builtins.pathExists ./rust-toolchain then
rust-bin.fromRustupToolchainFile ./rust-toolchain
else
rust-bin.stable.latest.default;
deps = with pkgs; [ openssl pkgconfig ];
rustTools = with pkgs;
[ cargo-audit cargo-deny cargo-cross rust-analyzer ]
++ optionals isLinux (with pkgs; [ cargo-watch ]);
in
{
packages.default = rust;
devShells = {
default = mkShell {
nativeBuildInputs = [ rust ] ++ deps ++ rustTools;
shellHook = ''
${rust}/bin/cargo --version
'';
};
};
});
} }

View file

@ -6,35 +6,37 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let
jdk = "jdk17";
config = { let
packageOverrides = p: { javaVersion = 17;
sbt = p.sbt.override { jre = p.${jdk}; };
scala_3 = p.scala_3.override { jre = p.${jdk}; }; overlays = [
(self: super: rec {
jdk = super."jdk${toString javaVersion}";
sbt = super.sbt.override {
jre = jdk;
}; };
}; scala = super.scala_3.override {
jre = jdk;
pkgs = import nixpkgs { inherit config jdk system; };
inherit (pkgs) mkShell;
scala = pkgs.scala_3;
buildTools = with pkgs; [ sbt ];
in
{
devShells = {
default = mkShell {
buildInputs = [ scala ] ++ buildTools;
shellHook = ''
${scala}/bin/scala -version
'';
}; };
}; })
}); ];
pkgs = import nixpkgs { inherit overlays system; };
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ scala sbt coursier ];
shellHook = ''
${pkgs.scala}/bin/scala -version
'';
};
});
} }

View file

@ -6,23 +6,23 @@
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
}; };
outputs = { self, flake-utils, nixpkgs }: outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
zigPkg = pkgs.zig; in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ zig ];
inherit (pkgs) mkShell; shellHook = ''
in echo "zig `${pkgs.zig}/bin/zig version`"
{ '';
devShells = { };
default = mkShell { });
buildInputs = [ zigPkg ];
shellHook = ''
echo "zig `${zigPkg}/bin/zig version`"
'';
};
};
});
} }