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/) |
| [Elm] | [`elm`](./elm/) |
| [Gleam] | [`gleam`](./gleam/) |
| [Go] 1.17 | [`go1_17`](./go1.17/) |
| [Go] 1.18 | [`go1_18`](./go1.18/) |
| [Go] | [`go`](./go/) |
| [Hashicorp] tools | [`hashi`](./hashi/) |
| [Java] | [`java`](./java/) |
| [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
### [`go1.17`](./go1.17/)
### [`go`](./go/)
- [Go] 1.17
- Standard Go tools ([goimports], [godoc], and others)
- [golangci-lint]
### [`go1.18`](./go1.18/)
- [Go] 1.18
- [Go] 1.19
- Standard Go tools ([goimports], [godoc], and others)
- [golangci-lint]

View file

@ -6,31 +6,38 @@
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = { self, flake-utils, nixpkgs }:
outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system:
let
jdk = "jdk17";
config = {
packageOverrides = p: {
boot = p.boot.override { jdk = p.${jdk}; };
clojure = p.clojure.override { jdk = p.${jdk}; };
leiningen = p.leiningen.override { jdk = p.${jdk}; };
let
javaVersion = 17;
overlays = [
(self: super: rec {
jdk = super."jdk${toString javaVersion}";
boot = super.boot.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
'';
clojure = super.clojure.override {
inherit jdk;
};
};
});
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";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) cue mkShell;
in
{
devShells = {
default = mkShell {
buildInputs = [ cue ];
outputs =
{ self
, flake-utils
, nixpkgs
}:
shellHook = ''
${cue}/bin/cue version
'';
};
};
});
flake-utils.lib.eachDefaultSystem (system:
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";
};
outputs = { self, flake-utils, nixpkgs }:
outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
dhall = pkgs.dhall;
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) mkShell;
inherit (pkgs.lib) optionals;
inherit (pkgs.stdenv) isLinux;
# Helper function for building dhall-* tools
mkDhallTools = ls:
builtins.map (tool: pkgs.haskellPackages."dhall-${tool}") ls;
# Helper function for building dhall-* tools
mkDhallTools = ls:
builtins.map (tool: pkgs.haskellPackages."dhall-${tool}") ls;
dhallTools = mkDhallTools [
"bash"
"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
dhallToolsCommon = mkDhallTools [
"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`"
'';
};
};
});
shellHook = ''
echo "dhall `${pkgs.dhall}/bin/dhall --version`"
'';
};
});
}

View file

@ -6,32 +6,27 @@
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = { self, flake-utils, nixpkgs }:
outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
let
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)
darwin gigalixir inotify-tools libnotify mkShell terminal-notifier;
inherit (pkgs.beam.packages.erlangR25) elixir elixir_ls;
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
'';
};
};
});
shellHook = ''
${pkgs.elixir}/bin/mix --version
${pkgs.elixir}/bin/iex --version
'';
};
});
}

View file

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

View file

