Skip to content

Commit

Permalink
fix: Avoid the need for impure for devenv (#4245)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmay authored Oct 6, 2024
1 parent dc64687 commit a4f4751
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use flake . --impure
use flake . --override-input devenv-root "file+file://"<(printf %s "$PWD")
13 changes: 13 additions & 0 deletions flake.lock

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

13 changes: 12 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
nixpkgs = { url = "github:NixOS/nixpkgs/nixos-unstable"; };
flake-utils = { url = "github:numtide/flake-utils"; };
devenv.url = "github:cachix/devenv";
devenv-root = {
url = "file+file:///dev/null";
flake = false;
};
};

outputs = inputs@{ self, nixpkgs, flake-utils, devenv }:
outputs = inputs@{ self, nixpkgs, flake-utils, devenv, devenv-root }:
(flake-utils.lib.eachDefaultSystem (system:
let
inherit (pkgs.lib) optional optionals;
Expand Down Expand Up @@ -98,6 +102,13 @@
devShell = devenv.lib.mkShell {
inherit inputs pkgs;
modules = with pkgs; [{

devenv.root =
let
devenvRootFileContent = builtins.readFile devenv-root.outPath;
in
pkgs.lib.mkIf (devenvRootFileContent != "") devenvRootFileContent;

packages = [
elixir
elixir_ls
Expand Down

0 comments on commit a4f4751

Please sign in to comment.