c: Move into own file
This commit is contained in:
parent
881b22c9b2
commit
42bc007ed4
10 changed files with 182 additions and 134 deletions
64
hm/homealone.nix
Normal file
64
hm/homealone.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
config = {
|
||||
frogeye = {
|
||||
# TODO Move to relevant config file. Rest can probably removed.
|
||||
direnv = {
|
||||
CARGOHOME = "${config.xdg.cacheHome}/cargo"; # There are config in there that we can version if one want
|
||||
DASHT_DOCSETS_DIR = "${config.xdg.cacheHome}/dash_docsets";
|
||||
GOPATH = "${config.xdg.cacheHome}/go";
|
||||
GRADLE_USER_HOME = "${config.xdg.cacheHome}/gradle";
|
||||
MIX_ARCHIVES = "${config.xdg.cacheHome}/mix/archives";
|
||||
MONO_GAC_PREFIX = "${config.xdg.cacheHome}/mono";
|
||||
npm_config_cache = "${config.xdg.cacheHome}/npm";
|
||||
PARALLEL_HOME = "${config.xdg.cacheHome}/parallel";
|
||||
TERMINFO = "${config.xdg.configHome}/terminfo";
|
||||
WINEPREFIX = "${config.xdg.stateHome}/wineprefix/default";
|
||||
YARN_CACHE_FOLDER = "${config.xdg.cacheHome}/yarn";
|
||||
};
|
||||
junkhome = [
|
||||
"adb"
|
||||
"audacity"
|
||||
"cabal" # TODO May have options but last time I tried it it crashed
|
||||
"itch"
|
||||
"simplescreenrecorder" # Easy fix https://github.com/MaartenBaert/ssr/blob/1556ae456e833992fb6d39d40f7c7d7c337a4160/src/Main.cpp#L252
|
||||
"vd"
|
||||
"wpa_cli"
|
||||
# TODO Maybe we can do something about node-gyp
|
||||
];
|
||||
shellAliases = lib.attrsets.mergeAttrsList (map (p: { "${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}"; }) config.frogeye.junkhome);
|
||||
};
|
||||
home = {
|
||||
activation.createDirenvFolders = lib.hm.dag.entryAfter [ "writeBoundary" ]
|
||||
(lib.strings.concatLines (map (d: "mkdir -p ${d}") (
|
||||
(builtins.attrValues config.frogeye.direnv) ++ [ "${config.xdg.cacheHome}/junkhome" ]
|
||||
)));
|
||||
|
||||
sessionVariables = config.frogeye.direnv;
|
||||
};
|
||||
};
|
||||
options.frogeye = {
|
||||
direnv = lib.mkOption {
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
DASHT_DOCSETS_DIR = "''${config.xdg.cacheHome}/dash_docsets";
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Environment variables for which the value is a folder that will be automatically created.
|
||||
Useful for keeping programs data out of $HOME for programs that won't create the directory themselves.
|
||||
'';
|
||||
type = lib.types.attrsOf lib.types.str;
|
||||
};
|
||||
junkhome = lib.mkOption {
|
||||
default = [ ];
|
||||
description = ''
|
||||
Program names that will be run with a different HOME so they don't clutter the real one.
|
||||
Useful for programs that don't follow the XDG specification and tend to advertise themselves.
|
||||
'';
|
||||
type = lib.types.listOf lib.types.str;
|
||||
};
|
||||
# TODO Should make a nix package wrapper instead, so it also works from dmenu
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue