1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-02 07:01:03 +01:00
home-manager/modules/programs/hyprshot.nix
Joker9944 3dcae8af51 hyprshot: init module
Co-authored-by: Austin Horstman <khaneliman12@gmail.com>
2025-08-17 09:45:28 -05:00

38 lines
978 B
Nix

{
config,
pkgs,
lib,
...
}:
let
cfg = config.programs.hyprshot;
in
{
meta.maintainers = with lib.hm.maintainers; [
joker9944
];
options.programs.hyprshot = {
enable = lib.mkEnableOption "Hyprshot the Hyprland screenshot utility";
package = lib.mkPackageOption pkgs "hyprshot" { nullable = true; };
saveLocation = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
example = "$HOME/Pictures/Screenshots";
description = ''
Set the `$HYPRSHOT_DIR` environment variable to the given location.
Hypershot will save screenshots to the first expression that resolves:
- `$HYPRSHOT_DIR`
- `$XDG_PICTURES_DIR`
- `$(xdg-user-dir PICTURES)`
'';
};
};
config.home = lib.mkIf cfg.enable {
packages = lib.mkIf (cfg.package != null) [ cfg.package ];
sessionVariables = lib.mkIf (cfg.saveLocation != null) { HYPRSHOT_DIR = cfg.saveLocation; };
};
}