diff options
author | Ben Sima <ben@bsima.me> | 2019-04-23 11:31:02 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2019-04-23 11:31:02 -0700 |
commit | 1dd6e6a8e3b79d030dc69e7f0a15bc0bc0889144 (patch) | |
tree | a15d5a79a94f163c30014b01e91f9888bac86d68 | |
parent | 7257fa93373ca948e858c920ec0bd499a4543f45 (diff) |
generate xresources colors using base16-builder
-rw-r--r-- | linux.nix | 25 |
1 files changed, 20 insertions, 5 deletions
@@ -1,11 +1,26 @@ { pkgs, lib, ... }: let - solarized-xresources = ./xresources; homedir = builtins.getEnv "HOME"; - theme = lib.removeSuffix "\n" - (builtins.readFile "${homedir}/.local/share/xtheme"); - colors = { + + base16-scheme = "solarized"; + base16 = pkgs.stdenv.mkDerivation { + name = "base16-builder"; + src = builtins.fetchTarball { + url = "https://github.com/auduchinok/base16-builder/archive/51e3ad4d447fc3f1f539d0bfe33c851728fb6b5f.tar.gz"; + sha256 = "1qir689h38c6jr7fbbqbc3029544zgv41lrrqdcq26kcwxcwjrz1"; + }; + nativeBuildInputs = [pkgs.ruby]; + buildPhase = "${pkgs.ruby}/bin/ruby base16 -s schemes/${base16-scheme}.yml"; + installPhase = '' + mkdir -p $out + cp -r output/* $out + ''; + }; + theme = lib.removeSuffix "\n" (builtins.readFile "${homedir}/.local/share/xtheme"); + xresources = "${base16}/xresources/base16-${base16-scheme}.${theme}.xresources"; + + colors = { # derived from spacemacs "dark" = { highlight = "#5d4d7a"; background = "#292b2e"; @@ -38,7 +53,7 @@ in #"Xautolock.notify:" = 30; #"Xautolock.notifier:" = "notify-send -u critical -t 10000 -- 'Locking screen in 30 seconds'"; }; - extraConfig = builtins.readFile(solarized-xresources + "/Xresources." + theme); + extraConfig = builtins.readFile(xresources); }; services = { |