Refactored this a bit
This commit is contained in:
parent
3f02570d3c
commit
aa2464ef12
1 changed files with 23 additions and 23 deletions
|
|
@ -2,6 +2,12 @@
|
|||
let
|
||||
beets-cfg = config.my.beets-config;
|
||||
tmux-cfg = config.my.tmux-config;
|
||||
mkIfFlakeLoc = condition: errorMsg: value:
|
||||
(lib.mkIf (condition &&
|
||||
!(config.my.flakeLocation == null &&
|
||||
(lib.warn ("Didn't set 'my.flakeLocation', " + errorMsg) true)))
|
||||
value);
|
||||
flakeSubmodules = "${config.my.flakeLocation}/submodules";
|
||||
in
|
||||
{
|
||||
options = {
|
||||
|
|
@ -19,30 +25,24 @@ in
|
|||
|
||||
home = {
|
||||
file = {
|
||||
".config/beets/config.yaml" = lib.mkIf (beets-cfg.enable && !(
|
||||
config.my.flakeLocation == null &&
|
||||
(lib.warn
|
||||
"Didn't set 'my.flakeLocation', I won't symlink beets' config.yaml into place"
|
||||
true)
|
||||
)) {
|
||||
source = config.lib.file.mkOutOfStoreSymlink
|
||||
"${config.my.flakeLocation}/submodules/beets-config/config.yaml";
|
||||
# Recursive only applies to directories. If false, do one
|
||||
# symlink (which is the directory). Otherwise, do every file
|
||||
# recursively
|
||||
#
|
||||
# recursive = true;
|
||||
};
|
||||
".config/beets/config.yaml" = (mkIfFlakeLoc beets-cfg.enable
|
||||
"I won't symlink beets' config.yaml into place"
|
||||
{
|
||||
source = config.lib.file.mkOutOfStoreSymlink
|
||||
"${config.my.flakeLocation}/submodules/beets-config/config.yaml";
|
||||
# Recursive only applies to directories. If false, do one
|
||||
# symlink (which is the directory). Otherwise, do every file
|
||||
# recursively
|
||||
#
|
||||
# recursive = true;
|
||||
});
|
||||
|
||||
".config/tmux/tmux.conf" = lib.mkIf (tmux-cfg.enable && !(
|
||||
config.my.flakeLocation == null &&
|
||||
(lib.warn
|
||||
"Didn't set 'my.flakeLocation', I won't symlink tmux's tmux.conf into place"
|
||||
true)
|
||||
)) {
|
||||
source = config.lib.file.mkOutOfStoreSymlink
|
||||
"${config.my.flakeLocation}/submodules/tmux-config/tmux.conf";
|
||||
};
|
||||
".config/tmux/tmux.conf" = (mkIfFlakeLoc tmux-cfg.enable
|
||||
"I won't symlink tmux's tmux.conf into place"
|
||||
{
|
||||
source = config.lib.file.mkOutOfStoreSymlink
|
||||
"${flakeSubmodules}/submodules/tmux-config/tmux.conf";
|
||||
});
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue