senchopens / base16.nix Goto Github PK
View Code? Open in Web Editor NEWTheme applications with your favourite base16 colorschemes in Nix
License: MIT License
Theme applications with your favourite base16 colorschemes in Nix
License: MIT License
Hello! What would need to be done to support the scheme format we're moving to in https://github.com/tinted-theming/schemes? I would even be open to exporting something as a flake from the repo, if that would help, though I'm relatively new to nix, so advice would be appreciated.
Hello. I would like to use Tinted Theming (continuation of Base16) with this. I think the format changed a bit:
Hi,
I don't know if this has been done yet but I want to connect your base16 with my gtk theme. I see 'tinted-theming/base16-gtk-flatcolor' is a template, and I have tried using that, and either it needs to be done a special way, or it's not possible at this time. Below I will paste my theming.nix for reference. Any help or examples would be greatly appreciated.
Thanks!
theming.nix
{ config, pkgs, inputs, ...}:
{
home-manager.users.steven = {
# Theme 'alacritty'
programs.alacritty.settings.colors =
with config.scheme.withHashtag; let default = {
black = base00; white = base05;
inherit red green yellow blue cyan magenta;
};
in {
primary = { background = base00; foreground = base05; };
cursor = { text = base02; cursor = base07; };
normal = default; bright = default; dim = default;
};
# Theme 'neovim'
programs.neovim = {
plugins = [ (pkgs.vimPlugins.base16-vim.overrideAttrs (old:
let schemeFile = config.scheme inputs.base16-vim;
in { patchPhase = "cp ${schemeFile} colors/base16-scheme.vim"; }
))];
extraConfig = "
set termguicolors background=dark
let base16colorspace=256
colorscheme base16-scheme
";
};
# Theme 'gtk'
gtk = builtins.readFile (config.scheme {
templateRepo = inputs.base16-gtk; target = "gtk-3";
});
};
}
error:
… while checking flake output 'nixosConfigurations'
at /nix/store/z7bz1jaafr7mxi9swrk684cgn25zbava-source/flake.nix:39:5:
38| outputs = { self, nixpkgs, ... } @ inputs: {
39| nixosConfigurations = import ./hosts inputs;
| ^
40| };
… while checking the NixOS configuration 'nixosConfigurations.noelle'
at /nix/store/z7bz1jaafr7mxi9swrk684cgn25zbava-source/hosts/default.nix:19:5:
18| in {
19| noelle = nixpkgs.lib.nixosSystem {
| ^
20| inherit system;
(stack trace truncated; use '--show-trace' to show the full trace)
error: attribute '"\""' missing
at /nix/store/4wg7s6z4hmv6x7a8nzr6nznd1mz0x5cw-source/default.nix:23:12:
22| in
23| 16 * hex2decDigits."${builtins.substring 0 1 hex}"
| ^
24| + hex2decDigits."${builtins.substring 1 2 hex}";
Did you mean one of 0, 1, 2, 3 or 4?
When doing:
cssScheme = builtins.readFile (config.scheme inputs.base16-waybar);
when
config.scheme = "${inputs.base16-schemes}/gruvbox-dark-hard.yaml";
I get an error like this:
error: builder for '/nix/store/dfm82w1faj8kb4pg67k4p6ak9arnlyx5-gruvbox-dark-hard.drv' failed with exit code 1;
last 3 log lines:
> building
> installing
> cp: target 'hard.css': No such file or directory
this started after 124820f
This particular chain of functions in yaml2attrs
leads to IFD, as it forces the derivation to be evaluated before anything else can continue because we need to builtins.readFile
from the resulting file.
Lines 108 to 113 in 6b404cd
Because stdenv
is system-specific, that chain of requirements leads to requiring cross-compilation in order to simply run nix flake check
.
It does not appear to be possible to run nix flake check
on a flake containing both aarch64-darwin
and x86_64-linux
host configurations.
$ nf check --show-trace
trace: namaka={"dir":"tests","results":{"ops__keys":true,"ops__metadata":true}}
warning: unknown flake output '__std'
Failed to find a machine for remote build!
derivation: lm95hkshyfvyisjcxs17z4kx5mrcc3md-fromYAML.drv
required (system, features): (x86_64-linux, [])
1 available machines:
(systems, maxjobs, supportedFeatures, mandatoryFeatures)
([aarch64-linux], 4, [kvm], [])
error:
… while checking flake output 'nixosConfigurations'
at «none»:0: (source not available)
… while checking the NixOS configuration 'nixosConfigurations.freundix'
at «none»:0: (source not available)
… while calling the 'seq' builtin
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/modules.nix:326:18:
325| options = checked options;
326| config = checked (removeAttrs config [ "_module" ]);
| ^
327| _module = checked (config._module);
… while evaluating a branch condition
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/modules.nix:267:9:
266| checkUnmatched =
267| if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then
| ^
268| let
… in the right operand of the AND (&&) operator
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/modules.nix:267:72:
266| checkUnmatched =
267| if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then
| ^
268| let
… while evaluating the attribute 'unmatchedDefns'
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/modules.nix:671:7:
670| # Transforms unmatchedDefnsByName into a list of definitions
671| unmatchedDefns =
| ^
672| if configs == []
… while calling the 'concatLists' builtin
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/modules.nix:678:11:
677| else
678| concatLists (mapAttrsToList (name: defs:
| ^
679| map (def: def // {
… while calling anonymous lambda
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/attrsets.nix:539:10:
538| attrs:
539| map (name: f name attrs.${name}) (attrNames attrs);
| ^
540|
… from call site
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/attrsets.nix:539:16:
538| attrs:
539| map (name: f name attrs.${name}) (attrNames attrs);
| ^
540|
… while calling anonymous lambda
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/modules.nix:678:46:
677| else
678| concatLists (mapAttrsToList (name: defs:
| ^
679| map (def: def // {
… while calling anonymous lambda
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/modules.nix:664:22:
663| # Propagate all unmatched definitions from nested option sets
664| mapAttrs (n: v: v.unmatchedDefns) resultsByName
| ^
665| # Plus the definitions for the current prefix that don't have a matching option
… while calling anonymous lambda
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/attrsets.nix:539:10:
538| attrs:
539| map (name: f name attrs.${name}) (attrNames attrs);
| ^
540|
… from call site
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/attrsets.nix:539:16:
538| attrs:
539| map (name: f name attrs.${name}) (attrNames attrs);
| ^
540|
… while calling anonymous lambda
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/modules.nix:678:46:
677| else
678| concatLists (mapAttrsToList (name: defs:
| ^
679| map (def: def // {
… while calling anonymous lambda
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/modules.nix:664:22:
663| # Propagate all unmatched definitions from nested option sets
664| mapAttrs (n: v: v.unmatchedDefns) resultsByName
| ^
665| # Plus the definitions for the current prefix that don't have a matching option
… while calling anonymous lambda
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/modules.nix:594:46:
593| # an attrset 'name' => list of submodules that define ‘name’.
594| defnsByName = byName "config" (module: value:
| ^
595| map (config: { inherit (module) file; inherit config; }) (pushDownProperties value)
… from call site
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/modules.nix:595:69:
594| defnsByName = byName "config" (module: value:
595| map (config: { inherit (module) file; inherit config; }) (pushDownProperties value)
| ^
596| ) configs;
… while calling 'pushDownProperties'
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/modules.nix:826:24:
825| */
826| pushDownProperties = cfg:
| ^
827| if cfg._type or "" == "merge" then
… from call site
at /nix/store/fxgkj2xxcz9pn5khyq9f0ddyfpiw854y-source/stylix/palette.nix:128:26:
127| # https://github.com/SenchoPens/base16.nix#mktheme
128| lib.stylix.colors = (base16.mkSchemeAttrs cfg.base16Scheme).override override;
| ^
129| lib.stylix.scheme = base16.mkSchemeAttrs cfg.base16Scheme;
… while calling 'mkSchemeAttrs'
at /nix/store/c4ri83y4ka8q5ad1i9b278vp2qch2xx1-source/default.nix:190:5:
189| # (see https://github.com/base16-project/home/blob/main/builder.md#schemes-repository).
190| scheme:
| ^
191| let
… from call site
at /nix/store/c4ri83y4ka8q5ad1i9b278vp2qch2xx1-source/default.nix:237:25:
236|
237| populatedColors = colors inputAttrs;
| ^
238|
… while calling 'colors'
at /nix/store/c4ri83y4ka8q5ad1i9b278vp2qch2xx1-source/default.nix:44:12:
43| */
44| colors = scheme:
| ^
45| let
… from call site
at /nix/store/c4ri83y4ka8q5ad1i9b278vp2qch2xx1-source/default.nix:76:18:
75|
76| base-hex = lib.mapAttrs' (k: v: lib.nameValuePair "${k}-hex" v) base;
| ^
77| base-short = lib.mapAttrs' (k: v: lib.nameValuePair "${k}" v) base;
… while calling 'mapAttrs''
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/attrsets.nix:518:5:
517| # Attribute set to map over.
518| set:
| ^
519| listToAttrs (map (attr: f attr set.${attr}) (attrNames set));
… from call site
at /nix/store/c4ri83y4ka8q5ad1i9b278vp2qch2xx1-source/default.nix:50:9:
49| base = lib.mapAttrs (_: value: lib.toLower (lib.removePrefix "#" value)) (
50| lib.filterAttrs (name: _: lib.hasPrefix "base" name && builtins.stringLength name == 6) scheme
| ^
51| );
… while calling 'filterAttrs'
at /nix/store/38rzi6kzh5ilbpdgpvd8aj34vksgkcfa-source/lib/attrsets.nix:305:5:
304| # The attribute set to filter
305| set:
| ^
306| listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
… from call site
at /nix/store/c4ri83y4ka8q5ad1i9b278vp2qch2xx1-source/default.nix:202:12:
201| //
202| (yaml2attrs scheme)
| ^
203| ;
… while calling 'yaml2attrs'
at /nix/store/c4ri83y4ka8q5ad1i9b278vp2qch2xx1-source/default.nix:108:16:
107|
108| yaml2attrs = yaml:
| ^
109| builtins.fromJSON (builtins.readFile (pkgs.stdenv.mkDerivation {
error: a 'x86_64-linux' with features {} is required to build '/nix/store/lm95hkshyfvyisjcxs17z4kx5mrcc3md-fromYAML.drv', but I am a 'aarch64-darwin' with features {benchmark, big-parallel, nixos-test}
7.63s user 1.97s system 51% cpu 18.808s total
The following error message is written to file instead of the output.
Error: open /nix/store/syncbcpk5c9s0cl7cq203dhh2wab9kkz-source/stylix/palette.json.mustache: no such file or directory
It seems like running the path through escapeShellArg
stops it being listed as an input to the derivation, so presumably the sandbox is hiding it. It definitely exists from my perspective.
The build succeeds when escapeShellArg
is removed, however I can see why that might be necessary if the name contains spaces.
Functions to lighten/darken/hue-shift/etc. colors would be really useful. Sometimes the palette isn't quite enough, so the ability to derive extra colors is always nice to have.
First of all thank you for the project, its the best base16 nix project I've used so far.
Would it be possible to add a way to reference the hex values in any config, by something like ${base16.base05}
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.