Skip to content

Commit

Permalink
better to have direnv outside of module
Browse files Browse the repository at this point in the history
  • Loading branch information
jashan-lco committed Feb 5, 2025
1 parent 8dabe30 commit 1e30029
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
6 changes: 0 additions & 6 deletions flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ in
in {
name = "devenv-k8s";

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

imports = [
./skaffold-builder.nix
./cd.nix
Expand Down
9 changes: 9 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@
skaffold = inputs'.skaffold.packages.default;
};

devenv.shells.default = {

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

};

flake = {
Expand Down
12 changes: 12 additions & 0 deletions templates/app-repo/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
description = "Description for the project";

inputs = {
devenv-root = {
url = "file+file:///dev/null";
flake = false;
};

nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
devenv-k8s.url = "github:LCOGT/devenv-k8s";
Expand Down Expand Up @@ -39,6 +44,13 @@
# Enter using `nix develop --impure`
config.devenv.shells.default = {

# use direnv without --impure
devenv.root =
let
devenvRootFileContent = builtins.readFile inputs.devenv-root.outPath;
in
pkgs.lib.mkIf (devenvRootFileContent != "") devenvRootFileContent;

# https://devenv.sh/packages/
packages = [

Expand Down

0 comments on commit 1e30029

Please sign in to comment.