Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new(nix): Added flake-based devshell setup leveraging your own flake / overlay #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@
/classes
/target
.garden/
.direnv
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
description = "A Nix-flake-based development environment for application.garden";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
garden.url = "github:nextjournal/garden-cli";
};

outputs = { self, nixpkgs, garden }:
let
# Latest LTS releases as of Nov 2023
javaVersion = 21;
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 = [
garden.overlays.default
];
};
});
in {
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
buildInputs = [ pkgs.clojure pkgs.garden ];
};
});
};
}