2023-05-19 10:29:27 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
let cfg = config.programs.script-directory;
|
|
|
|
in {
|
|
|
|
meta.maintainers = [ lib.maintainers.janik ];
|
|
|
|
|
|
|
|
options.programs.script-directory = {
|
2023-07-02 01:45:18 +02:00
|
|
|
enable = lib.mkEnableOption "script-directory";
|
2023-05-19 10:29:27 +02:00
|
|
|
|
2023-07-02 01:45:18 +02:00
|
|
|
package = lib.mkPackageOption pkgs "script-directory" { };
|
2023-05-19 10:29:27 +02:00
|
|
|
|
|
|
|
settings = lib.mkOption {
|
|
|
|
default = { };
|
|
|
|
type = lib.types.attrsOf lib.types.str;
|
|
|
|
example = lib.literalExpression ''
|
|
|
|
{
|
|
|
|
SD_ROOT = "''${config.home.homeDirectory}/.sd";
|
|
|
|
SD_EDITOR = "nvim";
|
|
|
|
SD_CAT = "lolcat";
|
|
|
|
}
|
|
|
|
'';
|
2023-07-02 01:45:18 +02:00
|
|
|
description =
|
2023-07-20 19:52:05 +02:00
|
|
|
"script-directory config, for options take a look at the [documentation](https://github.com/ianthehenry/sd#options)";
|
2023-05-19 10:29:27 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
home = {
|
|
|
|
packages = [ cfg.package ];
|
|
|
|
sessionVariables = cfg.settings;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|