From 3fc09b571b0ff9f0ae6a718d2a82d714c8203699 Mon Sep 17 00:00:00 2001 From: lucy Date: Mon, 31 Aug 2026 12:12:34 +0200 Subject: [PATCH] add theme file --- flake.nix | 1 + modules/programs/emacs/emacs.nix | 10 ++++++---- modules/theme.nix | 9 +++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 modules/theme.nix diff --git a/flake.nix b/flake.nix index bb4bf9e..132cc12 100644 --- a/flake.nix +++ b/flake.nix @@ -25,6 +25,7 @@ imports = [ wrappers.flakeModules.wrappers ./modules/programs/emacs/emacs.nix + ./modules/theme.nix ]; flake.nixosConfigurations.nerv = inputs.nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; diff --git a/modules/programs/emacs/emacs.nix b/modules/programs/emacs/emacs.nix index 577991c..fe12316 100644 --- a/modules/programs/emacs/emacs.nix +++ b/modules/programs/emacs/emacs.nix @@ -1,8 +1,9 @@ { inputs, lib, config, ... }: { - flake.wrappers.emacs = { pkgs, wlib, lib, config, ... }: { + flake.wrappers.emacs = { pkgs, wlib, config, ... }: + + { imports = [ wlib.wrapperModules.emacs - inputs.base16.nixosModule ]; emacsPackages = epkgs: with epkgs.melpaPackages; [ @@ -11,7 +12,8 @@ qml-mode lua-mode elcord - nix-mode + nix-mode + base16-theme ]; runtimePkgs = with pkgs; [ @@ -23,7 +25,7 @@ configFile = '' ;;; -*- lexical-binding: t; -*- (setq make-backup-files nil) - (load-theme "${base16.lib.scheme-slug}" t + (load-theme "base16-${config.theme.scheme}" t) (use-package corfu :init diff --git a/modules/theme.nix b/modules/theme.nix new file mode 100644 index 0000000..4a2a233 --- /dev/null +++ b/modules/theme.nix @@ -0,0 +1,9 @@ +{ inputs, lib }: { + options.scheme = lib.mkOption { + type = lib.types.str; + default = "${inputs.tt-schemes}/base16/oxocarbon-dark.yaml"; + example = "${inputs.tt-schemes}/base16/catppuccin-mocha.yaml"; + description = "set the used theme"; + }; + config.scheme = "${inputs.tt-schemes}/base16/oxocarbon-dark.yaml"; +}