2023-02-05 04:01:18 +01:00
|
|
|
{ lib, config, ... }: {
|
2023-04-01 21:29:47 +02:00
|
|
|
options.satellite.dev = {
|
2023-02-05 04:01:18 +01:00
|
|
|
enable = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "While true, makes out of store symlinks for files in dev mode";
|
|
|
|
};
|
|
|
|
|
|
|
|
root = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
2023-12-13 19:30:04 +01:00
|
|
|
default = "${config.xdg.userDirs.extraConfig.XDG_PROJECTS_DIR}/satellite";
|
2023-02-05 04:01:18 +01:00
|
|
|
description = "Where the satellite repo is cloned";
|
|
|
|
};
|
|
|
|
|
|
|
|
path = lib.mkOption {
|
|
|
|
type = lib.types.functionTo lib.types.path;
|
|
|
|
description = "The function used to conditionally symlink in or out of store based on the above paths";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-04-01 21:29:47 +02:00
|
|
|
config.satellite.dev.path = path:
|
|
|
|
if config.satellite.dev.enable then
|
|
|
|
config.lib.file.mkOutOfStoreSymlink "${config.satellite.dev.root}/${path}"
|
2023-02-05 04:01:18 +01:00
|
|
|
else "${../..}/${path}";
|
|
|
|
}
|