helm/modules/desktop/apps/graphics.nix

51 lines
1.6 KiB
Nix
Raw Normal View History

2020-03-28 22:48:43 -07:00
# modules/desktop/apps/graphics.nix
#
# The hardest part about switching to linux? Sacrificing Adobe. It really is
# difficult to replace and its open source alternatives don't *quite* cut it,
# but enough that I can do a fraction of it on Linux. For the rest I have a
# second computer dedicated to design work (and gaming).
{ config, options, lib, pkgs, ... }:
with lib;
{
options.modules.desktop.apps.graphics =
let mkBoolDefault = bool: mkOption {
type = types.bool;
default = bool;
};
in {
enable = mkBoolDefault false;
tools.enable = mkBoolDefault false;
raster.enable = mkBoolDefault false;
vector.enable = mkBoolDefault false;
sprites.enable = mkBoolDefault false;
};
config = let gfx = config.modules.desktop.apps.graphics; in {
my.packages = with pkgs;
(if gfx.enable || gfx.tools.enable then [
font-manager # so many damned fonts...
imagemagick # for image manipulation from the shell
] else []) ++
# replaces illustrator & indesign
(if gfx.enable || gfx.vector.enable then [
2020-07-27 23:17:21 -07:00
unstable.inkscape
2020-03-28 22:48:43 -07:00
] else []) ++
# Replaces photoshop
(if gfx.enable || gfx.raster.enable then [
krita
gimp
gimpPlugins.resynthesizer2 # content-aware scaling in gimp
] else []) ++
# Sprite sheets & animation
(if gfx.enable || gfx.sprites.enable then [ aseprite-unfree ] else []);
my.home.xdg.configFile = mkIf (gfx.enable || gfx.raster.enable) {
"GIMP/2.10" = { source = <config/gimp>; recursive = true; };
};
};
}