File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 81
81
nix flake init --template '' ${DEVENV_ROOT}#flake-parts
82
82
nix flake update \
83
83
--override-input devenv '' ${DEVENV_ROOT}
84
- nix develop --accept-flake-config --impure --command echo nix-develop started succesfully |& tee ./console
84
+ nix develop --accept-flake-config --override-input devenv-root "file+file://"<(printf %s "$PWD") --command echo nix-develop started succesfully |& tee ./console
85
85
grep -F 'nix-develop started succesfully' <./console
86
86
grep -F "$(${ lib . getExe pkgs . hello } )" <./console
87
87
# Test that a container can be built
88
88
if $(uname) == "Linux"
89
89
then
90
- nix build --impure --accept-flake-config --show-trace .#container-processes
90
+ nix build --override-input devenv-root "file+file://"<(printf %s "$PWD") --accept-flake-config --show-trace .#container-processes
91
91
fi
92
92
popd
93
93
rm -rf "$tmp"
Original file line number Diff line number Diff line change 5
5
nix_direnv_watch_file devenv.nix
6
6
nix_direnv_watch_file devenv.lock
7
7
nix_direnv_watch_file devenv.yaml
8
- if ! use flake . --impure
8
+
9
+ if ! use flake . --override-input devenv-root " file+file://" <( printf %s " $PWD " )
9
10
then
10
11
echo " devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
11
12
fi
Original file line number Diff line number Diff line change 2
2
description = "Description for the project" ;
3
3
4
4
inputs = {
5
+ devenv-root = {
6
+ url = "file+file:///dev/null" ;
7
+ flake = false ;
8
+ } ;
5
9
nixpkgs . url = "github:cachix/devenv-nixpkgs/rolling" ;
6
10
devenv . url = "github:cachix/devenv" ;
7
11
nix2container . url = "github:nlewo/nix2container" ;
14
18
extra-substituters = "https://devenv.cachix.org" ;
15
19
} ;
16
20
17
- outputs = inputs @{ flake-parts , ... } :
21
+ outputs = inputs @{ flake-parts , devenv-root , ... } :
18
22
flake-parts . lib . mkFlake { inherit inputs ; } {
19
23
imports = [
20
24
inputs . devenv . flakeModule
33
37
packages . default = pkgs . hello ;
34
38
35
39
devenv . shells . default = {
40
+ devenv . root =
41
+ let
42
+ devenvRootFileContent = builtins . readFile devenv-root . outPath ;
43
+ in
44
+ pkgs . lib . mkIf ( devenvRootFileContent != "" ) devenvRootFileContent ;
45
+
36
46
name = "my-project" ;
37
47
38
48
imports = [
You can’t perform that action at this time.
0 commit comments