fix: Avoid the need for impure for devenv (#4245)

Based on https://github.com/cachix/devenv/pull/1018/files
This commit is contained in:
Brian May
2024-10-06 08:35:54 +02:00
committed by GitHub
parent dc64687ba8
commit a4f47518d8
3 changed files with 26 additions and 2 deletions
+12 -1
View File
@@ -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;
@@ -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