summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2019-04-23 11:31:02 -0700
committerBen Sima <ben@bsima.me>2019-04-23 11:31:02 -0700
commit1dd6e6a8e3b79d030dc69e7f0a15bc0bc0889144 (patch)
treea15d5a79a94f163c30014b01e91f9888bac86d68
parent7257fa93373ca948e858c920ec0bd499a4543f45 (diff)
generate xresources colors using base16-builder
-rw-r--r--linux.nix25
1 files changed, 20 insertions, 5 deletions
diff --git a/linux.nix b/linux.nix
index 0ae1ae9..62ea2d8 100644
--- a/linux.nix
+++ b/linux.nix
@@ -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 = {