From 059f1cdeafb54e35b84637f730d860c656b5b472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madeleine=20Sydney=20=C5=9Alaga?= Date: Sun, 14 Sep 2025 01:12:04 -0600 Subject: [PATCH] feat(rnote): Add Rnote module --- modules/home/users/crumb/rnote.nix | 60 ++++++++++++++++++++++++++++++ users/crumb/default.nix | 1 + 2 files changed, 61 insertions(+) create mode 100644 modules/home/users/crumb/rnote.nix diff --git a/modules/home/users/crumb/rnote.nix b/modules/home/users/crumb/rnote.nix new file mode 100644 index 0000000..30fc7e0 --- /dev/null +++ b/modules/home/users/crumb/rnote.nix @@ -0,0 +1,60 @@ +{ config, lib, pkgs, ... }: + +let cfg = config.sydnix.users.crumb.rnote; +in { + options.sydnix.users.crumb.rnote = { + enable = lib.mkEnableOption "Rnote"; + }; + + config = lib.mkIf cfg.enable { + home.packages = [ + pkgs.rnote + ]; + + # C.f. https://github.com/gepbird/dotfiles/blob/main/modules/rnote.nix. + # Browse options with + # dconf read /com/github/flxzt/rnote/engine-config \ + # | sed -e # "s/'\(.*\)'/\1/" | jq + dconf.settings."com/github/flxzt/rnote" = + let + colour = r: g: b: a: { inherit r g b a; }; + stylix = name: { + r = builtins.fromJSON config.lib.stylix.colors."${name}-dec-r"; + g = builtins.fromJSON config.lib.stylix.colors."${name}-dec-g"; + b = builtins.fromJSON config.lib.stylix.colors."${name}-dec-b"; + a = 1.0; + }; + weird-stylix = name: let c = stylix name; + in lib.gvariant.mkTuple [c.r c.g c.b c.a]; + in { + active-stroke-color = weird-stylix "base06"; # Old White + active-fill-color = weird-stylix "base06"; # Old White + engine-config = builtins.toJSON { + penholder.shortcuts = { + stylus_secondary_button.change_pen_style = { + style = "selector"; + mode = "toggle"; + }; + stylus_primary_button.change_pen_style = { + style = "tools"; + mode = "toggle"; + }; + }; + document.background = { + color = stylix "base00"; # Sumi Ink 1 + pattern_color = stylix "base06"; # Old White + format = { + show_borders = false; + border_color = colour 0.0 0.0 0.0 0.0; + }; + }; + pens_config = { + brush_config = { + stroke_color = stylix "base06"; # Old White + fill_color = stylix "base06"; # Old White + }; + }; + }; + }; + }; +} diff --git a/users/crumb/default.nix b/users/crumb/default.nix index 23a9c89..91ff4f2 100644 --- a/users/crumb/default.nix +++ b/users/crumb/default.nix @@ -49,6 +49,7 @@ # Personal configurations. users.crumb = { age.enable = true; + rnote.enable = true; default-applications.enable = true; fcitx5.enable = true; bash.enable = true;