-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.nix
54 lines (51 loc) · 969 Bytes
/
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
{ isLinux ? false, isMacOS ? false }@args:
with builtins;
let
callIfFunction = f: args: if isFunction f then (f args) else f;
merge = items: foldl' (res: item: res // item) { } items;
linuxOnly = path: if isLinux then path else null;
macOSOnly = path: if isMacOS then path else null;
optional = path: if pathExists path then path else null;
imports = items: merge (map
(item: callIfFunction (import item) { inherit linuxOnly macOSOnly optional; })
(filter (item: item != null) items)
);
in
imports ([
./alacritty
./ansible
./awesome
./bash
./bin
./cargo
./ctags
./discord
./doom
./git
./gtk
./htop
./lein
./lf
./neofetch
./nixpkgs
./npm
./nvim
./polybar
./prettier
./rofi
./sbt
./skhd
./tmux
./vim
./vscode
./xdg
./xmodmap
./xresources
./yabai
./yarn
./zsh
] ++ (
if pathExists ./secrets
then import ./secrets (args // { inherit linuxOnly macOSOnly optional; })
else [ ]
))