Skip to content

Commit b7cf341

Browse files
committed
Remove devenv impurity
1 parent 14ed3ff commit b7cf341

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

.envrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/usr/bin/env bash
2-
use flake . --impure --accept-flake-config
2+
use flake . --accept-flake-config --override-input devenv-root "file+file://"<(printf %s "$PWD")

flake.lock

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@
7373
pre-commit-hooks.follows = "pre-commit-hooks";
7474
};
7575
};
76+
devenv-root = {
77+
url = "file+file:///dev/null";
78+
flake = false;
79+
};
7680
flake-compat = {
7781
url = "github:nix-community/flake-compat/master";
7882
};

shells/default/default.nix

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is part of Nix++.
2-
# Copyright (C) 2023 Leandro Emmanuel Reina Kiperman.
2+
# Copyright (C) 2023-2024 Leandro Emmanuel Reina Kiperman.
33
#
44
# Nix++ is free software: you can redistribute it and/or modify it under the
55
# terms of the GNU General Public License as published by the Free Software
@@ -13,13 +13,19 @@
1313
# You should have received a copy of the GNU General Public License
1414
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1515

16-
{ npppkgs, pkgs, self, ... } @ args: {
16+
{ devenv-root, npppkgs, pkgs, self, ... } @ args: {
1717
inherit pkgs;
1818
inputs = builtins.removeAttrs args [ "pkgs" "system" ];
1919
modules = [
2020
# Basics
2121
({ lib, pkgs, ... }: {
2222
name = "Nix++";
23+
devenv.root =
24+
let
25+
devenvRootFileContent = builtins.readFile devenv-root.outPath;
26+
in
27+
pkgs.lib.mkIf (devenvRootFileContent != "") devenvRootFileContent
28+
;
2329
packages = with pkgs; [ cacert coreutils nixVersions.schemas ];
2430
enterShell = lib.mkBefore ''
2531
EDITOR="''${EDITOR:-${npppkgs.vim-minimal}/bin/vim}" # Default to vim

0 commit comments

Comments
 (0)