treewide: implement auto importing for modules
Reduce maintenance burden and increase efficiency by automatically importing modules following a specific convention. Co-authored-by: awwpotato <awwpotato@voidq.com> Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
fefeb0e928
commit
4fca600cb1
461 changed files with 72 additions and 474 deletions
37
modules/programs/script-directory/default.nix
Normal file
37
modules/programs/script-directory/default.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.script-directory;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.hm.maintainers.janik ];
|
||||
|
||||
options.programs.script-directory = {
|
||||
enable = lib.mkEnableOption "script-directory";
|
||||
|
||||
package = lib.mkPackageOption pkgs "script-directory" { };
|
||||
|
||||
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";
|
||||
}
|
||||
'';
|
||||
description = "script-directory config, for options take a look at the [documentation](https://github.com/ianthehenry/sd#options)";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
home = {
|
||||
packages = [ cfg.package ];
|
||||
sessionVariables = cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue