mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
Compare commits
419 Commits
release-20
...
lieer-notm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1eb2dcf3a9 | ||
|
|
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 | ||
|
|
249e31b656 | ||
|
|
0261950395 | ||
|
|
1066e01707 | ||
|
|
61e63c10dc | ||
|
|
5125fc0a47 | ||
|
|
cabf9ddd98 | ||
|
|
612afee126 | ||
|
|
072a6ea333 | ||
|
|
a98ec6ec15 | ||
|
|
c8746fb588 | ||
|
|
99fbae0ec5 | ||
|
|
b5291e995f | ||
|
|
28eb093a1e | ||
|
|
abaebf3b34 | ||
|
|
9bf1f40af1 | ||
|
|
22a3a5651d | ||
|
|
308ee310de | ||
|
|
0778a80ee0 | ||
|
|
10df7a7eee | ||
|
|
9cf5f764e1 | ||
|
|
014d8deb60 | ||
|
|
1c4ced745c | ||
|
|
731959ef0e | ||
|
|
18429f1d1d | ||
|
|
77913ff17e | ||
|
|
dc5239b5ce | ||
|
|
c5e47e25a6 | ||
|
|
e7d5531cfa | ||
|
|
aecd4acfb4 | ||
|
|
18a05a9604 | ||
|
|
7339784e07 | ||
|
|
0e9b6e6dc9 | ||
|
|
fc5619764e | ||
|
|
57518cd0bf | ||
|
|
b584745506 | ||
|
|
473d9acdad | ||
|
|
8537920706 | ||
|
|
7e5fee4268 | ||
|
|
0006da1381 | ||
|
|
9ff2188c5d | ||
|
|
da6077a899 | ||
|
|
41147ae09a | ||
|
|
6fed10a09a | ||
|
|
f0fc2a8702 | ||
|
|
521a808151 | ||
|
|
abfb4cde51 | ||
|
|
43ab2f40b9 | ||
|
|
690d93c22a | ||
|
|
8a160f01ab | ||
|
|
a6a3abb295 | ||
|
|
84bcce3c25 | ||
|
|
96d7de6db1 | ||
|
|
9b1b55ba02 | ||
|
|
b3498cccb3 | ||
|
|
92c682cd10 | ||
|
|
472ca211ca | ||
|
|
812b64d4d3 | ||
|
|
605a8fc92e | ||
|
|
b819d2cc41 | ||
|
|
1f04af74f2 | ||
|
|
249650a07e | ||
|
|
4ebb7d1715 | ||
|
|
1a6d6b8ace | ||
|
|
f146620897 | ||
|
|
41b1af808f | ||
|
|
182454fe6b | ||
|
|
a063b73d5c | ||
|
|
d3aee544b6 | ||
|
|
bd4c2b0651 | ||
|
|
1f34c048b3 | ||
|
|
bfc66df13d | ||
|
|
1ed8e7ef98 | ||
|
|
e6e49ad73c | ||
|
|
0399839271 | ||
|
|
4b702bf6b7 | ||
|
|
4fe5afa755 | ||
|
|
209fb62d49 | ||
|
|
6cf6b587b5 | ||
|
|
a79d31fcfd | ||
|
|
0869e23700 | ||
|
|
625b92cbba | ||
|
|
9854342b9f | ||
|
|
a3dd580adc | ||
|
|
2bcd96928e | ||
|
|
2c6a023744 | ||
|
|
9a473b693a | ||
|
|
f4f9f1a618 | ||
|
|
2a54c353a9 | ||
|
|
96e2f1bdf0 | ||
|
|
3886f8db33 | ||
|
|
baea46c5ac | ||
|
|
fceef469c2 | ||
|
|
ae8f432a75 | ||
|
|
e1fbb74b41 | ||
|
|
d1f4d1514d | ||
|
|
861690ff29 | ||
|
|
223e3c38a1 | ||
|
|
9c0fe3957b | ||
|
|
152769aed9 | ||
|
|
dbf6b2d2ab | ||
|
|
f119d4d142 | ||
|
|
79a2320fd0 | ||
|
|
bb6eb9b13e | ||
|
|
2e7935767f | ||
|
|
89adfc9f01 | ||
|
|
7b73f84071 | ||
|
|
5cd7865c6c | ||
|
|
3f1be69359 | ||
|
|
83301ca787 | ||
|
|
8ad5580021 | ||
|
|
e2e8b7371d | ||
|
|
4bd0ca2cd7 | ||
|
|
5c639ff68a | ||
|
|
a49ce0e9ed | ||
|
|
1a8ab9d9de | ||
|
|
e0fb488e57 | ||
|
|
05565a0145 | ||
|
|
5f189acce4 | ||
|
|
7dc322c1eb | ||
|
|
8736190743 | ||
|
|
7f7348b470 | ||
|
|
58716b7541 | ||
|
|
600f39f966 | ||
|
|
a94c8b072e | ||
|
|
5a15f3833d | ||
|
|
54b69d2ef8 | ||
|
|
8f2342e13a | ||
|
|
8ab1139891 | ||
|
|
1f174f6681 | ||
|
|
bf7297d55c | ||
|
|
ad4f33cfc4 | ||
|
|
ecb93ab9ae | ||
|
|
dc227b579d | ||
|
|
7682eb88c4 | ||
|
|
b0e8a1569e | ||
|
|
1b210e7143 | ||
|
|
bb567e20b3 | ||
|
|
507e446475 | ||
|
|
478022afad | ||
|
|
edc3bede6e | ||
|
|
21fbc5e5ad | ||
|
|
43ef16c3e1 | ||
|
|
561b3d5650 | ||
|
|
a3cb63265d | ||
|
|
4ba9cedd68 | ||
|
|
6f683d9726 | ||
|
|
2209d3cb51 | ||
|
|
3815248786 | ||
|
|
02c1f8d416 | ||
|
|
c378c1cbcd | ||
|
|
89be0943e1 | ||
|
|
abcddfe090 | ||
|
|
5a97bf30d4 | ||
|
|
b33802ca7f | ||
|
|
575cd4b8ba | ||
|
|
68b931aef8 | ||
|
|
2dbe637478 | ||
|
|
479274775f | ||
|
|
ba91ac5948 | ||
|
|
cca5161289 | ||
|
|
354344d971 | ||
|
|
248dc17394 | ||
|
|
410d2febbb | ||
|
|
42fd47b246 | ||
|
|
46cd37abc9 | ||
|
|
b2a7d24770 | ||
|
|
3b33862b04 | ||
|
|
85748171ec | ||
|
|
0ee5c9536b | ||
|
|
ca6fcc92a1 | ||
|
|
8e8210b441 | ||
|
|
a21c97d011 | ||
|
|
dd50dc4c13 | ||
|
|
b567d27394 | ||
|
|
d64fff1fe0 | ||
|
|
c8b73e415a | ||
|
|
728c3eba67 | ||
|
|
a505bb5253 | ||
|
|
8bbefa77f7 | ||
|
|
3a80ece9fa | ||
|
|
fe59b5bbc7 | ||
|
|
8af92f844f | ||
|
|
f36c8a09e6 | ||
|
|
0e2858af94 | ||
|
|
5ba71ef91f | ||
|
|
a957e2dc6b | ||
|
|
99a97c917a | ||
|
|
09304026ae | ||
|
|
b95ad63201 | ||
|
|
2ed978eb79 | ||
|
|
31ed6f1604 | ||
|
|
ac6235e53d | ||
|
|
f90b86b577 | ||
|
|
1c71bd1242 | ||
|
|
a0d9a58616 | ||
|
|
d99f54b51b | ||
|
|
4d49cee194 | ||
|
|
dcbe0f2a31 | ||
|
|
cc48e15f28 | ||
|
|
a43e7112e5 | ||
|
|
6c7a031367 | ||
|
|
645149d77b | ||
|
|
9ec9f004e1 | ||
|
|
0fe984d575 | ||
|
|
69f8e47e9e | ||
|
|
db6e261794 | ||
|
|
5cfc9fed79 | ||
|
|
40b1c5c448 | ||
|
|
e9945ee6ee | ||
|
|
cca024da2b | ||
|
|
1ec45b11ab | ||
|
|
4ae188bfc7 | ||
|
|
7f4053084c | ||
|
|
37202a1b70 | ||
|
|
b886cbea0b | ||
|
|
9f396fddc6 | ||
|
|
2434984336 | ||
|
|
1afa5e257b | ||
|
|
cba7b6ee6e | ||
|
|
03b4f81679 | ||
|
|
1dd226fde7 | ||
|
|
ded327b9fc | ||
|
|
ecc1f2310c | ||
|
|
866d7d5152 | ||
|
|
91551c09d4 | ||
|
|
70f7c9f355 | ||
|
|
10673bff4c | ||
|
|
642d9ffe24 | ||
|
|
8b82f52e75 | ||
|
|
a7cdfaa325 | ||
|
|
a6037a9eb8 | ||
|
|
23220d43f3 | ||
|
|
ad8b644de1 | ||
|
|
95b95b1407 | ||
|
|
cfaf213980 | ||
|
|
5baa0c300f | ||
|
|
2d88cbe496 | ||
|
|
8369624512 | ||
|
|
ee1c40e5c5 | ||
|
|
2f2a4396c6 | ||
|
|
cb17f1ede2 |
101
.github/CODEOWNERS
vendored
101
.github/CODEOWNERS
vendored
@@ -1,5 +1,7 @@
|
||||
* @rycee
|
||||
|
||||
/flake.nix @bqv @kisik21
|
||||
|
||||
/modules/home-environment.nix @rycee
|
||||
|
||||
/modules/misc/dconf.nix @gnidorah @rycee
|
||||
@@ -9,8 +11,14 @@
|
||||
|
||||
/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
|
||||
/tests/modules/misc/numlock @evanjs
|
||||
|
||||
/modules/misc/pam.nix @rycee
|
||||
/tests/modules/misc/pam @rycee
|
||||
|
||||
@@ -18,10 +26,19 @@
|
||||
|
||||
/modules/misc/submodule-support.nix @rycee
|
||||
|
||||
/modules/misc/tmpfiles.nix @dawidsowa
|
||||
|
||||
/modules/misc/vte.nix @rycee
|
||||
|
||||
/modules/misc/xdg-mime-apps.nix @pacien
|
||||
|
||||
/modules/misc/xdg-user-dirs.nix @pacien
|
||||
|
||||
/modules/programs/aria2.nix @JustinLovinger
|
||||
|
||||
/modules/programs/autojump.nix @evanjs
|
||||
/tests/modules/programs/autojump @evanjs
|
||||
|
||||
/modules/programs/autorandr.nix @uvNikita
|
||||
|
||||
/modules/programs/bash.nix @rycee
|
||||
@@ -32,6 +49,8 @@
|
||||
|
||||
/modules/programs/broot.nix @aheaume
|
||||
|
||||
/modules/programs/dircolors.nix @JustinLovinger
|
||||
|
||||
/modules/programs/direnv.nix @rycee
|
||||
|
||||
/modules/programs/eclipse.nix @rycee
|
||||
@@ -40,6 +59,9 @@
|
||||
|
||||
/modules/programs/firefox.nix @rycee
|
||||
|
||||
/modules/programs/gh.nix @Gerschtli
|
||||
/tests/modules/programs/gh @Gerschtli
|
||||
|
||||
/modules/programs/git.nix @rycee
|
||||
|
||||
/modules/programs/gnome-terminal.nix @rycee
|
||||
@@ -48,22 +70,49 @@
|
||||
|
||||
/modules/programs/home-manager.nix @rycee
|
||||
|
||||
/modules/programs/i3status.nix @JustinLovinger
|
||||
|
||||
/modules/programs/i3status-rust.nix @workflow
|
||||
|
||||
/modules/programs/keychain.nix @marsam
|
||||
|
||||
/modules/programs/lesspipe.nix @rycee
|
||||
|
||||
/modules/programs/lf.nix @owm111
|
||||
/tests/modules/programs/lf @owm111
|
||||
|
||||
/modules/programs/lieer.nix @tadfisher
|
||||
|
||||
/modules/programs/lsd.nix @marsam
|
||||
|
||||
/modules/programs/matplotlib.nix @rprospero
|
||||
|
||||
/modules/programs/mpv.nix @tadeokondrak
|
||||
/modules/programs/mbsync.nix @KarlJoad
|
||||
/tests/modules/programs/mbsync @KarlJoad
|
||||
|
||||
/modules/programs/mcfly.nix @marsam
|
||||
|
||||
/modules/programs/mpv.nix @tadeokondrak @thiagokokada
|
||||
/tests/modules/programs/mpv @thiagokokada
|
||||
|
||||
/modules/programs/mu.nix @KarlJoad
|
||||
|
||||
/modules/programs/ncmpcpp.nix @olmokramer
|
||||
/tests/modules/programs/ncmpcpp @olmokramer
|
||||
/tests/modules/programs/ncmpcpp-linux @olmokramer
|
||||
|
||||
/modules/programs/ne.nix @cwyc
|
||||
/tests/modules/programs/ne @cwyc
|
||||
|
||||
/modules/programs/noti.nix @marsam
|
||||
|
||||
/modules/programs/nushell.nix @Philipp-M
|
||||
/tests/modules/programs/nushell @Philipp-M
|
||||
|
||||
/modules/programs/obs-studio.nix @adisbladis
|
||||
|
||||
/modules/programs/octant.nix @06kellyjac
|
||||
|
||||
/modules/programs/opam.nix @marsam
|
||||
|
||||
/modules/programs/openssh.nix @rycee
|
||||
@@ -74,24 +123,53 @@
|
||||
|
||||
/modules/programs/pidgin.nix @rycee
|
||||
|
||||
/modules/programs/powerline-go.nix @DamienCassou
|
||||
|
||||
/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/ssh.nix @rycee
|
||||
|
||||
/modules/programs/starship.nix @marsam
|
||||
|
||||
/modules/programs/texlive.nix @rycee
|
||||
|
||||
/modules/programs/waybar.nix @berbiche
|
||||
/tests/modules/programs/waybar @berbiche
|
||||
|
||||
/modules/programs/z-lua.nix @marsam
|
||||
|
||||
/modules/programs/zathura.nix @rprospero
|
||||
|
||||
/modules/programs/zoxide.nix @marsam
|
||||
|
||||
/modules/programs/zsh/prezto.nix @NickHu
|
||||
|
||||
/modules/services/caffeine.nix @uvNikita
|
||||
|
||||
/modules/services/cbatticon.nix @pmiddend
|
||||
|
||||
/modules/services/clipmenu.nix @DamienCassou
|
||||
|
||||
/modules/services/dropbox.nix @eyJhb
|
||||
/tests/modules/services/dropbox @eyJhb
|
||||
|
||||
/modules/services/dunst.nix @rycee
|
||||
|
||||
/modules/services/emacs.nix @tadfisher
|
||||
|
||||
/modules/services/flameshot.nix @moredhel
|
||||
|
||||
/modules/services/fluidsynth.nix @Valodim
|
||||
|
||||
/modules/services/gnome-keyring.nix @rycee
|
||||
|
||||
/modules/services/gpg-agent.nix @rycee
|
||||
@@ -102,6 +180,9 @@
|
||||
|
||||
/modules/services/imapnotify.nix @nickhu
|
||||
|
||||
/modules/services/kanshi.nix @nurelin
|
||||
/tests/modules/services/kanshi @nurelin
|
||||
|
||||
/modules/services/kdeconnect.nix @adisbladis
|
||||
|
||||
/modules/services/keepassx.nix @rycee
|
||||
@@ -126,9 +207,20 @@
|
||||
|
||||
/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/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
|
||||
|
||||
@@ -144,6 +236,11 @@
|
||||
|
||||
/modules/services/unison.nix @pacien
|
||||
|
||||
/modules/services/window-managers/i3-sway/sway.nix @alexarice
|
||||
|
||||
/modules/services/wlsunset.nix @matrss
|
||||
/tests/modules/services/wlsunset @matrss
|
||||
|
||||
/modules/services/xcape.nix @nickhu
|
||||
|
||||
/modules/services/xembed-sni-proxy.nix @rycee
|
||||
|
||||
38
.github/ISSUE_TEMPLATE.md
vendored
Normal file
38
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<!--
|
||||
|
||||
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.
|
||||
-->
|
||||
28
.github/PULL_REQUEST_TEMPLATE.md
vendored
28
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,21 +1,31 @@
|
||||
### Description
|
||||
|
||||
<!--
|
||||
|
||||
Please fill the description and checklist to the best of your
|
||||
ability.
|
||||
Please provide a brief description of your change.
|
||||
|
||||
-->
|
||||
|
||||
### Description
|
||||
|
||||
|
||||
|
||||
### Checklist
|
||||
|
||||
<!--
|
||||
|
||||
Please go through the following checklist before opening a non-WIP
|
||||
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
|
||||
|
||||
-->
|
||||
|
||||
- [ ] Change is backwards compatible.
|
||||
|
||||
- [ ] Code formatted with `./format`.
|
||||
|
||||
- [ ] Code tested through `nix-shell --pure tests -A run.all`.
|
||||
|
||||
- [ ] Test cases updated/added. See [example](https://github.com/rycee/home-manager/commit/f3fbb50b68df20da47f9b0def5607857fcc0d021#diff-b61a6d542f9036550ba9c401c80f00ef).
|
||||
- [ ] Test cases updated/added. See [example](https://github.com/nix-community/home-manager/commit/f3fbb50b68df20da47f9b0def5607857fcc0d021#diff-b61a6d542f9036550ba9c401c80f00ef).
|
||||
|
||||
- [ ] Commit messages are formatted like
|
||||
|
||||
@@ -25,10 +35,10 @@
|
||||
{long description}
|
||||
```
|
||||
|
||||
See [CONTRIBUTING](https://github.com/rycee/home-manager/blob/master/CONTRIBUTING.md#commits) for more information and [recent commit messages](https://github.com/rycee/home-manager/commits/master) for examples.
|
||||
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.
|
||||
|
||||
- If this PR adds a new module
|
||||
|
||||
- [ ] Added myself as module maintainer. See [example](https://github.com/rycee/home-manager/blob/068ff76a10e95820f886ac46957edcff4e44621d/modules/programs/lesspipe.nix#L6).
|
||||
- [ ] Added myself as module maintainer. See [example](https://github.com/nix-community/home-manager/blob/068ff76a10e95820f886ac46957edcff4e44621d/modules/programs/lesspipe.nix#L6).
|
||||
|
||||
- [ ] Added myself and the module files to `.github/CODEOWNERS`.
|
||||
|
||||
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:"
|
||||
28
.github/workflows/github_pages.yml
vendored
Normal file
28
.github/workflows/github_pages.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: GitHub Pages
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
publish:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: cachix/install-nix-action@v13
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- uses: cachix/cachix-action@v10
|
||||
with:
|
||||
name: nix-community
|
||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||
- run: |
|
||||
nix-build -A docs.html
|
||||
cp -r result/share/doc/home-manager public
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./public
|
||||
23
.github/workflows/test.yml
vendored
Normal file
23
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
name: Test
|
||||
on:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: "30 2 * * *"
|
||||
jobs:
|
||||
tests:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: cachix/install-nix-action@v13
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- 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 tests -A run.all
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
/flake.lock
|
||||
/result*
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
image: nixos/nix:latest
|
||||
|
||||
variables:
|
||||
# Pinned 2020-01-01.
|
||||
NIX_PATH: "nixpkgs=https://github.com/NixOS/nixpkgs/archive/b0bbacb52134a7e731e549f4c0a7a2a39ca6b481.tar.gz"
|
||||
NIX_PATH: "nixpkgs=channel:nixos-unstable"
|
||||
|
||||
stages:
|
||||
- test
|
||||
@@ -11,7 +10,7 @@ stages:
|
||||
Run tests:
|
||||
stage: test
|
||||
script:
|
||||
- nix-shell tests -A run.files-text
|
||||
- nix-shell --pure tests -A run.files-text
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "master"
|
||||
when: always
|
||||
|
||||
13
.travis.yml
13
.travis.yml
@@ -1,13 +0,0 @@
|
||||
language: nix
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
before_script:
|
||||
- mkdir -m 0755 -p /nix/var/nix/{profiles,gcroots}/per-user/$USER
|
||||
|
||||
script:
|
||||
- ./format -c
|
||||
- nix-shell . -A install
|
||||
- nix-shell --pure --max-jobs 10 tests -A run.all
|
||||
1
CONTRIBUTING.adoc
Symbolic link
1
CONTRIBUTING.adoc
Symbolic link
@@ -0,0 +1 @@
|
||||
doc/contributing.adoc
|
||||
194
CONTRIBUTING.md
194
CONTRIBUTING.md
@@ -1,194 +0,0 @@
|
||||
Contributing
|
||||
============
|
||||
|
||||
Thanks for wanting to contribute to Home Manager! These are some
|
||||
guidelines to make the process as smooth as possible for both you and
|
||||
the Home Manager developers.
|
||||
|
||||
If you are only looking to report a problem then it is sufficient to
|
||||
read through the following section on reporting issues. If you instead
|
||||
want to directly contribute improvements and additions then please
|
||||
have a look at everything here.
|
||||
|
||||
Reporting an issue
|
||||
------------------
|
||||
|
||||
If you notice a problem with Home Manager and want to report it then
|
||||
have a look among the already [open issues][], if you find one
|
||||
matching yours then feel free to comment on it to add any additional
|
||||
information you may have.
|
||||
|
||||
If no matching issue exists then go to the [new issue][] page and
|
||||
write a description of your problem. Include as much information as
|
||||
you can, ideally also include relevant excerpts from your Home Manager
|
||||
configuration.
|
||||
|
||||
Contributing code
|
||||
-----------------
|
||||
|
||||
If you want to contribute code to improve Home Manager then please
|
||||
follow these guidelines.
|
||||
|
||||
### Fork and create a pull request ###
|
||||
|
||||
If you have not previously forked Home Manager then you need to do
|
||||
that first. Have a look at GitHub's "[Fork A Repo][]" for instructions
|
||||
on how to do this.
|
||||
|
||||
Once you have a fork of Home Manager you should create a branch
|
||||
starting at the most recent `master`. Give your branch a reasonably
|
||||
descriptive name. Perform your changes on this branch and when you are
|
||||
happy with the result push the branch to GitHub and
|
||||
[create a pull request][].
|
||||
|
||||
Assuming your clone is at `$HOME/devel/home-manager` then you can make
|
||||
the `home-manager` command use it by either
|
||||
|
||||
1. overriding the default path by using the `-I` command line option:
|
||||
|
||||
home-manager -I home-manager=$HOME/devel/home-manager
|
||||
|
||||
or
|
||||
|
||||
2. changing the default path by ensuring your configuration includes
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
programs.home-manager.path = "$HOME/devel/home-manager";
|
||||
|
||||
and running `home-manager switch` to activate the change.
|
||||
Afterwards, `home-manager build` and `home-manager switch` will
|
||||
use your cloned repository.
|
||||
|
||||
The first option is good if you only temporarily want to use your
|
||||
clone.
|
||||
|
||||
### Commits ###
|
||||
|
||||
The commits in your pull request should be reasonably self-contained,
|
||||
that is, each commit should make sense in isolation. In particular,
|
||||
you will be asked to amend any commit that introduces syntax errors or
|
||||
similar problems even if they are fixed in a later commit.
|
||||
|
||||
The commit messages should follow the format
|
||||
|
||||
{component}: {description}
|
||||
|
||||
{long description}
|
||||
|
||||
where `{component}` refers to the code component (or module) your
|
||||
change affects, `{description}` is a 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.
|
||||
|
||||
When adding a new module, say `foo.nix`, we use the fixed commit
|
||||
format `foo: add module`. You can, of course, still include a long
|
||||
description if you wish.
|
||||
|
||||
In addition to the above commit message guidelines, try to follow the
|
||||
[seven rules][] as much as possible.
|
||||
|
||||
### Style guidelines ###
|
||||
|
||||
The code in Home Manager is formatted by the [nixfmt][] tool and the
|
||||
formatting is checked in the pull request tests. Run the `format` tool
|
||||
inside the project repository before submitting your pull request.
|
||||
|
||||
Note, we prefer `lowerCamelCase` for variable and attribute names with
|
||||
the accepted exception of variables directly referencing packages in
|
||||
Nixpkgs which use a hyphenated style. For example, the Home Manager
|
||||
option `services.gpg-agent.enableSshSupport` references the
|
||||
`gpg-agent` package in Nixpkgs.
|
||||
|
||||
### News ###
|
||||
|
||||
Home Manager includes a system for presenting news to the user. When
|
||||
making a change you, therefore, have the option to also include an
|
||||
associated news entry. In general, a news entry should only be added
|
||||
for truly noteworthy news. For example, a bug fix or new option does
|
||||
generally not need a news entry.
|
||||
|
||||
If you do have a change worthy of a news entry then please add one in
|
||||
[`news.nix`][] but you should follow some basic guidelines:
|
||||
|
||||
- The entry timestamp should be in ISO-8601 format having "+00:00" as
|
||||
time zone. For example, "2017-09-13T17:10:14+00:00". A suitable
|
||||
timestamp can be produced by the command
|
||||
|
||||
date --iso-8601=second --universal
|
||||
|
||||
- The entry condition should be as specific as possible. For example,
|
||||
if you are changing or deprecating a specific option then you could
|
||||
restrict the news to those users who actually use this option.
|
||||
|
||||
- Wrap the news message so that it will fit in the typical terminal,
|
||||
that is, at most 80 characters wide. Ideally a bit less.
|
||||
|
||||
- Unlike commit messages, news will be read without any connection to
|
||||
the Home Manager source code. It is therefore important to make the
|
||||
message understandable in isolation and to those who do not have
|
||||
knowledge of the Home Manager internals. To this end it should be
|
||||
written in more descriptive, prose like way.
|
||||
|
||||
- If you refer to an option then write its full attribute path. That
|
||||
is, instead of writing
|
||||
|
||||
> The option 'foo' has been deprecated, please use 'bar' instead.
|
||||
|
||||
it should read
|
||||
|
||||
> The option 'services.myservice.foo' has been deprecated, please
|
||||
> use 'services.myservice.bar' instead.
|
||||
|
||||
- A new module, say `foo.nix`, should always include a news entry
|
||||
that has a message along the lines of
|
||||
|
||||
> A new module is available: 'services.foo'.
|
||||
|
||||
If the module is platform specific, e.g., a service module using
|
||||
systemd, then a condition like
|
||||
|
||||
```
|
||||
condition = hostPlatform.isLinux;
|
||||
```
|
||||
|
||||
should be added. If you contribute a module then you don't need to
|
||||
add this entry, the merger will create an entry for you.
|
||||
|
||||
### Tests ###
|
||||
|
||||
Home Manager includes a basic test suite and it is highly recommended
|
||||
to include at least one test when adding a module. Tests are typically
|
||||
in the form of "golden tests" where, for example, a generated
|
||||
configuration file is compared to a known correct file.
|
||||
|
||||
It is relatively easy to create tests by modeling the existing tests,
|
||||
found in the `tests` project directory.
|
||||
|
||||
The full Home Manager test suite can be run by executing
|
||||
|
||||
```console
|
||||
$ nix-shell --pure tests -A run.all
|
||||
```
|
||||
|
||||
in the project root. List all test cases through
|
||||
|
||||
```console
|
||||
$ nix-shell --pure tests -A list
|
||||
```
|
||||
|
||||
and run an individual test, for example `alacritty-empty-settings`,
|
||||
through
|
||||
|
||||
```console
|
||||
$ nix-shell --pure tests -A run.alacritty-empty-settings
|
||||
```
|
||||
|
||||
[open issues]: https://github.com/rycee/home-manager/issues
|
||||
[new issue]: https://github.com/rycee/home-manager/issues/new
|
||||
[Fork A Repo]: https://help.github.com/articles/fork-a-repo/
|
||||
[create a pull request]: https://help.github.com/articles/creating-a-pull-request/
|
||||
[seven rules]: https://chris.beams.io/posts/git-commit/#seven-rules
|
||||
[`news.nix`]: https://github.com/rycee/home-manager/blob/master/modules/misc/news.nix
|
||||
[nixfmt]: https://github.com/serokell/nixfmt/
|
||||
198
FAQ.md
198
FAQ.md
@@ -1,198 +0,0 @@
|
||||
Frequently Asked Questions (FAQ)
|
||||
================================
|
||||
|
||||
Why is there a collision error when switching generation?
|
||||
---------------------------------------------------------
|
||||
|
||||
Home Manager currently installs packages into the user environment,
|
||||
precisely as if the packages were installed through
|
||||
`nix-env --install`. This means that you will get a collision error if
|
||||
your Home Manager configuration attempts to install a package that you
|
||||
already have installed manually, that is, packages that shows up when
|
||||
you run `nix-env --query`.
|
||||
|
||||
For example, imagine you have the `hello` package installed in your
|
||||
environment
|
||||
|
||||
```console
|
||||
$ nix-env --query
|
||||
hello-2.10
|
||||
```
|
||||
|
||||
and your Home Manager configuration contains
|
||||
|
||||
home.packages = [ pkgs.hello ];
|
||||
|
||||
Then attempting to switch to this configuration will result in an
|
||||
error similar to
|
||||
|
||||
```console
|
||||
$ home-manager switch
|
||||
these derivations will be built:
|
||||
/nix/store/xg69wsnd1rp8xgs9qfsjal017nf0ldhm-home-manager-path.drv
|
||||
[…]
|
||||
Activating installPackages
|
||||
replacing old ‘home-manager-path’
|
||||
installing ‘home-manager-path’
|
||||
building path(s) ‘/nix/store/b5c0asjz9f06l52l9812w6k39ifr49jj-user-environment’
|
||||
Wide character in die at /nix/store/64jc9gd2rkbgdb4yjx3nrgc91bpjj5ky-buildenv.pl line 79.
|
||||
collision between ‘/nix/store/fmwa4axzghz11cnln5absh31nbhs9lq1-home-manager-path/bin/hello’ and ‘/nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10/bin/hello’; use ‘nix-env --set-flag priority NUMBER PKGNAME’ to change the priority of one of the conflicting packages
|
||||
builder for ‘/nix/store/b37x3s7pzxbasfqhaca5dqbf3pjjw0ip-user-environment.drv’ failed with exit code 2
|
||||
error: build of ‘/nix/store/b37x3s7pzxbasfqhaca5dqbf3pjjw0ip-user-environment.drv’ failed
|
||||
```
|
||||
|
||||
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?
|
||||
--------------------------------------
|
||||
|
||||
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
|
||||
|
||||
```sh
|
||||
. "$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.
|
||||
|
||||
How do set up a configuration for multiple users/machines?
|
||||
----------------------------------------------------------
|
||||
|
||||
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.
|
||||
|
||||
For example, if you have two machines, called "kronos" and "rhea" on
|
||||
which you want to configure your user "jane" then you could create the
|
||||
files
|
||||
|
||||
- `kronos-jane.nix`,
|
||||
- `rhea-jane.nix`, and
|
||||
- `common.nix`
|
||||
|
||||
in your repository. On the kronos and rhea machines you can then make
|
||||
`~jane/.config/nixpkgs/home.nix` be a symbolic link to the
|
||||
corresponding file in your configuration repository.
|
||||
|
||||
The `kronos-jane.nix` and `rhea-jane.nix` files follow the format
|
||||
|
||||
```nix
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [ ./common.nix ];
|
||||
|
||||
# Various options that are specific for this machine/user.
|
||||
}
|
||||
```
|
||||
|
||||
while the `common.nix` file contains configuration shared across the
|
||||
two logins. Of course, instead of just a single `common.nix` file you
|
||||
can have multiple ones, even one per program or service.
|
||||
|
||||
You can get some inspiration from the [Post your home-manager home.nix
|
||||
file!][1] Reddit thread.
|
||||
|
||||
[1]: https://www.reddit.com/r/NixOS/comments/9bb9h9/post_your_homemanager_homenix_file/
|
||||
|
||||
Why do I get an error message about `ca.desrt.dconf`?
|
||||
-----------------------------------------------------
|
||||
|
||||
You are most likely trying to configure the GTK or Gnome Terminal but
|
||||
the DBus session is not aware of the dconf service. The full error you
|
||||
might get is
|
||||
|
||||
error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files
|
||||
|
||||
The solution on NixOS is to add
|
||||
|
||||
services.dbus.packages = with pkgs; [ gnome3.dconf ];
|
||||
|
||||
to your system configuration.
|
||||
|
||||
How do I install packages from Nixpkgs unstable?
|
||||
------------------------------------------------
|
||||
|
||||
If you are using a stable version of Nixpkgs but would like to install
|
||||
some particular packages from Nixpkgs unstable then you can import the
|
||||
unstable Nixpkgs and refer to its packages within your configuration.
|
||||
Something like
|
||||
|
||||
```nix
|
||||
{ pkgs, config, ... }:
|
||||
|
||||
let
|
||||
|
||||
pkgsUnstable = import <nixpkgs-unstable> {};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
home.packages = [
|
||||
pkgsUnstable.foo
|
||||
];
|
||||
|
||||
# …
|
||||
}
|
||||
```
|
||||
|
||||
should work provided you have a Nix channel called `nixpkgs-unstable`.
|
||||
Note, the package will not be affected by any package overrides,
|
||||
overlays, etc.
|
||||
|
||||
How do I override the package used by a module?
|
||||
-----------------------------------------------
|
||||
|
||||
By default Home Manager will install the package provided by your
|
||||
chosen `nixpkgs` channel but occasionally you might end up needing to
|
||||
change this package. This can typically be done in two ways.
|
||||
|
||||
1. If the module provides a `package` option, such as
|
||||
`programs.beets.package`, then this is the recommended way to
|
||||
perform the override. For example,
|
||||
|
||||
```
|
||||
programs.beets.package = pkgs.beets.override { enableCheck = true; };
|
||||
```
|
||||
|
||||
2. If no `package` option is available, then you can typically
|
||||
override the relevant package using an [overlay][nixpkgs-overlays].
|
||||
|
||||
For example, if you want to use the `programs.skim` module but use
|
||||
the `skim` package from Nixpkgs unstable, then a configuration like
|
||||
|
||||
```nix
|
||||
{ pkgs, config, ... }:
|
||||
|
||||
let
|
||||
|
||||
pkgsUnstable = import <nixpkgs-unstable> {};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
programs.skim.enable = true;
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
skim = pkgsUnstable.skim;
|
||||
})
|
||||
];
|
||||
|
||||
# …
|
||||
}
|
||||
```
|
||||
|
||||
should work OK.
|
||||
|
||||
[nixpkgs-overlays]: https://nixos.org/nixpkgs/manual/#chap-overlays
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2020 Robert Helgesson and Home Manager contributors
|
||||
Copyright (c) 2017-2020 Home Manager contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
125
README.md
125
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,9 +14,17 @@ 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.
|
||||
|
||||
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
|
||||
@@ -22,7 +32,7 @@ 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
|
||||
generation or from manual configuration.
|
||||
|
||||
Home Manager targets [NixOS][] unstable and NixOS version 20.03 (the
|
||||
Home Manager targets [NixOS][] unstable and NixOS version 20.09 (the
|
||||
current stable version), it may or may not work on other Linux
|
||||
distributions and NixOS versions.
|
||||
|
||||
@@ -46,41 +56,33 @@ Installation
|
||||
|
||||
Currently the easiest way to install Home Manager is as follows:
|
||||
|
||||
1. Make sure you have a working Nix installation. If you are not
|
||||
using NixOS then you may here have to run
|
||||
|
||||
```console
|
||||
$ mkdir -m 0755 -p /nix/var/nix/{profiles,gcroots}/per-user/$USER
|
||||
```
|
||||
|
||||
since Home Manager uses these directories to manage your profile
|
||||
generations. On NixOS these should already be available.
|
||||
|
||||
Also 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
|
||||
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
|
||||
[`allowed-users`][nixAllowedUsers] Nix option. On NixOS you can
|
||||
control this option using the
|
||||
[`nix.allowedUsers`][nixosAllowedUsers] system option.
|
||||
|
||||
2. Add the appropriate Home Manager channel. Typically this is
|
||||
Note that Nix 2.4 (`nixUnstable`) is not yet supported.
|
||||
|
||||
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/rycee/home-manager/archive/master.tar.gz home-manager
|
||||
$ 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 20.09 channel you can run
|
||||
|
||||
```console
|
||||
$ nix-channel --add https://github.com/rycee/home-manager/archive/release-20.03.tar.gz home-manager
|
||||
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.tar.gz home-manager
|
||||
$ nix-channel --update
|
||||
```
|
||||
|
||||
if you follow a Nixpkgs version 20.03 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
|
||||
|
||||
@@ -116,6 +118,13 @@ Currently the easiest way to install Home Manager is as follows:
|
||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
If instead of using channels you want to run Home Manager from a Git
|
||||
@@ -133,8 +142,8 @@ 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 the
|
||||
IcedTea plugin enabled, and enable the user gpg-agent service.
|
||||
Emacs with a few extra packages enabled, install Firefox with
|
||||
smooth scrolling enabled, and enable the user gpg-agent service.
|
||||
|
||||
To satisfy the above setup we should elaborate the
|
||||
`~/.config/nixpkgs/home.nix` file as follows:
|
||||
@@ -158,7 +167,13 @@ To satisfy the above setup we should elaborate the
|
||||
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
enableIcedTea = true;
|
||||
profiles = {
|
||||
myprofile = {
|
||||
settings = {
|
||||
"general.smoothScroll" = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.gpg-agent = {
|
||||
@@ -303,6 +318,48 @@ in your system configuration and
|
||||
|
||||
in your Home Manager configuration.
|
||||
|
||||
Nix Flakes
|
||||
----------
|
||||
|
||||
Home Manager includes a `flake.nix` file for compatibility with [Nix Flakes][]
|
||||
for those that wish to use it as a module. A bare-minimum `flake.nix` would be
|
||||
as follows:
|
||||
|
||||
```nix
|
||||
{
|
||||
description = "NixOS configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
};
|
||||
|
||||
outputs = { home-manager, nixpkgs, ... }: {
|
||||
nixosConfigurations = {
|
||||
hostname = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./configuration.nix
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.jdoe = import ./home.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
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
|
||||
--------
|
||||
|
||||
@@ -310,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.03`). These branches get fixes, but usually not new
|
||||
(e.g. `release-20.09`). These branches get fixes, but usually not new
|
||||
modules. If you need a module to be backported, then feel free to open
|
||||
an issue.
|
||||
|
||||
@@ -321,9 +378,11 @@ an issue.
|
||||
[nixAllowedUsers]: https://nixos.org/nix/manual/#conf-allowed-users
|
||||
[nixosAllowedUsers]: https://nixos.org/nixos/manual/options.html#opt-nix.allowedUsers
|
||||
[Z shell]: http://zsh.sourceforge.net/
|
||||
[manual]: https://rycee.gitlab.io/home-manager/
|
||||
[configuration options]: https://rycee.gitlab.io/home-manager/options.html
|
||||
[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/
|
||||
[samueldr]: https://github.com/samueldr/
|
||||
[Nix Pills]: https://nixos.org/nixos/nix-pills/
|
||||
[Nix Flakes]: https://nixos.wiki/wiki/Flakes
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
|
||||
rec {
|
||||
docs = with import ./doc { inherit pkgs; }; {
|
||||
html = manual.html;
|
||||
manPages = manPages;
|
||||
json = options.json;
|
||||
};
|
||||
|
||||
home-manager = pkgs.callPackage ./home-manager { path = toString ./.; };
|
||||
|
||||
install =
|
||||
pkgs.callPackage ./home-manager/install.nix { inherit home-manager; };
|
||||
|
||||
nixos = import ./nixos;
|
||||
|
||||
path = ./.;
|
||||
}
|
||||
|
||||
258
doc/contributing.adoc
Normal file
258
doc/contributing.adoc
Normal file
@@ -0,0 +1,258 @@
|
||||
[[ch-contributing]]
|
||||
== Contributing
|
||||
|
||||
:open-issues: https://github.com/nix-community/home-manager/issues
|
||||
:new-issue: https://github.com/nix-community/home-manager/issues/new
|
||||
:fork-a-repo: https://help.github.com/articles/fork-a-repo/
|
||||
:create-a-pull-request: https://help.github.com/articles/creating-a-pull-request/
|
||||
:seven-rules: https://chris.beams.io/posts/git-commit/#seven-rules
|
||||
:news-nix: https://github.com/nix-community/home-manager/blob/master/modules/misc/news.nix
|
||||
:nixfmt: https://github.com/serokell/nixfmt/
|
||||
:example-commit-message: https://github.com/nix-community/home-manager/commit/69f8e47e9e74c8d3d060ca22e18246b7f7d988ef
|
||||
|
||||
Contributions to Home Manager are very welcome. To make the process as smooth as possible for both you and the Home Manager maintainers we provide some guidelines that we ask you to follow. See <<sec-contrib-getting-started>> for information on how to set up a suitable development environment and <<sec-guidelines>> for the actual guidelines.
|
||||
|
||||
This text is mainly directed at those who would like to make code contributions to Home Manager. If you just want to report a bug then first look among the already {open-issues}[open issues], if you find one matching yours then feel free to comment on it to add any additional information you may have. If no matching issue exists then go to the {new-issue}[new issue] page and write a description of your problem. Include as much information as you can, ideally also include relevant excerpts from your Home Manager configuration.
|
||||
|
||||
[[sec-contrib-getting-started]]
|
||||
=== Getting started
|
||||
|
||||
If you have not previously forked Home Manager then you need to do that first. Have a look at GitHub's {fork-a-repo}[Fork a repo] for instructions on how to do this.
|
||||
|
||||
Once you have a fork of Home Manager you should create a branch starting at the most recent `master` branch. Give your branch a reasonably descriptive name. Commit your changes to this branch and when you are happy with the result and it fulfills <<sec-guidelines>> then push the branch to GitHub and {create-a-pull-request}[create a pull request].
|
||||
|
||||
Assuming your clone is at `$HOME/devel/home-manager` then you can make the `home-manager` command use it by either
|
||||
|
||||
1. overriding the default path by using the `-I` command line option:
|
||||
+
|
||||
[source,console]
|
||||
$ home-manager -I home-manager=$HOME/devel/home-manager
|
||||
+
|
||||
or
|
||||
|
||||
2. changing the default path by ensuring your configuration includes
|
||||
+
|
||||
[source,nix]
|
||||
----
|
||||
programs.home-manager.enable = true;
|
||||
programs.home-manager.path = "$HOME/devel/home-manager";
|
||||
----
|
||||
+
|
||||
and running `home-manager switch` to activate the change. Afterwards, `home-manager build` and `home-manager switch` will use your cloned repository.
|
||||
|
||||
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
|
||||
: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.
|
||||
|
||||
If you are uncertain how these rules affect the change you would like to make then feel free to start a discussion in the {irc-home-manager}[#home-manager] IRC channel, ideally before you start developing.
|
||||
|
||||
[[sec-guidelines-back-compat]]
|
||||
==== Maintain backward compatibility
|
||||
|
||||
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?
|
||||
|
||||
[[sec-guidelines-forward-compat]]
|
||||
==== Keep forward compatibility in mind
|
||||
|
||||
The master branch of Home Manager tracks the unstable channel of Nixpkgs, which may update package versions at any time. It is therefore important to consider how a package update may affect your code and try to reduce the risk of breakage.
|
||||
|
||||
The most effective way to reduce this risk is to follow the advice in <<sec-guidelines-valuable-options>>.
|
||||
|
||||
[[sec-guidelines-valuable-options]]
|
||||
==== Add only valuable options
|
||||
|
||||
When creating a new module it is tempting to include every option supported by the software. This is _strongly_ discouraged. Providing many options increases maintenance burden and risk of breakage considerably. This is why only the most {valuable-options}[important software options] should be modeled explicitly. Less important options should be expressible through an `extraConfig` escape hatch.
|
||||
|
||||
A good rule of thumb for the first implementation of a module is to only add explicit options for those settings that absolutely must be set for the software to function correctly. It follows that a module for software that provides sensible default values for all settings would require no explicit options at all.
|
||||
|
||||
If the software uses a structured configuration format like a JSON, YAML, INI, TOML, or even a plain list of key/value pairs then consider using a `settings` option as described in {rfc-42}[Nix RFC 42].
|
||||
|
||||
[[sec-guidelines-add-tests]]
|
||||
==== Add relevant tests
|
||||
|
||||
If at all possible, make sure to add new tests and expand existing tests so that your change will keep working in the future. See <<sec-tests>> for more information about the Home Manager test suite.
|
||||
|
||||
All contributed code _must_ pass the test suite.
|
||||
|
||||
[[sec-guidelines-module-maintainer]]
|
||||
|
||||
==== Add relevant documentation
|
||||
:docbook: https://tdg.docbook.org/
|
||||
:asciidoc: https://asciidoc.org/
|
||||
: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.
|
||||
|
||||
The HTML version of the manual containing both the module option descriptions and the documentation of Home Manager can be generated and opened by typing the following in a shell within a clone of the Home Manager Git repository:
|
||||
|
||||
[source,console]
|
||||
$ nix-build -A docs.html
|
||||
$ xdg-open ./result/share/doc/home-manager/index.html
|
||||
|
||||
When you have made changes to a module, it is a good idea to check that the man page version of the module options looks good:
|
||||
|
||||
[source,console]
|
||||
$ nix-build -A docs.manPages
|
||||
$ man ./result/share/man/man5/home-configuration.nix.5
|
||||
|
||||
==== Add yourself as a module maintainer
|
||||
|
||||
Every new module _must_ include a named maintainer using the `meta.maintainers` attribute. If you are a user of a module that currently lacks a maintainer then please consider adopting it.
|
||||
|
||||
If you are present in the NixOS maintainer list then you can use that entry. If you are not then you can add yourself to `modules/lib/maintainers.nix` in the Home Manager project.
|
||||
|
||||
Also add yourself to `.github/CODEOWNERS` as owner of the associated module files, including the test files. You will then be automatically added as a reviewer on any new pull request that touches your files.
|
||||
|
||||
Maintainers are encouraged to join the IRC channel and participate when they have opportunity.
|
||||
|
||||
[[sec-guidelines-code-style]]
|
||||
==== Format your code
|
||||
|
||||
Make sure your code is formatted as described in <<sec-code-style>>. To maintain consistency throughout the project you are encouraged to browse through existing code and adopt its style also in new code.
|
||||
|
||||
[[sec-guidelines-commit-message-style]]
|
||||
==== Format your commit messages
|
||||
|
||||
Similar to <<sec-guidelines-code-style>> we encourage a consistent commit message format as described in <<sec-commit-style>>.
|
||||
|
||||
[[sec-guidelines-news-style]]
|
||||
==== Format your news entries
|
||||
|
||||
If your contribution includes a change that should be communicated to users of Home Manager then you can add a news entry. The entry must be formatted as described in <<sec-news>>.
|
||||
|
||||
When new modules are added a news entry should be included but you do not need to create this entry manually. The merging maintainer will create the entry for you. This is to reduce the risk of merge conflicts.
|
||||
|
||||
[[sec-guidelines-conditional-modules]]
|
||||
==== Use conditional modules and news
|
||||
|
||||
Home Manager includes a number of modules that are only usable on some of the supported platforms. The most common example of platform specific modules are those that define systemd user services, which only works on Linux systems.
|
||||
|
||||
If you add a module that is platform specific then make sure to include a condition in the `loadModule` function call. This will make the module accessible only on systems where the condition evaluates to `true`.
|
||||
|
||||
Similarly, if you are adding a news entry then it should be shown only to users that may find it relevant, see <<sec-news>> for a description of conditional news.
|
||||
|
||||
[[sec-guidelines-licensing]]
|
||||
==== Mind the license
|
||||
|
||||
The Home Manager project is covered by the MIT license and we can only accept contributions that fall under this license, or are licensed in a compatible way. When you contribute self written code and documentation it is assumed that you are doing so under the MIT license.
|
||||
|
||||
A potential gotcha with respect to licensing are option descriptions. Often it is convenient to copy from the upstream software documentation. When this is done it is important to verify that the license of the upstream documentation allows redistribution under the terms of the MIT license.
|
||||
|
||||
[[sec-commit-style]]
|
||||
=== Commits
|
||||
|
||||
The commits in your pull request should be reasonably self-contained, that is, each commit should make sense in isolation. In particular, you will be asked to amend any commit that introduces syntax errors or similar problems even if they are fixed in a later commit.
|
||||
|
||||
The commit messages should follow the {seven-rules}[seven rules]. We also ask you to include the affected code component or module in the first line. That is, a commit message should follow the template
|
||||
|
||||
----
|
||||
{component}: {description}
|
||||
|
||||
{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.
|
||||
|
||||
[[ex-commit-message]]
|
||||
.Compliant commit message
|
||||
===============================================================================
|
||||
The commit {example-commit-message}[69f8e47e9e74c8d3d060ca22e18246b7f7d988ef] contains the commit message
|
||||
|
||||
----
|
||||
starship: allow running in Emacs if vterm is used
|
||||
|
||||
The vterm buffer is backed by libvterm and can handle Starship prompts
|
||||
without issues.
|
||||
----
|
||||
|
||||
which ticks all the boxes necessary to be accepted in Home Manager.
|
||||
===============================================================================
|
||||
|
||||
Finally, when adding a new module, say `programs/foo.nix`, we use the fixed commit format `foo: add module`. You can, of course, still include a long description if you wish.
|
||||
|
||||
[[sec-code-style]]
|
||||
=== Code Style
|
||||
|
||||
The code in Home Manager is formatted by the {nixfmt}[nixfmt] tool and the formatting is checked in the pull request tests. Run the `format` tool inside the project repository before submitting your pull request.
|
||||
|
||||
Keep lines at a reasonable width, ideally 80 characters or less. This also applies to string literals.
|
||||
|
||||
We prefer `lowerCamelCase` for variable and attribute names with the accepted exception of variables directly referencing packages in Nixpkgs which use a hyphenated style. For example, the Home Manager option `services.gpg-agent.enableSshSupport` references the `gpg-agent` package in Nixpkgs.
|
||||
|
||||
[[sec-news]]
|
||||
=== News
|
||||
|
||||
Home Manager includes a system for presenting news to the user. When making a change you, therefore, have the option to also include an associated news entry. In general, a news entry should only be added for truly noteworthy news. For example, a bug fix or new option does generally not need a news entry.
|
||||
|
||||
If you do have a change worthy of a news entry then please add one in {news-nix}[`news.nix`] but you should follow some basic guidelines:
|
||||
|
||||
- The entry timestamp should be in ISO-8601 format having "+00:00" as time zone. For example, "2017-09-13T17:10:14+00:00". A suitable timestamp can be produced by the command
|
||||
+
|
||||
[source,console]
|
||||
$ date --iso-8601=second --universal
|
||||
|
||||
- The entry condition should be as specific as possible. For example, if you are changing or deprecating a specific option then you could restrict the news to those users who actually use this option.
|
||||
|
||||
- Wrap the news message so that it will fit in the typical terminal, that is, at most 80 characters wide. Ideally a bit less.
|
||||
|
||||
- Unlike commit messages, news will be read without any connection to the Home Manager source code. It is therefore important to make the message understandable in isolation and to those who do not have knowledge of the Home Manager internals. To this end it should be written in more descriptive, prose like way.
|
||||
|
||||
- If you refer to an option then write its full attribute path. That is, instead of writing
|
||||
+
|
||||
----
|
||||
The option 'foo' has been deprecated, please use 'bar' instead.
|
||||
----
|
||||
+
|
||||
it should read
|
||||
+
|
||||
----
|
||||
The option 'services.myservice.foo' has been deprecated, please
|
||||
use 'services.myservice.bar' instead.
|
||||
----
|
||||
|
||||
- A new module, say `foo.nix`, should always include a news entry that has a message along the lines of
|
||||
+
|
||||
----
|
||||
A new module is available: 'services.foo'.
|
||||
----
|
||||
+
|
||||
If the module is platform specific, e.g., a service module using systemd, then a condition like
|
||||
+
|
||||
[source,nix]
|
||||
condition = hostPlatform.isLinux;
|
||||
+
|
||||
should be added. If you contribute a module then you don't need to add this entry, the merger will create an entry for you.
|
||||
|
||||
[[sec-tests]]
|
||||
=== Tests
|
||||
|
||||
Home Manager includes a basic test suite and it is highly recommended to include at least one test when adding a module. Tests are typically in the form of "golden tests" where, for example, a generated configuration file is compared to a known correct file.
|
||||
|
||||
It is relatively easy to create tests by modeling the existing tests, found in the `tests` project directory.
|
||||
|
||||
The full Home Manager test suite can be run by executing
|
||||
|
||||
[source,console]
|
||||
$ nix-shell --pure tests -A run.all
|
||||
|
||||
in the project root. List all test cases through
|
||||
|
||||
[source,console]
|
||||
$ nix-shell --pure tests -A list
|
||||
|
||||
and run an individual test, for example `alacritty-empty-settings`, through
|
||||
|
||||
[source,console]
|
||||
$ nix-shell --pure tests -A run.alacritty-empty-settings
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
{ pkgs
|
||||
|
||||
# Note, this should be "the standard library" + HM extensions.
|
||||
lib, pkgs }:
|
||||
, lib ? import ../modules/lib/stdlib-extended.nix pkgs.lib }:
|
||||
|
||||
let
|
||||
|
||||
@@ -8,8 +9,8 @@ let
|
||||
name = "nmd";
|
||||
owner = "rycee";
|
||||
repo = "nmd";
|
||||
rev = "49567e3ff2824ac8ba457f439f384eafc1eb4547";
|
||||
sha256 = "0x2lwcryvmnr128r497bzrawi4x1yyxb4riicppdaib95iwn8jck";
|
||||
rev = "2398aa79ab12aa7aba14bc3b08a6efd38ebabdc5";
|
||||
sha256 = "0yxb48afvccn8vvpkykzcr4q1rgv8jsijqncia7a5ffzshcrwrnh";
|
||||
};
|
||||
|
||||
nmd = import nmdSrc { inherit lib pkgs; };
|
||||
@@ -25,27 +26,78 @@ let
|
||||
}];
|
||||
};
|
||||
|
||||
hmModulesDocs = nmd.buildModulesDocs {
|
||||
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 ];
|
||||
moduleRootPaths = [ ./.. ];
|
||||
mkModuleUrl = path:
|
||||
"https://github.com/rycee/home-manager/blob/master/${path}#blob-path";
|
||||
channelName = "home-manager";
|
||||
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 ];
|
||||
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>
|
||||
|
||||
171
doc/faq.adoc
Normal file
171
doc/faq.adoc
Normal file
@@ -0,0 +1,171 @@
|
||||
[[ch-faq]]
|
||||
== Frequently Asked Questions (FAQ)
|
||||
|
||||
=== Why is there a collision error when switching generation?
|
||||
|
||||
Home Manager currently installs packages into the user environment, precisely as if the packages were installed through `nix-env --install`. This means that you will get a collision error if your Home Manager configuration attempts to install a package that you already have installed manually, that is, packages that shows up when you run `nix-env --query`.
|
||||
|
||||
For example, imagine you have the `hello` package installed in your environment
|
||||
|
||||
[source,console]
|
||||
----
|
||||
$ nix-env --query
|
||||
hello-2.10
|
||||
----
|
||||
|
||||
and your Home Manager configuration contains
|
||||
|
||||
[source,nix]
|
||||
----
|
||||
home.packages = [ pkgs.hello ];
|
||||
----
|
||||
|
||||
Then attempting to switch to this configuration will result in an error similar to
|
||||
|
||||
[source,console]
|
||||
----
|
||||
$ home-manager switch
|
||||
these derivations will be built:
|
||||
/nix/store/xg69wsnd1rp8xgs9qfsjal017nf0ldhm-home-manager-path.drv
|
||||
[…]
|
||||
Activating installPackages
|
||||
replacing old ‘home-manager-path’
|
||||
installing ‘home-manager-path’
|
||||
building path(s) ‘/nix/store/b5c0asjz9f06l52l9812w6k39ifr49jj-user-environment’
|
||||
Wide character in die at /nix/store/64jc9gd2rkbgdb4yjx3nrgc91bpjj5ky-buildenv.pl line 79.
|
||||
collision between ‘/nix/store/fmwa4axzghz11cnln5absh31nbhs9lq1-home-manager-path/bin/hello’ and ‘/nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10/bin/hello’; use ‘nix-env --set-flag priority NUMBER PKGNAME’ to change the priority of one of the conflicting packages
|
||||
builder for ‘/nix/store/b37x3s7pzxbasfqhaca5dqbf3pjjw0ip-user-environment.drv’ failed with exit code 2
|
||||
error: build of ‘/nix/store/b37x3s7pzxbasfqhaca5dqbf3pjjw0ip-user-environment.drv’ failed
|
||||
----
|
||||
|
||||
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?
|
||||
|
||||
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
|
||||
|
||||
[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.
|
||||
|
||||
=== 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.
|
||||
|
||||
For example, if you have two machines, called "kronos" and "rhea" on which you want to configure your user "jane" then you could create the files
|
||||
|
||||
- `kronos-jane.nix`,
|
||||
- `rhea-jane.nix`, and
|
||||
- `common.nix`
|
||||
|
||||
in your repository. On the kronos and rhea machines you can then make `~jane/.config/nixpkgs/home.nix` be a symbolic link to the corresponding file in your configuration repository.
|
||||
|
||||
The `kronos-jane.nix` and `rhea-jane.nix` files follow the format
|
||||
|
||||
[source,nix]
|
||||
----
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [ ./common.nix ];
|
||||
|
||||
# Various options that are specific for this machine/user.
|
||||
}
|
||||
----
|
||||
|
||||
while the `common.nix` file contains configuration shared across the two logins. Of course, instead of just a single `common.nix` file you can have multiple ones, even one per program or service.
|
||||
|
||||
You can get some inspiration from the {post-your-homenix}[Post your home-manager home.nix file!] Reddit thread.
|
||||
|
||||
=== Why do I get an error message about `ca.desrt.dconf`?
|
||||
|
||||
You are most likely trying to configure the GTK or Gnome Terminal but the DBus session is not aware of the dconf service. The full error you might get is
|
||||
|
||||
----
|
||||
error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files
|
||||
----
|
||||
|
||||
The solution on NixOS is to add
|
||||
|
||||
[source,nix]
|
||||
services.dbus.packages = with pkgs; [ gnome3.dconf ];
|
||||
|
||||
to your system configuration.
|
||||
|
||||
=== How do I install packages from Nixpkgs unstable?
|
||||
|
||||
If you are using a stable version of Nixpkgs but would like to install some particular packages from Nixpkgs unstable – or some other channel – then you can import the unstable Nixpkgs and refer to its packages within your configuration. Something like
|
||||
|
||||
[source,nix]
|
||||
----
|
||||
{ pkgs, config, ... }:
|
||||
|
||||
let
|
||||
|
||||
pkgsUnstable = import <nixpkgs-unstable> {};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
home.packages = [
|
||||
pkgsUnstable.foo
|
||||
];
|
||||
|
||||
# …
|
||||
}
|
||||
----
|
||||
|
||||
should work provided you have a Nix channel called `nixpkgs-unstable`.
|
||||
|
||||
You can add the `nixpkgs-unstable` channel by running
|
||||
|
||||
[source,console]
|
||||
----
|
||||
# nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable
|
||||
# nix-channel --update
|
||||
----
|
||||
|
||||
Note, the package will not be affected by any package overrides, overlays, etc.
|
||||
|
||||
=== How do I override the package used by a module?
|
||||
:nixpkgs-overlays: https://nixos.org/nixpkgs/manual/#chap-overlays
|
||||
|
||||
By default Home Manager will install the package provided by your chosen `nixpkgs` channel but occasionally you might end up needing to change this package. This can typically be done in two ways.
|
||||
|
||||
1. If the module provides a `package` option, such as `programs.beets.package`, then this is the recommended way to perform the override. For example,
|
||||
+
|
||||
[source,nix]
|
||||
programs.beets.package = pkgs.beets.override { enableCheck = true; };
|
||||
|
||||
2. If no `package` option is available then you can typically override the relevant package using an {nixpkgs-overlays}[overlay].
|
||||
+
|
||||
For example, if you want to use the `programs.skim` module but use the `skim` package from Nixpkgs unstable, then a configuration like
|
||||
+
|
||||
[source,nix]
|
||||
----
|
||||
{ pkgs, config, ... }:
|
||||
|
||||
let
|
||||
|
||||
pkgsUnstable = import <nixpkgs-unstable> {};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
programs.skim.enable = true;
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
skim = pkgsUnstable.skim;
|
||||
})
|
||||
];
|
||||
|
||||
# …
|
||||
}
|
||||
----
|
||||
+
|
||||
should work OK.
|
||||
263
doc/installation.adoc
Normal file
263
doc/installation.adoc
Normal file
@@ -0,0 +1,263 @@
|
||||
[[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 20.09 channel, you can run
|
||||
+
|
||||
[source,console]
|
||||
----
|
||||
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.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.
|
||||
+
|
||||
Unfortunately, we currently only support 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.
|
||||
|
||||
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 20.09 channel, you can run
|
||||
|
||||
[source,console]
|
||||
----
|
||||
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.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 20.09 channel, you can run
|
||||
|
||||
[source,console]
|
||||
----
|
||||
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.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]
|
||||
----
|
||||
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.
|
||||
====
|
||||
@@ -1,327 +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. If you are not using NixOS
|
||||
then it may be necessary to run
|
||||
</para>
|
||||
<screen>
|
||||
<prompt>$</prompt> <userinput>mkdir -m 0755 -p /nix/var/nix/{profiles,gcroots}/per-user/$USER</userinput>
|
||||
</screen>
|
||||
<para>
|
||||
since Home Manager uses these directories to manage your profile
|
||||
generations. On NixOS these should already be available.
|
||||
</para>
|
||||
<para>
|
||||
Also 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/rycee/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/rycee/home-manager/archive/release-20.03.tar.gz home-manager</userinput>
|
||||
<prompt>$</prompt> <userinput>nix-channel --update</userinput>
|
||||
</screen>
|
||||
<para>
|
||||
if you follow a Nixpkgs version 20.03 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>
|
||||
<prompt>#</prompt> <userinput>nix-channel --add https://github.com/rycee/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/rycee/home-manager/archive/release-20.03.tar.gz home-manager</userinput>
|
||||
<prompt>#</prompt> <userinput>nix-channel --update</userinput>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
if you follow a Nixpkgs version 20.03 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>
|
||||
<prompt>#</prompt> <userinput>nix-channel --add https://github.com/rycee/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/rycee/home-manager/archive/release-20.03.tar.gz home-manager</userinput>
|
||||
<prompt>#</prompt> <userinput>nix-channel --update</userinput>
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
if you follow a Nixpkgs version 20.03 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>
|
||||
</section>
|
||||
</chapter>
|
||||
@@ -66,6 +66,10 @@
|
||||
-I <replaceable>path</replaceable>
|
||||
</arg>
|
||||
|
||||
<arg>
|
||||
--flake <replaceable>flake-uri</replaceable>
|
||||
</arg>
|
||||
|
||||
<arg>
|
||||
-b <replaceable>ext</replaceable>
|
||||
</arg>
|
||||
@@ -115,7 +119,16 @@
|
||||
</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>
|
||||
@@ -151,7 +164,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
|
||||
@@ -334,6 +347,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 +442,9 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-j <replaceable>number</replaceable></option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--max-jobs <replaceable>number</replaceable></option>
|
||||
</term>
|
||||
@@ -512,7 +540,7 @@
|
||||
<para>
|
||||
Please report any bugs on the
|
||||
<link
|
||||
xlink:href="https://github.com/rycee/home-manager/issues">project
|
||||
xlink:href="https://github.com/nix-community/home-manager/issues">project
|
||||
issue tracker</link>.
|
||||
</para>
|
||||
</refsection>
|
||||
|
||||
@@ -13,9 +13,14 @@
|
||||
Manager.
|
||||
</para>
|
||||
<para>
|
||||
If you encounter problems or bugs then please report them on the
|
||||
<link xlink:href="https://github.com/rycee/home-manager/issues">Home Manager
|
||||
issue tracker</link>.
|
||||
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>.
|
||||
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>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
@@ -27,10 +32,20 @@
|
||||
</preface>
|
||||
<xi:include href="installation.xml" />
|
||||
<xi:include href="writing-modules.xml" />
|
||||
<xi:include href="contributing.xml" />
|
||||
<xi:include href="faq.xml" />
|
||||
<appendix xml:id="ch-options">
|
||||
<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,6 +6,10 @@ This section lists the release notes for stable versions of Home Manager and the
|
||||
|
||||
:leveloffset: 1
|
||||
|
||||
include::rl-2105.adoc[]
|
||||
|
||||
include::rl-2009.adoc[]
|
||||
|
||||
include::rl-2003.adoc[]
|
||||
|
||||
include::rl-1909.adoc[]
|
||||
|
||||
@@ -5,7 +5,7 @@ The 19.03 release branch became the stable branch in April, 2019.
|
||||
|
||||
[[sec-release-19.03-highlights]]
|
||||
=== Highlights
|
||||
:opt-home-file-source: opt-home.file._name__.source
|
||||
:opt-home-file-source: opt-home.file._name_.source
|
||||
|
||||
This release has the following notable changes:
|
||||
|
||||
|
||||
96
doc/release-notes/rl-2009.adoc
Normal file
96
doc/release-notes/rl-2009.adoc
Normal file
@@ -0,0 +1,96 @@
|
||||
[[sec-release-20.09]]
|
||||
== Release 20.09
|
||||
|
||||
The 20.09 release branch became the stable branch in late September, 2020.
|
||||
|
||||
[[sec-release-20.09-highlights]]
|
||||
=== Highlights
|
||||
|
||||
This release has the following notable changes:
|
||||
|
||||
* Nothing has happened.
|
||||
|
||||
[[sec-release-20.09-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
|
||||
"20.09" or later.
|
||||
|
||||
* The options <<opt-home.homeDirectory>> and <<opt-home.username>> no
|
||||
longer have default values and must therefore be provided in your
|
||||
configuration. Previously their values would default to the content of
|
||||
the environment variables `HOME` and `USER`, respectively.
|
||||
+
|
||||
--
|
||||
Further, the options <<opt-xdg.cacheHome>>, <<opt-xdg.configHome>>,
|
||||
and <<opt-xdg.dataHome>> will no longer be affected by the
|
||||
`XDG_CACHE_HOME`, `XDG_CONFIG_HOME`, and `XDG_DATA_HOME` environment
|
||||
variables. They now unconditionally default to
|
||||
|
||||
- `"${config.home.homeDirectory}/.cache"`,
|
||||
- `"${config.home.homeDirectory}/.config"`, and
|
||||
- `"${config.home.homeDirectory}/.local/share"`.
|
||||
|
||||
If you choose to switch to state version 20.09 then you must set these
|
||||
options if you use non-default XDG base directory paths.
|
||||
|
||||
The initial configuration generated by
|
||||
|
||||
[source,console]
|
||||
$ nix-shell '<home-manager>' -A install
|
||||
|
||||
will automatically include these options, when necessary.
|
||||
--
|
||||
|
||||
* Git's `smtpEncryption` option is now set to `tls` only if both <<opt-accounts.email.accounts.\_name_.smtp.tls.enable>> and <<opt-accounts.email.accounts.\_name_.smtp.tls.useStartTls>> are `true`. If only <<opt-accounts.email.accounts.\_name_.smtp.tls.enable>> is `true`, `ssl` is used instead.
|
||||
|
||||
* The `nixpkgs` module no longer references `<nixpkgs>`. Before it would do so when building the `pkgs` module argument. Starting with state version 20.09, the `pkgs` argument is instead built from the same Nixpkgs that was used to initialize the Home Manager modules. This is useful, for example, when using Home Manager within a Nix Flake. If you want to keep using `<nixpkgs>` with state version ≥ 20.09 then add
|
||||
+
|
||||
[source,nix]
|
||||
_module.args.pkgsPath = <nixpkgs>;
|
||||
+
|
||||
to your Home Manager configuration.
|
||||
|
||||
* The options `wayland.windowManager.sway.config.bars` and `opt-xsession.windowManager.i3.config.bars` have been changed so that most of the suboptions are now nullable and default to `null`. The default for these two options has been changed to manually set the old defaults for each suboption. The overall effect is that if the `bars` options is not set, then the default remains the same. On the other hand, something like:
|
||||
+
|
||||
--
|
||||
[source,nix]
|
||||
----
|
||||
bars = [ {
|
||||
command = "waybar";
|
||||
} ];
|
||||
----
|
||||
will now create the config:
|
||||
....
|
||||
bar {
|
||||
swaybar_command waybar
|
||||
}
|
||||
....
|
||||
instead of
|
||||
....
|
||||
bar {
|
||||
|
||||
font pango:monospace 8
|
||||
mode dock
|
||||
hidden_state hide
|
||||
position bottom
|
||||
status_command /nix/store/h7s6i9q1z5fxrlyyw5ls8vqxhf5bcs5a-i3status-2.13/bin/i3status
|
||||
swaybar_command waybar
|
||||
workspace_buttons yes
|
||||
strip_workspace_numbers no
|
||||
tray_output primary
|
||||
colors {
|
||||
background #000000
|
||||
statusline #ffffff
|
||||
separator #666666
|
||||
focused_workspace #4c7899 #285577 #ffffff
|
||||
active_workspace #333333 #5f676a #ffffff
|
||||
inactive_workspace #333333 #222222 #888888
|
||||
urgent_workspace #2f343a #900000 #ffffff
|
||||
binding_mode #2f343a #900000 #ffffff
|
||||
}
|
||||
|
||||
}
|
||||
....
|
||||
--
|
||||
182
doc/release-notes/rl-2105.adoc
Normal file
182
doc/release-notes/rl-2105.adoc
Normal file
@@ -0,0 +1,182 @@
|
||||
[[sec-release-21.05]]
|
||||
== Release 21.05
|
||||
|
||||
This is the current unstable branch and the information in this
|
||||
section is therefore not final.
|
||||
|
||||
[[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;
|
||||
};
|
||||
----
|
||||
|
||||
[[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.
|
||||
|
||||
* Nothing has happened.
|
||||
@@ -168,13 +168,20 @@ Builds a GVariant array containing the given list of elements, where each elemen
|
||||
- `hm.gvariant.type.uint64`
|
||||
- `hm.gvariant.type.double`
|
||||
- `hm.gvariant.type.arrayOf type`
|
||||
- `hm.gvariant.type.maybeOf type`
|
||||
- `hm.gvariant.type.tupleOf types`
|
||||
--
|
||||
+
|
||||
where `type` and `types` are themselve a type and list of types, respectively.
|
||||
where `type` and `types` are themselves a type and list of types, respectively.
|
||||
+
|
||||
`hm.gvariant.mkEmptyArray type`:::
|
||||
An alias of `hm.gvariant.mkArray type []`.
|
||||
+
|
||||
`hm.gvariant.mkNothing type`:::
|
||||
Builds a GVariant maybe value whose (non-existent) element is of the given type. The `type` value is constructed as described for the `mkArray` function above.
|
||||
+
|
||||
`hm.gvariant.mkJust element`:::
|
||||
Builds a GVariant maybe value containing the given GVariant element.
|
||||
+
|
||||
`hm.gvariant.mkTuple elements`:::
|
||||
Builds a GVariant tuple containing the given list of elements, where each element is a GVariant value.
|
||||
|
||||
26
flake.nix
Normal file
26
flake.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
description = "Home Manager for Nix";
|
||||
|
||||
outputs = { self, nixpkgs }: rec {
|
||||
nixosModules.home-manager = import ./nixos;
|
||||
nixosModule = self.nixosModules.home-manager;
|
||||
|
||||
darwinModules.home-manager = import ./nix-darwin;
|
||||
darwinModule = self.darwinModules.home-manager;
|
||||
|
||||
lib = {
|
||||
hm = import ./modules/lib { lib = nixpkgs.lib; };
|
||||
homeManagerConfiguration = { configuration, system, homeDirectory
|
||||
, username, extraSpecialArgs ? { }
|
||||
, pkgs ? builtins.getAttr system nixpkgs.outputs.legacyPackages
|
||||
, check ? true }@args:
|
||||
import ./modules {
|
||||
inherit pkgs check extraSpecialArgs;
|
||||
configuration = { ... }: {
|
||||
imports = [ configuration ];
|
||||
home = { inherit homeDirectory username; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
9
format
9
format
@@ -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,23 +25,17 @@ 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/gtk.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/alot.nix \
|
||||
! -path ./modules/programs/bash.nix \
|
||||
! -path ./modules/programs/emacs.nix \
|
||||
! -path ./modules/programs/firefox.nix \
|
||||
! -path ./modules/programs/gpg.nix \
|
||||
! -path ./modules/programs/lesspipe.nix \
|
||||
! -path ./modules/programs/neovim.nix \
|
||||
! -path ./modules/programs/ssh.nix \
|
||||
! -path ./modules/programs/tmux.nix \
|
||||
! -path ./modules/programs/vscode.nix \
|
||||
! -path ./modules/programs/zsh.nix \
|
||||
! -path ./modules/services/gpg-agent.nix \
|
||||
! -path ./modules/services/kbfs.nix \
|
||||
@@ -56,10 +49,8 @@ find . -name '*.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/default.nix \
|
||||
! -path ./tests/modules/systemd/services.nix \
|
||||
! -path ./tests/modules/systemd/session-variables.nix \
|
||||
-exec nixfmt $CHECK_ARG {} +
|
||||
|
||||
@@ -285,7 +285,8 @@ _home-manager_completions ()
|
||||
#--------------------------#
|
||||
|
||||
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" "--show-trace" \
|
||||
"-j" "--max-jobs" )
|
||||
|
||||
# ^ « home-manager »'s options.
|
||||
|
||||
|
||||
54
home-manager/completion.zsh
Normal file
54
home-manager/completion.zsh
Normal file
@@ -0,0 +1,54 @@
|
||||
#compdef home-manager
|
||||
|
||||
local state ret=1
|
||||
|
||||
_arguments \
|
||||
'-A[attribute]:ATTRIBUTE:()' \
|
||||
'-I[search path]:PATH:_files -/' \
|
||||
'-b[backup files]:EXT:()' \
|
||||
'--cores[cores]:NUM:()' \
|
||||
'--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:()' \
|
||||
'--show-trace[show trace]' \
|
||||
'1: :->cmds' \
|
||||
'*:: :->args' && ret=0
|
||||
|
||||
case "$state" in
|
||||
cmds)
|
||||
_values 'command' \
|
||||
'help[help]' \
|
||||
'edit[edit]' \
|
||||
'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:()' \
|
||||
'--keep-failed[keep failed]' \
|
||||
'--keep-going[keep going]' \
|
||||
'--max-jobs[max jobs]:NUM:()' \
|
||||
'--option[option]:NAME VALUE:()' \
|
||||
'--show-trace[show trace]'
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
return ret
|
||||
@@ -1,40 +1,36 @@
|
||||
{ runCommand, lib, bash, coreutils, findutils, gnused, less
|
||||
|
||||
# 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
|
||||
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
|
||||
|
||||
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 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
|
||||
''
|
||||
|
||||
@@ -74,7 +74,35 @@ 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 doInstantiate() {
|
||||
setFlakeAttribute
|
||||
if [[ -v FLAKE_CONFIG_URI ]]; then
|
||||
errorEcho "Can't instantiate a flake configuration"
|
||||
exit 1
|
||||
fi
|
||||
setConfigFile
|
||||
setHomeManagerNixPath
|
||||
|
||||
@@ -165,7 +193,11 @@ function doEdit() {
|
||||
|
||||
setConfigFile
|
||||
|
||||
exec "$EDITOR" "$HOME_MANAGER_CONFIG"
|
||||
# Don't quote $EDITOR in order to support values including options, e.g.,
|
||||
# "code --wait".
|
||||
#
|
||||
# shellcheck disable=2086
|
||||
exec $EDITOR "$HOME_MANAGER_CONFIG"
|
||||
}
|
||||
|
||||
function doBuild() {
|
||||
@@ -174,6 +206,17 @@ function doBuild() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
setFlakeAttribute
|
||||
if [[ -v FLAKE_CONFIG_URI ]]; then
|
||||
local exitCode=0
|
||||
nix build \
|
||||
"${PASSTHROUGH_OPTS[@]}" \
|
||||
${DRY_RUN+--dry-run} \
|
||||
"$FLAKE_CONFIG_URI.activationPackage" \
|
||||
|| exitCode=1
|
||||
return $exitCode
|
||||
fi
|
||||
|
||||
setWorkDir
|
||||
|
||||
local newsInfo
|
||||
@@ -190,6 +233,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
|
||||
@@ -217,11 +270,11 @@ 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
|
||||
|
||||
pushd "/nix/var/nix/profiles/per-user/$USER" > /dev/null
|
||||
pushd "$NIX_STATE_DIR/profiles/per-user/$USER" > /dev/null
|
||||
# shellcheck disable=2012
|
||||
ls --color=$color -gG --time-style=long-iso --sort time home-manager-*-link \
|
||||
| cut -d' ' -f 4- \
|
||||
@@ -234,7 +287,7 @@ function doListGens() {
|
||||
function doRmGenerations() {
|
||||
setVerboseAndDryRun
|
||||
|
||||
pushd "/nix/var/nix/profiles/per-user/$USER" > /dev/null
|
||||
pushd "$NIX_STATE_DIR/profiles/per-user/$USER" > /dev/null
|
||||
|
||||
for generationId in "$@"; do
|
||||
local linkName="home-manager-$generationId-link"
|
||||
@@ -254,11 +307,11 @@ function doRmGenerations() {
|
||||
|
||||
function doRmAllGenerations() {
|
||||
$DRY_RUN_CMD rm $VERBOSE_ARG \
|
||||
"/nix/var/nix/profiles/per-user/$USER/home-manager"*
|
||||
"$NIX_STATE_DIR/profiles/per-user/$USER/home-manager"*
|
||||
}
|
||||
|
||||
function doExpireGenerations() {
|
||||
local profileDir="/nix/var/nix/profiles/per-user/$USER"
|
||||
local profileDir="$NIX_STATE_DIR/profiles/per-user/$USER"
|
||||
|
||||
local generations
|
||||
generations="$( \
|
||||
@@ -368,11 +421,12 @@ function doUninstall() {
|
||||
HOME_MANAGER_CONFIG="$(mktemp --tmpdir home-manager.XXXXXXXXXX)"
|
||||
echo "{ lib, ... }: { home.file = lib.mkForce {}; }" > "$HOME_MANAGER_CONFIG"
|
||||
doSwitch
|
||||
$DRY_RUN_CMD nix-env -e home-manager-path || true
|
||||
rm "$HOME_MANAGER_CONFIG"
|
||||
$DRY_RUN_CMD rm $VERBOSE_ARG -r \
|
||||
"${XDG_DATA_HOME:-$HOME/.local/share}/home-manager"
|
||||
$DRY_RUN_CMD rm $VERBOSE_ARG \
|
||||
"/nix/var/nix/gcroots/per-user/$USER/current-home"
|
||||
"$NIX_STATE_DIR/gcroots/per-user/$USER/current-home"
|
||||
;;
|
||||
*)
|
||||
echo "Yay!"
|
||||
@@ -404,22 +458,24 @@ 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 " --keep-failed"
|
||||
echo " --keep-going"
|
||||
echo " --max-jobs NUM"
|
||||
echo " -j, --max-jobs NUM"
|
||||
echo " --option NAME VALUE"
|
||||
echo " --show-trace"
|
||||
echo " --(no-)substitute"
|
||||
@@ -454,11 +510,14 @@ function doHelp() {
|
||||
echo " uninstall Remove Home Manager"
|
||||
}
|
||||
|
||||
readonly NIX_STATE_DIR="${NIX_STATE_DIR:-/nix/var/nix}"
|
||||
|
||||
EXTRA_NIX_PATH=()
|
||||
HOME_MANAGER_CONFIG_ATTRIBUTE=""
|
||||
PASSTHROUGH_OPTS=()
|
||||
COMMAND=""
|
||||
COMMAND_ARGS=()
|
||||
FLAKE_ARG=""
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
opt="$1"
|
||||
@@ -483,6 +542,21 @@ 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
|
||||
;;
|
||||
-h|--help)
|
||||
doHelp
|
||||
exit 0
|
||||
@@ -490,11 +564,11 @@ 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)
|
||||
PASSTHROUGH_OPTS+=("$opt" "$1")
|
||||
shift
|
||||
;;
|
||||
@@ -505,6 +579,10 @@ while [[ $# -gt 0 ]]; do
|
||||
-v|--verbose)
|
||||
export VERBOSE=1
|
||||
;;
|
||||
--version)
|
||||
echo 21.05
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
case $COMMAND in
|
||||
expire-generations|remove-generations)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ pkgs ? import <nixpkgs> {}
|
||||
, confPath
|
||||
, confAttr
|
||||
, confAttr ? null
|
||||
, check ? true
|
||||
, newsReadIdsFile ? null
|
||||
}:
|
||||
@@ -11,7 +11,7 @@ let
|
||||
|
||||
env = import ../modules {
|
||||
configuration =
|
||||
if confAttr == ""
|
||||
if confAttr == "" || confAttr == null
|
||||
then confPath
|
||||
else (import confPath).${confAttr};
|
||||
pkgs = pkgs;
|
||||
|
||||
@@ -12,6 +12,18 @@ runCommand "home-manager-install" {
|
||||
echo
|
||||
echo "Creating initial Home Manager configuration..."
|
||||
|
||||
nl=$'\n'
|
||||
xdgVars=""
|
||||
if [[ -v XDG_CACHE_HOME && $XDG_CACHE_HOME != "$HOME/.cache" ]]; then
|
||||
xdgVars="$xdgVars xdg.cacheHome = \"$XDG_CACHE_HOME\";$nl"
|
||||
fi
|
||||
if [[ -v XDG_CONFIG_HOME && $XDG_CONFIG_HOME != "$HOME/.config" ]]; then
|
||||
xdgVars="$xdgVars xdg.configHome = \"$XDG_CONFIG_HOME\";$nl"
|
||||
fi
|
||||
if [[ -v XDG_DATA_HOME && $XDG_DATA_HOME != "$HOME/.local/share" ]]; then
|
||||
xdgVars="$xdgVars xdg.dataHome = \"$XDG_DATA_HOME\";$nl"
|
||||
fi
|
||||
|
||||
mkdir -p "$(dirname "$confFile")"
|
||||
cat > $confFile <<EOF
|
||||
{ config, pkgs, ... }:
|
||||
@@ -20,6 +32,11 @@ runCommand "home-manager-install" {
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home.username = "$USER";
|
||||
home.homeDirectory = "$HOME";
|
||||
$xdgVars
|
||||
# This value determines the Home Manager release that your
|
||||
# configuration is compatible with. This helps avoid breakage
|
||||
# when a new Home Manager release introduces backwards
|
||||
@@ -28,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 = "20.03";
|
||||
home.stateVersion = "21.05";
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
@@ -54,7 +71,7 @@ runCommand "home-manager-install" {
|
||||
|
||||
Uh oh, the installation failed! Please create an issue at
|
||||
|
||||
https://github.com/rycee/home-manager/issues
|
||||
https://github.com/nix-community/home-manager/issues
|
||||
|
||||
if the error seems to be the fault of Home Manager.
|
||||
EOF
|
||||
|
||||
@@ -374,19 +374,7 @@ in {
|
||||
};
|
||||
|
||||
accounts = mkOption {
|
||||
type = types.attrsOf (types.submodule ([
|
||||
mailAccountOpts
|
||||
(import ../programs/alot-accounts.nix pkgs)
|
||||
(import ../programs/astroid-accounts.nix)
|
||||
(import ../programs/getmail-accounts.nix)
|
||||
(import ../programs/lieer-accounts.nix)
|
||||
(import ../programs/mbsync-accounts.nix)
|
||||
(import ../programs/msmtp-accounts.nix)
|
||||
(import ../programs/neomutt-accounts.nix)
|
||||
(import ../programs/notmuch-accounts.nix)
|
||||
(import ../programs/offlineimap-accounts.nix)
|
||||
] ++ optionals pkgs.stdenv.hostPlatform.isLinux
|
||||
[ (import ../services/lieer-accounts.nix) ]));
|
||||
type = types.attrsOf (types.submodule mailAccountOpts);
|
||||
default = { };
|
||||
description = "List of email accounts.";
|
||||
};
|
||||
|
||||
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 = {
|
||||
# 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,13 @@ in
|
||||
};
|
||||
|
||||
config = {
|
||||
lib.file.mkOutOfStoreSymlink = path:
|
||||
let
|
||||
pathStr = toString path;
|
||||
name = hm.strings.storeFileName (baseNameOf pathStr);
|
||||
in
|
||||
pkgs.runCommandLocal name {} ''ln -s ${escapeShellArg pathStr} $out'';
|
||||
|
||||
# This verifies that the links we are about to create will not
|
||||
# overwrite an existing file.
|
||||
home.activation.checkLinkTargets = hm.dag.entryBefore ["writeBoundary"] (
|
||||
@@ -83,10 +90,10 @@ in
|
||||
errorEcho "Existing file '$backup' would be clobbered by backing up '$targetPath'"
|
||||
collision=1
|
||||
else
|
||||
warnEcho "Existing file '$targetPath' is in the way, will be moved to '$backup'"
|
||||
warnEcho "Existing file '$targetPath' is in the way of '$sourcePath', will be moved to '$backup'"
|
||||
fi
|
||||
else
|
||||
errorEcho "Existing file '$targetPath' is in the way"
|
||||
errorEcho "Existing file '$targetPath' is in the way of '$sourcePath'"
|
||||
collision=1
|
||||
fi
|
||||
fi
|
||||
@@ -162,7 +169,7 @@ in
|
||||
if [[ -e "$newGenFiles/$relativePath" ]] ; then
|
||||
$VERBOSE_ECHO "Checking $targetPath: exists"
|
||||
elif [[ ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then
|
||||
warnEcho "Path '$targetPath' not link into Home Manager generation. Skipping delete."
|
||||
warnEcho "Path '$targetPath' does not link into a Home Manager generation. Skipping delete."
|
||||
else
|
||||
$VERBOSE_ECHO "Checking $targetPath: gone (deleting)"
|
||||
$DRY_RUN_CMD rm $VERBOSE_ARG "$targetPath"
|
||||
@@ -250,7 +257,7 @@ in
|
||||
home-files = pkgs.runCommand
|
||||
"home-manager-files"
|
||||
{
|
||||
nativeBuildInputs = [ pkgs.xlibs.lndir ];
|
||||
nativeBuildInputs = [ pkgs.xorg.lndir ];
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
}
|
||||
@@ -309,12 +316,15 @@ in
|
||||
}
|
||||
'' + concatStrings (
|
||||
mapAttrsToList (n: v: ''
|
||||
insertFile "${sourceStorePath v}" \
|
||||
"${v.target}" \
|
||||
"${if v.executable == null
|
||||
then "inherit"
|
||||
else builtins.toString v.executable}" \
|
||||
"${builtins.toString v.recursive}"
|
||||
insertFile ${
|
||||
escapeShellArgs [
|
||||
(sourceStorePath v)
|
||||
v.target
|
||||
(if v.executable == null
|
||||
then "inherit"
|
||||
else toString v.executable)
|
||||
(toString v.recursive)
|
||||
]}
|
||||
'') cfg
|
||||
));
|
||||
};
|
||||
|
||||
@@ -16,11 +16,35 @@ let
|
||||
'';
|
||||
};
|
||||
|
||||
address = mkOption {
|
||||
ctype = mkOption {
|
||||
default = null;
|
||||
type = types.nullOr types.str;
|
||||
description = ''
|
||||
The language to use for addresses.
|
||||
Character classification category.
|
||||
'';
|
||||
};
|
||||
|
||||
numeric = mkOption {
|
||||
default = null;
|
||||
type = types.nullOr types.str;
|
||||
description = ''
|
||||
The language to use for numerical values.
|
||||
'';
|
||||
};
|
||||
|
||||
time = mkOption {
|
||||
default = null;
|
||||
type = types.nullOr types.str;
|
||||
description = ''
|
||||
The language to use for formatting times.
|
||||
'';
|
||||
};
|
||||
|
||||
collate = mkOption {
|
||||
default = null;
|
||||
type = types.nullOr types.str;
|
||||
description = ''
|
||||
The language to use for collation (alphabetical ordering).
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -32,6 +56,14 @@ let
|
||||
'';
|
||||
};
|
||||
|
||||
messages = mkOption {
|
||||
default = null;
|
||||
type = types.nullOr types.str;
|
||||
description = ''
|
||||
The language to use for messages, application UI languages, etc.
|
||||
'';
|
||||
};
|
||||
|
||||
paper = mkOption {
|
||||
default = null;
|
||||
type = types.nullOr types.str;
|
||||
@@ -40,13 +72,38 @@ let
|
||||
'';
|
||||
};
|
||||
|
||||
time = mkOption {
|
||||
name = mkOption {
|
||||
default = null;
|
||||
type = types.nullOr types.str;
|
||||
description = ''
|
||||
The language to use for formatting times.
|
||||
The language to use for personal names.
|
||||
'';
|
||||
};
|
||||
|
||||
address = mkOption {
|
||||
default = null;
|
||||
type = types.nullOr types.str;
|
||||
description = ''
|
||||
The language to use for addresses.
|
||||
'';
|
||||
};
|
||||
|
||||
telephone = mkOption {
|
||||
default = null;
|
||||
type = types.nullOr types.str;
|
||||
description = ''
|
||||
The language to use for telephone numbers.
|
||||
'';
|
||||
};
|
||||
|
||||
measurement = mkOption {
|
||||
default = null;
|
||||
type = types.nullOr types.str;
|
||||
description = ''
|
||||
The language to use for measurement values.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@@ -125,14 +182,23 @@ in
|
||||
options = {
|
||||
home.username = mkOption {
|
||||
type = types.str;
|
||||
defaultText = "$USER";
|
||||
defaultText = literalExample ''
|
||||
"$USER" for state version < 20.09,
|
||||
undefined for state version ≥ 20.09
|
||||
'';
|
||||
example = "jane.doe";
|
||||
description = "The user's username.";
|
||||
};
|
||||
|
||||
home.homeDirectory = mkOption {
|
||||
type = types.path;
|
||||
defaultText = "$HOME";
|
||||
description = "The user's home directory.";
|
||||
defaultText = literalExample ''
|
||||
"$HOME" for state version < 20.09,
|
||||
undefined for state version ≥ 20.09
|
||||
'';
|
||||
apply = toString;
|
||||
example = "/home/jane.doe";
|
||||
description = "The user's home directory. Must be an absolute path.";
|
||||
};
|
||||
|
||||
home.profileDirectory = mkOption {
|
||||
@@ -198,6 +264,17 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
home.sessionPath = mkOption {
|
||||
type = with types; listOf str;
|
||||
default = [ ];
|
||||
example = [
|
||||
".git/safe/../../bin"
|
||||
"\${xdg.configHome}/emacs/bin"
|
||||
"~/.local/bin"
|
||||
];
|
||||
description = "Extra directories to add to <envar>PATH</envar>.";
|
||||
};
|
||||
|
||||
home.sessionVariablesExtra = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
@@ -327,13 +404,17 @@ in
|
||||
}
|
||||
];
|
||||
|
||||
home.username = mkDefault (builtins.getEnv "USER");
|
||||
home.homeDirectory = mkDefault (builtins.getEnv "HOME");
|
||||
home.username =
|
||||
mkIf (versionOlder config.home.stateVersion "20.09")
|
||||
(mkDefault (builtins.getEnv "USER"));
|
||||
home.homeDirectory =
|
||||
mkIf (versionOlder config.home.stateVersion "20.09")
|
||||
(mkDefault (builtins.getEnv "HOME"));
|
||||
|
||||
home.profileDirectory =
|
||||
if config.submoduleSupport.enable
|
||||
&& config.submoduleSupport.externalPackageInstall
|
||||
then config.home.path
|
||||
then "/etc/profiles/per-user/${cfg.username}"
|
||||
else cfg.homeDirectory + "/.nix-profile";
|
||||
|
||||
home.sessionVariables =
|
||||
@@ -342,13 +423,27 @@ in
|
||||
in
|
||||
(maybeSet "LANG" cfg.language.base)
|
||||
//
|
||||
(maybeSet "LC_ADDRESS" cfg.language.address)
|
||||
(maybeSet "LC_CTYPE" cfg.language.ctype)
|
||||
//
|
||||
(maybeSet "LC_NUMERIC" cfg.language.numeric)
|
||||
//
|
||||
(maybeSet "LC_TIME" cfg.language.time)
|
||||
//
|
||||
(maybeSet "LC_COLLATE" cfg.language.collate)
|
||||
//
|
||||
(maybeSet "LC_MONETARY" cfg.language.monetary)
|
||||
//
|
||||
(maybeSet "LC_MESSAGES" cfg.language.messages)
|
||||
//
|
||||
(maybeSet "LC_PAPER" cfg.language.paper)
|
||||
//
|
||||
(maybeSet "LC_TIME" cfg.language.time);
|
||||
(maybeSet "LC_NAME" cfg.language.name)
|
||||
//
|
||||
(maybeSet "LC_ADDRESS" cfg.language.address)
|
||||
//
|
||||
(maybeSet "LC_TELEPHONE" cfg.language.telephone)
|
||||
//
|
||||
(maybeSet "LC_MEASUREMENT" cfg.language.measurement);
|
||||
|
||||
home.packages = [
|
||||
# Provide a file holding all session variables.
|
||||
@@ -362,6 +457,8 @@ in
|
||||
export __HM_SESS_VARS_SOURCED=1
|
||||
|
||||
${config.lib.shell.exportAll cfg.sessionVariables}
|
||||
'' + lib.optionalString (cfg.sessionPath != [ ]) ''
|
||||
export PATH="$PATH''${PATH:+:}${concatStringsSep ":" cfg.sessionPath}"
|
||||
'' + cfg.sessionVariablesExtra;
|
||||
}
|
||||
)
|
||||
@@ -455,6 +552,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
|
||||
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function setupVars() {
|
||||
local profilesPath="/nix/var/nix/profiles/per-user/$USER"
|
||||
local gcPath="/nix/var/nix/gcroots/per-user/$USER"
|
||||
local greatestGenNum
|
||||
local nixStateDir="${NIX_STATE_DIR:-/nix/var/nix}"
|
||||
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"
|
||||
|
||||
local greatestGenNum
|
||||
greatestGenNum=$( \
|
||||
find "$profilesPath" -name 'home-manager-*-link' \
|
||||
| sed 's/^.*-\([0-9]*\)-link$/\1/' \
|
||||
| sort -rn \
|
||||
| head -1)
|
||||
nix-env --list-generations --profile "$genProfilePath" \
|
||||
| tail -1 \
|
||||
| sed -E 's/ *([[:digit:]]+) .*/\1/')
|
||||
|
||||
if [[ -n $greatestGenNum ]] ; then
|
||||
oldGenNum=$greatestGenNum
|
||||
@@ -18,15 +22,15 @@ function setupVars() {
|
||||
newGenNum=1
|
||||
fi
|
||||
|
||||
if [[ -e $gcPath/current-home ]] ; then
|
||||
oldGenPath="$(readlink -e "$gcPath/current-home")"
|
||||
if [[ -e $profilesPath/home-manager ]] ; then
|
||||
oldGenPath="$(readlink -e "$profilesPath/home-manager")"
|
||||
fi
|
||||
|
||||
$VERBOSE_ECHO "Sanity checking oldGenNum and oldGenPath"
|
||||
if [[ -v oldGenNum && ! -v oldGenPath
|
||||
|| ! -v oldGenNum && -v oldGenPath ]]; then
|
||||
errorEcho "Invalid profile number and GC root values! These must be"
|
||||
errorEcho "either both empty or both set but are now set to"
|
||||
errorEcho "Invalid profile number and current profile values! These"
|
||||
errorEcho "must be either both empty or both set but are now set to"
|
||||
errorEcho " '${oldGenNum:-}' and '${oldGenPath:-}'"
|
||||
errorEcho "If you don't mind losing previous profile generations then"
|
||||
errorEcho "the easiest solution is probably to run"
|
||||
@@ -35,12 +39,6 @@ function setupVars() {
|
||||
errorEcho "and trying home-manager switch again. Good luck!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
genProfilePath="$profilesPath/home-manager"
|
||||
newGenPath="@GENERATION_DIR@";
|
||||
newGenProfilePath="$profilesPath/home-manager-$newGenNum-link"
|
||||
newGenGcPath="$gcPath/current-home"
|
||||
}
|
||||
|
||||
if [[ -v VERBOSE ]]; then
|
||||
@@ -53,6 +51,11 @@ fi
|
||||
|
||||
echo "Starting home manager activation"
|
||||
|
||||
# Verify that we can connect to the Nix store and/or daemon. This will
|
||||
# also create the necessary directories in profiles and gcroots.
|
||||
$VERBOSE_ECHO "Sanity checking Nix"
|
||||
nix-build --expr '{}' --no-out-link
|
||||
|
||||
setupVars
|
||||
|
||||
if [[ -v DRY_RUN ]] ; then
|
||||
@@ -78,6 +81,5 @@ else
|
||||
fi
|
||||
$VERBOSE_ECHO " newGenPath=$newGenPath"
|
||||
$VERBOSE_ECHO " newGenNum=$newGenNum"
|
||||
$VERBOSE_ECHO " newGenProfilePath=$newGenProfilePath"
|
||||
$VERBOSE_ECHO " newGenGcPath=$newGenGcPath"
|
||||
$VERBOSE_ECHO " genProfilePath=$genProfilePath"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -17,7 +17,7 @@ rec {
|
||||
};
|
||||
|
||||
gvariant = import ./gvariant.nix { inherit lib; };
|
||||
|
||||
maintainers = import ./maintainers.nix;
|
||||
strings = import ./strings.nix { inherit lib; };
|
||||
types = import ./types.nix { inherit dag gvariant lib; };
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ with lib;
|
||||
# Arguments:
|
||||
# - basePathDesc docbook compatible description of the base path
|
||||
# - basePath the file base path
|
||||
fileType = basePathDesc: basePath: types.loaOf (types.submodule (
|
||||
fileType = basePathDesc: basePath: types.attrsOf (types.submodule (
|
||||
{ name, config, ... }: {
|
||||
options = {
|
||||
target = mkOption {
|
||||
@@ -21,6 +21,7 @@ with lib;
|
||||
absPath = if hasPrefix "/" p then p else "${basePath}/${p}";
|
||||
in
|
||||
removePrefix (homeDirectory + "/") absPath;
|
||||
defaultText = literalExample "<name>";
|
||||
description = ''
|
||||
Path to target file relative to ${basePathDesc}.
|
||||
'';
|
||||
@@ -29,17 +30,20 @@ with lib;
|
||||
text = mkOption {
|
||||
default = null;
|
||||
type = types.nullOr types.lines;
|
||||
description = "Text of the file.";
|
||||
description = ''
|
||||
Text of the file. If this option is null then
|
||||
<link linkend="opt-home.file._name_.source">home.file.<name?>.source</link>
|
||||
must be set.
|
||||
'';
|
||||
};
|
||||
|
||||
source = mkOption {
|
||||
type = types.path;
|
||||
description = ''
|
||||
Path of the source file. The file name must not start
|
||||
with a period since Nix will not allow such names in
|
||||
the Nix store.
|
||||
</para><para>
|
||||
This may refer to a directory.
|
||||
Path of the source file or directory. If
|
||||
<link linkend="opt-home.file._name_.text">home.file.<name?>.text</link>
|
||||
is non-null then this option will automatically point to a file
|
||||
containing that text.
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ let
|
||||
|
||||
type = {
|
||||
arrayOf = t: "a${t}";
|
||||
maybeOf = t: "m${t}";
|
||||
tupleOf = ts: "(${concatStrings ts})";
|
||||
string = "s";
|
||||
boolean = "b";
|
||||
@@ -57,11 +58,21 @@ let
|
||||
else
|
||||
"";
|
||||
|
||||
mkMaybe = elemType: elem:
|
||||
mkPrimitive (type.maybeOf elemType) elem // {
|
||||
__toString = self:
|
||||
if self.value == null then
|
||||
"@${self.type} nothing"
|
||||
else
|
||||
"just ${toString self.value}";
|
||||
};
|
||||
|
||||
in rec {
|
||||
|
||||
inherit type typeOf;
|
||||
|
||||
isArray = hasPrefix "a";
|
||||
isMaybe = hasPrefix "m";
|
||||
isTuple = hasPrefix "(";
|
||||
|
||||
# Returns the GVariant value that most closely matches the given Nix
|
||||
@@ -92,6 +103,10 @@ in rec {
|
||||
|
||||
mkEmptyArray = elemType: mkArray elemType [ ];
|
||||
|
||||
mkNothing = elemType: mkMaybe elemType null;
|
||||
|
||||
mkJust = elem: let gvarElem = mkValue elem; in mkMaybe gvarElem.type gvarElem;
|
||||
|
||||
mkTuple = elems:
|
||||
let
|
||||
gvarElems = map mkValue elems;
|
||||
@@ -108,7 +123,7 @@ in rec {
|
||||
|
||||
mkString = v:
|
||||
mkPrimitive type.string v // {
|
||||
__toString = self: "'${escape [ "'" ] self.value}'";
|
||||
__toString = self: "'${escape [ "'" "\\" ] self.value}'";
|
||||
};
|
||||
|
||||
mkObjectpath = v:
|
||||
|
||||
68
modules/lib/maintainers.nix
Normal file
68
modules/lib/maintainers.nix
Normal file
@@ -0,0 +1,68 @@
|
||||
# Home Manager maintainers.
|
||||
#
|
||||
# This attribute set contains Home Manager module maintainers that do
|
||||
# not have an entry in the Nixpkgs maintainer list [1]. Entries here
|
||||
# are expected to be follow the same format as described in [1].
|
||||
#
|
||||
# [1] https://github.com/NixOS/nixpkgs/blob/fca0d6e093c82b31103dc0dacc48da2a9b06e24b/maintainers/maintainer-list.nix#LC1
|
||||
|
||||
{
|
||||
justinlovinger = {
|
||||
name = "Justin Lovinger";
|
||||
email = "git@justinlovinger.com";
|
||||
github = "JustinLovinger";
|
||||
githubId = 7183441;
|
||||
};
|
||||
owm111 = {
|
||||
email = "7798336+owm111@users.noreply.github.com";
|
||||
name = "Owen McGrath";
|
||||
github = "owm111";
|
||||
githubId = 7798336;
|
||||
};
|
||||
cwyc = {
|
||||
email = "cwyc@users.noreply.github.com";
|
||||
name = "cwyc";
|
||||
github = "cwyc";
|
||||
githubId = 16950437;
|
||||
};
|
||||
olmokramer = {
|
||||
name = "Olmo Kramer";
|
||||
email = "olmokramer@users.noreply.github.com";
|
||||
github = "olmokramer";
|
||||
githubId = 3612514;
|
||||
};
|
||||
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";
|
||||
};
|
||||
}
|
||||
@@ -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.
|
||||
'';
|
||||
};
|
||||
};
|
||||
@@ -77,6 +86,8 @@ in rec {
|
||||
(map (d: d // { value = d.value.value; }) vdefs)
|
||||
else if gvar.isTuple sharedDefType && allChecked then
|
||||
mergeOneOption loc defs
|
||||
else if gvar.isMaybe sharedDefType && allChecked then
|
||||
mergeOneOption loc defs
|
||||
else if gvar.type.string == sharedDefType && allChecked then
|
||||
types.str.merge loc defs
|
||||
else if gvar.type.double == sharedDefType && allChecked then
|
||||
|
||||
@@ -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.gnome3.dconf}/bin/dconf load / "<" ${iniFile}
|
||||
else
|
||||
$DCONF_DBUS_RUN_SESSION ${pkgs.gnome3.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
|
||||
'');
|
||||
};
|
||||
}
|
||||
|
||||
@@ -11,21 +11,22 @@ let
|
||||
toGtk3Ini = generators.toINI {
|
||||
mkKeyValue = key: value:
|
||||
let
|
||||
value' =
|
||||
if isBool value then (if value then "true" else "false")
|
||||
else toString value;
|
||||
in
|
||||
"${key}=${value'}";
|
||||
value' = if isBool value then
|
||||
(if value then "true" else "false")
|
||||
else
|
||||
toString value;
|
||||
in "${key}=${value'}";
|
||||
};
|
||||
|
||||
formatGtk2Option = n: v:
|
||||
let
|
||||
v' =
|
||||
if isBool v then (if v then "true" else "false")
|
||||
else if isString v then "\"${v}\""
|
||||
else toString v;
|
||||
in
|
||||
"${n} = ${v'}";
|
||||
v' = if isBool v then
|
||||
(if v then "true" else "false")
|
||||
else if isString v then
|
||||
''"${v}"''
|
||||
else
|
||||
toString v;
|
||||
in "${n} = ${v'}";
|
||||
|
||||
themeType = types.submodule {
|
||||
options = {
|
||||
@@ -48,13 +49,11 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
in {
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
|
||||
imports = [
|
||||
(mkRemovedOptionModule ["gtk" "gtk3" "waylandSupport"] ''
|
||||
(mkRemovedOptionModule [ "gtk" "gtk3" "waylandSupport" ] ''
|
||||
This options is not longer needed and can be removed.
|
||||
'')
|
||||
];
|
||||
@@ -105,8 +104,11 @@ in
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = with types; attrsOf (either bool (either int str));
|
||||
default = {};
|
||||
example = { gtk-cursor-blink = false; gtk-recent-files-limit = 20; };
|
||||
default = { };
|
||||
example = {
|
||||
gtk-cursor-blink = false;
|
||||
gtk-recent-files-limit = 20;
|
||||
};
|
||||
description = ''
|
||||
Extra configuration options to add to
|
||||
<filename>~/.config/gtk-3.0/settings.ini</filename>.
|
||||
@@ -125,52 +127,42 @@ 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; }
|
||||
//
|
||||
optionalAttrs (cfg.iconTheme != null)
|
||||
{ gtk-icon-theme-name = cfg.iconTheme.name; };
|
||||
config = mkIf cfg.enable (let
|
||||
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; }
|
||||
//
|
||||
optionalAttrs (cfg.iconTheme != null)
|
||||
{ icon-theme = cfg.iconTheme.name; };
|
||||
dconfIni = optionalAttrs (cfg.font != null) { font-name = cfg.font.name; }
|
||||
// optionalAttrs (cfg.theme != null) { gtk-theme = cfg.theme.name; }
|
||||
// optionalAttrs (cfg.iconTheme != null) {
|
||||
icon-theme = cfg.iconTheme.name;
|
||||
};
|
||||
|
||||
optionalPackage = opt:
|
||||
optional (opt != null && opt.package != null) opt.package;
|
||||
in
|
||||
{
|
||||
home.packages =
|
||||
optionalPackage cfg.font
|
||||
++ optionalPackage cfg.theme
|
||||
++ optionalPackage cfg.iconTheme;
|
||||
optionalPackage = opt:
|
||||
optional (opt != null && opt.package != null) opt.package;
|
||||
in {
|
||||
home.packages = optionalPackage cfg.font ++ optionalPackage cfg.theme
|
||||
++ optionalPackage cfg.iconTheme;
|
||||
|
||||
home.file.".gtkrc-2.0".text =
|
||||
concatStringsSep "\n" (
|
||||
mapAttrsToList formatGtk2Option ini
|
||||
) + "\n" + cfg2.extraConfig;
|
||||
home.file.".gtkrc-2.0".text =
|
||||
concatStringsSep "\n" (mapAttrsToList formatGtk2Option ini) + "\n"
|
||||
+ cfg2.extraConfig;
|
||||
|
||||
xdg.configFile."gtk-3.0/settings.ini".text =
|
||||
toGtk3Ini { Settings = ini // cfg3.extraConfig; };
|
||||
xdg.configFile."gtk-3.0/settings.ini".text =
|
||||
toGtk3Ini { Settings = ini // cfg3.extraConfig; };
|
||||
|
||||
xdg.configFile."gtk-3.0/gtk.css".text = cfg3.extraCss;
|
||||
xdg.configFile."gtk-3.0/gtk.css".text = cfg3.extraCss;
|
||||
|
||||
xdg.configFile."gtk-3.0/bookmarks" = mkIf (cfg3.bookmarks != []) {
|
||||
text = concatStringsSep "\n" cfg3.bookmarks;
|
||||
};
|
||||
xdg.configFile."gtk-3.0/bookmarks" = mkIf (cfg3.bookmarks != [ ]) {
|
||||
text = concatStringsSep "\n" cfg3.bookmarks;
|
||||
};
|
||||
|
||||
dconf.settings."org/gnome/desktop/interface" = dconfIni;
|
||||
}
|
||||
);
|
||||
dconf.settings."org/gnome/desktop/interface" = dconfIni;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -452,7 +452,7 @@ in
|
||||
|
||||
{
|
||||
time = "2017-12-11T17:23:12+00:00";
|
||||
condition = config.home.activation ? reloadSystemD;
|
||||
condition = config.home.activation ? reloadSystemd;
|
||||
message = ''
|
||||
The Boolean option 'systemd.user.startServices' is now
|
||||
available. When enabled the current naive systemd unit
|
||||
@@ -508,7 +508,7 @@ in
|
||||
configuration you can add
|
||||
|
||||
imports = [
|
||||
"''${builtins.fetchTarball https://github.com/rycee/home-manager/archive/master.tar.gz}/nixos"
|
||||
"''${builtins.fetchTarball https://github.com/nix-community/home-manager/archive/master.tar.gz}/nixos"
|
||||
];
|
||||
|
||||
to your 'configuration.nix' file. This will introduce a new
|
||||
@@ -1363,7 +1363,7 @@ in
|
||||
|
||||
To learn more, see the installation section of the manual
|
||||
|
||||
https://rycee.gitlab.io/home-manager/#sec-install-nixos-module
|
||||
https://nix-community.github.io/home-manager/#sec-install-nixos-module
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -1474,6 +1474,419 @@ in
|
||||
A new module is available: 'services.mako'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-04-23T19:45:26+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.lf'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-04-26T13:46:28+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.pulseeffects'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-05-03T11:13:07+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.i3status'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-05-03T11:21:42+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.aria2'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-05-04T21:19:43+00:00";
|
||||
condition = config.programs.git.enable;
|
||||
message = ''
|
||||
The Git module now supports the 'delta' syntax highlighter.
|
||||
|
||||
It can be enabled through the option 'programs.git.delta.enable'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-05-12T20:09:54+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.dircolors'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-05-26T17:13:58+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.zoxide'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-06-03T17:46:11+00:00";
|
||||
condition = config.programs.ssh.enable;
|
||||
message = ''
|
||||
The ssh module now supports the 'ServerAliveCountMax' option
|
||||
both globally through
|
||||
|
||||
programs.ssh.serverAliveCountMax
|
||||
|
||||
and per match blocks
|
||||
|
||||
programs.ssh.matchBlocks.<name>.serverAliveCountMax
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-06-11T18:06:37+00:00";
|
||||
condition = hostPlatform.isLinux && config.services.emacs.enable;
|
||||
message = ''
|
||||
The Emacs service now supports systemd socket activation.
|
||||
|
||||
It can be enabled through the option 'services.emacs.socketActivation.enable'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-06-12T17:48:01+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.clipmenu'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-06-12T07:08:09+00:00";
|
||||
condition = config.programs.bash.enable;
|
||||
message = ''
|
||||
A new module is available: 'programs.powerline-go'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-06-14T13:30:19+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'service.fluidsynth'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-06-17T22:17:52+00:00";
|
||||
condition = config.programs.git.enable;
|
||||
message = ''
|
||||
Since May 1, 2020 string values in Git configurations are
|
||||
automatically escaped. If you have any manually escaped characters,
|
||||
then you may need to restore them to their unescaped form to avoid
|
||||
double escaping.
|
||||
|
||||
In other words, if you now have something along the lines of
|
||||
|
||||
programs.git.aliases.hello = '''"!echo $'Hello\\nWorld'"''';
|
||||
|
||||
you must replace it by the unescaped form
|
||||
|
||||
programs.git.aliases.hello = "!echo $'Hello\nWorld'";
|
||||
|
||||
Apologies for the belated notification!
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-06-23T20:06:39+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.ne'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-07-24T15:03:11+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.nushell'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-07-25T21:04:59+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.dropbox'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-08-13T22:15:27+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'programs.waybar'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-08-14T22:44:20+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.kanshi'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-08-25T22:14:01+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.mcfly'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-09-01T18:38:18+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.ncmpcpp'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-09-11T10:06:47+00:00";
|
||||
condition = hostPlatform.isLinux && config.targets.genericLinux.enable;
|
||||
message = ''
|
||||
A new option 'targets.genericLinux.extraXdgDataDirs' is available
|
||||
to setup the user environment with the OS's data files.
|
||||
|
||||
This is useful for example to get Bash completion for
|
||||
'systemctl' which shouldn't be installed through Home Manager.
|
||||
|
||||
This is also useful to have non Home Manager applications
|
||||
available in menus.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-09-09T06:54:59+00:00";
|
||||
condition = config.programs.man.enable;
|
||||
message = ''
|
||||
A new option 'programs.man.generateCaches' was added to
|
||||
support the apropos command.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-09-22T21:03:28+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.pet'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-09-29T21:21:44+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.mu'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-10-08T21:28:16+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.autojump'
|
||||
|
||||
The option `programs.bash.enableAutojump` is deprecated and this new
|
||||
module should be used instead.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-10-12T00:12:23+00:00";
|
||||
condition = config.programs.zsh.enable;
|
||||
message = ''
|
||||
A new zsh submodule is available: 'programs.zsh.prezto'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-10-22T21:10:38+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.gammastep'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-10-22T21:30:42+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.gh'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-11-01T11:17:02+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
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'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Adapted from Nixpkgs.
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, pkgs, pkgsPath, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
@@ -49,7 +49,7 @@ let
|
||||
merge = lib.mergeOneOption;
|
||||
};
|
||||
|
||||
_pkgs = import <nixpkgs> (
|
||||
_pkgs = import pkgsPath (
|
||||
filterAttrs (n: v: v != null) config.nixpkgs
|
||||
);
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ let
|
||||
cfg = config.xsession.numlock;
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.evanjs ];
|
||||
|
||||
options = { xsession.numlock.enable = mkEnableOption "Num Lock"; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
@@ -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.
|
||||
|
||||
49
modules/misc/tmpfiles.nix
Normal file
49
modules/misc/tmpfiles.nix
Normal file
@@ -0,0 +1,49 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.systemd.user.tmpfiles;
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.dawidsowa ];
|
||||
|
||||
options.systemd.user.tmpfiles.rules = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = [ "L /home/user/Documents - - - - /mnt/data/Documents" ];
|
||||
description = ''
|
||||
Rules for creating and cleaning up temporary files
|
||||
automatically. See
|
||||
<citerefentry>
|
||||
<refentrytitle>tmpfiles.d</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry>
|
||||
for the exact format.
|
||||
'';
|
||||
};
|
||||
|
||||
config = mkIf (cfg.rules != [ ]) {
|
||||
xdg = {
|
||||
dataFile."user-tmpfiles.d/home-manager.conf" = {
|
||||
text = ''
|
||||
# This file is created automatically and should not be modified.
|
||||
# Please change the option ‘systemd.user.tmpfiles.rules’ instead.
|
||||
${concatStringsSep "\n" cfg.rules}
|
||||
'';
|
||||
onChange = "${pkgs.systemd}/bin/systemd-tmpfiles --user --create";
|
||||
};
|
||||
configFile = {
|
||||
"systemd/user/basic.target.wants/systemd-tmpfiles-setup.service".source =
|
||||
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-setup.service";
|
||||
"systemd/user/systemd-tmpfiles-setup.service".source =
|
||||
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-setup.service";
|
||||
"systemd/user/timers.target.wants/systemd-tmpfiles-clean.timer".source =
|
||||
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-clean.timer";
|
||||
"systemd/user/systemd-tmpfiles-clean.service".source =
|
||||
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-clean.service";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -5,7 +5,8 @@ with lib;
|
||||
{
|
||||
options = {
|
||||
home.stateVersion = mkOption {
|
||||
type = types.enum [ "18.09" "19.03" "19.09" "20.03" "20.09" ];
|
||||
type =
|
||||
types.enum [ "18.09" "19.03" "19.09" "20.03" "20.09" "21.03" "21.05" ];
|
||||
default = "18.09";
|
||||
description = ''
|
||||
It is occasionally necessary for Home Manager to change
|
||||
|
||||
51
modules/misc/vte.nix
Normal file
51
modules/misc/vte.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
|
||||
options.programs = let
|
||||
description = ''
|
||||
Whether to enable integration with terminals using the VTE
|
||||
library. This will let the terminal track the current working
|
||||
directory.
|
||||
'';
|
||||
in {
|
||||
bash.enableVteIntegration = mkEnableOption "" // { inherit description; };
|
||||
|
||||
zsh.enableVteIntegration = mkEnableOption "" // { inherit description; };
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf config.programs.bash.enableVteIntegration {
|
||||
# Unfortunately we have to do a little dance here to fix two
|
||||
# problems with the upstream vte.sh file:
|
||||
#
|
||||
# - It does `PROMPT_COMMAND="__vte_prompt_command"` which
|
||||
# clobbers any previously assigned prompt command.
|
||||
#
|
||||
# - Its `__vte_prompt_command` function runs commands that will
|
||||
# overwrite the exit status of the command the user ran.
|
||||
programs.bash.initExtra = ''
|
||||
__HM_PROMPT_COMMAND="''${PROMPT_COMMAND:+''${PROMPT_COMMAND%;};}__hm_vte_prompt_command"
|
||||
. ${pkgs.vte}/etc/profile.d/vte.sh
|
||||
if [[ $(type -t __vte_prompt_command) = function ]]; then
|
||||
__hm_vte_prompt_command() {
|
||||
local old_exit_status=$?
|
||||
__vte_prompt_command
|
||||
return $old_exit_status
|
||||
}
|
||||
PROMPT_COMMAND="$__HM_PROMPT_COMMAND"
|
||||
fi
|
||||
unset __HM_PROMPT_COMMAND
|
||||
'';
|
||||
})
|
||||
|
||||
(mkIf config.programs.zsh.enableVteIntegration {
|
||||
programs.zsh.initExtra = ''
|
||||
. ${pkgs.vte}/etc/profile.d/vte.sh
|
||||
'';
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -74,7 +74,7 @@ in {
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Deprecated but still used by some applications.
|
||||
home.file.".local/share/applications/mimeapps.list".source =
|
||||
xdg.dataFile."applications/mimeapps.list".source =
|
||||
config.xdg.configFile."mimeapps.list".source;
|
||||
|
||||
xdg.configFile."mimeapps.list".text =
|
||||
|
||||
@@ -27,10 +27,18 @@ in {
|
||||
home.packages = [
|
||||
# Explicitly install package to provide basic mime types.
|
||||
pkgs.shared-mime-info
|
||||
|
||||
# Make sure the target directories will be real directories.
|
||||
(pkgs.runCommandLocal "dummy-xdg-mime-dirs1" { } ''
|
||||
mkdir -p $out/share/{applications,mime/packages}
|
||||
'')
|
||||
(pkgs.runCommandLocal "dummy-xdg-mime-dirs2" { } ''
|
||||
mkdir -p $out/share/{applications,mime/packages}
|
||||
'')
|
||||
];
|
||||
|
||||
home.extraProfileCommands = ''
|
||||
if [[ -w $out/share/mime && -d $out/share/mime/packages ]]; then
|
||||
if [[ -w $out/share/mime && -w $out/share/mime/packages && -d $out/share/mime/packages ]]; then
|
||||
XDG_DATA_DIRS=$out/share \
|
||||
PKGSYSTEM_ENABLE_FSYNC=0 \
|
||||
${pkgs.buildPackages.shared-mime-info}/bin/update-mime-database \
|
||||
|
||||
@@ -86,10 +86,13 @@ 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 = generators.toKeyValue { } ({
|
||||
config = let
|
||||
directories = {
|
||||
XDG_DESKTOP_DIR = cfg.desktop;
|
||||
XDG_DOCUMENTS_DIR = cfg.documents;
|
||||
XDG_DOWNLOAD_DIR = cfg.download;
|
||||
@@ -98,8 +101,21 @@ in {
|
||||
XDG_PUBLICSHARE_DIR = cfg.publicShare;
|
||||
XDG_TEMPLATES_DIR = cfg.templates;
|
||||
XDG_VIDEOS_DIR = cfg.videos;
|
||||
} // cfg.extraConfig);
|
||||
} // cfg.extraConfig;
|
||||
in mkIf cfg.enable {
|
||||
xdg.configFile."user-dirs.dirs".text = let
|
||||
# For some reason, these need to be wrapped with quotes to be valid.
|
||||
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);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -85,19 +85,29 @@ in
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf (!cfg.enable) {
|
||||
# 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;
|
||||
})
|
||||
|
||||
# "Modern" deterministic setup.
|
||||
(mkIf (!cfg.enable && versionAtLeast config.home.stateVersion "20.09") {
|
||||
xdg.cacheHome = mkDefault defaultCacheHome;
|
||||
xdg.configHome = mkDefault defaultConfigHome;
|
||||
xdg.dataHome = mkDefault defaultDataHome;
|
||||
})
|
||||
|
||||
{
|
||||
home.file = mkMerge [
|
||||
cfg.configFile
|
||||
cfg.dataFile
|
||||
{
|
||||
"${config.xdg.cacheHome}/.keep".text = "";
|
||||
}
|
||||
(mapAttrs'
|
||||
(name: file: nameValuePair "${config.xdg.configHome}/${name}" file)
|
||||
cfg.configFile)
|
||||
(mapAttrs'
|
||||
(name: file: nameValuePair "${config.xdg.dataHome}/${name}" file)
|
||||
cfg.dataFile)
|
||||
{ "${config.xdg.cacheHome}/.keep".text = ""; }
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
@@ -22,6 +22,7 @@ let
|
||||
|
||||
allModules = [
|
||||
(loadModule ./accounts/email.nix { })
|
||||
(loadModule ./config/i18n.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./files.nix { })
|
||||
(loadModule ./home-environment.nix { })
|
||||
(loadModule ./manual.nix { })
|
||||
@@ -36,7 +37,9 @@ let
|
||||
(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; })
|
||||
@@ -45,15 +48,18 @@ let
|
||||
(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 { condition = hostPlatform.isLinux; })
|
||||
(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 { })
|
||||
@@ -62,12 +68,15 @@ let
|
||||
(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/i3status-rust.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./programs/info.nix { })
|
||||
(loadModule ./programs/irssi.nix { })
|
||||
(loadModule ./programs/lieer.nix { })
|
||||
@@ -76,30 +85,41 @@ let
|
||||
(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/octant.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/rofi-pass.nix { })
|
||||
(loadModule ./programs/rtorrent.nix { })
|
||||
(loadModule ./programs/skim.nix { })
|
||||
(loadModule ./programs/starship.nix { })
|
||||
(loadModule ./programs/sbt.nix { })
|
||||
(loadModule ./programs/ssh.nix { })
|
||||
(loadModule ./programs/taskwarrior.nix { })
|
||||
(loadModule ./programs/termite.nix { })
|
||||
@@ -109,22 +129,32 @@ let
|
||||
(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/redshift-gammastep/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 { })
|
||||
@@ -143,10 +173,14 @@ let
|
||||
(loadModule ./services/parcellite.nix { })
|
||||
(loadModule ./services/password-store-sync.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/pasystray.nix { })
|
||||
(loadModule ./services/pbgopy.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/picom.nix { })
|
||||
(loadModule ./services/plan9port.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/playerctld.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/polybar.nix { })
|
||||
(loadModule ./services/pulseeffects.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/random-background.nix { })
|
||||
(loadModule ./services/redshift.nix { })
|
||||
(loadModule ./services/redshift-gammastep/redshift.nix { })
|
||||
(loadModule ./services/rsibreak.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./services/screen-locker.nix { })
|
||||
(loadModule ./services/stalonetray.nix { })
|
||||
@@ -165,11 +199,13 @@ let
|
||||
(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/wlsunset.nix { condition = hostPlatform.isLinux; })
|
||||
(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 { condition = hostPlatform.isDarwin; })
|
||||
(loadModule ./targets/generic-linux.nix { condition = hostPlatform.isLinux; })
|
||||
(loadModule ./xcursor.nix { })
|
||||
(loadModule ./xresources.nix { })
|
||||
@@ -180,9 +216,14 @@ let
|
||||
|
||||
modules = map (getAttr "file") (filter (getAttr "condition") allModules);
|
||||
|
||||
pkgsModule = {
|
||||
pkgsModule = { config, ... }: {
|
||||
config = {
|
||||
_module.args.baseModules = modules;
|
||||
_module.args.pkgsPath = lib.mkDefault (
|
||||
if versionAtLeast config.home.stateVersion "20.09" then
|
||||
pkgs.path
|
||||
else
|
||||
<nixpkgs>);
|
||||
_module.args.pkgs = lib.mkDefault pkgs;
|
||||
_module.check = check;
|
||||
lib = lib.hm;
|
||||
|
||||
@@ -3,16 +3,22 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.alacritty;
|
||||
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
in {
|
||||
options = {
|
||||
programs.alacritty = {
|
||||
enable = mkEnableOption "Alacritty";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.alacritty;
|
||||
defaultText = literalExample "pkgs.alacritty";
|
||||
description = "The Alacritty package to install.";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = types.attrs;
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
example = literalExample ''
|
||||
{
|
||||
@@ -41,9 +47,14 @@ in {
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf cfg.enable {
|
||||
home.packages = [ pkgs.alacritty ];
|
||||
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,167 +7,234 @@ let
|
||||
|
||||
cfg = config.programs.alot;
|
||||
|
||||
alotAccounts = filter (a: a.notmuch.enable)
|
||||
(attrValues config.accounts.email.accounts);
|
||||
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";
|
||||
|
||||
accountStr = account: with account;
|
||||
concatStringsSep "\n" (
|
||||
[ "[[${name}]]" ]
|
||||
++ mapAttrsToList (n: v: n + "=" + v) (
|
||||
{
|
||||
address = address;
|
||||
realname = realName;
|
||||
sendmail_command =
|
||||
optionalString (alot.sendMailCommand != null) alot.sendMailCommand;
|
||||
sent_box = "maildir" + "://" + maildir.absPath + "/" + folders.sent;
|
||||
draft_box = "maildir" + "://"+ maildir.absPath + "/" + folders.drafts;
|
||||
}
|
||||
// optionalAttrs (aliases != []) {
|
||||
aliases = concatStringsSep "," aliases;
|
||||
}
|
||||
// optionalAttrs (gpg != null) {
|
||||
gpg_key = gpg.key;
|
||||
encrypt_by_default = if gpg.encryptByDefault then "all" else "none";
|
||||
sign_by_default = boolStr gpg.signByDefault;
|
||||
}
|
||||
// optionalAttrs (signature.showSignature != "none") {
|
||||
signature = pkgs.writeText "signature.txt" signature.text;
|
||||
signature_as_attachment =
|
||||
boolStr (signature.showSignature == "attach");
|
||||
}
|
||||
)
|
||||
++ [ alot.extraConfig ]
|
||||
++ [ "[[[abook]]]" ]
|
||||
++ mapAttrsToList (n: v: n + "=" + v) alot.contactCompletion
|
||||
);
|
||||
mkKeyValue = key: value:
|
||||
let value' = if isBool value then boolStr value else toString value;
|
||||
in "${key} = ${value'}";
|
||||
|
||||
configFile =
|
||||
let
|
||||
bindingsToStr = attrSet:
|
||||
concatStringsSep "\n" (mapAttrsToList (n: v: "${n} = ${v}") attrSet);
|
||||
in
|
||||
''
|
||||
# Generated by Home Manager.
|
||||
# See http://alot.readthedocs.io/en/latest/configuration/config_options.html
|
||||
mk2ndLevelSectionName = name: "[" + name + "]";
|
||||
|
||||
${cfg.extraConfig}
|
||||
tagSubmodule = types.submodule {
|
||||
options = {
|
||||
translated = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = ''
|
||||
Fixed string representation for this tag. The tag can be
|
||||
hidden from view, if the key translated is set to
|
||||
<literal>""</literal>, the empty string.
|
||||
'';
|
||||
};
|
||||
|
||||
[bindings]
|
||||
${bindingsToStr cfg.bindings.global}
|
||||
translation = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
A pair of strings that define a regular substitution to
|
||||
compute the string representation on the fly using
|
||||
<literal>re.sub</literal>.
|
||||
'';
|
||||
};
|
||||
|
||||
[[bufferlist]]
|
||||
${bindingsToStr cfg.bindings.bufferlist}
|
||||
[[search]]
|
||||
${bindingsToStr cfg.bindings.search}
|
||||
[[envelope]]
|
||||
${bindingsToStr cfg.bindings.envelope}
|
||||
[[taglist]]
|
||||
${bindingsToStr cfg.bindings.taglist}
|
||||
[[thread]]
|
||||
${bindingsToStr cfg.bindings.thread}
|
||||
normal = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
example = "'','', 'white','light red', 'white','#d66'";
|
||||
description = ''
|
||||
How to display the tag when unfocused.
|
||||
See <link xlink:href="https://alot.readthedocs.io/en/latest/configuration/theming.html#tagstring-formatting"/>.
|
||||
'';
|
||||
};
|
||||
|
||||
[accounts]
|
||||
|
||||
${concatStringsSep "\n\n" (map accountStr alotAccounts)}
|
||||
'';
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
options.programs.alot = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = ''
|
||||
Whether to enable the Alot mail user agent. Alot uses the
|
||||
Notmuch email system and will therefore be automatically
|
||||
enabled for each email account that is managed by Notmuch.
|
||||
'';
|
||||
focus = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "How to display the tag when focused.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
hooks = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Content of the hooks file.
|
||||
'';
|
||||
};
|
||||
accountStr = account:
|
||||
with account;
|
||||
concatStringsSep "\n" ([ "[[${name}]]" ]
|
||||
++ mapAttrsToList (n: v: n + "=" + v) ({
|
||||
address = address;
|
||||
realname = realName;
|
||||
sendmail_command =
|
||||
optionalString (alot.sendMailCommand != null) alot.sendMailCommand;
|
||||
sent_box = "maildir" + "://" + maildir.absPath + "/" + folders.sent;
|
||||
draft_box = "maildir" + "://" + maildir.absPath + "/" + folders.drafts;
|
||||
} // optionalAttrs (aliases != [ ]) {
|
||||
aliases = concatStringsSep "," aliases;
|
||||
} // optionalAttrs (gpg != null) {
|
||||
gpg_key = gpg.key;
|
||||
encrypt_by_default = if gpg.encryptByDefault then "all" else "none";
|
||||
sign_by_default = boolStr gpg.signByDefault;
|
||||
} // optionalAttrs (signature.showSignature != "none") {
|
||||
signature = pkgs.writeText "signature.txt" signature.text;
|
||||
signature_as_attachment = boolStr (signature.showSignature == "attach");
|
||||
}) ++ [ alot.extraConfig ] ++ [ "[[[abook]]]" ]
|
||||
++ mapAttrsToList (n: v: n + "=" + v) alot.contactCompletion);
|
||||
|
||||
bindings = mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
global = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = {};
|
||||
description = "Global keybindings.";
|
||||
};
|
||||
configFile = let
|
||||
bindingsToStr = attrSet:
|
||||
concatStringsSep "\n" (mapAttrsToList (n: v: "${n} = ${v}") attrSet);
|
||||
in ''
|
||||
# Generated by Home Manager.
|
||||
# See http://alot.readthedocs.io/en/latest/configuration/config_options.html
|
||||
|
||||
bufferlist = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = {};
|
||||
description = "Bufferlist mode keybindings.";
|
||||
};
|
||||
${generators.toKeyValue { inherit mkKeyValue; } cfg.settings}
|
||||
${cfg.extraConfig}
|
||||
[tags]
|
||||
'' + (let
|
||||
submoduleToAttrs = m:
|
||||
filterAttrs (name: v: name != "_module" && v != null) m;
|
||||
in generators.toINI { mkSectionName = mk2ndLevelSectionName; }
|
||||
(mapAttrs (name: x: submoduleToAttrs x) cfg.tags)) + ''
|
||||
[bindings]
|
||||
${bindingsToStr cfg.bindings.global}
|
||||
|
||||
search = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = {};
|
||||
description = "Search mode keybindings.";
|
||||
};
|
||||
[[bufferlist]]
|
||||
${bindingsToStr cfg.bindings.bufferlist}
|
||||
[[search]]
|
||||
${bindingsToStr cfg.bindings.search}
|
||||
[[envelope]]
|
||||
${bindingsToStr cfg.bindings.envelope}
|
||||
[[taglist]]
|
||||
${bindingsToStr cfg.bindings.taglist}
|
||||
[[thread]]
|
||||
${bindingsToStr cfg.bindings.thread}
|
||||
|
||||
envelope = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = {};
|
||||
description = "Envelope mode keybindings.";
|
||||
};
|
||||
[accounts]
|
||||
|
||||
taglist = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = {};
|
||||
description = "Taglist mode keybindings.";
|
||||
};
|
||||
${concatStringsSep "\n\n" (map accountStr alotAccounts)}
|
||||
'';
|
||||
|
||||
thread = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = {};
|
||||
description = "Thread mode keybindings.";
|
||||
in {
|
||||
options = {
|
||||
programs.alot = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = ''
|
||||
Whether to enable the Alot mail user agent. Alot uses the
|
||||
Notmuch email system and will therefore be automatically
|
||||
enabled for each email account that is managed by Notmuch.
|
||||
'';
|
||||
};
|
||||
|
||||
hooks = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Content of the hooks file.
|
||||
'';
|
||||
};
|
||||
|
||||
bindings = mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
global = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = { };
|
||||
description = "Global keybindings.";
|
||||
};
|
||||
|
||||
bufferlist = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = { };
|
||||
description = "Bufferlist mode keybindings.";
|
||||
};
|
||||
|
||||
search = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = { };
|
||||
description = "Search mode keybindings.";
|
||||
};
|
||||
|
||||
envelope = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = { };
|
||||
description = "Envelope mode keybindings.";
|
||||
};
|
||||
|
||||
taglist = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = { };
|
||||
description = "Taglist mode keybindings.";
|
||||
};
|
||||
|
||||
thread = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = { };
|
||||
description = "Thread mode keybindings.";
|
||||
};
|
||||
};
|
||||
};
|
||||
default = { };
|
||||
description = ''
|
||||
Keybindings.
|
||||
'';
|
||||
};
|
||||
|
||||
tags = mkOption {
|
||||
type = types.attrsOf tagSubmodule;
|
||||
default = { };
|
||||
description = "How to display the tags.";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = with types;
|
||||
let primitive = either (either (either str int) bool) float;
|
||||
in attrsOf primitive;
|
||||
default = {
|
||||
initial_command = "search tag:inbox AND NOT tag:killed";
|
||||
auto_remove_unread = true;
|
||||
handle_mouse = true;
|
||||
prefer_plaintext = true;
|
||||
};
|
||||
example = literalExample ''
|
||||
{
|
||||
auto_remove_unread = true;
|
||||
ask_subject = false;
|
||||
thread_indent_replies = 2;
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Configuration options added to alot configuration file.
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Extra lines added to alot configuration file.
|
||||
'';
|
||||
};
|
||||
default = {};
|
||||
description = ''
|
||||
Keybindings.
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = ''
|
||||
auto_remove_unread = True
|
||||
ask_subject = False
|
||||
handle_mouse = True
|
||||
initial_command = "search tag:inbox AND NOT tag:killed"
|
||||
input_timeout = 0.3
|
||||
prefer_plaintext = True
|
||||
thread_indent_replies = 4
|
||||
'';
|
||||
description = ''
|
||||
Extra lines added to alot configuration file.
|
||||
'';
|
||||
accounts.email.accounts = mkOption {
|
||||
type = with types; attrsOf (submodule (import ./alot-accounts.nix pkgs));
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.alot ];
|
||||
home.packages = [ pkgs.alot ];
|
||||
|
||||
xdg.configFile."alot/config".text = configFile;
|
||||
|
||||
xdg.configFile."alot/hooks.py".text =
|
||||
''
|
||||
xdg.configFile."alot/hooks.py" = mkIf (cfg.hooks != "") {
|
||||
text = ''
|
||||
# Generated by Home Manager.
|
||||
''
|
||||
+ cfg.hooks;
|
||||
'' + cfg.hooks;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
61
modules/programs/aria2.nix
Normal file
61
modules/programs/aria2.nix
Normal file
@@ -0,0 +1,61 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.aria2;
|
||||
|
||||
formatLine = n: v:
|
||||
let
|
||||
formatValue = v:
|
||||
if builtins.isBool v then
|
||||
(if v then "true" else "false")
|
||||
else
|
||||
toString v;
|
||||
in "${n}=${formatValue v}";
|
||||
in {
|
||||
meta.maintainers = [ hm.maintainers.justinlovinger ];
|
||||
|
||||
options.programs.aria2 = {
|
||||
enable = mkEnableOption "aria2";
|
||||
|
||||
settings = mkOption {
|
||||
type = with types; attrsOf (oneOf [ bool float int str ]);
|
||||
default = { };
|
||||
description = ''
|
||||
Options to add to <filename>aria2.conf</filename> file.
|
||||
See
|
||||
<citerefentry>
|
||||
<refentrytitle>aria2c</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
</citerefentry>
|
||||
for options.
|
||||
'';
|
||||
example = literalExample ''
|
||||
{
|
||||
listen-port = 60000;
|
||||
dht-listen-port = 60000;
|
||||
seed-ratio = 1.0;
|
||||
max-upload-limit = "50K";
|
||||
ftp-pasv = true;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Extra lines added to <filename>aria2.conf</filename> file.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.aria2 ];
|
||||
|
||||
xdg.configFile."aria2/aria2.conf".text = concatStringsSep "\n" ([ ]
|
||||
++ mapAttrsToList formatLine cfg.settings
|
||||
++ optional (cfg.extraConfig != "") cfg.extraConfig);
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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,26 +91,29 @@ 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.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
accounts.email.accounts = mkOption {
|
||||
type = with types; attrsOf (submodule (import ./astroid-accounts.nix));
|
||||
};
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
56
modules/programs/autojump.nix
Normal file
56
modules/programs/autojump.nix
Normal file
@@ -0,0 +1,56 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.autojump;
|
||||
package = pkgs.autojump;
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.evanjs ];
|
||||
|
||||
options.programs.autojump = {
|
||||
enable = mkEnableOption "autojump";
|
||||
|
||||
enableBashIntegration = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
description = ''
|
||||
Whether to enable Bash integration.
|
||||
'';
|
||||
};
|
||||
|
||||
enableZshIntegration = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
description = ''
|
||||
Whether to enable Zsh integration.
|
||||
'';
|
||||
};
|
||||
|
||||
enableFishIntegration = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
description = ''
|
||||
Whether to enable Fish integration.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ package ];
|
||||
|
||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration (mkBefore ''
|
||||
. ${package}/share/autojump/autojump.bash
|
||||
'');
|
||||
|
||||
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
|
||||
. ${package}/share/autojump/autojump.zsh
|
||||
'';
|
||||
|
||||
programs.fish.promptInit = mkIf cfg.enableFishIntegration ''
|
||||
. ${package}/share/autojump/autojump.fish
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -55,6 +55,13 @@ let
|
||||
default = true;
|
||||
};
|
||||
|
||||
crtc = mkOption {
|
||||
type = types.nullOr types.ints.unsigned;
|
||||
description = "Output video display controller.";
|
||||
default = null;
|
||||
example = 0;
|
||||
};
|
||||
|
||||
primary = mkOption {
|
||||
type = types.bool;
|
||||
description = "Whether output should be marked as primary";
|
||||
@@ -244,21 +251,22 @@ let
|
||||
]);
|
||||
fingerprintToString = name: edid: "${name} ${edid}";
|
||||
configToString = name: config:
|
||||
if config.enable then ''
|
||||
output ${name}
|
||||
${optionalString (config.position != "") "pos ${config.position}"}
|
||||
${optionalString config.primary "primary"}
|
||||
${optionalString (config.dpi != null) "dpi ${toString config.dpi}"}
|
||||
${optionalString (config.gamma != "") "gamma ${config.gamma}"}
|
||||
${optionalString (config.mode != "") "mode ${config.mode}"}
|
||||
${optionalString (config.rate != "") "rate ${config.rate}"}
|
||||
${optionalString (config.rotate != null) "rotate ${config.rotate}"}
|
||||
${optionalString (config.scale != null)
|
||||
((if config.scale.method == "factor" then "scale" else "scale-from")
|
||||
+ " ${toString config.scale.x}x${toString config.scale.y}")}
|
||||
${optionalString (config.transform != null) ("transform "
|
||||
+ concatMapStringsSep "," toString (flatten config.transform))}
|
||||
'' else ''
|
||||
if config.enable then
|
||||
concatStringsSep "\n" ([ "output ${name}" ]
|
||||
++ optional (config.position != "") "pos ${config.position}"
|
||||
++ optional (config.crtc != null) "crtc ${toString config.crtc}"
|
||||
++ optional config.primary "primary"
|
||||
++ optional (config.dpi != null) "dpi ${toString config.dpi}"
|
||||
++ optional (config.gamma != "") "gamma ${config.gamma}"
|
||||
++ optional (config.mode != "") "mode ${config.mode}"
|
||||
++ optional (config.rate != "") "rate ${config.rate}"
|
||||
++ optional (config.rotate != null) "rotate ${config.rotate}"
|
||||
++ optional (config.transform != null) ("transform "
|
||||
+ concatMapStringsSep "," toString (flatten config.transform))
|
||||
++ optional (config.scale != null)
|
||||
((if config.scale.method == "factor" then "scale" else "scale-from")
|
||||
+ " ${toString config.scale.x}x${toString config.scale.y}"))
|
||||
else ''
|
||||
output ${name}
|
||||
off
|
||||
'';
|
||||
@@ -315,6 +323,7 @@ in {
|
||||
eDP1.enable = false;
|
||||
DP1 = {
|
||||
enable = true;
|
||||
crtc = 0;
|
||||
primary = true;
|
||||
position = "0x0";
|
||||
mode = "3840x2160";
|
||||
|
||||
@@ -11,6 +11,14 @@ in
|
||||
{
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
|
||||
imports = [
|
||||
(mkRenamedOptionModule [ "programs" "bash" "enableAutojump" ] [
|
||||
"programs"
|
||||
"autojump"
|
||||
"enable"
|
||||
])
|
||||
];
|
||||
|
||||
options = {
|
||||
programs.bash = {
|
||||
enable = mkEnableOption "GNU Bourne-Again SHell";
|
||||
@@ -22,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.";
|
||||
};
|
||||
|
||||
@@ -94,12 +102,6 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
enableAutojump = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
description = "Enable the autojump navigation tool.";
|
||||
};
|
||||
|
||||
profileExtra = mkOption {
|
||||
default = "";
|
||||
type = types.lines;
|
||||
@@ -109,17 +111,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;
|
||||
@@ -129,6 +120,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;
|
||||
@@ -155,10 +155,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;
|
||||
}
|
||||
@@ -167,22 +169,6 @@ 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}
|
||||
|
||||
${optionalString cfg.enableAutojump
|
||||
". ${pkgs.autojump}/share/autojump/autojump.bash"}
|
||||
fi
|
||||
'';
|
||||
|
||||
home.file.".bash_profile".text = ''
|
||||
# -*- mode: sh -*-
|
||||
|
||||
@@ -207,6 +193,17 @@ in
|
||||
# -*- mode: sh -*-
|
||||
|
||||
${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 != "") {
|
||||
@@ -216,9 +213,6 @@ in
|
||||
${cfg.logoutExtra}
|
||||
'';
|
||||
};
|
||||
|
||||
home.packages =
|
||||
optional (cfg.enableAutojump) pkgs.autojump;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,20 +6,10 @@ 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;
|
||||
};
|
||||
|
||||
@@ -54,41 +44,60 @@ in {
|
||||
};
|
||||
|
||||
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 +118,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,12 +183,13 @@ 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".text = "";
|
||||
xdg.configFile."broot/launcher/installed-v1".text = "";
|
||||
|
||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration (
|
||||
# Using mkAfter to make it more likely to appear after other
|
||||
|
||||
@@ -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,13 +103,15 @@ 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";
|
||||
};
|
||||
|
||||
configDir = if pkgs.stdenv.isDarwin then
|
||||
@@ -60,20 +119,33 @@ let
|
||||
else
|
||||
"${config.xdg.configHome}/${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 +153,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 +161,6 @@ in {
|
||||
(browserConfig config.programs.google-chrome)
|
||||
(browserConfig config.programs.google-chrome-beta)
|
||||
(browserConfig config.programs.google-chrome-dev)
|
||||
(browserConfig config.programs.brave)
|
||||
];
|
||||
}
|
||||
|
||||
223
modules/programs/dircolors.nix
Normal file
223
modules/programs/dircolors.nix
Normal file
@@ -0,0 +1,223 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.dircolors;
|
||||
|
||||
formatLine = n: v: "${n} ${toString v}";
|
||||
in {
|
||||
meta.maintainers = [ hm.maintainers.justinlovinger ];
|
||||
|
||||
options.programs.dircolors = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to manage <filename>.dir_colors</filename>
|
||||
and set <code>LS_COLORS</code>.
|
||||
'';
|
||||
};
|
||||
|
||||
enableBashIntegration = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to enable Bash integration.
|
||||
'';
|
||||
};
|
||||
|
||||
enableFishIntegration = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to enable Fish integration.
|
||||
'';
|
||||
};
|
||||
|
||||
enableZshIntegration = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to enable Zsh integration.
|
||||
'';
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = with types; attrsOf str;
|
||||
default = { };
|
||||
description = ''
|
||||
Options to add to <filename>.dir_colors</filename> file.
|
||||
See <command>dircolors --print-database</command>
|
||||
for options.
|
||||
'';
|
||||
example = literalExample ''
|
||||
{
|
||||
OTHER_WRITABLE = "30;46";
|
||||
".sh" = "01;32";
|
||||
".csh" = "01;32";
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Extra lines added to <filename>.dir_colors</filename> file.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Add default settings from `dircolors --print-database`.
|
||||
programs.dircolors.settings = {
|
||||
RESET = mkDefault "0";
|
||||
DIR = mkDefault "01;34";
|
||||
LINK = mkDefault "01;36";
|
||||
MULTIHARDLINK = mkDefault "00";
|
||||
FIFO = mkDefault "40;33";
|
||||
SOCK = mkDefault "01;35";
|
||||
DOOR = mkDefault "01;35";
|
||||
BLK = mkDefault "40;33;01";
|
||||
CHR = mkDefault "40;33;01";
|
||||
ORPHAN = mkDefault "40;31;01";
|
||||
MISSING = mkDefault "00";
|
||||
SETUID = mkDefault "37;41";
|
||||
SETGID = mkDefault "30;43";
|
||||
CAPABILITY = mkDefault "30;41";
|
||||
STICKY_OTHER_WRITABLE = mkDefault "30;42";
|
||||
OTHER_WRITABLE = mkDefault "34;42";
|
||||
STICKY = mkDefault "37;44";
|
||||
EXEC = mkDefault "01;32";
|
||||
".tar" = mkDefault "01;31";
|
||||
".tgz" = mkDefault "01;31";
|
||||
".arc" = mkDefault "01;31";
|
||||
".arj" = mkDefault "01;31";
|
||||
".taz" = mkDefault "01;31";
|
||||
".lha" = mkDefault "01;31";
|
||||
".lz4" = mkDefault "01;31";
|
||||
".lzh" = mkDefault "01;31";
|
||||
".lzma" = mkDefault "01;31";
|
||||
".tlz" = mkDefault "01;31";
|
||||
".txz" = mkDefault "01;31";
|
||||
".tzo" = mkDefault "01;31";
|
||||
".t7z" = mkDefault "01;31";
|
||||
".zip" = mkDefault "01;31";
|
||||
".z" = mkDefault "01;31";
|
||||
".dz" = mkDefault "01;31";
|
||||
".gz" = mkDefault "01;31";
|
||||
".lrz" = mkDefault "01;31";
|
||||
".lz" = mkDefault "01;31";
|
||||
".lzo" = mkDefault "01;31";
|
||||
".xz" = mkDefault "01;31";
|
||||
".zst" = mkDefault "01;31";
|
||||
".tzst" = mkDefault "01;31";
|
||||
".bz2" = mkDefault "01;31";
|
||||
".bz" = mkDefault "01;31";
|
||||
".tbz" = mkDefault "01;31";
|
||||
".tbz2" = mkDefault "01;31";
|
||||
".tz" = mkDefault "01;31";
|
||||
".deb" = mkDefault "01;31";
|
||||
".rpm" = mkDefault "01;31";
|
||||
".jar" = mkDefault "01;31";
|
||||
".war" = mkDefault "01;31";
|
||||
".ear" = mkDefault "01;31";
|
||||
".sar" = mkDefault "01;31";
|
||||
".rar" = mkDefault "01;31";
|
||||
".alz" = mkDefault "01;31";
|
||||
".ace" = mkDefault "01;31";
|
||||
".zoo" = mkDefault "01;31";
|
||||
".cpio" = mkDefault "01;31";
|
||||
".7z" = mkDefault "01;31";
|
||||
".rz" = mkDefault "01;31";
|
||||
".cab" = mkDefault "01;31";
|
||||
".wim" = mkDefault "01;31";
|
||||
".swm" = mkDefault "01;31";
|
||||
".dwm" = mkDefault "01;31";
|
||||
".esd" = mkDefault "01;31";
|
||||
".jpg" = mkDefault "01;35";
|
||||
".jpeg" = mkDefault "01;35";
|
||||
".mjpg" = mkDefault "01;35";
|
||||
".mjpeg" = mkDefault "01;35";
|
||||
".gif" = mkDefault "01;35";
|
||||
".bmp" = mkDefault "01;35";
|
||||
".pbm" = mkDefault "01;35";
|
||||
".pgm" = mkDefault "01;35";
|
||||
".ppm" = mkDefault "01;35";
|
||||
".tga" = mkDefault "01;35";
|
||||
".xbm" = mkDefault "01;35";
|
||||
".xpm" = mkDefault "01;35";
|
||||
".tif" = mkDefault "01;35";
|
||||
".tiff" = mkDefault "01;35";
|
||||
".png" = mkDefault "01;35";
|
||||
".svg" = mkDefault "01;35";
|
||||
".svgz" = mkDefault "01;35";
|
||||
".mng" = mkDefault "01;35";
|
||||
".pcx" = mkDefault "01;35";
|
||||
".mov" = mkDefault "01;35";
|
||||
".mpg" = mkDefault "01;35";
|
||||
".mpeg" = mkDefault "01;35";
|
||||
".m2v" = mkDefault "01;35";
|
||||
".mkv" = mkDefault "01;35";
|
||||
".webm" = mkDefault "01;35";
|
||||
".ogm" = mkDefault "01;35";
|
||||
".mp4" = mkDefault "01;35";
|
||||
".m4v" = mkDefault "01;35";
|
||||
".mp4v" = mkDefault "01;35";
|
||||
".vob" = mkDefault "01;35";
|
||||
".qt" = mkDefault "01;35";
|
||||
".nuv" = mkDefault "01;35";
|
||||
".wmv" = mkDefault "01;35";
|
||||
".asf" = mkDefault "01;35";
|
||||
".rm" = mkDefault "01;35";
|
||||
".rmvb" = mkDefault "01;35";
|
||||
".flc" = mkDefault "01;35";
|
||||
".avi" = mkDefault "01;35";
|
||||
".fli" = mkDefault "01;35";
|
||||
".flv" = mkDefault "01;35";
|
||||
".gl" = mkDefault "01;35";
|
||||
".dl" = mkDefault "01;35";
|
||||
".xcf" = mkDefault "01;35";
|
||||
".xwd" = mkDefault "01;35";
|
||||
".yuv" = mkDefault "01;35";
|
||||
".cgm" = mkDefault "01;35";
|
||||
".emf" = mkDefault "01;35";
|
||||
".ogv" = mkDefault "01;35";
|
||||
".ogx" = mkDefault "01;35";
|
||||
".aac" = mkDefault "00;36";
|
||||
".au" = mkDefault "00;36";
|
||||
".flac" = mkDefault "00;36";
|
||||
".m4a" = mkDefault "00;36";
|
||||
".mid" = mkDefault "00;36";
|
||||
".midi" = mkDefault "00;36";
|
||||
".mka" = mkDefault "00;36";
|
||||
".mp3" = mkDefault "00;36";
|
||||
".mpc" = mkDefault "00;36";
|
||||
".ogg" = mkDefault "00;36";
|
||||
".ra" = mkDefault "00;36";
|
||||
".wav" = mkDefault "00;36";
|
||||
".oga" = mkDefault "00;36";
|
||||
".opus" = mkDefault "00;36";
|
||||
".spx" = mkDefault "00;36";
|
||||
".xspf" = mkDefault "00;36";
|
||||
};
|
||||
|
||||
home.file.".dir_colors".text = concatStringsSep "\n" ([ ]
|
||||
++ mapAttrsToList formatLine cfg.settings ++ [ "" ]
|
||||
++ optional (cfg.extraConfig != "") cfg.extraConfig);
|
||||
|
||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
|
||||
eval $(${pkgs.coreutils}/bin/dircolors -b ~/.dir_colors)
|
||||
'';
|
||||
|
||||
programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
|
||||
eval (${pkgs.coreutils}/bin/dircolors -c ~/.dir_colors)
|
||||
'';
|
||||
|
||||
# Set `LS_COLORS` before Oh My Zsh and `initExtra`.
|
||||
programs.zsh.initExtraBeforeCompInit = mkIf cfg.enableZshIntegration ''
|
||||
eval $(${pkgs.coreutils}/bin/dircolors -b ~/.dir_colors)
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -5,16 +5,8 @@ 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 {
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
@@ -23,7 +15,7 @@ in {
|
||||
enable = mkEnableOption "direnv, the environment switcher";
|
||||
|
||||
config = mkOption {
|
||||
type = types.attrs;
|
||||
type = tomlFormat.type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to
|
||||
@@ -70,16 +62,25 @@ in {
|
||||
Whether to enable Fish integration.
|
||||
'';
|
||||
};
|
||||
|
||||
enableNixDirenvIntegration = mkEnableOption ''
|
||||
<link
|
||||
xlink:href="https://github.com/nix-community/nix-direnv">nix-direnv</link>,
|
||||
a fast, persistent use_nix implementation for 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" =
|
||||
mkIf (cfg.stdlib != "") { text = cfg.stdlib; };
|
||||
xdg.configFile."direnv/direnvrc" = let
|
||||
text = concatStringsSep "\n" (optional (cfg.stdlib != "") cfg.stdlib
|
||||
++ optional cfg.enableNixDirenvIntegration
|
||||
"source ${pkgs.nix-direnv}/share/nix-direnv/direnvrc");
|
||||
in mkIf (text != "") { inherit text; };
|
||||
|
||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration (
|
||||
# Using mkAfter to make it more likely to appear after other
|
||||
@@ -93,7 +94,7 @@ in {
|
||||
'';
|
||||
|
||||
programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
|
||||
eval (${pkgs.direnv}/bin/direnv hook fish)
|
||||
${pkgs.direnv}/bin/direnv hook fish | source
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,6 +13,16 @@ in {
|
||||
programs.eclipse = {
|
||||
enable = mkEnableOption "Eclipse";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.eclipses.eclipse-platform;
|
||||
defaultText = literalExample "pkgs.eclipses.eclipse-platform";
|
||||
example = literalExample "pkgs.eclipses.eclipse-java";
|
||||
description = ''
|
||||
The Eclipse package to install.
|
||||
'';
|
||||
};
|
||||
|
||||
enableLombok = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
@@ -40,7 +50,7 @@ in {
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [
|
||||
(pkgs.eclipses.eclipseWithPlugins {
|
||||
eclipse = pkgs.eclipses.eclipse-platform;
|
||||
eclipse = cfg.package;
|
||||
jvmArgs = cfg.jvmArgs ++ optional cfg.enableLombok
|
||||
"-javaagent:${pkgs.lombok}/share/java/lombok.jar";
|
||||
plugins = cfg.plugins;
|
||||
|
||||
@@ -8,16 +8,12 @@ let
|
||||
|
||||
# Copied from all-packages.nix, with modifications to support
|
||||
# overrides.
|
||||
emacsPackages =
|
||||
let
|
||||
epkgs = pkgs.emacsPackagesGen cfg.package;
|
||||
in
|
||||
epkgs.overrideScope' cfg.overrides;
|
||||
emacsPackages = let epkgs = pkgs.emacsPackagesFor cfg.package;
|
||||
in epkgs.overrideScope' cfg.overrides;
|
||||
|
||||
emacsWithPackages = emacsPackages.emacsWithPackages;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
in {
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
|
||||
options = {
|
||||
@@ -33,7 +29,7 @@ in
|
||||
};
|
||||
|
||||
extraPackages = mkOption {
|
||||
default = self: [];
|
||||
default = self: [ ];
|
||||
type = hm.types.selectorFunction;
|
||||
defaultText = "epkgs: []";
|
||||
example = literalExample "epkgs: [ epkgs.emms epkgs.magit ]";
|
||||
@@ -45,7 +41,7 @@ in
|
||||
};
|
||||
|
||||
overrides = mkOption {
|
||||
default = self: super: {};
|
||||
default = self: super: { };
|
||||
type = hm.types.overlayFunction;
|
||||
defaultText = "self: super: {}";
|
||||
example = literalExample ''
|
||||
|
||||
@@ -6,8 +6,22 @@ let
|
||||
|
||||
cfg = config.programs.feh;
|
||||
|
||||
disableBinding = func: key: func;
|
||||
enableBinding = func: key: "${func} ${toString key}";
|
||||
bindingsOf = t: with types; attrsOf (nullOr (either t (listOf t)));
|
||||
|
||||
renderBindings = bindings:
|
||||
let
|
||||
enabled = filterAttrs (n: v: v != null) bindings;
|
||||
disabled = filterAttrs (n: v: v == null) bindings;
|
||||
render = mapAttrsToList renderBinding;
|
||||
in concatStringsSep "\n" (render disabled ++ render enabled);
|
||||
|
||||
renderBinding = func: key:
|
||||
if key == null then
|
||||
func
|
||||
else if isList key then
|
||||
concatStringsSep " " ([ func ] ++ map toString key)
|
||||
else
|
||||
"${func} ${toString key}";
|
||||
|
||||
in {
|
||||
options.programs.feh = {
|
||||
@@ -15,14 +29,16 @@ in {
|
||||
|
||||
buttons = mkOption {
|
||||
default = { };
|
||||
type = with types; attrsOf (nullOr (either str int));
|
||||
type = with types; bindingsOf (either str int);
|
||||
example = {
|
||||
zoom_in = 4;
|
||||
zoom_out = "C-4";
|
||||
prev_img = [ 3 "C-3" ];
|
||||
};
|
||||
description = ''
|
||||
Override feh's default mouse button mapping. If you want to disable an
|
||||
action, set its value to null.
|
||||
action, set its value to null. If you want to bind multiple buttons to
|
||||
an action, set its value to a list.
|
||||
See <link xlink:href="https://man.finalrewind.org/1/feh/#x425554544f4e53"/> for
|
||||
default bindings and available commands.
|
||||
'';
|
||||
@@ -30,14 +46,16 @@ in {
|
||||
|
||||
keybindings = mkOption {
|
||||
default = { };
|
||||
type = types.attrsOf (types.nullOr types.str);
|
||||
type = bindingsOf types.str;
|
||||
example = {
|
||||
zoom_in = "plus";
|
||||
zoom_out = "minus";
|
||||
prev_img = [ "h" "Left" ];
|
||||
};
|
||||
description = ''
|
||||
Override feh's default keybindings. If you want to disable a keybinding
|
||||
set its value to null.
|
||||
set its value to null. If you want to bind multiple keys to an action,
|
||||
set its value to a list.
|
||||
See <link xlink:href="https://man.finalrewind.org/1/feh/#x4b455953"/> for
|
||||
default bindings and available commands.
|
||||
'';
|
||||
@@ -53,18 +71,11 @@ in {
|
||||
|
||||
home.packages = [ pkgs.feh ];
|
||||
|
||||
xdg.configFile."feh/buttons".text = ''
|
||||
${concatStringsSep "\n" (mapAttrsToList disableBinding
|
||||
(filterAttrs (n: v: v == null) cfg.buttons))}
|
||||
${concatStringsSep "\n" (mapAttrsToList enableBinding
|
||||
(filterAttrs (n: v: v != null) cfg.buttons))}
|
||||
'';
|
||||
xdg.configFile."feh/buttons" =
|
||||
mkIf (cfg.buttons != { }) { text = renderBindings cfg.buttons + "\n"; };
|
||||
|
||||
xdg.configFile."feh/keys".text = ''
|
||||
${concatStringsSep "\n" (mapAttrsToList disableBinding
|
||||
(filterAttrs (n: v: v == null) cfg.keybindings))}
|
||||
${concatStringsSep "\n" (mapAttrsToList enableBinding
|
||||
(filterAttrs (n: v: v != null) cfg.keybindings))}
|
||||
'';
|
||||
xdg.configFile."feh/keys" = mkIf (cfg.keybindings != { }) {
|
||||
text = renderBindings cfg.keybindings + "\n";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -67,6 +67,8 @@ in
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
|
||||
imports = [
|
||||
(mkRemovedOptionModule ["programs" "firefox" "enableAdobeFlash"]
|
||||
"Support for this option has been removed.")
|
||||
(mkRemovedOptionModule ["programs" "firefox" "enableGoogleTalk"]
|
||||
"Support for this option has been removed.")
|
||||
(mkRemovedOptionModule ["programs" "firefox" "enableIcedTea"]
|
||||
@@ -101,9 +103,29 @@ in
|
||||
]
|
||||
'';
|
||||
description = ''
|
||||
List of Firefox add-on packages to install. Note, it is
|
||||
necessary to manually enable these extensions inside Firefox
|
||||
after the first installation.
|
||||
List of Firefox add-on packages to install. Some
|
||||
pre-packaged add-ons are accessible from NUR,
|
||||
<link xlink:href="https://github.com/nix-community/NUR"/>.
|
||||
Once you have NUR installed run
|
||||
|
||||
<screen language="console">
|
||||
<prompt>$</prompt> <userinput>nix-env -f '<nixpkgs>' -qaP -A nur.repos.rycee.firefox-addons</userinput>
|
||||
</screen>
|
||||
|
||||
to list the available Firefox add-ons.
|
||||
|
||||
</para><para>
|
||||
|
||||
Note that it is necessary to manually enable these
|
||||
extensions inside Firefox after the first installation.
|
||||
|
||||
</para><para>
|
||||
|
||||
Extensions listed here will only be available in Firefox
|
||||
profiles managed through the
|
||||
<link linkend="opt-programs.firefox.profiles">programs.firefox.profiles</link>
|
||||
option. This is due to recent changes in the way Firefox
|
||||
handles extension side-loading.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -195,10 +217,15 @@ in
|
||||
description = "Attribute set of Firefox profiles.";
|
||||
};
|
||||
|
||||
enableAdobeFlash = mkOption {
|
||||
enableGnomeExtensions = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether to enable the unfree Adobe Flash plugin.";
|
||||
description = ''
|
||||
Whether to enable the GNOME Shell native host connector. Note, you
|
||||
also need to set the NixOS option
|
||||
<literal>services.gnome3.chrome-gnome-shell.enable</literal> to
|
||||
<literal>true</literal>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -241,7 +268,7 @@ in
|
||||
let
|
||||
# The configuration expected by the Firefox wrapper.
|
||||
fcfg = {
|
||||
enableAdobeFlash = cfg.enableAdobeFlash;
|
||||
enableGnomeExtensions = cfg.enableGnomeExtensions;
|
||||
};
|
||||
|
||||
# A bit of hackery to force a config into the wrapper.
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -441,7 +446,9 @@ in {
|
||||
|
||||
# Source initialization code if it exists.
|
||||
if test -d $plugin_dir/conf.d
|
||||
source $plugin_dir/conf.d/*.fish
|
||||
for f in $plugin_dir/conf.d/*.fish
|
||||
source $f
|
||||
end
|
||||
end
|
||||
|
||||
if test -f $plugin_dir/key_bindings.fish
|
||||
|
||||
@@ -7,9 +7,21 @@ let
|
||||
cfg = config.programs.fzf;
|
||||
|
||||
in {
|
||||
imports = [
|
||||
(mkRemovedOptionModule [ "programs" "fzf" "historyWidgetCommand" ]
|
||||
"This option is no longer supported by fzf.")
|
||||
];
|
||||
|
||||
options.programs.fzf = {
|
||||
enable = mkEnableOption "fzf - a command-line fuzzy finder";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.fzf;
|
||||
defaultText = literalExample "pkgs.fzf";
|
||||
description = "Package providing the <command>fzf</command> tool.";
|
||||
};
|
||||
|
||||
defaultCommand = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
@@ -67,15 +79,6 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
historyWidgetCommand = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
The command that gets executed as the source for fzf for the
|
||||
CTRL-R keybinding.
|
||||
'';
|
||||
};
|
||||
|
||||
historyWidgetOptions = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
@@ -111,13 +114,12 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.fzf ];
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
home.sessionVariables = mapAttrs (n: v: toString v)
|
||||
(filterAttrs (n: v: v != [ ] && v != null) {
|
||||
FZF_ALT_C_COMMAND = cfg.changeDirWidgetCommand;
|
||||
FZF_ALT_C_OPTS = cfg.changeDirWidgetOptions;
|
||||
FZF_CTRL_R_COMMAND = cfg.historyWidgetCommand;
|
||||
FZF_CTRL_R_OPTS = cfg.historyWidgetOptions;
|
||||
FZF_CTRL_T_COMMAND = cfg.fileWidgetCommand;
|
||||
FZF_CTRL_T_OPTS = cfg.fileWidgetOptions;
|
||||
|
||||
@@ -11,8 +11,7 @@ let
|
||||
with account;
|
||||
let
|
||||
passCmd = concatMapStringsSep ", " (x: "'${x}'") passwordCommand;
|
||||
renderedMailboxes =
|
||||
concatMapStringsSep ", " (x: "'${x}'") getmail.mailboxes;
|
||||
renderedMailboxes = concatMapStrings (x: "'${x}', ") getmail.mailboxes;
|
||||
retrieverType = if imap.tls.enable then
|
||||
"SimpleIMAPSSLRetriever"
|
||||
else
|
||||
@@ -49,6 +48,12 @@ let
|
||||
".getmail/getmail${if a.primary then "rc" else a.name}";
|
||||
|
||||
in {
|
||||
options = {
|
||||
accounts.email.accounts = mkOption {
|
||||
type = with types; attrsOf (submodule (import ./getmail-accounts.nix));
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf getmailEnabled {
|
||||
home.file = foldl' (a: b: a // b) { }
|
||||
(map (a: { "${renderConfigFilepath a}".text = renderAccountConfig a; })
|
||||
|
||||
55
modules/programs/gh.nix
Normal file
55
modules/programs/gh.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.gh;
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.gerschtli ];
|
||||
|
||||
options.programs.gh = {
|
||||
enable = mkEnableOption "GitHub CLI tool";
|
||||
|
||||
aliases = mkOption {
|
||||
type = with types; attrsOf str;
|
||||
default = { };
|
||||
example = literalExample ''
|
||||
{
|
||||
co = "pr checkout";
|
||||
pv = "pr view";
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Aliases that allow you to create nicknames for gh commands.
|
||||
'';
|
||||
};
|
||||
|
||||
editor = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = ''
|
||||
The editor that gh should run when creating issues, pull requests, etc.
|
||||
If blank, will refer to environment.
|
||||
'';
|
||||
};
|
||||
|
||||
gitProtocol = mkOption {
|
||||
type = types.enum [ "https" "ssh" ];
|
||||
default = "https";
|
||||
description = ''
|
||||
The protocol to use when performing Git operations.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.gh ];
|
||||
|
||||
xdg.configFile."gh/config.yml".text = builtins.toJSON {
|
||||
inherit (cfg) aliases editor;
|
||||
git_protocol = cfg.gitProtocol;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -19,9 +19,19 @@ let
|
||||
else
|
||||
''${section} "${subsection}"'';
|
||||
|
||||
mkValueString = v:
|
||||
let
|
||||
escapedV = ''
|
||||
"${
|
||||
replaceStrings [ "\n" " " ''"'' "\\" ] [ "\\n" "\\t" ''\"'' "\\\\" ] v
|
||||
}"'';
|
||||
in generators.mkValueStringDefault { } (if isString v then escapedV else v);
|
||||
|
||||
# generation for multiple ini values
|
||||
mkKeyValue = k: v:
|
||||
let mkKeyValue = generators.mkKeyValueDefault { } " = " k;
|
||||
let
|
||||
mkKeyValue =
|
||||
generators.mkKeyValueDefault { inherit mkValueString; } " = " k;
|
||||
in concatStringsSep "\n" (map (kv: " " + mkKeyValue kv) (toList v));
|
||||
|
||||
# converts { a.b.c = 5; } to { "a.b".c = 5; } for toINI
|
||||
@@ -51,8 +61,13 @@ let
|
||||
signModule = types.submodule {
|
||||
options = {
|
||||
key = mkOption {
|
||||
type = types.str;
|
||||
description = "The default GPG signing key fingerprint.";
|
||||
type = types.nullOr types.str;
|
||||
description = ''
|
||||
The default GPG signing key fingerprint.
|
||||
</para><para>
|
||||
Set to <literal>null</literal> to let GnuPG decide what signing key
|
||||
to use depending on commit’s author.
|
||||
'';
|
||||
};
|
||||
|
||||
signByDefault = mkOption {
|
||||
@@ -91,7 +106,7 @@ let
|
||||
};
|
||||
|
||||
contents = mkOption {
|
||||
type = types.attrs;
|
||||
type = types.attrsOf types.anything;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration to include. If empty then a path must be given.
|
||||
@@ -205,6 +220,36 @@ in {
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
delta = {
|
||||
enable = mkEnableOption "" // {
|
||||
description = ''
|
||||
Whether to enable the <command>delta</command> syntax highlighter.
|
||||
See <link xlink:href="https://github.com/dandavison/delta" />.
|
||||
'';
|
||||
};
|
||||
|
||||
options = mkOption {
|
||||
type = with types;
|
||||
let
|
||||
primitiveType = either str (either bool int);
|
||||
sectionType = attrsOf primitiveType;
|
||||
in attrsOf (either primitiveType sectionType);
|
||||
default = { };
|
||||
example = {
|
||||
features = "decorations";
|
||||
whitespace-error-style = "22 reverse";
|
||||
decorations = {
|
||||
commit-decoration-style = "bold yellow box ul";
|
||||
file-style = "bold yellow ul";
|
||||
file-decoration-style = "none";
|
||||
};
|
||||
};
|
||||
description = ''
|
||||
Options to configure delta.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -236,21 +281,34 @@ in {
|
||||
|
||||
genIdentity = name: account:
|
||||
with account;
|
||||
nameValuePair "sendemail.${name}" ({
|
||||
smtpEncryption = if smtp.tls.enable then "tls" else "";
|
||||
smtpServer = smtp.host;
|
||||
smtpUser = userName;
|
||||
nameValuePair "sendemail.${name}" (if account.msmtp.enable then {
|
||||
smtpServer = "${pkgs.msmtp}/bin/msmtp";
|
||||
envelopeSender = "auto";
|
||||
from = address;
|
||||
} // optionalAttrs (smtp.port != null) {
|
||||
smtpServerPort = smtp.port;
|
||||
});
|
||||
} else
|
||||
{
|
||||
smtpEncryption = if smtp.tls.enable then
|
||||
(if smtp.tls.useStartTls
|
||||
|| versionOlder config.home.stateVersion "20.09" then
|
||||
"tls"
|
||||
else
|
||||
"ssl")
|
||||
else
|
||||
"";
|
||||
smtpSslCertPath = mkIf smtp.tls.enable smtp.tls.certificatesFile;
|
||||
smtpServer = smtp.host;
|
||||
smtpUser = userName;
|
||||
from = address;
|
||||
} // optionalAttrs (smtp.port != null) {
|
||||
smtpServerPort = smtp.port;
|
||||
});
|
||||
in mapAttrs' genIdentity
|
||||
(filterAttrs hasSmtp config.accounts.email.accounts);
|
||||
}
|
||||
|
||||
(mkIf (cfg.signing != null) {
|
||||
programs.git.iniContent = {
|
||||
user.signingKey = cfg.signing.key;
|
||||
user.signingKey = mkIf (cfg.signing.key != null) cfg.signing.key;
|
||||
commit.gpgSign = cfg.signing.signByDefault;
|
||||
gpg.program = cfg.signing.gpgPath;
|
||||
};
|
||||
@@ -299,5 +357,16 @@ in {
|
||||
([ "git-lfs" "smudge" ] ++ skipArg ++ [ "--" "%f" ]);
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.delta.enable {
|
||||
home.packages = [ pkgs.delta ];
|
||||
|
||||
programs.git.iniContent = let deltaCommand = "${pkgs.delta}/bin/delta";
|
||||
in {
|
||||
core.pager = deltaCommand;
|
||||
interactive.diffFilter = "${deltaCommand} --color-only";
|
||||
delta = cfg.delta.options;
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -6,10 +6,13 @@ let
|
||||
|
||||
cfg = config.programs.gnome-terminal;
|
||||
|
||||
vteInitStr = ''
|
||||
# gnome-terminal: Show current directory in the terminal window title.
|
||||
. ${pkgs.gnome3.vte}/etc/profile.d/vte.sh
|
||||
'';
|
||||
eraseBinding = types.enum [
|
||||
"auto"
|
||||
"ascii-backspace"
|
||||
"ascii-delete"
|
||||
"delete-sequence"
|
||||
"tty"
|
||||
];
|
||||
|
||||
backForeSubModule = types.submodule ({ ... }: {
|
||||
options = {
|
||||
@@ -127,17 +130,130 @@ let
|
||||
The number of scrollback lines to keep, null for infinite.
|
||||
'';
|
||||
};
|
||||
|
||||
customCommand = mkOption {
|
||||
default = null;
|
||||
type = types.nullOr types.str;
|
||||
description = ''
|
||||
The command to use to start the shell, or null for default shell.
|
||||
'';
|
||||
};
|
||||
|
||||
loginShell = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
description = "Run command as a login shell.";
|
||||
};
|
||||
|
||||
backspaceBinding = mkOption {
|
||||
default = "ascii-delete";
|
||||
type = eraseBinding;
|
||||
description = ''
|
||||
Which string the terminal should send to an application when the user
|
||||
presses the <emphasis>Backspace</emphasis> key.
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><literal>auto</literal></term>
|
||||
<listitem><para>
|
||||
Attempt to determine the right value from the terminal's IO settings.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>ascii-backspace</literal></term>
|
||||
<listitem><para>
|
||||
Send an ASCII backspace character (0x08).
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>ascii-delete</literal></term>
|
||||
<listitem><para>
|
||||
Send an ASCII delete character (0x7F).
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>delete-sequence</literal></term>
|
||||
<listitem><para>
|
||||
Send the <quote>@7</quote> control sequence.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>tty</literal></term>
|
||||
<listitem><para>
|
||||
Send terminal’s <quote>erase</quote> setting.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
'';
|
||||
};
|
||||
|
||||
deleteBinding = mkOption {
|
||||
default = "delete-sequence";
|
||||
type = eraseBinding;
|
||||
description = ''
|
||||
Which string the terminal should send to an application when the user
|
||||
presses the <emphasis>Delete</emphasis> key.
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><literal>auto</literal></term>
|
||||
<listitem><para>
|
||||
Send the <quote>@7</quote> control sequence.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>ascii-backspace</literal></term>
|
||||
<listitem><para>
|
||||
Send an ASCII backspace character (0x08).
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>ascii-delete</literal></term>
|
||||
<listitem><para>
|
||||
Send an ASCII delete character (0x7F).
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>delete-sequence</literal></term>
|
||||
<listitem><para>
|
||||
Send the <quote>@7</quote> control sequence.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>tty</literal></term>
|
||||
<listitem><para>
|
||||
Send terminal’s <quote>erase</quote> setting.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
'';
|
||||
};
|
||||
|
||||
audibleBell = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
description = "Turn on/off the terminal's bell.";
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
buildProfileSet = pcfg:
|
||||
{
|
||||
audible-bell = pcfg.audibleBell;
|
||||
visible-name = pcfg.visibleName;
|
||||
scrollbar-policy = if pcfg.showScrollbar then "always" else "never";
|
||||
scrollback-lines = pcfg.scrollbackLines;
|
||||
cursor-shape = pcfg.cursorShape;
|
||||
cursor-blink-mode = pcfg.cursorBlinkMode;
|
||||
} // (if (pcfg.font == null) then {
|
||||
login-shell = pcfg.loginShell;
|
||||
backspace-binding = pcfg.backspaceBinding;
|
||||
delete-binding = pcfg.deleteBinding;
|
||||
} // (if (pcfg.customCommand != null) then {
|
||||
use-custom-command = true;
|
||||
custom-command = pcfg.customCommand;
|
||||
} else {
|
||||
use-custom-command = false;
|
||||
}) // (if (pcfg.font == null) then {
|
||||
use-system-font = true;
|
||||
} else {
|
||||
use-system-font = false;
|
||||
@@ -186,7 +302,7 @@ in {
|
||||
|
||||
themeVariant = mkOption {
|
||||
default = "default";
|
||||
type = types.enum [ "default" "light" "dark" ];
|
||||
type = types.enum [ "default" "light" "dark" "system" ];
|
||||
description = "The theme variation to request";
|
||||
};
|
||||
|
||||
@@ -199,7 +315,7 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.gnome3.gnome_terminal ];
|
||||
home.packages = [ pkgs.gnome3.gnome-terminal ];
|
||||
|
||||
dconf.settings = let dconfPath = "org/gnome/terminal/legacy";
|
||||
in {
|
||||
@@ -217,7 +333,7 @@ in {
|
||||
(n: v: nameValuePair ("${dconfPath}/profiles:/:${n}") (buildProfileSet v))
|
||||
cfg.profile;
|
||||
|
||||
programs.bash.initExtra = mkBefore vteInitStr;
|
||||
programs.zsh.initExtra = vteInitStr;
|
||||
programs.bash.enableVteIntegration = true;
|
||||
programs.zsh.enableVteIntegration = true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,25 +5,30 @@ with lib;
|
||||
let
|
||||
cfg = config.programs.gpg;
|
||||
|
||||
cfgText =
|
||||
concatStringsSep "\n"
|
||||
(attrValues
|
||||
(mapAttrs (key: value:
|
||||
if isString value
|
||||
then "${key} ${value}"
|
||||
else optionalString value key)
|
||||
cfg.settings));
|
||||
mkKeyValue = key: value:
|
||||
if isString value
|
||||
then "${key} ${value}"
|
||||
else optionalString value key;
|
||||
|
||||
in {
|
||||
cfgText = generators.toKeyValue {
|
||||
inherit mkKeyValue;
|
||||
listsAsDuplicateKeys = true;
|
||||
} cfg.settings;
|
||||
|
||||
primitiveType = types.oneOf [ types.str types.bool ];
|
||||
in
|
||||
{
|
||||
options.programs.gpg = {
|
||||
enable = mkEnableOption "GnuPG";
|
||||
|
||||
settings = mkOption {
|
||||
type = types.attrsOf (types.either types.str types.bool);
|
||||
example = {
|
||||
no-comments = false;
|
||||
s2k-cipher-algo = "AES128";
|
||||
};
|
||||
type = types.attrsOf (types.either primitiveType (types.listOf types.str));
|
||||
example = literalExample ''
|
||||
{
|
||||
no-comments = false;
|
||||
s2k-cipher-algo = "AES128";
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
GnuPG configuration options. Available options are described
|
||||
in the gpg manpage:
|
||||
|
||||
@@ -61,6 +61,9 @@ let
|
||||
CGROUP = 112;
|
||||
OOM = 113;
|
||||
IO_PRIORITY = 114;
|
||||
M_PSS = 118;
|
||||
M_SWAP = 119;
|
||||
M_PSSWP = 120;
|
||||
};
|
||||
|
||||
# Mapping from names to defaults
|
||||
@@ -76,16 +79,32 @@ let
|
||||
Hostname = 2;
|
||||
AllCPUs = 1;
|
||||
AllCPUs2 = 1;
|
||||
AllCPUs4 = 1;
|
||||
LeftCPUs = 1;
|
||||
RightCPUs = 1;
|
||||
Right = 1;
|
||||
CPUs = 1;
|
||||
LeftCPUs2 = 1;
|
||||
RightCPUs2 = 1;
|
||||
LeftCPUs4 = 1;
|
||||
RightCPUs4 = 1;
|
||||
Blank = 2;
|
||||
PressureStallCPUSome = 2;
|
||||
PressureStallIOSome = 2;
|
||||
PressureStallIOFull = 2;
|
||||
PressureStallMemorySome = 2;
|
||||
PressureStallMemoryFull = 2;
|
||||
ZFSARC = 2;
|
||||
ZFSCARC = 2;
|
||||
CPU = 1;
|
||||
"CPU(1)" = 1;
|
||||
"CPU(2)" = 1;
|
||||
"CPU(3)" = 1;
|
||||
"CPU(4)" = 1;
|
||||
"CPU(5)" = 1;
|
||||
"CPU(6)" = 1;
|
||||
"CPU(7)" = 1;
|
||||
"CPU(8)" = 1;
|
||||
};
|
||||
|
||||
singleMeterType = let
|
||||
@@ -268,6 +287,18 @@ in {
|
||||
description = "Count CPUs from 0 instead of 1.";
|
||||
};
|
||||
|
||||
showCpuUsage = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Show CPU usage frequency.";
|
||||
};
|
||||
|
||||
showCpuFrequency = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Show CPU frequency.";
|
||||
};
|
||||
|
||||
updateProcessNames = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
@@ -287,6 +318,12 @@ in {
|
||||
description = "Which color scheme to use.";
|
||||
};
|
||||
|
||||
enableMouse = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Enable mouse support.";
|
||||
};
|
||||
|
||||
delay = mkOption {
|
||||
type = types.int;
|
||||
default = 15;
|
||||
@@ -328,6 +365,11 @@ in {
|
||||
type = meterType;
|
||||
};
|
||||
|
||||
vimMode = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Vim key bindings.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
@@ -357,14 +399,18 @@ in {
|
||||
header_margin=${bool cfg.headerMargin}
|
||||
detailed_cpu_time=${bool cfg.detailedCpuTime}
|
||||
cpu_count_from_zero=${bool cfg.cpuCountFromZero}
|
||||
show_cpu_usage=${bool cfg.showCpuUsage}
|
||||
show_cpu_frequency=${bool cfg.showCpuFrequency}
|
||||
update_process_names=${bool cfg.updateProcessNames}
|
||||
account_guest_in_cpu_meter=${bool cfg.accountGuestInCpuMeter}
|
||||
color_scheme=${toString cfg.colorScheme}
|
||||
enable_mouse=${bool cfg.enableMouse}
|
||||
delay=${toString cfg.delay}
|
||||
left_meters=${list leftMeters}
|
||||
left_meter_modes=${list leftModes}
|
||||
right_meters=${list rightMeters}
|
||||
right_meter_modes=${list rightModes}
|
||||
vim_mode=${bool cfg.vimMode}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
265
modules/programs/i3status-rust.nix
Normal file
265
modules/programs/i3status-rust.nix
Normal file
@@ -0,0 +1,265 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.i3status-rust;
|
||||
|
||||
restartI3 = ''
|
||||
i3Socket=''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*
|
||||
if [ -S $i3Socket ]; then
|
||||
echo "Reloading i3"
|
||||
$DRY_RUN_CMD ${config.xsession.windowManager.i3.package}/bin/i3-msg -s $i3Socket restart 1>/dev/null
|
||||
fi
|
||||
'';
|
||||
|
||||
settingsFormat = pkgs.formats.toml { };
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.farlion ];
|
||||
|
||||
options.programs.i3status-rust = {
|
||||
enable = mkEnableOption "a replacement for i3-status written in Rust";
|
||||
|
||||
bars = mkOption {
|
||||
type = types.attrsOf (types.submodule {
|
||||
options = {
|
||||
|
||||
blocks = mkOption {
|
||||
type = settingsFormat.type;
|
||||
default = [
|
||||
{
|
||||
block = "disk_space";
|
||||
path = "/";
|
||||
alias = "/";
|
||||
info_type = "available";
|
||||
unit = "GB";
|
||||
interval = 60;
|
||||
warning = 20.0;
|
||||
alert = 10.0;
|
||||
}
|
||||
{
|
||||
block = "memory";
|
||||
display_type = "memory";
|
||||
format_mem = "{Mup}%";
|
||||
format_swap = "{SUp}%";
|
||||
}
|
||||
{
|
||||
block = "cpu";
|
||||
interval = 1;
|
||||
}
|
||||
{
|
||||
block = "load";
|
||||
interval = 1;
|
||||
format = "{1m}";
|
||||
}
|
||||
{ block = "sound"; }
|
||||
{
|
||||
block = "time";
|
||||
interval = 60;
|
||||
format = "%a %d/%m %R";
|
||||
}
|
||||
];
|
||||
description = ''
|
||||
Configuration blocks to add to i3status-rust
|
||||
<filename>config</filename>. See
|
||||
<link xlink:href="https://github.com/greshake/i3status-rust/blob/master/blocks.md"/>
|
||||
for block options.
|
||||
'';
|
||||
example = literalExample ''
|
||||
[
|
||||
{
|
||||
block = "disk_space";
|
||||
path = "/";
|
||||
alias = "/";
|
||||
info_type = "available";
|
||||
unit = "GB";
|
||||
interval = 60;
|
||||
warning = 20.0;
|
||||
alert = 10.0;
|
||||
}
|
||||
{
|
||||
block = "sound";
|
||||
format = "{output_name} {volume}%";
|
||||
on_click = "pavucontrol --tab=3";
|
||||
mappings = {
|
||||
"alsa_output.pci-0000_00_1f.3.analog-stereo" = "";
|
||||
"bluez_sink.70_26_05_DA_27_A4.a2dp_sink" = ""
|
||||
};
|
||||
}
|
||||
];
|
||||
'';
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = settingsFormat.type;
|
||||
default = { };
|
||||
description = ''
|
||||
Any extra options to add to i3status-rust
|
||||
<filename>config</filename>.
|
||||
'';
|
||||
example = literalExample ''
|
||||
{
|
||||
theme = {
|
||||
name = "solarized-dark";
|
||||
overrides = {
|
||||
idle_bg = "#123456";
|
||||
idle_fg = "#abcdef";
|
||||
};
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
icons = mkOption {
|
||||
type = types.str;
|
||||
default = "none";
|
||||
description = ''
|
||||
The icons set to use. See
|
||||
<link xlink:href="https://github.com/greshake/i3status-rust/blob/master/themes.md"/>
|
||||
for a list of available icon sets.
|
||||
'';
|
||||
example = "awesome5";
|
||||
};
|
||||
|
||||
theme = mkOption {
|
||||
type = types.str;
|
||||
default = "plain";
|
||||
description = ''
|
||||
The theme to use. See
|
||||
<link xlink:href="https://github.com/greshake/i3status-rust/blob/master/themes.md"/>
|
||||
for a list of available themes.
|
||||
'';
|
||||
example = "gruvbox-dark";
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
default = {
|
||||
default = {
|
||||
blocks = [
|
||||
{
|
||||
block = "disk_space";
|
||||
path = "/";
|
||||
alias = "/";
|
||||
info_type = "available";
|
||||
unit = "GB";
|
||||
interval = 60;
|
||||
warning = 20.0;
|
||||
alert = 10.0;
|
||||
}
|
||||
{
|
||||
block = "memory";
|
||||
display_type = "memory";
|
||||
format_mem = "{Mup}%";
|
||||
format_swap = "{SUp}%";
|
||||
}
|
||||
{
|
||||
block = "cpu";
|
||||
interval = 1;
|
||||
}
|
||||
{
|
||||
block = "load";
|
||||
interval = 1;
|
||||
format = "{1m}";
|
||||
}
|
||||
{ block = "sound"; }
|
||||
{
|
||||
block = "time";
|
||||
interval = 60;
|
||||
format = "%a %d/%m %R";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
description = ''
|
||||
Attribute set of i3status-rust bars, each with their own configuration.
|
||||
Each bar <varname>name</varname> generates a config file suffixed with
|
||||
the bar's <varname>name</varname> from the attribute set, like so:
|
||||
<filename>config-<replaceable>name</replaceable>.toml</filename>.
|
||||
</para><para>
|
||||
This way, multiple config files can be generated, such as for having a
|
||||
top and a bottom bar.
|
||||
</para><para>
|
||||
See
|
||||
<citerefentry>
|
||||
<refentrytitle>i3status-rust</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
</citerefentry>
|
||||
for options.
|
||||
'';
|
||||
example = literalExample ''
|
||||
bottom = {
|
||||
blocks = [
|
||||
{
|
||||
block = "disk_space";
|
||||
path = "/";
|
||||
alias = "/";
|
||||
info_type = "available";
|
||||
unit = "GB";
|
||||
interval = 60;
|
||||
warning = 20.0;
|
||||
alert = 10.0;
|
||||
}
|
||||
{
|
||||
block = "memory";
|
||||
display_type = "memory";
|
||||
format_mem = "{Mup}%";
|
||||
format_swap = "{SUp}%";
|
||||
}
|
||||
{
|
||||
block = "cpu";
|
||||
interval = 1;
|
||||
}
|
||||
{
|
||||
block = "load";
|
||||
interval = 1;
|
||||
format = "{1m}";
|
||||
}
|
||||
{ block = "sound"; }
|
||||
{
|
||||
block = "time";
|
||||
interval = 60;
|
||||
format = "%a %d/%m %R";
|
||||
}
|
||||
];
|
||||
settings = {
|
||||
theme = {
|
||||
name = "solarized-dark";
|
||||
overrides = {
|
||||
idle_bg = "#123456";
|
||||
idle_fg = "#abcdef";
|
||||
};
|
||||
};
|
||||
};
|
||||
icons = "awesome5";
|
||||
theme = "gruvbox-dark";
|
||||
};
|
||||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.i3status-rust;
|
||||
defaultText = literalExample "pkgs.i3status-rust";
|
||||
description = "Package providing i3status-rust";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile = mapAttrs' (cfgFileSuffix: cfg:
|
||||
nameValuePair ("i3status-rust/config-${cfgFileSuffix}.toml") ({
|
||||
onChange = mkIf config.xsession.windowManager.i3.enable restartI3;
|
||||
|
||||
source = settingsFormat.generate ("config-${cfgFileSuffix}.toml") ({
|
||||
theme = cfg.theme;
|
||||
icons = cfg.icons;
|
||||
block = cfg.blocks;
|
||||
} // cfg.settings);
|
||||
})) cfg.bars;
|
||||
};
|
||||
}
|
||||
208
modules/programs/i3status.nix
Normal file
208
modules/programs/i3status.nix
Normal file
@@ -0,0 +1,208 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.i3status;
|
||||
|
||||
enabledModules = filterAttrs (n: v: v.enable) cfg.modules;
|
||||
|
||||
formatOrder = n: ''order += "${n}"'';
|
||||
|
||||
formatModule = n: v:
|
||||
let
|
||||
formatLine = n: v:
|
||||
let
|
||||
formatValue = v:
|
||||
if isBool v then
|
||||
(if v then "true" else "false")
|
||||
else if isString v then
|
||||
''"${v}"''
|
||||
else
|
||||
toString v;
|
||||
in "${n} = ${formatValue v}";
|
||||
in ''
|
||||
${n} {
|
||||
${concatStringsSep "\n " (mapAttrsToList formatLine v)}
|
||||
}
|
||||
'';
|
||||
|
||||
settingsType = with types; attrsOf (oneOf [ bool int str ]);
|
||||
|
||||
sortAttrNamesByPosition = comparator: set:
|
||||
let pos = n: set."${n}".position;
|
||||
in sort (a: b: comparator (pos a) (pos b)) (attrNames set);
|
||||
in {
|
||||
meta.maintainers = [ hm.maintainers.justinlovinger ];
|
||||
|
||||
options.programs.i3status = {
|
||||
enable = mkEnableOption "i3status";
|
||||
|
||||
enableDefault = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether or not to enable
|
||||
the default configuration.
|
||||
'';
|
||||
};
|
||||
|
||||
general = mkOption {
|
||||
type = settingsType;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration to add to i3status <filename>config</filename>
|
||||
<code>general</code> section.
|
||||
See
|
||||
<citerefentry>
|
||||
<refentrytitle>i3status</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
</citerefentry>
|
||||
for options.
|
||||
'';
|
||||
example = literalExample ''
|
||||
{
|
||||
colors = true;
|
||||
color_good = "#e0e0e0";
|
||||
color_degraded = "#d7ae00";
|
||||
color_bad = "#f69d6a";
|
||||
interval = 1;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
modules = mkOption {
|
||||
type = types.attrsOf (types.submodule {
|
||||
options = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether or not to enable this module.
|
||||
'';
|
||||
};
|
||||
position = mkOption {
|
||||
type = with types; either int float;
|
||||
description = ''
|
||||
Position of this module in i3status <code>order</code>.
|
||||
'';
|
||||
};
|
||||
settings = mkOption {
|
||||
type = settingsType;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration to add to this i3status module.
|
||||
See
|
||||
<citerefentry>
|
||||
<refentrytitle>i3status</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
</citerefentry>
|
||||
for options.
|
||||
'';
|
||||
example = literalExample ''
|
||||
{
|
||||
format = "♪ %volume";
|
||||
format_muted = "♪ muted (%volume)";
|
||||
device = "pulse:1";
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
default = { };
|
||||
description = ''
|
||||
Modules to add to i3status <filename>config</filename> file.
|
||||
See
|
||||
<citerefentry>
|
||||
<refentrytitle>i3status</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
</citerefentry>
|
||||
for options.
|
||||
'';
|
||||
example = literalExample ''
|
||||
{
|
||||
"volume master" = {
|
||||
position = 1;
|
||||
settings = {
|
||||
format = "♪ %volume";
|
||||
format_muted = "♪ muted (%volume)";
|
||||
device = "pulse:1";
|
||||
};
|
||||
};
|
||||
"disk /" = {
|
||||
position = 2;
|
||||
settings = {
|
||||
format = "/ %avail";
|
||||
};
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.i3status = mkIf cfg.enableDefault {
|
||||
general = {
|
||||
colors = mkDefault true;
|
||||
interval = mkDefault 5;
|
||||
};
|
||||
|
||||
modules = {
|
||||
ipv6 = { position = mkDefault 1; };
|
||||
|
||||
"wireless _first_" = {
|
||||
position = mkDefault 2;
|
||||
settings = {
|
||||
format_up = mkDefault "W: (%quality at %essid) %ip";
|
||||
format_down = mkDefault "W: down";
|
||||
};
|
||||
};
|
||||
|
||||
"ethernet _first_" = {
|
||||
position = mkDefault 3;
|
||||
settings = {
|
||||
format_up = mkDefault "E: %ip (%speed)";
|
||||
format_down = mkDefault "E: down";
|
||||
};
|
||||
};
|
||||
|
||||
"battery all" = {
|
||||
position = mkDefault 4;
|
||||
settings = { format = mkDefault "%status %percentage %remaining"; };
|
||||
};
|
||||
|
||||
"disk /" = {
|
||||
position = mkDefault 5;
|
||||
settings = { format = mkDefault "%avail"; };
|
||||
};
|
||||
|
||||
load = {
|
||||
position = mkDefault 6;
|
||||
settings = { format = mkDefault "%1min"; };
|
||||
};
|
||||
|
||||
memory = {
|
||||
position = mkDefault 7;
|
||||
settings = {
|
||||
format = mkDefault "%used | %available";
|
||||
threshold_degraded = mkDefault "1G";
|
||||
format_degraded = mkDefault "MEMORY < %available";
|
||||
};
|
||||
};
|
||||
|
||||
"tztime local" = {
|
||||
position = mkDefault 8;
|
||||
settings = { format = mkDefault "%Y-%m-%d %H:%M:%S"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = [ pkgs.i3status ];
|
||||
|
||||
xdg.configFile."i3status/config".text = concatStringsSep "\n" ([ ]
|
||||
++ optional (cfg.general != { }) (formatModule "general" cfg.general)
|
||||
++ map formatOrder (sortAttrNamesByPosition lessThan enabledModules)
|
||||
++ mapAttrsToList formatModule
|
||||
(mapAttrs (n: v: v.settings) enabledModules));
|
||||
};
|
||||
}
|
||||
@@ -1,22 +1,21 @@
|
||||
# info.nix -- install texinfo, set INFOPATH, create `dir` file
|
||||
# info.nix -- install texinfo and create `dir` file
|
||||
|
||||
# This is a helper for the GNU info documentation system. By default,
|
||||
# the `info` command (and the Info subsystem within Emacs) gives easy
|
||||
# access to the info files stored system-wide, but not info files in
|
||||
# your ~/.nix-profile.
|
||||
|
||||
# We set $INFOPATH to include `/run/current-system/sw/share/info` and
|
||||
# `~/.nix-profile/share/info` but it's not enough. Although info can
|
||||
# then find files when you explicitly ask for them, it doesn't show
|
||||
# them to you in the table of contents on startup. To do that requires
|
||||
# a `dir` file. NixOS keeps the system-wide `dir` file up to date, but
|
||||
# ignores home-installed packages.
|
||||
# Specifically, although info can then find files when you explicitly
|
||||
# ask for them, it doesn't show them to you in the table of contents
|
||||
# on startup. To do that requires a `dir` file. NixOS keeps the
|
||||
# system-wide `dir` file up to date, but ignores files installed in
|
||||
# user profiles.
|
||||
|
||||
# So this module contains an activation script that generates the
|
||||
# `dir` for your home profile. Then when you start info (and both
|
||||
# `dir` files are in your $INFOPATH), it will *merge* the contents of
|
||||
# the two files, showing you a unified table of contents for all
|
||||
# packages. This is really nice.
|
||||
# This module contains extra profile commands that generate the `dir`
|
||||
# for your home profile. Then when you start info (and both `dir`
|
||||
# files are in your $INFOPATH), it will *merge* the contents of the
|
||||
# two files, showing you a unified table of contents for all packages.
|
||||
# This is really nice.
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
@@ -26,50 +25,39 @@ let
|
||||
|
||||
cfg = config.programs.info;
|
||||
|
||||
# Indexes info files found in this location
|
||||
homeInfoPath = "${config.home.profileDirectory}/share/info";
|
||||
|
||||
# Installs this package -- the interactive just means that it
|
||||
# includes the curses `info` program. We also use `install-info`
|
||||
# from this package in the activation script.
|
||||
infoPkg = pkgs.texinfoInteractive;
|
||||
|
||||
in {
|
||||
options = {
|
||||
programs.info = {
|
||||
enable = mkEnableOption "GNU Info";
|
||||
imports = [
|
||||
(mkRemovedOptionModule [ "programs" "info" "homeInfoDirLocation" ] ''
|
||||
The `dir` file is now generated as part of the Home Manager profile and
|
||||
will no longer be placed in your home directory.
|
||||
'')
|
||||
];
|
||||
|
||||
homeInfoDirLocation = mkOption {
|
||||
default = "\${XDG_CACHE_HOME:-$HOME/.cache}/info";
|
||||
description = ''
|
||||
Directory in which to store the info <filename>dir</filename>
|
||||
file within your home.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
options.programs.info.enable = mkEnableOption "GNU Info";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.sessionVariables.INFOPATH =
|
||||
"${cfg.homeInfoDirLocation}\${INFOPATH:+:}\${INFOPATH}";
|
||||
home.packages = [
|
||||
infoPkg
|
||||
|
||||
home.activation.createHomeInfoDir =
|
||||
hm.dag.entryAfter [ "installPackages" ] ''
|
||||
oPATH=$PATH
|
||||
export PATH="${lib.makeBinPath [ pkgs.gzip ]}''${PATH:+:}$PATH"
|
||||
$DRY_RUN_CMD mkdir -p "${cfg.homeInfoDirLocation}"
|
||||
$DRY_RUN_CMD rm -f "${cfg.homeInfoDirLocation}/dir"
|
||||
if [[ -d "${homeInfoPath}" ]]; then
|
||||
find -L "${homeInfoPath}" \( -name '*.info' -o -name '*.info.gz' \) \
|
||||
-exec $DRY_RUN_CMD ${infoPkg}/bin/install-info '{}' \
|
||||
"${cfg.homeInfoDirLocation}/dir" \;
|
||||
fi
|
||||
export PATH="$oPATH"
|
||||
unset oPATH
|
||||
'';
|
||||
|
||||
home.packages = [ infoPkg ];
|
||||
# Make sure the target directory is a real directory.
|
||||
(pkgs.runCommandLocal "dummy-info-dir1" { } "mkdir -p $out/share/info")
|
||||
(pkgs.runCommandLocal "dummy-info-dir2" { } "mkdir -p $out/share/info")
|
||||
];
|
||||
|
||||
home.extraOutputsToInstall = [ "info" ];
|
||||
|
||||
home.extraProfileCommands = let infoPath = "$out/share/info";
|
||||
in ''
|
||||
if [[ -w "${infoPath}" && ! -e "${infoPath}/dir" ]]; then
|
||||
PATH="${lib.makeBinPath [ pkgs.gzip infoPkg ]}''${PATH:+:}$PATH" \
|
||||
find -L "${infoPath}" \( -name '*.info' -o -name '*.info.gz' \) \
|
||||
-exec install-info '{}' "${infoPath}/dir" ';'
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -51,12 +51,12 @@ in {
|
||||
|
||||
default = {
|
||||
null = "1;30";
|
||||
false = "0;39";
|
||||
true = "0;39";
|
||||
numbers = "0;39";
|
||||
false = "0;37";
|
||||
true = "0;37";
|
||||
numbers = "0;37";
|
||||
strings = "0;32";
|
||||
arrays = "1;39";
|
||||
objects = "1;39";
|
||||
arrays = "1;37";
|
||||
objects = "1;37";
|
||||
};
|
||||
|
||||
type = colorsType;
|
||||
|
||||
@@ -97,16 +97,7 @@ let
|
||||
keyMapping = types.submodule {
|
||||
options = {
|
||||
mode = mkOption {
|
||||
type = types.enum [
|
||||
"insert"
|
||||
"normal"
|
||||
"prompt"
|
||||
"menu"
|
||||
"user"
|
||||
"goto"
|
||||
"view"
|
||||
"object"
|
||||
];
|
||||
type = types.str;
|
||||
example = "user";
|
||||
description = ''
|
||||
The mode in which the mapping takes effect.
|
||||
@@ -498,6 +489,10 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
kakouneWithPlugins = pkgs.wrapKakoune pkgs.kakoune-unwrapped {
|
||||
configure = { plugins = cfg.plugins; };
|
||||
};
|
||||
|
||||
configFile = let
|
||||
wrapOptions = with cfg.config.wrapLines;
|
||||
concatStrings [
|
||||
@@ -515,12 +510,22 @@ let
|
||||
];
|
||||
|
||||
showWhitespaceOptions = with cfg.config.showWhitespace;
|
||||
concatStrings [
|
||||
(optionalString (tab != null) " -tab ${tab}")
|
||||
(optionalString (tabStop != null) " -tabpad ${tabStop}")
|
||||
(optionalString (space != null) " -spc ${space}")
|
||||
(optionalString (nonBreakingSpace != null) " -nbsp ${nonBreakingSpace}")
|
||||
(optionalString (lineFeed != null) " -lf ${lineFeed}")
|
||||
let
|
||||
quoteSep = sep:
|
||||
if sep == "'" then
|
||||
''"'"''
|
||||
else if lib.strings.stringLength sep == 1 then
|
||||
"'${sep}'"
|
||||
else
|
||||
sep; # backwards compat, in case sep == "' '", etc.
|
||||
|
||||
in concatStrings [
|
||||
(optionalString (tab != null) " -tab ${quoteSep tab}")
|
||||
(optionalString (tabStop != null) " -tabpad ${quoteSep tabStop}")
|
||||
(optionalString (space != null) " -spc ${quoteSep space}")
|
||||
(optionalString (nonBreakingSpace != null)
|
||||
" -nbsp ${quoteSep nonBreakingSpace}")
|
||||
(optionalString (lineFeed != null) " -lf ${quoteSep lineFeed}")
|
||||
];
|
||||
|
||||
uiOptions = with cfg.config.ui;
|
||||
@@ -543,6 +548,21 @@ let
|
||||
}"
|
||||
];
|
||||
|
||||
userModeString = mode:
|
||||
optionalString (!builtins.elem mode [
|
||||
"insert"
|
||||
"normal"
|
||||
"prompt"
|
||||
"menu"
|
||||
"user"
|
||||
"goto"
|
||||
"view"
|
||||
"object"
|
||||
]) "try %{declare-user-mode ${mode}}";
|
||||
|
||||
userModeStrings = map userModeString
|
||||
(lists.unique (map (km: km.mode) cfg.config.keyMappings));
|
||||
|
||||
keyMappingString = km:
|
||||
concatStringsSep " " [
|
||||
"map global"
|
||||
@@ -554,7 +574,7 @@ let
|
||||
hookString = h:
|
||||
concatStringsSep " " [
|
||||
"hook"
|
||||
"${optionalString (h.group != null) "-group ${group}"}"
|
||||
"${optionalString (h.group != null) "-group ${h.group}"}"
|
||||
"${optionalString (h.once) "-once"}"
|
||||
"global"
|
||||
"${h.name}"
|
||||
@@ -592,7 +612,8 @@ let
|
||||
++ [ "# UI options" ]
|
||||
++ optional (ui != null) "set-option global ui_options ${uiOptions}"
|
||||
|
||||
++ [ "# Key mappings" ] ++ map keyMappingString keyMappings
|
||||
++ [ "# User modes" ] ++ userModeStrings ++ [ "# Key mappings" ]
|
||||
++ map keyMappingString keyMappings
|
||||
|
||||
++ [ "# Hooks" ] ++ map hookString hooks);
|
||||
in pkgs.writeText "kakrc"
|
||||
@@ -617,11 +638,22 @@ in {
|
||||
<filename>~/.config/kak/kakrc</filename>.
|
||||
'';
|
||||
};
|
||||
|
||||
plugins = mkOption {
|
||||
type = with types; listOf package;
|
||||
default = [ ];
|
||||
example = literalExample "[ pkgs.kakounePlugins.kak-fzf ]";
|
||||
description = ''
|
||||
List of kakoune plugins to install. To get a list of
|
||||
supported plugins run:
|
||||
<command>nix-env -f '<nixpkgs>' -qaP -A kakounePlugins</command>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.kakoune ];
|
||||
home.packages = [ kakouneWithPlugins ];
|
||||
xdg.configFile."kak/kakrc".source = configFile;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -79,7 +79,11 @@ in {
|
||||
# Generated by Home Manager.
|
||||
# See https://sw.kovidgoyal.net/kitty/conf.html
|
||||
|
||||
${optionalString (cfg.font != null) "font_family ${cfg.font.name}"}
|
||||
${optionalString (cfg.font != null) ''
|
||||
font_family ${cfg.font.name}
|
||||
${optionalString (cfg.font.size != null)
|
||||
"font_size ${toString cfg.font.size}"}
|
||||
''}
|
||||
|
||||
${toKittyConfig cfg.settings}
|
||||
|
||||
|
||||
219
modules/programs/lf.nix
Normal file
219
modules/programs/lf.nix
Normal file
@@ -0,0 +1,219 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.lf;
|
||||
|
||||
knownSettings = {
|
||||
anchorfind = types.bool;
|
||||
color256 = types.bool;
|
||||
dircounts = types.bool;
|
||||
dirfirst = types.bool;
|
||||
drawbox = types.bool;
|
||||
globsearch = types.bool;
|
||||
icons = types.bool;
|
||||
hidden = types.bool;
|
||||
ignorecase = types.bool;
|
||||
ignoredia = types.bool;
|
||||
incsearch = types.bool;
|
||||
preview = types.bool;
|
||||
reverse = types.bool;
|
||||
smartcase = types.bool;
|
||||
smartdia = types.bool;
|
||||
wrapscan = types.bool;
|
||||
wrapscroll = types.bool;
|
||||
number = types.bool;
|
||||
relativenumber = types.bool;
|
||||
findlen = types.int;
|
||||
period = types.int;
|
||||
scrolloff = types.int;
|
||||
tabstop = types.int;
|
||||
errorfmt = types.str;
|
||||
filesep = types.str;
|
||||
ifs = types.str;
|
||||
promptfmt = types.str;
|
||||
shell = types.str;
|
||||
sortby = types.str;
|
||||
timefmt = types.str;
|
||||
ratios = types.str;
|
||||
info = types.str;
|
||||
shellopts = types.str;
|
||||
};
|
||||
|
||||
lfSettingsType = types.submodule {
|
||||
options = let
|
||||
opt = name: type:
|
||||
mkOption {
|
||||
type = types.nullOr type;
|
||||
default = null;
|
||||
visible = false;
|
||||
};
|
||||
in mapAttrs opt knownSettings;
|
||||
};
|
||||
in {
|
||||
meta.maintainers = [ hm.maintainers.owm111 ];
|
||||
|
||||
options = {
|
||||
programs.lf = {
|
||||
enable = mkEnableOption "lf";
|
||||
|
||||
settings = mkOption {
|
||||
type = lfSettingsType;
|
||||
default = { };
|
||||
example = {
|
||||
tabstop = 4;
|
||||
number = true;
|
||||
ratios = "1:1:2";
|
||||
};
|
||||
description = ''
|
||||
An attribute set of lf settings. The attribute names and corresponding
|
||||
values must be among the following supported options.
|
||||
|
||||
<informaltable frame="none"><tgroup cols="1"><tbody>
|
||||
${concatStringsSep "\n" (mapAttrsToList (n: v: ''
|
||||
<row>
|
||||
<entry><varname>${n}</varname></entry>
|
||||
<entry>${v.description}</entry>
|
||||
</row>
|
||||
'') knownSettings)}
|
||||
</tbody></tgroup></informaltable>
|
||||
|
||||
See the lf documentation for detailed descriptions of these options.
|
||||
Note, use <varname>previewer</varname> to set lf's
|
||||
<varname>previewer</varname> option, and
|
||||
<varname>extraConfig</varname> for any other option not listed above.
|
||||
All string options are quoted with double quotes.
|
||||
'';
|
||||
};
|
||||
|
||||
commands = mkOption {
|
||||
type = with types; attrsOf (nullOr str);
|
||||
default = { };
|
||||
example = {
|
||||
get-mime-type = ''%xdg-mime query filetype "$f"'';
|
||||
open = "$$OPENER $f";
|
||||
};
|
||||
description = ''
|
||||
Commands to declare. Commands set to null or an empty string are
|
||||
deleted.
|
||||
'';
|
||||
};
|
||||
|
||||
keybindings = mkOption {
|
||||
type = with types; attrsOf (nullOr str);
|
||||
default = { };
|
||||
example = {
|
||||
gh = "cd ~";
|
||||
D = "trash";
|
||||
i = "$less $f";
|
||||
U = "!du -sh";
|
||||
gg = null;
|
||||
};
|
||||
description =
|
||||
"Keys to bind. Keys set to null or an empty string are deleted.";
|
||||
};
|
||||
|
||||
cmdKeybindings = mkOption {
|
||||
type = with types; attrsOf (nullOr str);
|
||||
default = { };
|
||||
example = literalExample ''{ "<c-g>" = "cmd-escape"; }'';
|
||||
description = ''
|
||||
Keys to bind to command line commands which can only be one of the
|
||||
builtin commands. Keys set to null or an empty string are deleted.
|
||||
'';
|
||||
};
|
||||
|
||||
previewer.source = mkOption {
|
||||
type = with types; nullOr path;
|
||||
default = null;
|
||||
example = literalExample ''
|
||||
pkgs.writeShellScript "pv.sh" '''
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
*.tar*) tar tf "$1";;
|
||||
*.zip) unzip -l "$1";;
|
||||
*.rar) unrar l "$1";;
|
||||
*.7z) 7z l "$1";;
|
||||
*.pdf) pdftotext "$1" -;;
|
||||
*) highlight -O ansi "$1" || cat "$1";;
|
||||
esac
|
||||
'''
|
||||
'';
|
||||
description = ''
|
||||
Script or executable to use to preview files. Sets lf's
|
||||
<varname>previewer</varname> option.
|
||||
'';
|
||||
};
|
||||
|
||||
previewer.keybinding = mkOption {
|
||||
type = with types; nullOr str;
|
||||
default = null;
|
||||
example = "i";
|
||||
description = ''
|
||||
Key to bind to the script at <varname>previewer.source</varname> and
|
||||
pipe through less. Setting to null will not bind any key.
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
example = ''
|
||||
$mkdir -p ~/.trash
|
||||
'';
|
||||
description = "Custom lfrc lines.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.lf ];
|
||||
|
||||
xdg.configFile."lf/lfrc".text = let
|
||||
fmtSetting = k: v:
|
||||
optionalString (v != null) "set ${
|
||||
if isBool v then
|
||||
"${optionalString (!v) "no"}${k}"
|
||||
else
|
||||
"${k} ${if isInt v then toString v else ''"${v}"''}"
|
||||
}";
|
||||
|
||||
settingsStr = concatStringsSep "\n" (filter (x: x != "")
|
||||
(mapAttrsToList fmtSetting
|
||||
(builtins.intersectAttrs knownSettings cfg.settings)));
|
||||
|
||||
fmtCmdMap = before: k: v:
|
||||
"${before} ${k}${optionalString (v != null && v != "") " ${v}"}";
|
||||
fmtCmd = fmtCmdMap "cmd";
|
||||
fmtMap = fmtCmdMap "map";
|
||||
fmtCmap = fmtCmdMap "cmap";
|
||||
|
||||
commandsStr = concatStringsSep "\n" (mapAttrsToList fmtCmd cfg.commands);
|
||||
keybindingsStr =
|
||||
concatStringsSep "\n" (mapAttrsToList fmtMap cfg.keybindings);
|
||||
cmdKeybindingsStr =
|
||||
concatStringsSep "\n" (mapAttrsToList fmtCmap cfg.cmdKeybindings);
|
||||
|
||||
previewerStr = optionalString (cfg.previewer.source != null) ''
|
||||
set previewer ${cfg.previewer.source}
|
||||
${optionalString (cfg.previewer.keybinding != null) ''
|
||||
map ${cfg.previewer.keybinding} ''$${cfg.previewer.source} "$f" | less -R
|
||||
''}
|
||||
'';
|
||||
in ''
|
||||
${settingsStr}
|
||||
|
||||
${commandsStr}
|
||||
|
||||
${keybindingsStr}
|
||||
|
||||
${cmdKeybindingsStr}
|
||||
|
||||
${previewerStr}
|
||||
|
||||
${cfg.extraConfig}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -43,6 +43,10 @@ in {
|
||||
options = {
|
||||
programs.lieer.enable =
|
||||
mkEnableOption "lieer Gmail synchronization for notmuch";
|
||||
|
||||
accounts.email.accounts = mkOption {
|
||||
type = with types; attrsOf (submodule (import ./lieer-accounts.nix));
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
|
||||
@@ -6,12 +6,14 @@ let
|
||||
|
||||
cfg = config.programs.lsd;
|
||||
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
|
||||
aliases = {
|
||||
ls = "${pkgs.lsd}/bin/lsd";
|
||||
ll = "ls -l";
|
||||
la = "ls -a";
|
||||
lt = "ls --tree";
|
||||
lla = "ls -la";
|
||||
ll = "${pkgs.lsd}/bin/lsd -l";
|
||||
la = "${pkgs.lsd}/bin/lsd -a";
|
||||
lt = "${pkgs.lsd}/bin/lsd --tree";
|
||||
lla = "${pkgs.lsd}/bin/lsd -la";
|
||||
};
|
||||
|
||||
in {
|
||||
@@ -27,6 +29,21 @@ in {
|
||||
Whether to enable recommended lsd aliases.
|
||||
'';
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
example = {
|
||||
date = "relative";
|
||||
ignore-globs = [ ".git" ".hg" ];
|
||||
};
|
||||
description = ''
|
||||
Configuration written to
|
||||
<filename>~/.config/lsd/config.yaml</filename>. See
|
||||
<link xlink:href="https://github.com/Peltoche/lsd#config-file-content"/>
|
||||
for supported values.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
@@ -37,5 +54,9 @@ in {
|
||||
programs.zsh.shellAliases = mkIf cfg.enableAliases aliases;
|
||||
|
||||
programs.fish.shellAliases = mkIf cfg.enableAliases aliases;
|
||||
|
||||
xdg.configFile."lsd/config.yaml" = mkIf (cfg.settings != { }) {
|
||||
source = yamlFormat.generate "lsd-config" cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,19 +4,69 @@ with lib;
|
||||
|
||||
{
|
||||
options = {
|
||||
programs.man.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to enable manual pages and the <command>man</command>
|
||||
command. This also includes "man" outputs of all
|
||||
<literal>home.packages</literal>.
|
||||
'';
|
||||
programs.man = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to enable manual pages and the <command>man</command>
|
||||
command. This also includes "man" outputs of all
|
||||
<literal>home.packages</literal>.
|
||||
'';
|
||||
};
|
||||
|
||||
generateCaches = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to generate the manual page index caches using
|
||||
<citerefentry>
|
||||
<refentrytitle>mandb</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>. This allows searching for a page or
|
||||
keyword using utilities like <citerefentry>
|
||||
<refentrytitle>apropos</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
</citerefentry>.
|
||||
</para><para>
|
||||
This feature is disabled by default because it slows down
|
||||
building. If you don't mind waiting a few more seconds when
|
||||
Home Manager builds a new generation, you may safely enable
|
||||
this option.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.programs.man.enable {
|
||||
home.packages = [ pkgs.man ];
|
||||
home.extraOutputsToInstall = [ "man" ];
|
||||
|
||||
# This is mostly copy/pasted/adapted from NixOS' documentation.nix.
|
||||
home.file = mkIf config.programs.man.generateCaches {
|
||||
".manpath".text = let
|
||||
# Generate a directory containing installed packages' manpages.
|
||||
manualPages = pkgs.buildEnv {
|
||||
name = "man-paths";
|
||||
paths = config.home.packages;
|
||||
pathsToLink = [ "/share/man" ];
|
||||
extraOutputsToInstall = [ "man" ];
|
||||
ignoreCollisions = true;
|
||||
};
|
||||
|
||||
# Generate a database of all manpages in ${manualPages}.
|
||||
manualCache = pkgs.runCommandLocal "man-cache" { } ''
|
||||
# Generate a temporary man.conf so mandb knows where to
|
||||
# write cache files.
|
||||
echo "MANDB_MAP ${manualPages}/share/man $out" > man.conf
|
||||
|
||||
# Run mandb to generate cache files:
|
||||
${pkgs.man-db}/bin/mandb -C man.conf --no-straycats --create \
|
||||
${manualPages}/share/man
|
||||
'';
|
||||
in ''
|
||||
MANDB_MAP ${config.home.profileDirectory}/share/man ${manualCache}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ in {
|
||||
|
||||
config = mkOption {
|
||||
default = { };
|
||||
type = types.attrs;
|
||||
type = types.attrsOf types.anything;
|
||||
description = ''
|
||||
Add terms to the <filename>matplotlibrc</filename> file to
|
||||
control the default matplotlib behavior.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ lib, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
@@ -6,6 +6,110 @@ let
|
||||
|
||||
extraConfigType = with lib.types; attrsOf (either (either str int) bool);
|
||||
|
||||
perAccountGroups = { name, config, ... }: {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
# Make value of name the same as the name used with the dot prefix
|
||||
default = name;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
The name of this group for this account. These names are different than
|
||||
some others, because they will hide channel names that are the same.
|
||||
'';
|
||||
};
|
||||
|
||||
channels = mkOption {
|
||||
type = types.attrsOf (types.submodule channel);
|
||||
default = { };
|
||||
description = ''
|
||||
List of channels that should be grouped together into this group. When
|
||||
performing a synchronization, the groups are synchronized, rather than
|
||||
the individual channels.
|
||||
</para><para>
|
||||
Using these channels and then grouping them together allows for you to
|
||||
define the maildir hierarchy as you see fit.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Options for configuring channel(s) that will be composed together into a group.
|
||||
channel = { name, config, ... }: {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = name;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
The unique name for THIS channel in THIS group. The group will refer to
|
||||
this channel by this name.
|
||||
</para><para>
|
||||
In addition, you can manually sync just this channel by specifying this
|
||||
name to mbsync on the command line.
|
||||
'';
|
||||
};
|
||||
|
||||
masterPattern = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
example = "[Gmail]/Sent Mail";
|
||||
description = ''
|
||||
IMAP4 patterns for which mailboxes on the remote mail server to sync.
|
||||
If <literal>Patterns</literal> are specified, <literal>masterPattern</literal>
|
||||
is interpreted as a prefix which is not matched against the patterns,
|
||||
and is not affected by mailbox list overrides.
|
||||
</para><para>
|
||||
If this is left as the default, then mbsync will default to the pattern
|
||||
<literal>INBOX</literal>.
|
||||
'';
|
||||
};
|
||||
|
||||
slavePattern = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
example = "Sent";
|
||||
description = ''
|
||||
Name for where mail coming from the master mail server will end up
|
||||
locally. The mailbox specified by the master's pattern will be placed
|
||||
in this directory.
|
||||
</para><para>
|
||||
If this is left as the default, then mbsync will default to the pattern
|
||||
<literal>INBOX</literal>.
|
||||
'';
|
||||
};
|
||||
|
||||
patterns = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = [ "INBOX" ];
|
||||
description = ''
|
||||
Instead of synchronizing <emphasis>just</emphasis> the mailboxes that
|
||||
match the <literal>masterPattern</literal>, use it as a prefix which is
|
||||
not matched against the patterns, and is not affected by mailbox list
|
||||
overrides.
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = extraConfigType;
|
||||
default = { };
|
||||
example = ''
|
||||
{
|
||||
Create = "both";
|
||||
CopyArrivalDate = "yes";
|
||||
MaxMessages = 10000;
|
||||
MaxSize = "1m";
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Extra configuration lines to add to <emphasis>THIS</emphasis> channel's
|
||||
configuration.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
in {
|
||||
options.mbsync = {
|
||||
enable = mkEnableOption "synchronization using mbsync";
|
||||
@@ -21,6 +125,16 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
subFolders = mkOption {
|
||||
type = types.enum [ "Verbatim" "Maildir++" "Legacy" ];
|
||||
default = "Verbatim";
|
||||
example = "Maildir++";
|
||||
description = ''
|
||||
The on-disk folder naming style. This option has no
|
||||
effect when <option>flatten</option> is used.
|
||||
'';
|
||||
};
|
||||
|
||||
create = mkOption {
|
||||
type = types.enum [ "none" "maildir" "imap" "both" ];
|
||||
default = "none";
|
||||
@@ -58,6 +172,23 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
groups = mkOption {
|
||||
type = types.attrsOf (types.submodule perAccountGroups);
|
||||
default = { };
|
||||
# The default cannot actually be empty, but contains an attribute set where
|
||||
# the channels set is empty. If a group is specified, then a name is given,
|
||||
# creating the attribute set.
|
||||
description = ''
|
||||
Some email providers (Gmail) have a different directory hierarchy for
|
||||
synchronized email messages. Namely, when using mbsync without specifying
|
||||
a set of channels into a group, all synchronized directories end up beneath
|
||||
the <literal>[Gmail]/</literal> directory.
|
||||
</para><para>
|
||||
This option allows you to specify a group, and subsequently channels that
|
||||
will allow you to sync your mail into an arbitrary hierarchy.
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig.channel = mkOption {
|
||||
type = extraConfigType;
|
||||
default = { };
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user