Do not sync direnv
It will only add the the cache to gcroots on the first computer that built it, so everyone else has to re-fetch it.
This commit is contained in:
parent
3690815630
commit
65817f4e70
1 changed files with 43 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
||||||
# Allow switching to a specific environment when going into a directory
|
# Allow switching to a specific environment when going into a directory
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
@ -11,7 +14,46 @@
|
||||||
enableZshIntegration = true;
|
enableZshIntegration = true;
|
||||||
nix-direnv.enable = true;
|
nix-direnv.enable = true;
|
||||||
};
|
};
|
||||||
git.ignores = [ ".envrc" ".direnv" ];
|
git.ignores = [
|
||||||
|
".envrc"
|
||||||
|
".direnv"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
systemd.user.services.direnv_ignore = {
|
||||||
|
Service = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = lib.getExe (
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = "direnv_ignore";
|
||||||
|
text =
|
||||||
|
''
|
||||||
|
ignore_direnv() {
|
||||||
|
dir="$1"
|
||||||
|
if [ ! -f "$dir/.stignore" ]
|
||||||
|
then
|
||||||
|
touch "$dir/.stignore"
|
||||||
|
fi
|
||||||
|
rule="**/.direnv"
|
||||||
|
if ! grep -qFx "$rule" "$dir/.stignore"
|
||||||
|
then
|
||||||
|
echo "$rule" >> "$dir/.stignore"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
''
|
||||||
|
+ (lib.trivial.pipe config.frogeye.folders [
|
||||||
|
builtins.attrValues
|
||||||
|
(builtins.filter (folder: folder.syncthing.enable))
|
||||||
|
(builtins.map (folder: ''
|
||||||
|
ignore_direnv ${lib.strings.escapeShellArg folder.fullPath}
|
||||||
|
''))
|
||||||
|
lib.strings.concatLines
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
Install = {
|
||||||
|
WantedBy = [ "default.target" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue