forked from matthewbauer/bauer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule.nix
33 lines (31 loc) · 780 Bytes
/
module.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
# -*- mode: nix; coding: utf-8; -*-
{ config, lib, pkgs, ... }: with lib;
let
ensure = f: n: if builtins.pathExists f then f
else builtins.fetchurl
"https://matthewbauer.us/bauer/${n}";
bauer = import (ensure ./default.nix "default.nix") {
inherit pkgs;
};
in {
options = {
programs.bauer = {
enable = mkOption {
default = false;
type = types.bool;
};
};
};
config = mkIf config.programs.bauer.enable {
environment = {
systemPackages = [ bauer ];
variables = with lib; {
PATH = [bauer.PATH];
XDG_DATA_DIRS = [bauer.XDG_DATA_DIRS];
TERMINFO_DIRS = [bauer.TERMINFO_DIRS];
MANPATH = [bauer.MANPATH];
INFOPATH = [bauer.INFOPATH];
};
};
};
}