From e1888c72a8b5b6c803c288cfa9727fa38e0dbe77 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Tue, 23 Apr 2024 13:54:45 +0300 Subject: [PATCH] modules: move flameshot to the programs --- .../window-manager/hyprland/default.nix | 6 ++--- .../configs/window-manager/xmonad/default.nix | 14 ----------- modules/home-manager/programs/default.nix | 1 + modules/home-manager/programs/flameshot.nix | 25 +++++++++++++++++++ users/jan/default.nix | 2 ++ users/nas/default.nix | 16 ++++++------ 6 files changed, 40 insertions(+), 24 deletions(-) create mode 100644 modules/home-manager/programs/flameshot.nix diff --git a/modules/home-manager/configs/window-manager/hyprland/default.nix b/modules/home-manager/configs/window-manager/hyprland/default.nix index 8b26300..bad721e 100644 --- a/modules/home-manager/configs/window-manager/hyprland/default.nix +++ b/modules/home-manager/configs/window-manager/hyprland/default.nix @@ -111,7 +111,6 @@ in "$terminal" = "wezterm start"; "$browser" = "librewolf"; - "$fileManager" = "vifm"; "$menu" = "dmenu-wl_run"; "$m1" = "ALT_L"; @@ -121,7 +120,8 @@ in # programs "$m1 SHIFT, Return, exec, $terminal" "$m1 SHIFT, B, exec, $browser" - "$m1, p, exec, $menu" + "$m1 SHIFT, S, exec, flameshot gui" + "$m1, P, exec, $menu" # focus (lib.flip lib.mapAttrsToList { k = "prev"; j = "next"; } (k: d: [ @@ -129,7 +129,7 @@ in "$m1 SHIFT, ${k}, layoutmsg, swap${d}" ])) "$m1, Return, layoutmsg, swapwithmaster, master" - "$m1, s, exec, ${easyfocus}/bin/easyfocus-hyprland" + "$m1, S, exec, ${easyfocus}/bin/easyfocus-hyprland" # comma (,) "$m1, code:44, layoutmsg, addmaster" # period (.) diff --git a/modules/home-manager/configs/window-manager/xmonad/default.nix b/modules/home-manager/configs/window-manager/xmonad/default.nix index 7620028..3c2174a 100644 --- a/modules/home-manager/configs/window-manager/xmonad/default.nix +++ b/modules/home-manager/configs/window-manager/xmonad/default.nix @@ -93,19 +93,5 @@ in ${pkgs.nitrogen}/bin/nitrogen --restore & ''; }; - - services.flameshot = { - enable = true; - - # See: https://github.com/flameshot-org/flameshot/blob/master/flameshot.example.ini - settings = { - General = { - disabledTrayIcon = true; - savePathFixed = true; - showDesktopNotification = false; - showSidePanelButton = true; - }; - }; - }; }; } diff --git a/modules/home-manager/programs/default.nix b/modules/home-manager/programs/default.nix index f058112..2a34216 100644 --- a/modules/home-manager/programs/default.nix +++ b/modules/home-manager/programs/default.nix @@ -5,6 +5,7 @@ ./aerc.nix ./communication.nix ./dev-tools.nix + ./flameshot.nix ./libreoffice.nix ./share-files.nix ./editors diff --git a/modules/home-manager/programs/flameshot.nix b/modules/home-manager/programs/flameshot.nix new file mode 100644 index 0000000..ccae703 --- /dev/null +++ b/modules/home-manager/programs/flameshot.nix @@ -0,0 +1,25 @@ +{ config, lib, ... }: + +let cfg = config.local.programs.flameshot; in + +{ + options.local.programs.flameshot = with lib; { + enable = mkEnableOption "flameshot"; + }; + + config = lib.mkIf cfg.enable { + services.flameshot = { + enable = true; + + # See: https://github.com/flameshot-org/flameshot/blob/master/flameshot.example.ini + settings = { + General = { + disabledTrayIcon = true; + savePathFixed = true; + showDesktopNotification = false; + showSidePanelButton = true; + }; + }; + }; + }; +} diff --git a/users/jan/default.nix b/users/jan/default.nix index bc228e4..8a123bc 100644 --- a/users/jan/default.nix +++ b/users/jan/default.nix @@ -105,6 +105,8 @@ local.programs.share-files.croc.enable = lib.mkDefault true; + local.programs.flameshot.enable = lib.mkDefault true; + ################################################################################ # Services ################################################################################ diff --git a/users/nas/default.nix b/users/nas/default.nix index 2525ce3..0b920ff 100644 --- a/users/nas/default.nix +++ b/users/nas/default.nix @@ -23,16 +23,16 @@ # Configs ################################################################################ - local.keyboard.enable = true; + local.keyboard.enable = lib.mkDefault true; local.window-manager = { - xmonad.enable = true; - polybar.enable = true; + xmonad.enable = lib.mkDefault true; + polybar.enable = lib.mkDefault true; }; - xdg.enable = true; + xdg.enable = lib.mkDefault true; - local.shell.enable = true; + local.shell.enable = lib.mkDefault true; ################################################################################ # Programs @@ -49,10 +49,12 @@ skype.enable = lib.mkDefault true; }; - local.programs.share-files.croc.enable = true; + local.programs.share-files.croc.enable = lib.mkDefault true; + + local.programs.flameshot.enable = lib.mkDefault true; local.programs.libreoffice = { - enable = true; + enable = lib.mkDefault true; spellCheckDicts = with pkgs.hunspellDicts; [ ru_RU