-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
direnv: allow configuring extra files to watch from devenv.nix
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ pkgs, config, lib, ... }: | ||
|
||
let | ||
cfg = config.direnv; | ||
in | ||
{ | ||
options.direnv = { | ||
watchFiles = lib.mkOption { | ||
description = lib.mdDoc "Extra files to watch for changes and reload the direnv environment"; | ||
# TODO: best type here? any way to exclude defaults? | ||
# TODO: regex support? | ||
type = lib.types.listOf lib.types.str; | ||
default = [ ]; | ||
}; | ||
|
||
watchfiles = lib.mkOption { | ||
internal = true; | ||
type = lib.types.package; | ||
}; | ||
}; | ||
|
||
config = { | ||
direnv.watchfiles = pkgs.writeText "watchfiles.txt" (lib.concatStringsSep "\n" cfg.watchFiles); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters