diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 3ec2d5904..576387344 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1033,6 +1033,12 @@ in defaults to 'pkgs.openssh'. ''; } + { + time = "2023-05-18T21:03:30+00:00"; + message = '' + A new module is available: 'programs.shell-directory'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 91b8bf0b3..e219817d7 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -169,6 +169,7 @@ let ./programs/sagemath.nix ./programs/sbt.nix ./programs/scmpuff.nix + ./programs/script-directory.nix ./programs/senpai.nix ./programs/sioyek.nix ./programs/skim.nix diff --git a/modules/programs/script-directory.nix b/modules/programs/script-directory.nix new file mode 100644 index 000000000..2f19a32fc --- /dev/null +++ b/modules/programs/script-directory.nix @@ -0,0 +1,31 @@ +{ config, pkgs, lib, ... }: +let cfg = config.programs.script-directory; +in { + meta.maintainers = [ lib.maintainers.janik ]; + + options.programs.script-directory = { + enable = lib.mkEnableOption "script-directory"; + + package = lib.mkPackageOptionMD 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 = lib.mdDoc + "script-directory config, for options take a look at the [documentation](github.com/ianthehenry/sd#options)"; + }; + }; + config = lib.mkIf cfg.enable { + home = { + packages = [ cfg.package ]; + sessionVariables = cfg.settings; + }; + }; +}