GithubHelp home page GithubHelp logo

Comments (6)

CRTified avatar CRTified commented on August 26, 2024 1

Yes, it's defined at this place.

from stylix.

CRTified avatar CRTified commented on August 26, 2024 1

I just noticed that I missed the font config. I'll try to add that it evening (UTC+1 here).

from stylix.

dwarfmaster avatar dwarfmaster commented on August 26, 2024

Where does base16-theme-define comes from ? From there ?

from stylix.

CRTified avatar CRTified commented on August 26, 2024

For the sake of completeness: With emacs-init, I'm referring to this hm module - which might explain why base16-theme is in my scope from just that snippet above.

The base16-theme package is nonetheless available in nixpkgs, so I have the impression that this should be solvable in a relatively clean way.

from stylix.

dwarfmaster avatar dwarfmaster commented on August 26, 2024

I don't have the time to try and do this right now, but indeed I think it should be pretty straightforward to do it without the emacs-init module.

from stylix.

CRTified avatar CRTified commented on August 26, 2024

So, my current draft hm-module looks like this:

{ config, ... }:
with config.lib.stylix.colors.withHashtag;
with config.stylix.fonts; {
  programs.emacs = {
    extraPackages = epkgs:
      [
        (epkgs.trivialBuild {
          pname = "base16-stylix-theme";
          src = pkgs.writeText "base16-stylix-theme.el" ''
            (require 'base16-theme)

            (defvar base16-stylix-theme-colors
              '(:base00 "${config.lib.stylix.colors.withHashtag.base00}"
                :base01 "${config.lib.stylix.colors.withHashtag.base01}"
                :base02 "${config.lib.stylix.colors.withHashtag.base02}"
                :base03 "${config.lib.stylix.colors.withHashtag.base03}"
                :base04 "${config.lib.stylix.colors.withHashtag.base04}"
                :base05 "${config.lib.stylix.colors.withHashtag.base05}"
                :base06 "${config.lib.stylix.colors.withHashtag.base06}"
                :base07 "${config.lib.stylix.colors.withHashtag.base07}"
                :base08 "${config.lib.stylix.colors.withHashtag.base08}"
                :base09 "${config.lib.stylix.colors.withHashtag.base09}"
                :base0A "${config.lib.stylix.colors.withHashtag.base0A}"
                :base0B "${config.lib.stylix.colors.withHashtag.base0B}"
                :base0C "${config.lib.stylix.colors.withHashtag.base0C}"
                :base0D "${config.lib.stylix.colors.withHashtag.base0D}"
                :base0E "${config.lib.stylix.colors.withHashtag.base0E}"
                :base0F "${config.lib.stylix.colors.withHashtag.base0F}")
              "All colors for Base16 stylix are defined here.")

            ;; Define the theme
            (deftheme base16-stylix)

            ;; Add all the faces to the theme
            (base16-theme-define 'base16-stylix base16-stylix-theme-colors)

            ;; Mark the theme as provided
            (provide-theme 'base16-stylix)
          '';
          packageRequires = [ epkgs.base16-theme ];
        })
      ];

    extraConfig = ''
      (require 'base16-theme)
      (set 'custom-theme-load-path
             (append (eval 'custom-theme-load-path) load-path))
      (load-theme 'base16-stylix t)

      ;; Set font
      (set-face-attribute 'default t :font "${monospace.name}" )
    '';
  };
}

One of the main problems here is that I currently need to copy load-path into custom-theme-load-path, as I don't see a way to get the pre-built epkg base16-stylix (extraPackages is a function, not an attrset or similar). Maybe filtering the load-path list for stylix makes sense here?

Font applies nicely.

from stylix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.