Skip to content

Commit

Permalink
Fix shells
Browse files Browse the repository at this point in the history
  • Loading branch information
lucperkins committed Jul 20, 2024
1 parent 4ddce11 commit 28cd260
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 81 deletions.
19 changes: 10 additions & 9 deletions clojure/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@

let
javaVersion = 22; # Change this value to update the whole stack
overlays = [
(final: prev: rec {
jdk = prev."jdk${toString javaVersion}";
boot = prev.boot.override { inherit jdk; };
clojure = prev.clojure.override { inherit jdk; };
leiningen = prev.leiningen.override { inherit jdk; };
})
];

supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit overlays system; };
pkgs = import nixpkgs { inherit system; overlays = [ self.overlays.default ]; };
});
in
{
overlays.default =
final: prev: rec {
jdk = prev."jdk${toString javaVersion}";
boot = prev.boot.override { inherit jdk; };
clojure = prev.clojure.override { inherit jdk; };
leiningen = prev.leiningen.override { inherit jdk; };
};

devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [ boot clojure leiningen ];
Expand Down
5 changes: 1 addition & 4 deletions elixir/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
pkgs = import nixpkgs { inherit system; overlays = [ self.overlays.default ]; };
});
in
{
Expand Down
11 changes: 9 additions & 2 deletions go/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@
outputs = { self, nixpkgs }:
let
goVersion = 22; # Change this to update the whole stack
overlays = [ (final: prev: { go = final."go_1_${toString goVersion}"; }) ];

supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit overlays system; };
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
});
in
{
overlays.default = final: prev: {
go = final."go_1_${toString goVersion}";
};

devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
Expand Down
19 changes: 10 additions & 9 deletions java/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,23 @@
outputs = { self, nixpkgs }:
let
javaVersion = 22; # Change this value to update the whole stack
overlays = [
(final: prev: rec {
jdk = prev."jdk${toString javaVersion}";
gradle = prev.gradle.override { java = jdk; };
maven = prev.maven.override { inherit jdk; };
})
];

supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit overlays system; };
pkgs = import nixpkgs { inherit system; };
});
in
{
overlays.default =
final: prev: rec {
jdk = prev."jdk${toString javaVersion}";
maven = prev.maven.override { jre = jdk; };
gradle = prev.gradle.override { java = jdk; };
};

devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [ jdk gradle maven jdt-language-server ];
packages = with pkgs; [ maven gradle gcc ncurses patchelf zlib ];
};
});
};
Expand Down
15 changes: 8 additions & 7 deletions kotlin/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
outputs = { self, nixpkgs }:
let
javaVersion = 22; # Change this value to update the whole stack
overlays = [
(final: prev: rec {
jdk = prev."jdk${toString javaVersion}";
gradle = prev.gradle.override { java = jdk; };
kotlin = prev.kotlin.override { jre = jdk; };
})
];

supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in
{
overlays.default =
final: prev: rec {
jdk = prev."jdk${toString javaVersion}";
gradle = prev.gradle.override { java = jdk; };
kotlin = prev.kotlin.override { jre = jdk; };
};

devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [ kotlin gradle gcc ncurses patchelf zlib ];
Expand Down
16 changes: 7 additions & 9 deletions node/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,20 @@

outputs = { self, nixpkgs }:
let
overlays = [
(final: prev: rec {
nodejs = prev.nodejs_latest;
pnpm = prev.nodePackages.pnpm;
yarn = (prev.yarn.override { inherit nodejs; });
})
];
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit overlays system; };
pkgs = import nixpkgs { inherit system; overlays = [ self.overlays.default ]; };
});
in
{
overlays.default = final: prev: rec {
nodejs = prev.nodejs;
yarn = (prev.yarn.override { inherit nodejs; });
};

devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [ node2nix nodejs pnpm yarn ];
packages = with pkgs; [ node2nix nodejs nodePackages.pnpm yarn ];
};
});
};
Expand Down
15 changes: 7 additions & 8 deletions r/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@

outputs = { self, nixpkgs }:
let
overlays = [
(final: prev: rec {
rEnv = final.rWrapper.override {
packages = with final.rPackages; [ knitr ];
};
})
];
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit overlays system; };
pkgs = import nixpkgs { inherit system; overlays = [ self.overlays.default ]; };
});
in
{
overlays.default = final: prev: rec {
rEnv = final.rWrapper.override {
packages = with final.rPackages; [ knitr ];
};
};

devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs;
Expand Down
15 changes: 8 additions & 7 deletions rust-toolchain/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@

outputs = { self, nixpkgs, rust-overlay }:
let
overlays = [
rust-overlay.overlays.default
(final: prev: {
rustToolchain = final.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
})
];
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit overlays system; };
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default self.overlays.default ];
};
});
in
{
overlays.default = final: prev: {
rustToolchain = final.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
};

devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
Expand Down
37 changes: 19 additions & 18 deletions rust/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,30 @@

outputs = { self, nixpkgs, rust-overlay }:
let
overlays = [
rust-overlay.overlays.default
(final: prev: {
rustToolchain =
let
rust = prev.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.override {
extensions = [ "rust-src" "rustfmt" ];
};
})
];
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit overlays system; };
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default self.overlays.default ];
};
});
in
{
overlays.default = final: prev: {
rustToolchain =
let
rust = prev.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.override {
extensions = [ "rust-src" "rustfmt" ];
};
};

devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
Expand Down
16 changes: 8 additions & 8 deletions scala/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
outputs = { self, nixpkgs }:
let
javaVersion = 22; # Change this value to update the whole stack
overlays = [
(final: prev: rec {
jdk = prev."jdk${toString javaVersion}";
sbt = prev.sbt.override { jre = jdk; };
scala = prev.scala_3.override { jre = jdk; };
})
];

supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
pkgs = import nixpkgs { inherit system; overlays = [ self.overlays.default ]; };
});
in
{
overlays.default = final: prev: rec {
jdk = prev."jdk${toString javaVersion}";
sbt = prev.sbt.override { jre = jdk; };
scala = prev.scala_3.override { jre = jdk; };
};

devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [ scala sbt coursier ];
Expand Down

0 comments on commit 28cd260

Please sign in to comment.