@ -6,23 +6,23 @@
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = { self, flake-utils, nixpkgs }:
outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
gleamPkg = pkgs.gleam;
let
pkgs = import nixpkgs { inherit system; };
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ gleam ];
inherit (pkgs) mkShell;
in
{
devShells = {
default = mkShell {
buildInputs = [ gleamPkg ];
shellHook = ''
${gleamPkg}/bin/gleam --version
'';
};
};
});
shellHook = ''
${pkgs.gleam}/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";
};
outputs = { self, flake-utils, nixpkgs }:
outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs)
damon levant mkShell nomad nomad-autoscaler nomad-pack packer
terraform vault;
hashiTools = [
let
pkgs = import nixpkgs { inherit system; };
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
packer
terraform
nomad
@ -25,22 +28,15 @@
nomad-pack
levant
damon
terragrunt
];
relatedTools = with pkgs; [ terragrunt ];
in
{
devShells = {
default = mkShell {
buildInputs = hashiTools ++ relatedTools;
shellHook = ''
echo "packer `${packer}/bin/packer --version`"
${terraform}/bin/terraform --version
${nomad}/bin/nomad --version
${vault}/bin/vault --version
'';
};
};
});
shellHook = with pkgs; ''
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";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) cabal-install ghc mkShell;
in
{
devShells = {
default = mkShell {
buildInputs = [ cabal-install ghc ];
outputs =
{ self
, flake-utils
, nixpkgs
}:
shellHook = ''
${ghc}/bin/ghc --version
${cabal-install}/bin/cabal --version
'';
};
};
});
flake-utils.lib.eachDefaultSystem (system:
let
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";
};
outputs = { self, flake-utils, nixpkgs }:
outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system:
let
jdk = pkgs.jdk17;
let
javaVersion = 17;
config = {
packageOverrides = p: {
gradle = (p.gradle.override { java = jdk; });
overlays = [
(self: super: rec {
jdk = super."jdk${toString javaVersion}";
gradle = super.gradle.override {
java = 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
'';
maven = super.maven.override {
inherit jdk;
};
};
});
})
];
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";
};
outputs = { self, flake-utils, nixpkgs }:
outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system:
let
jdk = pkgs.jdk17;
let
javaVersion = 17;
config = {
packageOverrides = p: {
gradle = (p.gradle.override { java = jdk; });
kotlin = (p.kotlin.override { jre = jdk; });
overlays = [
(self: super: rec {
jdk = pkgs."jdk${toString javaVersion}";
gradle = super.gradle.override {
java = 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
'';
kotlin = super.kotlin.override {
jre = jdk;
};
};
});
})
];
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";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) mkShell nickel;
in
{
devShells = {
default = mkShell {
buildInputs = [ nickel ];
outputs =
{ self
, flake-utils
, nixpkgs
}:
shellHook = ''
${nickel}/bin/nickel --version
'';
};
};
});
flake-utils.lib.eachDefaultSystem (system:
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";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) mkShell nim;
in
{
devShells = {
default = mkShell {
buildInputs = [ nim ];
outputs =
{ self
, flake-utils
, nixpkgs
}:
shellHook = ''
${nim}/bin/nim --version
'';
};
};
});
flake-utils.lib.eachDefaultSystem (system:
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";
};
outputs = { self, flake-utils, nixpkgs }:
outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
dhallNix = pkgs.haskellPackages.dhall-nix;
nixRelatedTools = with pkgs; [
let
pkgs = import nixpkgs { inherit system; };
in
{
devShell = {
buildInputs = with pkgs; [
cachix
dhallNix
lorri
niv
nixfmt
statix
vulnix
haskellPackages.dhall-nix
];
inherit (pkgs) mkShell;
in
{
devShells = { default = mkShell { buildInputs = nixRelatedTools; }; };
});
};
});
}

View file

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

View file

@ -6,24 +6,24 @@
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) mkShell;
ocaml = pkgs.ocamlPackages.ocaml;
ocamlTools = with pkgs.ocamlPackages;
[ dune_3 odoc ] ++ (with pkgs; [ ocamlformat ]);
in
{
devShells = {
default = mkShell {
buildInputs = [ ocaml ] ++ ocamlTools;
outputs =
{ self
, flake-utils
, nixpkgs
}:
shellHook = ''
${ocaml}/bin/ocaml --version
'';
};
};
});
flake-utils.lib.eachDefaultSystem (system:
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";
};
outputs = { self, flake-utils, nixpkgs }:
outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) conftest mkShell open-policy-agent;
let
pkgs = import nixpkgs { inherit system; };
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ open-policy-agent conftest ];
opaTools = [ conftest open-policy-agent ];
in
{
devShells = {
default = mkShell {
buildInputs = opaTools;
shellHook = ''
${open-policy-agent}/bin/opa version
'';
};
};
});
shellHook = ''
${pkgs.open-policy-agent}/bin/opa version
'';
};
});
}

View file

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

View file

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

View file

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

View file

@ -7,41 +7,48 @@
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:
let
overlays = [ (import rust-overlay) ];
let
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;
inherit (pkgs.lib) optionals;
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
'';
};
};
});
shellHook = ''
${pkgs.rustToolchain}/bin/cargo --version
'';
};
});
}

View file

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