From ce781e1d963311216b2837e014f522c3620f0639 Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Sat, 26 Nov 2022 14:31:33 +0000 Subject: [PATCH] Style GEdit :sparkles: Fixes #17 --- flake.nix | 1 + modules/gedit/default.nix | 20 ++++++ modules/gedit/template.mustache | 117 ++++++++++++++++++++++++++++++++ 3 files changed, 138 insertions(+) create mode 100644 modules/gedit/default.nix create mode 100644 modules/gedit/template.mustache diff --git a/flake.nix b/flake.nix index 4c0807af..103dcc27 100644 --- a/flake.nix +++ b/flake.nix @@ -65,6 +65,7 @@ ./modules/dunst.nix ./modules/feh.nix ./modules/fish.nix + ./modules/gedit ./modules/gnome.nix ./modules/grub.nix ./modules/gtk diff --git a/modules/gedit/default.nix b/modules/gedit/default.nix new file mode 100644 index 00000000..e60af4f9 --- /dev/null +++ b/modules/gedit/default.nix @@ -0,0 +1,20 @@ +{ pkgs, config, lib, ... }: + +let + style = config.lib.stylix.colors { + template = builtins.readFile ./template.mustache; + extension = "xml"; + }; + +in { + options.stylix.targets.gedit.enable = + config.lib.stylix.mkEnableTarget "GEdit" true; + + config = lib.mkIf config.stylix.targets.gedit.enable { + home-manager.sharedModules = [{ + xdg.dataFile = { + "gedit/styles/stylix.xml".source = style; + }; + }]; + }; +} diff --git a/modules/gedit/template.mustache b/modules/gedit/template.mustache new file mode 100644 index 00000000..e8a4ed01 --- /dev/null +++ b/modules/gedit/template.mustache @@ -0,0 +1,117 @@ + + + + Stylix + <_description>Theme configured as part of your NixOS configuration. + + + + + + + + + + + + + + + + + + +