-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.nix
43 lines (38 loc) · 1.17 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
# Author: Viacheslav Lotsmanov
# License: GPLv3 https://raw.githubusercontent.com/unclechu/xlib-keys-hack/master/LICENSE
let sources = import nix/sources.nix; in
# This module is supposed to be called with ‘nixpkgs.callPackage’
{ lib
, callPackage
, fetchFromGitHub
, haskellPackages
, haskell
# Overridable dependencies
, __data-maybe-preserve ?
let k = "data-maybe-preserve"; in
haskellPackages.callCabal2nix k sources.${k} {}
# Build options
, __src ? (callPackage nix/clean-src.nix {}) ./. # A directory
, justStaticExecutable ? true
}:
let
name = "xlib-keys-hack";
pkg = extendedHaskellPackages.callCabal2nix name __src {};
extendedHaskellPackages = haskellPackages.extend (self: super: {
linux-evdev =
haskell.lib.compose.overrideCabal
(old: { broken = false; })
(haskell.lib.doJailbreak super.linux-evdev);
data-maybe-preserve = __data-maybe-preserve;
${name} = pkg;
});
justStaticExecutableFn =
if justStaticExecutable
then haskell.lib.justStaticExecutables
else x: x;
in
justStaticExecutableFn pkg // {
data-maybe-preserve = __data-maybe-preserve;
haskellPackages = extendedHaskellPackages;
haskellPackage = pkg;
}