From d6bec3b137d93ef90a98ff02f4ffed118025a31b Mon Sep 17 00:00:00 2001 From: Tomo <68489118+Tomodachi94@users.noreply.github.com> Date: Sun, 14 Apr 2024 13:53:46 -0700 Subject: [PATCH] wip --- home-modules/default.nix | 5 +++ home-modules/neovide/default.nix | 59 ++++++++++++++++++++++++++++++++ home/common/default.nix | 4 +++ 3 files changed, 68 insertions(+) create mode 100644 home-modules/default.nix create mode 100644 home-modules/neovide/default.nix diff --git a/home-modules/default.nix b/home-modules/default.nix new file mode 100644 index 0000000..eb451d6 --- /dev/null +++ b/home-modules/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./neovide + ]; +} diff --git a/home-modules/neovide/default.nix b/home-modules/neovide/default.nix new file mode 100644 index 0000000..4a95453 --- /dev/null +++ b/home-modules/neovide/default.nix @@ -0,0 +1,59 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.programs.neovide; + + settingsFormat = pkgs.formats.toml { }; + +in { + meta.maintainers = with hm.maintainers; [ tomodachi94 ]; + + options.programs.neovide = { + enable = mkEnableOption + "neovide, a simple, no-nonsense, cross-platform graphical user interface for Neovim"; + + package = mkPackageOption pkgs "neovide" { }; + + settings = mkOption { + type = settingsFormat.type; + example = lib.literalExpression '' + { + wsl = false; + no-multigrid = false; + vsync = true; + maximized = false; + srgb = false; + idle = true; + neovim-bin = "${pkgs.lib.getExe myCustomNeovimPackage}"; + frame = "full"; + title-hidden = true; + tabs = true; + font = { + normal = [ "MonoLisa Nerd Font" ]; + size = 18; + features = { + MonoLisa = [ "+ss01" "+ss07" "+ss11" "-calt" "+ss09" "+ss02" "+ss14" "+ss16" "+ss17" ]; + }; + }; + } + ''; + default = { + neovim-bin = lib.mkDefault (lib.getExe config.programs.neovim.package); # Respect the user's programs.neovim configuration + }; + description = '' + Neovide configuration, written to {file}`$XDG_CONFIG_HOME/neovide/config.toml`. + For available settings and default values, see . + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ cfg.package ]; + + xdg.configFile."neovide/config.toml".source = + settingsFormat.generate "neovide-config.toml" cfg.settings; + }; +} diff --git a/home/common/default.nix b/home/common/default.nix index 8ea1786..1ceaac1 100644 --- a/home/common/default.nix +++ b/home/common/default.nix @@ -20,5 +20,9 @@ ./syncthing ./zoxide ./zsh + + ../../home-modules ]; + programs.neovide.enable = true; + programs.neovide.settings.wsl = true; }