mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
Compare commits
445 Commits
release-20
...
emacs-pkgs
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
677f1f05df | ||
|
|
959217e51d | ||
|
|
cb09a968e9 | ||
|
|
b0651cc217 | ||
|
|
eee807560b | ||
|
|
58aa667e28 | ||
|
|
821299e90e | ||
|
|
4320399a3e | ||
|
|
7cb118c9d2 | ||
|
|
371576cdc2 | ||
|
|
562449b503 | ||
|
|
514acaebb9 | ||
|
|
4b964d2f7b | ||
|
|
2cfea84e6f | ||
|
|
5199bc841a | ||
|
|
208e310e94 | ||
|
|
039f786e60 | ||
|
|
275f39611d | ||
|
|
0dab813748 | ||
|
|
5e46262cb1 | ||
|
|
2952168ed5 | ||
|
|
bd747c5a53 | ||
|
|
21a2ff4496 | ||
|
|
61ca2fc1c0 | ||
|
|
33db7cc6a6 | ||
|
|
f637e145d7 | ||
|
|
521a03d8bf | ||
|
|
84d54402a5 | ||
|
|
2cf19d1d98 | ||
|
|
9029fd2b9d | ||
|
|
f6d1cad6ba | ||
|
|
c5b3069145 | ||
|
|
4367119ca3 | ||
|
|
bf6b85136b | ||
|
|
1a6df903e3 | ||
|
|
49a03303e1 | ||
|
|
a5c609b4b1 | ||
|
|
ec260995e2 | ||
|
|
72394f6d6b | ||
|
|
d11afee973 | ||
|
|
5569770d1e | ||
|
|
8d68dbd144 | ||
|
|
7ef3db3730 | ||
|
|
ad0fc085c7 | ||
|
|
763b1a1c55 | ||
|
|
5ed3a41afa | ||
|
|
2c3a968f57 | ||
|
|
e60dca7bb3 | ||
|
|
447f80f676 | ||
|
|
e4553546cc | ||
|
|
7226c2db46 | ||
|
|
6eb88173e9 | ||
|
|
72f3bc6fa4 | ||
|
|
654d82f888 | ||
|
|
a965b097b1 | ||
|
|
a3d691c053 | ||
|
|
d819e0741a | ||
|
|
479e26dc8c | ||
|
|
3d93e1e802 | ||
|
|
604561ba9a | ||
|
|
c049a09d1a | ||
|
|
a4a8307897 | ||
|
|
a57ef9dad1 | ||
|
|
5515ec99cc | ||
|
|
2c4234cb79 | ||
|
|
59be1f4983 | ||
|
|
b0d769691c | ||
|
|
29ea37374d | ||
|
|
d490797179 | ||
|
|
ab6517d34a | ||
|
|
7f976da068 | ||
|
|
7c19bcb822 | ||
|
|
5f6364fc28 | ||
|
|
2272fc312d | ||
|
|
e08c696524 | ||
|
|
ae8cb242f2 | ||
|
|
47ad3655ec | ||
|
|
f6f6990fc8 | ||
|
|
addc78bea0 | ||
|
|
0423a7b40c | ||
|
|
996b439739 | ||
|
|
cc6909d407 | ||
|
|
784da32958 | ||
|
|
6c984bd675 | ||
|
|
ddeeb031fd | ||
|
|
41101d0e62 | ||
|
|
fa483b82ab | ||
|
|
d7e089699a | ||
|
|
2b75633b2c | ||
|
|
41903a14b0 | ||
|
|
82b06103ae | ||
|
|
5f433eb164 | ||
|
|
1617e56c2f | ||
|
|
c476cc61b2 | ||
|
|
f56a087cbc | ||
|
|
775cb20bd4 | ||
|
|
9e3c402972 | ||
|
|
4971b9cad0 | ||
|
|
3ab254aff4 | ||
|
|
9ed7a73ae2 | ||
|
|
ae636c09f4 | ||
|
|
2c9fe368c1 | ||
|
|
d7d7bbbf20 | ||
|
|
06ee8ec8df | ||
|
|
97d183e2e4 | ||
|
|
ac319fd314 | ||
|
|
7df6656b11 | ||
|
|
9ad0024d4d | ||
|
|
3f6cb409ca | ||
|
|
5b08b33e8f | ||
|
|
9b7a90daa1 | ||
|
|
85d67b0a6e | ||
|
|
dc4337d9fe | ||
|
|
a17bc3217f | ||
|
|
2aeaf65e8f | ||
|
|
f4998f0adc | ||
|
|
8d3b273afe | ||
|
|
8eee5f5272 | ||
|
|
0ada50fc9c | ||
|
|
7e2b1a42aa | ||
|
|
ab0e6c3e0e | ||
|
|
21ac4c499b | ||
|
|
b42fce7aaa | ||
|
|
49864a4370 | ||
|
|
762f860cfb | ||
|
|
04955ca970 | ||
|
|
cd11c02c28 | ||
|
|
a73e619377 | ||
|
|
dc1b6b8349 | ||
|
|
e70524cd2b | ||
|
|
2f6d5c90f4 | ||
|
|
6d9bff77ed | ||
|
|
d04e52b0c0 | ||
|
|
3aa479d551 | ||
|
|
a01fe9f81e | ||
|
|
6cd92c643a | ||
|
|
5a19e0ea9c | ||
|
|
63af2d3e4c | ||
|
|
e92f5bb79e | ||
|
|
1e8d0beae4 | ||
|
|
9b39fd7eb4 | ||
|
|
be0e73a308 | ||
|
|
e0f2949c98 | ||
|
|
1375fd4a03 | ||
|
|
b6613a8544 | ||
|
|
c982c19f53 | ||
|
|
4ed6705b0f | ||
|
|
25bf3d7953 | ||
|
|
fb50102daf | ||
|
|
666eee4f72 | ||
|
|
42847469b3 | ||
|
|
aa36e2d6b4 | ||
|
|
06a98ba0fd | ||
|
|
f74dc9c70b | ||
|
|
9424f31f86 | ||
|
|
3ffe2a4cdf | ||
|
|
afb5fd962c | ||
|
|
7591c8041d | ||
|
|
5060262b79 | ||
|
|
ac82c036d8 | ||
|
|
e9ed9c2e11 | ||
|
|
5eb199e937 | ||
|
|
dba802c1d9 | ||
|
|
e4c55ed4e6 | ||
|
|
19d95258ac | ||
|
|
5c1415d67f | ||
|
|
45f9cb06a9 | ||
|
|
c12d53dd7c | ||
|
|
d3cdabb5c9 | ||
|
|
c7e79b5337 | ||
|
|
95da56b783 | ||
|
|
30102ea9e5 | ||
|
|
d6bbd02e95 | ||
|
|
b917624670 | ||
|
|
cb227dc6c2 | ||
|
|
2a4ab0d891 | ||
|
|
9e253a8c30 | ||
|
|
5573c10ea4 | ||
|
|
0e329cee4c | ||
|
|
d2aaeac42c | ||
|
|
07ad6a4f76 | ||
|
|
ab64dc3249 | ||
|
|
3591cd2b3b | ||
|
|
0e6c61a440 | ||
|
|
ddf35436b7 | ||
|
|
b840707a87 | ||
|
|
90493027e3 | ||
|
|
64607f58b7 | ||
|
|
4f70f49cec | ||
|
|
82ab1ad467 | ||
|
|
3d18912f5a | ||
|
|
b449cb77b1 | ||
|
|
cced902dda | ||
|
|
91450f23ce | ||
|
|
ff616b2734 | ||
|
|
73ecbd3722 | ||
|
|
3612ca58e8 | ||
|
|
f9e45390de | ||
|
|
adbabcd0a0 | ||
|
|
e9b7d12e06 | ||
|
|
794d08a1d8 | ||
|
|
b0688a631b | ||
|
|
6a471f1b11 | ||
|
|
01ec2aaefe | ||
|
|
77188bcd6e | ||
|
|
23769994e8 | ||
|
|
3b799f6ea4 | ||
|
|
7d765d8f46 | ||
|
|
15a2953c81 | ||
|
|
e42e147b58 | ||
|
|
4896c50074 | ||
|
|
b2dec35b86 | ||
|
|
ff959fd49a | ||
|
|
86944b0fb1 | ||
|
|
30355f8ee6 | ||
|
|
f298705ae4 | ||
|
|
90dd375eba | ||
|
|
64c5228c08 | ||
|
|
9ffb206050 | ||
|
|
e0ee5068dd | ||
|
|
225bf275ba | ||
|
|
cdc774f337 | ||
|
|
ca7868dc29 | ||
|
|
2f857761d0 | ||
|
|
5709b5f953 | ||
|
|
19fc0917c0 | ||
|
|
614a5b55bf | ||
|
|
2eed138026 | ||
|
|
5e6f09795c | ||
|
|
d57c59e7cb | ||
|
|
137a584e22 | ||
|
|
55ef8d3a10 | ||
|
|
5ae7817dc5 | ||
|
|
4727b0543d | ||
|
|
4edc2091e0 | ||
|
|
2d421b30ad | ||
|
|
b706d101eb | ||
|
|
19ebab97e8 | ||
|
|
a759143ae1 | ||
|
|
a513fbc395 | ||
|
|
c0ba8c526d | ||
|
|
18ad12d52b | ||
|
|
d437baa41c | ||
|
|
865e404826 | ||
|
|
d4278212b5 | ||
|
|
b4e3f069f1 | ||
|
|
827636c619 | ||
|
|
c2c26120d7 | ||
|
|
839645caf3 | ||
|
|
e00dd0d7d2 | ||
|
|
26fa84ebce | ||
|
|
db00b39a9a | ||
|
|
0c236e13bc | ||
|
|
1e7e8ac75d | ||
|
|
6aa6556bca | ||
|
|
ebbbd4f2b5 | ||
|
|
348b5a5a69 | ||
|
|
0a6227d667 | ||
|
|
7cf69a3b8d | ||
|
|
073710d7f2 | ||
|
|
f7159a0f76 | ||
|
|
18930aaf75 | ||
|
|
5c5d562266 | ||
|
|
91418d3e57 | ||
|
|
f567ea8228 | ||
|
|
17a10287d2 | ||
|
|
56f5f41ed4 | ||
|
|
be56b6f2c5 | ||
|
|
c12897e8e1 | ||
|
|
4fd4066d2f | ||
|
|
7fcfd9b565 | ||
|
|
3a16ebdf72 | ||
|
|
e5a260a569 | ||
|
|
33edf558a0 | ||
|
|
cc60c22c69 | ||
|
|
25a6a6d298 | ||
|
|
6e3d93d7cc | ||
|
|
ad04237d51 | ||
|
|
447ed0fbcb | ||
|
|
90223cf3eb | ||
|
|
cbf0667037 | ||
|
|
c1761366b5 | ||
|
|
7b30fc9922 | ||
|
|
fedfd430f9 | ||
|
|
ddcd476603 | ||
|
|
f30b62a74d | ||
|
|
f9b5172d95 | ||
|
|
de1fa8defb | ||
|
|
6245dd11cf | ||
|
|
ffbc3819e4 | ||
|
|
920ea74afe | ||
|
|
b42d987ad9 | ||
|
|
07f6c6481e | ||
|
|
1ee1835a3e | ||
|
|
42bb553544 | ||
|
|
19c7d4e29f | ||
|
|
a4e146693e | ||
|
|
040ea28e44 | ||
|
|
57a7e5e2c5 | ||
|
|
5fbb33cff5 | ||
|
|
abc9d96d19 | ||
|
|
73559e0dbc | ||
|
|
0e2dc4be30 | ||
|
|
39e4991856 | ||
|
|
69e2693342 | ||
|
|
ddee030dc7 | ||
|
|
e72e241d7a | ||
|
|
9068ff292c | ||
|
|
f45c7000d5 | ||
|
|
aa479b0124 | ||
|
|
3327cbe1f9 | ||
|
|
fb9bf032fb | ||
|
|
e7b1491fb8 | ||
|
|
0933fb8765 | ||
|
|
7582090eb0 | ||
|
|
21952f1cab | ||
|
|
029767ca63 | ||
|
|
aa9affb53f | ||
|
|
82d6ba7003 | ||
|
|
eb3a0342a8 | ||
|
|
2b7a73071a | ||
|
|
da92360208 | ||
|
|
55030c8302 | ||
|
|
2e795f3efd | ||
|
|
1ee1d01daa | ||
|
|
87e2ec341b | ||
|
|
e6f2687a83 | ||
|
|
b220d5c446 | ||
|
|
88e05a5472 | ||
|
|
d8dd2a09b0 | ||
|
|
ef4370bedc | ||
|
|
bdee1be7b3 | ||
|
|
dd6ee694df | ||
|
|
6dfa9ef85c | ||
|
|
fc87ac92af | ||
|
|
d420287583 | ||
|
|
46a750f94f | ||
|
|
63d5d28db6 | ||
|
|
22ecd0e568 | ||
|
|
3f2f7f8efa | ||
|
|
9dad146639 | ||
|
|
bbb6d30001 | ||
|
|
0fa2b16a07 | ||
|
|
df7d81b0b3 | ||
|
|
98d030f723 | ||
|
|
7313258b45 | ||
|
|
db88b625f9 | ||
|
|
7de0d07dd9 | ||
|
|
6b15b03898 | ||
|
|
c137866bd7 | ||
|
|
3d634914ce | ||
|
|
e44faef21c | ||
|
|
6f7074d21d | ||
|
|
9a12cd7e81 | ||
|
|
08fc1586c0 | ||
|
|
4e86d65aee | ||
|
|
2c0e3f61da | ||
|
|
5280360d6c | ||
|
|
c33b1777b6 | ||
|
|
b0c8727286 | ||
|
|
6f5fa6350d | ||
|
|
9d680ec662 | ||
|
|
7e80e034cc | ||
|
|
8f24ed4c7f | ||
|
|
3fe2a57b95 | ||
|
|
8127799f79 | ||
|
|
4b772fd698 | ||
|
|
65d0e2d241 | ||
|
|
d62bdaf938 | ||
|
|
45e3b0ce0e | ||
|
|
cc89be5a30 | ||
|
|
e8358125d9 | ||
|
|
cb1ed0d2f3 | ||
|
|
32371301d3 | ||
|
|
cf5dad76c1 | ||
|
|
a361541c10 | ||
|
|
b9597e5774 | ||
|
|
68dfc86173 | ||
|
|
73506f947c | ||
|
|
f0e6396b78 | ||
|
|
6acc6bc651 | ||
|
|
f6fd7e3fa4 | ||
|
|
05448dcedb | ||
|
|
374649a15b | ||
|
|
118b36bf45 | ||
|
|
3e218f2600 | ||
|
|
f4b5ae026c | ||
|
|
9d53afb709 | ||
|
|
4dedfcfd95 | ||
|
|
8e0c1c55fb | ||
|
|
99f0074362 | ||
|
|
5263fe4594 | ||
|
|
cd86c2638b | ||
|
|
bcbf09a202 | ||
|
|
ca7fd5a643 | ||
|
|
3627ec4de5 | ||
|
|
2901044520 | ||
|
|
cb136f37c7 | ||
|
|
76de0632ac | ||
|
|
8b3fca4ec5 | ||
|
|
2b1892e646 | ||
|
|
a1162e04b3 | ||
|
|
e87bccabc3 | ||
|
|
1a7f190cb9 | ||
|
|
66a68b4a58 | ||
|
|
6dc8de259a | ||
|
|
708cb61e82 | ||
|
|
b6ed605d4a | ||
|
|
6739d8bb50 | ||
|
|
4f0b0d78af | ||
|
|
9d775bad07 | ||
|
|
e6a58a7e71 | ||
|
|
e3828769e8 | ||
|
|
275d1b5212 | ||
|
|
aaa5329d39 | ||
|
|
005ea6cc18 | ||
|
|
0654364426 | ||
|
|
0027b0e76b | ||
|
|
33407189c1 | ||
|
|
44f9d68d8c | ||
|
|
c1faa848c5 | ||
|
|
c6263347de | ||
|
|
a3a0f1289a | ||
|
|
7b6ebf2785 | ||
|
|
6dc68b1d16 | ||
|
|
99b75f99df | ||
|
|
964f698095 | ||
|
|
4f20ee61c2 | ||
|
|
9e01441c5c | ||
|
|
9fe15dc83b | ||
|
|
b9b8a42fda | ||
|
|
b04aa56503 | ||
|
|
cde1d33e61 | ||
|
|
b3fdbfdf42 | ||
|
|
f3372bf982 | ||
|
|
234de0270a | ||
|
|
9c14bbe988 | ||
|
|
7c3c64208e | ||
|
|
b5e7817de2 | ||
|
|
fe849640ad | ||
|
|
fd79015c0f | ||
|
|
4cc1b77c3f | ||
|
|
9e9d8ffc7c | ||
|
|
faca77d77d | ||
|
|
ef72617c4a |
142
.github/CODEOWNERS
vendored
142
.github/CODEOWNERS
vendored
@@ -4,6 +4,9 @@
|
||||
|
||||
/modules/home-environment.nix @rycee
|
||||
|
||||
/modules/i18n/input-method @Kranzes
|
||||
/tests/modules/i18n/input-method @Kranzes
|
||||
|
||||
/modules/misc/dconf.nix @gnidorah @rycee
|
||||
|
||||
/modules/misc/fontconfig.nix @rycee
|
||||
@@ -11,6 +14,9 @@
|
||||
|
||||
/modules/misc/gtk.nix @rycee
|
||||
|
||||
/modules/config/i18n.nix @midchildan
|
||||
/tests/modules/config/i18n @midchildan
|
||||
|
||||
/modules/misc/news.nix @rycee
|
||||
|
||||
/modules/misc/numlock.nix @evanjs
|
||||
@@ -31,6 +37,14 @@
|
||||
|
||||
/modules/misc/xdg-user-dirs.nix @pacien
|
||||
|
||||
/modules/misc/xdg-system-dirs.nix @tadfisher
|
||||
/tests/modules/misc/xdg/system-dirs.nix @tadfisher
|
||||
|
||||
/modules/misc/xdg-desktop-entries.nix @cwyc
|
||||
/tests/modules/misc/xdg/desktop-entries.nix @cwyc
|
||||
/tests/modules/misc/xdg/desktop-full-expected.desktop @cwyc
|
||||
/tests/modules/misc/xdg/desktop-min-expected.desktop @cwyc
|
||||
|
||||
/modules/programs/aria2.nix @JustinLovinger
|
||||
|
||||
/modules/programs/autojump.nix @evanjs
|
||||
@@ -44,6 +58,9 @@
|
||||
|
||||
/modules/programs/beets.nix @rycee
|
||||
|
||||
/modules/programs/bottom.nix @polykernel
|
||||
/tests/modules/programs/bottom @polykernel
|
||||
|
||||
/modules/programs/broot.nix @aheaume
|
||||
|
||||
/modules/programs/dircolors.nix @JustinLovinger
|
||||
@@ -54,23 +71,40 @@
|
||||
|
||||
/modules/programs/emacs.nix @rycee
|
||||
|
||||
/modules/programs/exa.nix @kalhauge
|
||||
|
||||
/modules/programs/firefox.nix @rycee
|
||||
|
||||
/modules/programs/foot.nix @plabadens
|
||||
/tests/modules/programs/foot @plabadens
|
||||
|
||||
/modules/programs/gh.nix @Gerschtli
|
||||
/tests/modules/programs/gh @Gerschtli
|
||||
|
||||
/modules/programs/git.nix @rycee
|
||||
|
||||
/modules/programs/gnome-terminal.nix @rycee
|
||||
/modules/programs/gnome-terminal.nix @kamadorueda @rycee
|
||||
|
||||
/modules/programs/go.nix @rvolosatovs
|
||||
|
||||
/modules/programs/himalaya.nix @ambroisie
|
||||
/tests/modules/programs/himalaya @ambroisie
|
||||
|
||||
/modules/programs/home-manager.nix @rycee
|
||||
|
||||
/modules/programs/htop.nix @bjpbakker
|
||||
/tests/modules/htop @bjpbakker
|
||||
|
||||
/modules/programs/i3status.nix @JustinLovinger
|
||||
|
||||
/modules/programs/i3status-rust.nix @workflow
|
||||
|
||||
/modules/programs/java.nix @ShamrockLee
|
||||
|
||||
/modules/programs/keychain.nix @marsam
|
||||
|
||||
/modules/programs/lazygit.nix @kalhauge
|
||||
|
||||
/modules/programs/lesspipe.nix @rycee
|
||||
|
||||
/modules/programs/lf.nix @owm111
|
||||
@@ -82,12 +116,16 @@
|
||||
|
||||
/modules/programs/matplotlib.nix @rprospero
|
||||
|
||||
/modules/programs/mangohud.nix @ZerataX
|
||||
/tests/modules/programs/mangohud @ZerataX
|
||||
|
||||
/modules/programs/mbsync.nix @KarlJoad
|
||||
/tests/modules/programs/mbsync @KarlJoad
|
||||
|
||||
/modules/programs/mcfly.nix @marsam
|
||||
|
||||
/modules/programs/mpv.nix @tadeokondrak
|
||||
/modules/programs/mpv.nix @tadeokondrak @thiagokokada
|
||||
/tests/modules/programs/mpv @thiagokokada
|
||||
|
||||
/modules/programs/mu.nix @KarlJoad
|
||||
|
||||
@@ -95,9 +133,17 @@
|
||||
/tests/modules/programs/ncmpcpp @olmokramer
|
||||
/tests/modules/programs/ncmpcpp-linux @olmokramer
|
||||
|
||||
/modules/programs/ncspot.nix @marsam
|
||||
|
||||
/modules/programs/ne.nix @cwyc
|
||||
/tests/modules/programs/ne @cwyc
|
||||
|
||||
/modules/programs/newsboat.nix @sumnerevans
|
||||
/tests/modules/programs/newsboat @sumnerevans
|
||||
|
||||
/modules/programs/nix-index.nix @ambroisie
|
||||
/tests/modules/programs/nix-index @ambroisie
|
||||
|
||||
/modules/programs/noti.nix @marsam
|
||||
|
||||
/modules/programs/nushell.nix @Philipp-M
|
||||
@@ -105,6 +151,8 @@
|
||||
|
||||
/modules/programs/obs-studio.nix @adisbladis
|
||||
|
||||
/modules/programs/octant.nix @06kellyjac
|
||||
|
||||
/modules/programs/opam.nix @marsam
|
||||
|
||||
/modules/programs/openssh.nix @rycee
|
||||
@@ -115,19 +163,49 @@
|
||||
|
||||
/modules/programs/pidgin.nix @rycee
|
||||
|
||||
/modules/programs/piston-cli.nix @ethancedwards8
|
||||
|
||||
/modules/programs/powerline-go.nix @DamienCassou
|
||||
|
||||
/modules/programs/rbw.nix @ambroisie
|
||||
/tests/modules/programs/rbw @ambroisie
|
||||
|
||||
/modules/programs/rofi.nix @thiagokokada
|
||||
/tests/modules/programs/rofi @thiagokokada
|
||||
|
||||
/modules/programs/rofi-pass.nix @seylerius
|
||||
/tests/modules/programs/rofi-pass @seylerius
|
||||
|
||||
/modules/programs/rtorrent.nix @marsam
|
||||
|
||||
/modules/programs/sbt.nix @kubukoz
|
||||
/tests/modules/programs/sbt @kubukoz
|
||||
|
||||
/modules/programs/scmpuff.nix @cpcloud
|
||||
/tests/modules/programs/scmpuff @cpcloud
|
||||
|
||||
/modules/programs/senpai.nix @malte-v
|
||||
|
||||
/modules/programs/sm64ex.nix @ivarwithoutbones
|
||||
/tests/modules/programs/sm64ex @ivarwithoutbones
|
||||
|
||||
/modules/programs/ssh.nix @rycee
|
||||
|
||||
/modules/programs/starship.nix @marsam
|
||||
|
||||
/modules/programs/terminator.nix @chisui
|
||||
|
||||
/modules/programs/texlive.nix @rycee
|
||||
|
||||
/modules/programs/topgrade.nix @msfjarvis
|
||||
/tests/modules/programs/topgrade @msfjarvis
|
||||
|
||||
/modules/programs/waybar.nix @berbiche
|
||||
/tests/modules/programs/waybar @berbiche
|
||||
|
||||
/modules/programs/xmobar.nix @t4ccer
|
||||
/tests/modules/programs/xmobar @t4ccer
|
||||
|
||||
/modules/programs/z-lua.nix @marsam
|
||||
|
||||
/modules/programs/zathura.nix @rprospero
|
||||
@@ -136,24 +214,39 @@
|
||||
|
||||
/modules/programs/zsh/prezto.nix @NickHu
|
||||
|
||||
/modules/services/barrier.nix @Kritnich
|
||||
/tests/modules/services/barrier @Kritnich
|
||||
|
||||
/modules/services/betterlockscreen.nix @SebTM
|
||||
|
||||
/modules/services/caffeine.nix @uvNikita
|
||||
|
||||
/modules/services/cbatticon.nix @pmiddend
|
||||
|
||||
/modules/services/clipmenu.nix @DamienCassou
|
||||
|
||||
/modules/services/devilspie2.nix @dawidsowa
|
||||
/tests/modules/services/devilspie2 @dawidsowa
|
||||
|
||||
/modules/services/dropbox.nix @eyJhb
|
||||
/tests/modules/services/dropbox @eyJhb
|
||||
|
||||
/modules/services/dunst.nix @rycee
|
||||
|
||||
/modules/services/easyeffects.nix @fufexan
|
||||
|
||||
/modules/services/emacs.nix @tadfisher
|
||||
|
||||
/modules/services/etesync-dav.nix @Valodim
|
||||
|
||||
/modules/services/flameshot.nix @moredhel
|
||||
|
||||
/modules/services/fluidsynth.nix @Valodim
|
||||
|
||||
/modules/services/gammastep.nix @petabyteboy
|
||||
/modules/services/fnott.nix @polykernel
|
||||
/tests/modules/services/fnott @polykernel
|
||||
|
||||
/modules/services/git-sync.nix @IvanMalison
|
||||
|
||||
/modules/services/gnome-keyring.nix @rycee
|
||||
|
||||
@@ -182,21 +275,41 @@
|
||||
|
||||
/modules/services/mpdris2.nix @pjones
|
||||
|
||||
/modules/services/mpris-proxy.nix @ThibautMarty
|
||||
|
||||
/modules/services/muchsync.nix @pacien
|
||||
|
||||
/modules/services/network-manager-applet.nix @rycee
|
||||
|
||||
/modules/services/notify-osd.nix @imalison
|
||||
|
||||
/modules/services/pantalaimon.nix @jojosch
|
||||
/tests/modules/services/pantalaimon @jojosch
|
||||
|
||||
/modules/services/parcellite.nix @gleber
|
||||
|
||||
/modules/services/pass-secret-service.nix @cab404
|
||||
|
||||
/modules/services/password-store-sync.nix @pacien
|
||||
|
||||
/modules/services/pasystray.nix @pltanton
|
||||
|
||||
/modules/services/pbgopy.nix @ivarwithoutbones
|
||||
/tests/modules/services/pbgopy @ivarwithoutbones
|
||||
|
||||
/modules/services/plan9port.nix @ehmry
|
||||
|
||||
/modules/services/playerctld.nix @fendse
|
||||
/tests/modules/playerctld @fendse
|
||||
|
||||
/modules/services/poweralertd.nix @ThibautMarty
|
||||
|
||||
/modules/services/pulseeffects.nix @jonringer
|
||||
|
||||
/modules/services/random-background.nix @rycee
|
||||
|
||||
/modules/services/redshift.nix @rycee
|
||||
/modules/services/redshift-gammastep @rycee @petabyteboy @thiagokokada
|
||||
/tests/modules/redshift-gammastep @thiagokokada
|
||||
|
||||
/modules/services/status-notifier-watcher.nix @pltanton
|
||||
|
||||
@@ -208,16 +321,33 @@
|
||||
|
||||
/modules/services/taskwarrior-sync.nix @minijackson @pacien
|
||||
|
||||
/modules/services/trayer.nix @AndreasMager
|
||||
/tests/modules/services/trayer @AndreasMager
|
||||
|
||||
/modules/services/udiskie.nix @rycee
|
||||
|
||||
/modules/services/unison.nix @pacien
|
||||
|
||||
/modules/services/window-managers/i3-sway/sway.nix @alexarice
|
||||
/modules/services/window-managers/bspwm @ncfavier
|
||||
/tests/modules/services/window-managers/bspwm @ncfavier
|
||||
|
||||
/modules/services/window-managers/i3-sway/i3.nix @sumnerevans
|
||||
/tests/modules/services/window-managers/i3 @sumnerevans
|
||||
|
||||
/modules/services/window-managers/i3-sway/lib @sumnerevans
|
||||
|
||||
/modules/services/window-managers/i3-sway/sway.nix @alexarice @sumnerevans
|
||||
/tests/modules/services/window-managers/sway @sumnerevans
|
||||
|
||||
/modules/services/wlsunset.nix @matrss
|
||||
/tests/modules/services/wlsunset @matrss
|
||||
|
||||
/modules/services/xcape.nix @nickhu
|
||||
|
||||
/modules/services/xembed-sni-proxy.nix @rycee
|
||||
|
||||
/modules/services/xidlehook.nix @dschrempf
|
||||
|
||||
/modules/services/xscreensaver.nix @rycee
|
||||
|
||||
/modules/services/xsuspender.nix @offlinehacker
|
||||
@@ -229,3 +359,5 @@
|
||||
/modules/xresources.nix @rycee
|
||||
|
||||
/modules/xsession.nix @rycee
|
||||
|
||||
/modules/services/volnoti.nix @IvanMalison
|
||||
|
||||
38
.github/ISSUE_TEMPLATE.md
vendored
38
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,38 +0,0 @@
|
||||
<!--
|
||||
|
||||
If you are encountering the error
|
||||
|
||||
element xref: validity error : IDREF attribute linkend references an unknown ID "opt-home.file._name__.source"
|
||||
|
||||
then it means that you are using an old version of Home Manager, such
|
||||
as the release-20.03 branch, with a recent version of Nixpkgs, such as
|
||||
version 20.09 or master. See https://git.io/JTb6K for more.
|
||||
|
||||
In general, please check if there already exists a relevant issue
|
||||
before creating a new one.
|
||||
|
||||
-->
|
||||
|
||||
### Issue description
|
||||
|
||||
<!--
|
||||
Please describe the issue. For support and help please use the IRC
|
||||
channel #home-manager @ freenode.net instead.
|
||||
-->
|
||||
|
||||
### Meta
|
||||
|
||||
#### Maintainer CC
|
||||
|
||||
<!--
|
||||
Please @ people who are in the `meta.maintainers` list of the
|
||||
offending module. If in doubt, check `git blame` for whoever last
|
||||
touched something.
|
||||
-->
|
||||
|
||||
#### Technical details
|
||||
|
||||
<!--
|
||||
Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the
|
||||
result.
|
||||
-->
|
||||
15
.github/ISSUE_TEMPLATE/feature-request.md
vendored
Normal file
15
.github/ISSUE_TEMPLATE/feature-request.md
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Ask for a new feature to be added (module, program, etc.)
|
||||
title: ''
|
||||
labels: feature request
|
||||
assignees: rycee, berbiche, sumnerevans
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Note: Please search to see if the feature has already been requested
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
46
.github/ISSUE_TEMPLATE/issue.yaml
vendored
Normal file
46
.github/ISSUE_TEMPLATE/issue.yaml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
name: Bug Report
|
||||
description: File a bug/issue
|
||||
title: 'bug: '
|
||||
labels: [bug, triage]
|
||||
|
||||
# We cannot use nix-community/home-manager
|
||||
# See https://github.com/dear-github/dear-github/issues/170
|
||||
assignees: [rycee, berbiche, sumnerevans]
|
||||
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Is there an existing issue for this?
|
||||
description: |
|
||||
Please search to see if an issue already exists for the bug you encountered.
|
||||
options:
|
||||
- label: I have searched the existing issues
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Issue description
|
||||
description: |
|
||||
Please describe the issue.
|
||||
|
||||
For support and help please use the IRC channel #home-manager at irc.oftc.net or
|
||||
Matrix room <https://matrix.to/#/#hm:rycee.net> instead.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Maintainer CC
|
||||
description: |
|
||||
Please @ people who are in the `meta.maintainers` list of the offending module.
|
||||
If in doubt, check `git blame` for whoever last touched something.
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: system
|
||||
attributes:
|
||||
label: System information
|
||||
description: |
|
||||
Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the result.
|
||||
render: markdown
|
||||
validations:
|
||||
required: true
|
||||
|
||||
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -15,7 +15,7 @@ pull-request.
|
||||
|
||||
Also make sure to read the guidelines found at
|
||||
|
||||
https://github.com/nix-community/home-manager/blob/master/doc/contributing.adoc#sec-guidelines
|
||||
https://github.com/nix-community/home-manager/blob/master/docs/contributing.adoc#sec-guidelines
|
||||
|
||||
-->
|
||||
|
||||
@@ -35,7 +35,7 @@ Also make sure to read the guidelines found at
|
||||
{long description}
|
||||
```
|
||||
|
||||
See [CONTRIBUTING](https://github.com/nix-community/home-manager/blob/master/doc/contributing.adoc#sec-commit-style) for more information and [recent commit messages](https://github.com/nix-community/home-manager/commits/master) for examples.
|
||||
See [CONTRIBUTING](https://github.com/nix-community/home-manager/blob/master/docs/contributing.adoc#sec-commit-style) for more information and [recent commit messages](https://github.com/nix-community/home-manager/commits/master) for examples.
|
||||
|
||||
- If this PR adds a new module
|
||||
|
||||
|
||||
17
.github/dependabot.yml
vendored
Normal file
17
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
target-branch: "master"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
commit-message:
|
||||
prefix: "ci:"
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
target-branch: "release-20.09"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
commit-message:
|
||||
prefix: "ci:"
|
||||
75
.github/stale.yml
vendored
Normal file
75
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
# Configuration for probot-stale - https://github.com/probot/stale
|
||||
daysUntilStale: 90
|
||||
daysUntilClose: 7
|
||||
staleLabel: "status: stale"
|
||||
closeComment: false
|
||||
issues:
|
||||
markComment: |
|
||||
<p>
|
||||
Thank you for your contribution!
|
||||
I marked this issue as stale due to inactivity.
|
||||
If this remains inactive for another 7 days, I will close this issue.
|
||||
<b>Please read the relevant sections below before commenting.</b>
|
||||
</p>
|
||||
|
||||
<details>
|
||||
<summary><b>If you are the original author of the issue</b></summary>
|
||||
<p>
|
||||
|
||||
* If this is resolved, please consider closing it so that the maintainers know not to focus on this.
|
||||
* If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
|
||||
* If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
|
||||
|
||||
</p>
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>If you are <i>not</i> the original author of the issue</b></summary>
|
||||
<p>
|
||||
|
||||
* If you are also experiencing this issue, please add details of your situation to help with the debugging process.
|
||||
* If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
|
||||
|
||||
</p>
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>Memorandum on closing issues</b></summary>
|
||||
<p>
|
||||
If you have nothing of substance to add, please refrain from commenting and allow the bot close the issue.
|
||||
Also, don't be afraid to manually close an issue, even if it holds valuable information.
|
||||
</p>
|
||||
<p>
|
||||
Closed issues stay in the system for people to search, read, cross-reference, or even reopen--nothing is lost!
|
||||
Closing obsolete issues is an important way to help maintainers focus their time and effort.
|
||||
</p>
|
||||
</details>
|
||||
pulls:
|
||||
markComment: |
|
||||
<p>
|
||||
Thank you for your contribution!
|
||||
I marked this pull request as stale due to inactivity.
|
||||
If this remains inactive for another 7 days, I will close this PR.
|
||||
<b>Please read the relevant sections below before commenting.</b>
|
||||
</p>
|
||||
|
||||
<details>
|
||||
<summary><b>If you are the original author of the PR</b></summary>
|
||||
<p>
|
||||
|
||||
* GitHub sometimes doesn't notify people who commented / reviewed a PR previously, when you (force) push commits. *If you have addressed the reviews* you can [officially ask for a review](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/requesting-a-pull-request-review) from those who commented to you or anyone else.
|
||||
* If it is unfinished but you plan to finish it, please mark it as a draft.
|
||||
* If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
|
||||
* To get things rolling again, rebase the PR against the target branch and address valid comments.
|
||||
|
||||
</p>
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>If you are <i>not</i> the original author of the issue</b></summary>
|
||||
<p>
|
||||
|
||||
* If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.
|
||||
|
||||
</p>
|
||||
</details>
|
||||
4
.github/workflows/github_pages.yml
vendored
4
.github/workflows/github_pages.yml
vendored
@@ -11,10 +11,10 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: cachix/install-nix-action@v10
|
||||
- uses: cachix/install-nix-action@v14
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- uses: cachix/cachix-action@v6
|
||||
- uses: cachix/cachix-action@v10
|
||||
with:
|
||||
name: nix-community
|
||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||
|
||||
7
.github/workflows/test.yml
vendored
7
.github/workflows/test.yml
vendored
@@ -11,12 +11,13 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: cachix/install-nix-action@v11
|
||||
- uses: cachix/install-nix-action@v14
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- uses: cachix/cachix-action@v6
|
||||
- uses: cachix/cachix-action@v10
|
||||
with:
|
||||
name: nix-community
|
||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||
- run: ./format -c
|
||||
- run: nix-shell . -A install
|
||||
- run: nix-shell --pure --max-jobs 4 tests -A run.all
|
||||
- run: nix-shell --arg enableBig false --pure tests -A run.all
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
image: nixos/nix:latest
|
||||
|
||||
variables:
|
||||
# Pinned 2020-09-11.
|
||||
NIX_PATH: "nixpkgs=https://github.com/NixOS/nixpkgs/archive/6d4b93323e7f78121f8d6db6c59f3889aa1dd931.tar.gz"
|
||||
NIX_PATH: "nixpkgs=channel:nixos-unstable"
|
||||
|
||||
stages:
|
||||
- test
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
doc/contributing.adoc
|
||||
75
README.md
75
README.md
@@ -3,8 +3,10 @@ Home Manager using Nix
|
||||
|
||||
This project provides a basic system for managing a user environment
|
||||
using the [Nix][] package manager together with the Nix libraries
|
||||
found in [Nixpkgs][]. Before attempting to use Home Manager please
|
||||
read the warning below.
|
||||
found in [Nixpkgs][]. It allows declarative configuration of user
|
||||
specific (non global) packages and dotfiles.
|
||||
|
||||
Before attempting to use Home Manager please read the warning below.
|
||||
|
||||
For a more systematic overview of Home Manager and its available
|
||||
options, please see the [Home Manager manual][manual].
|
||||
@@ -12,22 +14,25 @@ options, please see the [Home Manager manual][manual].
|
||||
Words of warning
|
||||
----------------
|
||||
|
||||
This project is under development. I personally use it to manage
|
||||
several user configurations but it may fail catastrophically for you.
|
||||
So beware!
|
||||
Unfortunately, it is quite possible to get difficult to understand
|
||||
errors when working with Home Manager, such as infinite loops with no
|
||||
clear source reference. You should therefore be comfortable using the
|
||||
Nix language and the various tools in the Nix ecosystem. Reading
|
||||
through the [Nix Pills][] document is a good way to familiarize
|
||||
yourself with them.
|
||||
|
||||
Before using Home Manager you should be comfortable using the Nix
|
||||
language and the various tools in the Nix ecosystem. Reading through
|
||||
the [Nix Pills][] document is a good way to familiarize yourself with
|
||||
them.
|
||||
If you are not very familiar with Nix but still want to use Home
|
||||
Manager then you are strongly encouraged to start with a small and
|
||||
very simple configuration and gradually make it more elaborate as you
|
||||
learn.
|
||||
|
||||
In some cases Home Manager cannot detect whether it will overwrite a
|
||||
previous manual configuration. For example, the Gnome Terminal module
|
||||
will write to your dconf store and cannot tell whether a configuration
|
||||
that it is about to be overwrite was from a previous Home Manager
|
||||
that it is about to be overwritten was from a previous Home Manager
|
||||
generation or from manual configuration.
|
||||
|
||||
Home Manager targets [NixOS][] unstable and NixOS version 20.09 (the
|
||||
Home Manager targets [NixOS][] unstable and NixOS version 21.05 (the
|
||||
current stable version), it may or may not work on other Linux
|
||||
distributions and NixOS versions.
|
||||
|
||||
@@ -43,8 +48,7 @@ Contact
|
||||
-------
|
||||
|
||||
You can chat with us on IRC in the channel [#home-manager][] on
|
||||
[freenode][]. The [channel logs][] are hosted courtesy of
|
||||
[samueldr][].
|
||||
[OFTC][].
|
||||
|
||||
Installation
|
||||
------------
|
||||
@@ -63,22 +67,21 @@ Currently the easiest way to install Home Manager is as follows:
|
||||
|
||||
Note that Nix 2.4 (`nixUnstable`) is not yet supported.
|
||||
|
||||
2. Add the appropriate Home Manager channel. Typically this is
|
||||
2. Add the appropriate Home Manager channel. If you are following
|
||||
Nixpkgs master or an unstable channel you can run
|
||||
|
||||
```console
|
||||
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
$ nix-channel --update
|
||||
```
|
||||
|
||||
if you are following Nixpkgs master or an unstable channel and
|
||||
and if you follow a Nixpkgs version 21.05 channel you can run
|
||||
|
||||
```console
|
||||
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.tar.gz home-manager
|
||||
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
|
||||
$ nix-channel --update
|
||||
```
|
||||
|
||||
if you follow a Nixpkgs version 20.09 channel.
|
||||
|
||||
On NixOS you may need to log out and back in for the channel to
|
||||
become available. On non-NixOS you may have to add
|
||||
|
||||
@@ -104,9 +107,8 @@ Currently the easiest way to install Home Manager is as follows:
|
||||
$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||
```
|
||||
|
||||
file in your shell configuration. Unfortunately, in this specific
|
||||
case we currently only support POSIX.2-like shells such as
|
||||
[Bash][] or [Z shell][].
|
||||
file in your shell configuration. This file can be sourced
|
||||
directly by POSIX.2-like shells such as [Bash][] or [Z shell][].
|
||||
|
||||
For example, if you use Bash then add
|
||||
|
||||
@@ -114,7 +116,16 @@ Currently the easiest way to install Home Manager is as follows:
|
||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
```
|
||||
|
||||
to your `~/.profile` file.
|
||||
or this when managing home configuration together with system
|
||||
configuration
|
||||
|
||||
```bash
|
||||
. "/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh"
|
||||
```
|
||||
|
||||
to your `~/.profile` file. For fish shell, it is possible to use
|
||||
[foreign-env](https://github.com/oh-my-fish/plugin-foreign-env) to
|
||||
source the file.
|
||||
|
||||
If instead of using channels you want to run Home Manager from a Git
|
||||
checkout of the repository then you can use the
|
||||
@@ -132,7 +143,7 @@ configuration generations.
|
||||
As an example, let us expand the initial configuration file from the
|
||||
installation above to install the htop and fortune packages, install
|
||||
Emacs with a few extra packages enabled, install Firefox with
|
||||
smooth scrolling enabled, and enable the user gpg-agent service.
|
||||
smooth scrolling disabled, and enable the user gpg-agent service.
|
||||
|
||||
To satisfy the above setup we should elaborate the
|
||||
`~/.config/nixpkgs/home.nix` file as follows:
|
||||
@@ -269,7 +280,7 @@ then result in
|
||||
$ home-manager switch
|
||||
…
|
||||
Activating checkLinkTargets
|
||||
Existing file '/home/jdoe/.gitconfig' is in the way
|
||||
Existing file '/home/jdoe/.config/git/config' is in the way
|
||||
Please move the above files and try again
|
||||
```
|
||||
|
||||
@@ -333,7 +344,7 @@ as follows:
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.user = import ./home.nix;
|
||||
home-manager.users.jdoe = import ./home.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
@@ -342,6 +353,13 @@ as follows:
|
||||
}
|
||||
```
|
||||
|
||||
Note, the Home Manager library is exported by the flake under
|
||||
`lib.hm`.
|
||||
|
||||
When using flakes, switch to new configurations as you do for the
|
||||
whole system (e. g. `nixos-rebuild switch --flake <path>`) instead of
|
||||
using the `home-manager` command line tool.
|
||||
|
||||
Releases
|
||||
--------
|
||||
|
||||
@@ -349,7 +367,7 @@ Home Manager is developed against `nixpkgs-unstable` branch, which
|
||||
often causes it to contain tweaks for changes/packages not yet
|
||||
released in stable NixOS. To avoid breaking users' configurations,
|
||||
Home Manager is released in branches corresponding to NixOS releases
|
||||
(e.g. `release-20.09`). These branches get fixes, but usually not new
|
||||
(e.g. `release-21.05`). These branches get fixes, but usually not new
|
||||
modules. If you need a module to be backported, then feel free to open
|
||||
an issue.
|
||||
|
||||
@@ -362,9 +380,8 @@ an issue.
|
||||
[Z shell]: http://zsh.sourceforge.net/
|
||||
[manual]: https://nix-community.github.io/home-manager/
|
||||
[configuration options]: https://nix-community.github.io/home-manager/options.html
|
||||
[#home-manager]: https://webchat.freenode.net/?url=irc%3A%2F%2Firc.freenode.net%2Fhome-manager
|
||||
[freenode]: https://freenode.net/
|
||||
[channel logs]: https://logs.nix.samueldr.com/home-manager/
|
||||
[#home-manager]: https://webchat.oftc.net/?channels=home-manager
|
||||
[OFTC]: https://oftc.net/
|
||||
[samueldr]: https://github.com/samueldr/
|
||||
[Nix Pills]: https://nixos.org/nixos/nix-pills/
|
||||
[Nix Flakes]: https://nixos.wiki/wiki/Flakes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
|
||||
rec {
|
||||
docs = with import ./doc { inherit pkgs; }; {
|
||||
docs = with import ./docs { inherit pkgs; }; {
|
||||
html = manual.html;
|
||||
manPages = manPages;
|
||||
json = options.json;
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
{ pkgs
|
||||
|
||||
# Note, this should be "the standard library" + HM extensions.
|
||||
, lib ? import ../modules/lib/stdlib-extended.nix pkgs.lib }:
|
||||
|
||||
let
|
||||
|
||||
nmdSrc = pkgs.fetchFromGitLab {
|
||||
name = "nmd";
|
||||
owner = "rycee";
|
||||
repo = "nmd";
|
||||
rev = "2398aa79ab12aa7aba14bc3b08a6efd38ebabdc5";
|
||||
sha256 = "0yxb48afvccn8vvpkykzcr4q1rgv8jsijqncia7a5ffzshcrwrnh";
|
||||
};
|
||||
|
||||
nmd = import nmdSrc { inherit lib pkgs; };
|
||||
|
||||
# Make sure the used package is scrubbed to avoid actually
|
||||
# instantiating derivations.
|
||||
scrubbedPkgsModule = {
|
||||
imports = [{
|
||||
_module.args = {
|
||||
pkgs = lib.mkForce (nmd.scrubDerivations "pkgs" pkgs);
|
||||
pkgs_i686 = lib.mkForce { };
|
||||
};
|
||||
}];
|
||||
};
|
||||
|
||||
hmModulesDocs = nmd.buildModulesDocs {
|
||||
modules = import ../modules/modules.nix {
|
||||
inherit lib pkgs;
|
||||
check = false;
|
||||
} ++ [ scrubbedPkgsModule ];
|
||||
moduleRootPaths = [ ./.. ];
|
||||
mkModuleUrl = path:
|
||||
"https://github.com/nix-community/home-manager/blob/master/${path}#blob-path";
|
||||
channelName = "home-manager";
|
||||
docBook.id = "home-manager-options";
|
||||
};
|
||||
|
||||
docs = nmd.buildDocBookDocs {
|
||||
pathName = "home-manager";
|
||||
modulesDocs = [ hmModulesDocs ];
|
||||
documentsDirectory = ./.;
|
||||
documentType = "book";
|
||||
chunkToc = ''
|
||||
<toc>
|
||||
<d:tocentry xmlns:d="http://docbook.org/ns/docbook" linkend="book-home-manager-manual"><?dbhtml filename="index.html"?>
|
||||
<d:tocentry linkend="ch-options"><?dbhtml filename="options.html"?></d:tocentry>
|
||||
<d:tocentry linkend="ch-tools"><?dbhtml filename="tools.html"?></d:tocentry>
|
||||
<d:tocentry linkend="ch-release-notes"><?dbhtml filename="release-notes.html"?></d:tocentry>
|
||||
</d:tocentry>
|
||||
</toc>
|
||||
'';
|
||||
};
|
||||
|
||||
in {
|
||||
inherit nmdSrc;
|
||||
|
||||
options = {
|
||||
json = hmModulesDocs.json.override {
|
||||
path = "share/doc/home-manager/options.json";
|
||||
};
|
||||
};
|
||||
|
||||
manPages = docs.manPages;
|
||||
|
||||
manual = { inherit (docs) html htmlOpenTool; };
|
||||
}
|
||||
@@ -1,334 +0,0 @@
|
||||
<chapter xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
version="5.0"
|
||||
xml:id="ch-installation">
|
||||
<title>Installing Home Manager</title>
|
||||
<para>
|
||||
Home Manager can be used in three primary ways:
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
Using the standalone <command>home-manager</command> tool. For platforms
|
||||
other than NixOS and Darwin, this is the only available choice. It is also
|
||||
recommended for people on NixOS or Darwin that want to manage their home
|
||||
directory independent of the system as a whole. See
|
||||
<xref linkend="sec-install-standalone"/> for instructions on how to
|
||||
perform this installation.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
As a module within a NixOS system configuration. This allows the user
|
||||
profiles to be built together with the system when running
|
||||
<command>nixos-rebuild</command>. See
|
||||
<xref linkend="sec-install-nixos-module"/> for a description of this
|
||||
setup.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
As a module within a
|
||||
<link xlink:href="https://github.com/LnL7/nix-darwin/">nix-darwin</link>
|
||||
system configuration. This allows the user profiles to be built together
|
||||
with the system when running <command>darwin-rebuild</command>. See
|
||||
<xref linkend="sec-install-nix-darwin-module"/> for a description of this
|
||||
setup.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
<section xml:id="sec-install-standalone">
|
||||
<title>Standalone installation</title>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
Make sure you have a working Nix installation. Specifically, make
|
||||
sure that your user is able to build and install Nix packages.
|
||||
For example, you should be able to successfully run a command
|
||||
like <literal>nix-instantiate '<nixpkgs>' -A hello</literal>
|
||||
without having to switch to the root user. For a multi-user
|
||||
install of Nix this means that your user must be covered by the
|
||||
<link xlink:href="https://nixos.org/nix/manual/#conf-allowed-users"><literal>allowed-users</literal></link>
|
||||
Nix option. On NixOS you can control this option using the
|
||||
<link xlink:href="https://nixos.org/nixos/manual/options.html#opt-nix.allowedUsers"><literal>nix.allowedUsers</literal></link>
|
||||
system option.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Add the Home Manager channel that you wish to follow. This is done by
|
||||
running
|
||||
</para>
|
||||
<screen>
|
||||
<prompt>$</prompt> <userinput>nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager</userinput>
|
||||
<prompt>$</prompt> <userinput>nix-channel --update</userinput>
|
||||
</screen>
|
||||
<para>
|
||||
if you are following Nixpkgs master or an unstable channel and
|
||||
</para>
|
||||
<screen>
|
||||
<prompt>$</prompt> <userinput>nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.tar.gz home-manager</userinput>
|
||||
<prompt>$</prompt> <userinput>nix-channel --update</userinput>
|
||||
</screen>
|
||||
<para>
|
||||
if you follow a Nixpkgs version 20.09 channel.
|
||||
</para>
|
||||
<para>
|
||||
On NixOS you may need to log out and back in for the channel to become
|
||||
available. On non-NixOS you may have to add
|
||||
<programlisting language="bash">
|
||||
export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
|
||||
</programlisting>
|
||||
to your shell (see
|
||||
<link xlink:href="https://github.com/NixOS/nix/issues/2033">nix#2033</link>).
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Run the Home Manager installation command and create the first Home
|
||||
Manager generation:
|
||||
</para>
|
||||
<screen>
|
||||
<prompt>$</prompt> <userinput>nix-shell '<home-manager>' -A install</userinput>
|
||||
</screen>
|
||||
<para>
|
||||
Once finished, Home Manager should be active and available in your user
|
||||
environment.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
If you do not plan on having Home Manager manage your shell configuration
|
||||
then you must source the
|
||||
</para>
|
||||
<programlisting language="bash">
|
||||
$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||
</programlisting>
|
||||
<para>
|
||||
file in your shell configuration. Unfortunately, we currently only support
|
||||
POSIX.2-like shells such as
|
||||
<link xlink:href="https://www.gnu.org/software/bash/">Bash</link> or
|
||||
<link xlink:href="http://zsh.sourceforge.net/">Z shell</link>.
|
||||
</para>
|
||||
<para>
|
||||
For example, if you use Bash then add
|
||||
</para>
|
||||
<programlisting language="bash">
|
||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
</programlisting>
|
||||
<para>
|
||||
to your <literal>~/.profile</literal> file.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
||||
<para>
|
||||
If instead of using channels you want to run Home Manager from a Git
|
||||
checkout of the repository then you can use the
|
||||
<literal>programs.home-manager.path</literal> option to specify the absolute
|
||||
path to the repository.
|
||||
</para>
|
||||
</section>
|
||||
<section xml:id="sec-install-nixos-module">
|
||||
<title>NixOS module</title>
|
||||
|
||||
<para>
|
||||
Home Manager provides a NixOS module that allows you to prepare user
|
||||
environments directly from the system configuration file, which often is
|
||||
more convenient than using the <command>home-manager</command> tool. It also
|
||||
opens up additional possibilities, for example, to automatically configure
|
||||
user environments in NixOS declarative containers or on systems deployed
|
||||
through NixOps.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To make the NixOS module available for use you must <option>import</option>
|
||||
it into your system configuration. This is most conveniently done by adding
|
||||
a Home Manager channel, for example
|
||||
</para>
|
||||
|
||||
<screen language="console">
|
||||
<prompt>#</prompt> <userinput>nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager</userinput>
|
||||
<prompt>#</prompt> <userinput>nix-channel --update</userinput>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
if you are following Nixpkgs master or an unstable channel and
|
||||
</para>
|
||||
|
||||
<screen language="console">
|
||||
<prompt>#</prompt> <userinput>nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.tar.gz home-manager</userinput>
|
||||
<prompt>#</prompt> <userinput>nix-channel --update</userinput>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
if you follow a Nixpkgs version 20.09 channel.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
It is then possible to add
|
||||
</para>
|
||||
|
||||
<programlisting language="nix">
|
||||
imports = [ <home-manager/nixos> ];
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
to your system <filename>configuration.nix</filename> file, which will
|
||||
introduce a new NixOS option called <option>home-manager.users</option>
|
||||
whose type is an attribute set that maps user names to Home Manager
|
||||
configurations.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For example, a NixOS configuration may include the lines
|
||||
</para>
|
||||
|
||||
<programlisting language="nix">
|
||||
users.users.eve.isNormalUser = true;
|
||||
home-manager.users.eve = { pkgs, ... }: {
|
||||
home.packages = [ pkgs.atool pkgs.httpie ];
|
||||
programs.bash.enable = true;
|
||||
};
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
and after a <command>nixos-rebuild switch</command> the user eve's
|
||||
environment should include a basic Bash configuration and the packages atool
|
||||
and httpie.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
By default packages will be installed to
|
||||
<filename>$HOME/.nix-profile</filename> but they can be installed to
|
||||
<filename>/etc/profiles</filename> if
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
home-manager.useUserPackages = true;
|
||||
</programlisting>
|
||||
<para>
|
||||
is added to the system configuration. This is necessary if, for example,
|
||||
you wish to use <command>nixos-rebuild build-vm</command>. This option may
|
||||
become the default value in the future.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
By default, Home Manager uses a private <literal>pkgs</literal> instance
|
||||
that is configured via the <option>home-manager.users.<name>.nixpkgs</option> options.
|
||||
To instead use the global <literal>pkgs</literal> that is configured via
|
||||
the system level <option>nixpkgs</option> options, set
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
home-manager.useGlobalPkgs = true;
|
||||
</programlisting>
|
||||
<para>
|
||||
This saves an extra Nixpkgs evaluation, adds consistency, and removes the
|
||||
dependency on <envar>NIX_PATH</envar>, which is otherwise used for
|
||||
importing Nixpkgs.
|
||||
</para>
|
||||
</note>
|
||||
</section>
|
||||
<section xml:id="sec-install-nix-darwin-module">
|
||||
<title>nix-darwin module</title>
|
||||
|
||||
<para>
|
||||
Home Manager provides a module that allows you to prepare user
|
||||
environments directly from the nix-darwin configuration file, which often is
|
||||
more convenient than using the <command>home-manager</command> tool.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To make the NixOS module available for use you must <option>import</option>
|
||||
it into your system configuration. This is most conveniently done by adding
|
||||
a Home Manager channel, for example
|
||||
</para>
|
||||
|
||||
<screen language="console">
|
||||
<prompt>#</prompt> <userinput>nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager</userinput>
|
||||
<prompt>#</prompt> <userinput>nix-channel --update</userinput>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
if you are following Nixpkgs master or an unstable channel and
|
||||
</para>
|
||||
|
||||
<screen language="console">
|
||||
<prompt>#</prompt> <userinput>nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.tar.gz home-manager</userinput>
|
||||
<prompt>#</prompt> <userinput>nix-channel --update</userinput>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
if you follow a Nixpkgs version 20.09 channel.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
It is then possible to add
|
||||
</para>
|
||||
|
||||
<programlisting language="nix">
|
||||
imports = [ <home-manager/nix-darwin> ];
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
to your nix-darwin <filename>configuration.nix</filename> file, which will
|
||||
introduce a new NixOS option called <option>home-manager</option> whose type
|
||||
is an attribute set that maps user names to Home Manager configurations.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For example, a nix-darwin configuration may include the lines
|
||||
</para>
|
||||
|
||||
<programlisting language="nix">
|
||||
home-manager.users.eve = { pkgs, ... }: {
|
||||
home.packages = [ pkgs.atool pkgs.httpie ];
|
||||
programs.bash.enable = true;
|
||||
};
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
and after a <command>darwin-rebuild --switch</command> the user eve's
|
||||
environment should include a basic Bash configuration and the packages atool
|
||||
and httpie.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
By default user packages will not be ignored in favor of
|
||||
<option>environment.systemPackages</option>, but they will be intalled to
|
||||
<option>/etc/profiles/per-user/$USERNAME</option> if
|
||||
</para>
|
||||
|
||||
<programlisting language="nix">
|
||||
home-manager.useUserPackages = true;
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
is added to the nix-darwin configuration. This option may become the default
|
||||
value in the future.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
By default, Home Manager uses a private <literal>pkgs</literal> instance
|
||||
that is configured via the <option>home-manager.users.<name>.nixpkgs</option> options.
|
||||
To instead use the global <literal>pkgs</literal> that is configured via
|
||||
the system level <option>nixpkgs</option> options, set
|
||||
</para>
|
||||
<programlisting language="nix">
|
||||
home-manager.useGlobalPkgs = true;
|
||||
</programlisting>
|
||||
<para>
|
||||
This saves an extra Nixpkgs evaluation, adds consistency, and removes the
|
||||
dependency on <envar>NIX_PATH</envar>, which is otherwise used for
|
||||
importing Nixpkgs.
|
||||
</para>
|
||||
</note>
|
||||
</section>
|
||||
</chapter>
|
||||
@@ -1,21 +0,0 @@
|
||||
[[sec-release-21.03]]
|
||||
== Release 21.03
|
||||
|
||||
This is the current unstable branch and the information in this
|
||||
section is therefore not final.
|
||||
|
||||
[[sec-release-21.03-highlights]]
|
||||
=== Highlights
|
||||
|
||||
This release has the following notable changes:
|
||||
|
||||
* Nothing has happened.
|
||||
|
||||
[[sec-release-21.03-state-version-changes]]
|
||||
=== State Version Changes
|
||||
|
||||
The state version in this release includes the changes below. These
|
||||
changes are only active if the `home.stateVersion` option is set to
|
||||
"21.03" or later.
|
||||
|
||||
* Nothing has happened.
|
||||
@@ -44,9 +44,10 @@ The first option is good if you only temporarily want to use your clone.
|
||||
|
||||
[[sec-guidelines]]
|
||||
=== Guidelines
|
||||
:irc-home-manager: https://webchat.freenode.net/?url=irc%3A%2F%2Firc.freenode.net%2Fhome-manager
|
||||
:irc-home-manager: https://webchat.oftc.net/?channels=home-manager
|
||||
:valuable-options: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md#valuable-options
|
||||
:rfc-42: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md
|
||||
:assertions: https://nixos.org/manual/nixos/stable/index.html#sec-assertions
|
||||
|
||||
If your contribution satisfy the following rules then there is a good chance it will be merged without too much trouble. The rules are enforced by the Home Manager maintainers and to a lesser extent the Home Manager CI system.
|
||||
|
||||
@@ -55,7 +56,9 @@ If you are uncertain how these rules affect the change you would like to make th
|
||||
[[sec-guidelines-back-compat]]
|
||||
==== Maintain backward compatibility
|
||||
|
||||
Your contribution should never cause another user's existing configuration to break. Home Manager is used in many different environments and you should consider how you change may effect others. For example,
|
||||
Your contribution should not cause another user's existing configuration to break unless there is a very good reason and the change should be announced to the user through an {assertions}[assertion] or similar.
|
||||
|
||||
Remember that Home Manager is used in many different environments and you should consider how your change may effect others. For example,
|
||||
|
||||
- Does your change work for people that do not use NixOS? Consider other GNU/Linux distributions and macOS.
|
||||
- Does your change work for people whose configuration is built on one system and deployed on another system?
|
||||
@@ -88,7 +91,7 @@ All contributed code _must_ pass the test suite.
|
||||
==== Add relevant documentation
|
||||
:docbook: https://tdg.docbook.org/
|
||||
:asciidoc: https://asciidoc.org/
|
||||
:docbook-rocks: https://docbook.rocks/
|
||||
:docbook-rocks: https://berbiche.github.io/docbook.rocks/
|
||||
|
||||
Many code changes require changing the documentation as well. Module options should be documented with DocBook. See {docbook-rocks}[DocBook rocks!] for a quick introduction and {docbook}[DocBook 5: The Definitive Guide] for in-depth information of DocBook. Home Manager is itself documented using a combination of DocBook and {asciidoc}[AsciiDoc]. All text is hosted in Home Manager's Git repository.
|
||||
|
||||
@@ -160,7 +163,7 @@ The commit messages should follow the {seven-rules}[seven rules]. We also ask yo
|
||||
{long description}
|
||||
----
|
||||
|
||||
where `{component}` refers to the code component (or module) your change affects, `{description}` is a very brief description of your change, and `{long description}` is an optional clarifying description. Note, `{description}` should start with a lower case letter. As a rare exception, if there is no clear component, or your change affects many components, then the `{component}` part is optional. See <<ex-commit-message>> for a commit message that fulfills these requirements.
|
||||
where `{component}` refers to the code component (or module) your change affects, `{description}` is a very brief description of your change, and `{long description}` is an optional clarifying description. As a rare exception, if there is no clear component, or your change affects many components, then the `{component}` part is optional. See <<ex-commit-message>> for a commit message that fulfills these requirements.
|
||||
|
||||
[[ex-commit-message]]
|
||||
.Compliant commit message
|
||||
120
docs/default.nix
Normal file
120
docs/default.nix
Normal file
@@ -0,0 +1,120 @@
|
||||
{ pkgs
|
||||
|
||||
# Note, this should be "the standard library" + HM extensions.
|
||||
, lib ? import ../modules/lib/stdlib-extended.nix pkgs.lib }:
|
||||
|
||||
let
|
||||
|
||||
nmdSrc = pkgs.fetchFromGitLab {
|
||||
name = "nmd";
|
||||
owner = "rycee";
|
||||
repo = "nmd";
|
||||
rev = "2398aa79ab12aa7aba14bc3b08a6efd38ebabdc5";
|
||||
sha256 = "0yxb48afvccn8vvpkykzcr4q1rgv8jsijqncia7a5ffzshcrwrnh";
|
||||
};
|
||||
|
||||
nmd = import nmdSrc { inherit lib pkgs; };
|
||||
|
||||
# Make sure the used package is scrubbed to avoid actually
|
||||
# instantiating derivations.
|
||||
scrubbedPkgsModule = {
|
||||
imports = [{
|
||||
_module.args = {
|
||||
pkgs = lib.mkForce (nmd.scrubDerivations "pkgs" pkgs);
|
||||
pkgs_i686 = lib.mkForce { };
|
||||
};
|
||||
}];
|
||||
};
|
||||
|
||||
buildModulesDocs = args:
|
||||
nmd.buildModulesDocs ({
|
||||
moduleRootPaths = [ ./.. ];
|
||||
mkModuleUrl = path:
|
||||
"https://github.com/nix-community/home-manager/blob/master/${path}#blob-path";
|
||||
channelName = "home-manager";
|
||||
} // args);
|
||||
|
||||
hmModulesDocs = buildModulesDocs {
|
||||
modules = import ../modules/modules.nix {
|
||||
inherit lib pkgs;
|
||||
check = false;
|
||||
} ++ [ scrubbedPkgsModule ];
|
||||
docBook.id = "home-manager-options";
|
||||
};
|
||||
|
||||
nixosModuleDocs = buildModulesDocs {
|
||||
modules = let
|
||||
nixosModule = module: pkgs.path + "/nixos/modules" + module;
|
||||
mockedNixos = with lib; {
|
||||
options = {
|
||||
environment.pathsToLink = mkSinkUndeclaredOptions { };
|
||||
systemd.services = mkSinkUndeclaredOptions { };
|
||||
users.users = mkSinkUndeclaredOptions { };
|
||||
};
|
||||
};
|
||||
in [
|
||||
../nixos/default.nix
|
||||
mockedNixos
|
||||
(nixosModule "/misc/assertions.nix")
|
||||
scrubbedPkgsModule
|
||||
];
|
||||
docBook = {
|
||||
id = "nixos-options";
|
||||
optionIdPrefix = "nixos-opt";
|
||||
};
|
||||
};
|
||||
|
||||
nixDarwinModuleDocs = buildModulesDocs {
|
||||
modules = let
|
||||
nixosModule = module: pkgs.path + "/nixos/modules" + module;
|
||||
mockedNixDarwin = with lib; {
|
||||
options = {
|
||||
environment.pathsToLink = mkSinkUndeclaredOptions { };
|
||||
system.activationScripts.postActivation.text =
|
||||
mkSinkUndeclaredOptions { };
|
||||
users.users = mkSinkUndeclaredOptions { };
|
||||
};
|
||||
};
|
||||
in [
|
||||
../nix-darwin/default.nix
|
||||
mockedNixDarwin
|
||||
(nixosModule "/misc/assertions.nix")
|
||||
scrubbedPkgsModule
|
||||
];
|
||||
docBook = {
|
||||
id = "nix-darwin-options";
|
||||
optionIdPrefix = "nix-darwin-opt";
|
||||
};
|
||||
};
|
||||
|
||||
docs = nmd.buildDocBookDocs {
|
||||
pathName = "home-manager";
|
||||
modulesDocs = [ hmModulesDocs nixDarwinModuleDocs nixosModuleDocs ];
|
||||
documentsDirectory = ./.;
|
||||
documentType = "book";
|
||||
chunkToc = ''
|
||||
<toc>
|
||||
<d:tocentry xmlns:d="http://docbook.org/ns/docbook" linkend="book-home-manager-manual"><?dbhtml filename="index.html"?>
|
||||
<d:tocentry linkend="ch-options"><?dbhtml filename="options.html"?></d:tocentry>
|
||||
<d:tocentry linkend="ch-nixos-options"><?dbhtml filename="nixos-options.html"?></d:tocentry>
|
||||
<d:tocentry linkend="ch-nix-darwin-options"><?dbhtml filename="nix-darwin-options.html"?></d:tocentry>
|
||||
<d:tocentry linkend="ch-tools"><?dbhtml filename="tools.html"?></d:tocentry>
|
||||
<d:tocentry linkend="ch-release-notes"><?dbhtml filename="release-notes.html"?></d:tocentry>
|
||||
</d:tocentry>
|
||||
</toc>
|
||||
'';
|
||||
};
|
||||
|
||||
in {
|
||||
inherit nmdSrc;
|
||||
|
||||
options = {
|
||||
json = hmModulesDocs.json.override {
|
||||
path = "share/doc/home-manager/options.json";
|
||||
};
|
||||
};
|
||||
|
||||
manPages = docs.manPages;
|
||||
|
||||
manual = { inherit (docs) html htmlOpenTool; };
|
||||
}
|
||||
@@ -40,18 +40,26 @@ error: build of ‘/nix/store/b37x3s7pzxbasfqhaca5dqbf3pjjw0ip-user-environment.
|
||||
|
||||
The solution is typically to uninstall the package from the environment using `nix-env --uninstall` and reattempt the Home Manager generation switch.
|
||||
|
||||
=== Why are the session variables not set?
|
||||
You could also opt to unistall _all_ of the packages from your profile with `nix-env --uninstall '*'`.
|
||||
|
||||
Home Manager is only able to set session variables automatically if it manages your Bash or Z shell configuration. If you don't want to let Home Manager manage your shell then you will have to manually source the `~/.nix-profile/etc/profile.d/hm-session-vars.sh` file in an appropriate way. In Bash and Z shell this can be done by adding
|
||||
=== Why are the session variables not set?
|
||||
:foreign-env: https://github.com/oh-my-fish/plugin-foreign-env
|
||||
|
||||
Home Manager is only able to set session variables automatically if it manages your Bash, Z shell, or fish shell configuration. If you don't want to let Home Manager manage your shell then you will have to manually source the `~/.nix-profile/etc/profile.d/hm-session-vars.sh` file in an appropriate way. In Bash and Z shell this can be done by adding
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
----
|
||||
|
||||
to your `.profile` and `.zshrc` files, respectively. The `hm-session-vars.sh` file should work in most Bourne-like shells.
|
||||
to your `.profile` and `.zshrc` files, respectively. The `hm-session-vars.sh` file should work in most Bourne-like shells. For fish shell, it is possible to source it using {foreign-env}[the foreign-env plugin]
|
||||
|
||||
=== How do set up a configuration for multiple users/machines?
|
||||
[source,bash]
|
||||
----
|
||||
fenv source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" > /dev/null
|
||||
----
|
||||
|
||||
=== How to set up a configuration for multiple users/machines?
|
||||
:post-your-homenix: https://www.reddit.com/r/NixOS/comments/9bb9h9/post_your_homemanager_homenix_file/
|
||||
|
||||
A typical way to prepare a repository of configurations for multiple logins and machines is to prepare one "top-level" file for each unique combination.
|
||||
@@ -92,7 +100,7 @@ error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.
|
||||
The solution on NixOS is to add
|
||||
|
||||
[source,nix]
|
||||
services.dbus.packages = with pkgs; [ gnome3.dconf ];
|
||||
programs.dconf.enable = true;
|
||||
|
||||
to your system configuration.
|
||||
|
||||
269
docs/installation.adoc
Normal file
269
docs/installation.adoc
Normal file
@@ -0,0 +1,269 @@
|
||||
[[ch-installation]]
|
||||
== Installing Home Manager
|
||||
|
||||
:nix-darwin: https://github.com/LnL7/nix-darwin/
|
||||
|
||||
Home Manager can be used in three primary ways:
|
||||
|
||||
1. Using the standalone `home-manager` tool. For platforms other than
|
||||
NixOS and Darwin, this is the only available choice. It is also
|
||||
recommended for people on NixOS or Darwin that want to manage their
|
||||
home directory independent of the system as a whole. See
|
||||
<<sec-install-standalone>> for instructions on how to perform this
|
||||
installation.
|
||||
|
||||
2. As a module within a NixOS system configuration. This allows the
|
||||
user profiles to be built together with the system when running
|
||||
`nixos-rebuild`. See <<sec-install-nixos-module>> for a description of
|
||||
this setup.
|
||||
|
||||
3. As a module within a {nix-darwin}[nix-darwin] system configuration.
|
||||
This allows the user profiles to be built together with the system
|
||||
when running `darwin-rebuild`. See <<sec-install-nix-darwin-module>>
|
||||
for a description of this setup.
|
||||
|
||||
[[sec-install-standalone]]
|
||||
=== Standalone installation
|
||||
|
||||
:nix-allowed-users: https://nixos.org/nix/manual/#conf-allowed-users
|
||||
:nixos-allowed-users: https://nixos.org/nixos/manual/options.html#opt-nix.allowedUsers
|
||||
|
||||
1. Make sure you have a working Nix installation. Specifically, make
|
||||
sure that your user is able to build and install Nix packages. For
|
||||
example, you should be able to successfully run a command like
|
||||
`nix-instantiate '<nixpkgs>' -A hello` without having to switch to the
|
||||
root user. For a multi-user install of Nix this means that your user
|
||||
must be covered by the {nix-allowed-users}[`allowed-users`] Nix
|
||||
option. On NixOS you can control this option using the
|
||||
{nixos-allowed-users}[`nix.allowedUsers`] system option.
|
||||
|
||||
2. Add the Home Manager channel that you wish to follow. If you are
|
||||
following Nixpkgs master or an unstable channel then this is done by
|
||||
running
|
||||
+
|
||||
[source,console]
|
||||
----
|
||||
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
$ nix-channel --update
|
||||
----
|
||||
+
|
||||
and if you follow a Nixpkgs version 21.05 channel, you can run
|
||||
+
|
||||
[source,console]
|
||||
----
|
||||
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
|
||||
$ nix-channel --update
|
||||
----
|
||||
+
|
||||
On NixOS you may need to log out and back in for the channel to become
|
||||
available. On non-NixOS you may have to add
|
||||
+
|
||||
[source,bash]
|
||||
export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
|
||||
+
|
||||
to your shell (see
|
||||
https://github.com/NixOS/nix/issues/2033[nix#2033]).
|
||||
|
||||
3. Run the Home Manager installation command and create the first Home
|
||||
Manager generation:
|
||||
+
|
||||
[source,console]
|
||||
$ nix-shell '<home-manager>' -A install
|
||||
+
|
||||
Once finished, Home Manager should be active and available in your
|
||||
user environment.
|
||||
|
||||
4. If you do not plan on having Home Manager manage your shell
|
||||
configuration then you must source the
|
||||
+
|
||||
[source,bash]
|
||||
$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||
+
|
||||
file in your shell configuration. Alternatively source
|
||||
+
|
||||
[source,bash]
|
||||
/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh
|
||||
+
|
||||
when managing home configuration together with system configuration.
|
||||
+
|
||||
This file can be sourced directly by POSIX.2-like shells such as
|
||||
https://www.gnu.org/software/bash/[Bash] or
|
||||
http://zsh.sourceforge.net/[Z shell].
|
||||
+
|
||||
For example, if you use Bash then add
|
||||
+
|
||||
[source,bash]
|
||||
----
|
||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
----
|
||||
+
|
||||
to your `~/.profile` file. For fish shell, it is possible to use
|
||||
https://github.com/oh-my-fish/plugin-foreign-env[foreign-env] to
|
||||
source the file.
|
||||
|
||||
If instead of using channels you want to run Home Manager from a Git
|
||||
checkout of the repository then you can use the
|
||||
<<opt-programs.home-manager.path>> option to specify the absolute path
|
||||
to the repository.
|
||||
|
||||
[[sec-install-nixos-module]]
|
||||
=== NixOS module
|
||||
|
||||
Home Manager provides a NixOS module that allows you to prepare user
|
||||
environments directly from the system configuration file, which often
|
||||
is more convenient than using the `home-manager` tool. It also opens
|
||||
up additional possibilities, for example, to automatically configure
|
||||
user environments in NixOS declarative containers or on systems
|
||||
deployed through NixOps.
|
||||
|
||||
To make the NixOS module available for use you must `import` it into
|
||||
your system configuration. This is most conveniently done by adding a
|
||||
Home Manager channel. For example, if you are following Nixpkgs master
|
||||
or an unstable channel, you can run
|
||||
|
||||
[source,console]
|
||||
----
|
||||
# nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
# nix-channel --update
|
||||
----
|
||||
|
||||
and if you follow a Nixpkgs version 21.05 channel, you can run
|
||||
|
||||
[source,console]
|
||||
----
|
||||
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
|
||||
# nix-channel --update
|
||||
----
|
||||
|
||||
It is then possible to add
|
||||
|
||||
[source,nix]
|
||||
imports = [ <home-manager/nixos> ];
|
||||
|
||||
to your system `configuration.nix` file, which will introduce a new
|
||||
NixOS option called `home-manager.users` whose type is an attribute
|
||||
set that maps user names to Home Manager configurations.
|
||||
|
||||
For example, a NixOS configuration may include the lines
|
||||
|
||||
[source,nix]
|
||||
----
|
||||
users.users.eve.isNormalUser = true;
|
||||
home-manager.users.eve = { pkgs, ... }: {
|
||||
home.packages = [ pkgs.atool pkgs.httpie ];
|
||||
programs.bash.enable = true;
|
||||
};
|
||||
----
|
||||
|
||||
and after a `nixos-rebuild switch` the user eve's environment should
|
||||
include a basic Bash configuration and the packages atool and httpie.
|
||||
|
||||
[NOTE]
|
||||
====
|
||||
By default packages will be installed to `$HOME/.nix-profile` but they
|
||||
can be installed to `/etc/profiles` if
|
||||
|
||||
[source,nix]
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
is added to the system configuration. This is necessary if, for
|
||||
example, you wish to use `nixos-rebuild build-vm`. This option may
|
||||
become the default value in the future.
|
||||
====
|
||||
|
||||
[NOTE]
|
||||
====
|
||||
By default, Home Manager uses a private `pkgs` instance that is
|
||||
configured via the `home-manager.users.<name>.nixpkgs` options. To
|
||||
instead use the global `pkgs` that is configured via the system level
|
||||
`nixpkgs` options, set
|
||||
|
||||
[source,nix]
|
||||
home-manager.useGlobalPkgs = true;
|
||||
|
||||
This saves an extra Nixpkgs evaluation, adds consistency, and removes
|
||||
the dependency on `NIX_PATH`, which is otherwise used for importing
|
||||
Nixpkgs.
|
||||
====
|
||||
|
||||
[[sec-install-nix-darwin-module]]
|
||||
=== nix-darwin module
|
||||
|
||||
Home Manager provides a module that allows you to prepare user
|
||||
environments directly from the {nix-darwin}[nix-darwin] configuration
|
||||
file, which often is more convenient than using the `home-manager`
|
||||
tool.
|
||||
|
||||
To make the NixOS module available for use you must `import` it into
|
||||
your system configuration. This is most conveniently done by adding a
|
||||
Home Manager channel. For example, if you are following Nixpkgs master
|
||||
or an unstable channel, you can run
|
||||
|
||||
[source,console]
|
||||
----
|
||||
# nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
# nix-channel --update
|
||||
----
|
||||
|
||||
and if you follow a Nixpkgs version 21.05 channel, you can run
|
||||
|
||||
[source,console]
|
||||
----
|
||||
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
|
||||
# nix-channel --update
|
||||
----
|
||||
|
||||
It is then possible to add
|
||||
|
||||
[source,nix]
|
||||
imports = [ <home-manager/nix-darwin> ];
|
||||
|
||||
to your nix-darwin `configuration.nix` file, which will introduce a
|
||||
new NixOS option called `home-manager` whose type is an attribute set
|
||||
that maps user names to Home Manager configurations.
|
||||
|
||||
For example, a nix-darwin configuration may include the lines
|
||||
|
||||
[source,nix]
|
||||
----
|
||||
users.users.eve = {
|
||||
name = "eve";
|
||||
home = "/Users/eve";
|
||||
}
|
||||
home-manager.users.eve = { pkgs, ... }: {
|
||||
home.packages = [ pkgs.atool pkgs.httpie ];
|
||||
programs.bash.enable = true;
|
||||
};
|
||||
----
|
||||
|
||||
and after a `darwin-rebuild switch` the user eve's environment
|
||||
should include a basic Bash configuration and the packages atool and
|
||||
httpie.
|
||||
|
||||
[NOTE]
|
||||
====
|
||||
By default user packages will not be ignored in favor of
|
||||
`environment.systemPackages`, but they will be intalled to
|
||||
`/etc/profiles/per-user/$USERNAME` if
|
||||
|
||||
[source,nix]
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
is added to the nix-darwin configuration. This option may become the
|
||||
default value in the future.
|
||||
====
|
||||
|
||||
[NOTE]
|
||||
====
|
||||
By default, Home Manager uses a private `pkgs` instance that is
|
||||
configured via the `home-manager.users.<name>.nixpkgs` options. To
|
||||
instead use the global `pkgs` that is configured via the system level
|
||||
`nixpkgs` options, set
|
||||
|
||||
[source,nix]
|
||||
home-manager.useGlobalPkgs = true;
|
||||
|
||||
This saves an extra Nixpkgs evaluation, adds consistency, and removes
|
||||
the dependency on `NIX_PATH`, which is otherwise used for importing
|
||||
Nixpkgs.
|
||||
====
|
||||
@@ -12,47 +12,51 @@
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>home-manager</command> <group choice="req">
|
||||
<command>home-manager</command> <group choice="req">
|
||||
<arg choice="plain">
|
||||
build
|
||||
</arg>
|
||||
|
||||
|
||||
<arg choice="plain">
|
||||
instantiate
|
||||
</arg>
|
||||
|
||||
|
||||
<arg choice="plain">
|
||||
edit
|
||||
</arg>
|
||||
|
||||
|
||||
<arg choice="plain">
|
||||
expire-generations <replaceable>timestamp</replaceable>
|
||||
</arg>
|
||||
|
||||
|
||||
<arg choice="plain">
|
||||
generations
|
||||
</arg>
|
||||
|
||||
|
||||
<arg choice="plain">
|
||||
help
|
||||
</arg>
|
||||
|
||||
|
||||
<arg choice="plain">
|
||||
news
|
||||
</arg>
|
||||
|
||||
|
||||
<arg choice="plain">
|
||||
option <replaceable>option.name</replaceable>
|
||||
</arg>
|
||||
|
||||
<arg choice="plain">
|
||||
packages
|
||||
</arg>
|
||||
|
||||
|
||||
<arg choice="plain">
|
||||
remove-generations <replaceable>ID …</replaceable>
|
||||
</arg>
|
||||
|
||||
|
||||
<arg choice="plain">
|
||||
switch
|
||||
</arg>
|
||||
|
||||
|
||||
<arg choice="plain">
|
||||
uninstall
|
||||
</arg>
|
||||
@@ -61,85 +65,110 @@
|
||||
<arg>
|
||||
-A <replaceable>attrPath</replaceable>
|
||||
</arg>
|
||||
|
||||
|
||||
<arg>
|
||||
-I <replaceable>path</replaceable>
|
||||
</arg>
|
||||
|
||||
|
||||
<arg>
|
||||
--flake <replaceable>flake-uri</replaceable>
|
||||
</arg>
|
||||
|
||||
<arg>
|
||||
-b <replaceable>ext</replaceable>
|
||||
</arg>
|
||||
|
||||
|
||||
<arg>
|
||||
<group choice="req">
|
||||
<group choice="req">
|
||||
<arg choice="plain">
|
||||
-f
|
||||
</arg>
|
||||
|
||||
|
||||
<arg choice="plain">
|
||||
--file
|
||||
</arg>
|
||||
</group> <replaceable>path</replaceable>
|
||||
</arg>
|
||||
|
||||
|
||||
<arg>
|
||||
<group choice="req">
|
||||
<group choice="req">
|
||||
<arg choice="plain">
|
||||
-h
|
||||
</arg>
|
||||
|
||||
|
||||
<arg choice="plain">
|
||||
--help
|
||||
</arg>
|
||||
</group>
|
||||
</arg>
|
||||
|
||||
|
||||
<arg>
|
||||
<group choice="req">
|
||||
<group choice="req">
|
||||
<arg choice="plain">
|
||||
-n
|
||||
</arg>
|
||||
|
||||
|
||||
<arg choice="plain">
|
||||
--dry-run
|
||||
</arg>
|
||||
</group>
|
||||
</arg>
|
||||
|
||||
|
||||
<arg>
|
||||
--option <replaceable>name</replaceable> <replaceable>value</replaceable>
|
||||
</arg>
|
||||
|
||||
|
||||
<arg>
|
||||
--cores <replaceable>number</replaceable>
|
||||
</arg>
|
||||
|
||||
|
||||
<arg>
|
||||
--max-jobs <replaceable>number</replaceable>
|
||||
<group choice="req">
|
||||
<arg choice="plain">
|
||||
-j
|
||||
</arg>
|
||||
|
||||
<arg choice="plain">
|
||||
--max-jobs
|
||||
</arg>
|
||||
</group>
|
||||
<replaceable>number</replaceable>
|
||||
</arg>
|
||||
|
||||
|
||||
<arg>
|
||||
--debug
|
||||
</arg>
|
||||
|
||||
<arg>
|
||||
--impure
|
||||
</arg>
|
||||
|
||||
<arg>
|
||||
--keep-failed
|
||||
</arg>
|
||||
|
||||
|
||||
<arg>
|
||||
--keep-going
|
||||
</arg>
|
||||
|
||||
|
||||
<arg>
|
||||
--show-trace
|
||||
</arg>
|
||||
|
||||
|
||||
<arg>
|
||||
--(no-)substitute
|
||||
</arg>
|
||||
|
||||
|
||||
<arg>
|
||||
<group choice="req">
|
||||
--no-out-link
|
||||
</arg>
|
||||
|
||||
<arg>
|
||||
<group choice="req">
|
||||
<arg choice="plain">
|
||||
-v
|
||||
</arg>
|
||||
|
||||
|
||||
<arg choice="plain">
|
||||
--verbose
|
||||
</arg>
|
||||
@@ -151,7 +180,7 @@
|
||||
<title>Description</title>
|
||||
<para>
|
||||
This command updates the user environment so that it corresponds to the
|
||||
configuration specified in <filename>~/.config/nixpkgs/home.nix</filename>.
|
||||
configuration specified in <filename>~/.config/nixpkgs/home.nix</filename> or <filename>~/.config/nixpkgs/flake.nix</filename>.
|
||||
</para>
|
||||
<para>
|
||||
All operations using this tool expects a sub-command that indicates the
|
||||
@@ -233,6 +262,18 @@
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>option <replaceable>option.name</replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Inspect the given option name in the home configuration, like <citerefentry>
|
||||
<refentrytitle>nixos-option</refentrytitle>
|
||||
<manvolnum>8</manvolnum> </citerefentry>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>packages</option>
|
||||
@@ -334,6 +375,18 @@
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--flake <replaceable>flake-uri[#name]</replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Build Home Manager configuration from the flake, which must contain the
|
||||
output homeConfigurations.name. If no name is specified it will first try
|
||||
username@hostname and then username.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-b <replaceable>extension</replaceable></option>
|
||||
@@ -417,6 +470,9 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-j <replaceable>number</replaceable></option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--max-jobs <replaceable>number</replaceable></option>
|
||||
</term>
|
||||
@@ -428,6 +484,30 @@
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--debug</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Passed on to <citerefentry>
|
||||
<refentrytitle>nix-build</refentrytitle>
|
||||
<manvolnum>1</manvolnum> </citerefentry>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--impure</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Passed on to <citerefentry>
|
||||
<refentrytitle>nix-build</refentrytitle>
|
||||
<manvolnum>1</manvolnum> </citerefentry>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--keep-failed</option>
|
||||
@@ -476,6 +556,19 @@
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--no-out-link</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Passed on to <citerefentry>
|
||||
<refentrytitle>nix-build</refentrytitle>
|
||||
<manvolnum>1</manvolnum> </citerefentry>
|
||||
when running <command>home-manager build</command>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-v</option>
|
||||
@@ -9,15 +9,13 @@
|
||||
<preface>
|
||||
<title>Preface</title>
|
||||
<para>
|
||||
This manual will eventually describes how to install, use, and extend Home
|
||||
This manual will eventually describe how to install, use, and extend Home
|
||||
Manager.
|
||||
</para>
|
||||
<para>
|
||||
If you encounter problems then please reach out on the IRC channel
|
||||
<link xlink:href="https://webchat.freenode.net/?url=irc%3A%2F%2Firc.freenode.net%2Fhome-manager">#home-manager</link>
|
||||
hosted by <link xlink:href="https://freenode.net/">freenode</link>.
|
||||
The <link xlink:href="https://logs.nix.samueldr.com/home-manager/">channel logs</link>
|
||||
are hosted courtesy of <link xlink:href="https://github.com/samueldr/">samueldr</link>.
|
||||
<link xlink:href="https://webchat.oftc.net/?channels=home-manager">#home-manager</link>
|
||||
hosted by <link xlink:href="https://oftc.net/">OFTC</link>.
|
||||
If your problem is caused by a bug in Home Manager then it should
|
||||
be reported on the
|
||||
<link xlink:href="https://github.com/nix-community/home-manager/issues">Home Manager issue tracker</link>.
|
||||
@@ -38,6 +36,14 @@
|
||||
<title>Configuration Options</title>
|
||||
<xi:include href="./nmd-result/home-manager-options.xml" />
|
||||
</appendix>
|
||||
<appendix xml:id="ch-nixos-options">
|
||||
<title>NixOS Module Options</title>
|
||||
<xi:include href="./nmd-result/nixos-options.xml" />
|
||||
</appendix>
|
||||
<appendix xml:id="ch-nix-darwin-options">
|
||||
<title>nix-darwin Module Options</title>
|
||||
<xi:include href="./nmd-result/nix-darwin-options.xml" />
|
||||
</appendix>
|
||||
<appendix xml:id="ch-tools">
|
||||
<title>Tools</title>
|
||||
<xi:include href="./man-home-manager.xml" />
|
||||
@@ -6,7 +6,9 @@ This section lists the release notes for stable versions of Home Manager and the
|
||||
|
||||
:leveloffset: 1
|
||||
|
||||
include::rl-2103.adoc[]
|
||||
include::rl-2111.adoc[]
|
||||
|
||||
include::rl-2105.adoc[]
|
||||
|
||||
include::rl-2009.adoc[]
|
||||
|
||||
200
docs/release-notes/rl-2105.adoc
Normal file
200
docs/release-notes/rl-2105.adoc
Normal file
@@ -0,0 +1,200 @@
|
||||
[[sec-release-21.05]]
|
||||
== Release 21.05
|
||||
|
||||
The 21.05 release branch became the stable branch in May, 2021.
|
||||
|
||||
[[sec-release-21.05-highlights]]
|
||||
=== Highlights
|
||||
|
||||
This release has the following notable changes:
|
||||
|
||||
* The <<opt-programs.broot.verbs>> option is now a list rather than an
|
||||
attribute set. To migrate, move the keys of the attrset into the list
|
||||
items' `invocation` keys. For example,
|
||||
+
|
||||
[source,nix]
|
||||
----
|
||||
programs.broot.verbs = {
|
||||
"p" = { execution = ":parent"; };
|
||||
};
|
||||
----
|
||||
+
|
||||
becomes
|
||||
+
|
||||
[source,nix]
|
||||
----
|
||||
programs.broot.verbs = [
|
||||
{
|
||||
invocation = "p";
|
||||
execution = ":parent";
|
||||
}
|
||||
];
|
||||
----
|
||||
|
||||
* The <<opt-programs.mpv.package>> option has been changed to allow custom
|
||||
derivations. The following configuration is now possible:
|
||||
+
|
||||
[source,nix]
|
||||
----
|
||||
programs.mpv.package = (pkgs.wrapMpv (pkgs.mpv-unwrapped.override {
|
||||
vapoursynthSupport = true;
|
||||
}) {
|
||||
extraMakeWrapperArgs = [
|
||||
"--prefix" "LD_LIBRARY_PATH" ":" "${pkgs.vapoursynth-mvtools}/lib/vapoursynth"
|
||||
];
|
||||
});
|
||||
----
|
||||
+
|
||||
As a result of this change, <<opt-programs.mpv.package>> is no longer the
|
||||
resulting derivation. Use the newly introduced `programs.mpv.finalPackage`
|
||||
instead.
|
||||
|
||||
* The <<opt-programs.rofi.extraConfig>> option is now an attribute set rather
|
||||
than a string. To migrate, move each line into the attribute set,
|
||||
removing the `rofi.` prefix from the keys. For example,
|
||||
+
|
||||
[source,nix]
|
||||
----
|
||||
programs.rofi.extraConfig = ''
|
||||
rofi.show-icons: true
|
||||
rofi.modi: drun,emoji,ssh
|
||||
'';
|
||||
----
|
||||
+
|
||||
becomes
|
||||
+
|
||||
[source,nix]
|
||||
----
|
||||
programs.rofi.extraConfig = {
|
||||
show-icons = true;
|
||||
modi = "drun,emoji,ssh";
|
||||
};
|
||||
----
|
||||
+
|
||||
* The <<opt-programs.rofi.theme>> option now supports defining a theme
|
||||
using an attribute set, the following configuration is now possible:
|
||||
+
|
||||
[source,nix]
|
||||
----
|
||||
programs.rofi.theme = let
|
||||
# Necessary to avoid quoting non-string values
|
||||
inherit (config.lib.formats.rasi) mkLiteral;
|
||||
in {
|
||||
"@import" = "~/.config/rofi/theme.rasi";
|
||||
|
||||
"*" = {
|
||||
background-color = mkLiteral "#000000";
|
||||
foreground-color = mkLiteral "rgba ( 250, 251, 252, 100 % )";
|
||||
border-color = mkLiteral "#FFFFFF";
|
||||
width = 512;
|
||||
};
|
||||
|
||||
"#textbox-prompt-colon" = {
|
||||
expand = false;
|
||||
str = ":";
|
||||
margin = mkLiteral "0px 0.3em 0em 0em";
|
||||
text-color = mkLiteral "@foreground-color";
|
||||
};
|
||||
};
|
||||
----
|
||||
|
||||
|
||||
* The `services.redshift.extraOptions` and `services.gammastep.extraOptions`
|
||||
options were removed in favor of <<opt-services.redshift.settings>> and
|
||||
`services.gammastep.settings`, that are now an attribute set rather
|
||||
than a string. They also support new features not available before, for
|
||||
example:
|
||||
+
|
||||
[source,nix]
|
||||
----
|
||||
services.redshift = {
|
||||
dawnTime = "6:00-7:45";
|
||||
duskTime = "18:35-20:15";
|
||||
settings = {
|
||||
redshift = {
|
||||
gamma = 0.8;
|
||||
adjustment-method = "randr";
|
||||
};
|
||||
|
||||
randr = {
|
||||
screen = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
----
|
||||
+
|
||||
It is recommended to check either
|
||||
https://github.com/jonls/redshift/blob/master/redshift.conf.sample[redshift.conf.sample] or
|
||||
https://gitlab.com/chinstrap/gammastep/-/blob/master/gammastep.conf.sample[gammastep.conf.sample]
|
||||
for the available additional options in each program.
|
||||
|
||||
* Specifying `programs.neomutt.binds.map` or `programs.neomutt.macros.map` as a
|
||||
single string is now deprecated in favor of specfiying it as a list of
|
||||
strings.
|
||||
|
||||
* The `programs.neovim.configure` is deprecated in favor of other `programs.neovim` options;
|
||||
please use the other options at your disposal:
|
||||
+
|
||||
[source,nix]
|
||||
----
|
||||
configure.packages.*.opt -> programs.neovim.plugins = [ { plugin = ...; optional = true; }]
|
||||
configure.packages.*.start -> programs.neovim.plugins = [ { plugin = ...; }]
|
||||
configure.customRC -> programs.neovim.extraConfig
|
||||
----
|
||||
|
||||
* Home Manager now respects the `NO_COLOR` environment variable as per
|
||||
https://no-color.org/[].
|
||||
|
||||
* Qt module now supports <<opt-qt.style.name>> to specify a theme name and
|
||||
<<opt-qt.style.package>> to specify a theme package. If you have set
|
||||
<<opt-qt.platformTheme>> to `gnome`, a <<opt-qt.style.package>> compatible
|
||||
with both Qt and Gtk is now required to be set. For instance:
|
||||
+
|
||||
[source,nix]
|
||||
----
|
||||
qt = {
|
||||
platformTheme = "gnome";
|
||||
style = {
|
||||
name = "adwaita-dark";
|
||||
package = pkgs.adwaita-qt;
|
||||
};
|
||||
};
|
||||
----
|
||||
|
||||
* The library type `fontType` now has a `size` attribute in addition to `name`. For example:
|
||||
+
|
||||
[source,nix]
|
||||
----
|
||||
font = {
|
||||
name = "DejaVu Sans";
|
||||
size = 8;
|
||||
};
|
||||
----
|
||||
|
||||
* The <<opt-programs.htop.settings>> option is introduced to replace individual
|
||||
options in `programs.htop`. To migrate, set the htop options directly in
|
||||
<<opt-programs.htop.settings>>. For example:
|
||||
+
|
||||
[source,nix]
|
||||
----
|
||||
programs.htop = {
|
||||
enabled = true;
|
||||
settings = {
|
||||
color_scheme = 5;
|
||||
delay = 15;
|
||||
highlight_base_name = 1;
|
||||
highlight_megabytes = 1;
|
||||
highlight_threads = 1;
|
||||
};
|
||||
};
|
||||
----
|
||||
|
||||
[[sec-release-21.05-state-version-changes]]
|
||||
=== State Version Changes
|
||||
|
||||
The state version in this release includes the changes below. These
|
||||
changes are only active if the `home.stateVersion` option is set to
|
||||
"21.05" or later.
|
||||
|
||||
* The `newsboat` module now stores generated configuration in
|
||||
`$XDG_CONFIG_HOME/newsboat`.
|
||||
43
docs/release-notes/rl-2111.adoc
Normal file
43
docs/release-notes/rl-2111.adoc
Normal file
@@ -0,0 +1,43 @@
|
||||
[[sec-release-21.11]]
|
||||
== Release 21.11
|
||||
|
||||
This is the current unstable branch and the information in this
|
||||
section is therefore not final.
|
||||
|
||||
[[sec-release-21.11-highlights]]
|
||||
=== Highlights
|
||||
|
||||
This release has the following notable changes:
|
||||
|
||||
* All Home Manager modules are now loaded on all platforms. With this
|
||||
change you will get a more descriptive error message if you attempt to
|
||||
enable a module that is incompatible with the host platform.
|
||||
+
|
||||
Previously, modules that were platform specific would only be loaded
|
||||
on that particular platform. For example, a module defining a
|
||||
https://systemd.io/[systemd] service would only be loaded when the
|
||||
host platform was Linux. This reduced evaluation times, simplified the
|
||||
generated documentation, and made it impossible to accidentally use
|
||||
modules that do not support the host platform.
|
||||
+
|
||||
While the above benefits are quite nice, avoiding module loads also
|
||||
brings a few problems. For example, the
|
||||
https://nix-community.github.io/home-manager/[public documentation]
|
||||
will only show the options available for Linux hosts and the
|
||||
documentation cannot make references to options within modules that
|
||||
are unavailable on some hosts. Finally, users who wish to use the same
|
||||
configuration file for different platforms cannot do so, even if the
|
||||
platform incompatible options are unused.
|
||||
+
|
||||
Ultimately, the benefits of loading all modules won and the behavior
|
||||
has now changed. For associated discussion see
|
||||
https://github.com/nix-community/home-manager/issues/1906[issue #1906].
|
||||
|
||||
[[sec-release-21.11-state-version-changes]]
|
||||
=== State Version Changes
|
||||
|
||||
The state version in this release includes the changes below. These
|
||||
changes are only active if the `home.stateVersion` option is set to
|
||||
"21.11" or later.
|
||||
|
||||
* Nothing has happened.
|
||||
58
flake.nix
58
flake.nix
@@ -1,23 +1,51 @@
|
||||
{
|
||||
description = "Home Manager for Nix";
|
||||
|
||||
outputs = { self, nixpkgs }: rec {
|
||||
nixosModules.home-manager = import ./nixos;
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
# List of systems supported by home-manager binary
|
||||
supportedSystems = nixpkgs.lib.platforms.unix;
|
||||
|
||||
darwinModules.home-manager = import ./nix-darwin;
|
||||
# Function to generate a set based on supported systems
|
||||
forAllSystems = f:
|
||||
nixpkgs.lib.genAttrs supportedSystems (system: f system);
|
||||
|
||||
lib = {
|
||||
homeManagerConfiguration = { configuration, system, homeDirectory
|
||||
, username
|
||||
, pkgs ? builtins.getAttr system nixpkgs.outputs.legacyPackages
|
||||
, check ? true }@args:
|
||||
import ./modules {
|
||||
inherit pkgs check;
|
||||
configuration = { ... }: {
|
||||
imports = [ configuration ];
|
||||
home = { inherit homeDirectory username; };
|
||||
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
|
||||
in rec {
|
||||
nixosModules.home-manager = import ./nixos;
|
||||
nixosModule = self.nixosModules.home-manager;
|
||||
|
||||
darwinModules.home-manager = import ./nix-darwin;
|
||||
darwinModule = self.darwinModules.home-manager;
|
||||
|
||||
packages = forAllSystems (system:
|
||||
let docs = import ./docs { pkgs = nixpkgsFor.${system}; };
|
||||
in {
|
||||
home-manager = nixpkgsFor.${system}.callPackage ./home-manager { };
|
||||
docs-html = docs.manual.html;
|
||||
docs-manpages = docs.manPages;
|
||||
docs-json = docs.options.json;
|
||||
});
|
||||
|
||||
defaultPackage =
|
||||
forAllSystems (system: self.packages.${system}.home-manager);
|
||||
|
||||
lib = {
|
||||
hm = import ./modules/lib { lib = nixpkgs.lib; };
|
||||
homeManagerConfiguration = { configuration, system, homeDirectory
|
||||
, username, extraModules ? [ ], extraSpecialArgs ? { }
|
||||
, pkgs ? builtins.getAttr system nixpkgs.outputs.legacyPackages
|
||||
, check ? true, stateVersion ? "20.09" }@args:
|
||||
assert nixpkgs.lib.versionAtLeast stateVersion "20.09";
|
||||
|
||||
import ./modules {
|
||||
inherit pkgs check extraSpecialArgs;
|
||||
configuration = { ... }: {
|
||||
imports = [ configuration ] ++ extraModules;
|
||||
home = { inherit homeDirectory stateVersion username; };
|
||||
nixpkgs = { inherit (pkgs) config overlays; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
21
format
21
format
@@ -1,5 +1,5 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/05f0934825c2a0750d4888c4735f9420c906b388.tar.gz -i bash -p findutils nixfmt
|
||||
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/5edf5b60c3d8f82b5fc5e73e822b6f7460584945.tar.gz -i bash -p findutils nixfmt
|
||||
|
||||
CHECK_ARG=
|
||||
|
||||
@@ -18,7 +18,6 @@ esac
|
||||
find . -name '*.nix' \
|
||||
! -path ./modules/programs/irssi.nix \
|
||||
\
|
||||
! -path ./home-manager/default.nix \
|
||||
! -path ./home-manager/home-manager.nix \
|
||||
! -path ./modules/default.nix \
|
||||
! -path ./modules/files.nix \
|
||||
@@ -26,34 +25,16 @@ find . -name '*.nix' \
|
||||
! -path ./modules/lib/default.nix \
|
||||
! -path ./modules/lib/file-type.nix \
|
||||
! -path ./modules/manual.nix \
|
||||
! -path ./modules/misc/dconf.nix \
|
||||
! -path ./modules/misc/news.nix \
|
||||
! -path ./modules/misc/nixpkgs.nix \
|
||||
! -path ./modules/misc/xdg.nix \
|
||||
! -path ./modules/modules.nix \
|
||||
! -path ./modules/programs/afew.nix \
|
||||
! -path ./modules/programs/bash.nix \
|
||||
! -path ./modules/programs/firefox.nix \
|
||||
! -path ./modules/programs/gpg.nix \
|
||||
! -path ./modules/programs/lesspipe.nix \
|
||||
! -path ./modules/programs/ssh.nix \
|
||||
! -path ./modules/programs/tmux.nix \
|
||||
! -path ./modules/programs/zsh.nix \
|
||||
! -path ./modules/services/gpg-agent.nix \
|
||||
! -path ./modules/services/kbfs.nix \
|
||||
! -path ./modules/services/keybase.nix \
|
||||
! -path ./modules/services/mpd.nix \
|
||||
! -path ./modules/services/sxhkd.nix \
|
||||
! -path ./modules/services/window-managers/i3.nix \
|
||||
! -path ./modules/systemd.nix \
|
||||
! -path ./nix-darwin/default.nix \
|
||||
! -path ./tests/default.nix \
|
||||
! -path ./tests/modules/home-environment/default.nix \
|
||||
! -path ./tests/modules/home-environment/session-variables.nix \
|
||||
! -path ./tests/modules/programs/gpg/override-defaults.nix \
|
||||
! -path ./tests/modules/programs/tmux/default.nix \
|
||||
! -path ./tests/modules/programs/zsh/session-variables.nix \
|
||||
! -path ./tests/modules/services/sxhkd/service.nix \
|
||||
! -path ./tests/modules/systemd/services.nix \
|
||||
! -path ./tests/modules/systemd/session-variables.nix \
|
||||
-exec nixfmt $CHECK_ARG {} +
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
# generations
|
||||
# help
|
||||
# news
|
||||
# option
|
||||
# packages
|
||||
# remove-generations
|
||||
# switch
|
||||
@@ -86,6 +87,7 @@
|
||||
#
|
||||
# help
|
||||
# edit
|
||||
# option
|
||||
# build
|
||||
# switch
|
||||
# generations
|
||||
@@ -131,6 +133,9 @@
|
||||
#
|
||||
# edit Open the home configuration in $EDITOR
|
||||
#
|
||||
# option OPTION.NAME
|
||||
# Inspect configuration option named OPTION.NAME.
|
||||
#
|
||||
# build Build configuration into result directory
|
||||
#
|
||||
# switch Build and activate configuration
|
||||
@@ -278,14 +283,17 @@ _home-manager_completions ()
|
||||
#--------------------------#
|
||||
|
||||
local Subcommands
|
||||
Subcommands=( "help" "edit" "build" "instantiate" "switch" "generations" "remove-generations" "expire-generations" "packages" "news" "uninstall" )
|
||||
Subcommands=( "help" "edit" "option" "build" "instantiate" "switch" "generations" "remove-generations" "expire-generations" "packages" "news" "uninstall" )
|
||||
|
||||
# ^ « home-manager »'s subcommands.
|
||||
|
||||
#--------------------------#
|
||||
|
||||
local Options
|
||||
Options=( "-f" "--file" "-b" "-A" "-I" "-h" "--help" "-n" "--dry-run" "-v" "--verbose" "--show-trace" )
|
||||
Options=( "-f" "--file" "-b" "-A" "-I" "-h" "--help" "-n" "--dry-run" "-v" \
|
||||
"--verbose" "--cores" "--debug" "--impure" "--keep-failed" \
|
||||
"--keep-going" "-j" "--max-jobs" "--no-substitute" "--no-out-link" \
|
||||
"--show-trace" "--substitute" "--builders")
|
||||
|
||||
# ^ « home-manager »'s options.
|
||||
|
||||
@@ -353,4 +361,4 @@ _home-manager_completions ()
|
||||
|
||||
complete -F _home-manager_completions -o default home-manager
|
||||
|
||||
#complete -W "help edit build switch generations remove-generations expire-generations packages news" home-manager
|
||||
#complete -W "help edit option build switch generations remove-generations expire-generations packages news" home-manager
|
||||
|
||||
65
home-manager/completion.fish
Normal file
65
home-manager/completion.fish
Normal file
@@ -0,0 +1,65 @@
|
||||
#!/bin/env fish
|
||||
##################################################
|
||||
|
||||
# « home-manager » command-line fish completion
|
||||
#
|
||||
# © 2021 "Ariel AxionL" <i at axionl dot me>
|
||||
#
|
||||
# MIT License
|
||||
#
|
||||
|
||||
##################################################
|
||||
|
||||
### Functions
|
||||
function __home_manager_generations --description "Get all generations"
|
||||
for i in (home-manager generations)
|
||||
set -l split (string split " " $i)
|
||||
set -l gen_id $split[5]
|
||||
set -l gen_datetime $split[1..2]
|
||||
set -l gen_hash (string match -r '\w{32}' $i)
|
||||
echo $gen_id\t$gen_datetime $gen_hash
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
### SubCommands
|
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "help" -d "Print home-manager help"
|
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "edit" -d "Open the home configuration in $EDITOR"
|
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "option" -d "Inspect configuration option"
|
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "build" -d "Build configuration into result directory"
|
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "instantiate" -d "Instantiate the configuration and print the resulting derivation"
|
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "switch" -d "Build and activate configuration"
|
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "generations" -d "List all home environment generations"
|
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "packages" -d "List all packages installed in home-manager-path"
|
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "news" -d "Show news entries in a pager"
|
||||
complete -c home-manager -n "__fish_use_subcommand" -f -a "uninstall" -d "Remove Home Manager"
|
||||
|
||||
complete -c home-manager -n "__fish_use_subcommand" -x -a "remove-generations" -d "Remove indicated generations"
|
||||
complete -c home-manager -n "__fish_seen_subcommand_from remove-generations" -f -ka '(__home_manager_generations)'
|
||||
|
||||
complete -c home-manager -n "__fish_use_subcommand" -x -a "expire-generations" -d "Remove generations older than TIMESTAMP"
|
||||
|
||||
### Options
|
||||
complete -c home-manager -F -s f -l "file" -d "The home configuration file"
|
||||
complete -c home-manager -x -s A -d "Select an expression in the configuration file"
|
||||
complete -c home-manager -F -s I -d "Add a path to the Nix expression search path"
|
||||
complete -c home-manager -F -l "flake" -d "Use home-manager configuration at specified flake-uri"
|
||||
complete -c home-manager -F -s b -d "Move existing files to new path rather than fail"
|
||||
complete -c home-manager -f -s v -l "verbose" -d "Verbose output"
|
||||
complete -c home-manager -f -s n -l "dry-run" -d "Do a dry run, only prints what actions would be taken"
|
||||
complete -c home-manager -f -s h -l "help" -d "Print this help"
|
||||
|
||||
complete -c home-manager -x -l "arg" -d "Override inputs passed to home-manager.nix"
|
||||
complete -c home-manager -x -l "argstr" -d "Like --arg but the value is a string"
|
||||
complete -c home-manager -x -l "cores" -d "Threads per job (e.g. -j argument to make)"
|
||||
complete -c home-manager -x -l "debug"
|
||||
complete -c home-manager -x -l "impure"
|
||||
complete -c home-manager -f -l "keep-failed" -d "Keep temporary directory used by failed builds"
|
||||
complete -c home-manager -f -l "keep-going" -d "Keep going in case of failed builds"
|
||||
complete -c home-manager -x -s j -l "max-jobs" -d "Max number of build jobs in parallel"
|
||||
complete -c home-manager -x -l "option" -d "Set Nix configuration option"
|
||||
complete -c home-manager -x -l "builders" -d "Remote builders"
|
||||
complete -c home-manager -f -l "show-trace" -d "Print stack trace of evaluation errors"
|
||||
complete -c home-manager -f -l "substitute"
|
||||
complete -c home-manager -f -l "no-substitute"
|
||||
complete -c home-manager -f -l "no-out-link"
|
||||
64
home-manager/completion.zsh
Normal file
64
home-manager/completion.zsh
Normal file
@@ -0,0 +1,64 @@
|
||||
#compdef home-manager
|
||||
|
||||
local state ret=1
|
||||
|
||||
_arguments \
|
||||
'-A[attribute]:ATTRIBUTE:()' \
|
||||
'-I[search path]:PATH:_files -/' \
|
||||
'-b[backup files]:EXT:()' \
|
||||
'--cores[cores]:NUM:()' \
|
||||
'--debug[debug]' \
|
||||
'--impure[impure]' \
|
||||
'--keep-failed[keep failed]' \
|
||||
'--keep-going[keep going]' \
|
||||
'(-h --help)'{--help,-h}'[help]' \
|
||||
'(-v --verbose)'{--verbose,-v}'[verbose]' \
|
||||
'(-n --dry-run)'{--dry-run,-n}'[dry run]' \
|
||||
'(-f --file)'{--file,-f}'[configuration file]:FILE:_files' \
|
||||
'(-j --max-jobs)'{--max-jobs,-j}'[max jobs]:NUM:()' \
|
||||
'--option[option]:NAME VALUE:()' \
|
||||
'--builders[builders]:SPEC:()' \
|
||||
'--show-trace[show trace]' \
|
||||
'1: :->cmds' \
|
||||
'*:: :->args' && ret=0
|
||||
|
||||
case "$state" in
|
||||
cmds)
|
||||
_values 'command' \
|
||||
'help[help]' \
|
||||
'edit[edit]' \
|
||||
'option[inspect option]' \
|
||||
'build[build]' \
|
||||
'switch[switch]' \
|
||||
'generations[list generations]' \
|
||||
'remove-generations[remove generations]' \
|
||||
'expire-generations[expire generations]' \
|
||||
'packages[managed packages]' \
|
||||
'news[read the news]' \
|
||||
'uninstall[uninstall]' && ret=0
|
||||
;;
|
||||
args)
|
||||
case $line[1] in
|
||||
remove-generations)
|
||||
_values 'generations' \
|
||||
$(home-manager generations | cut -d ' ' -f 5) && ret=0
|
||||
;;
|
||||
build|switch)
|
||||
_arguments \
|
||||
'--cores[cores]:NUM:()' \
|
||||
'--debug[debug]' \
|
||||
'--impure[impure]' \
|
||||
'--keep-failed[keep failed]' \
|
||||
'--keep-going[keep going]' \
|
||||
'--max-jobs[max jobs]:NUM:()' \
|
||||
'--no-out-link[no out link]' \
|
||||
'--no-substitute[no substitute]' \
|
||||
'--option[option]:NAME VALUE:()' \
|
||||
'--show-trace[show trace]' \
|
||||
'--substitute[substitute]' \
|
||||
'--builders[builders]:SPEC:()'
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
return ret
|
||||
@@ -1,40 +1,44 @@
|
||||
{ runCommand, lib, bash, coreutils, findutils, gnused, less
|
||||
{ runCommand, lib, bash, callPackage, coreutils, findutils, gnused, less
|
||||
# used for pkgs.path for nixos-option
|
||||
, pkgs
|
||||
|
||||
# Extra path to Home Manager. If set then this path will be tried
|
||||
# before `$HOME/.config/nixpkgs/home-manager` and
|
||||
# `$HOME/.nixpkgs/home-manager`.
|
||||
, path ? null
|
||||
}:
|
||||
# Extra path to Home Manager. If set then this path will be tried
|
||||
# before `$HOME/.config/nixpkgs/home-manager` and
|
||||
# `$HOME/.nixpkgs/home-manager`.
|
||||
, path ? null }:
|
||||
|
||||
let
|
||||
|
||||
pathStr = if path == null then "" else path;
|
||||
|
||||
in
|
||||
nixos-option = pkgs.nixos-option or (callPackage
|
||||
(pkgs.path + "/nixos/modules/installer/tools/nixos-option") { });
|
||||
|
||||
runCommand
|
||||
"home-manager"
|
||||
{
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
meta = with lib; {
|
||||
description = "A user environment configurator";
|
||||
maintainers = [ maintainers.rycee ];
|
||||
platforms = platforms.unix;
|
||||
license = licenses.mit;
|
||||
};
|
||||
}
|
||||
''
|
||||
install -v -D -m755 ${./home-manager} $out/bin/home-manager
|
||||
in runCommand "home-manager" {
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
meta = with lib; {
|
||||
description = "A user environment configurator";
|
||||
maintainers = [ maintainers.rycee ];
|
||||
platforms = platforms.unix;
|
||||
license = licenses.mit;
|
||||
};
|
||||
} ''
|
||||
install -v -D -m755 ${./home-manager} $out/bin/home-manager
|
||||
|
||||
substituteInPlace $out/bin/home-manager \
|
||||
--subst-var-by bash "${bash}" \
|
||||
--subst-var-by coreutils "${coreutils}" \
|
||||
--subst-var-by findutils "${findutils}" \
|
||||
--subst-var-by gnused "${gnused}" \
|
||||
--subst-var-by less "${less}" \
|
||||
--subst-var-by HOME_MANAGER_PATH '${pathStr}'
|
||||
substituteInPlace $out/bin/home-manager \
|
||||
--subst-var-by bash "${bash}" \
|
||||
--subst-var-by coreutils "${coreutils}" \
|
||||
--subst-var-by findutils "${findutils}" \
|
||||
--subst-var-by gnused "${gnused}" \
|
||||
--subst-var-by less "${less}" \
|
||||
--subst-var-by nixos-option "${nixos-option}" \
|
||||
--subst-var-by HOME_MANAGER_PATH '${pathStr}'
|
||||
|
||||
install -D -m755 ${./completion.bash} \
|
||||
$out/share/bash-completion/completions/home-manager
|
||||
''
|
||||
install -D -m755 ${./completion.bash} \
|
||||
$out/share/bash-completion/completions/home-manager
|
||||
install -D -m755 ${./completion.zsh} \
|
||||
$out/share/zsh/site-functions/_home-manager
|
||||
install -D -m755 ${./completion.fish} \
|
||||
$out/share/fish/vendor_completions.d/home-manager.fish
|
||||
''
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!@bash@/bin/bash
|
||||
|
||||
# Prepare to use tools from Nixpkgs.
|
||||
PATH=@coreutils@/bin:@findutils@/bin:@gnused@/bin:@less@/bin${PATH:+:}$PATH
|
||||
PATH=@coreutils@/bin:@findutils@/bin:@gnused@/bin:@less@/bin:@nixos-option@/bin${PATH:+:}$PATH
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
@@ -74,7 +74,75 @@ function setHomeManagerNixPath() {
|
||||
done
|
||||
}
|
||||
|
||||
function setFlakeAttribute() {
|
||||
local configFlake="${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/flake.nix"
|
||||
if [[ -z $FLAKE_ARG && ! -v HOME_MANAGER_CONFIG && -e "$configFlake" ]]; then
|
||||
FLAKE_ARG="$(dirname "$(readlink -f "$configFlake")")"
|
||||
fi
|
||||
|
||||
if [[ -n "$FLAKE_ARG" ]]; then
|
||||
local flake="${FLAKE_ARG%#*}"
|
||||
case $FLAKE_ARG in
|
||||
*#*)
|
||||
local name="${FLAKE_ARG#*#}"
|
||||
;;
|
||||
*)
|
||||
local name="$USER@$(hostname)"
|
||||
if [ "$(nix eval "$flake#homeConfigurations" --apply "x: x ? \"$name\"")" = "false" ]; then
|
||||
name="$USER"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
export FLAKE_CONFIG_URI="$flake#homeConfigurations.\"$name\""
|
||||
fi
|
||||
}
|
||||
|
||||
function doInspectOption() {
|
||||
setFlakeAttribute
|
||||
if [[ -v FLAKE_CONFIG_URI ]]; then
|
||||
errorEcho "Can't inspect options of a flake configuration"
|
||||
exit 1
|
||||
fi
|
||||
setConfigFile
|
||||
setHomeManagerNixPath
|
||||
|
||||
local extraArgs=("$@")
|
||||
|
||||
for p in "${EXTRA_NIX_PATH[@]}"; do
|
||||
extraArgs=("${extraArgs[@]}" "-I" "$p")
|
||||
done
|
||||
|
||||
if [[ -v VERBOSE ]]; then
|
||||
extraArgs=("${extraArgs[@]}" "--show-trace")
|
||||
fi
|
||||
|
||||
local HOME_MANAGER_CONFIG_NIX HOME_MANAGER_CONFIG_ATTRIBUTE_NIX
|
||||
HOME_MANAGER_CONFIG_NIX=${HOME_MANAGER_CONFIG//'\'/'\\'}
|
||||
HOME_MANAGER_CONFIG_NIX=${HOME_MANAGER_CONFIG_NIX//'"'/'\"'}
|
||||
HOME_MANAGER_CONFIG_NIX=${HOME_MANAGER_CONFIG_NIX//$'\n'/$'\\n'}
|
||||
HOME_MANAGER_CONFIG_ATTRIBUTE_NIX=${HOME_MANAGER_CONFIG_ATTRIBUTE//'\'/'\\'}
|
||||
HOME_MANAGER_CONFIG_ATTRIBUTE_NIX=${HOME_MANAGER_CONFIG_ATTRIBUTE_NIX//'"'/'\"'}
|
||||
HOME_MANAGER_CONFIG_ATTRIBUTE_NIX=${HOME_MANAGER_CONFIG_ATTRIBUTE_NIX//$'\n'/$'\\n'}
|
||||
local modulesExpr
|
||||
modulesExpr="let confPath = \"${HOME_MANAGER_CONFIG_NIX}\"; "
|
||||
modulesExpr+="confAttr = \"${HOME_MANAGER_CONFIG_ATTRIBUTE_NIX}\"; in "
|
||||
modulesExpr+="(import <home-manager/modules> {"
|
||||
modulesExpr+=" configuration = if confAttr == \"\" then confPath else (import confPath).\${confAttr};"
|
||||
modulesExpr+=" pkgs = import <nixpkgs> {}; check = true; })"
|
||||
|
||||
nixos-option \
|
||||
--options_expr "$modulesExpr.options" \
|
||||
--config_expr "$modulesExpr.config" \
|
||||
"${extraArgs[@]}" \
|
||||
"${PASSTHROUGH_OPTS[@]}"
|
||||
}
|
||||
|
||||
function doInstantiate() {
|
||||
setFlakeAttribute
|
||||
if [[ -v FLAKE_CONFIG_URI ]]; then
|
||||
errorEcho "Can't instantiate a flake configuration"
|
||||
exit 1
|
||||
fi
|
||||
setConfigFile
|
||||
setHomeManagerNixPath
|
||||
|
||||
@@ -178,14 +246,27 @@ function doBuild() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
setFlakeAttribute
|
||||
if [[ -v FLAKE_CONFIG_URI ]]; then
|
||||
local exitCode=0
|
||||
nix build \
|
||||
"${PASSTHROUGH_OPTS[@]}" \
|
||||
${DRY_RUN+--dry-run} \
|
||||
${NO_OUT_LINK+--no-out-link} \
|
||||
"$FLAKE_CONFIG_URI.activationPackage" \
|
||||
|| exitCode=1
|
||||
return $exitCode
|
||||
fi
|
||||
|
||||
setWorkDir
|
||||
|
||||
local newsInfo
|
||||
newsInfo=$(buildNews)
|
||||
|
||||
local exitCode
|
||||
|
||||
doBuildAttr --attr activationPackage \
|
||||
doBuildAttr \
|
||||
${NO_OUT_LINK+--no-out-link} \
|
||||
--attr activationPackage \
|
||||
&& exitCode=0 || exitCode=1
|
||||
|
||||
presentNews "$newsInfo"
|
||||
@@ -194,6 +275,16 @@ function doBuild() {
|
||||
}
|
||||
|
||||
function doSwitch() {
|
||||
setFlakeAttribute
|
||||
if [[ -v FLAKE_CONFIG_URI ]]; then
|
||||
local exitCode=0
|
||||
nix run \
|
||||
"${PASSTHROUGH_OPTS[@]}" \
|
||||
"$FLAKE_CONFIG_URI.activationPackage" \
|
||||
|| exitCode=1
|
||||
return $exitCode
|
||||
fi
|
||||
|
||||
setWorkDir
|
||||
|
||||
local newsInfo
|
||||
@@ -221,7 +312,7 @@ function doSwitch() {
|
||||
function doListGens() {
|
||||
# Whether to colorize the generations output.
|
||||
local color="never"
|
||||
if [[ -t 1 ]]; then
|
||||
if [[ ! -v NO_COLOR && -t 1 ]]; then
|
||||
color="always"
|
||||
fi
|
||||
|
||||
@@ -409,25 +500,31 @@ function doHelp() {
|
||||
echo
|
||||
echo "Options"
|
||||
echo
|
||||
echo " -f FILE The home configuration file."
|
||||
echo " Default is '~/.config/nixpkgs/home.nix'."
|
||||
echo " -A ATTRIBUTE Optional attribute that selects a configuration"
|
||||
echo " expression in the configuration file."
|
||||
echo " -I PATH Add a path to the Nix expression search path."
|
||||
echo " -b EXT Move existing files to new path rather than fail."
|
||||
echo " -v Verbose output"
|
||||
echo " -n Do a dry run, only prints what actions would be taken"
|
||||
echo " -h Print this help"
|
||||
echo " -f FILE The home configuration file."
|
||||
echo " Default is '~/.config/nixpkgs/home.nix'."
|
||||
echo " -A ATTRIBUTE Optional attribute that selects a configuration"
|
||||
echo " expression in the configuration file."
|
||||
echo " -I PATH Add a path to the Nix expression search path."
|
||||
echo " --flake flake-uri Use home-manager configuration at flake-uri"
|
||||
echo " -b EXT Move existing files to new path rather than fail."
|
||||
echo " -v Verbose output"
|
||||
echo " -n Do a dry run, only prints what actions would be taken"
|
||||
echo " -h Print this help"
|
||||
echo
|
||||
echo "Options passed on to nix-build(1)"
|
||||
echo
|
||||
echo " --arg(str) NAME VALUE Override inputs passed to home-manager.nix"
|
||||
echo " --cores NUM"
|
||||
echo " --debug"
|
||||
echo " --impure"
|
||||
echo " --keep-failed"
|
||||
echo " --keep-going"
|
||||
echo " --max-jobs NUM"
|
||||
echo " -j, --max-jobs NUM"
|
||||
echo " --option NAME VALUE"
|
||||
echo " --show-trace"
|
||||
echo " --(no-)substitute"
|
||||
echo " --no-out-link Do not create a symlink to the output path"
|
||||
echo " --builders VALUE"
|
||||
echo
|
||||
echo "Commands"
|
||||
echo
|
||||
@@ -435,6 +532,9 @@ function doHelp() {
|
||||
echo
|
||||
echo " edit Open the home configuration in \$EDITOR"
|
||||
echo
|
||||
echo " option OPTION.NAME"
|
||||
echo " Inspect configuration option named OPTION.NAME."
|
||||
echo
|
||||
echo " build Build configuration into result directory"
|
||||
echo
|
||||
echo " instantiate Instantiate the configuration and print the resulting derivation"
|
||||
@@ -466,12 +566,13 @@ HOME_MANAGER_CONFIG_ATTRIBUTE=""
|
||||
PASSTHROUGH_OPTS=()
|
||||
COMMAND=""
|
||||
COMMAND_ARGS=()
|
||||
FLAKE_ARG=""
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
opt="$1"
|
||||
shift
|
||||
case $opt in
|
||||
build|instantiate|edit|expire-generations|generations|help|news|packages|remove-generations|switch|uninstall)
|
||||
build|instantiate|option|edit|expire-generations|generations|help|news|packages|remove-generations|switch|uninstall)
|
||||
COMMAND="$opt"
|
||||
;;
|
||||
-A)
|
||||
@@ -490,6 +591,24 @@ while [[ $# -gt 0 ]]; do
|
||||
HOME_MANAGER_CONFIG="$1"
|
||||
shift
|
||||
;;
|
||||
--flake)
|
||||
FLAKE_ARG="$1"
|
||||
shift
|
||||
;;
|
||||
--recreate-lock-file|--no-update-lock-file|--no-write-lock-file|--no-registries|--commit-lock-file)
|
||||
PASSTHROUGH_OPTS+=("$opt")
|
||||
;;
|
||||
--update-input)
|
||||
PASSTHROUGH_OPTS+=("$opt" "$1")
|
||||
shift
|
||||
;;
|
||||
--override-input)
|
||||
PASSTHROUGH_OPTS+=("$opt" "$1" "$2")
|
||||
shift 2
|
||||
;;
|
||||
--no-out-link)
|
||||
NO_OUT_LINK=1
|
||||
;;
|
||||
-h|--help)
|
||||
doHelp
|
||||
exit 0
|
||||
@@ -497,24 +616,28 @@ while [[ $# -gt 0 ]]; do
|
||||
-n|--dry-run)
|
||||
export DRY_RUN=1
|
||||
;;
|
||||
--option)
|
||||
--option|--arg|--argstr)
|
||||
PASSTHROUGH_OPTS+=("$opt" "$1" "$2")
|
||||
shift 2
|
||||
;;
|
||||
--max-jobs|--cores)
|
||||
-j|--max-jobs|--cores|--builders)
|
||||
PASSTHROUGH_OPTS+=("$opt" "$1")
|
||||
shift
|
||||
;;
|
||||
--keep-failed|--keep-going|--show-trace\
|
||||
|--substitute|--no-substitute)
|
||||
--debug|--keep-failed|--keep-going|--show-trace\
|
||||
|--substitute|--no-substitute|--impure)
|
||||
PASSTHROUGH_OPTS+=("$opt")
|
||||
;;
|
||||
-v|--verbose)
|
||||
export VERBOSE=1
|
||||
;;
|
||||
--version)
|
||||
echo 21.11
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
case $COMMAND in
|
||||
expire-generations|remove-generations)
|
||||
expire-generations|remove-generations|option)
|
||||
COMMAND_ARGS+=("$opt")
|
||||
;;
|
||||
*)
|
||||
@@ -559,6 +682,9 @@ case $COMMAND in
|
||||
doExpireGenerations "${COMMAND_ARGS[@]}"
|
||||
fi
|
||||
;;
|
||||
option)
|
||||
doInspectOption "${COMMAND_ARGS[@]}"
|
||||
;;
|
||||
packages)
|
||||
doListPackages
|
||||
;;
|
||||
@@ -577,3 +703,5 @@ case $COMMAND in
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# vim: ft=bash
|
||||
|
||||
@@ -45,7 +45,7 @@ runCommand "home-manager-install" {
|
||||
# You can update Home Manager without changing this value. See
|
||||
# the Home Manager release notes for a list of state version
|
||||
# changes in each release.
|
||||
home.stateVersion = "21.03";
|
||||
home.stateVersion = "21.11";
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
|
||||
@@ -71,7 +71,7 @@ let
|
||||
};
|
||||
|
||||
certificatesFile = mkOption {
|
||||
type = types.path;
|
||||
type = types.nullOr types.path;
|
||||
default = config.accounts.email.certificatesFile;
|
||||
defaultText = "config.accounts.email.certificatesFile";
|
||||
description = ''
|
||||
@@ -332,7 +332,10 @@ let
|
||||
(mkIf (config.flavor == "gmail.com") {
|
||||
userName = mkDefault config.address;
|
||||
|
||||
imap = { host = "imap.gmail.com"; };
|
||||
imap = {
|
||||
host = "imap.gmail.com";
|
||||
port = 993;
|
||||
};
|
||||
|
||||
smtp = {
|
||||
host = "smtp.gmail.com";
|
||||
@@ -351,7 +354,7 @@ let
|
||||
in {
|
||||
options.accounts.email = {
|
||||
certificatesFile = mkOption {
|
||||
type = types.path;
|
||||
type = types.nullOr types.path;
|
||||
default = "/etc/ssl/certs/ca-certificates.crt";
|
||||
description = ''
|
||||
Path to default file containing certificate authorities that
|
||||
|
||||
46
modules/config/i18n.nix
Normal file
46
modules/config/i18n.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
# The glibc package in Nixpkgs is patched to make it possible to specify
|
||||
# an alternative path for the locale archive through a special environment
|
||||
# variable. This would allow different versions of glibc to coexist on the
|
||||
# same system because each version of glibc could look up different paths
|
||||
# for its locale archive should the archive format ever change in
|
||||
# incompatible ways.
|
||||
#
|
||||
# See also:
|
||||
# - localedef(1)
|
||||
# - https://nixos.org/manual/nixpkgs/stable/#locales
|
||||
# - https://github.com/NixOS/nixpkgs/issues/38991
|
||||
#
|
||||
# Note, the name of the said environment variable gets updated with each
|
||||
# breaking release of the glibcLocales package. Periodically check the link
|
||||
# below for changes:
|
||||
# https://github.com/NixOS/nixpkgs/blob/nixpkgs-unstable/pkgs/development/libraries/glibc/nix-locale-archive.patch
|
||||
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
inherit (pkgs.glibcLocales) version;
|
||||
|
||||
archivePath = "${pkgs.glibcLocales}/lib/locale/locale-archive";
|
||||
|
||||
# lookup the version of glibcLocales and set the appropriate environment vars
|
||||
localeVars = if versionAtLeast version "2.27" then {
|
||||
LOCALE_ARCHIVE_2_27 = archivePath;
|
||||
} else if versionAtLeast version "2.11" then {
|
||||
LOCALE_ARCHIVE_2_11 = archivePath;
|
||||
} else
|
||||
{ };
|
||||
|
||||
in {
|
||||
meta.maintainers = with maintainers; [ midchildan ];
|
||||
|
||||
config = mkIf pkgs.hostPlatform.isLinux {
|
||||
# For shell sessions.
|
||||
home.sessionVariables = localeVars;
|
||||
|
||||
# For desktop apps.
|
||||
systemd.user.sessionVariables = localeVars;
|
||||
};
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
{ configuration
|
||||
, pkgs
|
||||
, lib ? pkgs.stdenv.lib
|
||||
, lib ? pkgs.lib
|
||||
|
||||
# Whether to check that each option has a matching declaration.
|
||||
, check ? true
|
||||
# Extra arguments passed to specialArgs.
|
||||
, extraSpecialArgs ? { }
|
||||
}:
|
||||
|
||||
with lib;
|
||||
@@ -31,7 +33,7 @@ let
|
||||
modules = [ configuration ] ++ hmModules;
|
||||
specialArgs = {
|
||||
modulesPath = builtins.toString ./.;
|
||||
};
|
||||
} // extraSpecialArgs;
|
||||
};
|
||||
|
||||
module = showWarnings (
|
||||
|
||||
@@ -39,6 +39,28 @@ in
|
||||
};
|
||||
|
||||
config = {
|
||||
assertions = [(
|
||||
let
|
||||
dups =
|
||||
attrNames
|
||||
(filterAttrs (n: v: v > 1)
|
||||
(foldAttrs (acc: v: acc + v) 0
|
||||
(mapAttrsToList (n: v: { ${v.target} = 1; }) cfg)));
|
||||
dupsStr = concatStringsSep ", " dups;
|
||||
in {
|
||||
assertion = dups == [];
|
||||
message = ''
|
||||
Conflicting managed target files: ${dupsStr}
|
||||
|
||||
This may happen, for example, if you have a configuration similar to
|
||||
|
||||
home.file = {
|
||||
conflict1 = { source = ./foo.nix; target = "baz"; };
|
||||
conflict2 = { source = ./bar.nix; target = "baz"; };
|
||||
}'';
|
||||
})
|
||||
];
|
||||
|
||||
lib.file.mkOutOfStoreSymlink = path:
|
||||
let
|
||||
pathStr = toString path;
|
||||
@@ -53,7 +75,7 @@ in
|
||||
# Paths that should be forcibly overwritten by Home Manager.
|
||||
# Caveat emptor!
|
||||
forcedPaths =
|
||||
concatMapStringsSep " " (p: ''"$HOME/${p}"'')
|
||||
concatMapStringsSep " " (p: ''"$HOME"/${escapeShellArg p}'')
|
||||
(mapAttrsToList (n: v: v.target)
|
||||
(filterAttrs (n: v: v.force) cfg));
|
||||
|
||||
@@ -62,7 +84,7 @@ in
|
||||
|
||||
# A symbolic link whose target path matches this pattern will be
|
||||
# considered part of a Home Manager generation.
|
||||
homeFilePattern="$(readlink -e "${builtins.storeDir}")/*-home-manager-files/*"
|
||||
homeFilePattern="$(readlink -e ${escapeShellArg builtins.storeDir})/*-home-manager-files/*"
|
||||
|
||||
forcedPaths=(${forcedPaths})
|
||||
|
||||
@@ -84,7 +106,12 @@ in
|
||||
$VERBOSE_ECHO "Skipping collision check for $targetPath"
|
||||
elif [[ -e "$targetPath" \
|
||||
&& ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then
|
||||
if [[ ! -L "$targetPath" && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
|
||||
# The target file already exists and it isn't a symlink owned by Home Manager.
|
||||
if cmp -s $sourcePath $targetPath; then
|
||||
# First compare the files' content. If they're equal, we're fine.
|
||||
warnEcho "Existing file '$targetPath' is in the way of '$sourcePath', will be skipped since they are the same"
|
||||
elif [[ ! -L "$targetPath" && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
|
||||
# Next, try to move the file to a backup location if configured and possible
|
||||
backup="$targetPath.$HOME_MANAGER_BACKUP_EXT"
|
||||
if [[ -e "$backup" ]]; then
|
||||
errorEcho "Existing file '$backup' would be clobbered by backing up '$targetPath'"
|
||||
@@ -93,6 +120,7 @@ in
|
||||
warnEcho "Existing file '$targetPath' is in the way of '$sourcePath', will be moved to '$backup'"
|
||||
fi
|
||||
else
|
||||
# Fail if nothing else works
|
||||
errorEcho "Existing file '$targetPath' is in the way of '$sourcePath'"
|
||||
collision=1
|
||||
fi
|
||||
@@ -100,7 +128,7 @@ in
|
||||
done
|
||||
|
||||
if [[ -v collision ]] ; then
|
||||
errorEcho "Please move the above files and try again or use -b <ext> to move automatically."
|
||||
errorEcho "Please move the above files and try again or use 'home-manager switch -b backup' to back up existing files automatically."
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
@@ -140,27 +168,35 @@ in
|
||||
# source and target generation.
|
||||
home.activation.linkGeneration = hm.dag.entryAfter ["writeBoundary"] (
|
||||
let
|
||||
link = pkgs.writeText "link" ''
|
||||
link = pkgs.writeShellScript "link" ''
|
||||
newGenFiles="$1"
|
||||
shift
|
||||
for sourcePath in "$@" ; do
|
||||
relativePath="''${sourcePath#$newGenFiles/}"
|
||||
targetPath="$HOME/$relativePath"
|
||||
if [[ -e "$targetPath" && ! -L "$targetPath" && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
|
||||
# The target exists, back it up
|
||||
backup="$targetPath.$HOME_MANAGER_BACKUP_EXT"
|
||||
$DRY_RUN_CMD mv $VERBOSE_ARG "$targetPath" "$backup" || errorEcho "Moving '$targetPath' failed!"
|
||||
fi
|
||||
$DRY_RUN_CMD mkdir -p $VERBOSE_ARG "$(dirname "$targetPath")"
|
||||
$DRY_RUN_CMD ln -nsf $VERBOSE_ARG "$sourcePath" "$targetPath"
|
||||
|
||||
if [[ -e "$targetPath" && ! -L "$targetPath" ]] && cmp -s $sourcePath $targetPath ; then
|
||||
# The target exists but is identical – don't do anything.
|
||||
$VERBOSE_ECHO "Skipping '$targetPath' as it is identical to '$sourcePath'"
|
||||
else
|
||||
# Place that symlink, --force
|
||||
$DRY_RUN_CMD mkdir -p $VERBOSE_ARG "$(dirname "$targetPath")"
|
||||
$DRY_RUN_CMD ln -nsf $VERBOSE_ARG "$sourcePath" "$targetPath"
|
||||
fi
|
||||
done
|
||||
'';
|
||||
|
||||
cleanup = pkgs.writeText "cleanup" ''
|
||||
cleanup = pkgs.writeShellScript "cleanup" ''
|
||||
. ${./lib-bash/color-echo.sh}
|
||||
|
||||
# A symbolic link whose target path matches this pattern will be
|
||||
# considered part of a Home Manager generation.
|
||||
homeFilePattern="$(readlink -e "${builtins.storeDir}")/*-home-manager-files/*"
|
||||
homeFilePattern="$(readlink -e ${escapeShellArg builtins.storeDir})/*-home-manager-files/*"
|
||||
|
||||
newGenFiles="$1"
|
||||
shift 1
|
||||
@@ -235,31 +271,50 @@ in
|
||||
);
|
||||
|
||||
home.activation.checkFilesChanged = hm.dag.entryBefore ["linkGeneration"] (
|
||||
''
|
||||
let
|
||||
homeDirArg = escapeShellArg homeDirectory;
|
||||
in ''
|
||||
function _cmp() {
|
||||
if [[ -d $1 && -d $2 ]]; then
|
||||
diff -rq "$1" "$2" &> /dev/null
|
||||
else
|
||||
cmp --quiet "$1" "$2"
|
||||
fi
|
||||
}
|
||||
declare -A changedFiles
|
||||
'' + concatMapStrings (v: ''
|
||||
cmp --quiet "${sourceStorePath v}" "${homeDirectory}/${v.target}" \
|
||||
&& changedFiles["${v.target}"]=0 \
|
||||
|| changedFiles["${v.target}"]=1
|
||||
'') (filter (v: v.onChange != "") (attrValues cfg))
|
||||
'' + concatMapStrings (v:
|
||||
let
|
||||
sourceArg = escapeShellArg (sourceStorePath v);
|
||||
targetArg = escapeShellArg v.target;
|
||||
in ''
|
||||
_cmp ${sourceArg} ${homeDirArg}/${targetArg} \
|
||||
&& changedFiles[${targetArg}]=0 \
|
||||
|| changedFiles[${targetArg}]=1
|
||||
'') (filter (v: v.onChange != "") (attrValues cfg))
|
||||
+ ''
|
||||
unset -f _cmp
|
||||
''
|
||||
);
|
||||
|
||||
home.activation.onFilesChange = hm.dag.entryAfter ["linkGeneration"] (
|
||||
concatMapStrings (v: ''
|
||||
if [[ ${"$\{changedFiles"}["${v.target}"]} -eq 1 ]]; then
|
||||
${v.onChange}
|
||||
if (( ''${changedFiles[${escapeShellArg v.target}]} == 1 )); then
|
||||
if [[ -v DRY_RUN || -v VERBOSE ]]; then
|
||||
echo "Running onChange hook for" ${escapeShellArg v.target}
|
||||
fi
|
||||
if [[ ! -v DRY_RUN ]]; then
|
||||
${v.onChange}
|
||||
fi
|
||||
fi
|
||||
'') (filter (v: v.onChange != "") (attrValues cfg))
|
||||
);
|
||||
|
||||
# Symlink directories and files that have the right execute bit.
|
||||
# Copy files that need their execute bit changed.
|
||||
home-files = pkgs.runCommand
|
||||
home-files = pkgs.runCommandLocal
|
||||
"home-manager-files"
|
||||
{
|
||||
nativeBuildInputs = [ pkgs.xorg.lndir ];
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
}
|
||||
(''
|
||||
mkdir -p $out
|
||||
@@ -273,6 +328,15 @@ in
|
||||
local executable="$3"
|
||||
local recursive="$4"
|
||||
|
||||
# If the target already exists then we have a collision. Note, this
|
||||
# should not happen due to the assertion found in the 'files' module.
|
||||
# We therefore simply log the conflict and otherwise ignore it, mainly
|
||||
# to make the `files-target-config` test work as expected.
|
||||
if [[ -e "$realOut/$relTarget" ]]; then
|
||||
echo "File conflict for file '$relTarget'" >&2
|
||||
return
|
||||
fi
|
||||
|
||||
# Figure out the real absolute path to the target.
|
||||
local target
|
||||
target="$(realpath -m "$realOut/$relTarget")"
|
||||
|
||||
@@ -373,6 +373,16 @@ in
|
||||
description = "The package containing the complete activation script.";
|
||||
};
|
||||
|
||||
home.extraActivationPath = mkOption {
|
||||
internal = true;
|
||||
type = types.listOf types.package;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Extra packages to add to <envar>PATH</envar> within the activation
|
||||
script.
|
||||
'';
|
||||
};
|
||||
|
||||
home.extraBuilderCommands = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
@@ -390,6 +400,21 @@ in
|
||||
Extra commands to run in the Home Manager profile builder.
|
||||
'';
|
||||
};
|
||||
|
||||
home.enableNixpkgsReleaseCheck = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Determines whether to check for release version mismatch between Home
|
||||
Manager and Nixpkgs. Using mismatched versions is likely to cause errors
|
||||
and unexpected behavior. It is therefore highly recommended to use a
|
||||
release of Home Manager than corresponds with your chosen release of
|
||||
Nixpkgs.
|
||||
</para><para>
|
||||
When this option is enabled and a mismatch is detected then a warning
|
||||
will be printed when the user configuration is being built.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
@@ -404,6 +429,31 @@ in
|
||||
}
|
||||
];
|
||||
|
||||
warnings =
|
||||
let
|
||||
hmRelease = fileContents ../.release;
|
||||
nixpkgsRelease = pkgs.lib.trivial.release;
|
||||
releaseMismatch =
|
||||
config.home.enableNixpkgsReleaseCheck
|
||||
&& hmRelease != nixpkgsRelease;
|
||||
in
|
||||
optional releaseMismatch ''
|
||||
You are using
|
||||
|
||||
Home Manager version ${hmRelease} and
|
||||
Nixpkgs version ${nixpkgsRelease}.
|
||||
|
||||
Using mismatched versions is likely to cause errors and unexpected
|
||||
behavior. It is therefore highly recommended to use a release of Home
|
||||
Manager than corresponds with your chosen release of Nixpkgs.
|
||||
|
||||
If you insist then you can disable this warning by adding
|
||||
|
||||
home.enableNixpkgsReleaseCheck = false;
|
||||
|
||||
to your configuration.
|
||||
'';
|
||||
|
||||
home.username =
|
||||
mkIf (versionOlder config.home.stateVersion "20.09")
|
||||
(mkDefault (builtins.getEnv "USER"));
|
||||
@@ -493,7 +543,24 @@ in
|
||||
''
|
||||
else
|
||||
''
|
||||
$DRY_RUN_CMD nix-env -i ${cfg.path}
|
||||
if ! $DRY_RUN_CMD nix-env -i ${cfg.path} ; then
|
||||
cat <<EOF
|
||||
|
||||
Oops, nix-env failed to install your new Home Manager profile!
|
||||
|
||||
Perhaps there is a conflict with a package that was installed using
|
||||
'nix-env -i'? Try running
|
||||
|
||||
nix-env -q
|
||||
|
||||
and if there is a conflicting package you can remove it with
|
||||
|
||||
nix-env -e {package name}
|
||||
|
||||
Then try activating your Home Manager configuration again.
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
''
|
||||
);
|
||||
|
||||
@@ -513,20 +580,20 @@ in
|
||||
|
||||
# Programs that always should be available on the activation
|
||||
# script's PATH.
|
||||
activationBinPaths = lib.makeBinPath [
|
||||
pkgs.bash
|
||||
pkgs.coreutils
|
||||
pkgs.diffutils # For `cmp` and `diff`.
|
||||
pkgs.findutils
|
||||
pkgs.gnugrep
|
||||
pkgs.gnused
|
||||
pkgs.ncurses # For `tput`.
|
||||
]
|
||||
activationBinPaths = lib.makeBinPath (
|
||||
[
|
||||
pkgs.bash
|
||||
pkgs.coreutils
|
||||
pkgs.diffutils # For `cmp` and `diff`.
|
||||
pkgs.findutils
|
||||
pkgs.gnugrep
|
||||
pkgs.gnused
|
||||
pkgs.ncurses # For `tput`.
|
||||
] ++ config.home.extraActivationPath
|
||||
)
|
||||
+ optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";
|
||||
|
||||
activationScript = pkgs.writeScript "activation-script" ''
|
||||
#!${pkgs.runtimeShell}
|
||||
|
||||
activationScript = pkgs.writeShellScript "activation-script" ''
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
@@ -552,6 +619,9 @@ in
|
||||
|
||||
cp ${activationScript} $out/activate
|
||||
|
||||
mkdir $out/bin
|
||||
ln -s $out/activate $out/bin/home-manager-generation
|
||||
|
||||
substituteInPlace $out/activate \
|
||||
--subst-var-by GENERATION_DIR $out
|
||||
|
||||
|
||||
106
modules/i18n/input-method/default.nix
Normal file
106
modules/i18n/input-method/default.nix
Normal file
@@ -0,0 +1,106 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
|
||||
cfg = config.i18n.inputMethod;
|
||||
|
||||
gtk2Cache = pkgs.runCommandLocal "gtk2-immodule.cache" {
|
||||
buildInputs = [ pkgs.gtk2 cfg.package ];
|
||||
} ''
|
||||
mkdir -p $out/etc/gtk-2.0/
|
||||
GTK_PATH=${cfg.package}/lib/gtk-2.0/ \
|
||||
gtk-query-immodules-2.0 > $out/etc/gtk-2.0/immodules.cache
|
||||
'';
|
||||
|
||||
gtk3Cache = pkgs.runCommandLocal "gtk3-immodule.cache" {
|
||||
buildInputs = [ pkgs.gtk3 cfg.package ];
|
||||
} ''
|
||||
mkdir -p $out/etc/gtk-3.0/
|
||||
GTK_PATH=${cfg.package}/lib/gtk-3.0/ \
|
||||
gtk-query-immodules-3.0 > $out/etc/gtk-3.0/immodules.cache
|
||||
'';
|
||||
|
||||
in {
|
||||
imports =
|
||||
[ ./fcitx.nix ./fcitx5.nix ./hime.nix ./kime.nix ./nabi.nix ./uim.nix ];
|
||||
|
||||
options.i18n = {
|
||||
inputMethod = {
|
||||
enabled = mkOption {
|
||||
type = types.nullOr
|
||||
(types.enum [ "fcitx" "fcitx5" "nabi" "uim" "hime" "kime" ]);
|
||||
default = null;
|
||||
example = "fcitx";
|
||||
description = ''
|
||||
Select the enabled input method. Input methods is a software to input
|
||||
symbols that are not available on standard input devices.
|
||||
</para><para>
|
||||
Input methods are specially used to input Chinese, Japanese and Korean
|
||||
characters.
|
||||
</para><para>
|
||||
Currently the following input methods are available in Home Manager:
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><literal>fcitx</literal></term>
|
||||
<listitem><para>
|
||||
A customizable lightweight input method
|
||||
extra input engines can be added using
|
||||
<literal>i18n.inputMethod.fcitx.engines</literal>.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>fcitx5</literal></term>
|
||||
<listitem><para>
|
||||
The next generation of fcitx,
|
||||
addons (including engines, dictionaries, skins) can be added using
|
||||
<literal>i18n.inputMethod.fcitx5.addons</literal>.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>nabi</literal></term>
|
||||
<listitem><para>
|
||||
A Korean input method based on XIM. Nabi doesn't support Qt 5.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>uim</literal></term>
|
||||
<listitem><para>
|
||||
The universal input method, is a library with a XIM bridge.
|
||||
uim mainly support Chinese, Japanese and Korean.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>hime</literal></term>
|
||||
<listitem><para>An extremely easy-to-use input method framework.</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>kime</literal></term>
|
||||
<listitem><para>A Korean IME.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
internal = true;
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
description = ''
|
||||
The input method method package.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enabled != null) {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "i18n.inputMethod" pkgs platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package gtk2Cache gtk3Cache ];
|
||||
};
|
||||
|
||||
meta.maintainers = with lib; [ hm.maintainers.kranzes ];
|
||||
}
|
||||
50
modules/i18n/input-method/fcitx.nix
Normal file
50
modules/i18n/input-method/fcitx.nix
Normal file
@@ -0,0 +1,50 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.i18n.inputMethod.fcitx;
|
||||
fcitxPackage = pkgs.fcitx.override { plugins = cfg.engines; };
|
||||
fcitxEngine = types.package // {
|
||||
name = "fcitx-engine";
|
||||
check = x:
|
||||
types.package.check x && attrByPath [ "meta" "isFcitxEngine" ] false x;
|
||||
};
|
||||
in {
|
||||
options = {
|
||||
|
||||
i18n.inputMethod.fcitx = {
|
||||
engines = mkOption {
|
||||
type = with types; listOf fcitxEngine;
|
||||
default = [ ];
|
||||
example = literalExample "with pkgs.fcitx-engines; [ mozc hangul ]";
|
||||
description = let
|
||||
enginesDrv = filterAttrs (const isDerivation) pkgs.fcitx-engines;
|
||||
engines = concatStringsSep ", "
|
||||
(map (name: "<literal>${name}</literal>") (attrNames enginesDrv));
|
||||
in "Enabled Fcitx engines. Available engines are: ${engines}.";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf (config.i18n.inputMethod.enabled == "fcitx") {
|
||||
i18n.inputMethod.package = fcitxPackage;
|
||||
|
||||
home.sessionVariables = {
|
||||
GTK_IM_MODULE = "fcitx";
|
||||
QT_IM_MODULE = "fcitx";
|
||||
XMODIFIERS = "@im=fcitx";
|
||||
};
|
||||
|
||||
systemd.user.services.fcitx-daemon = {
|
||||
Unit = {
|
||||
Description = "Fcitx input method editor";
|
||||
PartOf = [ "graphical-session.desktop" ];
|
||||
};
|
||||
Service.ExecStart = "${fcitxPackage}/bin/fcitx";
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
42
modules/i18n/input-method/fcitx5.nix
Normal file
42
modules/i18n/input-method/fcitx5.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
im = config.i18n.inputMethod;
|
||||
cfg = im.fcitx5;
|
||||
fcitx5Package = pkgs.fcitx5-with-addons.override { inherit (cfg) addons; };
|
||||
in {
|
||||
options = {
|
||||
i18n.inputMethod.fcitx5 = {
|
||||
addons = mkOption {
|
||||
type = with types; listOf package;
|
||||
default = [ ];
|
||||
example = literalExample "with pkgs; [ fcitx5-rime ]";
|
||||
description = ''
|
||||
Enabled Fcitx5 addons.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (im.enabled == "fcitx5") {
|
||||
i18n.inputMethod.package = fcitx5Package;
|
||||
|
||||
home.sessionVariables = {
|
||||
GTK_IM_MODULE = "fcitx";
|
||||
QT_IM_MODULE = "fcitx";
|
||||
XMODIFIERS = "@im=fcitx";
|
||||
};
|
||||
|
||||
systemd.user.services.fcitx5-daemon = {
|
||||
Unit = {
|
||||
Description = "Fcitx5 input method editor";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
Service.ExecStart = "${fcitx5Package}/bin/fcitx5";
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
23
modules/i18n/input-method/hime.nix
Normal file
23
modules/i18n/input-method/hime.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib; {
|
||||
config = mkIf (config.i18n.inputMethod.enabled == "hime") {
|
||||
i18n.inputMethod.package = pkgs.hime;
|
||||
|
||||
home.sessionVariables = {
|
||||
GTK_IM_MODULE = "hime";
|
||||
QT_IM_MODULE = "hime";
|
||||
XMODIFIERS = "@im=hime";
|
||||
};
|
||||
|
||||
systemd.user.services.hime-daemon = {
|
||||
Unit = {
|
||||
Description = "Hime input method editor";
|
||||
PartOf = [ "graphical-session.desktop" ];
|
||||
};
|
||||
Service.ExecStart = "${pkgs.hime}/bin/hime";
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
58
modules/i18n/input-method/kime.nix
Normal file
58
modules/i18n/input-method/kime.nix
Normal file
@@ -0,0 +1,58 @@
|
||||
{ config, pkgs, lib, generators, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.i18n.inputMethod.kime;
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
in {
|
||||
options = {
|
||||
i18n.inputMethod.kime = {
|
||||
config = mkOption {
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
example = literalExample ''
|
||||
{
|
||||
daemon = {
|
||||
modules = ["Xim" "Indicator"];
|
||||
};
|
||||
|
||||
indicator = {
|
||||
icon_color = "White";
|
||||
};
|
||||
|
||||
engine = {
|
||||
hangul = {
|
||||
layout = "dubeolsik";
|
||||
};
|
||||
};
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
kime configuration. Refer to
|
||||
<link xlink:href="https://github.com/Riey/kime/blob/develop/docs/CONFIGURATION.md"/>
|
||||
for details on supported values.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (config.i18n.inputMethod.enabled == "kime") {
|
||||
i18n.inputMethod.package = pkgs.kime;
|
||||
|
||||
home.sessionVariables = {
|
||||
GTK_IM_MODULE = "kime";
|
||||
QT_IM_MODULE = "kime";
|
||||
XMODIFIERS = "@im=kime";
|
||||
};
|
||||
|
||||
xdg.configFile."kime/config.yaml".text =
|
||||
replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.config);
|
||||
|
||||
systemd.user.services.kime-daemon = {
|
||||
Unit = { Description = "Kime input method editor"; };
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
Service.ExecStart = "${pkgs.kime}/bin/kime";
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
23
modules/i18n/input-method/nabi.nix
Normal file
23
modules/i18n/input-method/nabi.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib; {
|
||||
config = mkIf (config.i18n.inputMethod.enabled == "nabi") {
|
||||
i18n.inputMethod.package = pkgs.nabi;
|
||||
|
||||
home.sessionVariables = {
|
||||
GTK_IM_MODULE = "nabi";
|
||||
QT_IM_MODULE = "nabi";
|
||||
XMODIFIERS = "@im=nabi";
|
||||
};
|
||||
|
||||
systemd.user.services.nabi-daemon = {
|
||||
Unit = {
|
||||
Description = "Nabi input method editor";
|
||||
PartOf = [ "graphical-session.desktop" ];
|
||||
};
|
||||
Service.ExecStart = "${pkgs.nabi}/bin/nabi";
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
45
modules/i18n/input-method/uim.nix
Normal file
45
modules/i18n/input-method/uim.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.i18n.inputMethod.uim;
|
||||
in {
|
||||
options = {
|
||||
|
||||
i18n.inputMethod.uim = {
|
||||
toolbar = mkOption {
|
||||
type = types.enum [ "gtk" "gtk3" "gtk-systray" "gtk3-systray" "qt4" ];
|
||||
default = "gtk";
|
||||
example = "gtk-systray";
|
||||
description = ''
|
||||
Selected UIM toolbar.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf (config.i18n.inputMethod.enabled == "uim") {
|
||||
i18n.inputMethod.package = pkgs.uim;
|
||||
|
||||
home.sessionVariables = {
|
||||
GTK_IM_MODULE = "uim";
|
||||
QT_IM_MODULE = "uim";
|
||||
XMODIFIERS = "@im=uim";
|
||||
};
|
||||
|
||||
systemd.user.services.uim-daemon = {
|
||||
Unit = {
|
||||
Description = "Uim input method editor";
|
||||
PartOf = [ "graphical-session.desktop" ];
|
||||
};
|
||||
Service.ExecStart = toString
|
||||
(pkgs.writeShellScript "start-uim-xim-and-uim-toolbar" ''
|
||||
${pkgs.uim}/bin/uim-xim &
|
||||
${pkgs.uim}/bin/uim-toolbar-${cfg.toolbar}
|
||||
'');
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
@@ -5,9 +5,9 @@ function setupVars() {
|
||||
local profilesPath="$nixStateDir/profiles/per-user/$USER"
|
||||
local gcPath="$nixStateDir/gcroots/per-user/$USER"
|
||||
|
||||
genProfilePath="$profilesPath/home-manager"
|
||||
newGenPath="@GENERATION_DIR@";
|
||||
newGenGcPath="$gcPath/current-home"
|
||||
declare -gr genProfilePath="$profilesPath/home-manager"
|
||||
declare -gr newGenPath="@GENERATION_DIR@";
|
||||
declare -gr newGenGcPath="$gcPath/current-home"
|
||||
|
||||
local greatestGenNum
|
||||
greatestGenNum=$( \
|
||||
@@ -16,14 +16,15 @@ function setupVars() {
|
||||
| sed -E 's/ *([[:digit:]]+) .*/\1/')
|
||||
|
||||
if [[ -n $greatestGenNum ]] ; then
|
||||
oldGenNum=$greatestGenNum
|
||||
newGenNum=$((oldGenNum + 1))
|
||||
declare -gr oldGenNum=$greatestGenNum
|
||||
declare -gr newGenNum=$((oldGenNum + 1))
|
||||
else
|
||||
newGenNum=1
|
||||
declare -gr newGenNum=1
|
||||
fi
|
||||
|
||||
if [[ -e $profilesPath/home-manager ]] ; then
|
||||
oldGenPath="$(readlink -e "$profilesPath/home-manager")"
|
||||
declare -gr oldGenPath
|
||||
fi
|
||||
|
||||
$VERBOSE_ECHO "Sanity checking oldGenNum and oldGenPath"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# The check for terminal output and color support is heavily inspired
|
||||
# by https://unix.stackexchange.com/a/10065.
|
||||
#
|
||||
# Allow opt out by respecting the `NO_COLOR` environment variable.
|
||||
|
||||
function setupColors() {
|
||||
normalColor=""
|
||||
@@ -7,8 +9,8 @@ function setupColors() {
|
||||
warnColor=""
|
||||
noteColor=""
|
||||
|
||||
# Check if stdout is a terminal.
|
||||
if [[ -t 1 ]]; then
|
||||
# Enable colors for terminals, and allow opting out.
|
||||
if [[ ! -v NO_COLOR && -t 1 ]]; then
|
||||
# See if it supports colors.
|
||||
local ncolors
|
||||
ncolors=$(tput colors)
|
||||
|
||||
14
modules/lib/assertions.nix
Normal file
14
modules/lib/assertions.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ lib }:
|
||||
|
||||
{
|
||||
assertPlatform = module: pkgs: platforms: {
|
||||
assertion = lib.elem pkgs.stdenv.hostPlatform.system platforms;
|
||||
message = let
|
||||
platformsStr = lib.concatStringsSep "\n"
|
||||
(map (p: " - ${p}") (lib.sort (a: b: a < b) platforms));
|
||||
in ''
|
||||
The module ${module} does not support your platform. It only supports
|
||||
|
||||
${platformsStr}'';
|
||||
};
|
||||
}
|
||||
@@ -16,6 +16,8 @@ rec {
|
||||
entryBefore = d.dagEntryBefore;
|
||||
};
|
||||
|
||||
assertions = import ./assertions.nix { inherit lib; };
|
||||
|
||||
gvariant = import ./gvariant.nix { inherit lib; };
|
||||
maintainers = import ./maintainers.nix;
|
||||
strings = import ./strings.nix { inherit lib; };
|
||||
|
||||
@@ -82,6 +82,9 @@ with lib;
|
||||
generations. The script will be run
|
||||
<emphasis>after</emphasis> the new files have been linked
|
||||
into place.
|
||||
</para><para>
|
||||
Note, this code is always run when <literal>recursive</literal> is
|
||||
enabled.
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
@@ -71,6 +71,8 @@ in rec {
|
||||
|
||||
inherit type typeOf;
|
||||
|
||||
isGVariant = v: v._type or "" == "gvariant";
|
||||
|
||||
isArray = hasPrefix "a";
|
||||
isMaybe = hasPrefix "m";
|
||||
isTuple = hasPrefix "(";
|
||||
@@ -122,8 +124,9 @@ in rec {
|
||||
};
|
||||
|
||||
mkString = v:
|
||||
mkPrimitive type.string v // {
|
||||
__toString = self: "'${escape [ "'" "\\" ] self.value}'";
|
||||
let sanitize = s: replaceStrings [ "\n" ] [ "\\n" ] (escape [ "'" "\\" ] s);
|
||||
in mkPrimitive type.string v // {
|
||||
__toString = self: "'${sanitize self.value}'";
|
||||
};
|
||||
|
||||
mkObjectpath = v:
|
||||
|
||||
@@ -25,10 +25,106 @@
|
||||
github = "cwyc";
|
||||
githubId = 16950437;
|
||||
};
|
||||
chisui = {
|
||||
name = "Philipp Dargel";
|
||||
email = "chisui@users.noreply.github.com";
|
||||
github = "chisui";
|
||||
githubId = 4526429;
|
||||
};
|
||||
olmokramer = {
|
||||
name = "Olmo Kramer";
|
||||
email = "olmokramer@users.noreply.github.com";
|
||||
github = "olmokramer";
|
||||
githubId = 3612514;
|
||||
};
|
||||
kalhauge = {
|
||||
name = "Christian Gram Kalhauge";
|
||||
email = "kalhauge@users.noreply.github.com";
|
||||
github = "kalhauge";
|
||||
githubId = 1182166;
|
||||
};
|
||||
kamadorueda = {
|
||||
name = "Kevin Amado";
|
||||
email = "kamadorueda@gmail.com";
|
||||
github = "kamadorueda";
|
||||
githubId = 47480384;
|
||||
keys = [{
|
||||
longkeyid = "rsa4096/0x04D0CEAF916A9A40";
|
||||
fingerprint = "2BE3 BAFD 793E A349 ED1F F00F 04D0 CEAF 916A 9A40";
|
||||
}];
|
||||
};
|
||||
kubukoz = {
|
||||
name = "Jakub Kozłowski";
|
||||
email = "kubukoz@users.noreply.github.com";
|
||||
github = "kubukoz";
|
||||
githubId = 894884;
|
||||
};
|
||||
matrss = {
|
||||
name = "Matthias Riße";
|
||||
email = "matrss@users.noreply.github.com";
|
||||
github = "matrss";
|
||||
githubId = 9308656;
|
||||
};
|
||||
seylerius = {
|
||||
email = "sable@seyleri.us";
|
||||
name = "Sable Seyler";
|
||||
github = "seylerius";
|
||||
githubId = 1145981;
|
||||
keys = [{
|
||||
logkeyid = "rsa4096/0x68BF2EAE6D91CAFF";
|
||||
fingerprint = "F0E0 0311 126A CD72 4392 25E6 68BF 2EAE 6D91 CAFF";
|
||||
}];
|
||||
};
|
||||
thiagokokada = {
|
||||
email = "thiagokokada@gmail.com";
|
||||
name = "Thiago Kenji Okada";
|
||||
github = "thiagokokada";
|
||||
githubId = 844343;
|
||||
};
|
||||
fendse = {
|
||||
email = "46252070+Fendse@users.noreply.github.com";
|
||||
github = "Fendse";
|
||||
githubId = 46252070;
|
||||
name = "Sara Johnsson";
|
||||
};
|
||||
msfjarvis = {
|
||||
email = "me@msfjarvis.dev";
|
||||
github = "msfjarvis";
|
||||
githubId = "13348378";
|
||||
name = "Harsh Shandilya";
|
||||
keys = [{
|
||||
longkeyid = "rsa4096/0xB7843F823355E9B9";
|
||||
fingerprint = "8F87 050B 0F9C B841 1515 7399 B784 3F82 3355 E9B9";
|
||||
}];
|
||||
};
|
||||
ambroisie = {
|
||||
email = "bruno.home-manager@belanyi.fr";
|
||||
github = "ambroisie";
|
||||
githubId = 12465195;
|
||||
name = "Bruno BELANYI";
|
||||
};
|
||||
malvo = {
|
||||
email = "malte@malvo.org";
|
||||
github = "malte-v";
|
||||
githubId = 34393802;
|
||||
name = "Malte Voos";
|
||||
};
|
||||
kranzes = {
|
||||
email = "personal@ilanjoselevich.com";
|
||||
github = "Kranzes";
|
||||
githubId = 56614642;
|
||||
name = "Ilan Joselevich";
|
||||
};
|
||||
mager = {
|
||||
email = "andreas@mager.eu";
|
||||
github = "AndreasMager";
|
||||
githubId = 5646732;
|
||||
name = "Andreas Mager";
|
||||
};
|
||||
bjpbakker = {
|
||||
email = "bart@thesoftwarecraft.com";
|
||||
github = "bjpbakker";
|
||||
githubId = 605641;
|
||||
name = "Bart Bakker";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -47,9 +47,18 @@ in rec {
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
example = "DejaVu Sans 8";
|
||||
example = "DejaVu Sans";
|
||||
description = ''
|
||||
The family name and size of the font within the package.
|
||||
The family name of the font within the package.
|
||||
'';
|
||||
};
|
||||
|
||||
size = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
default = null;
|
||||
example = "8";
|
||||
description = ''
|
||||
The size of the font.
|
||||
'';
|
||||
};
|
||||
};
|
||||
@@ -61,7 +70,11 @@ in rec {
|
||||
check = v: gvar.mkValue v != null;
|
||||
merge = loc: defs:
|
||||
let
|
||||
vdefs = map (d: d // { value = gvar.mkValue d.value; }) defs;
|
||||
vdefs = map (d:
|
||||
d // {
|
||||
value =
|
||||
if gvar.isGVariant d.value then d.value else gvar.mkValue d.value;
|
||||
}) defs;
|
||||
vals = map (d: d.value) vdefs;
|
||||
defTypes = map (x: x.type) vals;
|
||||
sameOrNull = x: y: if x == y then y else null;
|
||||
@@ -73,8 +86,10 @@ in rec {
|
||||
+ " mismatched GVariant types given in"
|
||||
+ " ${showFiles (getFiles defs)}.")
|
||||
else if gvar.isArray sharedDefType && allChecked then
|
||||
(types.listOf gvariant).merge loc
|
||||
(map (d: d // { value = d.value.value; }) vdefs)
|
||||
gvar.mkValue ((types.listOf gvariant).merge loc
|
||||
(map (d: d // { value = d.value.value; }) vdefs)) // {
|
||||
type = sharedDefType;
|
||||
}
|
||||
else if gvar.isTuple sharedDefType && allChecked then
|
||||
mergeOneOption loc defs
|
||||
else if gvar.isMaybe sharedDefType && allChecked then
|
||||
|
||||
@@ -6,7 +6,7 @@ let
|
||||
|
||||
cfg = config.manual;
|
||||
|
||||
docs = import ../doc { inherit lib pkgs; };
|
||||
docs = import ../docs { inherit lib pkgs; };
|
||||
|
||||
in
|
||||
|
||||
|
||||
@@ -8,12 +8,9 @@ let
|
||||
|
||||
toDconfIni = generators.toINI { mkKeyValue = mkIniKeyValue; };
|
||||
|
||||
mkIniKeyValue = key: value:
|
||||
"${key}=${toString (hm.gvariant.mkValue value)}";
|
||||
mkIniKeyValue = key: value: "${key}=${toString (hm.gvariant.mkValue value)}";
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
in {
|
||||
meta.maintainers = [ maintainers.gnidorah maintainers.rycee ];
|
||||
|
||||
options = {
|
||||
@@ -29,7 +26,7 @@ in
|
||||
|
||||
settings = mkOption {
|
||||
type = with types; attrsOf (attrsOf hm.types.gvariant);
|
||||
default = {};
|
||||
default = { };
|
||||
example = literalExample ''
|
||||
{
|
||||
"org/gnome/calculator" = {
|
||||
@@ -48,26 +45,26 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable && cfg.settings != {}) {
|
||||
home.activation.dconfSettings = hm.dag.entryAfter ["installPackages"] (
|
||||
let
|
||||
iniFile = pkgs.writeText "hm-dconf.ini" (toDconfIni cfg.settings);
|
||||
in
|
||||
''
|
||||
if [[ -v DBUS_SESSION_BUS_ADDRESS ]]; then
|
||||
DCONF_DBUS_RUN_SESSION=""
|
||||
else
|
||||
DCONF_DBUS_RUN_SESSION="${pkgs.dbus}/bin/dbus-run-session"
|
||||
fi
|
||||
config = mkIf (cfg.enable && cfg.settings != { }) {
|
||||
# Make sure the dconf directory exists.
|
||||
xdg.configFile."dconf/.keep".source = builtins.toFile "keep" "";
|
||||
|
||||
if [[ -v DRY_RUN ]]; then
|
||||
echo $DCONF_DBUS_RUN_SESSION ${pkgs.dconf}/bin/dconf load / "<" ${iniFile}
|
||||
else
|
||||
$DCONF_DBUS_RUN_SESSION ${pkgs.dconf}/bin/dconf load / < ${iniFile}
|
||||
fi
|
||||
home.activation.dconfSettings = hm.dag.entryAfter [ "installPackages" ]
|
||||
(let iniFile = pkgs.writeText "hm-dconf.ini" (toDconfIni cfg.settings);
|
||||
in ''
|
||||
if [[ -v DBUS_SESSION_BUS_ADDRESS ]]; then
|
||||
DCONF_DBUS_RUN_SESSION=""
|
||||
else
|
||||
DCONF_DBUS_RUN_SESSION="${pkgs.dbus}/bin/dbus-run-session"
|
||||
fi
|
||||
|
||||
unset DCONF_DBUS_RUN_SESSION
|
||||
''
|
||||
);
|
||||
if [[ -v DRY_RUN ]]; then
|
||||
echo $DCONF_DBUS_RUN_SESSION ${pkgs.dconf}/bin/dconf load / "<" ${iniFile}
|
||||
else
|
||||
$DCONF_DBUS_RUN_SESSION ${pkgs.dconf}/bin/dconf load / < ${iniFile}
|
||||
fi
|
||||
|
||||
unset DCONF_DBUS_RUN_SESSION
|
||||
'');
|
||||
};
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ let
|
||||
package = mkOption {
|
||||
type = types.nullOr types.package;
|
||||
default = null;
|
||||
example = literalExample "pkgs.gnome3.gnome_themes_standard";
|
||||
example = literalExample "pkgs.gnome.gnome_themes_standard";
|
||||
description = ''
|
||||
Package providing the theme. This package will be installed
|
||||
to your profile. If <literal>null</literal> then the theme
|
||||
@@ -92,6 +92,18 @@ in {
|
||||
<filename>~/.gtkrc-2.0</filename>.
|
||||
'';
|
||||
};
|
||||
|
||||
configLocation = mkOption {
|
||||
type = types.path;
|
||||
default = "${config.home.homeDirectory}/.gtkrc-2.0";
|
||||
defaultText =
|
||||
literalExample ''"''${config.home.homeDirectory}/.gtkrc-2.0"'';
|
||||
example =
|
||||
literalExample ''"''${config.xdg.configHome}/gtk-2.0/gtkrc"'';
|
||||
description = ''
|
||||
The location to put the GTK configuration file.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
gtk3 = {
|
||||
@@ -128,14 +140,22 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (let
|
||||
ini = optionalAttrs (cfg.font != null) { gtk-font-name = cfg.font.name; }
|
||||
// optionalAttrs (cfg.theme != null) { gtk-theme-name = cfg.theme.name; }
|
||||
ini = optionalAttrs (cfg.font != null) {
|
||||
gtk-font-name = let
|
||||
fontSize =
|
||||
optionalString (cfg.font.size != null) " ${toString cfg.font.size}";
|
||||
in "${cfg.font.name}" + fontSize;
|
||||
} // optionalAttrs (cfg.theme != null) { gtk-theme-name = cfg.theme.name; }
|
||||
// optionalAttrs (cfg.iconTheme != null) {
|
||||
gtk-icon-theme-name = cfg.iconTheme.name;
|
||||
};
|
||||
|
||||
dconfIni = optionalAttrs (cfg.font != null) { font-name = cfg.font.name; }
|
||||
// optionalAttrs (cfg.theme != null) { gtk-theme = cfg.theme.name; }
|
||||
dconfIni = optionalAttrs (cfg.font != null) {
|
||||
font-name = let
|
||||
fontSize =
|
||||
optionalString (cfg.font.size != null) " ${toString cfg.font.size}";
|
||||
in "${cfg.font.name}" + fontSize;
|
||||
} // optionalAttrs (cfg.theme != null) { gtk-theme = cfg.theme.name; }
|
||||
// optionalAttrs (cfg.iconTheme != null) {
|
||||
icon-theme = cfg.iconTheme.name;
|
||||
};
|
||||
@@ -146,10 +166,12 @@ in {
|
||||
home.packages = optionalPackage cfg.font ++ optionalPackage cfg.theme
|
||||
++ optionalPackage cfg.iconTheme;
|
||||
|
||||
home.file.".gtkrc-2.0".text =
|
||||
home.file.${cfg2.configLocation}.text =
|
||||
concatStringsSep "\n" (mapAttrsToList formatGtk2Option ini) + "\n"
|
||||
+ cfg2.extraConfig;
|
||||
|
||||
home.sessionVariables.GTK2_RC_FILES = cfg2.configLocation;
|
||||
|
||||
xdg.configFile."gtk-3.0/settings.ini".text =
|
||||
toGtk3Ini { Settings = ini // cfg3.extraConfig; };
|
||||
|
||||
|
||||
@@ -116,6 +116,9 @@ in
|
||||
#
|
||||
# date --iso-8601=second --universal
|
||||
#
|
||||
# On darwin (or BSD like systems) use
|
||||
#
|
||||
# date -u +'%Y-%m-%dT%H:%M:%S+00:00'
|
||||
news.entries = [
|
||||
{
|
||||
time = "2017-09-01T10:56:28+00:00";
|
||||
@@ -1728,6 +1731,478 @@ in
|
||||
A new module is available: 'services.caffeine'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-11-05T22:59:21+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'programs.i3status-rust'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-11-14T13:02:40+00:00";
|
||||
condition = config.programs.broot.enable;
|
||||
message = ''
|
||||
The 'programs.broot.verbs' option is now a list rather than an
|
||||
attribute set. To migrate, move the keys of the attrset into the
|
||||
list items' 'invocation' keys. For example,
|
||||
|
||||
programs.broot.verbs = {
|
||||
"p" = { execution = ":parent"; };
|
||||
};
|
||||
|
||||
becomes
|
||||
|
||||
programs.broot.verbs = [
|
||||
{
|
||||
invocation = "p";
|
||||
execution = ":parent";
|
||||
}
|
||||
];
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-12-01T20:46:14+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.wlsunset'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-12-09T22:34:33+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.pbgopy'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-12-18T22:22:25+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.rofi.pass'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-12-31T14:16:47+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.octant'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-01-01T08:51:11+00:00";
|
||||
condition = config.pam.sessionVariables != {};
|
||||
message = ''
|
||||
The option 'pam.sessionVariables' will be deprecated in the future.
|
||||
This is due to PAM 1.5.0 deprecating reading of the user environment.
|
||||
The deprecation will not take place immediately but you may wish to
|
||||
consider alternatives to PAM environment variables.
|
||||
|
||||
See
|
||||
|
||||
https://github.com/nix-community/home-manager/issues/1691
|
||||
|
||||
for discussion.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-01-02T07:49:15+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.plan9port'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-01-31T11:23:30+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.playerctld'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-01-28T15:07:34+00:00";
|
||||
condition = hostPlatform.isDarwin;
|
||||
message = ''
|
||||
New options are available for 'targets.darwin':
|
||||
|
||||
- targets.darwin.defaults
|
||||
|
||||
This adds options for configuring macOS through the defaults(1)
|
||||
system.
|
||||
|
||||
- targets.darwin.keybindings
|
||||
|
||||
This adds options for configuring the default keybindings for macOS
|
||||
text fields.
|
||||
|
||||
- targets.darwin.search
|
||||
|
||||
This adds options for configuring the default search engine for
|
||||
macOS.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-02-04T22:28:26+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.sbt'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-02-20T00:00:00+00:00";
|
||||
condition = config.services.polybar.enable;
|
||||
message = ''
|
||||
The polybar configuration can now be written in a more nix-friendly format.
|
||||
The new 'services.polybar.settings' option is an alternative to
|
||||
'services.polybar.config' that supports nested keys and converts nix
|
||||
lists to polybar-style 'foo-0, foo-1, ...' lists.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-02-25T22:36:43+00:00";
|
||||
condition = config.programs.git.enable && any (msmtp: msmtp.enable)
|
||||
(mapAttrsToList (name: account: account.msmtp)
|
||||
config.accounts.email.accounts);
|
||||
message = ''
|
||||
Git will now defer to msmtp for sending emails if
|
||||
'accounts.email.accounts.<name>.msmtp.enable' is true.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-03-03T22:16:05+00:00";
|
||||
message = ''
|
||||
Home Manager now respects the 'NO_COLOR' environment variable as per
|
||||
https://no-color.org/.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-03-29T21:05:50+00:00";
|
||||
message = ''
|
||||
Configuration specified by 'programs.dircolors.extraConfig' is now
|
||||
applied after 'programs.dircolors.settings'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-04-11T20:44:54+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.exa'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-04-23T10:00:00+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.pass-secret-service'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-04-26T07:00:00+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new service is available: 'services.poweralertd'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-04-28T10:00:00+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new service is available: 'services.mpris-proxy'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-04-28T12:00:00+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.topgrade'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-04-30T22:05:01+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new service is available: 'services.barrier'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-05-01T15:16:08+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.lazygit'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-04-27T00:00:00+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.ncspot'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-05-02T11:22:42+00:00";
|
||||
condition = hostPlatform.isLinux && config.services.sxhkd.enable;
|
||||
message = ''
|
||||
The sxhkd service now is started using 'xsession.initExtra',
|
||||
therefore this module loses systemd service management capabilities
|
||||
and works only if Home Manager starts the user X session.
|
||||
|
||||
The option 'services.sxhkd.extraPath' has been deprecated.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-05-06T20:47:37+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.etesync-dav'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-05-06T11:01:41+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.nix-index'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-05-10T18:50:07+00:00";
|
||||
message = ''
|
||||
A new module is available: 'xdg.systemDirs'. Options are:
|
||||
|
||||
- xdg.systemDirs.config
|
||||
|
||||
Extra directory names to add to $XDG_CONFIG_DIRS in the user
|
||||
session.
|
||||
|
||||
- xdg.systemDirs.data
|
||||
|
||||
Extra directory names to add to $XDG_DATA_DIRS in the user
|
||||
session.
|
||||
|
||||
These variables are visible in both systemd user services and
|
||||
login shells.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-05-18T12:22:42+00:00";
|
||||
condition = config.services.syncthing != {};
|
||||
message = ''
|
||||
Setting 'services.syncthing.tray' as a boolean will be deprecated in
|
||||
the future.
|
||||
|
||||
This is to make the syncthing tray package configurable, with
|
||||
`services.syncthing.tray.package`, following QSyncthingTray becoming
|
||||
no longer actively maintained. The default syncthing tray package has
|
||||
also changed to https://github.com/Martchus/syncthingtray. To
|
||||
continue as before, set `services.syncthing.tray.enable`.
|
||||
|
||||
See
|
||||
|
||||
https://github.com/nix-community/home-manager/pull/1257
|
||||
|
||||
for discussion.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-05-18T20:28:50+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'programs.foot'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-05-23T18:31:38+00:00";
|
||||
condition = config.programs.mbsync.enable;
|
||||
message = ''
|
||||
mbsync channels no longer accepts the masterPattern or slavePattern
|
||||
attribute keys. This is due to an upstream change.
|
||||
They have been renamed: masterPattern -> farPattern, and
|
||||
slavePattern -> nearPattern.
|
||||
This is a stateful change, where the database file(s) used to keep track
|
||||
of mail are silently upgraded once you upgrade both your configuration file
|
||||
and the mbsync program.
|
||||
|
||||
Note that this change is non-reversible, meaning once you choose to switch to
|
||||
near/farPattern, you can no longer use your previous slave/masterPattern
|
||||
configuration file.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-05-10T20:41:44+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.rbw'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-05-30T15:22:10+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.piston-cli'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-06-02T04:24:10+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.xidlehook'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-06-07T20:44:00+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.pantalaimon'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-06-12T05:00:22+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.mangohud'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-06-16T01:26:16+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
The xmonad module now compiles the configuration before
|
||||
linking the binary to the place xmonad expects to find
|
||||
the compiled configuration (the binary).
|
||||
|
||||
This breaks recompilation of xmonad (i.e. the 'q' binding or
|
||||
'xmonad --recompile').
|
||||
|
||||
If this behavior is undesirable, do not use the
|
||||
'xsession.windowManager.xmonad.config' option. Instead, set the
|
||||
contents of the configuration file with
|
||||
'home.file.".xmonad/config.hs".text = "content of the file"'
|
||||
or 'home.file.".xmonad/config.hs".source = ./path-to-config'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-06-24T22:36:11+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'i18n.inputMethod'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-06-22T14:43:53+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.himalaya'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-07-11T17:45:56+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.sm64ex'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-07-15T13:38:32+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.xsettingsd'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-07-14T20:06:18+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.volnoti'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-07-23T22:22:31+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.trayer'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-07-19T01:30:46+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.notify-osd'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-08-10T21:28:40+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.java'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-08-11T13:55:51+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.easyeffects'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-08-16T21:59:02+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.git-sync'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-08-26T06:40:59+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.fnott'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-08-31T18:44:26+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.betterlockscreen'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-09-14T21:31:03+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.bottom'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,40 +6,31 @@ with lib;
|
||||
|
||||
let
|
||||
|
||||
isConfig = x:
|
||||
builtins.isAttrs x || builtins.isFunction x;
|
||||
isConfig = x: builtins.isAttrs x || builtins.isFunction x;
|
||||
|
||||
optCall = f: x:
|
||||
if builtins.isFunction f
|
||||
then f x
|
||||
else f;
|
||||
optCall = f: x: if builtins.isFunction f then f x else f;
|
||||
|
||||
mergeConfig = lhs_: rhs_:
|
||||
let
|
||||
lhs = optCall lhs_ { inherit pkgs; };
|
||||
rhs = optCall rhs_ { inherit pkgs; };
|
||||
in
|
||||
lhs // rhs //
|
||||
optionalAttrs (lhs ? packageOverrides) {
|
||||
in lhs // rhs // optionalAttrs (lhs ? packageOverrides) {
|
||||
packageOverrides = pkgs:
|
||||
optCall lhs.packageOverrides pkgs //
|
||||
optCall (attrByPath ["packageOverrides"] ({}) rhs) pkgs;
|
||||
} //
|
||||
optionalAttrs (lhs ? perlPackageOverrides) {
|
||||
optCall lhs.packageOverrides pkgs
|
||||
// optCall (attrByPath [ "packageOverrides" ] ({ }) rhs) pkgs;
|
||||
} // optionalAttrs (lhs ? perlPackageOverrides) {
|
||||
perlPackageOverrides = pkgs:
|
||||
optCall lhs.perlPackageOverrides pkgs //
|
||||
optCall (attrByPath ["perlPackageOverrides"] ({}) rhs) pkgs;
|
||||
optCall lhs.perlPackageOverrides pkgs
|
||||
// optCall (attrByPath [ "perlPackageOverrides" ] ({ }) rhs) pkgs;
|
||||
};
|
||||
|
||||
configType = mkOptionType {
|
||||
name = "nixpkgs-config";
|
||||
description = "nixpkgs config";
|
||||
check = x:
|
||||
let traceXIfNot = c:
|
||||
if c x then true
|
||||
else lib.traceSeqN 1 x false;
|
||||
let traceXIfNot = c: if c x then true else lib.traceSeqN 1 x false;
|
||||
in traceXIfNot isConfig;
|
||||
merge = args: fold (def: mergeConfig def.value) {};
|
||||
merge = args: fold (def: mergeConfig def.value) { };
|
||||
};
|
||||
|
||||
overlayType = mkOptionType {
|
||||
@@ -49,13 +40,9 @@ let
|
||||
merge = lib.mergeOneOption;
|
||||
};
|
||||
|
||||
_pkgs = import pkgsPath (
|
||||
filterAttrs (n: v: v != null) config.nixpkgs
|
||||
);
|
||||
_pkgs = import pkgsPath (filterAttrs (n: v: v != null) config.nixpkgs);
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
in {
|
||||
options.nixpkgs = {
|
||||
config = mkOption {
|
||||
default = null;
|
||||
@@ -91,17 +78,16 @@ in
|
||||
|
||||
overlays = mkOption {
|
||||
default = null;
|
||||
example = literalExample
|
||||
''
|
||||
[ (self: super: {
|
||||
openssh = super.openssh.override {
|
||||
hpnSupport = true;
|
||||
withKerberos = true;
|
||||
kerberos = self.libkrb5;
|
||||
};
|
||||
example = literalExample ''
|
||||
[ (self: super: {
|
||||
openssh = super.openssh.override {
|
||||
hpnSupport = true;
|
||||
withKerberos = true;
|
||||
kerberos = self.libkrb5;
|
||||
};
|
||||
) ]
|
||||
'';
|
||||
};
|
||||
) ]
|
||||
'';
|
||||
type = types.nullOr (types.listOf overlayType);
|
||||
description = ''
|
||||
List of overlays to use with the Nix Packages collection. (For
|
||||
@@ -144,9 +130,10 @@ in
|
||||
_module.args = {
|
||||
pkgs = mkOverride modules.defaultPriority _pkgs;
|
||||
pkgs_i686 =
|
||||
if _pkgs.stdenv.isLinux && _pkgs.stdenv.hostPlatform.isx86
|
||||
then _pkgs.pkgsi686Linux
|
||||
else { };
|
||||
if _pkgs.stdenv.isLinux && _pkgs.stdenv.hostPlatform.isx86 then
|
||||
_pkgs.pkgsi686Linux
|
||||
else
|
||||
{ };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -12,6 +12,10 @@ in {
|
||||
options = { xsession.numlock.enable = mkEnableOption "Num Lock"; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "xsession.numlock" pkgs platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.numlockx = {
|
||||
Unit = {
|
||||
Description = "NumLockX";
|
||||
|
||||
@@ -21,6 +21,9 @@ in {
|
||||
<refentrytitle>pam_env.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry>.
|
||||
</para><para>
|
||||
Note, this option will become deprecated in the future and its use is
|
||||
therefore discouraged.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
@@ -44,19 +44,72 @@ in {
|
||||
</variablelist>
|
||||
'';
|
||||
};
|
||||
|
||||
style = {
|
||||
name = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
example = "adwaita-dark";
|
||||
relatedPackages = [ "adwaita-qt" [ "libsForQt5" "qtstyleplugins" ] ];
|
||||
description = ''
|
||||
Selects the style to use for Qt5 applications.</para>
|
||||
<para>The options are
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><literal>adwaita</literal></term>
|
||||
<term><literal>adwaita-dark</literal></term>
|
||||
<listitem><para>Use Adwaita Qt style with
|
||||
<link xlink:href="https://github.com/FedoraQt/adwaita-qt">adwaita</link>
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>cleanlooks</literal></term>
|
||||
<term><literal>gtk2</literal></term>
|
||||
<term><literal>motif</literal></term>
|
||||
<term><literal>plastique</literal></term>
|
||||
<listitem><para>Use styles from
|
||||
<link xlink:href="https://github.com/qt/qtstyleplugins">qtstyleplugins</link>
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.nullOr types.package;
|
||||
default = null;
|
||||
example = literalExample "pkgs.adwaita-qt";
|
||||
description = "Theme package to be used in Qt5 applications.";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable && cfg.platformTheme != null) {
|
||||
home.sessionVariables.QT_QPA_PLATFORMTHEME =
|
||||
if cfg.platformTheme == "gnome" then "gnome" else "gtk2";
|
||||
assertions = [{
|
||||
assertion = (cfg.platformTheme == "gnome")
|
||||
-> ((cfg.style.name != null) && (cfg.style.package != null));
|
||||
message = ''
|
||||
`qt.platformTheme` "gnome" must have `qt.style` set to a theme that
|
||||
supports both Qt and Gtk, for example "adwaita" or "adwaita-dark".
|
||||
'';
|
||||
}];
|
||||
|
||||
# Necessary because home.sessionVariables is of types.attrs
|
||||
home.sessionVariables = (filterAttrs (n: v: v != null) {
|
||||
QT_QPA_PLATFORMTHEME =
|
||||
if cfg.platformTheme == "gnome" then "gnome" else "gtk2";
|
||||
QT_STYLE_OVERRIDE = cfg.style.name;
|
||||
});
|
||||
|
||||
home.packages = if cfg.platformTheme == "gnome" then
|
||||
[ pkgs.qgnomeplatform ]
|
||||
++ lib.optionals (cfg.style.package != null) [ cfg.style.package ]
|
||||
else
|
||||
[ pkgs.libsForQt5.qtstyleplugins ];
|
||||
|
||||
xsession.importedVariables = [ "QT_QPA_PLATFORMTHEME" ];
|
||||
xsession.importedVariables = [ "QT_QPA_PLATFORMTHEME" ]
|
||||
++ lib.optionals (cfg.style != null) [ "QT_STYLE_OVERRIDE" ];
|
||||
|
||||
# Enable GTK+ style for Qt4 in either case.
|
||||
# It doesn’t support the platform theme packages.
|
||||
|
||||
@@ -25,6 +25,11 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf (cfg.rules != [ ]) {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "systemd.user.tmpfiles" pkgs
|
||||
platforms.linux)
|
||||
];
|
||||
|
||||
xdg = {
|
||||
dataFile."user-tmpfiles.d/home-manager.conf" = {
|
||||
text = ''
|
||||
|
||||
@@ -5,7 +5,16 @@ with lib;
|
||||
{
|
||||
options = {
|
||||
home.stateVersion = mkOption {
|
||||
type = types.enum [ "18.09" "19.03" "19.09" "20.03" "20.09" "21.03" ];
|
||||
type = types.enum [
|
||||
"18.09"
|
||||
"19.03"
|
||||
"19.09"
|
||||
"20.03"
|
||||
"20.09"
|
||||
"21.03"
|
||||
"21.05"
|
||||
"21.11"
|
||||
];
|
||||
default = "18.09";
|
||||
description = ''
|
||||
It is occasionally necessary for Home Manager to change
|
||||
|
||||
183
modules/misc/xdg-desktop-entries.nix
Normal file
183
modules/misc/xdg-desktop-entries.nix
Normal file
@@ -0,0 +1,183 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
desktopEntry = {
|
||||
options = {
|
||||
# Since this module uses the nixpkgs/pkgs/build-support/make-desktopitem function,
|
||||
# our options and defaults follow its parameters, with the following exceptions:
|
||||
|
||||
# `desktopName` on makeDesktopItem is controlled by `name`.
|
||||
# This is what we'd commonly consider the name of the application.
|
||||
# `name` on makeDesktopItem is controlled by this module's key in the attrset.
|
||||
# This is the file's filename excluding ".desktop".
|
||||
|
||||
# `extraEntries` on makeDesktopItem is controlled by `extraConfig`,
|
||||
# and `extraDesktopEntries` by `settings`,
|
||||
# to match what's commonly used by other home manager modules.
|
||||
|
||||
# `startupNotify` on makeDesktopItem asks for "true" or "false" strings,
|
||||
# for usability's sake we ask for a boolean.
|
||||
|
||||
# `mimeType` and `categories` on makeDesktopItem ask for a string in the format "one;two;three;",
|
||||
# for the same reason we ask for a list of strings.
|
||||
|
||||
# Descriptions are taken from the desktop entry spec:
|
||||
# https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys
|
||||
|
||||
type = mkOption {
|
||||
description = "The type of the desktop entry.";
|
||||
default = "Application";
|
||||
type = types.enum [ "Application" "Link" "Directory" ];
|
||||
};
|
||||
|
||||
exec = mkOption {
|
||||
description = "Program to execute, possibly with arguments.";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
icon = mkOption {
|
||||
description = "Icon to display in file manager, menus, etc.";
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
comment = mkOption {
|
||||
description = "Tooltip for the entry.";
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
terminal = mkOption {
|
||||
description = "Whether the program runs in a terminal window.";
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
description = "Specific name of the application.";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
genericName = mkOption {
|
||||
description = "Generic name of the application.";
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
mimeType = mkOption {
|
||||
description = "The MIME type(s) supported by this application.";
|
||||
type = types.nullOr (types.listOf types.str);
|
||||
default = null;
|
||||
};
|
||||
|
||||
categories = mkOption {
|
||||
description =
|
||||
"Categories in which the entry should be shown in a menu.";
|
||||
type = types.nullOr (types.listOf types.str);
|
||||
default = null;
|
||||
};
|
||||
|
||||
startupNotify = mkOption {
|
||||
description = ''
|
||||
If true, it is KNOWN that the application will send a "remove"
|
||||
message when started with the <literal>DESKTOP_STARTUP_ID</literal>
|
||||
environment variable set. If false, it is KNOWN that the application
|
||||
does not work with startup notification at all.'';
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
description = ''
|
||||
Extra configuration. Will be appended to the end of the file and
|
||||
may thus contain extra sections.
|
||||
'';
|
||||
type = types.lines;
|
||||
default = "";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = types.attrsOf types.string;
|
||||
description = ''
|
||||
Extra key-value pairs to add to the <literal>[Desktop Entry]</literal> section.
|
||||
This may override other values.
|
||||
'';
|
||||
default = { };
|
||||
example = literalExample ''
|
||||
{
|
||||
Keywords = "calc;math";
|
||||
DBusActivatable = "false";
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
fileValidation = mkOption {
|
||||
type = types.bool;
|
||||
description = "Whether to validate the generated desktop file.";
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#formatting helpers
|
||||
ifNotNull = a: a': if a == null then null else a';
|
||||
stringBool = bool: if bool then "true" else "false";
|
||||
semicolonList = list:
|
||||
(concatStringsSep ";" list) + ";"; # requires trailing semicolon
|
||||
|
||||
#passes config options to makeDesktopItem in expected format
|
||||
makeFile = name: config:
|
||||
pkgs.makeDesktopItem {
|
||||
name = name;
|
||||
type = config.type;
|
||||
exec = config.exec;
|
||||
icon = config.icon;
|
||||
comment = config.comment;
|
||||
terminal = config.terminal;
|
||||
desktopName = config.name;
|
||||
genericName = config.genericName;
|
||||
mimeType = ifNotNull config.mimeType (semicolonList config.mimeType);
|
||||
categories =
|
||||
ifNotNull config.categories (semicolonList config.categories);
|
||||
startupNotify =
|
||||
ifNotNull config.startupNotify (stringBool config.startupNotify);
|
||||
extraEntries = config.extraConfig;
|
||||
extraDesktopEntries = config.settings;
|
||||
};
|
||||
in {
|
||||
meta.maintainers = with maintainers; [ cwyc ];
|
||||
|
||||
options.xdg.desktopEntries = mkOption {
|
||||
description = ''
|
||||
Desktop Entries allow applications to be shown in your desktop environment's app launcher. </para><para>
|
||||
You can define entries for programs without entries or override existing entries. </para><para>
|
||||
See <link xlink:href="https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys" /> for more information on options.
|
||||
'';
|
||||
default = { };
|
||||
type = types.attrsOf (types.submodule desktopEntry);
|
||||
example = literalExample ''
|
||||
{
|
||||
firefox = {
|
||||
name = "Firefox";
|
||||
genericName = "Web Browser";
|
||||
exec = "firefox %U";
|
||||
terminal = false;
|
||||
categories = [ "Application" "Network" "WebBrowser" ];
|
||||
mimeType = [ "text/html" "text/xml" ];
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
config = mkIf (config.xdg.desktopEntries != { }) {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "xdg.desktopEntries" pkgs platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = (map hiPrio # we need hiPrio to override existing entries
|
||||
(attrsets.mapAttrsToList makeFile config.xdg.desktopEntries));
|
||||
};
|
||||
|
||||
}
|
||||
@@ -73,6 +73,9 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions =
|
||||
[ (hm.assertions.assertPlatform "xdg.mimeApps" pkgs platforms.linux) ];
|
||||
|
||||
# Deprecated but still used by some applications.
|
||||
xdg.dataFile."applications/mimeapps.list".source =
|
||||
config.xdg.configFile."mimeapps.list".source;
|
||||
|
||||
@@ -10,7 +10,9 @@ in {
|
||||
options = {
|
||||
xdg.mime.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
default = pkgs.hostPlatform.isLinux;
|
||||
defaultText =
|
||||
literalExample "true if host platform is Linux, false otherwise";
|
||||
description = ''
|
||||
Whether to install programs and files to support the
|
||||
XDG Shared MIME-info specification and XDG MIME Applications
|
||||
@@ -24,6 +26,9 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf config.xdg.mime.enable {
|
||||
assertions =
|
||||
[ (hm.assertions.assertPlatform "xdg.mime" pkgs platforms.linux) ];
|
||||
|
||||
home.packages = [
|
||||
# Explicitly install package to provide basic mime types.
|
||||
pkgs.shared-mime-info
|
||||
|
||||
61
modules/misc/xdg-system-dirs.nix
Normal file
61
modules/misc/xdg-system-dirs.nix
Normal file
@@ -0,0 +1,61 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.xdg.systemDirs;
|
||||
|
||||
configDirs = concatStringsSep ":" cfg.config;
|
||||
|
||||
dataDirs = concatStringsSep ":" cfg.data;
|
||||
|
||||
in {
|
||||
meta.maintainers = with maintainers; [ tadfisher ];
|
||||
|
||||
options.xdg.systemDirs = {
|
||||
config = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = literalExample ''[ "/etc/xdg" ]'';
|
||||
description = ''
|
||||
Directory names to add to <envar>XDG_CONFIG_DIRS</envar>
|
||||
in the user session.
|
||||
'';
|
||||
};
|
||||
|
||||
data = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = literalExample ''[ "/usr/share" "/usr/local/share" ]'';
|
||||
description = ''
|
||||
Directory names to add to <envar>XDG_DATA_DIRS</envar>
|
||||
in the user session.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf (cfg.config != [ ] || cfg.data != [ ]) {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "xdg.systemDirs" pkgs platforms.linux)
|
||||
];
|
||||
})
|
||||
|
||||
(mkIf (cfg.config != [ ]) {
|
||||
home.sessionVariables.XDG_CONFIG_DIRS =
|
||||
"${configDirs}\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}";
|
||||
|
||||
systemd.user.sessionVariables.XDG_CONFIG_DIRS =
|
||||
"${configDirs}\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}";
|
||||
})
|
||||
|
||||
(mkIf (cfg.data != [ ]) {
|
||||
home.sessionVariables.XDG_DATA_DIRS =
|
||||
"${dataDirs}\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}";
|
||||
|
||||
systemd.user.sessionVariables.XDG_DATA_DIRS =
|
||||
"${dataDirs}\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}";
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -86,25 +86,39 @@ in {
|
||||
example = { XDG_MISC_DIR = "$HOME/Misc"; };
|
||||
description = "Other user directories.";
|
||||
};
|
||||
|
||||
createDirectories =
|
||||
mkEnableOption "automatic creation of the XDG user directories";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
xdg.configFile."user-dirs.dirs".text = let
|
||||
options = {
|
||||
XDG_DESKTOP_DIR = cfg.desktop;
|
||||
XDG_DOCUMENTS_DIR = cfg.documents;
|
||||
XDG_DOWNLOAD_DIR = cfg.download;
|
||||
XDG_MUSIC_DIR = cfg.music;
|
||||
XDG_PICTURES_DIR = cfg.pictures;
|
||||
XDG_PUBLICSHARE_DIR = cfg.publicShare;
|
||||
XDG_TEMPLATES_DIR = cfg.templates;
|
||||
XDG_VIDEOS_DIR = cfg.videos;
|
||||
} // cfg.extraConfig;
|
||||
config = let
|
||||
directories = {
|
||||
XDG_DESKTOP_DIR = cfg.desktop;
|
||||
XDG_DOCUMENTS_DIR = cfg.documents;
|
||||
XDG_DOWNLOAD_DIR = cfg.download;
|
||||
XDG_MUSIC_DIR = cfg.music;
|
||||
XDG_PICTURES_DIR = cfg.pictures;
|
||||
XDG_PUBLICSHARE_DIR = cfg.publicShare;
|
||||
XDG_TEMPLATES_DIR = cfg.templates;
|
||||
XDG_VIDEOS_DIR = cfg.videos;
|
||||
} // cfg.extraConfig;
|
||||
in mkIf cfg.enable {
|
||||
assertions =
|
||||
[ (hm.assertions.assertPlatform "xdg.userDirs" pkgs platforms.linux) ];
|
||||
|
||||
xdg.configFile."user-dirs.dirs".text = let
|
||||
# For some reason, these need to be wrapped with quotes to be valid.
|
||||
wrapped = mapAttrs (_: value: ''"${value}"'') options;
|
||||
wrapped = mapAttrs (_: value: ''"${value}"'') directories;
|
||||
in generators.toKeyValue { } wrapped;
|
||||
|
||||
xdg.configFile."user-dirs.conf".text = "enabled=False";
|
||||
|
||||
home.activation = mkIf cfg.createDirectories {
|
||||
createXdgUserDirectories = let
|
||||
directoriesList = attrValues directories;
|
||||
mkdir = (dir: ''$DRY_RUN_CMD mkdir -p $VERBOSE_ARG "${dir}"'');
|
||||
in lib.hm.dag.entryAfter [ "writeBoundary" ]
|
||||
(strings.concatMapStringsSep "\n" mkdir directoriesList);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@ let
|
||||
|
||||
cfg = config.xdg;
|
||||
|
||||
dag = config.lib.dag;
|
||||
|
||||
fileType = (import ../lib/file-type.nix {
|
||||
inherit (config.home) homeDirectory;
|
||||
inherit lib pkgs;
|
||||
@@ -17,21 +15,18 @@ let
|
||||
defaultConfigHome = "${config.home.homeDirectory}/.config";
|
||||
defaultDataHome = "${config.home.homeDirectory}/.local/share";
|
||||
|
||||
getXdgDir = name: fallback:
|
||||
let
|
||||
value = builtins.getEnv name;
|
||||
in
|
||||
if value != "" then value else fallback;
|
||||
getEnvFallback = name: fallback:
|
||||
let value = builtins.getEnv name;
|
||||
in if value != "" then value else fallback;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
in {
|
||||
options.xdg = {
|
||||
enable = mkEnableOption "management of XDG base directories";
|
||||
|
||||
cacheHome = mkOption {
|
||||
type = types.path;
|
||||
defaultText = "~/.cache";
|
||||
apply = toString;
|
||||
description = ''
|
||||
Absolute path to directory holding application caches.
|
||||
'';
|
||||
@@ -39,7 +34,7 @@ in
|
||||
|
||||
configFile = mkOption {
|
||||
type = fileType "<varname>xdg.configHome</varname>" cfg.configHome;
|
||||
default = {};
|
||||
default = { };
|
||||
description = ''
|
||||
Attribute set of files to link into the user's XDG
|
||||
configuration home.
|
||||
@@ -49,6 +44,7 @@ in
|
||||
configHome = mkOption {
|
||||
type = types.path;
|
||||
defaultText = "~/.config";
|
||||
apply = toString;
|
||||
description = ''
|
||||
Absolute path to directory holding application configurations.
|
||||
'';
|
||||
@@ -56,7 +52,7 @@ in
|
||||
|
||||
dataFile = mkOption {
|
||||
type = fileType "<varname>xdg.dataHome</varname>" cfg.dataHome;
|
||||
default = {};
|
||||
default = { };
|
||||
description = ''
|
||||
Attribute set of files to link into the user's XDG
|
||||
data home.
|
||||
@@ -66,6 +62,7 @@ in
|
||||
dataHome = mkOption {
|
||||
type = types.path;
|
||||
defaultText = "~/.local/share";
|
||||
apply = toString;
|
||||
description = ''
|
||||
Absolute path to directory holding application data.
|
||||
'';
|
||||
@@ -87,9 +84,11 @@ in
|
||||
|
||||
# Legacy non-deterministic setup.
|
||||
(mkIf (!cfg.enable && versionOlder config.home.stateVersion "20.09") {
|
||||
xdg.cacheHome = getXdgDir "XDG_CACHE_HOME" defaultCacheHome;
|
||||
xdg.configHome = getXdgDir "XDG_CONFIG_HOME" defaultConfigHome;
|
||||
xdg.dataHome = getXdgDir "XDG_DATA_HOME" defaultDataHome;
|
||||
xdg.cacheHome =
|
||||
mkDefault (getEnvFallback "XDG_CACHE_HOME" defaultCacheHome);
|
||||
xdg.configHome =
|
||||
mkDefault (getEnvFallback "XDG_CONFIG_HOME" defaultConfigHome);
|
||||
xdg.dataHome = mkDefault (getEnvFallback "XDG_DATA_HOME" defaultDataHome);
|
||||
})
|
||||
|
||||
# "Modern" deterministic setup.
|
||||
@@ -101,13 +100,11 @@ in
|
||||
|
||||
{
|
||||
home.file = mkMerge [
|
||||
(mapAttrs'
|
||||
(name: file: nameValuePair "${config.xdg.configHome}/${name}" file)
|
||||
(mapAttrs' (name: file: nameValuePair "${cfg.configHome}/${name}" file)
|
||||
cfg.configFile)
|
||||
(mapAttrs'
|
||||
(name: file: nameValuePair "${config.xdg.dataHome}/${name}" file)
|
||||
(mapAttrs' (name: file: nameValuePair "${cfg.dataHome}/${name}" file)
|
||||
cfg.dataFile)
|
||||
{ "${config.xdg.cacheHome}/.keep".text = ""; }
|
||||
{ "${cfg.cacheHome}/.keep".text = ""; }
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,217 +1,252 @@
|
||||
{ pkgs
|
||||
|
||||
# Note, this should be "the standard library" + HM extensions.
|
||||
# Note, this should be "the standard library" + HM extensions.
|
||||
, lib
|
||||
|
||||
# Whether to enable module type checking.
|
||||
# Whether to enable module type checking.
|
||||
, check ? true
|
||||
|
||||
# If disabled, the pkgs attribute passed to this function is used instead.
|
||||
, useNixpkgsModule ? true
|
||||
}:
|
||||
# If disabled, the pkgs attribute passed to this function is used instead.
|
||||
, useNixpkgsModule ? true }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
hostPlatform = pkgs.stdenv.hostPlatform;
|
||||
|
||||
loadModule = file: { condition ? true }: {
|
||||
inherit file condition;
|
||||
};
|
||||
|
||||
allModules = [
|
||||
(loadModule ./accounts/email.nix { })
|
||||
(loadModule ./files.nix { })
|
||||
(loadModule ./home-environment.nix { })
|
||||
(loadModule ./manual.nix { })
|
||||
(loadModule ./misc/dconf.nix { })
|
||||
(loadModule ./misc/debug.nix { })
|
||||
(loadModule ./misc/fontconfig.nix { })
|
||||
(loadModule ./misc/gtk.nix { })
|
||||
(loadModule ./misc/lib.nix { })
|
||||
(loadModule ./misc/news.nix { })
|
||||
(loadModule ./misc/nixpkgs.nix { condition = useNixpkgsModule; })
|
||||
(loadModule ./misc/numlock.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./misc/pam.nix { })
|
||||
(loadModule ./misc/qt.nix { })
|
||||
(loadModule ./misc/submodule-support.nix { })
|
||||
(loadModule ./misc/tmpfiles.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./misc/version.nix { })
|
||||
(loadModule ./misc/vte.nix { })
|
||||
(loadModule ./misc/xdg-mime.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./misc/xdg-mime-apps.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./misc/xdg-user-dirs.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./misc/xdg.nix { })
|
||||
(loadModule ./programs/abook.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./programs/afew.nix { })
|
||||
(loadModule ./programs/alacritty.nix { })
|
||||
(loadModule ./programs/alot.nix { })
|
||||
(loadModule ./programs/aria2.nix { })
|
||||
(loadModule ./programs/astroid.nix { })
|
||||
(loadModule ./programs/autojump.nix { })
|
||||
(loadModule ./programs/autorandr.nix { })
|
||||
(loadModule ./programs/bash.nix { })
|
||||
(loadModule ./programs/bat.nix { })
|
||||
(loadModule ./programs/beets.nix { })
|
||||
(loadModule ./programs/broot.nix { })
|
||||
(loadModule ./programs/browserpass.nix { })
|
||||
(loadModule ./programs/chromium.nix { })
|
||||
(loadModule ./programs/command-not-found/command-not-found.nix { })
|
||||
(loadModule ./programs/dircolors.nix { })
|
||||
(loadModule ./programs/direnv.nix { })
|
||||
(loadModule ./programs/eclipse.nix { })
|
||||
(loadModule ./programs/emacs.nix { })
|
||||
(loadModule ./programs/feh.nix { })
|
||||
(loadModule ./programs/firefox.nix { })
|
||||
(loadModule ./programs/fish.nix { })
|
||||
(loadModule ./programs/fzf.nix { })
|
||||
(loadModule ./programs/getmail.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./programs/gh.nix { })
|
||||
(loadModule ./programs/git.nix { })
|
||||
(loadModule ./programs/gnome-terminal.nix { })
|
||||
(loadModule ./programs/go.nix { })
|
||||
(loadModule ./programs/gpg.nix { })
|
||||
(loadModule ./programs/home-manager.nix { })
|
||||
(loadModule ./programs/htop.nix { })
|
||||
(loadModule ./programs/i3status.nix { })
|
||||
(loadModule ./programs/info.nix { })
|
||||
(loadModule ./programs/irssi.nix { })
|
||||
(loadModule ./programs/lieer.nix { })
|
||||
(loadModule ./programs/jq.nix { })
|
||||
(loadModule ./programs/kakoune.nix { })
|
||||
(loadModule ./programs/keychain.nix { })
|
||||
(loadModule ./programs/kitty.nix { })
|
||||
(loadModule ./programs/lesspipe.nix { })
|
||||
(loadModule ./programs/lf.nix { })
|
||||
(loadModule ./programs/lsd.nix { })
|
||||
(loadModule ./programs/man.nix { })
|
||||
(loadModule ./programs/matplotlib.nix { })
|
||||
(loadModule ./programs/mbsync.nix { })
|
||||
(loadModule ./programs/mcfly.nix { })
|
||||
(loadModule ./programs/mercurial.nix { })
|
||||
(loadModule ./programs/mpv.nix { })
|
||||
(loadModule ./programs/msmtp.nix { })
|
||||
(loadModule ./programs/mu.nix { })
|
||||
(loadModule ./programs/ncmpcpp.nix { })
|
||||
(loadModule ./programs/ne.nix { })
|
||||
(loadModule ./programs/neomutt.nix { })
|
||||
(loadModule ./programs/neovim.nix { })
|
||||
(loadModule ./programs/newsboat.nix { })
|
||||
(loadModule ./programs/noti.nix { })
|
||||
(loadModule ./programs/notmuch.nix { })
|
||||
(loadModule ./programs/nushell.nix { })
|
||||
(loadModule ./programs/obs-studio.nix { })
|
||||
(loadModule ./programs/offlineimap.nix { })
|
||||
(loadModule ./programs/opam.nix { })
|
||||
(loadModule ./programs/password-store.nix { })
|
||||
(loadModule ./programs/pazi.nix { })
|
||||
(loadModule ./programs/pet.nix { })
|
||||
(loadModule ./programs/pidgin.nix { })
|
||||
(loadModule ./programs/powerline-go.nix { })
|
||||
(loadModule ./programs/qutebrowser.nix { })
|
||||
(loadModule ./programs/readline.nix { })
|
||||
(loadModule ./programs/rofi.nix { })
|
||||
(loadModule ./programs/rtorrent.nix { })
|
||||
(loadModule ./programs/skim.nix { })
|
||||
(loadModule ./programs/starship.nix { })
|
||||
(loadModule ./programs/ssh.nix { })
|
||||
(loadModule ./programs/taskwarrior.nix { })
|
||||
(loadModule ./programs/termite.nix { })
|
||||
(loadModule ./programs/texlive.nix { })
|
||||
(loadModule ./programs/tmux.nix { })
|
||||
(loadModule ./programs/urxvt.nix { })
|
||||
(loadModule ./programs/vim.nix { })
|
||||
(loadModule ./programs/vscode.nix { })
|
||||
(loadModule ./programs/vscode/haskell.nix { })
|
||||
(loadModule ./programs/waybar.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./programs/z-lua.nix { })
|
||||
(loadModule ./programs/zathura.nix { })
|
||||
(loadModule ./programs/zoxide.nix { })
|
||||
(loadModule ./programs/zplug.nix { })
|
||||
(loadModule ./programs/zsh.nix { })
|
||||
(loadModule ./programs/zsh/prezto.nix { })
|
||||
(loadModule ./services/blueman-applet.nix { })
|
||||
(loadModule ./services/caffeine.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/cbatticon.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/clipmenu.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/compton.nix { })
|
||||
(loadModule ./services/dropbox.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/dunst.nix { })
|
||||
(loadModule ./services/dwm-status.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/emacs.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/flameshot.nix { })
|
||||
(loadModule ./services/fluidsynth.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/gammastep.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/getmail.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/gnome-keyring.nix { })
|
||||
(loadModule ./services/gpg-agent.nix { })
|
||||
(loadModule ./services/grobi.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/hound.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/imapnotify.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/kanshi.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/kbfs.nix { })
|
||||
(loadModule ./services/kdeconnect.nix { })
|
||||
(loadModule ./services/keepassx.nix { })
|
||||
(loadModule ./services/keybase.nix { })
|
||||
(loadModule ./services/keynav.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/lieer.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/lorri.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/mako.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/mbsync.nix { })
|
||||
(loadModule ./services/mpd.nix { })
|
||||
(loadModule ./services/mpdris2.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/muchsync.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/network-manager-applet.nix { })
|
||||
(loadModule ./services/nextcloud-client.nix { })
|
||||
(loadModule ./services/owncloud-client.nix { })
|
||||
(loadModule ./services/parcellite.nix { })
|
||||
(loadModule ./services/password-store-sync.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/pasystray.nix { })
|
||||
(loadModule ./services/picom.nix { })
|
||||
(loadModule ./services/polybar.nix { })
|
||||
(loadModule ./services/pulseeffects.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/random-background.nix { })
|
||||
(loadModule ./services/redshift.nix { })
|
||||
(loadModule ./services/rsibreak.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/screen-locker.nix { })
|
||||
(loadModule ./services/stalonetray.nix { })
|
||||
(loadModule ./services/status-notifier-watcher.nix { })
|
||||
(loadModule ./services/spotifyd.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/sxhkd.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/syncthing.nix { })
|
||||
(loadModule ./services/taffybar.nix { })
|
||||
(loadModule ./services/tahoe-lafs.nix { })
|
||||
(loadModule ./services/taskwarrior-sync.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/udiskie.nix { })
|
||||
(loadModule ./services/unclutter.nix { })
|
||||
(loadModule ./services/unison.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/window-managers/awesome.nix { })
|
||||
(loadModule ./services/window-managers/bspwm/default.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/window-managers/i3-sway/i3.nix { })
|
||||
(loadModule ./services/window-managers/i3-sway/sway.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/window-managers/xmonad.nix { })
|
||||
(loadModule ./services/xcape.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/xembed-sni-proxy.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/xscreensaver.nix { })
|
||||
(loadModule ./services/xsuspender.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./systemd.nix { })
|
||||
(loadModule ./targets/darwin.nix { condition = hostPlatform.isDarwin; })
|
||||
(loadModule ./targets/generic-linux.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./xcursor.nix { })
|
||||
(loadModule ./xresources.nix { })
|
||||
(loadModule ./xsession.nix { })
|
||||
(loadModule (pkgs.path + "/nixos/modules/misc/assertions.nix") { })
|
||||
(loadModule (pkgs.path + "/nixos/modules/misc/meta.nix") { })
|
||||
];
|
||||
|
||||
modules = map (getAttr "file") (filter (getAttr "condition") allModules);
|
||||
modules = [
|
||||
./accounts/email.nix
|
||||
./config/i18n.nix
|
||||
./files.nix
|
||||
./home-environment.nix
|
||||
./i18n/input-method/default.nix
|
||||
./manual.nix
|
||||
./misc/dconf.nix
|
||||
./misc/debug.nix
|
||||
./misc/fontconfig.nix
|
||||
./misc/gtk.nix
|
||||
./misc/lib.nix
|
||||
./misc/news.nix
|
||||
./misc/numlock.nix
|
||||
./misc/pam.nix
|
||||
./misc/qt.nix
|
||||
./misc/submodule-support.nix
|
||||
./misc/tmpfiles.nix
|
||||
./misc/version.nix
|
||||
./misc/vte.nix
|
||||
./misc/xdg-desktop-entries.nix
|
||||
./misc/xdg-mime-apps.nix
|
||||
./misc/xdg-mime.nix
|
||||
./misc/xdg-system-dirs.nix
|
||||
./misc/xdg-user-dirs.nix
|
||||
./misc/xdg.nix
|
||||
./programs/abook.nix
|
||||
./programs/afew.nix
|
||||
./programs/alacritty.nix
|
||||
./programs/alot.nix
|
||||
./programs/aria2.nix
|
||||
./programs/astroid.nix
|
||||
./programs/autojump.nix
|
||||
./programs/autorandr.nix
|
||||
./programs/bash.nix
|
||||
./programs/bat.nix
|
||||
./programs/beets.nix
|
||||
./programs/bottom.nix
|
||||
./programs/broot.nix
|
||||
./programs/browserpass.nix
|
||||
./programs/chromium.nix
|
||||
./programs/command-not-found/command-not-found.nix
|
||||
./programs/dircolors.nix
|
||||
./programs/direnv.nix
|
||||
./programs/eclipse.nix
|
||||
./programs/emacs.nix
|
||||
./programs/exa.nix
|
||||
./programs/feh.nix
|
||||
./programs/firefox.nix
|
||||
./programs/fish.nix
|
||||
./programs/foot.nix
|
||||
./programs/fzf.nix
|
||||
./programs/getmail.nix
|
||||
./programs/gh.nix
|
||||
./programs/git.nix
|
||||
./programs/gnome-terminal.nix
|
||||
./programs/go.nix
|
||||
./programs/gpg.nix
|
||||
./programs/himalaya.nix
|
||||
./programs/home-manager.nix
|
||||
./programs/htop.nix
|
||||
./programs/i3status-rust.nix
|
||||
./programs/i3status.nix
|
||||
./programs/info.nix
|
||||
./programs/irssi.nix
|
||||
./programs/java.nix
|
||||
./programs/jq.nix
|
||||
./programs/kakoune.nix
|
||||
./programs/keychain.nix
|
||||
./programs/kitty.nix
|
||||
./programs/lazygit.nix
|
||||
./programs/lesspipe.nix
|
||||
./programs/lf.nix
|
||||
./programs/lieer.nix
|
||||
./programs/lsd.nix
|
||||
./programs/man.nix
|
||||
./programs/mangohud.nix
|
||||
./programs/matplotlib.nix
|
||||
./programs/mbsync.nix
|
||||
./programs/mcfly.nix
|
||||
./programs/mercurial.nix
|
||||
./programs/mpv.nix
|
||||
./programs/msmtp.nix
|
||||
./programs/mu.nix
|
||||
./programs/ncmpcpp.nix
|
||||
./programs/ncspot.nix
|
||||
./programs/ne.nix
|
||||
./programs/neomutt.nix
|
||||
./programs/neovim.nix
|
||||
./programs/newsboat.nix
|
||||
./programs/nix-index.nix
|
||||
./programs/noti.nix
|
||||
./programs/notmuch.nix
|
||||
./programs/nushell.nix
|
||||
./programs/obs-studio.nix
|
||||
./programs/octant.nix
|
||||
./programs/offlineimap.nix
|
||||
./programs/opam.nix
|
||||
./programs/password-store.nix
|
||||
./programs/pazi.nix
|
||||
./programs/pet.nix
|
||||
./programs/pidgin.nix
|
||||
./programs/piston-cli.nix
|
||||
./programs/powerline-go.nix
|
||||
./programs/qutebrowser.nix
|
||||
./programs/rbw.nix
|
||||
./programs/readline.nix
|
||||
./programs/rofi-pass.nix
|
||||
./programs/rofi.nix
|
||||
./programs/rtorrent.nix
|
||||
./programs/sbt.nix
|
||||
./programs/scmpuff.nix
|
||||
./programs/senpai.nix
|
||||
./programs/skim.nix
|
||||
./programs/sm64ex.nix
|
||||
./programs/ssh.nix
|
||||
./programs/starship.nix
|
||||
./programs/taskwarrior.nix
|
||||
./programs/terminator.nix
|
||||
./programs/termite.nix
|
||||
./programs/texlive.nix
|
||||
./programs/tmux.nix
|
||||
./programs/topgrade.nix
|
||||
./programs/urxvt.nix
|
||||
./programs/vim.nix
|
||||
./programs/vscode.nix
|
||||
./programs/vscode/haskell.nix
|
||||
./programs/waybar.nix
|
||||
./programs/xmobar.nix
|
||||
./programs/z-lua.nix
|
||||
./programs/zathura.nix
|
||||
./programs/zoxide.nix
|
||||
./programs/zplug.nix
|
||||
./programs/zsh.nix
|
||||
./programs/zsh/prezto.nix
|
||||
./services/barrier.nix
|
||||
./services/betterlockscreen.nix
|
||||
./services/blueman-applet.nix
|
||||
./services/caffeine.nix
|
||||
./services/cbatticon.nix
|
||||
./services/clipmenu.nix
|
||||
./services/compton.nix
|
||||
./services/devilspie2.nix
|
||||
./services/dropbox.nix
|
||||
./services/dunst.nix
|
||||
./services/dwm-status.nix
|
||||
./services/easyeffects.nix
|
||||
./services/emacs.nix
|
||||
./services/etesync-dav.nix
|
||||
./services/flameshot.nix
|
||||
./services/fluidsynth.nix
|
||||
./services/fnott.nix
|
||||
./services/getmail.nix
|
||||
./services/git-sync.nix
|
||||
./services/gnome-keyring.nix
|
||||
./services/gpg-agent.nix
|
||||
./services/grobi.nix
|
||||
./services/hound.nix
|
||||
./services/imapnotify.nix
|
||||
./services/kanshi.nix
|
||||
./services/kbfs.nix
|
||||
./services/kdeconnect.nix
|
||||
./services/keepassx.nix
|
||||
./services/keybase.nix
|
||||
./services/keynav.nix
|
||||
./services/lieer.nix
|
||||
./services/lorri.nix
|
||||
./services/mako.nix
|
||||
./services/mbsync.nix
|
||||
./services/mpd.nix
|
||||
./services/mpdris2.nix
|
||||
./services/mpris-proxy.nix
|
||||
./services/muchsync.nix
|
||||
./services/network-manager-applet.nix
|
||||
./services/nextcloud-client.nix
|
||||
./services/notify-osd.nix
|
||||
./services/owncloud-client.nix
|
||||
./services/pantalaimon.nix
|
||||
./services/parcellite.nix
|
||||
./services/pass-secret-service.nix
|
||||
./services/password-store-sync.nix
|
||||
./services/pasystray.nix
|
||||
./services/pbgopy.nix
|
||||
./services/picom.nix
|
||||
./services/plan9port.nix
|
||||
./services/playerctld.nix
|
||||
./services/polybar.nix
|
||||
./services/poweralertd.nix
|
||||
./services/pulseeffects.nix
|
||||
./services/random-background.nix
|
||||
./services/redshift-gammastep/gammastep.nix
|
||||
./services/redshift-gammastep/redshift.nix
|
||||
./services/rsibreak.nix
|
||||
./services/screen-locker.nix
|
||||
./services/spotifyd.nix
|
||||
./services/stalonetray.nix
|
||||
./services/status-notifier-watcher.nix
|
||||
./services/sxhkd.nix
|
||||
./services/syncthing.nix
|
||||
./services/taffybar.nix
|
||||
./services/tahoe-lafs.nix
|
||||
./services/taskwarrior-sync.nix
|
||||
./services/trayer.nix
|
||||
./services/udiskie.nix
|
||||
./services/unclutter.nix
|
||||
./services/unison.nix
|
||||
./services/volnoti.nix
|
||||
./services/window-managers/awesome.nix
|
||||
./services/window-managers/bspwm/default.nix
|
||||
./services/window-managers/i3-sway/i3.nix
|
||||
./services/window-managers/i3-sway/sway.nix
|
||||
./services/window-managers/xmonad.nix
|
||||
./services/wlsunset.nix
|
||||
./services/xcape.nix
|
||||
./services/xembed-sni-proxy.nix
|
||||
./services/xidlehook.nix
|
||||
./services/xscreensaver.nix
|
||||
./services/xsettingsd.nix
|
||||
./services/xsuspender.nix
|
||||
./systemd.nix
|
||||
./targets/darwin
|
||||
./targets/generic-linux.nix
|
||||
./xcursor.nix
|
||||
./xresources.nix
|
||||
./xsession.nix
|
||||
(pkgs.path + "/nixos/modules/misc/assertions.nix")
|
||||
(pkgs.path + "/nixos/modules/misc/meta.nix")
|
||||
] ++ optional useNixpkgsModule ./misc/nixpkgs.nix;
|
||||
|
||||
pkgsModule = { config, ... }: {
|
||||
config = {
|
||||
_module.args.baseModules = modules;
|
||||
_module.args.pkgsPath = lib.mkDefault (
|
||||
if versionAtLeast config.home.stateVersion "20.09" then
|
||||
_module.args.pkgsPath = lib.mkDefault
|
||||
(if versionAtLeast config.home.stateVersion "20.09" then
|
||||
pkgs.path
|
||||
else
|
||||
<nixpkgs>);
|
||||
@@ -223,6 +258,4 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
modules ++ [ pkgsModule ]
|
||||
in modules ++ [ pkgsModule ]
|
||||
|
||||
@@ -27,7 +27,11 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions =
|
||||
[ (hm.assertions.assertPlatform "programs.abook" pkgs platforms.linux) ];
|
||||
|
||||
home.packages = [ pkgs.abook ];
|
||||
|
||||
xdg.configFile."abook/abookrc" = mkIf (cfg.extraConfig != "") {
|
||||
text = ''
|
||||
# Generated by Home Manager.
|
||||
|
||||
@@ -6,9 +6,7 @@ let
|
||||
|
||||
cfg = config.programs.afew;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
in {
|
||||
options.programs.afew = {
|
||||
enable = mkEnableOption "the afew initial tagging script for Notmuch";
|
||||
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.alacritty;
|
||||
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
in {
|
||||
options = {
|
||||
programs.alacritty = {
|
||||
@@ -19,7 +18,7 @@ in {
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = types.attrs;
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
example = literalExample ''
|
||||
{
|
||||
@@ -51,6 +50,11 @@ in {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."alacritty/alacritty.yml" = mkIf (cfg.settings != { }) {
|
||||
# TODO: Replace by the generate function but need to figure out how to
|
||||
# handle the escaping first.
|
||||
#
|
||||
# source = yamlFormat.generate "alacritty.yml" cfg.settings;
|
||||
|
||||
text =
|
||||
replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.settings);
|
||||
};
|
||||
|
||||
@@ -7,9 +7,12 @@ let
|
||||
|
||||
cfg = config.programs.alot;
|
||||
|
||||
alotAccounts =
|
||||
enabledAccounts =
|
||||
filter (a: a.notmuch.enable) (attrValues config.accounts.email.accounts);
|
||||
|
||||
# sorted: primary first
|
||||
alotAccounts = sort (a: b: !(a.primary -> b.primary)) enabledAccounts;
|
||||
|
||||
boolStr = v: if v then "True" else "False";
|
||||
|
||||
mkKeyValue = key: value:
|
||||
|
||||
@@ -16,7 +16,7 @@ with lib;
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.attrs;
|
||||
type = types.attrsOf types.anything;
|
||||
default = { };
|
||||
example = { select_query = ""; };
|
||||
description = ''
|
||||
|
||||
@@ -7,6 +7,8 @@ let
|
||||
|
||||
cfg = config.programs.astroid;
|
||||
|
||||
jsonFormat = pkgs.formats.json { };
|
||||
|
||||
astroidAccounts =
|
||||
filterAttrs (n: v: v.astroid.enable) config.accounts.email.accounts;
|
||||
|
||||
@@ -20,9 +22,9 @@ let
|
||||
sendmail = astroid.sendMailCommand;
|
||||
additional_sent_tags = "";
|
||||
default = boolOpt primary;
|
||||
save_drafts_to = "${maildir.absPath}/${folders.drafts}";
|
||||
save_drafts_to = "${maildir.absPath}/${folders.drafts}/cur/";
|
||||
save_sent = "true";
|
||||
save_sent_to = "${maildir.absPath}/${folders.sent}";
|
||||
save_sent_to = "${maildir.absPath}/${folders.sent}/cur/";
|
||||
select_query = "";
|
||||
} // optionalAttrs (signature.showSignature != "none") {
|
||||
signature_attach = boolOpt (signature.showSignature == "attach");
|
||||
@@ -36,19 +38,18 @@ let
|
||||
} // astroid.extraConfig;
|
||||
|
||||
# See https://github.com/astroidmail/astroid/wiki/Configuration-Reference
|
||||
configFile = mailAccounts:
|
||||
let
|
||||
template = fromJSON (readFile ./astroid-config-template.json);
|
||||
astroidConfig = foldl' recursiveUpdate template [
|
||||
{
|
||||
astroid.notmuch_config = "${config.xdg.configHome}/notmuch/notmuchrc";
|
||||
accounts = mapAttrs (n: accountAttr) astroidAccounts;
|
||||
crypto.gpg.path = "${pkgs.gnupg}/bin/gpg";
|
||||
}
|
||||
cfg.extraConfig
|
||||
cfg.externalEditor
|
||||
];
|
||||
in builtins.toJSON astroidConfig;
|
||||
finalConfig = let
|
||||
template = fromJSON (readFile ./astroid-config-template.json);
|
||||
astroidConfig = foldl' recursiveUpdate template [
|
||||
{
|
||||
astroid.notmuch_config = "${config.xdg.configHome}/notmuch/notmuchrc";
|
||||
accounts = mapAttrs (n: accountAttr) astroidAccounts;
|
||||
crypto.gpg.path = "${pkgs.gnupg}/bin/gpg";
|
||||
}
|
||||
cfg.extraConfig
|
||||
cfg.externalEditor
|
||||
];
|
||||
in astroidConfig;
|
||||
|
||||
in {
|
||||
options = {
|
||||
@@ -90,9 +91,13 @@ in {
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.attrs;
|
||||
type = jsonFormat.type;
|
||||
default = { };
|
||||
example = { poll.interval = 0; };
|
||||
example = literalExample ''
|
||||
{
|
||||
poll.interval = 0;
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
JSON config that will override the default Astroid configuration.
|
||||
'';
|
||||
@@ -107,13 +112,8 @@ in {
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.astroid ];
|
||||
|
||||
xdg.configFile."astroid/config".source = pkgs.runCommand "out.json" {
|
||||
json = configFile astroidAccounts;
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
} ''
|
||||
echo -n "$json" | ${pkgs.jq}/bin/jq . > $out
|
||||
'';
|
||||
xdg.configFile."astroid/config".source =
|
||||
jsonFormat.generate "astroid-config" finalConfig;
|
||||
|
||||
xdg.configFile."astroid/poll.sh" = {
|
||||
executable = true;
|
||||
|
||||
@@ -30,8 +30,8 @@ in
|
||||
};
|
||||
|
||||
historyFile = mkOption {
|
||||
type = types.str;
|
||||
default = "$HOME/.bash_history";
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "Location of the bash history file.";
|
||||
};
|
||||
|
||||
@@ -75,7 +75,14 @@ in
|
||||
# Warn if closing shell with running jobs.
|
||||
"checkjobs"
|
||||
];
|
||||
description = "Shell options to set.";
|
||||
example = [
|
||||
"extglob"
|
||||
"-cdspell"
|
||||
];
|
||||
description = ''
|
||||
Shell options to set. Prefix an option with
|
||||
<quote><literal>-</literal></quote> to unset.
|
||||
'';
|
||||
};
|
||||
|
||||
sessionVariables = mkOption {
|
||||
@@ -111,17 +118,6 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
bashrcExtra = mkOption {
|
||||
# Hide for now, may want to rename in the future.
|
||||
visible = false;
|
||||
default = "";
|
||||
type = types.lines;
|
||||
description = ''
|
||||
Extra commands that should be added to
|
||||
<filename>~/.bashrc</filename>.
|
||||
'';
|
||||
};
|
||||
|
||||
initExtra = mkOption {
|
||||
default = "";
|
||||
type = types.lines;
|
||||
@@ -131,6 +127,15 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
bashrcExtra = mkOption {
|
||||
default = "";
|
||||
type = types.lines;
|
||||
description = ''
|
||||
Extra commands that should be placed in <filename>~/.bashrc</filename>.
|
||||
Note that these commands will be run even in non-interactive shells.
|
||||
'';
|
||||
};
|
||||
|
||||
logoutExtra = mkOption {
|
||||
default = "";
|
||||
type = types.lines;
|
||||
@@ -148,8 +153,10 @@ in
|
||||
mapAttrsToList (k: v: "alias ${k}=${escapeShellArg v}") cfg.shellAliases
|
||||
);
|
||||
|
||||
shoptsStr = concatStringsSep "\n" (
|
||||
map (v: "shopt -s ${v}") cfg.shellOptions
|
||||
shoptsStr = let
|
||||
switch = v: if hasPrefix "-" v then "-u" else "-s";
|
||||
in concatStringsSep "\n" (
|
||||
map (v: "shopt ${switch v} ${removePrefix "-" v}") cfg.shellOptions
|
||||
);
|
||||
|
||||
sessionVarsStr = config.lib.shell.exportAll cfg.sessionVariables;
|
||||
@@ -157,10 +164,12 @@ in
|
||||
historyControlStr =
|
||||
concatStringsSep "\n" (mapAttrsToList (n: v: "${n}=${v}") (
|
||||
{
|
||||
HISTFILE = "\"${cfg.historyFile}\"";
|
||||
HISTFILESIZE = toString cfg.historyFileSize;
|
||||
HISTSIZE = toString cfg.historySize;
|
||||
}
|
||||
// optionalAttrs (cfg.historyFile != null) {
|
||||
HISTFILE = "\"${cfg.historyFile}\"";
|
||||
}
|
||||
// optionalAttrs (cfg.historyControl != []) {
|
||||
HISTCONTROL = concatStringsSep ":" cfg.historyControl;
|
||||
}
|
||||
@@ -169,22 +178,7 @@ in
|
||||
}
|
||||
));
|
||||
in mkIf cfg.enable {
|
||||
programs.bash.bashrcExtra = ''
|
||||
# Commands that should be applied only for interactive shells.
|
||||
if [[ $- == *i* ]]; then
|
||||
${historyControlStr}
|
||||
|
||||
${shoptsStr}
|
||||
|
||||
${aliasesStr}
|
||||
|
||||
${cfg.initExtra}
|
||||
fi
|
||||
'';
|
||||
|
||||
home.file.".bash_profile".text = ''
|
||||
# -*- mode: sh -*-
|
||||
|
||||
home.file.".bash_profile".source = pkgs.writeShellScript "bash_profile" ''
|
||||
# include .profile if it exists
|
||||
[[ -f ~/.profile ]] && . ~/.profile
|
||||
|
||||
@@ -192,9 +186,7 @@ in
|
||||
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
||||
'';
|
||||
|
||||
home.file.".profile".text = ''
|
||||
# -*- mode: sh -*-
|
||||
|
||||
home.file.".profile".source = pkgs.writeShellScript "profile" ''
|
||||
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
|
||||
|
||||
${sessionVarsStr}
|
||||
@@ -202,18 +194,23 @@ in
|
||||
${cfg.profileExtra}
|
||||
'';
|
||||
|
||||
home.file.".bashrc".text = ''
|
||||
# -*- mode: sh -*-
|
||||
|
||||
home.file.".bashrc".source = pkgs.writeShellScript "bashrc" ''
|
||||
${cfg.bashrcExtra}
|
||||
|
||||
# Commands that should be applied only for interactive shells.
|
||||
[[ $- == *i* ]] || return
|
||||
|
||||
${historyControlStr}
|
||||
|
||||
${shoptsStr}
|
||||
|
||||
${aliasesStr}
|
||||
|
||||
${cfg.initExtra}
|
||||
'';
|
||||
|
||||
home.file.".bash_logout" = mkIf (cfg.logoutExtra != "") {
|
||||
text = ''
|
||||
# -*- mode: sh -*-
|
||||
|
||||
${cfg.logoutExtra}
|
||||
'';
|
||||
source = pkgs.writeShellScript "bash_logout" cfg.logoutExtra;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
@@ -6,6 +6,11 @@ let
|
||||
|
||||
cfg = config.programs.bat;
|
||||
|
||||
toConfigFile = generators.toKeyValue {
|
||||
mkKeyValue = k: v: "--${k}=${lib.escapeShellArg v}";
|
||||
listsAsDuplicateKeys = true;
|
||||
};
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.marsam ];
|
||||
|
||||
@@ -13,11 +18,12 @@ in {
|
||||
enable = mkEnableOption "bat, a cat clone with wings";
|
||||
|
||||
config = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
type = with types; attrsOf (either str (listOf str));
|
||||
default = { };
|
||||
example = {
|
||||
theme = "TwoDark";
|
||||
pager = "less -FR";
|
||||
map-syntax = [ "*.jenkinsfile:Groovy" "*.props:Java Properties" ];
|
||||
};
|
||||
description = ''
|
||||
Bat configuration.
|
||||
@@ -48,10 +54,8 @@ in {
|
||||
home.packages = [ pkgs.bat ];
|
||||
|
||||
xdg.configFile = mkMerge ([{
|
||||
"bat/config" = mkIf (cfg.config != { }) {
|
||||
text = concatStringsSep "\n"
|
||||
(mapAttrsToList (n: v: ''--${n}="${v}"'') cfg.config);
|
||||
};
|
||||
"bat/config" =
|
||||
mkIf (cfg.config != { }) { text = toConfigFile cfg.config; };
|
||||
}] ++ flip mapAttrsToList cfg.themes
|
||||
(name: body: { "bat/themes/${name}.tmTheme" = { text = body; }; }));
|
||||
};
|
||||
|
||||
@@ -6,6 +6,8 @@ let
|
||||
|
||||
cfg = config.programs.beets;
|
||||
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
|
||||
@@ -39,7 +41,7 @@ in {
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = types.attrs;
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to
|
||||
@@ -52,7 +54,7 @@ in {
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."beets/config.yaml".text =
|
||||
builtins.toJSON config.programs.beets.settings;
|
||||
xdg.configFile."beets/config.yaml".source =
|
||||
yamlFormat.generate "beets-config" cfg.settings;
|
||||
};
|
||||
}
|
||||
|
||||
66
modules/programs/bottom.nix
Normal file
66
modules/programs/bottom.nix
Normal file
@@ -0,0 +1,66 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.bottom;
|
||||
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
|
||||
configDir = if pkgs.stdenv.isDarwin then
|
||||
"Library/Application Support"
|
||||
else
|
||||
config.xdg.configHome;
|
||||
|
||||
in {
|
||||
options = {
|
||||
programs.bottom = {
|
||||
enable = mkEnableOption ''
|
||||
bottom, a cross-platform graphical process/system monitor with a
|
||||
customizable interface'';
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.bottom;
|
||||
defaultText = literalExample "pkgs.bottom";
|
||||
description = "Package providing <command>bottom</command>.";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = tomlFormat.type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to
|
||||
<filename>$XDG_CONFIG_HOME/bottom/bottom.toml</filename> on Linux or
|
||||
<filename>$HOME/Library/Application Support/bottom/bottom.toml</filename> on Darwin.
|
||||
</para><para>
|
||||
See <link xlink:href="https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml"/>
|
||||
for the default configuration.
|
||||
'';
|
||||
example = literalExample ''
|
||||
{
|
||||
flags = {
|
||||
avg_cpu = true;
|
||||
temperature_type = "c";
|
||||
};
|
||||
|
||||
colors = {
|
||||
low_battery_color = "red";
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
home.file."${configDir}/bottom/bottom.toml" = mkIf (cfg.settings != { }) {
|
||||
source = tomlFormat.generate "bottom.toml" cfg.settings;
|
||||
};
|
||||
};
|
||||
|
||||
meta.maintainers = [ maintainers.polykernel ];
|
||||
}
|
||||
@@ -6,21 +6,12 @@ let
|
||||
|
||||
cfg = config.programs.broot;
|
||||
|
||||
configFile = config:
|
||||
pkgs.runCommand "conf.toml" {
|
||||
buildInputs = [ pkgs.remarshal ];
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
} ''
|
||||
remarshal -if json -of toml \
|
||||
< ${pkgs.writeText "verbs.json" (builtins.toJSON config)} \
|
||||
> $out
|
||||
'';
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
|
||||
brootConf = {
|
||||
verbs =
|
||||
mapAttrsToList (name: value: value // { invocation = name; }) cfg.verbs;
|
||||
verbs = cfg.verbs;
|
||||
skin = cfg.skin;
|
||||
modal = cfg.modal;
|
||||
};
|
||||
|
||||
in {
|
||||
@@ -53,42 +44,63 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
modal = mkEnableOption "modal (vim) mode";
|
||||
|
||||
verbs = mkOption {
|
||||
type = with types; attrsOf (attrsOf (either bool str));
|
||||
default = {
|
||||
"p" = { execution = ":parent"; };
|
||||
"edit" = {
|
||||
type = with types; listOf (attrsOf (either bool str));
|
||||
default = [
|
||||
{
|
||||
invocation = "p";
|
||||
execution = ":parent";
|
||||
}
|
||||
{
|
||||
invocation = "edit";
|
||||
shortcut = "e";
|
||||
execution = "$EDITOR {file}";
|
||||
};
|
||||
"create {subpath}" = { execution = "$EDITOR {directory}/{subpath}"; };
|
||||
"view" = { execution = "less {file}"; };
|
||||
};
|
||||
example = literalExample ''
|
||||
}
|
||||
{
|
||||
"p" = { execution = ":parent"; };
|
||||
"edit" = { shortcut = "e"; execution = "$EDITOR {file}" ; };
|
||||
"create {subpath}" = { execution = "$EDITOR {directory}/{subpath}"; };
|
||||
"view" = { execution = "less {file}"; };
|
||||
"blop {name}\\.{type}" = {
|
||||
invocation = "create {subpath}";
|
||||
execution = "$EDITOR {directory}/{subpath}";
|
||||
}
|
||||
{
|
||||
invocation = "view";
|
||||
execution = "less {file}";
|
||||
}
|
||||
];
|
||||
example = literalExample ''
|
||||
[
|
||||
{ invocation = "p"; execution = ":parent"; }
|
||||
{ invocation = "edit"; shortcut = "e"; execution = "$EDITOR {file}" ; }
|
||||
{ invocation = "create {subpath}"; execution = "$EDITOR {directory}/{subpath}"; }
|
||||
{ invocation = "view"; execution = "less {file}"; }
|
||||
{
|
||||
invocation = "blop {name}\\.{type}";
|
||||
execution = "/bin/mkdir {parent}/{type} && /usr/bin/nvim {parent}/{type}/{name}.{type}";
|
||||
from_shell = true;
|
||||
};
|
||||
}
|
||||
}
|
||||
]
|
||||
'';
|
||||
description = ''
|
||||
Define new verbs. The attribute name indicates how the verb is
|
||||
called by the user, with placeholders for arguments.
|
||||
Define new verbs. For more information, see
|
||||
<link xlink:href="https://dystroy.org/broot/documentation/configuration/#verb-definition-attributes"/>.
|
||||
</para><para>
|
||||
The possible attributes are:
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><literal>invocation</literal> (optional)</term>
|
||||
<listitem><para>how the verb is called by the user, with placeholders for arguments</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>execution</literal> (mandatory)</term>
|
||||
<listitem><para>how the verb is executed</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>key</literal> (optional)</term>
|
||||
<listitem><para>a keyboard key triggering execution</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>shortcut</literal> (optional)</term>
|
||||
<listitem><para>an alternate way to call the verb (without
|
||||
@@ -109,6 +121,13 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.broot;
|
||||
defaultText = literalExample "pkgs.broot";
|
||||
description = "Package providing broot";
|
||||
};
|
||||
|
||||
skin = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = { };
|
||||
@@ -167,9 +186,10 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.broot ];
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."broot/conf.toml".source = configFile brootConf;
|
||||
xdg.configFile."broot/conf.toml".source =
|
||||
tomlFormat.generate "broot-config" brootConf;
|
||||
|
||||
# Dummy file to prevent broot from trying to reinstall itself
|
||||
xdg.configFile."broot/launcher/installed-v1".text = "";
|
||||
|
||||
@@ -5,7 +5,9 @@ with lib;
|
||||
let
|
||||
|
||||
browserModule = defaultPkg: name: visible:
|
||||
let browser = (builtins.parseDrvName defaultPkg.name).name;
|
||||
let
|
||||
browser = (builtins.parseDrvName defaultPkg.name).name;
|
||||
isProprietaryChrome = hasPrefix "Google Chrome" name;
|
||||
in {
|
||||
enable = mkOption {
|
||||
inherit visible;
|
||||
@@ -22,23 +24,78 @@ let
|
||||
defaultText = literalExample "pkgs.${browser}";
|
||||
description = "The ${name} package to use.";
|
||||
};
|
||||
|
||||
} // optionalAttrs (!isProprietaryChrome) {
|
||||
# Extensions do not work with Google Chrome
|
||||
# see https://github.com/nix-community/home-manager/issues/1383
|
||||
extensions = mkOption {
|
||||
inherit visible;
|
||||
type = types.listOf types.str;
|
||||
type = with types;
|
||||
let
|
||||
extensionType = submodule {
|
||||
options = {
|
||||
id = mkOption {
|
||||
type = strMatching "[a-zA-Z]{32}";
|
||||
description = ''
|
||||
The extension's ID from the Chome Web Store url or the unpacked crx.
|
||||
'';
|
||||
default = "";
|
||||
};
|
||||
|
||||
updateUrl = mkOption {
|
||||
type = str;
|
||||
description = ''
|
||||
URL of the extension's update manifest XML file. Linux only.
|
||||
'';
|
||||
default = "https://clients2.google.com/service/update2/crx";
|
||||
visible = pkgs.stdenv.isLinux;
|
||||
readOnly = pkgs.stdenv.isDarwin;
|
||||
};
|
||||
|
||||
crxPath = mkOption {
|
||||
type = nullOr path;
|
||||
description = ''
|
||||
Path to the extension's crx file. Linux only.
|
||||
'';
|
||||
default = null;
|
||||
visible = pkgs.stdenv.isLinux;
|
||||
};
|
||||
|
||||
version = mkOption {
|
||||
type = nullOr str;
|
||||
description = ''
|
||||
The extension's version, required for local installation. Linux only.
|
||||
'';
|
||||
default = null;
|
||||
visible = pkgs.stdenv.isLinux;
|
||||
};
|
||||
};
|
||||
};
|
||||
in listOf (coercedTo str (v: { id = v; }) extensionType);
|
||||
default = [ ];
|
||||
example = literalExample ''
|
||||
[
|
||||
"chlffgpmiacpedhhbkiomidkjlcfhogd" # pushbullet
|
||||
"mbniclmhobmnbdlbpiphghaielnnpgdp" # lightshot
|
||||
"gcbommkclmclpchllfjekcdonpmejbdp" # https everywhere
|
||||
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock origin
|
||||
{ id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; } # ublock origin
|
||||
{
|
||||
id = "dcpihecpambacapedldabdbpakmachpb";
|
||||
updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml";
|
||||
}
|
||||
{
|
||||
id = "aaaaaaaaaabbbbbbbbbbcccccccccc";
|
||||
crxPath = "/home/share/extension.crx";
|
||||
version = "1.0";
|
||||
}
|
||||
]
|
||||
'';
|
||||
description = ''
|
||||
List of ${name} extensions to install.
|
||||
To find the extension ID, check its URL on the
|
||||
<link xlink:href="https://chrome.google.com/webstore/category/extensions">Chrome Web Store</link>.
|
||||
</para><para>
|
||||
To install extensions outside of the Chrome Web Store set
|
||||
<literal>updateUrl</literal> or <literal>crxPath</literal> and
|
||||
<literal>version</literal> as explained in the
|
||||
<link xlink:href="https://developer.chrome.com/docs/extensions/mv2/external_extensions">Chrome
|
||||
documentation</link>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
@@ -46,34 +103,51 @@ let
|
||||
browserConfig = cfg:
|
||||
let
|
||||
|
||||
browser = (builtins.parseDrvName cfg.package.name).name;
|
||||
drvName = (builtins.parseDrvName cfg.package.name).name;
|
||||
browser = if drvName == "ungoogled-chromium" then "chromium" else drvName;
|
||||
|
||||
darwinDirs = {
|
||||
chromium = "Chromium";
|
||||
google-chrome = "Google/Chrome";
|
||||
google-chrome-beta = "Google/Chrome Beta";
|
||||
google-chrome-dev = "Google/Chrome Dev";
|
||||
brave = "BraveSoftware/Brave-Browser";
|
||||
};
|
||||
|
||||
linuxDirs = { brave = "BraveSoftware/Brave-Browser"; };
|
||||
|
||||
configDir = if pkgs.stdenv.isDarwin then
|
||||
"Library/Application Support/${getAttr browser darwinDirs}"
|
||||
"Library/Application Support/" + (darwinDirs."${browser}" or browser)
|
||||
else
|
||||
"${config.xdg.configHome}/${browser}";
|
||||
"${config.xdg.configHome}/" + (linuxDirs."${browser}" or browser);
|
||||
|
||||
extensionJson = ext: {
|
||||
name = "${configDir}/External Extensions/${ext}.json";
|
||||
value.text = builtins.toJSON {
|
||||
external_update_url =
|
||||
"https://clients2.google.com/service/update2/crx";
|
||||
extensionJson = ext:
|
||||
assert ext.crxPath != null -> ext.version != null;
|
||||
with builtins; {
|
||||
name = "${configDir}/External Extensions/${ext.id}.json";
|
||||
value.text = toJSON (if ext.crxPath != null then {
|
||||
external_crx = ext.crxPath;
|
||||
external_version = ext.version;
|
||||
} else {
|
||||
external_update_url = ext.updateUrl;
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
in mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
home.file = listToAttrs (map extensionJson cfg.extensions);
|
||||
home.file = listToAttrs (map extensionJson (cfg.extensions or [ ]));
|
||||
};
|
||||
|
||||
in {
|
||||
# Extensions do not work with the proprietary Google Chrome version
|
||||
# see https://github.com/nix-community/home-manager/issues/1383
|
||||
imports = map (flip mkRemovedOptionModule
|
||||
"The `extensions` option does not work on Google Chrome anymore.") [
|
||||
[ "programs" "google-chrome" "extensions" ]
|
||||
[ "programs" "google-chrome-beta" "extensions" ]
|
||||
[ "programs" "google-chrome-dev" "extensions" ]
|
||||
];
|
||||
|
||||
options.programs = {
|
||||
chromium = browserModule pkgs.chromium "Chromium" true;
|
||||
google-chrome = browserModule pkgs.google-chrome "Google Chrome" false;
|
||||
@@ -81,6 +155,7 @@ in {
|
||||
browserModule pkgs.google-chrome-beta "Google Chrome Beta" false;
|
||||
google-chrome-dev =
|
||||
browserModule pkgs.google-chrome-dev "Google Chrome Dev" false;
|
||||
brave = browserModule pkgs.brave "Brave Browser" false;
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
@@ -88,5 +163,6 @@ in {
|
||||
(browserConfig config.programs.google-chrome)
|
||||
(browserConfig config.programs.google-chrome-beta)
|
||||
(browserConfig config.programs.google-chrome-dev)
|
||||
(browserConfig config.programs.brave)
|
||||
];
|
||||
}
|
||||
|
||||
@@ -11,13 +11,8 @@ let
|
||||
dir = "bin";
|
||||
src = ./command-not-found.pl;
|
||||
isExecutable = true;
|
||||
inherit (pkgs) perl;
|
||||
inherit (cfg) dbPath;
|
||||
perlFlags = concatStrings (map (path: "-I ${path}/lib/perl5/site_perl ") [
|
||||
pkgs.perlPackages.DBI
|
||||
pkgs.perlPackages.DBDSQLite
|
||||
pkgs.perlPackages.StringShellQuote
|
||||
]);
|
||||
perl = pkgs.perl.withPackages (p: [ p.DBDSQLite p.StringShellQuote ]);
|
||||
};
|
||||
|
||||
shInit = commandNotFoundHandlerName: ''
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#! @perl@/bin/perl -w @perlFlags@
|
||||
#! @perl@/bin/perl -w
|
||||
|
||||
use strict;
|
||||
use DBI;
|
||||
@@ -29,16 +29,17 @@ if (!defined $res || scalar @$res == 0) {
|
||||
exec("nix-shell", "-p", $package, "--run", shell_quote("exec", @ARGV));
|
||||
} else {
|
||||
print STDERR <<EOF;
|
||||
The program ‘$program’ is currently not installed. You can install it by typing:
|
||||
nix-env -iA nixos.$package
|
||||
The program '$program' is not in your PATH. You can make it available in an
|
||||
ephemeral shell by typing:
|
||||
nix-shell -p $package
|
||||
EOF
|
||||
}
|
||||
} else {
|
||||
print STDERR <<EOF;
|
||||
The program ‘$program’ is currently not installed. It is provided by
|
||||
several packages. You can install it by typing one of the following:
|
||||
The program '$program' is not in your PATH. It is provided by several packages.
|
||||
You can make it available in an ephemeral shell by typing one of the following:
|
||||
EOF
|
||||
print STDERR " nix-env -iA nixos.$_->{package}\n" foreach @$res;
|
||||
print STDERR " nix-shell -p $_->{package}\n" foreach @$res;
|
||||
}
|
||||
|
||||
exit 127;
|
||||
|
||||
@@ -204,8 +204,8 @@ in {
|
||||
};
|
||||
|
||||
home.file.".dir_colors".text = concatStringsSep "\n" ([ ]
|
||||
++ optional (cfg.extraConfig != "") cfg.extraConfig
|
||||
++ mapAttrsToList formatLine cfg.settings) + "\n";
|
||||
++ mapAttrsToList formatLine cfg.settings ++ [ "" ]
|
||||
++ optional (cfg.extraConfig != "") cfg.extraConfig);
|
||||
|
||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
|
||||
eval $(${pkgs.coreutils}/bin/dircolors -b ~/.dir_colors)
|
||||
|
||||
@@ -5,25 +5,25 @@ with lib;
|
||||
let
|
||||
|
||||
cfg = config.programs.direnv;
|
||||
configFile = config:
|
||||
pkgs.runCommand "config.toml" {
|
||||
buildInputs = [ pkgs.remarshal ];
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
} ''
|
||||
remarshal -if json -of toml \
|
||||
< ${pkgs.writeText "config.json" (builtins.toJSON config)} \
|
||||
> $out
|
||||
'';
|
||||
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
|
||||
in {
|
||||
imports = [
|
||||
(mkRenamedOptionModule [
|
||||
"programs"
|
||||
"direnv"
|
||||
"enableNixDirenvIntegration"
|
||||
] [ "programs" "direnv" "nix-direnv" "enable" ])
|
||||
];
|
||||
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
|
||||
options.programs.direnv = {
|
||||
enable = mkEnableOption "direnv, the environment switcher";
|
||||
|
||||
config = mkOption {
|
||||
type = types.attrs;
|
||||
type = tomlFormat.type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to
|
||||
@@ -71,22 +71,29 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
enableNixDirenvIntegration = mkEnableOption ''
|
||||
<link
|
||||
xlink:href="https://github.com/nix-community/nix-direnv">nix-direnv</link>,
|
||||
a fast, persistent use_nix implementation for direnv'';
|
||||
nix-direnv = {
|
||||
enable = mkEnableOption ''
|
||||
<link
|
||||
xlink:href="https://github.com/nix-community/nix-direnv">nix-direnv</link>,
|
||||
a fast, persistent use_nix implementation for direnv'';
|
||||
enableFlakes = mkEnableOption "Flake support in nix-direnv";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.direnv ];
|
||||
|
||||
xdg.configFile."direnv/config.toml" =
|
||||
mkIf (cfg.config != { }) { source = configFile cfg.config; };
|
||||
xdg.configFile."direnv/config.toml" = mkIf (cfg.config != { }) {
|
||||
source = tomlFormat.generate "direnv-config" cfg.config;
|
||||
};
|
||||
|
||||
xdg.configFile."direnv/direnvrc" = let
|
||||
package =
|
||||
pkgs.nix-direnv.override { inherit (cfg.nix-direnv) enableFlakes; };
|
||||
text = concatStringsSep "\n" (optional (cfg.stdlib != "") cfg.stdlib
|
||||
++ optional cfg.enableNixDirenvIntegration
|
||||
"source ${pkgs.nix-direnv}/share/nix-direnv/direnvrc");
|
||||
++ optional cfg.nix-direnv.enable
|
||||
"source ${package}/share/nix-direnv/direnvrc");
|
||||
in mkIf (text != "") { inherit text; };
|
||||
|
||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration (
|
||||
@@ -101,7 +108,7 @@ in {
|
||||
'';
|
||||
|
||||
programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
|
||||
eval (${pkgs.direnv}/bin/direnv hook fish)
|
||||
${pkgs.direnv}/bin/direnv hook fish | source
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,13 +6,15 @@ let
|
||||
|
||||
cfg = config.programs.emacs;
|
||||
|
||||
# Copied from all-packages.nix, with modifications to support
|
||||
# overrides.
|
||||
emacsPackages = let epkgs = pkgs.emacsPackagesFor cfg.package;
|
||||
in epkgs.overrideScope' cfg.overrides;
|
||||
|
||||
emacsPackages = cfg.package.pkgs.overrideScope' cfg.overrides;
|
||||
emacsWithPackages = emacsPackages.emacsWithPackages;
|
||||
|
||||
createConfPackage = epkgs:
|
||||
epkgs.trivialBuild {
|
||||
pname = "default";
|
||||
src = pkgs.writeText "default.el" cfg.extraConfig;
|
||||
};
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
|
||||
@@ -28,6 +30,23 @@ in {
|
||||
description = "The Emacs package to use.";
|
||||
};
|
||||
|
||||
# NOTE: The config is placed in default.el instead of ~/.emacs.d so that
|
||||
# it won't conflict with Emacs configuration frameworks. Users of these
|
||||
# frameworks would still benefit from this option as it would easily allow
|
||||
# them to have Nix-computed paths in their configuration.
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
example = ''
|
||||
(setq standard-indent 2)
|
||||
'';
|
||||
description = ''
|
||||
Configuration to include in the Emacs default init file. See
|
||||
<link xlink:href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Init-File.html"/>
|
||||
for more.
|
||||
'';
|
||||
};
|
||||
|
||||
extraPackages = mkOption {
|
||||
default = self: [ ];
|
||||
type = hm.types.selectorFunction;
|
||||
@@ -68,6 +87,10 @@ in {
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.finalPackage ];
|
||||
programs.emacs.finalPackage = emacsWithPackages cfg.extraPackages;
|
||||
programs.emacs = {
|
||||
finalPackage = emacsWithPackages cfg.extraPackages;
|
||||
extraPackages = epkgs:
|
||||
optional (cfg.extraConfig != "") (createConfPackage epkgs);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
36
modules/programs/exa.nix
Normal file
36
modules/programs/exa.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.exa;
|
||||
|
||||
aliases = {
|
||||
ls = "${pkgs.exa}/bin/exa";
|
||||
ll = "${pkgs.exa}/bin/exa -l";
|
||||
la = "${pkgs.exa}/bin/exa -a";
|
||||
lt = "${pkgs.exa}/bin/exa --tree";
|
||||
lla = "${pkgs.exa}/bin/exa -la";
|
||||
};
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.kalhauge ];
|
||||
|
||||
options.programs.exa = {
|
||||
enable =
|
||||
mkEnableOption "exa, a modern replacement for <command>ls</command>";
|
||||
enableAliases = mkEnableOption "recommended exa aliases";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.exa ];
|
||||
|
||||
programs.bash.shellAliases = mkIf cfg.enableAliases aliases;
|
||||
|
||||
programs.zsh.shellAliases = mkIf cfg.enableAliases aliases;
|
||||
|
||||
programs.fish.shellAliases = mkIf cfg.enableAliases aliases;
|
||||
|
||||
};
|
||||
}
|
||||
@@ -9,19 +9,15 @@ let
|
||||
cfg = config.programs.firefox;
|
||||
|
||||
mozillaConfigPath =
|
||||
if isDarwin
|
||||
then "Library/Application Support/Mozilla"
|
||||
else ".mozilla";
|
||||
if isDarwin then "Library/Application Support/Mozilla" else ".mozilla";
|
||||
|
||||
firefoxConfigPath =
|
||||
if isDarwin
|
||||
then "Library/Application Support/Firefox"
|
||||
else "${mozillaConfigPath}/firefox";
|
||||
firefoxConfigPath = if isDarwin then
|
||||
"Library/Application Support/Firefox"
|
||||
else
|
||||
"${mozillaConfigPath}/firefox";
|
||||
|
||||
profilesPath =
|
||||
if isDarwin
|
||||
then "${firefoxConfigPath}/Profiles"
|
||||
else firefoxConfigPath;
|
||||
if isDarwin then "${firefoxConfigPath}/Profiles" else firefoxConfigPath;
|
||||
|
||||
# The extensions path shared by all profiles; will not be supported
|
||||
# by future Firefox versions.
|
||||
@@ -32,24 +28,17 @@ let
|
||||
paths = cfg.extensions;
|
||||
};
|
||||
|
||||
profiles =
|
||||
flip mapAttrs' cfg.profiles (_: profile:
|
||||
nameValuePair "Profile${toString profile.id}" {
|
||||
Name = profile.name;
|
||||
Path =
|
||||
if isDarwin
|
||||
then "Profiles/${profile.path}"
|
||||
else profile.path;
|
||||
IsRelative = 1;
|
||||
Default = if profile.isDefault then 1 else 0;
|
||||
}
|
||||
) // {
|
||||
General = {
|
||||
StartWithLastProfile = 1;
|
||||
};
|
||||
profiles = flip mapAttrs' cfg.profiles (_: profile:
|
||||
nameValuePair "Profile${toString profile.id}" {
|
||||
Name = profile.name;
|
||||
Path = if isDarwin then "Profiles/${profile.path}" else profile.path;
|
||||
IsRelative = 1;
|
||||
Default = if profile.isDefault then 1 else 0;
|
||||
}) // {
|
||||
General = { StartWithLastProfile = 1; };
|
||||
};
|
||||
|
||||
profilesIni = generators.toINI {} profiles;
|
||||
profilesIni = generators.toINI { } profiles;
|
||||
|
||||
mkUserJs = prefs: extraPrefs: ''
|
||||
// Generated by Home Manager.
|
||||
@@ -61,15 +50,15 @@ let
|
||||
${extraPrefs}
|
||||
'';
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
in {
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
|
||||
imports = [
|
||||
(mkRemovedOptionModule ["programs" "firefox" "enableGoogleTalk"]
|
||||
(mkRemovedOptionModule [ "programs" "firefox" "enableAdobeFlash" ]
|
||||
"Support for this option has been removed.")
|
||||
(mkRemovedOptionModule ["programs" "firefox" "enableIcedTea"]
|
||||
(mkRemovedOptionModule [ "programs" "firefox" "enableGoogleTalk" ]
|
||||
"Support for this option has been removed.")
|
||||
(mkRemovedOptionModule [ "programs" "firefox" "enableIcedTea" ]
|
||||
"Support for this option has been removed.")
|
||||
];
|
||||
|
||||
@@ -79,11 +68,22 @@ in
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default =
|
||||
if versionAtLeast config.home.stateVersion "19.09"
|
||||
then pkgs.firefox
|
||||
else pkgs.firefox-unwrapped;
|
||||
default = if versionAtLeast config.home.stateVersion "19.09" then
|
||||
pkgs.firefox
|
||||
else
|
||||
pkgs.firefox-unwrapped;
|
||||
defaultText = literalExample "pkgs.firefox";
|
||||
example = literalExample ''
|
||||
pkgs.firefox.override {
|
||||
# See nixpkgs' firefox/wrapper.nix to check which options you can use
|
||||
cfg = {
|
||||
# Gnome shell native connector
|
||||
enableGnomeExtensions = true;
|
||||
# Tridactyl native connector
|
||||
enableTridactylNative = true;
|
||||
};
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
The Firefox package to use. If state version ≥ 19.09 then
|
||||
this should be a wrapped Firefox package. For earlier state
|
||||
@@ -93,7 +93,7 @@ in
|
||||
|
||||
extensions = mkOption {
|
||||
type = types.listOf types.package;
|
||||
default = [];
|
||||
default = [ ];
|
||||
example = literalExample ''
|
||||
with pkgs.nur.repos.rycee.firefox-addons; [
|
||||
https-everywhere
|
||||
@@ -128,7 +128,7 @@ in
|
||||
};
|
||||
|
||||
profiles = mkOption {
|
||||
type = types.attrsOf (types.submodule ({config, name, ...}: {
|
||||
type = types.attrsOf (types.submodule ({ config, name, ... }: {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
@@ -146,7 +146,7 @@ in
|
||||
|
||||
settings = mkOption {
|
||||
type = with types; attrsOf (either bool (either int str));
|
||||
default = {};
|
||||
default = { };
|
||||
example = literalExample ''
|
||||
{
|
||||
"browser.startup.homepage" = "https://nixos.org";
|
||||
@@ -211,16 +211,10 @@ in
|
||||
};
|
||||
};
|
||||
}));
|
||||
default = {};
|
||||
default = { };
|
||||
description = "Attribute set of Firefox profiles.";
|
||||
};
|
||||
|
||||
enableAdobeFlash = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether to enable the unfree Adobe Flash plugin.";
|
||||
};
|
||||
|
||||
enableGnomeExtensions = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
@@ -236,96 +230,83 @@ in
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
(
|
||||
let
|
||||
defaults =
|
||||
catAttrs "name" (filter (a: a.isDefault) (attrValues cfg.profiles));
|
||||
in {
|
||||
assertion = cfg.profiles == {} || length defaults == 1;
|
||||
message =
|
||||
"Must have exactly one default Firefox profile but found "
|
||||
+ toString (length defaults)
|
||||
+ optionalString (length defaults > 1)
|
||||
(", namely " + concatStringsSep ", " defaults);
|
||||
}
|
||||
)
|
||||
(let
|
||||
defaults =
|
||||
catAttrs "name" (filter (a: a.isDefault) (attrValues cfg.profiles));
|
||||
in {
|
||||
assertion = cfg.profiles == { } || length defaults == 1;
|
||||
message = "Must have exactly one default Firefox profile but found "
|
||||
+ toString (length defaults) + optionalString (length defaults > 1)
|
||||
(", namely " + concatStringsSep ", " defaults);
|
||||
})
|
||||
|
||||
(
|
||||
let
|
||||
duplicates =
|
||||
filterAttrs (_: v: length v != 1)
|
||||
(zipAttrs
|
||||
(mapAttrsToList (n: v: { "${toString v.id}" = n; })
|
||||
(cfg.profiles)));
|
||||
(let
|
||||
duplicates = filterAttrs (_: v: length v != 1) (zipAttrs
|
||||
(mapAttrsToList (n: v: { "${toString v.id}" = n; }) (cfg.profiles)));
|
||||
|
||||
mkMsg = n: v: " - ID ${n} is used by ${concatStringsSep ", " v}";
|
||||
in {
|
||||
assertion = duplicates == {};
|
||||
message =
|
||||
"Must not have Firefox profiles with duplicate IDs but\n"
|
||||
+ concatStringsSep "\n" (mapAttrsToList mkMsg duplicates);
|
||||
}
|
||||
)
|
||||
mkMsg = n: v: " - ID ${n} is used by ${concatStringsSep ", " v}";
|
||||
in {
|
||||
assertion = duplicates == { };
|
||||
message = ''
|
||||
Must not have Firefox profiles with duplicate IDs but
|
||||
'' + concatStringsSep "\n" (mapAttrsToList mkMsg duplicates);
|
||||
})
|
||||
];
|
||||
|
||||
home.packages =
|
||||
let
|
||||
# The configuration expected by the Firefox wrapper.
|
||||
fcfg = {
|
||||
enableAdobeFlash = cfg.enableAdobeFlash;
|
||||
enableGnomeExtensions = cfg.enableGnomeExtensions;
|
||||
warnings = optional (cfg.enableGnomeExtensions or false) ''
|
||||
Using 'programs.firefox.enableGnomeExtensions' has been deprecated and
|
||||
will be removed in the future. Please change to overriding the package
|
||||
configuration using 'programs.firefox.package' instead. You can refer to
|
||||
its example for how to do this.
|
||||
'';
|
||||
|
||||
home.packages = let
|
||||
# The configuration expected by the Firefox wrapper.
|
||||
fcfg = { enableGnomeExtensions = cfg.enableGnomeExtensions; };
|
||||
|
||||
# A bit of hackery to force a config into the wrapper.
|
||||
browserName = cfg.package.browserName or (builtins.parseDrvName
|
||||
cfg.package.name).name;
|
||||
|
||||
# The configuration expected by the Firefox wrapper builder.
|
||||
bcfg = setAttrByPath [ browserName ] fcfg;
|
||||
|
||||
package = if isDarwin then
|
||||
cfg.package
|
||||
else if versionAtLeast config.home.stateVersion "19.09" then
|
||||
cfg.package.override (old: { cfg = old.cfg or { } // fcfg; })
|
||||
else
|
||||
(pkgs.wrapFirefox.override { config = bcfg; }) cfg.package { };
|
||||
in [ package ];
|
||||
|
||||
home.file = mkMerge ([{
|
||||
"${mozillaConfigPath}/${extensionPath}" = mkIf (cfg.extensions != [ ]) {
|
||||
source = "${extensionsEnvPkg}/share/mozilla/${extensionPath}";
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
"${firefoxConfigPath}/profiles.ini" =
|
||||
mkIf (cfg.profiles != { }) { text = profilesIni; };
|
||||
}] ++ flip mapAttrsToList cfg.profiles (_: profile: {
|
||||
"${profilesPath}/${profile.path}/.keep".text = "";
|
||||
|
||||
"${profilesPath}/${profile.path}/chrome/userChrome.css" =
|
||||
mkIf (profile.userChrome != "") { text = profile.userChrome; };
|
||||
|
||||
"${profilesPath}/${profile.path}/chrome/userContent.css" =
|
||||
mkIf (profile.userContent != "") { text = profile.userContent; };
|
||||
|
||||
"${profilesPath}/${profile.path}/user.js" =
|
||||
mkIf (profile.settings != { } || profile.extraConfig != "") {
|
||||
text = mkUserJs profile.settings profile.extraConfig;
|
||||
};
|
||||
|
||||
# A bit of hackery to force a config into the wrapper.
|
||||
browserName = cfg.package.browserName
|
||||
or (builtins.parseDrvName cfg.package.name).name;
|
||||
|
||||
# The configuration expected by the Firefox wrapper builder.
|
||||
bcfg = setAttrByPath [browserName] fcfg;
|
||||
|
||||
package =
|
||||
if isDarwin then
|
||||
cfg.package
|
||||
else if versionAtLeast config.home.stateVersion "19.09" then
|
||||
cfg.package.override { cfg = fcfg; }
|
||||
else
|
||||
(pkgs.wrapFirefox.override { config = bcfg; }) cfg.package { };
|
||||
in
|
||||
[ package ];
|
||||
|
||||
home.file = mkMerge (
|
||||
[{
|
||||
"${mozillaConfigPath}/${extensionPath}" = mkIf (cfg.extensions != []) {
|
||||
source = "${extensionsEnvPkg}/share/mozilla/${extensionPath}";
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
"${firefoxConfigPath}/profiles.ini" = mkIf (cfg.profiles != {}) {
|
||||
text = profilesIni;
|
||||
};
|
||||
}]
|
||||
++ flip mapAttrsToList cfg.profiles (_: profile: {
|
||||
"${profilesPath}/${profile.path}/chrome/userChrome.css" =
|
||||
mkIf (profile.userChrome != "") {
|
||||
text = profile.userChrome;
|
||||
};
|
||||
|
||||
"${profilesPath}/${profile.path}/chrome/userContent.css" =
|
||||
mkIf (profile.userContent != "") {
|
||||
text = profile.userContent;
|
||||
};
|
||||
|
||||
"${profilesPath}/${profile.path}/user.js" =
|
||||
mkIf (profile.settings != {} || profile.extraConfig != "") {
|
||||
text = mkUserJs profile.settings profile.extraConfig;
|
||||
};
|
||||
|
||||
"${profilesPath}/${profile.path}/extensions" = mkIf (cfg.extensions != []) {
|
||||
"${profilesPath}/${profile.path}/extensions" =
|
||||
mkIf (cfg.extensions != [ ]) {
|
||||
source = "${extensionsEnvPkg}/share/mozilla/${extensionPath}";
|
||||
recursive = true;
|
||||
force = true;
|
||||
};
|
||||
})
|
||||
);
|
||||
}));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -164,8 +164,8 @@ in {
|
||||
default = { };
|
||||
example = literalExample ''
|
||||
{
|
||||
ll = "ls -l";
|
||||
".." = "cd ..";
|
||||
g = "git";
|
||||
"..." = "cd ../..";
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
@@ -343,7 +343,12 @@ in {
|
||||
# if we haven't sourced the general config, do it
|
||||
if not set -q __fish_general_config_sourced
|
||||
|
||||
set -p fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions
|
||||
set --prepend fish_function_path ${
|
||||
if pkgs ? fishPlugins && pkgs.fishPlugins ? foreign-env then
|
||||
"${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d"
|
||||
else
|
||||
"${pkgs.fish-foreign-env}/share/fish-foreign-env/functions"
|
||||
}
|
||||
fenv source ${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh > /dev/null
|
||||
set -e fish_function_path[1]
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user