mirror of
https://github.com/teslamate-org/teslamate.git
synced 2026-01-24 21:06:08 +08:00
fix: Avoid the need for impure for devenv (#4245)
Based on https://github.com/cachix/devenv/pull/1018/files
This commit is contained in:
@@ -1 +1 @@
|
||||
use flake . --impure
|
||||
use flake . --override-input devenv-root "file+file://"<(printf %s "$PWD")
|
||||
|
||||
Generated
+13
@@ -46,6 +46,18 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"devenv-root": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"narHash": "sha256-d6xi4mKdjkX2JFicDIv5niSzpyI0m/Hnm8GGAIU04kY=",
|
||||
"type": "file",
|
||||
"url": "file:///dev/null"
|
||||
},
|
||||
"original": {
|
||||
"type": "file",
|
||||
"url": "file:///dev/null"
|
||||
}
|
||||
},
|
||||
"devenv_2": {
|
||||
"inputs": {
|
||||
"flake-compat": [
|
||||
@@ -539,6 +551,7 @@
|
||||
"root": {
|
||||
"inputs": {
|
||||
"devenv": "devenv",
|
||||
"devenv-root": "devenv-root",
|
||||
"flake-utils": "flake-utils_4",
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user