nix-conf-urxvt/flake.nix

74 lines
2.4 KiB
Nix
Raw Permalink Normal View History

2021-11-16 19:08:47 +02:00
{
description = "A very basic flake";
outputs = { self, nixpkgs }: {
nixosModule = { config, lib, pkgs, ... }:
with lib;
let cfg = config.programs.myUrxvt;
in
{
options = {
programs.myUrxvt = {
enable = mkEnableOption "Enable urxvt";
};
};
config = mkIf cfg.enable {
programs.urxvt = {
enable = true;
fonts = [ "xft:Iosevka:size=11" ];
iso14755 = false;
scroll = {
bar.enable = false;
lines = 4000;
keepPosition = true;
};
extraConfig = {
"pointerBlank" = true;
# 15.9.2020
# I added the urxvt-resize-font extension here. There's the new module
# that takes a configuration in the form of 'urxvt-plugins' as seen
# below. It just fetches the resources into a location where urxvt can
# understand them. The extension is fetched to a file defined by the LHS
# of the attribute.
#
# So for example in this case into 'resize-font'. And this needs to match
# the entry in perl-ext-common and in the keysym lines.
"perl-ext-common" = "default,matcher,searchable-scrollback,resize-font";
"keysym.C-minus" = "resize-font:smaller";
"keysym.C-plus" = "resize-font:bigger";
"keysym.C-equal" = "resize-font:reset";
"keysym.C-question" = "resize-font:show";
};
};
home.file =
let
files = mapAttrs' mkFile plugins;
mkFile = with builtins; name: value: { name = ".urxvt/ext/${name}"; value = {text = readFile "${value}";};};
plugins = with builtins; {
resize-font = with builtins; (pkgs.fetchFromGitHub {
owner = "simmel";
repo = "urxvt-resize-font";
inherit (fromJSON (readFile ./plugins/urxvt-resize-font.json)) sha256 rev;
}) + "/resize-font";
};
in files;
xresources = {
properties = {
"Xcursor.theme" = "oxy-white";
"Xft*antialias" = true;
"Xft*dpi" = 96;
"Xft*hinting" = true;
"Xft*hintstyle" = "hintfull";
"Xft*rgba" = "rgb";
"dzen2.font" = "xft:Iosevka:pixelsize=13";
};
extraConfig = builtins.readFile ./theme;
};
};
};
};
}