-
Notifications
You must be signed in to change notification settings - Fork 11
/
default.nix
57 lines (52 loc) · 1.45 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{ stdenv
, config
, gnome3
, gnumake
, wrapGAppsHook
, lib
, makeWrapper
, pkg-config
, pkgs
, rofi
, xurls
}:
let
pipecmd = pkgs.writeScript "pipecmd.sh" ''
#! ${stdenv.shell}
${xurls}/bin/xurls | ${rofi}/bin/rofi -dmenu | xargs -r firefox
'';
ateConfig = lib.recursiveUpdate {
options = { PIPECMD = toString pipecmd; BACKGROUND_OPACITY = 0.8; };
keybindings = {};
} (config.ate or {});
in
#
# Pass config like
#
# nixpkgs.config.ate.options = { BACKGROUND_COLOR = "#000000"; }
# nixpkgs.config.ate.keybindings = { INCREMENT_FONT = "control+plus"; }
#
# See https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#GdkModifierType for possible modifiers.
# The format is "(<modifier>\+)+<keyname>" and the <modifier> will be used in the form GDK_<modifier>_MASK.
# The keyname will be passed to https://developer.gnome.org/gdk3/stable/gdk3-Keyboard-Handling.html#gdk-keyval-from-name
#
# For possible options see config.default.h
#
stdenv.mkDerivation {
name = "ate-1.1.0";
buildInputs = [ pkgs.vte ];
nativeBuildInputs = [ pkg-config gnumake makeWrapper wrapGAppsHook ];
# filter the .nix files from the repo
src = lib.cleanSourceWith {
filter = name: _type:
let
baseName = baseNameOf (toString name);
in ! (lib.hasSuffix ".nix" baseName);
src = lib.cleanSource ./.;
};
CONFIG_CFLAGS = import ./config.nix ({ inherit lib; } // ateConfig);
installPhase = ''
mkdir -p $out/bin
cp ate $out/bin
'';
}