mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
Compare commits
105 Commits
release-21
...
files-bash
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a1297444b | ||
|
|
f6f6990fc8 | ||
|
|
addc78bea0 | ||
|
|
0423a7b40c | ||
|
|
996b439739 | ||
|
|
cc6909d407 | ||
|
|
784da32958 | ||
|
|
6c984bd675 | ||
|
|
ddeeb031fd | ||
|
|
41101d0e62 | ||
|
|
fa483b82ab | ||
|
|
d7e089699a | ||
|
|
2b75633b2c | ||
|
|
41903a14b0 | ||
|
|
82b06103ae | ||
|
|
5f433eb164 | ||
|
|
1617e56c2f | ||
|
|
c476cc61b2 | ||
|
|
f56a087cbc | ||
|
|
775cb20bd4 | ||
|
|
9e3c402972 | ||
|
|
4971b9cad0 | ||
|
|
3ab254aff4 | ||
|
|
9ed7a73ae2 | ||
|
|
ae636c09f4 | ||
|
|
2c9fe368c1 | ||
|
|
d7d7bbbf20 | ||
|
|
06ee8ec8df | ||
|
|
97d183e2e4 | ||
|
|
ac319fd314 | ||
|
|
7df6656b11 | ||
|
|
9ad0024d4d | ||
|
|
3f6cb409ca | ||
|
|
5b08b33e8f | ||
|
|
9b7a90daa1 | ||
|
|
85d67b0a6e | ||
|
|
dc4337d9fe | ||
|
|
a17bc3217f | ||
|
|
2aeaf65e8f | ||
|
|
f4998f0adc | ||
|
|
8d3b273afe | ||
|
|
8eee5f5272 | ||
|
|
0ada50fc9c | ||
|
|
7e2b1a42aa | ||
|
|
ab0e6c3e0e | ||
|
|
21ac4c499b | ||
|
|
b42fce7aaa | ||
|
|
49864a4370 | ||
|
|
762f860cfb | ||
|
|
04955ca970 | ||
|
|
cd11c02c28 | ||
|
|
a73e619377 | ||
|
|
dc1b6b8349 | ||
|
|
e70524cd2b | ||
|
|
2f6d5c90f4 | ||
|
|
6d9bff77ed | ||
|
|
d04e52b0c0 | ||
|
|
3aa479d551 | ||
|
|
a01fe9f81e | ||
|
|
6cd92c643a | ||
|
|
5a19e0ea9c | ||
|
|
63af2d3e4c | ||
|
|
e92f5bb79e | ||
|
|
1e8d0beae4 | ||
|
|
9b39fd7eb4 | ||
|
|
be0e73a308 | ||
|
|
e0f2949c98 | ||
|
|
1375fd4a03 | ||
|
|
b6613a8544 | ||
|
|
c982c19f53 | ||
|
|
4ed6705b0f | ||
|
|
25bf3d7953 | ||
|
|
fb50102daf | ||
|
|
666eee4f72 | ||
|
|
42847469b3 | ||
|
|
aa36e2d6b4 | ||
|
|
06a98ba0fd | ||
|
|
f74dc9c70b | ||
|
|
9424f31f86 | ||
|
|
3ffe2a4cdf | ||
|
|
afb5fd962c | ||
|
|
7591c8041d | ||
|
|
5060262b79 | ||
|
|
ac82c036d8 | ||
|
|
e9ed9c2e11 | ||
|
|
5eb199e937 | ||
|
|
dba802c1d9 | ||
|
|
e4c55ed4e6 | ||
|
|
19d95258ac | ||
|
|
5c1415d67f | ||
|
|
45f9cb06a9 | ||
|
|
c12d53dd7c | ||
|
|
d3cdabb5c9 | ||
|
|
c7e79b5337 | ||
|
|
95da56b783 | ||
|
|
30102ea9e5 | ||
|
|
d6bbd02e95 | ||
|
|
b917624670 | ||
|
|
cb227dc6c2 | ||
|
|
2a4ab0d891 | ||
|
|
9e253a8c30 | ||
|
|
5573c10ea4 | ||
|
|
0e329cee4c | ||
|
|
d2aaeac42c | ||
|
|
07ad6a4f76 |
47
.github/CODEOWNERS
vendored
47
.github/CODEOWNERS
vendored
@@ -4,6 +4,9 @@
|
|||||||
|
|
||||||
/modules/home-environment.nix @rycee
|
/modules/home-environment.nix @rycee
|
||||||
|
|
||||||
|
/modules/i18n/input-method @Kranzes
|
||||||
|
/tests/modules/i18n/input-method @Kranzes
|
||||||
|
|
||||||
/modules/misc/dconf.nix @gnidorah @rycee
|
/modules/misc/dconf.nix @gnidorah @rycee
|
||||||
|
|
||||||
/modules/misc/fontconfig.nix @rycee
|
/modules/misc/fontconfig.nix @rycee
|
||||||
@@ -37,6 +40,11 @@
|
|||||||
/modules/misc/xdg-system-dirs.nix @tadfisher
|
/modules/misc/xdg-system-dirs.nix @tadfisher
|
||||||
/tests/modules/misc/xdg/system-dirs.nix @tadfisher
|
/tests/modules/misc/xdg/system-dirs.nix @tadfisher
|
||||||
|
|
||||||
|
/modules/misc/xdg-desktop-entries.nix @cwyc
|
||||||
|
/tests/modules/misc/xdg/desktop-entries.nix @cwyc
|
||||||
|
/tests/modules/misc/xdg/desktop-full-expected.desktop @cwyc
|
||||||
|
/tests/modules/misc/xdg/desktop-min-expected.desktop @cwyc
|
||||||
|
|
||||||
/modules/programs/aria2.nix @JustinLovinger
|
/modules/programs/aria2.nix @JustinLovinger
|
||||||
|
|
||||||
/modules/programs/autojump.nix @evanjs
|
/modules/programs/autojump.nix @evanjs
|
||||||
@@ -72,10 +80,13 @@
|
|||||||
|
|
||||||
/modules/programs/git.nix @rycee
|
/modules/programs/git.nix @rycee
|
||||||
|
|
||||||
/modules/programs/gnome-terminal.nix @rycee
|
/modules/programs/gnome-terminal.nix @kamadorueda @rycee
|
||||||
|
|
||||||
/modules/programs/go.nix @rvolosatovs
|
/modules/programs/go.nix @rvolosatovs
|
||||||
|
|
||||||
|
/modules/programs/himalaya.nix @ambroisie
|
||||||
|
/tests/modules/programs/himalaya @ambroisie
|
||||||
|
|
||||||
/modules/programs/home-manager.nix @rycee
|
/modules/programs/home-manager.nix @rycee
|
||||||
|
|
||||||
/modules/programs/htop.nix @bjpbakker
|
/modules/programs/htop.nix @bjpbakker
|
||||||
@@ -99,6 +110,9 @@
|
|||||||
|
|
||||||
/modules/programs/matplotlib.nix @rprospero
|
/modules/programs/matplotlib.nix @rprospero
|
||||||
|
|
||||||
|
/modules/programs/mangohud.nix @ZerataX
|
||||||
|
/tests/modules/programs/mangohud @ZerataX
|
||||||
|
|
||||||
/modules/programs/mbsync.nix @KarlJoad
|
/modules/programs/mbsync.nix @KarlJoad
|
||||||
/tests/modules/programs/mbsync @KarlJoad
|
/tests/modules/programs/mbsync @KarlJoad
|
||||||
|
|
||||||
@@ -143,8 +157,13 @@
|
|||||||
|
|
||||||
/modules/programs/pidgin.nix @rycee
|
/modules/programs/pidgin.nix @rycee
|
||||||
|
|
||||||
|
/modules/programs/piston-cli.nix @ethancedwards8
|
||||||
|
|
||||||
/modules/programs/powerline-go.nix @DamienCassou
|
/modules/programs/powerline-go.nix @DamienCassou
|
||||||
|
|
||||||
|
/modules/programs/rbw.nix @ambroisie
|
||||||
|
/tests/modules/programs/rbw @ambroisie
|
||||||
|
|
||||||
/modules/programs/rofi.nix @thiagokokada
|
/modules/programs/rofi.nix @thiagokokada
|
||||||
/tests/modules/programs/rofi @thiagokokada
|
/tests/modules/programs/rofi @thiagokokada
|
||||||
|
|
||||||
@@ -159,10 +178,17 @@
|
|||||||
/modules/programs/scmpuff.nix @cpcloud
|
/modules/programs/scmpuff.nix @cpcloud
|
||||||
/tests/modules/programs/scmpuff @cpcloud
|
/tests/modules/programs/scmpuff @cpcloud
|
||||||
|
|
||||||
|
/modules/programs/senpai.nix @malte-v
|
||||||
|
|
||||||
|
/modules/programs/sm64ex.nix @ivarwithoutbones
|
||||||
|
/tests/modules/programs/sm64ex @ivarwithoutbones
|
||||||
|
|
||||||
/modules/programs/ssh.nix @rycee
|
/modules/programs/ssh.nix @rycee
|
||||||
|
|
||||||
/modules/programs/starship.nix @marsam
|
/modules/programs/starship.nix @marsam
|
||||||
|
|
||||||
|
/modules/programs/terminator.nix @chisui
|
||||||
|
|
||||||
/modules/programs/texlive.nix @rycee
|
/modules/programs/texlive.nix @rycee
|
||||||
|
|
||||||
/modules/programs/topgrade.nix @msfjarvis
|
/modules/programs/topgrade.nix @msfjarvis
|
||||||
@@ -171,6 +197,9 @@
|
|||||||
/modules/programs/waybar.nix @berbiche
|
/modules/programs/waybar.nix @berbiche
|
||||||
/tests/modules/programs/waybar @berbiche
|
/tests/modules/programs/waybar @berbiche
|
||||||
|
|
||||||
|
/modules/programs/xmobar.nix @t4ccer
|
||||||
|
/tests/modules/programs/xmobar @t4ccer
|
||||||
|
|
||||||
/modules/programs/z-lua.nix @marsam
|
/modules/programs/z-lua.nix @marsam
|
||||||
|
|
||||||
/modules/programs/zathura.nix @rprospero
|
/modules/programs/zathura.nix @rprospero
|
||||||
@@ -188,6 +217,9 @@
|
|||||||
|
|
||||||
/modules/services/clipmenu.nix @DamienCassou
|
/modules/services/clipmenu.nix @DamienCassou
|
||||||
|
|
||||||
|
/modules/services/devilspie2.nix @dawidsowa
|
||||||
|
/tests/modules/services/devilspie2 @dawidsowa
|
||||||
|
|
||||||
/modules/services/dropbox.nix @eyJhb
|
/modules/services/dropbox.nix @eyJhb
|
||||||
/tests/modules/services/dropbox @eyJhb
|
/tests/modules/services/dropbox @eyJhb
|
||||||
|
|
||||||
@@ -234,6 +266,9 @@
|
|||||||
|
|
||||||
/modules/services/network-manager-applet.nix @rycee
|
/modules/services/network-manager-applet.nix @rycee
|
||||||
|
|
||||||
|
/modules/services/pantalaimon.nix @jojosch
|
||||||
|
/tests/modules/services/pantalaimon @jojosch
|
||||||
|
|
||||||
/modules/services/parcellite.nix @gleber
|
/modules/services/parcellite.nix @gleber
|
||||||
|
|
||||||
/modules/services/pass-secret-service.nix @cab404
|
/modules/services/pass-secret-service.nix @cab404
|
||||||
@@ -269,10 +304,16 @@
|
|||||||
|
|
||||||
/modules/services/taskwarrior-sync.nix @minijackson @pacien
|
/modules/services/taskwarrior-sync.nix @minijackson @pacien
|
||||||
|
|
||||||
|
/modules/services/trayer.nix @AndreasMager
|
||||||
|
/tests/modules/services/trayer @AndreasMager
|
||||||
|
|
||||||
/modules/services/udiskie.nix @rycee
|
/modules/services/udiskie.nix @rycee
|
||||||
|
|
||||||
/modules/services/unison.nix @pacien
|
/modules/services/unison.nix @pacien
|
||||||
|
|
||||||
|
/modules/services/window-managers/bspwm @ncfavier
|
||||||
|
/tests/modules/services/window-managers/bspwm @ncfavier
|
||||||
|
|
||||||
/modules/services/window-managers/i3-sway/i3.nix @sumnerevans
|
/modules/services/window-managers/i3-sway/i3.nix @sumnerevans
|
||||||
/tests/modules/services/window-managers/i3 @sumnerevans
|
/tests/modules/services/window-managers/i3 @sumnerevans
|
||||||
|
|
||||||
@@ -288,6 +329,8 @@
|
|||||||
|
|
||||||
/modules/services/xembed-sni-proxy.nix @rycee
|
/modules/services/xembed-sni-proxy.nix @rycee
|
||||||
|
|
||||||
|
/modules/services/xidlehook.nix @dschrempf
|
||||||
|
|
||||||
/modules/services/xscreensaver.nix @rycee
|
/modules/services/xscreensaver.nix @rycee
|
||||||
|
|
||||||
/modules/services/xsuspender.nix @offlinehacker
|
/modules/services/xsuspender.nix @offlinehacker
|
||||||
@@ -299,3 +342,5 @@
|
|||||||
/modules/xresources.nix @rycee
|
/modules/xresources.nix @rycee
|
||||||
|
|
||||||
/modules/xsession.nix @rycee
|
/modules/xsession.nix @rycee
|
||||||
|
|
||||||
|
/modules/services/volnoti.nix @IvanMalison
|
||||||
|
|||||||
38
.github/ISSUE_TEMPLATE.md
vendored
38
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,38 +0,0 @@
|
|||||||
<!--
|
|
||||||
|
|
||||||
If you are encountering the error
|
|
||||||
|
|
||||||
element xref: validity error : IDREF attribute linkend references an unknown ID "opt-home.file._name__.source"
|
|
||||||
|
|
||||||
then it means that you are using an old version of Home Manager, such
|
|
||||||
as the release-20.03 branch, with a recent version of Nixpkgs, such as
|
|
||||||
version 20.09 or master. See https://git.io/JTb6K for more.
|
|
||||||
|
|
||||||
In general, please check if there already exists a relevant issue
|
|
||||||
before creating a new one.
|
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
||||||
### Issue description
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Please describe the issue. For support and help please use the IRC
|
|
||||||
channel #home-manager @ freenode.net instead.
|
|
||||||
-->
|
|
||||||
|
|
||||||
### Meta
|
|
||||||
|
|
||||||
#### Maintainer CC
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Please @ people who are in the `meta.maintainers` list of the
|
|
||||||
offending module. If in doubt, check `git blame` for whoever last
|
|
||||||
touched something.
|
|
||||||
-->
|
|
||||||
|
|
||||||
#### Technical details
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the
|
|
||||||
result.
|
|
||||||
-->
|
|
||||||
15
.github/ISSUE_TEMPLATE/feature-request.md
vendored
Normal file
15
.github/ISSUE_TEMPLATE/feature-request.md
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Ask for a new feature to be added (module, program, etc.)
|
||||||
|
title: ''
|
||||||
|
labels: feature request
|
||||||
|
assignees: rycee, berbiche, sumnerevans
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Note: Please search to see if the feature has already been requested
|
||||||
|
-->
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
46
.github/ISSUE_TEMPLATE/issue.yaml
vendored
Normal file
46
.github/ISSUE_TEMPLATE/issue.yaml
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
name: Bug Report
|
||||||
|
description: File a bug/issue
|
||||||
|
title: 'bug: '
|
||||||
|
labels: [bug, triage]
|
||||||
|
|
||||||
|
# We cannot use nix-community/home-manager
|
||||||
|
# See https://github.com/dear-github/dear-github/issues/170
|
||||||
|
assignees: [rycee, berbiche, sumnerevans]
|
||||||
|
|
||||||
|
body:
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: Is there an existing issue for this?
|
||||||
|
description: |
|
||||||
|
Please search to see if an issue already exists for the bug you encountered.
|
||||||
|
options:
|
||||||
|
- label: I have searched the existing issues
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Issue description
|
||||||
|
description: |
|
||||||
|
Please describe the issue.
|
||||||
|
|
||||||
|
For support and help please use the IRC channel #home-manager at irc.oftc.net or
|
||||||
|
Matrix room <https://matrix.to/#/#hm:rycee.net> instead.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Maintainer CC
|
||||||
|
description: |
|
||||||
|
Please @ people who are in the `meta.maintainers` list of the offending module.
|
||||||
|
If in doubt, check `git blame` for whoever last touched something.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
id: system
|
||||||
|
attributes:
|
||||||
|
label: System information
|
||||||
|
description: |
|
||||||
|
Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the result.
|
||||||
|
render: markdown
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
12
README.md
12
README.md
@@ -32,7 +32,7 @@ will write to your dconf store and cannot tell whether a configuration
|
|||||||
that it is about to be overwritten was from a previous Home Manager
|
that it is about to be overwritten was from a previous Home Manager
|
||||||
generation or from manual configuration.
|
generation or from manual configuration.
|
||||||
|
|
||||||
Home Manager targets [NixOS][] unstable and NixOS version 20.09 (the
|
Home Manager targets [NixOS][] unstable and NixOS version 21.05 (the
|
||||||
current stable version), it may or may not work on other Linux
|
current stable version), it may or may not work on other Linux
|
||||||
distributions and NixOS versions.
|
distributions and NixOS versions.
|
||||||
|
|
||||||
@@ -75,10 +75,10 @@ Currently the easiest way to install Home Manager is as follows:
|
|||||||
$ nix-channel --update
|
$ nix-channel --update
|
||||||
```
|
```
|
||||||
|
|
||||||
and if you follow a Nixpkgs version 20.09 channel you can run
|
and if you follow a Nixpkgs version 21.05 channel you can run
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.tar.gz home-manager
|
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
|
||||||
$ nix-channel --update
|
$ nix-channel --update
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ configuration generations.
|
|||||||
As an example, let us expand the initial configuration file from the
|
As an example, let us expand the initial configuration file from the
|
||||||
installation above to install the htop and fortune packages, install
|
installation above to install the htop and fortune packages, install
|
||||||
Emacs with a few extra packages enabled, install Firefox with
|
Emacs with a few extra packages enabled, install Firefox with
|
||||||
smooth scrolling enabled, and enable the user gpg-agent service.
|
smooth scrolling disabled, and enable the user gpg-agent service.
|
||||||
|
|
||||||
To satisfy the above setup we should elaborate the
|
To satisfy the above setup we should elaborate the
|
||||||
`~/.config/nixpkgs/home.nix` file as follows:
|
`~/.config/nixpkgs/home.nix` file as follows:
|
||||||
@@ -279,7 +279,7 @@ then result in
|
|||||||
$ home-manager switch
|
$ home-manager switch
|
||||||
…
|
…
|
||||||
Activating checkLinkTargets
|
Activating checkLinkTargets
|
||||||
Existing file '/home/jdoe/.gitconfig' is in the way
|
Existing file '/home/jdoe/.config/git/config' is in the way
|
||||||
Please move the above files and try again
|
Please move the above files and try again
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -366,7 +366,7 @@ Home Manager is developed against `nixpkgs-unstable` branch, which
|
|||||||
often causes it to contain tweaks for changes/packages not yet
|
often causes it to contain tweaks for changes/packages not yet
|
||||||
released in stable NixOS. To avoid breaking users' configurations,
|
released in stable NixOS. To avoid breaking users' configurations,
|
||||||
Home Manager is released in branches corresponding to NixOS releases
|
Home Manager is released in branches corresponding to NixOS releases
|
||||||
(e.g. `release-20.09`). These branches get fixes, but usually not new
|
(e.g. `release-21.05`). These branches get fixes, but usually not new
|
||||||
modules. If you need a module to be backported, then feel free to open
|
modules. If you need a module to be backported, then feel free to open
|
||||||
an issue.
|
an issue.
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ error: build of ‘/nix/store/b37x3s7pzxbasfqhaca5dqbf3pjjw0ip-user-environment.
|
|||||||
|
|
||||||
The solution is typically to uninstall the package from the environment using `nix-env --uninstall` and reattempt the Home Manager generation switch.
|
The solution is typically to uninstall the package from the environment using `nix-env --uninstall` and reattempt the Home Manager generation switch.
|
||||||
|
|
||||||
|
You could also opt to unistall _all_ of the packages from your profile with `nix-env --uninstall '*'`.
|
||||||
|
|
||||||
=== Why are the session variables not set?
|
=== 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
|
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
|
||||||
@@ -92,7 +94,7 @@ error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.
|
|||||||
The solution on NixOS is to add
|
The solution on NixOS is to add
|
||||||
|
|
||||||
[source,nix]
|
[source,nix]
|
||||||
services.dbus.packages = with pkgs; [ gnome3.dconf ];
|
services.dbus.packages = with pkgs; [ gnome.dconf ];
|
||||||
|
|
||||||
to your system configuration.
|
to your system configuration.
|
||||||
|
|
||||||
|
|||||||
@@ -47,11 +47,11 @@ $ nix-channel --add https://github.com/nix-community/home-manager/archive/master
|
|||||||
$ nix-channel --update
|
$ nix-channel --update
|
||||||
----
|
----
|
||||||
+
|
+
|
||||||
and if you follow a Nixpkgs version 20.09 channel, you can run
|
and if you follow a Nixpkgs version 21.05 channel, you can run
|
||||||
+
|
+
|
||||||
[source,console]
|
[source,console]
|
||||||
----
|
----
|
||||||
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.tar.gz home-manager
|
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
|
||||||
$ nix-channel --update
|
$ nix-channel --update
|
||||||
----
|
----
|
||||||
+
|
+
|
||||||
@@ -125,11 +125,11 @@ or an unstable channel, you can run
|
|||||||
# nix-channel --update
|
# nix-channel --update
|
||||||
----
|
----
|
||||||
|
|
||||||
and if you follow a Nixpkgs version 20.09 channel, you can run
|
and if you follow a Nixpkgs version 21.05 channel, you can run
|
||||||
|
|
||||||
[source,console]
|
[source,console]
|
||||||
----
|
----
|
||||||
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.tar.gz home-manager
|
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
|
||||||
# nix-channel --update
|
# nix-channel --update
|
||||||
----
|
----
|
||||||
|
|
||||||
@@ -203,11 +203,11 @@ or an unstable channel, you can run
|
|||||||
# nix-channel --update
|
# nix-channel --update
|
||||||
----
|
----
|
||||||
|
|
||||||
and if you follow a Nixpkgs version 20.09 channel, you can run
|
and if you follow a Nixpkgs version 21.05 channel, you can run
|
||||||
|
|
||||||
[source,console]
|
[source,console]
|
||||||
----
|
----
|
||||||
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.09.tar.gz home-manager
|
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
|
||||||
# nix-channel --update
|
# nix-channel --update
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|||||||
@@ -12,47 +12,51 @@
|
|||||||
</refnamediv>
|
</refnamediv>
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>home-manager</command> <group choice="req">
|
<command>home-manager</command> <group choice="req">
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
build
|
build
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
instantiate
|
instantiate
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
edit
|
edit
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
expire-generations <replaceable>timestamp</replaceable>
|
expire-generations <replaceable>timestamp</replaceable>
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
generations
|
generations
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
help
|
help
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
news
|
news
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
|
<arg choice="plain">
|
||||||
|
option <replaceable>option.name</replaceable>
|
||||||
|
</arg>
|
||||||
|
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
packages
|
packages
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
remove-generations <replaceable>ID …</replaceable>
|
remove-generations <replaceable>ID …</replaceable>
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
switch
|
switch
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
uninstall
|
uninstall
|
||||||
</arg>
|
</arg>
|
||||||
@@ -61,63 +65,63 @@
|
|||||||
<arg>
|
<arg>
|
||||||
-A <replaceable>attrPath</replaceable>
|
-A <replaceable>attrPath</replaceable>
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg>
|
<arg>
|
||||||
-I <replaceable>path</replaceable>
|
-I <replaceable>path</replaceable>
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg>
|
<arg>
|
||||||
--flake <replaceable>flake-uri</replaceable>
|
--flake <replaceable>flake-uri</replaceable>
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg>
|
<arg>
|
||||||
-b <replaceable>ext</replaceable>
|
-b <replaceable>ext</replaceable>
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg>
|
<arg>
|
||||||
<group choice="req">
|
<group choice="req">
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
-f
|
-f
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
--file
|
--file
|
||||||
</arg>
|
</arg>
|
||||||
</group> <replaceable>path</replaceable>
|
</group> <replaceable>path</replaceable>
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg>
|
<arg>
|
||||||
<group choice="req">
|
<group choice="req">
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
-h
|
-h
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
--help
|
--help
|
||||||
</arg>
|
</arg>
|
||||||
</group>
|
</group>
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg>
|
<arg>
|
||||||
<group choice="req">
|
<group choice="req">
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
-n
|
-n
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
--dry-run
|
--dry-run
|
||||||
</arg>
|
</arg>
|
||||||
</group>
|
</group>
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg>
|
<arg>
|
||||||
--option <replaceable>name</replaceable> <replaceable>value</replaceable>
|
--option <replaceable>name</replaceable> <replaceable>value</replaceable>
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg>
|
<arg>
|
||||||
--cores <replaceable>number</replaceable>
|
--cores <replaceable>number</replaceable>
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg>
|
<arg>
|
||||||
<group choice="req">
|
<group choice="req">
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
@@ -130,29 +134,33 @@
|
|||||||
</group>
|
</group>
|
||||||
<replaceable>number</replaceable>
|
<replaceable>number</replaceable>
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
|
<arg>
|
||||||
|
--debug
|
||||||
|
</arg>
|
||||||
|
|
||||||
<arg>
|
<arg>
|
||||||
--keep-failed
|
--keep-failed
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg>
|
<arg>
|
||||||
--keep-going
|
--keep-going
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg>
|
<arg>
|
||||||
--show-trace
|
--show-trace
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg>
|
<arg>
|
||||||
--(no-)substitute
|
--(no-)substitute
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg>
|
<arg>
|
||||||
<group choice="req">
|
<group choice="req">
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
-v
|
-v
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
<arg choice="plain">
|
<arg choice="plain">
|
||||||
--verbose
|
--verbose
|
||||||
</arg>
|
</arg>
|
||||||
@@ -246,6 +254,18 @@
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<option>option <replaceable>option.name</replaceable></option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Inspect the given option name in the home configuration, like <citerefentry>
|
||||||
|
<refentrytitle>nixos-option</refentrytitle>
|
||||||
|
<manvolnum>8</manvolnum> </citerefentry>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<option>packages</option>
|
<option>packages</option>
|
||||||
@@ -456,6 +476,18 @@
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<option>--debug</option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Passed on to <citerefentry>
|
||||||
|
<refentrytitle>nix-build</refentrytitle>
|
||||||
|
<manvolnum>1</manvolnum> </citerefentry>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<option>--keep-failed</option>
|
<option>--keep-failed</option>
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ This section lists the release notes for stable versions of Home Manager and the
|
|||||||
|
|
||||||
:leveloffset: 1
|
:leveloffset: 1
|
||||||
|
|
||||||
|
include::rl-2111.adoc[]
|
||||||
|
|
||||||
include::rl-2105.adoc[]
|
include::rl-2105.adoc[]
|
||||||
|
|
||||||
include::rl-2009.adoc[]
|
include::rl-2009.adoc[]
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
[[sec-release-21.05]]
|
[[sec-release-21.05]]
|
||||||
== Release 21.05
|
== Release 21.05
|
||||||
|
|
||||||
This is the current unstable branch and the information in this
|
The 21.05 release branch became the stable branch in May, 2021.
|
||||||
section is therefore not final.
|
|
||||||
|
|
||||||
[[sec-release-21.05-highlights]]
|
[[sec-release-21.05-highlights]]
|
||||||
=== Highlights
|
=== Highlights
|
||||||
|
|||||||
43
doc/release-notes/rl-2111.adoc
Normal file
43
doc/release-notes/rl-2111.adoc
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
[[sec-release-21.11]]
|
||||||
|
== Release 21.11
|
||||||
|
|
||||||
|
This is the current unstable branch and the information in this
|
||||||
|
section is therefore not final.
|
||||||
|
|
||||||
|
[[sec-release-21.11-highlights]]
|
||||||
|
=== Highlights
|
||||||
|
|
||||||
|
This release has the following notable changes:
|
||||||
|
|
||||||
|
* All Home Manager modules are now loaded on all platforms. With this
|
||||||
|
change you will get a more descriptive error message if you attempt to
|
||||||
|
enable a module that is incompatible with the host platform.
|
||||||
|
+
|
||||||
|
Previously, modules that were platform specific would only be loaded
|
||||||
|
on that particular platform. For example, a module defining a
|
||||||
|
https://systemd.io/[systemd] service would only be loaded when the
|
||||||
|
host platform was Linux. This reduced evaluation times, simplified the
|
||||||
|
generated documentation, and made it impossible to accidentally use
|
||||||
|
modules that do not support the host platform.
|
||||||
|
+
|
||||||
|
While the above benefits are quite nice, avoiding module loads also
|
||||||
|
brings a few problems. For example, the
|
||||||
|
https://nix-community.github.io/home-manager/[public documentation]
|
||||||
|
will only show the options available for Linux hosts and the
|
||||||
|
documentation cannot make references to options within modules that
|
||||||
|
are unavailable on some hosts. Finally, users who wish to use the same
|
||||||
|
configuration file for different platforms cannot do so, even if the
|
||||||
|
platform incompatible options are unused.
|
||||||
|
+
|
||||||
|
Ultimately, the benefits of loading all modules won and the behavior
|
||||||
|
has now changed. For associated discussion see
|
||||||
|
https://github.com/nix-community/home-manager/issues/1906[issue #1906].
|
||||||
|
|
||||||
|
[[sec-release-21.11-state-version-changes]]
|
||||||
|
=== State Version Changes
|
||||||
|
|
||||||
|
The state version in this release includes the changes below. These
|
||||||
|
changes are only active if the `home.stateVersion` option is set to
|
||||||
|
"21.11" or later.
|
||||||
|
|
||||||
|
* Nothing has happened.
|
||||||
10
format
10
format
@@ -26,25 +26,15 @@ find . -name '*.nix' \
|
|||||||
! -path ./modules/lib/file-type.nix \
|
! -path ./modules/lib/file-type.nix \
|
||||||
! -path ./modules/manual.nix \
|
! -path ./modules/manual.nix \
|
||||||
! -path ./modules/misc/news.nix \
|
! -path ./modules/misc/news.nix \
|
||||||
! -path ./modules/misc/nixpkgs.nix \
|
|
||||||
! -path ./modules/misc/xdg.nix \
|
|
||||||
! -path ./modules/modules.nix \
|
|
||||||
! -path ./modules/programs/bash.nix \
|
! -path ./modules/programs/bash.nix \
|
||||||
! -path ./modules/programs/firefox.nix \
|
|
||||||
! -path ./modules/programs/gpg.nix \
|
! -path ./modules/programs/gpg.nix \
|
||||||
! -path ./modules/programs/ssh.nix \
|
! -path ./modules/programs/ssh.nix \
|
||||||
! -path ./modules/programs/tmux.nix \
|
! -path ./modules/programs/tmux.nix \
|
||||||
! -path ./modules/programs/zsh.nix \
|
! -path ./modules/programs/zsh.nix \
|
||||||
! -path ./modules/services/gpg-agent.nix \
|
! -path ./modules/services/gpg-agent.nix \
|
||||||
! -path ./modules/services/mpd.nix \
|
! -path ./modules/services/mpd.nix \
|
||||||
! -path ./modules/services/sxhkd.nix \
|
|
||||||
! -path ./modules/systemd.nix \
|
|
||||||
! -path ./nix-darwin/default.nix \
|
! -path ./nix-darwin/default.nix \
|
||||||
! -path ./tests/default.nix \
|
! -path ./tests/default.nix \
|
||||||
! -path ./tests/modules/home-environment/session-variables.nix \
|
! -path ./tests/modules/home-environment/session-variables.nix \
|
||||||
! -path ./tests/modules/programs/gpg/override-defaults.nix \
|
! -path ./tests/modules/programs/gpg/override-defaults.nix \
|
||||||
! -path ./tests/modules/programs/zsh/session-variables.nix \
|
|
||||||
! -path ./tests/modules/services/sxhkd/service.nix \
|
|
||||||
! -path ./tests/modules/systemd/services.nix \
|
|
||||||
! -path ./tests/modules/systemd/session-variables.nix \
|
|
||||||
-exec nixfmt $CHECK_ARG {} +
|
-exec nixfmt $CHECK_ARG {} +
|
||||||
|
|||||||
@@ -62,6 +62,7 @@
|
|||||||
# generations
|
# generations
|
||||||
# help
|
# help
|
||||||
# news
|
# news
|
||||||
|
# option
|
||||||
# packages
|
# packages
|
||||||
# remove-generations
|
# remove-generations
|
||||||
# switch
|
# switch
|
||||||
@@ -86,6 +87,7 @@
|
|||||||
#
|
#
|
||||||
# help
|
# help
|
||||||
# edit
|
# edit
|
||||||
|
# option
|
||||||
# build
|
# build
|
||||||
# switch
|
# switch
|
||||||
# generations
|
# generations
|
||||||
@@ -131,6 +133,9 @@
|
|||||||
#
|
#
|
||||||
# edit Open the home configuration in $EDITOR
|
# edit Open the home configuration in $EDITOR
|
||||||
#
|
#
|
||||||
|
# option OPTION.NAME
|
||||||
|
# Inspect configuration option named OPTION.NAME.
|
||||||
|
#
|
||||||
# build Build configuration into result directory
|
# build Build configuration into result directory
|
||||||
#
|
#
|
||||||
# switch Build and activate configuration
|
# switch Build and activate configuration
|
||||||
@@ -278,15 +283,15 @@ _home-manager_completions ()
|
|||||||
#--------------------------#
|
#--------------------------#
|
||||||
|
|
||||||
local Subcommands
|
local Subcommands
|
||||||
Subcommands=( "help" "edit" "build" "instantiate" "switch" "generations" "remove-generations" "expire-generations" "packages" "news" "uninstall" )
|
Subcommands=( "help" "edit" "option" "build" "instantiate" "switch" "generations" "remove-generations" "expire-generations" "packages" "news" "uninstall" )
|
||||||
|
|
||||||
# ^ « home-manager »'s subcommands.
|
# ^ « home-manager »'s subcommands.
|
||||||
|
|
||||||
#--------------------------#
|
#--------------------------#
|
||||||
|
|
||||||
local Options
|
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" \
|
||||||
"-j" "--max-jobs" )
|
"--cores" "--debug" "--keep-failed" "--keep-going" "-j" "--max-jobs" "--no-substitute" "--show-trace" "--substitute")
|
||||||
|
|
||||||
# ^ « home-manager »'s options.
|
# ^ « home-manager »'s options.
|
||||||
|
|
||||||
@@ -354,4 +359,4 @@ _home-manager_completions ()
|
|||||||
|
|
||||||
complete -F _home-manager_completions -o default home-manager
|
complete -F _home-manager_completions -o default home-manager
|
||||||
|
|
||||||
#complete -W "help edit build switch generations remove-generations expire-generations packages news" home-manager
|
#complete -W "help edit option build switch generations remove-generations expire-generations packages news" home-manager
|
||||||
|
|||||||
62
home-manager/completion.fish
Normal file
62
home-manager/completion.fish
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
#!/bin/env fish
|
||||||
|
##################################################
|
||||||
|
|
||||||
|
# « home-manager » command-line fish completion
|
||||||
|
#
|
||||||
|
# © 2021 "Ariel AxionL" <i at axionl dot me>
|
||||||
|
#
|
||||||
|
# MIT License
|
||||||
|
#
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
|
||||||
|
### Functions
|
||||||
|
function __home_manager_generations --description "Get all generations"
|
||||||
|
for i in (home-manager generations)
|
||||||
|
set -l split (string split " " $i)
|
||||||
|
set -l gen_id $split[5]
|
||||||
|
set -l gen_datetime $split[1..2]
|
||||||
|
set -l gen_hash (string match -r '\w{32}' $i)
|
||||||
|
echo $gen_id\t$gen_datetime $gen_hash
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
### SubCommands
|
||||||
|
complete -c home-manager -n "__fish_use_subcommand" -f -a "help" -d "Print home-manager help"
|
||||||
|
complete -c home-manager -n "__fish_use_subcommand" -f -a "edit" -d "Open the home configuration in $EDITOR"
|
||||||
|
complete -c home-manager -n "__fish_use_subcommand" -f -a "option" -d "Inspect configuration option"
|
||||||
|
complete -c home-manager -n "__fish_use_subcommand" -f -a "build" -d "Build configuration into result directory"
|
||||||
|
complete -c home-manager -n "__fish_use_subcommand" -f -a "instantiate" -d "Instantiate the configuration and print the resulting derivation"
|
||||||
|
complete -c home-manager -n "__fish_use_subcommand" -f -a "switch" -d "Build and activate configuration"
|
||||||
|
complete -c home-manager -n "__fish_use_subcommand" -f -a "generations" -d "List all home environment generations"
|
||||||
|
complete -c home-manager -n "__fish_use_subcommand" -f -a "packages" -d "List all packages installed in home-manager-path"
|
||||||
|
complete -c home-manager -n "__fish_use_subcommand" -f -a "news" -d "Show news entries in a pager"
|
||||||
|
complete -c home-manager -n "__fish_use_subcommand" -f -a "uninstall" -d "Remove Home Manager"
|
||||||
|
|
||||||
|
complete -c home-manager -n "__fish_use_subcommand" -x -a "remove-generations" -d "Remove indicated generations"
|
||||||
|
complete -c home-manager -n "__fish_seen_subcommand_from remove-generations" -f -ka '(__home_manager_generations)'
|
||||||
|
|
||||||
|
complete -c home-manager -n "__fish_use_subcommand" -x -a "expire-generations" -d "Remove generations older than TIMESTAMP"
|
||||||
|
|
||||||
|
### Options
|
||||||
|
complete -c home-manager -F -s f -l "file" -d "The home configuration file"
|
||||||
|
complete -c home-manager -x -s A -d "Select an expression in the configuration file"
|
||||||
|
complete -c home-manager -F -s I -d "Add a path to the Nix expression search path"
|
||||||
|
complete -c home-manager -F -l "flake" -d "Use home-manager configuration at specified flake-uri"
|
||||||
|
complete -c home-manager -F -s b -d "Move existing files to new path rather than fail"
|
||||||
|
complete -c home-manager -f -s v -l "verbose" -d "Verbose output"
|
||||||
|
complete -c home-manager -f -s n -l "dry-run" -d "Do a dry run, only prints what actions would be taken"
|
||||||
|
complete -c home-manager -f -s h -l "help" -d "Print this help"
|
||||||
|
|
||||||
|
complete -c home-manager -x -l "arg" -d "Override inputs passed to home-manager.nix"
|
||||||
|
complete -c home-manager -x -l "argstr" -d "Like --arg but the value is a string"
|
||||||
|
complete -c home-manager -x -l "cores" -d "Threads per job (e.g. -j argument to make)"
|
||||||
|
complete -c home-manager -x -l "debug"
|
||||||
|
complete -c home-manager -f -l "keep-failed" -d "Keep temporary directory used by failed builds"
|
||||||
|
complete -c home-manager -f -l "keep-going" -d "Keep going in case of failed builds"
|
||||||
|
complete -c home-manager -x -s j -l "max-jobs" -d "Max number of build jobs in parallel"
|
||||||
|
complete -c home-manager -x -l "option" -d "Set Nix configuration option"
|
||||||
|
complete -c home-manager -f -l "show-trace" -d "Print stack trace of evaluation errors"
|
||||||
|
complete -c home-manager -f -l "substitute"
|
||||||
|
complete -c home-manager -f -l "no-substitute"
|
||||||
@@ -7,6 +7,7 @@ _arguments \
|
|||||||
'-I[search path]:PATH:_files -/' \
|
'-I[search path]:PATH:_files -/' \
|
||||||
'-b[backup files]:EXT:()' \
|
'-b[backup files]:EXT:()' \
|
||||||
'--cores[cores]:NUM:()' \
|
'--cores[cores]:NUM:()' \
|
||||||
|
'--debug[debug]' \
|
||||||
'--keep-failed[keep failed]' \
|
'--keep-failed[keep failed]' \
|
||||||
'--keep-going[keep going]' \
|
'--keep-going[keep going]' \
|
||||||
'(-h --help)'{--help,-h}'[help]' \
|
'(-h --help)'{--help,-h}'[help]' \
|
||||||
@@ -24,6 +25,7 @@ case "$state" in
|
|||||||
_values 'command' \
|
_values 'command' \
|
||||||
'help[help]' \
|
'help[help]' \
|
||||||
'edit[edit]' \
|
'edit[edit]' \
|
||||||
|
'option[inspect option]' \
|
||||||
'build[build]' \
|
'build[build]' \
|
||||||
'switch[switch]' \
|
'switch[switch]' \
|
||||||
'generations[list generations]' \
|
'generations[list generations]' \
|
||||||
@@ -42,11 +44,14 @@ case "$state" in
|
|||||||
build|switch)
|
build|switch)
|
||||||
_arguments \
|
_arguments \
|
||||||
'--cores[cores]:NUM:()' \
|
'--cores[cores]:NUM:()' \
|
||||||
|
'--debug[debug]' \
|
||||||
'--keep-failed[keep failed]' \
|
'--keep-failed[keep failed]' \
|
||||||
'--keep-going[keep going]' \
|
'--keep-going[keep going]' \
|
||||||
'--max-jobs[max jobs]:NUM:()' \
|
'--max-jobs[max jobs]:NUM:()' \
|
||||||
|
'--no-substitute[no substitute]' \
|
||||||
'--option[option]:NAME VALUE:()' \
|
'--option[option]:NAME VALUE:()' \
|
||||||
'--show-trace[show trace]'
|
'--show-trace[show trace]' \
|
||||||
|
'--substitute[substitute]'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
{ runCommand, lib, bash, coreutils, findutils, gnused, less
|
{ runCommand, lib, bash, callPackage, coreutils, findutils, gnused, less
|
||||||
|
# used for pkgs.path for nixos-option
|
||||||
|
, pkgs
|
||||||
|
|
||||||
# Extra path to Home Manager. If set then this path will be tried
|
# Extra path to Home Manager. If set then this path will be tried
|
||||||
# before `$HOME/.config/nixpkgs/home-manager` and
|
# before `$HOME/.config/nixpkgs/home-manager` and
|
||||||
@@ -9,6 +11,9 @@ let
|
|||||||
|
|
||||||
pathStr = if path == null then "" else path;
|
pathStr = if path == null then "" else path;
|
||||||
|
|
||||||
|
nixos-option = pkgs.nixos-option or (callPackage
|
||||||
|
(pkgs.path + "/nixos/modules/installer/tools/nixos-option") { });
|
||||||
|
|
||||||
in runCommand "home-manager" {
|
in runCommand "home-manager" {
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
allowSubstitutes = false;
|
allowSubstitutes = false;
|
||||||
@@ -27,10 +32,13 @@ in runCommand "home-manager" {
|
|||||||
--subst-var-by findutils "${findutils}" \
|
--subst-var-by findutils "${findutils}" \
|
||||||
--subst-var-by gnused "${gnused}" \
|
--subst-var-by gnused "${gnused}" \
|
||||||
--subst-var-by less "${less}" \
|
--subst-var-by less "${less}" \
|
||||||
|
--subst-var-by nixos-option "${nixos-option}" \
|
||||||
--subst-var-by HOME_MANAGER_PATH '${pathStr}'
|
--subst-var-by HOME_MANAGER_PATH '${pathStr}'
|
||||||
|
|
||||||
install -D -m755 ${./completion.bash} \
|
install -D -m755 ${./completion.bash} \
|
||||||
$out/share/bash-completion/completions/home-manager
|
$out/share/bash-completion/completions/home-manager
|
||||||
install -D -m755 ${./completion.zsh} \
|
install -D -m755 ${./completion.zsh} \
|
||||||
$out/share/zsh/site-functions/_home-manager
|
$out/share/zsh/site-functions/_home-manager
|
||||||
|
install -D -m755 ${./completion.fish} \
|
||||||
|
$out/share/fish/vendor_completions.d/home-manager.fish
|
||||||
''
|
''
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!@bash@/bin/bash
|
#!@bash@/bin/bash
|
||||||
|
|
||||||
# Prepare to use tools from Nixpkgs.
|
# Prepare to use tools from Nixpkgs.
|
||||||
PATH=@coreutils@/bin:@findutils@/bin:@gnused@/bin:@less@/bin${PATH:+:}$PATH
|
PATH=@coreutils@/bin:@findutils@/bin:@gnused@/bin:@less@/bin:@nixos-option@/bin${PATH:+:}$PATH
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
@@ -97,6 +97,46 @@ function setFlakeAttribute() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function doInspectOption() {
|
||||||
|
setFlakeAttribute
|
||||||
|
if [[ -v FLAKE_CONFIG_URI ]]; then
|
||||||
|
errorEcho "Can't inspect options of a flake configuration"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
setConfigFile
|
||||||
|
setHomeManagerNixPath
|
||||||
|
|
||||||
|
local extraArgs=("$@")
|
||||||
|
|
||||||
|
for p in "${EXTRA_NIX_PATH[@]}"; do
|
||||||
|
extraArgs=("${extraArgs[@]}" "-I" "$p")
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -v VERBOSE ]]; then
|
||||||
|
extraArgs=("${extraArgs[@]}" "--show-trace")
|
||||||
|
fi
|
||||||
|
|
||||||
|
local HOME_MANAGER_CONFIG_NIX HOME_MANAGER_CONFIG_ATTRIBUTE_NIX
|
||||||
|
HOME_MANAGER_CONFIG_NIX=${HOME_MANAGER_CONFIG//'\'/'\\'}
|
||||||
|
HOME_MANAGER_CONFIG_NIX=${HOME_MANAGER_CONFIG_NIX//'"'/'\"'}
|
||||||
|
HOME_MANAGER_CONFIG_NIX=${HOME_MANAGER_CONFIG_NIX//$'\n'/$'\\n'}
|
||||||
|
HOME_MANAGER_CONFIG_ATTRIBUTE_NIX=${HOME_MANAGER_CONFIG_ATTRIBUTE//'\'/'\\'}
|
||||||
|
HOME_MANAGER_CONFIG_ATTRIBUTE_NIX=${HOME_MANAGER_CONFIG_ATTRIBUTE_NIX//'"'/'\"'}
|
||||||
|
HOME_MANAGER_CONFIG_ATTRIBUTE_NIX=${HOME_MANAGER_CONFIG_ATTRIBUTE_NIX//$'\n'/$'\\n'}
|
||||||
|
local modulesExpr
|
||||||
|
modulesExpr="let confPath = \"${HOME_MANAGER_CONFIG_NIX}\"; "
|
||||||
|
modulesExpr+="confAttr = \"${HOME_MANAGER_CONFIG_ATTRIBUTE_NIX}\"; in "
|
||||||
|
modulesExpr+="(import <home-manager/modules> {"
|
||||||
|
modulesExpr+=" configuration = if confAttr == \"\" then confPath else (import confPath).\${confAttr};"
|
||||||
|
modulesExpr+=" pkgs = import <nixpkgs> {}; check = true; })"
|
||||||
|
|
||||||
|
nixos-option \
|
||||||
|
--options_expr "$modulesExpr.options" \
|
||||||
|
--config_expr "$modulesExpr.config" \
|
||||||
|
"${extraArgs[@]}" \
|
||||||
|
"${PASSTHROUGH_OPTS[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
function doInstantiate() {
|
function doInstantiate() {
|
||||||
setFlakeAttribute
|
setFlakeAttribute
|
||||||
if [[ -v FLAKE_CONFIG_URI ]]; then
|
if [[ -v FLAKE_CONFIG_URI ]]; then
|
||||||
@@ -473,6 +513,7 @@ function doHelp() {
|
|||||||
echo
|
echo
|
||||||
echo " --arg(str) NAME VALUE Override inputs passed to home-manager.nix"
|
echo " --arg(str) NAME VALUE Override inputs passed to home-manager.nix"
|
||||||
echo " --cores NUM"
|
echo " --cores NUM"
|
||||||
|
echo " --debug"
|
||||||
echo " --keep-failed"
|
echo " --keep-failed"
|
||||||
echo " --keep-going"
|
echo " --keep-going"
|
||||||
echo " -j, --max-jobs NUM"
|
echo " -j, --max-jobs NUM"
|
||||||
@@ -486,6 +527,9 @@ function doHelp() {
|
|||||||
echo
|
echo
|
||||||
echo " edit Open the home configuration in \$EDITOR"
|
echo " edit Open the home configuration in \$EDITOR"
|
||||||
echo
|
echo
|
||||||
|
echo " option OPTION.NAME"
|
||||||
|
echo " Inspect configuration option named OPTION.NAME."
|
||||||
|
echo
|
||||||
echo " build Build configuration into result directory"
|
echo " build Build configuration into result directory"
|
||||||
echo
|
echo
|
||||||
echo " instantiate Instantiate the configuration and print the resulting derivation"
|
echo " instantiate Instantiate the configuration and print the resulting derivation"
|
||||||
@@ -523,7 +567,7 @@ while [[ $# -gt 0 ]]; do
|
|||||||
opt="$1"
|
opt="$1"
|
||||||
shift
|
shift
|
||||||
case $opt in
|
case $opt in
|
||||||
build|instantiate|edit|expire-generations|generations|help|news|packages|remove-generations|switch|uninstall)
|
build|instantiate|option|edit|expire-generations|generations|help|news|packages|remove-generations|switch|uninstall)
|
||||||
COMMAND="$opt"
|
COMMAND="$opt"
|
||||||
;;
|
;;
|
||||||
-A)
|
-A)
|
||||||
@@ -572,7 +616,7 @@ while [[ $# -gt 0 ]]; do
|
|||||||
PASSTHROUGH_OPTS+=("$opt" "$1")
|
PASSTHROUGH_OPTS+=("$opt" "$1")
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--keep-failed|--keep-going|--show-trace\
|
--debug|--keep-failed|--keep-going|--show-trace\
|
||||||
|--substitute|--no-substitute)
|
|--substitute|--no-substitute)
|
||||||
PASSTHROUGH_OPTS+=("$opt")
|
PASSTHROUGH_OPTS+=("$opt")
|
||||||
;;
|
;;
|
||||||
@@ -580,12 +624,12 @@ while [[ $# -gt 0 ]]; do
|
|||||||
export VERBOSE=1
|
export VERBOSE=1
|
||||||
;;
|
;;
|
||||||
--version)
|
--version)
|
||||||
echo 21.05
|
echo 21.11
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
case $COMMAND in
|
case $COMMAND in
|
||||||
expire-generations|remove-generations)
|
expire-generations|remove-generations|option)
|
||||||
COMMAND_ARGS+=("$opt")
|
COMMAND_ARGS+=("$opt")
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -630,6 +674,9 @@ case $COMMAND in
|
|||||||
doExpireGenerations "${COMMAND_ARGS[@]}"
|
doExpireGenerations "${COMMAND_ARGS[@]}"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
option)
|
||||||
|
doInspectOption "${COMMAND_ARGS[@]}"
|
||||||
|
;;
|
||||||
packages)
|
packages)
|
||||||
doListPackages
|
doListPackages
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ runCommand "home-manager-install" {
|
|||||||
# You can update Home Manager without changing this value. See
|
# You can update Home Manager without changing this value. See
|
||||||
# the Home Manager release notes for a list of state version
|
# the Home Manager release notes for a list of state version
|
||||||
# changes in each release.
|
# changes in each release.
|
||||||
home.stateVersion = "21.05";
|
home.stateVersion = "21.11";
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -332,7 +332,10 @@ let
|
|||||||
(mkIf (config.flavor == "gmail.com") {
|
(mkIf (config.flavor == "gmail.com") {
|
||||||
userName = mkDefault config.address;
|
userName = mkDefault config.address;
|
||||||
|
|
||||||
imap = { host = "imap.gmail.com"; };
|
imap = {
|
||||||
|
host = "imap.gmail.com";
|
||||||
|
port = 993;
|
||||||
|
};
|
||||||
|
|
||||||
smtp = {
|
smtp = {
|
||||||
host = "smtp.gmail.com";
|
host = "smtp.gmail.com";
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ let
|
|||||||
in {
|
in {
|
||||||
meta.maintainers = with maintainers; [ midchildan ];
|
meta.maintainers = with maintainers; [ midchildan ];
|
||||||
|
|
||||||
config = {
|
config = mkIf pkgs.hostPlatform.isLinux {
|
||||||
# For shell sessions.
|
# For shell sessions.
|
||||||
home.sessionVariables = localeVars;
|
home.sessionVariables = localeVars;
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,28 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
assertions = [(
|
||||||
|
let
|
||||||
|
dups =
|
||||||
|
attrNames
|
||||||
|
(filterAttrs (n: v: v > 1)
|
||||||
|
(foldAttrs (acc: v: acc + v) 0
|
||||||
|
(mapAttrsToList (n: v: { ${v.target} = 1; }) cfg)));
|
||||||
|
dupsStr = concatStringsSep ", " dups;
|
||||||
|
in {
|
||||||
|
assertion = dups == [];
|
||||||
|
message = ''
|
||||||
|
Conflicting managed target files: ${dupsStr}
|
||||||
|
|
||||||
|
This may happen, for example, if you have a configuration similar to
|
||||||
|
|
||||||
|
home.file = {
|
||||||
|
conflict1 = { source = ./foo.nix; target = "baz"; };
|
||||||
|
conflict2 = { source = ./bar.nix; target = "baz"; };
|
||||||
|
}'';
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
lib.file.mkOutOfStoreSymlink = path:
|
lib.file.mkOutOfStoreSymlink = path:
|
||||||
let
|
let
|
||||||
pathStr = toString path;
|
pathStr = toString path;
|
||||||
@@ -53,7 +75,7 @@ in
|
|||||||
# Paths that should be forcibly overwritten by Home Manager.
|
# Paths that should be forcibly overwritten by Home Manager.
|
||||||
# Caveat emptor!
|
# Caveat emptor!
|
||||||
forcedPaths =
|
forcedPaths =
|
||||||
concatMapStringsSep " " (p: ''"$HOME/${p}"'')
|
concatMapStringsSep " " (p: ''"$HOME"/${escapeShellArg p}'')
|
||||||
(mapAttrsToList (n: v: v.target)
|
(mapAttrsToList (n: v: v.target)
|
||||||
(filterAttrs (n: v: v.force) cfg));
|
(filterAttrs (n: v: v.force) cfg));
|
||||||
|
|
||||||
@@ -62,7 +84,7 @@ in
|
|||||||
|
|
||||||
# A symbolic link whose target path matches this pattern will be
|
# A symbolic link whose target path matches this pattern will be
|
||||||
# considered part of a Home Manager generation.
|
# considered part of a Home Manager generation.
|
||||||
homeFilePattern="$(readlink -e "${builtins.storeDir}")/*-home-manager-files/*"
|
homeFilePattern="$(readlink -e ${escapeShellArg builtins.storeDir})/*-home-manager-files/*"
|
||||||
|
|
||||||
forcedPaths=(${forcedPaths})
|
forcedPaths=(${forcedPaths})
|
||||||
|
|
||||||
@@ -84,7 +106,8 @@ in
|
|||||||
$VERBOSE_ECHO "Skipping collision check for $targetPath"
|
$VERBOSE_ECHO "Skipping collision check for $targetPath"
|
||||||
elif [[ -e "$targetPath" \
|
elif [[ -e "$targetPath" \
|
||||||
&& ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then
|
&& ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then
|
||||||
if [[ ! -L "$targetPath" && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
|
if [[ ! -L "$targetPath" \
|
||||||
|
&& -v HOME_MANAGER_BACKUP_EXT && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
|
||||||
backup="$targetPath.$HOME_MANAGER_BACKUP_EXT"
|
backup="$targetPath.$HOME_MANAGER_BACKUP_EXT"
|
||||||
if [[ -e "$backup" ]]; then
|
if [[ -e "$backup" ]]; then
|
||||||
errorEcho "Existing file '$backup' would be clobbered by backing up '$targetPath'"
|
errorEcho "Existing file '$backup' would be clobbered by backing up '$targetPath'"
|
||||||
@@ -138,115 +161,131 @@ in
|
|||||||
# and a failure during the intermediate state FA ∩ FB will not
|
# and a failure during the intermediate state FA ∩ FB will not
|
||||||
# result in lost links because this set of links are in both the
|
# result in lost links because this set of links are in both the
|
||||||
# source and target generation.
|
# source and target generation.
|
||||||
home.activation.linkGeneration = hm.dag.entryAfter ["writeBoundary"] (
|
home.activation.linkGeneration = hm.dag.entryAfter ["writeBoundary"] (''
|
||||||
let
|
function clean() {
|
||||||
link = pkgs.writeText "link" ''
|
# A symbolic link whose target path matches this pattern will be
|
||||||
newGenFiles="$1"
|
# considered part of a Home Manager generation.
|
||||||
shift
|
local homeFilePattern
|
||||||
for sourcePath in "$@" ; do
|
homeFilePattern="$(readlink -e ${escapeShellArg builtins.storeDir})/*-home-manager-files/*"
|
||||||
relativePath="''${sourcePath#$newGenFiles/}"
|
|
||||||
targetPath="$HOME/$relativePath"
|
|
||||||
if [[ -e "$targetPath" && ! -L "$targetPath" && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
|
|
||||||
backup="$targetPath.$HOME_MANAGER_BACKUP_EXT"
|
|
||||||
$DRY_RUN_CMD mv $VERBOSE_ARG "$targetPath" "$backup" || errorEcho "Moving '$targetPath' failed!"
|
|
||||||
fi
|
|
||||||
$DRY_RUN_CMD mkdir -p $VERBOSE_ARG "$(dirname "$targetPath")"
|
|
||||||
$DRY_RUN_CMD ln -nsf $VERBOSE_ARG "$sourcePath" "$targetPath"
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
|
|
||||||
cleanup = pkgs.writeText "cleanup" ''
|
local newGenFiles="$1"
|
||||||
. ${./lib-bash/color-echo.sh}
|
local relativePath="$2"
|
||||||
|
local targetPath="$HOME/$relativePath"
|
||||||
|
if [[ -e "$newGenFiles/$relativePath" ]] ; then
|
||||||
|
$VERBOSE_ECHO "Checking $targetPath: exists"
|
||||||
|
elif [[ ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then
|
||||||
|
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"
|
||||||
|
|
||||||
# A symbolic link whose target path matches this pattern will be
|
# Recursively delete empty parent directories.
|
||||||
# considered part of a Home Manager generation.
|
targetDir="$(dirname "$relativePath")"
|
||||||
homeFilePattern="$(readlink -e "${builtins.storeDir}")/*-home-manager-files/*"
|
if [[ "$targetDir" != "." ]] ; then
|
||||||
|
pushd "$HOME" > /dev/null
|
||||||
|
|
||||||
newGenFiles="$1"
|
# Call rmdir with a relative path excluding $HOME.
|
||||||
shift 1
|
# Otherwise, it might try to delete $HOME and exit
|
||||||
for relativePath in "$@" ; do
|
# with a permission error.
|
||||||
targetPath="$HOME/$relativePath"
|
$DRY_RUN_CMD rmdir $VERBOSE_ARG \
|
||||||
if [[ -e "$newGenFiles/$relativePath" ]] ; then
|
-p --ignore-fail-on-non-empty \
|
||||||
$VERBOSE_ECHO "Checking $targetPath: exists"
|
"$targetDir"
|
||||||
elif [[ ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then
|
|
||||||
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"
|
|
||||||
|
|
||||||
# Recursively delete empty parent directories.
|
popd > /dev/null
|
||||||
targetDir="$(dirname "$relativePath")"
|
|
||||||
if [[ "$targetDir" != "." ]] ; then
|
|
||||||
pushd "$HOME" > /dev/null
|
|
||||||
|
|
||||||
# Call rmdir with a relative path excluding $HOME.
|
|
||||||
# Otherwise, it might try to delete $HOME and exit
|
|
||||||
# with a permission error.
|
|
||||||
$DRY_RUN_CMD rmdir $VERBOSE_ARG \
|
|
||||||
-p --ignore-fail-on-non-empty \
|
|
||||||
"$targetDir"
|
|
||||||
|
|
||||||
popd > /dev/null
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
''
|
|
||||||
function linkNewGen() {
|
|
||||||
echo "Creating home file links in $HOME"
|
|
||||||
|
|
||||||
local newGenFiles
|
|
||||||
newGenFiles="$(readlink -e "$newGenPath/home-files")"
|
|
||||||
find "$newGenFiles" \( -type f -or -type l \) \
|
|
||||||
-exec bash ${link} "$newGenFiles" {} +
|
|
||||||
}
|
|
||||||
|
|
||||||
function cleanOldGen() {
|
|
||||||
if [[ ! -v oldGenPath ]] ; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Cleaning up orphan links from $HOME"
|
|
||||||
|
|
||||||
local newGenFiles oldGenFiles
|
|
||||||
newGenFiles="$(readlink -e "$newGenPath/home-files")"
|
|
||||||
oldGenFiles="$(readlink -e "$oldGenPath/home-files")"
|
|
||||||
|
|
||||||
# Apply the cleanup script on each leaf in the old
|
|
||||||
# generation. The find command below will print the
|
|
||||||
# relative path of the entry.
|
|
||||||
find "$oldGenFiles" '(' -type f -or -type l ')' -printf '%P\0' \
|
|
||||||
| xargs -0 bash ${cleanup} "$newGenFiles"
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanOldGen
|
|
||||||
|
|
||||||
if [[ ! -v oldGenPath || "$oldGenPath" != "$newGenPath" ]] ; then
|
|
||||||
echo "Creating profile generation $newGenNum"
|
|
||||||
$DRY_RUN_CMD nix-env $VERBOSE_ARG --profile "$genProfilePath" --set "$newGenPath"
|
|
||||||
$DRY_RUN_CMD ln -Tsf $VERBOSE_ARG "$newGenPath" "$newGenGcPath"
|
|
||||||
else
|
|
||||||
echo "No change so reusing latest profile generation $oldGenNum"
|
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
linkNewGen
|
function cleanOldGen() {
|
||||||
''
|
if [[ ! -v oldGenPath ]] ; then
|
||||||
);
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Cleaning up orphan links from $HOME"
|
||||||
|
|
||||||
|
local newGenFiles oldGenFiles
|
||||||
|
newGenFiles="$(readlink -e "$newGenPath/home-files")"
|
||||||
|
oldGenFiles="$(readlink -e "$oldGenPath/home-files")"
|
||||||
|
|
||||||
|
# Apply the cleanup script on each leaf in the old
|
||||||
|
# generation. The find command below will print the
|
||||||
|
# relative path of the entry.
|
||||||
|
find "$oldGenFiles" '(' -type f -or -type l ')' -printf '%P\0' \
|
||||||
|
| while IFS= read -r -d "" relativePath ; do \
|
||||||
|
clean "$newGenFiles" "$relativePath"; \
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
function link() {
|
||||||
|
local newGenFiles="$1"
|
||||||
|
local sourcePath="$2"
|
||||||
|
local relativePath="''${sourcePath#$newGenFiles/}"
|
||||||
|
local targetPath="$HOME/$relativePath"
|
||||||
|
if [[ -e "$targetPath" && ! -L "$targetPath" \
|
||||||
|
&& -v HOME_MANAGER_BACKUP_EXT && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
|
||||||
|
local backup="$targetPath.$HOME_MANAGER_BACKUP_EXT"
|
||||||
|
$DRY_RUN_CMD mv $VERBOSE_ARG "$targetPath" "$backup" \
|
||||||
|
|| errorEcho "Moving '$targetPath' failed!"
|
||||||
|
fi
|
||||||
|
$DRY_RUN_CMD mkdir -p $VERBOSE_ARG "$(dirname "$targetPath")"
|
||||||
|
$DRY_RUN_CMD ln -nsf $VERBOSE_ARG "$sourcePath" "$targetPath"
|
||||||
|
}
|
||||||
|
|
||||||
|
function linkNewGen() {
|
||||||
|
echo "Creating home file links in $HOME"
|
||||||
|
|
||||||
|
local newGenFiles
|
||||||
|
newGenFiles="$(readlink -e "$newGenPath/home-files")"
|
||||||
|
find "$newGenFiles" \( -type f -or -type l \) -print0 \
|
||||||
|
| while IFS= read -r -d "" sourcePath ; do \
|
||||||
|
link "$newGenFiles" "$sourcePath"; \
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanOldGen
|
||||||
|
|
||||||
|
if [[ ! -v oldGenPath || "$oldGenPath" != "$newGenPath" ]] ; then
|
||||||
|
echo "Creating profile generation $newGenNum"
|
||||||
|
$DRY_RUN_CMD nix-env $VERBOSE_ARG --profile "$genProfilePath" --set "$newGenPath"
|
||||||
|
$DRY_RUN_CMD ln -Tsf $VERBOSE_ARG "$newGenPath" "$newGenGcPath"
|
||||||
|
else
|
||||||
|
echo "No change so reusing latest profile generation $oldGenNum"
|
||||||
|
fi
|
||||||
|
|
||||||
|
linkNewGen
|
||||||
|
|
||||||
|
unset -f clean cleanOldGen link linkNewGen
|
||||||
|
'');
|
||||||
|
|
||||||
home.activation.checkFilesChanged = hm.dag.entryBefore ["linkGeneration"] (
|
home.activation.checkFilesChanged = hm.dag.entryBefore ["linkGeneration"] (
|
||||||
''
|
let
|
||||||
|
homeDirArg = escapeShellArg homeDirectory;
|
||||||
|
in ''
|
||||||
|
function _cmp() {
|
||||||
|
if [[ -d $1 && -d $2 ]]; then
|
||||||
|
diff -rq "$1" "$2" &> /dev/null
|
||||||
|
else
|
||||||
|
cmp --quiet "$1" "$2"
|
||||||
|
fi
|
||||||
|
}
|
||||||
declare -A changedFiles
|
declare -A changedFiles
|
||||||
'' + concatMapStrings (v: ''
|
'' + concatMapStrings (v:
|
||||||
cmp --quiet "${sourceStorePath v}" "${homeDirectory}/${v.target}" \
|
let
|
||||||
&& changedFiles["${v.target}"]=0 \
|
sourceArg = escapeShellArg (sourceStorePath v);
|
||||||
|| changedFiles["${v.target}"]=1
|
targetArg = escapeShellArg v.target;
|
||||||
'') (filter (v: v.onChange != "") (attrValues cfg))
|
in ''
|
||||||
|
_cmp ${sourceArg} ${homeDirArg}/${targetArg} \
|
||||||
|
&& changedFiles[${targetArg}]=0 \
|
||||||
|
|| changedFiles[${targetArg}]=1
|
||||||
|
'') (filter (v: v.onChange != "") (attrValues cfg))
|
||||||
|
+ ''
|
||||||
|
unset -f _cmp
|
||||||
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
home.activation.onFilesChange = hm.dag.entryAfter ["linkGeneration"] (
|
home.activation.onFilesChange = hm.dag.entryAfter ["linkGeneration"] (
|
||||||
concatMapStrings (v: ''
|
concatMapStrings (v: ''
|
||||||
if [[ ${"$\{changedFiles"}["${v.target}"]} -eq 1 ]]; then
|
if [[ ''${changedFiles[${escapeShellArg v.target}]} -eq 1 ]]; then
|
||||||
${v.onChange}
|
${v.onChange}
|
||||||
fi
|
fi
|
||||||
'') (filter (v: v.onChange != "") (attrValues cfg))
|
'') (filter (v: v.onChange != "") (attrValues cfg))
|
||||||
@@ -254,12 +293,10 @@ in
|
|||||||
|
|
||||||
# Symlink directories and files that have the right execute bit.
|
# Symlink directories and files that have the right execute bit.
|
||||||
# Copy files that need their execute bit changed.
|
# Copy files that need their execute bit changed.
|
||||||
home-files = pkgs.runCommand
|
home-files = pkgs.runCommandLocal
|
||||||
"home-manager-files"
|
"home-manager-files"
|
||||||
{
|
{
|
||||||
nativeBuildInputs = [ pkgs.xorg.lndir ];
|
nativeBuildInputs = [ pkgs.xorg.lndir ];
|
||||||
preferLocalBuild = true;
|
|
||||||
allowSubstitutes = false;
|
|
||||||
}
|
}
|
||||||
(''
|
(''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
@@ -273,6 +310,15 @@ in
|
|||||||
local executable="$3"
|
local executable="$3"
|
||||||
local recursive="$4"
|
local recursive="$4"
|
||||||
|
|
||||||
|
# If the target already exists then we have a collision. Note, this
|
||||||
|
# should not happen due to the assertion found in the 'files' module.
|
||||||
|
# We therefore simply log the conflict and otherwise ignore it, mainly
|
||||||
|
# to make the `files-target-config` test work as expected.
|
||||||
|
if [[ -e "$realOut/$relTarget" ]]; then
|
||||||
|
echo "File conflict for file '$relTarget'" >&2
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
# Figure out the real absolute path to the target.
|
# Figure out the real absolute path to the target.
|
||||||
local target
|
local target
|
||||||
target="$(realpath -m "$realOut/$relTarget")"
|
target="$(realpath -m "$realOut/$relTarget")"
|
||||||
|
|||||||
@@ -373,6 +373,16 @@ in
|
|||||||
description = "The package containing the complete activation script.";
|
description = "The package containing the complete activation script.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.extraActivationPath = mkOption {
|
||||||
|
internal = true;
|
||||||
|
type = types.listOf types.package;
|
||||||
|
default = [ ];
|
||||||
|
description = ''
|
||||||
|
Extra packages to add to <envar>PATH</envar> within the activation
|
||||||
|
script.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
home.extraBuilderCommands = mkOption {
|
home.extraBuilderCommands = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
@@ -390,6 +400,21 @@ in
|
|||||||
Extra commands to run in the Home Manager profile builder.
|
Extra commands to run in the Home Manager profile builder.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.enableNixpkgsReleaseCheck = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Determines whether to check for release version mismatch between Home
|
||||||
|
Manager and Nixpkgs. Using mismatched versions is likely to cause errors
|
||||||
|
and unexpected behavior. It is therefore highly recommended to use a
|
||||||
|
release of Home Manager than corresponds with your chosen release of
|
||||||
|
Nixpkgs.
|
||||||
|
</para><para>
|
||||||
|
When this option is enabled and a mismatch is detected then a warning
|
||||||
|
will be printed when the user configuration is being built.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
@@ -404,6 +429,31 @@ in
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
warnings =
|
||||||
|
let
|
||||||
|
hmRelease = fileContents ../.release;
|
||||||
|
nixpkgsRelease = pkgs.lib.trivial.release;
|
||||||
|
releaseMismatch =
|
||||||
|
config.home.enableNixpkgsReleaseCheck
|
||||||
|
&& hmRelease != nixpkgsRelease;
|
||||||
|
in
|
||||||
|
optional releaseMismatch ''
|
||||||
|
You are using
|
||||||
|
|
||||||
|
Home Manager version ${hmRelease} and
|
||||||
|
Nixpkgs version ${nixpkgsRelease}.
|
||||||
|
|
||||||
|
Using mismatched versions is likely to cause errors and unexpected
|
||||||
|
behavior. It is therefore highly recommended to use a release of Home
|
||||||
|
Manager than corresponds with your chosen release of Nixpkgs.
|
||||||
|
|
||||||
|
If you insist then you can disable this warning by adding
|
||||||
|
|
||||||
|
home.enableNixpkgsReleaseCheck = false;
|
||||||
|
|
||||||
|
to your configuration.
|
||||||
|
'';
|
||||||
|
|
||||||
home.username =
|
home.username =
|
||||||
mkIf (versionOlder config.home.stateVersion "20.09")
|
mkIf (versionOlder config.home.stateVersion "20.09")
|
||||||
(mkDefault (builtins.getEnv "USER"));
|
(mkDefault (builtins.getEnv "USER"));
|
||||||
@@ -530,15 +580,17 @@ in
|
|||||||
|
|
||||||
# Programs that always should be available on the activation
|
# Programs that always should be available on the activation
|
||||||
# script's PATH.
|
# script's PATH.
|
||||||
activationBinPaths = lib.makeBinPath [
|
activationBinPaths = lib.makeBinPath (
|
||||||
pkgs.bash
|
[
|
||||||
pkgs.coreutils
|
pkgs.bash
|
||||||
pkgs.diffutils # For `cmp` and `diff`.
|
pkgs.coreutils
|
||||||
pkgs.findutils
|
pkgs.diffutils # For `cmp` and `diff`.
|
||||||
pkgs.gnugrep
|
pkgs.findutils
|
||||||
pkgs.gnused
|
pkgs.gnugrep
|
||||||
pkgs.ncurses # For `tput`.
|
pkgs.gnused
|
||||||
]
|
pkgs.ncurses # For `tput`.
|
||||||
|
] ++ config.home.extraActivationPath
|
||||||
|
)
|
||||||
+ optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";
|
+ optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";
|
||||||
|
|
||||||
activationScript = pkgs.writeShellScript "activation-script" ''
|
activationScript = pkgs.writeShellScript "activation-script" ''
|
||||||
|
|||||||
106
modules/i18n/input-method/default.nix
Normal file
106
modules/i18n/input-method/default.nix
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.i18n.inputMethod;
|
||||||
|
|
||||||
|
gtk2Cache = pkgs.runCommandLocal "gtk2-immodule.cache" {
|
||||||
|
buildInputs = [ pkgs.gtk2 cfg.package ];
|
||||||
|
} ''
|
||||||
|
mkdir -p $out/etc/gtk-2.0/
|
||||||
|
GTK_PATH=${cfg.package}/lib/gtk-2.0/ \
|
||||||
|
gtk-query-immodules-2.0 > $out/etc/gtk-2.0/immodules.cache
|
||||||
|
'';
|
||||||
|
|
||||||
|
gtk3Cache = pkgs.runCommandLocal "gtk3-immodule.cache" {
|
||||||
|
buildInputs = [ pkgs.gtk3 cfg.package ];
|
||||||
|
} ''
|
||||||
|
mkdir -p $out/etc/gtk-3.0/
|
||||||
|
GTK_PATH=${cfg.package}/lib/gtk-3.0/ \
|
||||||
|
gtk-query-immodules-3.0 > $out/etc/gtk-3.0/immodules.cache
|
||||||
|
'';
|
||||||
|
|
||||||
|
in {
|
||||||
|
imports =
|
||||||
|
[ ./fcitx.nix ./fcitx5.nix ./hime.nix ./kime.nix ./nabi.nix ./uim.nix ];
|
||||||
|
|
||||||
|
options.i18n = {
|
||||||
|
inputMethod = {
|
||||||
|
enabled = mkOption {
|
||||||
|
type = types.nullOr
|
||||||
|
(types.enum [ "fcitx" "fcitx5" "nabi" "uim" "hime" "kime" ]);
|
||||||
|
default = null;
|
||||||
|
example = "fcitx";
|
||||||
|
description = ''
|
||||||
|
Select the enabled input method. Input methods is a software to input
|
||||||
|
symbols that are not available on standard input devices.
|
||||||
|
</para><para>
|
||||||
|
Input methods are specially used to input Chinese, Japanese and Korean
|
||||||
|
characters.
|
||||||
|
</para><para>
|
||||||
|
Currently the following input methods are available in Home Manager:
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>fcitx</literal></term>
|
||||||
|
<listitem><para>
|
||||||
|
A customizable lightweight input method
|
||||||
|
extra input engines can be added using
|
||||||
|
<literal>i18n.inputMethod.fcitx.engines</literal>.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>fcitx5</literal></term>
|
||||||
|
<listitem><para>
|
||||||
|
The next generation of fcitx,
|
||||||
|
addons (including engines, dictionaries, skins) can be added using
|
||||||
|
<literal>i18n.inputMethod.fcitx5.addons</literal>.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>nabi</literal></term>
|
||||||
|
<listitem><para>
|
||||||
|
A Korean input method based on XIM. Nabi doesn't support Qt 5.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>uim</literal></term>
|
||||||
|
<listitem><para>
|
||||||
|
The universal input method, is a library with a XIM bridge.
|
||||||
|
uim mainly support Chinese, Japanese and Korean.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>hime</literal></term>
|
||||||
|
<listitem><para>An extremely easy-to-use input method framework.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>kime</literal></term>
|
||||||
|
<listitem><para>A Korean IME.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
internal = true;
|
||||||
|
type = types.nullOr types.path;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
The input method method package.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf (cfg.enabled != null) {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "i18n.inputMethod" pkgs platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
|
home.packages = [ cfg.package gtk2Cache gtk3Cache ];
|
||||||
|
};
|
||||||
|
|
||||||
|
meta.maintainers = with lib; [ hm.maintainers.kranzes ];
|
||||||
|
}
|
||||||
50
modules/i18n/input-method/fcitx.nix
Normal file
50
modules/i18n/input-method/fcitx.nix
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.i18n.inputMethod.fcitx;
|
||||||
|
fcitxPackage = pkgs.fcitx.override { plugins = cfg.engines; };
|
||||||
|
fcitxEngine = types.package // {
|
||||||
|
name = "fcitx-engine";
|
||||||
|
check = x:
|
||||||
|
types.package.check x && attrByPath [ "meta" "isFcitxEngine" ] false x;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
|
||||||
|
i18n.inputMethod.fcitx = {
|
||||||
|
engines = mkOption {
|
||||||
|
type = with types; listOf fcitxEngine;
|
||||||
|
default = [ ];
|
||||||
|
example = literalExample "with pkgs.fcitx-engines; [ mozc hangul ]";
|
||||||
|
description = let
|
||||||
|
enginesDrv = filterAttrs (const isDerivation) pkgs.fcitx-engines;
|
||||||
|
engines = concatStringsSep ", "
|
||||||
|
(map (name: "<literal>${name}</literal>") (attrNames enginesDrv));
|
||||||
|
in "Enabled Fcitx engines. Available engines are: ${engines}.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf (config.i18n.inputMethod.enabled == "fcitx") {
|
||||||
|
i18n.inputMethod.package = fcitxPackage;
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
GTK_IM_MODULE = "fcitx";
|
||||||
|
QT_IM_MODULE = "fcitx";
|
||||||
|
XMODIFIERS = "@im=fcitx";
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.services.fcitx-daemon = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Fcitx input method editor";
|
||||||
|
PartOf = [ "graphical-session.desktop" ];
|
||||||
|
};
|
||||||
|
Service.ExecStart = "${fcitxPackage}/bin/fcitx";
|
||||||
|
Install.WantedBy = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
42
modules/i18n/input-method/fcitx5.nix
Normal file
42
modules/i18n/input-method/fcitx5.nix
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
im = config.i18n.inputMethod;
|
||||||
|
cfg = im.fcitx5;
|
||||||
|
fcitx5Package = pkgs.fcitx5-with-addons.override { inherit (cfg) addons; };
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
i18n.inputMethod.fcitx5 = {
|
||||||
|
addons = mkOption {
|
||||||
|
type = with types; listOf package;
|
||||||
|
default = [ ];
|
||||||
|
example = literalExample "with pkgs; [ fcitx5-rime ]";
|
||||||
|
description = ''
|
||||||
|
Enabled Fcitx5 addons.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf (im.enabled == "fcitx5") {
|
||||||
|
i18n.inputMethod.package = fcitx5Package;
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
GTK_IM_MODULE = "fcitx";
|
||||||
|
QT_IM_MODULE = "fcitx";
|
||||||
|
XMODIFIERS = "@im=fcitx";
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.services.fcitx5-daemon = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Fcitx5 input method editor";
|
||||||
|
PartOf = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
Service.ExecStart = "${fcitx5Package}/bin/fcitx5";
|
||||||
|
Install.WantedBy = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
23
modules/i18n/input-method/hime.nix
Normal file
23
modules/i18n/input-method/hime.nix
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib; {
|
||||||
|
config = mkIf (config.i18n.inputMethod.enabled == "hime") {
|
||||||
|
i18n.inputMethod.package = pkgs.hime;
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
GTK_IM_MODULE = "hime";
|
||||||
|
QT_IM_MODULE = "hime";
|
||||||
|
XMODIFIERS = "@im=hime";
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.services.hime-daemon = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Hime input method editor";
|
||||||
|
PartOf = [ "graphical-session.desktop" ];
|
||||||
|
};
|
||||||
|
Service.ExecStart = "${pkgs.hime}/bin/hime";
|
||||||
|
Install.WantedBy = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
58
modules/i18n/input-method/kime.nix
Normal file
58
modules/i18n/input-method/kime.nix
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
{ config, pkgs, lib, generators, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.i18n.inputMethod.kime;
|
||||||
|
yamlFormat = pkgs.formats.yaml { };
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
i18n.inputMethod.kime = {
|
||||||
|
config = mkOption {
|
||||||
|
type = yamlFormat.type;
|
||||||
|
default = { };
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
daemon = {
|
||||||
|
modules = ["Xim" "Indicator"];
|
||||||
|
};
|
||||||
|
|
||||||
|
indicator = {
|
||||||
|
icon_color = "White";
|
||||||
|
};
|
||||||
|
|
||||||
|
engine = {
|
||||||
|
hangul = {
|
||||||
|
layout = "dubeolsik";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
kime configuration. Refer to
|
||||||
|
<link xlink:href="https://github.com/Riey/kime/blob/develop/docs/CONFIGURATION.md"/>
|
||||||
|
for details on supported values.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf (config.i18n.inputMethod.enabled == "kime") {
|
||||||
|
i18n.inputMethod.package = pkgs.kime;
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
GTK_IM_MODULE = "kime";
|
||||||
|
QT_IM_MODULE = "kime";
|
||||||
|
XMODIFIERS = "@im=kime";
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile."kime/config.yaml".text =
|
||||||
|
replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.config);
|
||||||
|
|
||||||
|
systemd.user.services.kime-daemon = {
|
||||||
|
Unit = { Description = "Kime input method editor"; };
|
||||||
|
PartOf = [ "graphical-session.target" ];
|
||||||
|
Service.ExecStart = "${pkgs.kime}/bin/kime";
|
||||||
|
Install.WantedBy = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
23
modules/i18n/input-method/nabi.nix
Normal file
23
modules/i18n/input-method/nabi.nix
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib; {
|
||||||
|
config = mkIf (config.i18n.inputMethod.enabled == "nabi") {
|
||||||
|
i18n.inputMethod.package = pkgs.nabi;
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
GTK_IM_MODULE = "nabi";
|
||||||
|
QT_IM_MODULE = "nabi";
|
||||||
|
XMODIFIERS = "@im=nabi";
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.services.nabi-daemon = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Nabi input method editor";
|
||||||
|
PartOf = [ "graphical-session.desktop" ];
|
||||||
|
};
|
||||||
|
Service.ExecStart = "${pkgs.nabi}/bin/nabi";
|
||||||
|
Install.WantedBy = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
45
modules/i18n/input-method/uim.nix
Normal file
45
modules/i18n/input-method/uim.nix
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let cfg = config.i18n.inputMethod.uim;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
|
||||||
|
i18n.inputMethod.uim = {
|
||||||
|
toolbar = mkOption {
|
||||||
|
type = types.enum [ "gtk" "gtk3" "gtk-systray" "gtk3-systray" "qt4" ];
|
||||||
|
default = "gtk";
|
||||||
|
example = "gtk-systray";
|
||||||
|
description = ''
|
||||||
|
Selected UIM toolbar.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf (config.i18n.inputMethod.enabled == "uim") {
|
||||||
|
i18n.inputMethod.package = pkgs.uim;
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
GTK_IM_MODULE = "uim";
|
||||||
|
QT_IM_MODULE = "uim";
|
||||||
|
XMODIFIERS = "@im=uim";
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.services.uim-daemon = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Uim input method editor";
|
||||||
|
PartOf = [ "graphical-session.desktop" ];
|
||||||
|
};
|
||||||
|
Service.ExecStart = toString
|
||||||
|
(pkgs.writeShellScript "start-uim-xim-and-uim-toolbar" ''
|
||||||
|
${pkgs.uim}/bin/uim-xim &
|
||||||
|
${pkgs.uim}/bin/uim-toolbar-${cfg.toolbar}
|
||||||
|
'');
|
||||||
|
Install.WantedBy = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
14
modules/lib/assertions.nix
Normal file
14
modules/lib/assertions.nix
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{ lib }:
|
||||||
|
|
||||||
|
{
|
||||||
|
assertPlatform = module: pkgs: platforms: {
|
||||||
|
assertion = lib.elem pkgs.stdenv.hostPlatform.system platforms;
|
||||||
|
message = let
|
||||||
|
platformsStr = lib.concatStringsSep "\n"
|
||||||
|
(map (p: " - ${p}") (lib.sort (a: b: a < b) platforms));
|
||||||
|
in ''
|
||||||
|
The module ${module} does not support your platform. It only supports
|
||||||
|
|
||||||
|
${platformsStr}'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -16,6 +16,8 @@ rec {
|
|||||||
entryBefore = d.dagEntryBefore;
|
entryBefore = d.dagEntryBefore;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assertions = import ./assertions.nix { inherit lib; };
|
||||||
|
|
||||||
gvariant = import ./gvariant.nix { inherit lib; };
|
gvariant = import ./gvariant.nix { inherit lib; };
|
||||||
maintainers = import ./maintainers.nix;
|
maintainers = import ./maintainers.nix;
|
||||||
strings = import ./strings.nix { inherit lib; };
|
strings = import ./strings.nix { inherit lib; };
|
||||||
|
|||||||
@@ -82,6 +82,9 @@ with lib;
|
|||||||
generations. The script will be run
|
generations. The script will be run
|
||||||
<emphasis>after</emphasis> the new files have been linked
|
<emphasis>after</emphasis> the new files have been linked
|
||||||
into place.
|
into place.
|
||||||
|
</para><para>
|
||||||
|
Note, this code is always run when <literal>recursive</literal> is
|
||||||
|
enabled.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,12 @@
|
|||||||
github = "cwyc";
|
github = "cwyc";
|
||||||
githubId = 16950437;
|
githubId = 16950437;
|
||||||
};
|
};
|
||||||
|
chisui = {
|
||||||
|
name = "Philipp Dargel";
|
||||||
|
email = "chisui@users.noreply.github.com";
|
||||||
|
github = "chisui";
|
||||||
|
githubId = 4526429;
|
||||||
|
};
|
||||||
olmokramer = {
|
olmokramer = {
|
||||||
name = "Olmo Kramer";
|
name = "Olmo Kramer";
|
||||||
email = "olmokramer@users.noreply.github.com";
|
email = "olmokramer@users.noreply.github.com";
|
||||||
@@ -37,6 +43,16 @@
|
|||||||
github = "kalhauge";
|
github = "kalhauge";
|
||||||
githubId = 1182166;
|
githubId = 1182166;
|
||||||
};
|
};
|
||||||
|
kamadorueda = {
|
||||||
|
name = "Kevin Amado";
|
||||||
|
email = "kamadorueda@gmail.com";
|
||||||
|
github = "kamadorueda";
|
||||||
|
githubId = 47480384;
|
||||||
|
keys = [{
|
||||||
|
longkeyid = "rsa4096/0x04D0CEAF916A9A40";
|
||||||
|
fingerprint = "2BE3 BAFD 793E A349 ED1F F00F 04D0 CEAF 916A 9A40";
|
||||||
|
}];
|
||||||
|
};
|
||||||
kubukoz = {
|
kubukoz = {
|
||||||
name = "Jakub Kozłowski";
|
name = "Jakub Kozłowski";
|
||||||
email = "kubukoz@users.noreply.github.com";
|
email = "kubukoz@users.noreply.github.com";
|
||||||
@@ -87,4 +103,22 @@
|
|||||||
githubId = 12465195;
|
githubId = 12465195;
|
||||||
name = "Bruno BELANYI";
|
name = "Bruno BELANYI";
|
||||||
};
|
};
|
||||||
|
malvo = {
|
||||||
|
email = "malte@malvo.org";
|
||||||
|
github = "malte-v";
|
||||||
|
githubId = 34393802;
|
||||||
|
name = "Malte Voos";
|
||||||
|
};
|
||||||
|
kranzes = {
|
||||||
|
email = "personal@ilanjoselevich.com";
|
||||||
|
github = "Kranzes";
|
||||||
|
githubId = 56614642;
|
||||||
|
name = "Ilan Joselevich";
|
||||||
|
};
|
||||||
|
mager = {
|
||||||
|
email = "andreas@mager.eu";
|
||||||
|
github = "AndreasMager";
|
||||||
|
githubId = 5646732;
|
||||||
|
name = "Andreas Mager";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ let
|
|||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.nullOr types.package;
|
type = types.nullOr types.package;
|
||||||
default = null;
|
default = null;
|
||||||
example = literalExample "pkgs.gnome3.gnome_themes_standard";
|
example = literalExample "pkgs.gnome.gnome_themes_standard";
|
||||||
description = ''
|
description = ''
|
||||||
Package providing the theme. This package will be installed
|
Package providing the theme. This package will be installed
|
||||||
to your profile. If <literal>null</literal> then the theme
|
to your profile. If <literal>null</literal> then the theme
|
||||||
|
|||||||
@@ -2047,6 +2047,108 @@ in
|
|||||||
configuration file.
|
configuration file.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-05-10T20:41:44+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.rbw'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-05-30T15:22:10+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.piston-cli'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-06-02T04:24:10+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.xidlehook'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-06-07T20:44:00+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.pantalaimon'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-06-12T05:00:22+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.mangohud'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-06-16T01:26:16+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
The xmonad module now compiles the configuration before
|
||||||
|
linking the binary to the place xmonad expects to find
|
||||||
|
the compiled configuration (the binary).
|
||||||
|
|
||||||
|
This breaks recompilation of xmonad (i.e. the 'q' binding or
|
||||||
|
'xmonad --recompile').
|
||||||
|
|
||||||
|
If this behavior is undesirable, do not use the
|
||||||
|
'xsession.windowManager.xmonad.config' option. Instead, set the
|
||||||
|
contents of the configuration file with
|
||||||
|
'home.file.".xmonad/config.hs".text = "content of the file"'
|
||||||
|
or 'home.file.".xmonad/config.hs".source = ./path-to-config'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-06-24T22:36:11+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'i18n.inputMethod'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-06-22T14:43:53+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.himalaya'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-07-11T17:45:56+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.sm64ex'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-07-15T13:38:32+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.xsettingsd'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-07-14T20:06:18+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.volnoti'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-07-23T22:22:31+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.trayer'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,40 +6,31 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
isConfig = x:
|
isConfig = x: builtins.isAttrs x || builtins.isFunction x;
|
||||||
builtins.isAttrs x || builtins.isFunction x;
|
|
||||||
|
|
||||||
optCall = f: x:
|
optCall = f: x: if builtins.isFunction f then f x else f;
|
||||||
if builtins.isFunction f
|
|
||||||
then f x
|
|
||||||
else f;
|
|
||||||
|
|
||||||
mergeConfig = lhs_: rhs_:
|
mergeConfig = lhs_: rhs_:
|
||||||
let
|
let
|
||||||
lhs = optCall lhs_ { inherit pkgs; };
|
lhs = optCall lhs_ { inherit pkgs; };
|
||||||
rhs = optCall rhs_ { inherit pkgs; };
|
rhs = optCall rhs_ { inherit pkgs; };
|
||||||
in
|
in lhs // rhs // optionalAttrs (lhs ? packageOverrides) {
|
||||||
lhs // rhs //
|
|
||||||
optionalAttrs (lhs ? packageOverrides) {
|
|
||||||
packageOverrides = pkgs:
|
packageOverrides = pkgs:
|
||||||
optCall lhs.packageOverrides pkgs //
|
optCall lhs.packageOverrides pkgs
|
||||||
optCall (attrByPath ["packageOverrides"] ({}) rhs) pkgs;
|
// optCall (attrByPath [ "packageOverrides" ] ({ }) rhs) pkgs;
|
||||||
} //
|
} // optionalAttrs (lhs ? perlPackageOverrides) {
|
||||||
optionalAttrs (lhs ? perlPackageOverrides) {
|
|
||||||
perlPackageOverrides = pkgs:
|
perlPackageOverrides = pkgs:
|
||||||
optCall lhs.perlPackageOverrides pkgs //
|
optCall lhs.perlPackageOverrides pkgs
|
||||||
optCall (attrByPath ["perlPackageOverrides"] ({}) rhs) pkgs;
|
// optCall (attrByPath [ "perlPackageOverrides" ] ({ }) rhs) pkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
configType = mkOptionType {
|
configType = mkOptionType {
|
||||||
name = "nixpkgs-config";
|
name = "nixpkgs-config";
|
||||||
description = "nixpkgs config";
|
description = "nixpkgs config";
|
||||||
check = x:
|
check = x:
|
||||||
let traceXIfNot = c:
|
let traceXIfNot = c: if c x then true else lib.traceSeqN 1 x false;
|
||||||
if c x then true
|
|
||||||
else lib.traceSeqN 1 x false;
|
|
||||||
in traceXIfNot isConfig;
|
in traceXIfNot isConfig;
|
||||||
merge = args: fold (def: mergeConfig def.value) {};
|
merge = args: fold (def: mergeConfig def.value) { };
|
||||||
};
|
};
|
||||||
|
|
||||||
overlayType = mkOptionType {
|
overlayType = mkOptionType {
|
||||||
@@ -49,13 +40,9 @@ let
|
|||||||
merge = lib.mergeOneOption;
|
merge = lib.mergeOneOption;
|
||||||
};
|
};
|
||||||
|
|
||||||
_pkgs = import pkgsPath (
|
_pkgs = import pkgsPath (filterAttrs (n: v: v != null) config.nixpkgs);
|
||||||
filterAttrs (n: v: v != null) config.nixpkgs
|
|
||||||
);
|
|
||||||
|
|
||||||
in
|
in {
|
||||||
|
|
||||||
{
|
|
||||||
options.nixpkgs = {
|
options.nixpkgs = {
|
||||||
config = mkOption {
|
config = mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
@@ -91,17 +78,16 @@ in
|
|||||||
|
|
||||||
overlays = mkOption {
|
overlays = mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
example = literalExample
|
example = literalExample ''
|
||||||
''
|
[ (self: super: {
|
||||||
[ (self: super: {
|
openssh = super.openssh.override {
|
||||||
openssh = super.openssh.override {
|
hpnSupport = true;
|
||||||
hpnSupport = true;
|
withKerberos = true;
|
||||||
withKerberos = true;
|
kerberos = self.libkrb5;
|
||||||
kerberos = self.libkrb5;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
) ]
|
};
|
||||||
'';
|
) ]
|
||||||
|
'';
|
||||||
type = types.nullOr (types.listOf overlayType);
|
type = types.nullOr (types.listOf overlayType);
|
||||||
description = ''
|
description = ''
|
||||||
List of overlays to use with the Nix Packages collection. (For
|
List of overlays to use with the Nix Packages collection. (For
|
||||||
@@ -144,9 +130,10 @@ in
|
|||||||
_module.args = {
|
_module.args = {
|
||||||
pkgs = mkOverride modules.defaultPriority _pkgs;
|
pkgs = mkOverride modules.defaultPriority _pkgs;
|
||||||
pkgs_i686 =
|
pkgs_i686 =
|
||||||
if _pkgs.stdenv.isLinux && _pkgs.stdenv.hostPlatform.isx86
|
if _pkgs.stdenv.isLinux && _pkgs.stdenv.hostPlatform.isx86 then
|
||||||
then _pkgs.pkgsi686Linux
|
_pkgs.pkgsi686Linux
|
||||||
else { };
|
else
|
||||||
|
{ };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ in {
|
|||||||
options = { xsession.numlock.enable = mkEnableOption "Num Lock"; };
|
options = { xsession.numlock.enable = mkEnableOption "Num Lock"; };
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "xsession.numlock" pkgs platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.numlockx = {
|
systemd.user.services.numlockx = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "NumLockX";
|
Description = "NumLockX";
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf (cfg.rules != [ ]) {
|
config = mkIf (cfg.rules != [ ]) {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "systemd.user.tmpfiles" pkgs
|
||||||
|
platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
xdg = {
|
xdg = {
|
||||||
dataFile."user-tmpfiles.d/home-manager.conf" = {
|
dataFile."user-tmpfiles.d/home-manager.conf" = {
|
||||||
text = ''
|
text = ''
|
||||||
|
|||||||
@@ -5,8 +5,16 @@ with lib;
|
|||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
home.stateVersion = mkOption {
|
home.stateVersion = mkOption {
|
||||||
type =
|
type = types.enum [
|
||||||
types.enum [ "18.09" "19.03" "19.09" "20.03" "20.09" "21.03" "21.05" ];
|
"18.09"
|
||||||
|
"19.03"
|
||||||
|
"19.09"
|
||||||
|
"20.03"
|
||||||
|
"20.09"
|
||||||
|
"21.03"
|
||||||
|
"21.05"
|
||||||
|
"21.11"
|
||||||
|
];
|
||||||
default = "18.09";
|
default = "18.09";
|
||||||
description = ''
|
description = ''
|
||||||
It is occasionally necessary for Home Manager to change
|
It is occasionally necessary for Home Manager to change
|
||||||
|
|||||||
183
modules/misc/xdg-desktop-entries.nix
Normal file
183
modules/misc/xdg-desktop-entries.nix
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
desktopEntry = {
|
||||||
|
options = {
|
||||||
|
# Since this module uses the nixpkgs/pkgs/build-support/make-desktopitem function,
|
||||||
|
# our options and defaults follow its parameters, with the following exceptions:
|
||||||
|
|
||||||
|
# `desktopName` on makeDesktopItem is controlled by `name`.
|
||||||
|
# This is what we'd commonly consider the name of the application.
|
||||||
|
# `name` on makeDesktopItem is controlled by this module's key in the attrset.
|
||||||
|
# This is the file's filename excluding ".desktop".
|
||||||
|
|
||||||
|
# `extraEntries` on makeDesktopItem is controlled by `extraConfig`,
|
||||||
|
# and `extraDesktopEntries` by `settings`,
|
||||||
|
# to match what's commonly used by other home manager modules.
|
||||||
|
|
||||||
|
# `startupNotify` on makeDesktopItem asks for "true" or "false" strings,
|
||||||
|
# for usability's sake we ask for a boolean.
|
||||||
|
|
||||||
|
# `mimeType` and `categories` on makeDesktopItem ask for a string in the format "one;two;three;",
|
||||||
|
# for the same reason we ask for a list of strings.
|
||||||
|
|
||||||
|
# Descriptions are taken from the desktop entry spec:
|
||||||
|
# https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys
|
||||||
|
|
||||||
|
type = mkOption {
|
||||||
|
description = "The type of the desktop entry.";
|
||||||
|
default = "Application";
|
||||||
|
type = types.enum [ "Application" "Link" "Directory" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
exec = mkOption {
|
||||||
|
description = "Program to execute, possibly with arguments.";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
|
||||||
|
icon = mkOption {
|
||||||
|
description = "Icon to display in file manager, menus, etc.";
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
comment = mkOption {
|
||||||
|
description = "Tooltip for the entry.";
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
terminal = mkOption {
|
||||||
|
description = "Whether the program runs in a terminal window.";
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
name = mkOption {
|
||||||
|
description = "Specific name of the application.";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
|
||||||
|
genericName = mkOption {
|
||||||
|
description = "Generic name of the application.";
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
mimeType = mkOption {
|
||||||
|
description = "The MIME type(s) supported by this application.";
|
||||||
|
type = types.nullOr (types.listOf types.str);
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
categories = mkOption {
|
||||||
|
description =
|
||||||
|
"Categories in which the entry should be shown in a menu.";
|
||||||
|
type = types.nullOr (types.listOf types.str);
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
startupNotify = mkOption {
|
||||||
|
description = ''
|
||||||
|
If true, it is KNOWN that the application will send a "remove"
|
||||||
|
message when started with the <literal>DESKTOP_STARTUP_ID</literal>
|
||||||
|
environment variable set. If false, it is KNOWN that the application
|
||||||
|
does not work with startup notification at all.'';
|
||||||
|
type = types.nullOr types.bool;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = mkOption {
|
||||||
|
description = ''
|
||||||
|
Extra configuration. Will be appended to the end of the file and
|
||||||
|
may thus contain extra sections.
|
||||||
|
'';
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = types.attrsOf types.string;
|
||||||
|
description = ''
|
||||||
|
Extra key-value pairs to add to the <literal>[Desktop Entry]</literal> section.
|
||||||
|
This may override other values.
|
||||||
|
'';
|
||||||
|
default = { };
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
Keywords = "calc;math";
|
||||||
|
DBusActivatable = "false";
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
fileValidation = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
description = "Whether to validate the generated desktop file.";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#formatting helpers
|
||||||
|
ifNotNull = a: a': if a == null then null else a';
|
||||||
|
stringBool = bool: if bool then "true" else "false";
|
||||||
|
semicolonList = list:
|
||||||
|
(concatStringsSep ";" list) + ";"; # requires trailing semicolon
|
||||||
|
|
||||||
|
#passes config options to makeDesktopItem in expected format
|
||||||
|
makeFile = name: config:
|
||||||
|
pkgs.makeDesktopItem {
|
||||||
|
name = name;
|
||||||
|
type = config.type;
|
||||||
|
exec = config.exec;
|
||||||
|
icon = config.icon;
|
||||||
|
comment = config.comment;
|
||||||
|
terminal = config.terminal;
|
||||||
|
desktopName = config.name;
|
||||||
|
genericName = config.genericName;
|
||||||
|
mimeType = ifNotNull config.mimeType (semicolonList config.mimeType);
|
||||||
|
categories =
|
||||||
|
ifNotNull config.categories (semicolonList config.categories);
|
||||||
|
startupNotify =
|
||||||
|
ifNotNull config.startupNotify (stringBool config.startupNotify);
|
||||||
|
extraEntries = config.extraConfig;
|
||||||
|
extraDesktopEntries = config.settings;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
meta.maintainers = with maintainers; [ cwyc ];
|
||||||
|
|
||||||
|
options.xdg.desktopEntries = mkOption {
|
||||||
|
description = ''
|
||||||
|
Desktop Entries allow applications to be shown in your desktop environment's app launcher. </para><para>
|
||||||
|
You can define entries for programs without entries or override existing entries. </para><para>
|
||||||
|
See <link xlink:href="https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys" /> for more information on options.
|
||||||
|
'';
|
||||||
|
default = { };
|
||||||
|
type = types.attrsOf (types.submodule desktopEntry);
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
firefox = {
|
||||||
|
name = "Firefox";
|
||||||
|
genericName = "Web Browser";
|
||||||
|
exec = "firefox %U";
|
||||||
|
terminal = false;
|
||||||
|
categories = [ "Application" "Network" "WebBrowser" ];
|
||||||
|
mimeType = [ "text/html" "text/xml" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf (config.xdg.desktopEntries != { }) {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "xdg.desktopEntries" pkgs platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
|
home.packages = (map hiPrio # we need hiPrio to override existing entries
|
||||||
|
(attrsets.mapAttrsToList makeFile config.xdg.desktopEntries));
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -73,6 +73,9 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions =
|
||||||
|
[ (hm.assertions.assertPlatform "xdg.mimeApps" pkgs platforms.linux) ];
|
||||||
|
|
||||||
# Deprecated but still used by some applications.
|
# Deprecated but still used by some applications.
|
||||||
xdg.dataFile."applications/mimeapps.list".source =
|
xdg.dataFile."applications/mimeapps.list".source =
|
||||||
config.xdg.configFile."mimeapps.list".source;
|
config.xdg.configFile."mimeapps.list".source;
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ in {
|
|||||||
options = {
|
options = {
|
||||||
xdg.mime.enable = mkOption {
|
xdg.mime.enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = pkgs.hostPlatform.isLinux;
|
||||||
|
defaultText =
|
||||||
|
literalExample "true if host platform is Linux, false otherwise";
|
||||||
description = ''
|
description = ''
|
||||||
Whether to install programs and files to support the
|
Whether to install programs and files to support the
|
||||||
XDG Shared MIME-info specification and XDG MIME Applications
|
XDG Shared MIME-info specification and XDG MIME Applications
|
||||||
@@ -24,6 +26,9 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.xdg.mime.enable {
|
config = mkIf config.xdg.mime.enable {
|
||||||
|
assertions =
|
||||||
|
[ (hm.assertions.assertPlatform "xdg.mime" pkgs platforms.linux) ];
|
||||||
|
|
||||||
home.packages = [
|
home.packages = [
|
||||||
# Explicitly install package to provide basic mime types.
|
# Explicitly install package to provide basic mime types.
|
||||||
pkgs.shared-mime-info
|
pkgs.shared-mime-info
|
||||||
|
|||||||
@@ -36,6 +36,12 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkMerge [
|
config = mkMerge [
|
||||||
|
(mkIf (cfg.config != [ ] || cfg.data != [ ]) {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "xdg.systemDirs" pkgs platforms.linux)
|
||||||
|
];
|
||||||
|
})
|
||||||
|
|
||||||
(mkIf (cfg.config != [ ]) {
|
(mkIf (cfg.config != [ ]) {
|
||||||
home.sessionVariables.XDG_CONFIG_DIRS =
|
home.sessionVariables.XDG_CONFIG_DIRS =
|
||||||
"${configDirs}\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}";
|
"${configDirs}\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}";
|
||||||
|
|||||||
@@ -103,6 +103,9 @@ in {
|
|||||||
XDG_VIDEOS_DIR = cfg.videos;
|
XDG_VIDEOS_DIR = cfg.videos;
|
||||||
} // cfg.extraConfig;
|
} // cfg.extraConfig;
|
||||||
in mkIf cfg.enable {
|
in mkIf cfg.enable {
|
||||||
|
assertions =
|
||||||
|
[ (hm.assertions.assertPlatform "xdg.userDirs" pkgs platforms.linux) ];
|
||||||
|
|
||||||
xdg.configFile."user-dirs.dirs".text = let
|
xdg.configFile."user-dirs.dirs".text = let
|
||||||
# For some reason, these need to be wrapped with quotes to be valid.
|
# For some reason, these need to be wrapped with quotes to be valid.
|
||||||
wrapped = mapAttrs (_: value: ''"${value}"'') directories;
|
wrapped = mapAttrs (_: value: ''"${value}"'') directories;
|
||||||
|
|||||||
@@ -16,14 +16,10 @@ let
|
|||||||
defaultDataHome = "${config.home.homeDirectory}/.local/share";
|
defaultDataHome = "${config.home.homeDirectory}/.local/share";
|
||||||
|
|
||||||
getXdgDir = name: fallback:
|
getXdgDir = name: fallback:
|
||||||
let
|
let value = builtins.getEnv name;
|
||||||
value = builtins.getEnv name;
|
in if value != "" then value else fallback;
|
||||||
in
|
|
||||||
if value != "" then value else fallback;
|
|
||||||
|
|
||||||
in
|
in {
|
||||||
|
|
||||||
{
|
|
||||||
options.xdg = {
|
options.xdg = {
|
||||||
enable = mkEnableOption "management of XDG base directories";
|
enable = mkEnableOption "management of XDG base directories";
|
||||||
|
|
||||||
@@ -37,7 +33,7 @@ in
|
|||||||
|
|
||||||
configFile = mkOption {
|
configFile = mkOption {
|
||||||
type = fileType "<varname>xdg.configHome</varname>" cfg.configHome;
|
type = fileType "<varname>xdg.configHome</varname>" cfg.configHome;
|
||||||
default = {};
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
Attribute set of files to link into the user's XDG
|
Attribute set of files to link into the user's XDG
|
||||||
configuration home.
|
configuration home.
|
||||||
@@ -54,7 +50,7 @@ in
|
|||||||
|
|
||||||
dataFile = mkOption {
|
dataFile = mkOption {
|
||||||
type = fileType "<varname>xdg.dataHome</varname>" cfg.dataHome;
|
type = fileType "<varname>xdg.dataHome</varname>" cfg.dataHome;
|
||||||
default = {};
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
Attribute set of files to link into the user's XDG
|
Attribute set of files to link into the user's XDG
|
||||||
data home.
|
data home.
|
||||||
|
|||||||
@@ -1,239 +1,245 @@
|
|||||||
{ pkgs
|
{ pkgs
|
||||||
|
|
||||||
# Note, this should be "the standard library" + HM extensions.
|
# Note, this should be "the standard library" + HM extensions.
|
||||||
, lib
|
, lib
|
||||||
|
|
||||||
# Whether to enable module type checking.
|
# Whether to enable module type checking.
|
||||||
, check ? true
|
, check ? true
|
||||||
|
|
||||||
# If disabled, the pkgs attribute passed to this function is used instead.
|
# If disabled, the pkgs attribute passed to this function is used instead.
|
||||||
, useNixpkgsModule ? true
|
, useNixpkgsModule ? true }:
|
||||||
}:
|
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
hostPlatform = pkgs.stdenv.hostPlatform;
|
modules = [
|
||||||
|
./accounts/email.nix
|
||||||
loadModule = file: { condition ? true }: {
|
./config/i18n.nix
|
||||||
inherit file condition;
|
./files.nix
|
||||||
};
|
./home-environment.nix
|
||||||
|
./i18n/input-method/default.nix
|
||||||
allModules = [
|
./manual.nix
|
||||||
(loadModule ./accounts/email.nix { })
|
./misc/dconf.nix
|
||||||
(loadModule ./config/i18n.nix { condition = hostPlatform.isLinux; })
|
./misc/debug.nix
|
||||||
(loadModule ./files.nix { })
|
./misc/fontconfig.nix
|
||||||
(loadModule ./home-environment.nix { })
|
./misc/gtk.nix
|
||||||
(loadModule ./manual.nix { })
|
./misc/lib.nix
|
||||||
(loadModule ./misc/dconf.nix { })
|
./misc/news.nix
|
||||||
(loadModule ./misc/debug.nix { })
|
./misc/numlock.nix
|
||||||
(loadModule ./misc/fontconfig.nix { })
|
./misc/pam.nix
|
||||||
(loadModule ./misc/gtk.nix { })
|
./misc/qt.nix
|
||||||
(loadModule ./misc/lib.nix { })
|
./misc/submodule-support.nix
|
||||||
(loadModule ./misc/news.nix { })
|
./misc/tmpfiles.nix
|
||||||
(loadModule ./misc/nixpkgs.nix { condition = useNixpkgsModule; })
|
./misc/version.nix
|
||||||
(loadModule ./misc/numlock.nix { condition = hostPlatform.isLinux; })
|
./misc/vte.nix
|
||||||
(loadModule ./misc/pam.nix { })
|
./misc/xdg-desktop-entries.nix
|
||||||
(loadModule ./misc/qt.nix { })
|
./misc/xdg-mime-apps.nix
|
||||||
(loadModule ./misc/submodule-support.nix { })
|
./misc/xdg-mime.nix
|
||||||
(loadModule ./misc/tmpfiles.nix { condition = hostPlatform.isLinux; })
|
./misc/xdg-system-dirs.nix
|
||||||
(loadModule ./misc/version.nix { })
|
./misc/xdg-user-dirs.nix
|
||||||
(loadModule ./misc/vte.nix { })
|
./misc/xdg.nix
|
||||||
(loadModule ./misc/xdg-system-dirs.nix { condition = hostPlatform.isLinux; })
|
./programs/abook.nix
|
||||||
(loadModule ./misc/xdg-mime.nix { condition = hostPlatform.isLinux; })
|
./programs/afew.nix
|
||||||
(loadModule ./misc/xdg-mime-apps.nix { condition = hostPlatform.isLinux; })
|
./programs/alacritty.nix
|
||||||
(loadModule ./misc/xdg-user-dirs.nix { condition = hostPlatform.isLinux; })
|
./programs/alot.nix
|
||||||
(loadModule ./misc/xdg.nix { })
|
./programs/aria2.nix
|
||||||
(loadModule ./programs/abook.nix { condition = hostPlatform.isLinux; })
|
./programs/astroid.nix
|
||||||
(loadModule ./programs/afew.nix { })
|
./programs/autojump.nix
|
||||||
(loadModule ./programs/alacritty.nix { })
|
./programs/autorandr.nix
|
||||||
(loadModule ./programs/alot.nix { })
|
./programs/bash.nix
|
||||||
(loadModule ./programs/aria2.nix { })
|
./programs/bat.nix
|
||||||
(loadModule ./programs/astroid.nix { })
|
./programs/beets.nix
|
||||||
(loadModule ./programs/autojump.nix { })
|
./programs/broot.nix
|
||||||
(loadModule ./programs/autorandr.nix { })
|
./programs/browserpass.nix
|
||||||
(loadModule ./programs/bash.nix { })
|
./programs/chromium.nix
|
||||||
(loadModule ./programs/bat.nix { })
|
./programs/command-not-found/command-not-found.nix
|
||||||
(loadModule ./programs/beets.nix { })
|
./programs/dircolors.nix
|
||||||
(loadModule ./programs/broot.nix { })
|
./programs/direnv.nix
|
||||||
(loadModule ./programs/browserpass.nix { })
|
./programs/eclipse.nix
|
||||||
(loadModule ./programs/chromium.nix { })
|
./programs/emacs.nix
|
||||||
(loadModule ./programs/command-not-found/command-not-found.nix { })
|
./programs/exa.nix
|
||||||
(loadModule ./programs/dircolors.nix { })
|
./programs/feh.nix
|
||||||
(loadModule ./programs/direnv.nix { })
|
./programs/firefox.nix
|
||||||
(loadModule ./programs/eclipse.nix { })
|
./programs/fish.nix
|
||||||
(loadModule ./programs/emacs.nix { })
|
./programs/foot.nix
|
||||||
(loadModule ./programs/exa.nix { })
|
./programs/fzf.nix
|
||||||
(loadModule ./programs/feh.nix { })
|
./programs/getmail.nix
|
||||||
(loadModule ./programs/firefox.nix { })
|
./programs/gh.nix
|
||||||
(loadModule ./programs/fish.nix { })
|
./programs/git.nix
|
||||||
(loadModule ./programs/foot.nix { condition = hostPlatform.isLinux; })
|
./programs/gnome-terminal.nix
|
||||||
(loadModule ./programs/fzf.nix { })
|
./programs/go.nix
|
||||||
(loadModule ./programs/getmail.nix { condition = hostPlatform.isLinux; })
|
./programs/gpg.nix
|
||||||
(loadModule ./programs/gh.nix { })
|
./programs/himalaya.nix
|
||||||
(loadModule ./programs/git.nix { })
|
./programs/home-manager.nix
|
||||||
(loadModule ./programs/gnome-terminal.nix { })
|
./programs/htop.nix
|
||||||
(loadModule ./programs/go.nix { })
|
./programs/i3status-rust.nix
|
||||||
(loadModule ./programs/gpg.nix { })
|
./programs/i3status.nix
|
||||||
(loadModule ./programs/home-manager.nix { })
|
./programs/info.nix
|
||||||
(loadModule ./programs/htop.nix { })
|
./programs/irssi.nix
|
||||||
(loadModule ./programs/i3status.nix { })
|
./programs/jq.nix
|
||||||
(loadModule ./programs/i3status-rust.nix { condition = hostPlatform.isLinux; })
|
./programs/kakoune.nix
|
||||||
(loadModule ./programs/info.nix { })
|
./programs/keychain.nix
|
||||||
(loadModule ./programs/irssi.nix { })
|
./programs/kitty.nix
|
||||||
(loadModule ./programs/lieer.nix { })
|
./programs/lazygit.nix
|
||||||
(loadModule ./programs/jq.nix { })
|
./programs/lesspipe.nix
|
||||||
(loadModule ./programs/kakoune.nix { })
|
./programs/lf.nix
|
||||||
(loadModule ./programs/keychain.nix { })
|
./programs/lieer.nix
|
||||||
(loadModule ./programs/kitty.nix { })
|
./programs/lsd.nix
|
||||||
(loadModule ./programs/lazygit.nix { })
|
./programs/man.nix
|
||||||
(loadModule ./programs/lesspipe.nix { })
|
./programs/mangohud.nix
|
||||||
(loadModule ./programs/lf.nix { })
|
./programs/matplotlib.nix
|
||||||
(loadModule ./programs/lsd.nix { })
|
./programs/mbsync.nix
|
||||||
(loadModule ./programs/man.nix { })
|
./programs/mcfly.nix
|
||||||
(loadModule ./programs/matplotlib.nix { })
|
./programs/mercurial.nix
|
||||||
(loadModule ./programs/mbsync.nix { })
|
./programs/mpv.nix
|
||||||
(loadModule ./programs/mcfly.nix { })
|
./programs/msmtp.nix
|
||||||
(loadModule ./programs/mercurial.nix { })
|
./programs/mu.nix
|
||||||
(loadModule ./programs/mpv.nix { })
|
./programs/ncmpcpp.nix
|
||||||
(loadModule ./programs/msmtp.nix { })
|
./programs/ncspot.nix
|
||||||
(loadModule ./programs/mu.nix { })
|
./programs/ne.nix
|
||||||
(loadModule ./programs/ncmpcpp.nix { })
|
./programs/neomutt.nix
|
||||||
(loadModule ./programs/ncspot.nix { })
|
./programs/neovim.nix
|
||||||
(loadModule ./programs/ne.nix { })
|
./programs/newsboat.nix
|
||||||
(loadModule ./programs/neomutt.nix { })
|
./programs/nix-index.nix
|
||||||
(loadModule ./programs/neovim.nix { })
|
./programs/noti.nix
|
||||||
(loadModule ./programs/newsboat.nix { })
|
./programs/notmuch.nix
|
||||||
(loadModule ./programs/nix-index.nix { })
|
./programs/nushell.nix
|
||||||
(loadModule ./programs/noti.nix { })
|
./programs/obs-studio.nix
|
||||||
(loadModule ./programs/notmuch.nix { })
|
./programs/octant.nix
|
||||||
(loadModule ./programs/nushell.nix { })
|
./programs/offlineimap.nix
|
||||||
(loadModule ./programs/obs-studio.nix { })
|
./programs/opam.nix
|
||||||
(loadModule ./programs/octant.nix { })
|
./programs/password-store.nix
|
||||||
(loadModule ./programs/offlineimap.nix { })
|
./programs/pazi.nix
|
||||||
(loadModule ./programs/opam.nix { })
|
./programs/pet.nix
|
||||||
(loadModule ./programs/password-store.nix { })
|
./programs/pidgin.nix
|
||||||
(loadModule ./programs/pazi.nix { })
|
./programs/piston-cli.nix
|
||||||
(loadModule ./programs/pet.nix { })
|
./programs/powerline-go.nix
|
||||||
(loadModule ./programs/pidgin.nix { })
|
./programs/qutebrowser.nix
|
||||||
(loadModule ./programs/powerline-go.nix { })
|
./programs/rbw.nix
|
||||||
(loadModule ./programs/qutebrowser.nix { })
|
./programs/readline.nix
|
||||||
(loadModule ./programs/readline.nix { })
|
./programs/rofi-pass.nix
|
||||||
(loadModule ./programs/rofi.nix { })
|
./programs/rofi.nix
|
||||||
(loadModule ./programs/rofi-pass.nix { })
|
./programs/rtorrent.nix
|
||||||
(loadModule ./programs/rtorrent.nix { })
|
./programs/sbt.nix
|
||||||
(loadModule ./programs/scmpuff.nix { })
|
./programs/scmpuff.nix
|
||||||
(loadModule ./programs/skim.nix { })
|
./programs/senpai.nix
|
||||||
(loadModule ./programs/starship.nix { })
|
./programs/skim.nix
|
||||||
(loadModule ./programs/sbt.nix { })
|
./programs/sm64ex.nix
|
||||||
(loadModule ./programs/ssh.nix { })
|
./programs/ssh.nix
|
||||||
(loadModule ./programs/taskwarrior.nix { })
|
./programs/starship.nix
|
||||||
(loadModule ./programs/termite.nix { })
|
./programs/taskwarrior.nix
|
||||||
(loadModule ./programs/texlive.nix { })
|
./programs/terminator.nix
|
||||||
(loadModule ./programs/tmux.nix { })
|
./programs/termite.nix
|
||||||
(loadModule ./programs/topgrade.nix { })
|
./programs/texlive.nix
|
||||||
(loadModule ./programs/urxvt.nix { })
|
./programs/tmux.nix
|
||||||
(loadModule ./programs/vim.nix { })
|
./programs/topgrade.nix
|
||||||
(loadModule ./programs/vscode.nix { })
|
./programs/urxvt.nix
|
||||||
(loadModule ./programs/vscode/haskell.nix { })
|
./programs/vim.nix
|
||||||
(loadModule ./programs/waybar.nix { condition = hostPlatform.isLinux; })
|
./programs/vscode.nix
|
||||||
(loadModule ./programs/z-lua.nix { })
|
./programs/vscode/haskell.nix
|
||||||
(loadModule ./programs/zathura.nix { })
|
./programs/waybar.nix
|
||||||
(loadModule ./programs/zoxide.nix { })
|
./programs/xmobar.nix
|
||||||
(loadModule ./programs/zplug.nix { })
|
./programs/z-lua.nix
|
||||||
(loadModule ./programs/zsh.nix { })
|
./programs/zathura.nix
|
||||||
(loadModule ./programs/zsh/prezto.nix { })
|
./programs/zoxide.nix
|
||||||
(loadModule ./services/barrier.nix { condition = hostPlatform.isLinux; })
|
./programs/zplug.nix
|
||||||
(loadModule ./services/blueman-applet.nix { })
|
./programs/zsh.nix
|
||||||
(loadModule ./services/caffeine.nix { condition = hostPlatform.isLinux; })
|
./programs/zsh/prezto.nix
|
||||||
(loadModule ./services/cbatticon.nix { condition = hostPlatform.isLinux; })
|
./services/barrier.nix
|
||||||
(loadModule ./services/clipmenu.nix { condition = hostPlatform.isLinux; })
|
./services/blueman-applet.nix
|
||||||
(loadModule ./services/compton.nix { })
|
./services/caffeine.nix
|
||||||
(loadModule ./services/dropbox.nix { condition = hostPlatform.isLinux; })
|
./services/cbatticon.nix
|
||||||
(loadModule ./services/dunst.nix { })
|
./services/clipmenu.nix
|
||||||
(loadModule ./services/dwm-status.nix { condition = hostPlatform.isLinux; })
|
./services/compton.nix
|
||||||
(loadModule ./services/emacs.nix { condition = hostPlatform.isLinux; })
|
./services/devilspie2.nix
|
||||||
(loadModule ./services/etesync-dav.nix { condition = hostPlatform.isLinux; })
|
./services/dropbox.nix
|
||||||
(loadModule ./services/flameshot.nix { })
|
./services/dunst.nix
|
||||||
(loadModule ./services/fluidsynth.nix { condition = hostPlatform.isLinux; })
|
./services/dwm-status.nix
|
||||||
(loadModule ./services/redshift-gammastep/gammastep.nix { condition = hostPlatform.isLinux; })
|
./services/emacs.nix
|
||||||
(loadModule ./services/getmail.nix { condition = hostPlatform.isLinux; })
|
./services/etesync-dav.nix
|
||||||
(loadModule ./services/gnome-keyring.nix { })
|
./services/flameshot.nix
|
||||||
(loadModule ./services/gpg-agent.nix { })
|
./services/fluidsynth.nix
|
||||||
(loadModule ./services/grobi.nix { condition = hostPlatform.isLinux; })
|
./services/getmail.nix
|
||||||
(loadModule ./services/hound.nix { condition = hostPlatform.isLinux; })
|
./services/gnome-keyring.nix
|
||||||
(loadModule ./services/imapnotify.nix { condition = hostPlatform.isLinux; })
|
./services/gpg-agent.nix
|
||||||
(loadModule ./services/kanshi.nix { condition = hostPlatform.isLinux; })
|
./services/grobi.nix
|
||||||
(loadModule ./services/kbfs.nix { })
|
./services/hound.nix
|
||||||
(loadModule ./services/kdeconnect.nix { })
|
./services/imapnotify.nix
|
||||||
(loadModule ./services/keepassx.nix { })
|
./services/kanshi.nix
|
||||||
(loadModule ./services/keybase.nix { })
|
./services/kbfs.nix
|
||||||
(loadModule ./services/keynav.nix { condition = hostPlatform.isLinux; })
|
./services/kdeconnect.nix
|
||||||
(loadModule ./services/lieer.nix { condition = hostPlatform.isLinux; })
|
./services/keepassx.nix
|
||||||
(loadModule ./services/lorri.nix { condition = hostPlatform.isLinux; })
|
./services/keybase.nix
|
||||||
(loadModule ./services/mako.nix { condition = hostPlatform.isLinux; })
|
./services/keynav.nix
|
||||||
(loadModule ./services/mbsync.nix { })
|
./services/lieer.nix
|
||||||
(loadModule ./services/mpd.nix { })
|
./services/lorri.nix
|
||||||
(loadModule ./services/mpdris2.nix { condition = hostPlatform.isLinux; })
|
./services/mako.nix
|
||||||
(loadModule ./services/mpris-proxy.nix { condition = hostPlatform.isLinux; })
|
./services/mbsync.nix
|
||||||
(loadModule ./services/muchsync.nix { condition = hostPlatform.isLinux; })
|
./services/mpd.nix
|
||||||
(loadModule ./services/network-manager-applet.nix { })
|
./services/mpdris2.nix
|
||||||
(loadModule ./services/nextcloud-client.nix { })
|
./services/mpris-proxy.nix
|
||||||
(loadModule ./services/owncloud-client.nix { })
|
./services/muchsync.nix
|
||||||
(loadModule ./services/parcellite.nix { })
|
./services/network-manager-applet.nix
|
||||||
(loadModule ./services/pass-secret-service.nix { condition = hostPlatform.isLinux; })
|
./services/nextcloud-client.nix
|
||||||
(loadModule ./services/password-store-sync.nix { condition = hostPlatform.isLinux; })
|
./services/owncloud-client.nix
|
||||||
(loadModule ./services/pasystray.nix { })
|
./services/pantalaimon.nix
|
||||||
(loadModule ./services/pbgopy.nix { condition = hostPlatform.isLinux; })
|
./services/parcellite.nix
|
||||||
(loadModule ./services/picom.nix { })
|
./services/pass-secret-service.nix
|
||||||
(loadModule ./services/plan9port.nix { condition = hostPlatform.isLinux; })
|
./services/password-store-sync.nix
|
||||||
(loadModule ./services/playerctld.nix { condition = hostPlatform.isLinux; })
|
./services/pasystray.nix
|
||||||
(loadModule ./services/polybar.nix { })
|
./services/pbgopy.nix
|
||||||
(loadModule ./services/poweralertd.nix { condition = hostPlatform.isLinux; })
|
./services/picom.nix
|
||||||
(loadModule ./services/pulseeffects.nix { condition = hostPlatform.isLinux; })
|
./services/plan9port.nix
|
||||||
(loadModule ./services/random-background.nix { })
|
./services/playerctld.nix
|
||||||
(loadModule ./services/redshift-gammastep/redshift.nix { })
|
./services/polybar.nix
|
||||||
(loadModule ./services/rsibreak.nix { condition = hostPlatform.isLinux; })
|
./services/poweralertd.nix
|
||||||
(loadModule ./services/screen-locker.nix { })
|
./services/pulseeffects.nix
|
||||||
(loadModule ./services/stalonetray.nix { })
|
./services/random-background.nix
|
||||||
(loadModule ./services/status-notifier-watcher.nix { })
|
./services/redshift-gammastep/gammastep.nix
|
||||||
(loadModule ./services/spotifyd.nix { condition = hostPlatform.isLinux; })
|
./services/redshift-gammastep/redshift.nix
|
||||||
(loadModule ./services/sxhkd.nix { condition = hostPlatform.isLinux; })
|
./services/rsibreak.nix
|
||||||
(loadModule ./services/syncthing.nix { })
|
./services/screen-locker.nix
|
||||||
(loadModule ./services/taffybar.nix { })
|
./services/spotifyd.nix
|
||||||
(loadModule ./services/tahoe-lafs.nix { })
|
./services/stalonetray.nix
|
||||||
(loadModule ./services/taskwarrior-sync.nix { condition = hostPlatform.isLinux; })
|
./services/status-notifier-watcher.nix
|
||||||
(loadModule ./services/udiskie.nix { })
|
./services/sxhkd.nix
|
||||||
(loadModule ./services/unclutter.nix { })
|
./services/syncthing.nix
|
||||||
(loadModule ./services/unison.nix { condition = hostPlatform.isLinux; })
|
./services/taffybar.nix
|
||||||
(loadModule ./services/window-managers/awesome.nix { })
|
./services/trayer.nix
|
||||||
(loadModule ./services/window-managers/bspwm/default.nix { condition = hostPlatform.isLinux; })
|
./services/tahoe-lafs.nix
|
||||||
(loadModule ./services/window-managers/i3-sway/i3.nix { })
|
./services/taskwarrior-sync.nix
|
||||||
(loadModule ./services/window-managers/i3-sway/sway.nix { condition = hostPlatform.isLinux; })
|
./services/udiskie.nix
|
||||||
(loadModule ./services/window-managers/xmonad.nix { })
|
./services/unclutter.nix
|
||||||
(loadModule ./services/wlsunset.nix { condition = hostPlatform.isLinux; })
|
./services/unison.nix
|
||||||
(loadModule ./services/xcape.nix { condition = hostPlatform.isLinux; })
|
./services/volnoti.nix
|
||||||
(loadModule ./services/xembed-sni-proxy.nix { condition = hostPlatform.isLinux; })
|
./services/window-managers/awesome.nix
|
||||||
(loadModule ./services/xscreensaver.nix { })
|
./services/window-managers/bspwm/default.nix
|
||||||
(loadModule ./services/xsuspender.nix { condition = hostPlatform.isLinux; })
|
./services/window-managers/i3-sway/i3.nix
|
||||||
(loadModule ./systemd.nix { })
|
./services/window-managers/i3-sway/sway.nix
|
||||||
(loadModule ./targets/darwin { condition = hostPlatform.isDarwin; })
|
./services/window-managers/xmonad.nix
|
||||||
(loadModule ./targets/generic-linux.nix { condition = hostPlatform.isLinux; })
|
./services/wlsunset.nix
|
||||||
(loadModule ./xcursor.nix { })
|
./services/xcape.nix
|
||||||
(loadModule ./xresources.nix { })
|
./services/xembed-sni-proxy.nix
|
||||||
(loadModule ./xsession.nix { })
|
./services/xidlehook.nix
|
||||||
(loadModule (pkgs.path + "/nixos/modules/misc/assertions.nix") { })
|
./services/xscreensaver.nix
|
||||||
(loadModule (pkgs.path + "/nixos/modules/misc/meta.nix") { })
|
./services/xsettingsd.nix
|
||||||
];
|
./services/xsuspender.nix
|
||||||
|
./systemd.nix
|
||||||
modules = map (getAttr "file") (filter (getAttr "condition") allModules);
|
./targets/darwin
|
||||||
|
./targets/generic-linux.nix
|
||||||
|
./xcursor.nix
|
||||||
|
./xresources.nix
|
||||||
|
./xsession.nix
|
||||||
|
(pkgs.path + "/nixos/modules/misc/assertions.nix")
|
||||||
|
(pkgs.path + "/nixos/modules/misc/meta.nix")
|
||||||
|
] ++ optional useNixpkgsModule ./misc/nixpkgs.nix;
|
||||||
|
|
||||||
pkgsModule = { config, ... }: {
|
pkgsModule = { config, ... }: {
|
||||||
config = {
|
config = {
|
||||||
_module.args.baseModules = modules;
|
_module.args.baseModules = modules;
|
||||||
_module.args.pkgsPath = lib.mkDefault (
|
_module.args.pkgsPath = lib.mkDefault
|
||||||
if versionAtLeast config.home.stateVersion "20.09" then
|
(if versionAtLeast config.home.stateVersion "20.09" then
|
||||||
pkgs.path
|
pkgs.path
|
||||||
else
|
else
|
||||||
<nixpkgs>);
|
<nixpkgs>);
|
||||||
@@ -245,6 +251,4 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in modules ++ [ pkgsModule ]
|
||||||
|
|
||||||
modules ++ [ pkgsModule ]
|
|
||||||
|
|||||||
@@ -27,7 +27,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions =
|
||||||
|
[ (hm.assertions.assertPlatform "programs.abook" pkgs platforms.linux) ];
|
||||||
|
|
||||||
home.packages = [ pkgs.abook ];
|
home.packages = [ pkgs.abook ];
|
||||||
|
|
||||||
xdg.configFile."abook/abookrc" = mkIf (cfg.extraConfig != "") {
|
xdg.configFile."abook/abookrc" = mkIf (cfg.extraConfig != "") {
|
||||||
text = ''
|
text = ''
|
||||||
# Generated by Home Manager.
|
# Generated by Home Manager.
|
||||||
|
|||||||
@@ -114,10 +114,12 @@ let
|
|||||||
brave = "BraveSoftware/Brave-Browser";
|
brave = "BraveSoftware/Brave-Browser";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
linuxDirs = { brave = "BraveSoftware/Brave-Browser"; };
|
||||||
|
|
||||||
configDir = if pkgs.stdenv.isDarwin then
|
configDir = if pkgs.stdenv.isDarwin then
|
||||||
"Library/Application Support/${getAttr browser darwinDirs}"
|
"Library/Application Support/" + (darwinDirs."${browser}" or browser)
|
||||||
else
|
else
|
||||||
"${config.xdg.configHome}/${browser}";
|
"${config.xdg.configHome}/" + (linuxDirs."${browser}" or browser);
|
||||||
|
|
||||||
extensionJson = ext:
|
extensionJson = ext:
|
||||||
assert ext.crxPath != null -> ext.version != null;
|
assert ext.crxPath != null -> ext.version != null;
|
||||||
|
|||||||
@@ -11,13 +11,8 @@ let
|
|||||||
dir = "bin";
|
dir = "bin";
|
||||||
src = ./command-not-found.pl;
|
src = ./command-not-found.pl;
|
||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
inherit (pkgs) perl;
|
|
||||||
inherit (cfg) dbPath;
|
inherit (cfg) dbPath;
|
||||||
perlFlags = concatStrings (map (path: "-I ${path}/lib/perl5/site_perl ") [
|
perl = pkgs.perl.withPackages (p: [ p.DBDSQLite p.StringShellQuote ]);
|
||||||
pkgs.perlPackages.DBI
|
|
||||||
pkgs.perlPackages.DBDSQLite
|
|
||||||
pkgs.perlPackages.StringShellQuote
|
|
||||||
]);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
shInit = commandNotFoundHandlerName: ''
|
shInit = commandNotFoundHandlerName: ''
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#! @perl@/bin/perl -w @perlFlags@
|
#! @perl@/bin/perl -w
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use DBI;
|
use DBI;
|
||||||
@@ -29,16 +29,17 @@ if (!defined $res || scalar @$res == 0) {
|
|||||||
exec("nix-shell", "-p", $package, "--run", shell_quote("exec", @ARGV));
|
exec("nix-shell", "-p", $package, "--run", shell_quote("exec", @ARGV));
|
||||||
} else {
|
} else {
|
||||||
print STDERR <<EOF;
|
print STDERR <<EOF;
|
||||||
The program ‘$program’ is currently not installed. You can install it by typing:
|
The program '$program' is not in your PATH. You can make it available in an
|
||||||
nix-env -iA nixos.$package
|
ephemeral shell by typing:
|
||||||
|
nix-shell -p $package
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print STDERR <<EOF;
|
print STDERR <<EOF;
|
||||||
The program ‘$program’ is currently not installed. It is provided by
|
The program '$program' is not in your PATH. It is provided by several packages.
|
||||||
several packages. You can install it by typing one of the following:
|
You can make it available in an ephemeral shell by typing one of the following:
|
||||||
EOF
|
EOF
|
||||||
print STDERR " nix-env -iA nixos.$_->{package}\n" foreach @$res;
|
print STDERR " nix-shell -p $_->{package}\n" foreach @$res;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit 127;
|
exit 127;
|
||||||
|
|||||||
@@ -9,6 +9,14 @@ let
|
|||||||
tomlFormat = pkgs.formats.toml { };
|
tomlFormat = pkgs.formats.toml { };
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
imports = [
|
||||||
|
(mkRenamedOptionModule [
|
||||||
|
"programs"
|
||||||
|
"direnv"
|
||||||
|
"enableNixDirenvIntegration"
|
||||||
|
] [ "programs" "direnv" "nix-direnv" "enable" ])
|
||||||
|
];
|
||||||
|
|
||||||
meta.maintainers = [ maintainers.rycee ];
|
meta.maintainers = [ maintainers.rycee ];
|
||||||
|
|
||||||
options.programs.direnv = {
|
options.programs.direnv = {
|
||||||
@@ -63,10 +71,14 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
enableNixDirenvIntegration = mkEnableOption ''
|
nix-direnv = {
|
||||||
<link
|
enable = mkEnableOption ''
|
||||||
xlink:href="https://github.com/nix-community/nix-direnv">nix-direnv</link>,
|
<link
|
||||||
a fast, persistent use_nix implementation for direnv'';
|
xlink:href="https://github.com/nix-community/nix-direnv">nix-direnv</link>,
|
||||||
|
a fast, persistent use_nix implementation for direnv'';
|
||||||
|
enableFlakes = mkEnableOption "Flake support in nix-direnv";
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
@@ -77,9 +89,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile."direnv/direnvrc" = let
|
xdg.configFile."direnv/direnvrc" = let
|
||||||
|
package =
|
||||||
|
pkgs.nix-direnv.override { inherit (cfg.nix-direnv) enableFlakes; };
|
||||||
text = concatStringsSep "\n" (optional (cfg.stdlib != "") cfg.stdlib
|
text = concatStringsSep "\n" (optional (cfg.stdlib != "") cfg.stdlib
|
||||||
++ optional cfg.enableNixDirenvIntegration
|
++ optional cfg.nix-direnv.enable
|
||||||
"source ${pkgs.nix-direnv}/share/nix-direnv/direnvrc");
|
"source ${package}/share/nix-direnv/direnvrc");
|
||||||
in mkIf (text != "") { inherit text; };
|
in mkIf (text != "") { inherit text; };
|
||||||
|
|
||||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration (
|
programs.bash.initExtra = mkIf cfg.enableBashIntegration (
|
||||||
|
|||||||
@@ -9,19 +9,15 @@ let
|
|||||||
cfg = config.programs.firefox;
|
cfg = config.programs.firefox;
|
||||||
|
|
||||||
mozillaConfigPath =
|
mozillaConfigPath =
|
||||||
if isDarwin
|
if isDarwin then "Library/Application Support/Mozilla" else ".mozilla";
|
||||||
then "Library/Application Support/Mozilla"
|
|
||||||
else ".mozilla";
|
|
||||||
|
|
||||||
firefoxConfigPath =
|
firefoxConfigPath = if isDarwin then
|
||||||
if isDarwin
|
"Library/Application Support/Firefox"
|
||||||
then "Library/Application Support/Firefox"
|
else
|
||||||
else "${mozillaConfigPath}/firefox";
|
"${mozillaConfigPath}/firefox";
|
||||||
|
|
||||||
profilesPath =
|
profilesPath =
|
||||||
if isDarwin
|
if isDarwin then "${firefoxConfigPath}/Profiles" else firefoxConfigPath;
|
||||||
then "${firefoxConfigPath}/Profiles"
|
|
||||||
else firefoxConfigPath;
|
|
||||||
|
|
||||||
# The extensions path shared by all profiles; will not be supported
|
# The extensions path shared by all profiles; will not be supported
|
||||||
# by future Firefox versions.
|
# by future Firefox versions.
|
||||||
@@ -32,24 +28,17 @@ let
|
|||||||
paths = cfg.extensions;
|
paths = cfg.extensions;
|
||||||
};
|
};
|
||||||
|
|
||||||
profiles =
|
profiles = flip mapAttrs' cfg.profiles (_: profile:
|
||||||
flip mapAttrs' cfg.profiles (_: profile:
|
nameValuePair "Profile${toString profile.id}" {
|
||||||
nameValuePair "Profile${toString profile.id}" {
|
Name = profile.name;
|
||||||
Name = profile.name;
|
Path = if isDarwin then "Profiles/${profile.path}" else profile.path;
|
||||||
Path =
|
IsRelative = 1;
|
||||||
if isDarwin
|
Default = if profile.isDefault then 1 else 0;
|
||||||
then "Profiles/${profile.path}"
|
}) // {
|
||||||
else profile.path;
|
General = { StartWithLastProfile = 1; };
|
||||||
IsRelative = 1;
|
|
||||||
Default = if profile.isDefault then 1 else 0;
|
|
||||||
}
|
|
||||||
) // {
|
|
||||||
General = {
|
|
||||||
StartWithLastProfile = 1;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
profilesIni = generators.toINI {} profiles;
|
profilesIni = generators.toINI { } profiles;
|
||||||
|
|
||||||
mkUserJs = prefs: extraPrefs: ''
|
mkUserJs = prefs: extraPrefs: ''
|
||||||
// Generated by Home Manager.
|
// Generated by Home Manager.
|
||||||
@@ -61,17 +50,15 @@ let
|
|||||||
${extraPrefs}
|
${extraPrefs}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in
|
in {
|
||||||
|
|
||||||
{
|
|
||||||
meta.maintainers = [ maintainers.rycee ];
|
meta.maintainers = [ maintainers.rycee ];
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
(mkRemovedOptionModule ["programs" "firefox" "enableAdobeFlash"]
|
(mkRemovedOptionModule [ "programs" "firefox" "enableAdobeFlash" ]
|
||||||
"Support for this option has been removed.")
|
"Support for this option has been removed.")
|
||||||
(mkRemovedOptionModule ["programs" "firefox" "enableGoogleTalk"]
|
(mkRemovedOptionModule [ "programs" "firefox" "enableGoogleTalk" ]
|
||||||
"Support for this option has been removed.")
|
"Support for this option has been removed.")
|
||||||
(mkRemovedOptionModule ["programs" "firefox" "enableIcedTea"]
|
(mkRemovedOptionModule [ "programs" "firefox" "enableIcedTea" ]
|
||||||
"Support for this option has been removed.")
|
"Support for this option has been removed.")
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -81,10 +68,10 @@ in
|
|||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default =
|
default = if versionAtLeast config.home.stateVersion "19.09" then
|
||||||
if versionAtLeast config.home.stateVersion "19.09"
|
pkgs.firefox
|
||||||
then pkgs.firefox
|
else
|
||||||
else pkgs.firefox-unwrapped;
|
pkgs.firefox-unwrapped;
|
||||||
defaultText = literalExample "pkgs.firefox";
|
defaultText = literalExample "pkgs.firefox";
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
pkgs.firefox.override {
|
pkgs.firefox.override {
|
||||||
@@ -106,7 +93,7 @@ in
|
|||||||
|
|
||||||
extensions = mkOption {
|
extensions = mkOption {
|
||||||
type = types.listOf types.package;
|
type = types.listOf types.package;
|
||||||
default = [];
|
default = [ ];
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
with pkgs.nur.repos.rycee.firefox-addons; [
|
with pkgs.nur.repos.rycee.firefox-addons; [
|
||||||
https-everywhere
|
https-everywhere
|
||||||
@@ -141,7 +128,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
profiles = mkOption {
|
profiles = mkOption {
|
||||||
type = types.attrsOf (types.submodule ({config, name, ...}: {
|
type = types.attrsOf (types.submodule ({ config, name, ... }: {
|
||||||
options = {
|
options = {
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
@@ -159,7 +146,7 @@ in
|
|||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = with types; attrsOf (either bool (either int str));
|
type = with types; attrsOf (either bool (either int str));
|
||||||
default = {};
|
default = { };
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
{
|
{
|
||||||
"browser.startup.homepage" = "https://nixos.org";
|
"browser.startup.homepage" = "https://nixos.org";
|
||||||
@@ -224,7 +211,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
default = {};
|
default = { };
|
||||||
description = "Attribute set of Firefox profiles.";
|
description = "Attribute set of Firefox profiles.";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -243,36 +230,27 @@ in
|
|||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
assertions = [
|
assertions = [
|
||||||
(
|
(let
|
||||||
let
|
defaults =
|
||||||
defaults =
|
catAttrs "name" (filter (a: a.isDefault) (attrValues cfg.profiles));
|
||||||
catAttrs "name" (filter (a: a.isDefault) (attrValues cfg.profiles));
|
in {
|
||||||
in {
|
assertion = cfg.profiles == { } || length defaults == 1;
|
||||||
assertion = cfg.profiles == {} || length defaults == 1;
|
message = "Must have exactly one default Firefox profile but found "
|
||||||
message =
|
+ toString (length defaults) + optionalString (length defaults > 1)
|
||||||
"Must have exactly one default Firefox profile but found "
|
(", namely " + concatStringsSep ", " defaults);
|
||||||
+ toString (length defaults)
|
})
|
||||||
+ optionalString (length defaults > 1)
|
|
||||||
(", namely " + concatStringsSep ", " defaults);
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
(
|
(let
|
||||||
let
|
duplicates = filterAttrs (_: v: length v != 1) (zipAttrs
|
||||||
duplicates =
|
(mapAttrsToList (n: v: { "${toString v.id}" = n; }) (cfg.profiles)));
|
||||||
filterAttrs (_: v: length v != 1)
|
|
||||||
(zipAttrs
|
|
||||||
(mapAttrsToList (n: v: { "${toString v.id}" = n; })
|
|
||||||
(cfg.profiles)));
|
|
||||||
|
|
||||||
mkMsg = n: v: " - ID ${n} is used by ${concatStringsSep ", " v}";
|
mkMsg = n: v: " - ID ${n} is used by ${concatStringsSep ", " v}";
|
||||||
in {
|
in {
|
||||||
assertion = duplicates == {};
|
assertion = duplicates == { };
|
||||||
message =
|
message = ''
|
||||||
"Must not have Firefox profiles with duplicate IDs but\n"
|
Must not have Firefox profiles with duplicate IDs but
|
||||||
+ concatStringsSep "\n" (mapAttrsToList mkMsg duplicates);
|
'' + concatStringsSep "\n" (mapAttrsToList mkMsg duplicates);
|
||||||
}
|
})
|
||||||
)
|
|
||||||
];
|
];
|
||||||
|
|
||||||
warnings = optional (cfg.enableGnomeExtensions or false) ''
|
warnings = optional (cfg.enableGnomeExtensions or false) ''
|
||||||
@@ -282,65 +260,53 @@ in
|
|||||||
its example for how to do this.
|
its example for how to do this.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
home.packages =
|
home.packages = let
|
||||||
let
|
# The configuration expected by the Firefox wrapper.
|
||||||
# The configuration expected by the Firefox wrapper.
|
fcfg = { enableGnomeExtensions = cfg.enableGnomeExtensions; };
|
||||||
fcfg = {
|
|
||||||
enableGnomeExtensions = cfg.enableGnomeExtensions;
|
# A bit of hackery to force a config into the wrapper.
|
||||||
|
browserName = cfg.package.browserName or (builtins.parseDrvName
|
||||||
|
cfg.package.name).name;
|
||||||
|
|
||||||
|
# The configuration expected by the Firefox wrapper builder.
|
||||||
|
bcfg = setAttrByPath [ browserName ] fcfg;
|
||||||
|
|
||||||
|
package = if isDarwin then
|
||||||
|
cfg.package
|
||||||
|
else if versionAtLeast config.home.stateVersion "19.09" then
|
||||||
|
cfg.package.override (old: { cfg = old.cfg or { } // fcfg; })
|
||||||
|
else
|
||||||
|
(pkgs.wrapFirefox.override { config = bcfg; }) cfg.package { };
|
||||||
|
in [ package ];
|
||||||
|
|
||||||
|
home.file = mkMerge ([{
|
||||||
|
"${mozillaConfigPath}/${extensionPath}" = mkIf (cfg.extensions != [ ]) {
|
||||||
|
source = "${extensionsEnvPkg}/share/mozilla/${extensionPath}";
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
"${firefoxConfigPath}/profiles.ini" =
|
||||||
|
mkIf (cfg.profiles != { }) { text = profilesIni; };
|
||||||
|
}] ++ flip mapAttrsToList cfg.profiles (_: profile: {
|
||||||
|
"${profilesPath}/${profile.path}/.keep".text = "";
|
||||||
|
|
||||||
|
"${profilesPath}/${profile.path}/chrome/userChrome.css" =
|
||||||
|
mkIf (profile.userChrome != "") { text = profile.userChrome; };
|
||||||
|
|
||||||
|
"${profilesPath}/${profile.path}/chrome/userContent.css" =
|
||||||
|
mkIf (profile.userContent != "") { text = profile.userContent; };
|
||||||
|
|
||||||
|
"${profilesPath}/${profile.path}/user.js" =
|
||||||
|
mkIf (profile.settings != { } || profile.extraConfig != "") {
|
||||||
|
text = mkUserJs profile.settings profile.extraConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
# A bit of hackery to force a config into the wrapper.
|
"${profilesPath}/${profile.path}/extensions" =
|
||||||
browserName = cfg.package.browserName
|
mkIf (cfg.extensions != [ ]) {
|
||||||
or (builtins.parseDrvName cfg.package.name).name;
|
|
||||||
|
|
||||||
# The configuration expected by the Firefox wrapper builder.
|
|
||||||
bcfg = setAttrByPath [browserName] fcfg;
|
|
||||||
|
|
||||||
package =
|
|
||||||
if isDarwin then
|
|
||||||
cfg.package
|
|
||||||
else if versionAtLeast config.home.stateVersion "19.09" then
|
|
||||||
cfg.package.override (old: { cfg = old.cfg or {} // fcfg; })
|
|
||||||
else
|
|
||||||
(pkgs.wrapFirefox.override { config = bcfg; }) cfg.package { };
|
|
||||||
in
|
|
||||||
[ package ];
|
|
||||||
|
|
||||||
home.file = mkMerge (
|
|
||||||
[{
|
|
||||||
"${mozillaConfigPath}/${extensionPath}" = mkIf (cfg.extensions != []) {
|
|
||||||
source = "${extensionsEnvPkg}/share/mozilla/${extensionPath}";
|
|
||||||
recursive = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
"${firefoxConfigPath}/profiles.ini" = mkIf (cfg.profiles != {}) {
|
|
||||||
text = profilesIni;
|
|
||||||
};
|
|
||||||
}]
|
|
||||||
++ flip mapAttrsToList cfg.profiles (_: profile: {
|
|
||||||
"${profilesPath}/${profile.path}/.keep".text = "";
|
|
||||||
|
|
||||||
"${profilesPath}/${profile.path}/chrome/userChrome.css" =
|
|
||||||
mkIf (profile.userChrome != "") {
|
|
||||||
text = profile.userChrome;
|
|
||||||
};
|
|
||||||
|
|
||||||
"${profilesPath}/${profile.path}/chrome/userContent.css" =
|
|
||||||
mkIf (profile.userContent != "") {
|
|
||||||
text = profile.userContent;
|
|
||||||
};
|
|
||||||
|
|
||||||
"${profilesPath}/${profile.path}/user.js" =
|
|
||||||
mkIf (profile.settings != {} || profile.extraConfig != "") {
|
|
||||||
text = mkUserJs profile.settings profile.extraConfig;
|
|
||||||
};
|
|
||||||
|
|
||||||
"${profilesPath}/${profile.path}/extensions" = mkIf (cfg.extensions != []) {
|
|
||||||
source = "${extensionsEnvPkg}/share/mozilla/${extensionPath}";
|
source = "${extensionsEnvPkg}/share/mozilla/${extensionPath}";
|
||||||
recursive = true;
|
recursive = true;
|
||||||
force = true;
|
force = true;
|
||||||
};
|
};
|
||||||
})
|
}));
|
||||||
);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions =
|
||||||
|
[ (hm.assertions.assertPlatform "programs.foot" pkgs platforms.linux) ];
|
||||||
|
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
xdg.configFile."foot/foot.ini" = mkIf (cfg.settings != { }) {
|
xdg.configFile."foot/foot.ini" = mkIf (cfg.settings != { }) {
|
||||||
|
|||||||
@@ -148,20 +148,20 @@ in {
|
|||||||
|
|
||||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
|
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
|
||||||
if [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then
|
if [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then
|
||||||
. ${pkgs.fzf}/share/fzf/completion.bash
|
. ${cfg.package}/share/fzf/completion.bash
|
||||||
. ${pkgs.fzf}/share/fzf/key-bindings.bash
|
. ${cfg.package}/share/fzf/key-bindings.bash
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
|
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
|
||||||
if [[ $options[zle] = on ]]; then
|
if [[ $options[zle] = on ]]; then
|
||||||
. ${pkgs.fzf}/share/fzf/completion.zsh
|
. ${cfg.package}/share/fzf/completion.zsh
|
||||||
. ${pkgs.fzf}/share/fzf/key-bindings.zsh
|
. ${cfg.package}/share/fzf/key-bindings.zsh
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
|
programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
|
||||||
source ${pkgs.fzf}/share/fzf/key-bindings.fish && fzf_key_bindings
|
source ${cfg.package}/share/fzf/key-bindings.fish && fzf_key_bindings
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,6 +55,10 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf getmailEnabled {
|
config = mkIf getmailEnabled {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "programs.getmail" pkgs platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
home.file = foldl' (a: b: a // b) { }
|
home.file = foldl' (a: b: a // b) { }
|
||||||
(map (a: { "${renderConfigFilepath a}".text = renderAccountConfig a; })
|
(map (a: { "${renderConfigFilepath a}".text = renderAccountConfig a; })
|
||||||
accounts);
|
accounts);
|
||||||
|
|||||||
@@ -187,6 +187,12 @@ let
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
boldIsBright = mkOption {
|
||||||
|
default = null;
|
||||||
|
type = types.nullOr types.bool;
|
||||||
|
description = "Whether bold text is shown in bright colors.";
|
||||||
|
};
|
||||||
|
|
||||||
deleteBinding = mkOption {
|
deleteBinding = mkOption {
|
||||||
default = "delete-sequence";
|
default = "delete-sequence";
|
||||||
type = eraseBinding;
|
type = eraseBinding;
|
||||||
@@ -234,6 +240,12 @@ let
|
|||||||
type = types.bool;
|
type = types.bool;
|
||||||
description = "Turn on/off the terminal's bell.";
|
description = "Turn on/off the terminal's bell.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
transparencyPercent = mkOption {
|
||||||
|
default = null;
|
||||||
|
type = types.nullOr (types.ints.between 0 100);
|
||||||
|
description = "Background transparency in percent.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -241,6 +253,7 @@ let
|
|||||||
{
|
{
|
||||||
audible-bell = pcfg.audibleBell;
|
audible-bell = pcfg.audibleBell;
|
||||||
visible-name = pcfg.visibleName;
|
visible-name = pcfg.visibleName;
|
||||||
|
scroll-on-output = pcfg.scrollOnOutput;
|
||||||
scrollbar-policy = if pcfg.showScrollbar then "always" else "never";
|
scrollbar-policy = if pcfg.showScrollbar then "always" else "never";
|
||||||
scrollback-lines = pcfg.scrollbackLines;
|
scrollback-lines = pcfg.scrollbackLines;
|
||||||
cursor-shape = pcfg.cursorShape;
|
cursor-shape = pcfg.cursorShape;
|
||||||
@@ -273,7 +286,9 @@ let
|
|||||||
} else {
|
} else {
|
||||||
bold-color-same-as-fg = false;
|
bold-color-same-as-fg = false;
|
||||||
bold-color = pcfg.colors.boldColor;
|
bold-color = pcfg.colors.boldColor;
|
||||||
}) // (if (pcfg.colors.cursor != null) then {
|
}) // optionalAttrs (pcfg.boldIsBright != null) {
|
||||||
|
bold-is-bright = pcfg.boldIsBright;
|
||||||
|
} // (if (pcfg.colors.cursor != null) then {
|
||||||
cursor-colors-set = true;
|
cursor-colors-set = true;
|
||||||
cursor-foreground-color = pcfg.colors.cursor.foreground;
|
cursor-foreground-color = pcfg.colors.cursor.foreground;
|
||||||
cursor-background-color = pcfg.colors.cursor.background;
|
cursor-background-color = pcfg.colors.cursor.background;
|
||||||
@@ -285,10 +300,14 @@ let
|
|||||||
highlight-background-color = pcfg.colors.highlight.background;
|
highlight-background-color = pcfg.colors.highlight.background;
|
||||||
} else {
|
} else {
|
||||||
highlight-colors-set = false;
|
highlight-colors-set = false;
|
||||||
})));
|
}) // optionalAttrs (pcfg.transparencyPercent != null) {
|
||||||
|
background-transparency-percent = pcfg.transparencyPercent;
|
||||||
|
use-theme-transparency = false;
|
||||||
|
use-transparent-background = true;
|
||||||
|
}));
|
||||||
|
|
||||||
in {
|
in {
|
||||||
meta.maintainers = [ maintainers.rycee ];
|
meta.maintainers = with maintainers; [ kamadorueda rycee ];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
programs.gnome-terminal = {
|
programs.gnome-terminal = {
|
||||||
@@ -315,7 +334,7 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ pkgs.gnome3.gnome-terminal ];
|
home.packages = [ pkgs.gnome.gnome-terminal ];
|
||||||
|
|
||||||
dconf.settings = let dconfPath = "org/gnome/terminal/legacy";
|
dconf.settings = let dconfPath = "org/gnome/terminal/legacy";
|
||||||
in {
|
in {
|
||||||
|
|||||||
100
modules/programs/himalaya.nix
Normal file
100
modules/programs/himalaya.nix
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.programs.himalaya;
|
||||||
|
|
||||||
|
enabledAccounts =
|
||||||
|
lib.filterAttrs (_: a: a.himalaya.enable) (config.accounts.email.accounts);
|
||||||
|
|
||||||
|
tomlFormat = pkgs.formats.toml { };
|
||||||
|
|
||||||
|
himalayaConfig = let
|
||||||
|
toHimalayaConfig = account:
|
||||||
|
{
|
||||||
|
email = account.address;
|
||||||
|
name = account.realName;
|
||||||
|
default = account.primary;
|
||||||
|
|
||||||
|
# FIXME: does not support disabling TLS altogether
|
||||||
|
# NOTE: does not accept sequence of strings for password commands
|
||||||
|
imap-login = account.userName;
|
||||||
|
imap-passwd-cmd = lib.escapeShellArgs account.passwordCommand;
|
||||||
|
imap-host = account.imap.host;
|
||||||
|
imap-port = account.imap.port;
|
||||||
|
imap-starttls = account.imap.tls.useStartTls;
|
||||||
|
|
||||||
|
smtp-login = account.userName;
|
||||||
|
smtp-passwd-cmd = lib.escapeShellArgs account.passwordCommand;
|
||||||
|
smtp-host = account.smtp.host;
|
||||||
|
smtp-port = account.smtp.port;
|
||||||
|
smtp-starttls = account.imap.tls.useStartTls;
|
||||||
|
} // (lib.optionalAttrs (account.signature.showSignature == "append") {
|
||||||
|
# FIXME: signature cannot be attached
|
||||||
|
signature = account.signature.text;
|
||||||
|
}) // account.himalaya.settings;
|
||||||
|
in {
|
||||||
|
# NOTE: will not start without this configured, but each account overrides it
|
||||||
|
name = "";
|
||||||
|
} // cfg.settings // (lib.mapAttrs (_: toHimalayaConfig) enabledAccounts);
|
||||||
|
in {
|
||||||
|
meta.maintainers = with lib.hm.maintainers; [ ambroisie ];
|
||||||
|
|
||||||
|
options = with lib; {
|
||||||
|
programs.himalaya = {
|
||||||
|
enable = mkEnableOption "himalaya mail client";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.himalaya;
|
||||||
|
defaultText = literalExample "pkgs.himalaya";
|
||||||
|
description = ''
|
||||||
|
Package providing the <command>himalaya</command> mail client.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = tomlFormat.type;
|
||||||
|
default = { };
|
||||||
|
example = lib.literalExample ''
|
||||||
|
{
|
||||||
|
default-page-size = 50;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Global <command>himalaya</command> configuration values.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
accounts.email.accounts = mkOption {
|
||||||
|
type = with types;
|
||||||
|
attrsOf (submodule {
|
||||||
|
options.himalaya = {
|
||||||
|
enable = mkEnableOption ''
|
||||||
|
the himalaya mail client for this account
|
||||||
|
'';
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = tomlFormat.type;
|
||||||
|
default = { };
|
||||||
|
example = lib.literalExample ''
|
||||||
|
{
|
||||||
|
default-page-size = 50;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Extra settings to add to this <command>himalaya</command>
|
||||||
|
account configuration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
|
xdg.configFile."himalaya/config.toml".source =
|
||||||
|
tomlFormat.generate "himalaya-config.toml" himalayaConfig;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -10,10 +10,14 @@ let
|
|||||||
let v' = if isBool v then (if v then "1" else "0") else toString v;
|
let v' = if isBool v then (if v then "1" else "0") else toString v;
|
||||||
in "${n}=${v'}";
|
in "${n}=${v'}";
|
||||||
|
|
||||||
formatMeters = side: meters: {
|
formatMeters = side: meters:
|
||||||
"${side}_meters" = mapAttrsToList (x: _: x) meters;
|
let
|
||||||
"${side}_meter_modes" = mapAttrsToList (_: y: y) meters;
|
warn' = warn "htop: meters should be passed as a list";
|
||||||
};
|
meters' = if isList meters then meters else warn' [ meters ];
|
||||||
|
in {
|
||||||
|
"${side}_meters" = concatMap (mapAttrsToList (x: _: x)) meters';
|
||||||
|
"${side}_meter_modes" = concatMap (mapAttrsToList (_: y: y)) meters';
|
||||||
|
};
|
||||||
leftMeters = formatMeters "left";
|
leftMeters = formatMeters "left";
|
||||||
rightMeters = formatMeters "right";
|
rightMeters = formatMeters "right";
|
||||||
|
|
||||||
@@ -80,6 +84,14 @@ let
|
|||||||
LED = 4;
|
LED = 4;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Utilities for constructing meters
|
||||||
|
meter = mode: name: { ${name} = mode; };
|
||||||
|
bar = meter modes.Bar;
|
||||||
|
text = meter modes.Text;
|
||||||
|
graph = meter modes.Graph;
|
||||||
|
led = meter modes.LED;
|
||||||
|
blank = text "Blank";
|
||||||
|
|
||||||
# Mapping from names to defaults
|
# Mapping from names to defaults
|
||||||
meters = {
|
meters = {
|
||||||
Clock = 2;
|
Clock = 2;
|
||||||
@@ -231,15 +243,17 @@ in {
|
|||||||
tree_view = false;
|
tree_view = false;
|
||||||
update_process_names = false;
|
update_process_names = false;
|
||||||
vim_mode = false;
|
vim_mode = false;
|
||||||
} // (leftMeters {
|
} // (leftMeters [
|
||||||
AllCPUs = modes.Bar;
|
(bar "AllCPUs2")
|
||||||
Memory = modes.Bar;
|
(bar "Memory")
|
||||||
Swap = modes.Bar;
|
(bar "Swap")
|
||||||
}) // (rightMeters {
|
(text "Zram")
|
||||||
Tasks = modes.Text;
|
]) // (rightMeters [
|
||||||
LoadAverage = modes.Text;
|
(text "Tasks")
|
||||||
Uptime = modes.Text;
|
(text "LoadAverage")
|
||||||
});
|
(text "Uptime")
|
||||||
|
(text "Systemd")
|
||||||
|
]);
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
{
|
{
|
||||||
color_scheme = 6;
|
color_scheme = 6;
|
||||||
@@ -262,17 +276,17 @@ in {
|
|||||||
highlight_base_name = 1;
|
highlight_base_name = 1;
|
||||||
highlight_megabytes = 1;
|
highlight_megabytes = 1;
|
||||||
highlight_threads = 1;
|
highlight_threads = 1;
|
||||||
} // (with config.lib.htop; leftMeters {
|
} // (with config.lib.htop; leftMeters [
|
||||||
AllCPUs2 = modes.Bar;
|
(bar "AllCPUs2")
|
||||||
Memory = modes.Bar;
|
(bar "Memory")
|
||||||
Swap = modes.Bar;
|
(bar "Swap")
|
||||||
Zram = modes.Text;
|
(text "Zram")
|
||||||
}) // (with config.lib.htop; rightMeters {
|
]) // (with config.lib.htop; rightMeters [
|
||||||
Tasks = modes.Text;
|
(text "Tasks")
|
||||||
LoadAverage = modes.Text;
|
(text "LoadAverage")
|
||||||
Uptime = modes.Text;
|
(text "Uptime")
|
||||||
Systemd = modes.Text;
|
(text "Systemd")
|
||||||
})
|
]);
|
||||||
'';
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
Configuration options to add to
|
Configuration options to add to
|
||||||
@@ -576,7 +590,9 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
lib.htop = { inherit fields modes leftMeters rightMeters; };
|
lib.htop = {
|
||||||
|
inherit fields modes leftMeters rightMeters bar text graph led blank;
|
||||||
|
};
|
||||||
|
|
||||||
home.packages = [ pkgs.htop ];
|
home.packages = [ pkgs.htop ];
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ in {
|
|||||||
{
|
{
|
||||||
block = "memory";
|
block = "memory";
|
||||||
display_type = "memory";
|
display_type = "memory";
|
||||||
format_mem = "{Mup}%";
|
format_mem = "{mem_used_percents}";
|
||||||
format_swap = "{SUp}%";
|
format_swap = "{swap_used_percents}";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
block = "cpu";
|
block = "cpu";
|
||||||
@@ -205,8 +205,8 @@ in {
|
|||||||
{
|
{
|
||||||
block = "memory";
|
block = "memory";
|
||||||
display_type = "memory";
|
display_type = "memory";
|
||||||
format_mem = "{Mup}%";
|
format_mem = "{mem_used_percents}";
|
||||||
format_swap = "{SUp}%";
|
format_swap = "{swap_used_percents}";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
block = "cpu";
|
block = "cpu";
|
||||||
@@ -249,6 +249,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "programs.i3status-rust" pkgs
|
||||||
|
platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
xdg.configFile = mapAttrs' (cfgFileSuffix: cfg:
|
xdg.configFile = mapAttrs' (cfgFileSuffix: cfg:
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ let
|
|||||||
use_ssl = "${boolStr v.server.ssl.enable}";
|
use_ssl = "${boolStr v.server.ssl.enable}";
|
||||||
ssl_verify = "${boolStr v.server.ssl.verify}";
|
ssl_verify = "${boolStr v.server.ssl.verify}";
|
||||||
autoconnect = "${boolStr v.server.autoConnect}";
|
autoconnect = "${boolStr v.server.autoConnect}";
|
||||||
|
${lib.optionalString (v.server.ssl.certificateFile != null) ''
|
||||||
|
ssl_cert = "${v.server.ssl.certificateFile}";
|
||||||
|
''}
|
||||||
}
|
}
|
||||||
''));
|
''));
|
||||||
|
|
||||||
@@ -118,6 +121,15 @@ let
|
|||||||
default = true;
|
default = true;
|
||||||
description = "Whether the SSL certificate should be verified.";
|
description = "Whether the SSL certificate should be verified.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
certificateFile = mkOption {
|
||||||
|
type = types.nullOr types.path;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Path to a file containing the certificate used for
|
||||||
|
client authentication to the server.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
autoConnect = mkOption {
|
autoConnect = mkOption {
|
||||||
|
|||||||
@@ -30,6 +30,13 @@ in {
|
|||||||
programs.jq = {
|
programs.jq = {
|
||||||
enable = mkEnableOption "the jq command-line JSON processor";
|
enable = mkEnableOption "the jq command-line JSON processor";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.jq;
|
||||||
|
defaultText = literalExample "pkgs.jq";
|
||||||
|
description = "jq package to use.";
|
||||||
|
};
|
||||||
|
|
||||||
colors = mkOption {
|
colors = mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
The colors used in colored JSON output.</para>
|
The colors used in colored JSON output.</para>
|
||||||
@@ -65,7 +72,7 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ pkgs.jq ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
home.sessionVariables = let c = cfg.colors;
|
home.sessionVariables = let c = cfg.colors;
|
||||||
in {
|
in {
|
||||||
|
|||||||
106
modules/programs/mangohud.nix
Normal file
106
modules/programs/mangohud.nix
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.programs.mangohud;
|
||||||
|
|
||||||
|
settingsType = with types;
|
||||||
|
(oneOf [ bool int float str path (listOf (oneOf [ int str ])) ]);
|
||||||
|
|
||||||
|
renderOption = option:
|
||||||
|
rec {
|
||||||
|
int = toString option;
|
||||||
|
float = int;
|
||||||
|
path = int;
|
||||||
|
bool = "false";
|
||||||
|
string = option;
|
||||||
|
list = concatStringsSep "," (lists.forEach option (x: toString x));
|
||||||
|
}.${builtins.typeOf option};
|
||||||
|
|
||||||
|
renderLine = k: v: (if isBool v && v then k else "${k}=${renderOption v}");
|
||||||
|
renderSettings = attrs:
|
||||||
|
strings.concatStringsSep "\n" (attrsets.mapAttrsToList renderLine attrs)
|
||||||
|
+ "\n";
|
||||||
|
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
programs.mangohud = {
|
||||||
|
enable = mkEnableOption "Mangohud";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.mangohud;
|
||||||
|
defaultText = literalExample "pkgs.mangohud";
|
||||||
|
description = "The Mangohud package to install.";
|
||||||
|
};
|
||||||
|
|
||||||
|
enableSessionWide = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Sets environment variables so that
|
||||||
|
MangoHud is started on any application that supports it.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = with types; attrsOf settingsType;
|
||||||
|
default = { };
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
output_folder = ~/Documents/mangohud/;
|
||||||
|
full = true;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Configuration written to
|
||||||
|
<filename>~/.config/MangoHud/MangoHud.conf</filename>. See
|
||||||
|
<link xlink:href="https://github.com/flightlessmango/MangoHud/blob/master/bin/MangoHud.conf"/>
|
||||||
|
for the default configuration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
settingsPerApplication = mkOption {
|
||||||
|
type = with types; attrsOf (attrsOf settingsType);
|
||||||
|
default = { };
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
mpv = {
|
||||||
|
no_display = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Sets MangoHud settings per application.
|
||||||
|
Configuration written to
|
||||||
|
<filename>~/.config/MangoHud/{application_name}.conf</filename>. See
|
||||||
|
<link xlink:href="https://github.com/flightlessmango/MangoHud/blob/master/bin/MangoHud.conf"/>
|
||||||
|
for the default configuration.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "programs.mangohud" pkgs platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
|
home.sessionVariables = mkIf cfg.enableSessionWide {
|
||||||
|
MANGOHUD = 1;
|
||||||
|
MANGOHUD_DLSYM = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile = {
|
||||||
|
"MangoHud/MangoHud.conf" =
|
||||||
|
mkIf (cfg.settings != { }) { text = renderSettings cfg.settings; };
|
||||||
|
} // mapAttrs'
|
||||||
|
(n: v: nameValuePair "MangoHud/${n}.conf" { text = renderSettings v; })
|
||||||
|
cfg.settingsPerApplication;
|
||||||
|
};
|
||||||
|
|
||||||
|
meta.maintainers = with maintainers; [ zeratax ];
|
||||||
|
}
|
||||||
@@ -6,6 +6,8 @@ let
|
|||||||
|
|
||||||
cfg = config.programs.neovim;
|
cfg = config.programs.neovim;
|
||||||
|
|
||||||
|
jsonFormat = pkgs.formats.json { };
|
||||||
|
|
||||||
extraPython3PackageType = mkOptionType {
|
extraPython3PackageType = mkOptionType {
|
||||||
name = "extra-python3-packages";
|
name = "extra-python3-packages";
|
||||||
description = "python3 packages in python.withPackages format";
|
description = "python3 packages in python.withPackages format";
|
||||||
@@ -51,8 +53,7 @@ let
|
|||||||
(map (x: if x ? plugin && x.optional == true then x.plugin else null)
|
(map (x: if x ? plugin && x.optional == true then x.plugin else null)
|
||||||
cfg.plugins);
|
cfg.plugins);
|
||||||
};
|
};
|
||||||
customRC = cfg.extraConfig
|
beforePlugins = "";
|
||||||
+ pkgs.lib.concatMapStrings pluginConfig cfg.plugins;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extraMakeWrapperArgs = lib.optionalString (cfg.extraPackages != [ ])
|
extraMakeWrapperArgs = lib.optionalString (cfg.extraPackages != [ ])
|
||||||
@@ -218,6 +219,44 @@ in {
|
|||||||
This option is mutually exclusive with <varname>configure</varname>.
|
This option is mutually exclusive with <varname>configure</varname>.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
coc = {
|
||||||
|
enable = mkEnableOption "Coc";
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = jsonFormat.type;
|
||||||
|
default = { };
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
"suggest.noselect" = true;
|
||||||
|
"suggest.enablePreview" = true;
|
||||||
|
"suggest.enablePreselect" = false;
|
||||||
|
"suggest.disableKind" = true;
|
||||||
|
languageserver = {
|
||||||
|
haskell = {
|
||||||
|
command = "haskell-language-server-wrapper";
|
||||||
|
args = [ "--lsp" ];
|
||||||
|
rootPatterns = [
|
||||||
|
"*.cabal"
|
||||||
|
"stack.yaml"
|
||||||
|
"cabal.project"
|
||||||
|
"package.yaml"
|
||||||
|
"hie.yaml"
|
||||||
|
];
|
||||||
|
filetypes = [ "haskell" "lhaskell" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Extra configuration lines to add to
|
||||||
|
<filename>$XDG_CONFIG_HOME/nvim/coc-settings.json</filename>
|
||||||
|
See
|
||||||
|
<link xlink:href="https://github.com/neoclide/coc.nvim/wiki/Using-the-configuration-file" />
|
||||||
|
for options.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -226,7 +265,8 @@ in {
|
|||||||
inherit (cfg)
|
inherit (cfg)
|
||||||
extraPython3Packages withPython3 withNodeJs withRuby viAlias vimAlias;
|
extraPython3Packages withPython3 withNodeJs withRuby viAlias vimAlias;
|
||||||
configure = cfg.configure // moduleConfigure;
|
configure = cfg.configure // moduleConfigure;
|
||||||
plugins = cfg.plugins;
|
plugins = cfg.plugins
|
||||||
|
++ optionals cfg.coc.enable [ pkgs.vimPlugins.coc-nvim ];
|
||||||
customRC = cfg.extraConfig;
|
customRC = cfg.extraConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -242,11 +282,18 @@ in {
|
|||||||
|
|
||||||
home.packages = [ cfg.finalPackage ];
|
home.packages = [ cfg.finalPackage ];
|
||||||
|
|
||||||
xdg.configFile."nvim/init.vim".text = neovimConfig.neovimRcContent;
|
xdg.configFile."nvim/init.vim" = mkIf (neovimConfig.neovimRcContent != "") {
|
||||||
|
text = neovimConfig.neovimRcContent;
|
||||||
|
};
|
||||||
|
xdg.configFile."nvim/coc-settings.json" = mkIf cfg.coc.enable {
|
||||||
|
source = jsonFormat.generate "coc-settings.json" cfg.coc.settings;
|
||||||
|
};
|
||||||
|
|
||||||
programs.neovim.finalPackage = pkgs.wrapNeovimUnstable cfg.package
|
programs.neovim.finalPackage = pkgs.wrapNeovimUnstable cfg.package
|
||||||
(neovimConfig // {
|
(neovimConfig // {
|
||||||
wrapperArgs = (lib.escapeShellArgs neovimConfig.wrapperArgs) + " "
|
wrapperArgs = (lib.escapeShellArgs neovimConfig.wrapperArgs) + " "
|
||||||
+ extraMakeWrapperArgs;
|
+ extraMakeWrapperArgs;
|
||||||
|
wrapRc = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
programs.bash.shellAliases = mkIf cfg.vimdiffAlias { vimdiff = "nvim -d"; };
|
programs.bash.shellAliases = mkIf cfg.vimdiffAlias { vimdiff = "nvim -d"; };
|
||||||
|
|||||||
@@ -6,21 +6,6 @@ let
|
|||||||
|
|
||||||
cfg = config.programs.obs-studio;
|
cfg = config.programs.obs-studio;
|
||||||
|
|
||||||
mkPluginEnv = packages:
|
|
||||||
let
|
|
||||||
pluginDirs = map (pkg: "${pkg}/share/obs/obs-plugins") packages;
|
|
||||||
plugins = concatMapStringsSep " " (p: "${p}/*") pluginDirs;
|
|
||||||
in pkgs.runCommand "obs-studio-plugins" {
|
|
||||||
preferLocalBuild = true;
|
|
||||||
allowSubstitutes = false;
|
|
||||||
} ''
|
|
||||||
mkdir $out
|
|
||||||
[[ '${plugins}' ]] || exit 0
|
|
||||||
for plugin in ${plugins}; do
|
|
||||||
ln -s "$plugin" $out/
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
meta.maintainers = [ maintainers.adisbladis ];
|
meta.maintainers = [ maintainers.adisbladis ];
|
||||||
|
|
||||||
@@ -37,9 +22,16 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
finalPackage = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
visible = false;
|
||||||
|
readOnly = true;
|
||||||
|
description = "Resulting customized OBS Studio package.";
|
||||||
|
};
|
||||||
|
|
||||||
plugins = mkOption {
|
plugins = mkOption {
|
||||||
default = [ ];
|
default = [ ];
|
||||||
example = literalExample "[ pkgs.obs-linuxbrowser ]";
|
example = literalExample "[ pkgs.obs-studio-plugins.wlrobs ]";
|
||||||
description = "Optional OBS plugins.";
|
description = "Optional OBS plugins.";
|
||||||
type = types.listOf types.package;
|
type = types.listOf types.package;
|
||||||
};
|
};
|
||||||
@@ -47,9 +39,10 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.finalPackage ];
|
||||||
|
programs.obs-studio.finalPackage =
|
||||||
xdg.configFile."obs-studio/plugins" =
|
pkgs.wrapOBS.override { obs-studio = cfg.package; } {
|
||||||
mkIf (cfg.plugins != [ ]) { source = mkPluginEnv cfg.plugins; };
|
plugins = cfg.plugins;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,5 +58,8 @@ in {
|
|||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
home.sessionVariables = cfg.settings;
|
home.sessionVariables = cfg.settings;
|
||||||
|
|
||||||
|
xsession.importedVariables = mkIf config.xsession.enable
|
||||||
|
(mapAttrsToList (name: value: name) cfg.settings);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
46
modules/programs/piston-cli.nix
Normal file
46
modules/programs/piston-cli.nix
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.programs.piston-cli;
|
||||||
|
yamlFormat = pkgs.formats.yaml { };
|
||||||
|
in {
|
||||||
|
meta.maintainers = with maintainers; [ ethancedwards8 ];
|
||||||
|
|
||||||
|
options.programs.piston-cli = {
|
||||||
|
enable = mkEnableOption "piston-cli, code runner";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.piston-cli;
|
||||||
|
defaultText = literalExample "pkgs.piston-cli";
|
||||||
|
description = "The piston-cli package to use.";
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = yamlFormat.type;
|
||||||
|
default = { };
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
theme = "emacs";
|
||||||
|
box_style = "MINIMAL_DOUBLE_HEAD";
|
||||||
|
prompt_continuation = "...";
|
||||||
|
prompt_start = ">>>";
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Configuration written to
|
||||||
|
<filename>$XDG_CONFIG_HOME/piston-cli/config.yml</filename>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
|
xdg.configFile."piston-cli/config.yml" = mkIf (cfg.settings != { }) {
|
||||||
|
source = yamlFormat.generate "config.yml" cfg.settings;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -32,6 +32,8 @@ let
|
|||||||
''config.bind("${k}", "${escape [ ''"'' ] c}", mode="${m}")'';
|
''config.bind("${k}", "${escape [ ''"'' ] c}", mode="${m}")'';
|
||||||
in concatStringsSep "\n" (mapAttrsToList (formatKeyBinding m) b);
|
in concatStringsSep "\n" (mapAttrsToList (formatKeyBinding m) b);
|
||||||
|
|
||||||
|
formatQuickmarks = n: s: "${n} ${s}";
|
||||||
|
|
||||||
in {
|
in {
|
||||||
options.programs.qutebrowser = {
|
options.programs.qutebrowser = {
|
||||||
enable = mkEnableOption "qutebrowser";
|
enable = mkEnableOption "qutebrowser";
|
||||||
@@ -251,6 +253,21 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
quickmarks = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
default = { };
|
||||||
|
description = ''
|
||||||
|
Quickmarks to add to qutebrowser's <filename>quickmarks</filename> file.
|
||||||
|
Note that when Home Manager manages your quickmarks, you cannot edit them at runtime.
|
||||||
|
'';
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
nixpkgs = "https://github.com/NixOS/nixpkgs";
|
||||||
|
home-manager = "https://github.com/nix-community/home-manager";
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
extraConfig = mkOption {
|
extraConfig = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
@@ -274,13 +291,44 @@ in {
|
|||||||
++ optional (!cfg.enableDefaultBindings) "c.bindings.default = {}"
|
++ optional (!cfg.enableDefaultBindings) "c.bindings.default = {}"
|
||||||
++ mapAttrsToList formatKeyBindings cfg.keyBindings
|
++ mapAttrsToList formatKeyBindings cfg.keyBindings
|
||||||
++ optional (cfg.extraConfig != "") cfg.extraConfig);
|
++ optional (cfg.extraConfig != "") cfg.extraConfig);
|
||||||
|
|
||||||
|
quickmarksFile = optionals (cfg.quickmarks != { }) concatStringsSep "\n"
|
||||||
|
((mapAttrsToList formatQuickmarks cfg.quickmarks));
|
||||||
in mkIf cfg.enable {
|
in mkIf cfg.enable {
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
home.file.".qutebrowser/config.py" =
|
home.file.".qutebrowser/config.py" =
|
||||||
mkIf pkgs.stdenv.hostPlatform.isDarwin { text = qutebrowserConfig; };
|
mkIf pkgs.stdenv.hostPlatform.isDarwin { text = qutebrowserConfig; };
|
||||||
|
|
||||||
|
home.file.".qutebrowser/quickmarks" =
|
||||||
|
mkIf (cfg.quickmarks != { } && pkgs.stdenv.hostPlatform.isDarwin) {
|
||||||
|
text = quickmarksFile;
|
||||||
|
};
|
||||||
|
|
||||||
xdg.configFile."qutebrowser/config.py" =
|
xdg.configFile."qutebrowser/config.py" =
|
||||||
mkIf pkgs.stdenv.hostPlatform.isLinux { text = qutebrowserConfig; };
|
mkIf pkgs.stdenv.hostPlatform.isLinux {
|
||||||
|
text = qutebrowserConfig;
|
||||||
|
onChange = ''
|
||||||
|
hash="$(echo -n $USER | md5sum | cut -d' ' -f1)"
|
||||||
|
socket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/qutebrowser/ipc-$hash"
|
||||||
|
if [ -S $socket ]; then
|
||||||
|
echo "Reloading qutebrowser"
|
||||||
|
command=${
|
||||||
|
escapeShellArg (builtins.toJSON {
|
||||||
|
args = [ ":config-source" ];
|
||||||
|
target_arg = null;
|
||||||
|
protocol_version = 1;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
$DRY_RUN_CMD echo $command | ${pkgs.socat}/bin/socat -lf /dev/null - UNIX-CONNECT:$socket
|
||||||
|
fi
|
||||||
|
unset hash socket command
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile."qutebrowser/quickmarks" =
|
||||||
|
mkIf (cfg.quickmarks != { } && pkgs.stdenv.hostPlatform.isLinux) {
|
||||||
|
text = quickmarksFile;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
116
modules/programs/rbw.nix
Normal file
116
modules/programs/rbw.nix
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.programs.rbw;
|
||||||
|
|
||||||
|
jsonFormat = pkgs.formats.json { };
|
||||||
|
|
||||||
|
inherit (pkgs.stdenv.hostPlatform) isDarwin;
|
||||||
|
|
||||||
|
settingsModule = with lib;
|
||||||
|
types.submodule {
|
||||||
|
freeformType = jsonFormat.type;
|
||||||
|
options = {
|
||||||
|
email = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
example = "name@example.com";
|
||||||
|
description = "The email address for your bitwarden account.";
|
||||||
|
};
|
||||||
|
|
||||||
|
base_url = mkOption {
|
||||||
|
type = with types; nullOr str;
|
||||||
|
default = null;
|
||||||
|
example = "bitwarden.example.com";
|
||||||
|
description =
|
||||||
|
"The base-url for a self-hosted bitwarden installation.";
|
||||||
|
};
|
||||||
|
|
||||||
|
identity_url = mkOption {
|
||||||
|
type = with types; nullOr str;
|
||||||
|
default = null;
|
||||||
|
example = "identity.example.com";
|
||||||
|
description = "The identity url for your bitwarden installation.";
|
||||||
|
};
|
||||||
|
|
||||||
|
lock_timeout = mkOption {
|
||||||
|
type = types.ints.unsigned;
|
||||||
|
default = 3600;
|
||||||
|
example = 300;
|
||||||
|
description = ''
|
||||||
|
The amount of time that your login information should be cached.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
pinentry = mkOption {
|
||||||
|
type = with types; either package (enum pkgs.pinentry.flavors);
|
||||||
|
example = "gnome3";
|
||||||
|
default = "gtk2";
|
||||||
|
description = ''
|
||||||
|
Which pinentry interface to use. Beware that
|
||||||
|
<literal>pinentry-gnome3</literal> may not work on non-Gnome
|
||||||
|
systems. You can fix it by adding the following to your
|
||||||
|
system configuration:
|
||||||
|
<programlisting language="nix">
|
||||||
|
services.dbus.packages = [ pkgs.gcr ];
|
||||||
|
</programlisting>
|
||||||
|
For this reason, the default is <literal>gtk2</literal> for
|
||||||
|
now.
|
||||||
|
'';
|
||||||
|
# we want the program in the config
|
||||||
|
apply = val:
|
||||||
|
if builtins.isString val then
|
||||||
|
"${pkgs.pinentry.${val}}/bin/pinentry"
|
||||||
|
else
|
||||||
|
"${val}/${val.binaryPath or "bin/pinentry"}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
meta.maintainers = with lib.hm.maintainers; [ ambroisie ];
|
||||||
|
|
||||||
|
options.programs.rbw = with lib; {
|
||||||
|
enable = mkEnableOption "rwb, a CLI Bitwarden client";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.rbw;
|
||||||
|
defaultText = literalExample "pkgs.rbw";
|
||||||
|
description = ''
|
||||||
|
Package providing the <command>rbw</command> tool and its
|
||||||
|
<command>rbw-agent</command> daemon.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = types.nullOr settingsModule;
|
||||||
|
default = null;
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
email = "name@example.com";
|
||||||
|
lock_timeout = 300;
|
||||||
|
pinentry = "gnome3";
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
rbw configuration, if not defined the configuration will not be
|
||||||
|
managed by Home Manager.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||||
|
{
|
||||||
|
home.packages = [ cfg.package ];
|
||||||
|
}
|
||||||
|
|
||||||
|
# Only manage configuration if not empty
|
||||||
|
(lib.mkIf (cfg.settings != null && !isDarwin) {
|
||||||
|
xdg.configFile."rbw/config.json".source =
|
||||||
|
jsonFormat.generate "rbw-config.json" cfg.settings;
|
||||||
|
})
|
||||||
|
|
||||||
|
(lib.mkIf (cfg.settings != null && isDarwin) {
|
||||||
|
home.file."Library/Application Support/rbw/config.json".source =
|
||||||
|
jsonFormat.generate "rbw-config.json" cfg.settings;
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
||||||
@@ -207,6 +207,15 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugins = mkOption {
|
||||||
|
default = [ ];
|
||||||
|
type = types.listOf types.package;
|
||||||
|
description = ''
|
||||||
|
List of rofi plugins to be installed.
|
||||||
|
'';
|
||||||
|
example = literalExample "[ pkgs.rofi-calc ]";
|
||||||
|
};
|
||||||
|
|
||||||
width = mkOption {
|
width = mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
type = types.nullOr types.int;
|
type = types.nullOr types.int;
|
||||||
@@ -261,7 +270,7 @@ in {
|
|||||||
description = ''
|
description = ''
|
||||||
Path to the terminal which will be used to run console applications
|
Path to the terminal which will be used to run console applications
|
||||||
'';
|
'';
|
||||||
example = "\${pkgs.gnome3.gnome_terminal}/bin/gnome-terminal";
|
example = "\${pkgs.gnome.gnome_terminal}/bin/gnome-terminal";
|
||||||
};
|
};
|
||||||
|
|
||||||
separator = mkOption {
|
separator = mkOption {
|
||||||
@@ -393,19 +402,29 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
assertions = [{
|
assertions = [
|
||||||
assertion = cfg.theme == null || cfg.colors == null;
|
(hm.assertions.assertPlatform "programs.rofi" pkgs platforms.linux)
|
||||||
message = ''
|
{
|
||||||
Cannot use the rofi options 'theme' and 'colors' simultaneously.
|
assertion = cfg.theme == null || cfg.colors == null;
|
||||||
'';
|
message = ''
|
||||||
}];
|
Cannot use the rofi options 'theme' and 'colors' simultaneously.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
lib.formats.rasi.mkLiteral = value: {
|
lib.formats.rasi.mkLiteral = value: {
|
||||||
_type = "literal";
|
_type = "literal";
|
||||||
inherit value;
|
inherit value;
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = [ cfg.package ];
|
home.packages = let
|
||||||
|
rofiWithPlugins = cfg.package.override
|
||||||
|
(old: rec { plugins = (old.plugins or [ ]) ++ cfg.plugins; });
|
||||||
|
rofiPackage = if builtins.hasAttr "override" cfg.package then
|
||||||
|
rofiWithPlugins
|
||||||
|
else
|
||||||
|
cfg.package;
|
||||||
|
in [ rofiPackage ];
|
||||||
|
|
||||||
home.file."${cfg.configPath}".text = toRasi {
|
home.file."${cfg.configPath}".text = toRasi {
|
||||||
configuration = ({
|
configuration = ({
|
||||||
|
|||||||
73
modules/programs/senpai.nix
Normal file
73
modules/programs/senpai.nix
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.programs.senpai;
|
||||||
|
cfgFmt = pkgs.formats.yaml { };
|
||||||
|
in {
|
||||||
|
options.programs.senpai = {
|
||||||
|
enable = mkEnableOption "senpai";
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.senpai;
|
||||||
|
defaultText = literalExample "pkgs.senpai";
|
||||||
|
description = "The <literal>senpai</literal> package to use.";
|
||||||
|
};
|
||||||
|
config = mkOption {
|
||||||
|
type = types.submodule {
|
||||||
|
freeformType = cfgFmt.type;
|
||||||
|
options = {
|
||||||
|
addr = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
The address (host[:port]) of the IRC server. senpai uses TLS
|
||||||
|
connections by default unless you specify no-tls option. TLS
|
||||||
|
connections default to port 6697, plain-text use port 6667.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
nick = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
Your nickname, sent with a NICK IRC message. It mustn't contain
|
||||||
|
spaces or colons (:).
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
password = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Your password, used for SASL authentication. Note that it will
|
||||||
|
reside world-readable in the Nix store.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
no-tls = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Disables TLS encryption.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
addr = "libera.chat:6697";
|
||||||
|
nick = "nicholas";
|
||||||
|
password = "verysecurepassword";
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Configuration for senpai. For a complete list of options, see
|
||||||
|
<citerefentry><refentrytitle>senpai</refentrytitle>
|
||||||
|
<manvolnum>5</manvolnum></citerefentry>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [ cfg.package ];
|
||||||
|
xdg.configFile."senpai/senpai.yaml".source =
|
||||||
|
cfgFmt.generate "senpai.yaml" cfg.config;
|
||||||
|
};
|
||||||
|
|
||||||
|
meta.maintainers = [ hm.maintainers.malvo ];
|
||||||
|
}
|
||||||
128
modules/programs/sm64ex.nix
Normal file
128
modules/programs/sm64ex.nix
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.programs.sm64ex;
|
||||||
|
|
||||||
|
# This is required for tests, we cannot overwrite the dummy package.
|
||||||
|
package = if cfg.region == null && cfg.baserom == null
|
||||||
|
&& cfg.extraCompileFlags == null then
|
||||||
|
cfg.package
|
||||||
|
|
||||||
|
else
|
||||||
|
cfg.package.override (attrs:
|
||||||
|
{ } // optionalAttrs (cfg.region != null) { region = cfg.region; }
|
||||||
|
// optionalAttrs (cfg.baserom != null) { baseRom = cfg.baserom; }
|
||||||
|
// optionalAttrs (cfg.extraCompileFlags != null) {
|
||||||
|
compileFlags = cfg.extraCompileFlags;
|
||||||
|
});
|
||||||
|
|
||||||
|
mkConfig = key: value:
|
||||||
|
let
|
||||||
|
generatedValue = if isBool value then
|
||||||
|
(if value then "true" else "false")
|
||||||
|
else if isList value then
|
||||||
|
concatStringsSep " " value
|
||||||
|
else
|
||||||
|
toString value;
|
||||||
|
in "${key} ${generatedValue}";
|
||||||
|
|
||||||
|
in {
|
||||||
|
meta.maintainers = [ maintainers.ivar ];
|
||||||
|
|
||||||
|
options.programs.sm64ex = {
|
||||||
|
enable = mkEnableOption "sm64ex";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.sm64ex;
|
||||||
|
description = "The sm64ex package to use.";
|
||||||
|
};
|
||||||
|
|
||||||
|
region = mkOption {
|
||||||
|
type = types.nullOr (types.enum [ "us" "eu" "jp" ]);
|
||||||
|
default = null;
|
||||||
|
defaultText =
|
||||||
|
literalExample "us"; # This is set both in nixpkgs and upstream
|
||||||
|
description = ''
|
||||||
|
Your baserom's region. Note that only "us", "eu", and "jp" are supported.
|
||||||
|
'';
|
||||||
|
example = literalExample "jp";
|
||||||
|
};
|
||||||
|
|
||||||
|
baserom = mkOption {
|
||||||
|
type = types.nullOr types.path;
|
||||||
|
default = null;
|
||||||
|
description =
|
||||||
|
"The path to the Super Mario 64 baserom to extract assets from.";
|
||||||
|
example = literalExample "/home/foo/baserom.us.z64";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraCompileFlags = mkOption {
|
||||||
|
type = with types; nullOr (listOf str);
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Extra flags to pass to the compiler. See
|
||||||
|
<link xlink:href="https://github.com/sm64pc/sm64ex/wiki/Build-options"/>
|
||||||
|
for more information.
|
||||||
|
'';
|
||||||
|
example = literalExample ''
|
||||||
|
[
|
||||||
|
"BETTERCAMERA=1"
|
||||||
|
"NODRAWINGDISTANCE=1"
|
||||||
|
];
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = with types;
|
||||||
|
nullOr (attrsOf (either str (either int (either bool (listOf str)))));
|
||||||
|
default = null;
|
||||||
|
description =
|
||||||
|
"Settings for sm64ex's <filename>~/.local/share/sm64pc/sm64config.txt</filename> file.";
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
fullscreen = false;
|
||||||
|
window_x = 0;
|
||||||
|
window_y = 0;
|
||||||
|
window_w = 1920;
|
||||||
|
window_h = 1080;
|
||||||
|
vsync = 1;
|
||||||
|
texture_filtering = 1;
|
||||||
|
master_volume = 127;
|
||||||
|
music_volume = 127;
|
||||||
|
sfx_volume = 127;
|
||||||
|
env_volume = 127;
|
||||||
|
key_a = [ "0026" "1000" "1103" ];
|
||||||
|
key_b = [ "0033" "1002" "1101" ];
|
||||||
|
key_start = [ "0039" "1006" "ffff" ];
|
||||||
|
key_l = [ "0034" "1007" "1104" ];
|
||||||
|
key_r = [ "0036" "100a" "1105" ];
|
||||||
|
key_z = [ "0025" "1009" "1102" ];
|
||||||
|
key_cup = [ "100b" "ffff" "ffff" ];
|
||||||
|
key_cdown = [ "100c" "ffff" "ffff" ];
|
||||||
|
key_cleft = [ "100d" "ffff" "ffff" ];
|
||||||
|
key_cright = [ "100e" "ffff" "ffff" ];
|
||||||
|
key_stickup = [ "0011" "ffff" "ffff" ];
|
||||||
|
key_stickdown = [ "001f" "ffff" "ffff" ];
|
||||||
|
key_stickleft = [ "001e" "ffff" "ffff" ];
|
||||||
|
key_stickright = [ "0020" "ffff" "ffff" ];
|
||||||
|
stick_deadzone = 16;
|
||||||
|
rumble_strength = 10;
|
||||||
|
skip_intro = 1;
|
||||||
|
};
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = let
|
||||||
|
configFile = optionals (cfg.settings != null)
|
||||||
|
(concatStringsSep "\n" ((mapAttrsToList mkConfig cfg.settings)));
|
||||||
|
in mkIf cfg.enable {
|
||||||
|
home.packages = [ package ];
|
||||||
|
|
||||||
|
xdg.dataFile."sm64pc/sm64config.txt" =
|
||||||
|
mkIf (cfg.settings != null) { text = configFile; };
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -98,8 +98,6 @@ in {
|
|||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ pkgs.taskwarrior ];
|
home.packages = [ pkgs.taskwarrior ];
|
||||||
|
|
||||||
home.file."${cfg.dataLocation}/.keep".text = "";
|
|
||||||
|
|
||||||
home.file.".taskrc".text = ''
|
home.file.".taskrc".text = ''
|
||||||
data.location=${cfg.dataLocation}
|
data.location=${cfg.dataLocation}
|
||||||
${includeTheme cfg.colorTheme}
|
${includeTheme cfg.colorTheme}
|
||||||
|
|||||||
75
modules/programs/terminator.nix
Normal file
75
modules/programs/terminator.nix
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.programs.terminator;
|
||||||
|
|
||||||
|
toValue = val:
|
||||||
|
if val == null then
|
||||||
|
"None"
|
||||||
|
else if val == true then
|
||||||
|
"True"
|
||||||
|
else if val == false then
|
||||||
|
"False"
|
||||||
|
else
|
||||||
|
''"${toString val}"'';
|
||||||
|
|
||||||
|
toConfigObject = let
|
||||||
|
toKey = depth: key:
|
||||||
|
if depth == 0 then key else toKey (depth - 1) "[${key}]";
|
||||||
|
toConfigObjectLevel = depth: obj:
|
||||||
|
flatten (mapAttrsToList (key: val:
|
||||||
|
if isAttrs val then
|
||||||
|
[ (toKey depth key) ] ++ toConfigObjectLevel (depth + 1) val
|
||||||
|
else
|
||||||
|
[ "${key} = ${toValue val}" ]) obj);
|
||||||
|
in obj: concatStringsSep "\n" (toConfigObjectLevel 1 obj);
|
||||||
|
|
||||||
|
in {
|
||||||
|
meta.maintainers = [ maintainers.chisui ];
|
||||||
|
|
||||||
|
options.programs.terminator = {
|
||||||
|
enable = mkEnableOption "terminator, a tiling terminal emulator";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.terminator;
|
||||||
|
example = literalExample "pkgs.terminator";
|
||||||
|
description = "terminator package to install.";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkOption {
|
||||||
|
default = { };
|
||||||
|
description = ''
|
||||||
|
configuration for terminator.
|
||||||
|
</para><para>
|
||||||
|
For a list of all possible options refer to the
|
||||||
|
<citerefentry>
|
||||||
|
<refentrytitle>terminator_config</refentrytitle>
|
||||||
|
<manvolnum>5</manvolnum>
|
||||||
|
</citerefentry>
|
||||||
|
man page.
|
||||||
|
'';
|
||||||
|
type = types.attrsOf types.anything;
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
global_config.borderless = true;
|
||||||
|
profiles.default.background_color = "#002b36";
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(hm.assertions.assertPlatform "programs.terminator" pkgs platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
|
xdg.configFile."terminator/config" =
|
||||||
|
mkIf (cfg.config != { }) { text = toConfigObject cfg.config; };
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -6,14 +6,21 @@ let
|
|||||||
|
|
||||||
cfg = config.programs.texlive;
|
cfg = config.programs.texlive;
|
||||||
|
|
||||||
texlivePkgs = cfg.extraPackages pkgs.texlive;
|
texlive = cfg.packageSet;
|
||||||
|
texlivePkgs = cfg.extraPackages texlive;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
meta.maintainers = [ maintainers.rycee ];
|
meta.maintainers = [ maintainers.rycee ];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
programs.texlive = {
|
programs.texlive = {
|
||||||
enable = mkEnableOption "Texlive";
|
enable = mkEnableOption "TeX Live";
|
||||||
|
|
||||||
|
packageSet = mkOption {
|
||||||
|
default = pkgs.texlive;
|
||||||
|
defaultText = literalExample "pkgs.texlive";
|
||||||
|
description = "TeX Live package set to use.";
|
||||||
|
};
|
||||||
|
|
||||||
extraPackages = mkOption {
|
extraPackages = mkOption {
|
||||||
default = tpkgs: { inherit (tpkgs) collection-basic; };
|
default = tpkgs: { inherit (tpkgs) collection-basic; };
|
||||||
@@ -21,12 +28,12 @@ in {
|
|||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
tpkgs: { inherit (tpkgs) collection-fontsrecommended algorithms; }
|
tpkgs: { inherit (tpkgs) collection-fontsrecommended algorithms; }
|
||||||
'';
|
'';
|
||||||
description = "Extra packages available to Texlive.";
|
description = "Extra packages available to TeX Live.";
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
description = "Resulting customized Texlive package.";
|
description = "Resulting customized TeX Live package.";
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -41,6 +48,6 @@ in {
|
|||||||
|
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
programs.texlive.package = pkgs.texlive.combine texlivePkgs;
|
programs.texlive.package = texlive.combine texlivePkgs;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -353,16 +353,26 @@ in {
|
|||||||
in allWarnings;
|
in allWarnings;
|
||||||
|
|
||||||
in mkIf cfg.enable (mkMerge [
|
in mkIf cfg.enable (mkMerge [
|
||||||
{ home.packages = [ cfg.package ]; }
|
{
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "programs.waybar" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
|
home.packages = [ cfg.package ];
|
||||||
|
}
|
||||||
|
|
||||||
(mkIf (cfg.settings != [ ]) {
|
(mkIf (cfg.settings != [ ]) {
|
||||||
# Generate warnings about defined but unreferenced modules
|
# Generate warnings about defined but unreferenced modules
|
||||||
inherit warnings;
|
inherit warnings;
|
||||||
|
|
||||||
xdg.configFile."waybar/config".source = configSource;
|
xdg.configFile."waybar/config".source = configSource;
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf (cfg.style != null) {
|
(mkIf (cfg.style != null) {
|
||||||
xdg.configFile."waybar/style.css".text = cfg.style;
|
xdg.configFile."waybar/style.css".text = cfg.style;
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.systemd.enable {
|
(mkIf cfg.systemd.enable {
|
||||||
systemd.user.services.waybar = {
|
systemd.user.services.waybar = {
|
||||||
Unit = {
|
Unit = {
|
||||||
|
|||||||
59
modules/programs/xmobar.nix
Normal file
59
modules/programs/xmobar.nix
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let cfg = config.programs.xmobar;
|
||||||
|
in {
|
||||||
|
options.programs.xmobar = {
|
||||||
|
enable = mkEnableOption "Xmobar, a minimalistic status bar";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
default = pkgs.haskellPackages.xmobar;
|
||||||
|
defaultText = literalExample "pkgs.haskellPackages.xmobar";
|
||||||
|
type = types.package;
|
||||||
|
description = ''
|
||||||
|
Package providing the <command>xmobar</command> binary.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = mkOption {
|
||||||
|
default = "";
|
||||||
|
example = literalExample ''
|
||||||
|
Config
|
||||||
|
{ font = "Fira Code"
|
||||||
|
, borderColor = "#d0d0d0"
|
||||||
|
, border = FullB
|
||||||
|
, borderWidth = 3
|
||||||
|
, bgColor = "#222"
|
||||||
|
, fgColor = "grey"
|
||||||
|
, position = TopSize C 99 30
|
||||||
|
, commands =
|
||||||
|
[ Run Cpu ["-t", "cpu: <fc=#4eb4fa><bar> <total>%</fc>"] 10
|
||||||
|
, Run Network "enp3s0" ["-S", "True", "-t", "eth: <fc=#4eb4fa><rx></fc>/<fc=#4eb4fa><tx></fc>"] 10
|
||||||
|
, Run Memory ["-t","mem: <fc=#4eb4fa><usedbar> <usedratio>%</fc>"] 10
|
||||||
|
, Run Date "date: <fc=#4eb4fa>%a %d %b %Y %H:%M:%S </fc>" "date" 10
|
||||||
|
, Run StdinReader
|
||||||
|
]
|
||||||
|
, sepChar = "%"
|
||||||
|
, alignSep = "}{"
|
||||||
|
, template = " %StdinReader% | %cpu% | %memory% | %enp3s0% }{%date% "
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
type = types.lines;
|
||||||
|
description = ''
|
||||||
|
Extra configuration lines to add to
|
||||||
|
<filename>$XDG_CONFIG_HOME/xmobar/.xmobarrc</filename>.
|
||||||
|
See
|
||||||
|
<link xlink:href="https://xmobar.org/#configuration" />
|
||||||
|
for options.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [ cfg.package ];
|
||||||
|
xdg.configFile."xmobar/.xmobarrc".text = cfg.extraConfig;
|
||||||
|
};
|
||||||
|
|
||||||
|
meta.maintainers = with maintainers; [ t4ccer ];
|
||||||
|
}
|
||||||
@@ -279,11 +279,22 @@ in
|
|||||||
type = types.bool;
|
type = types.bool;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
completionInit = mkOption {
|
||||||
|
default = "autoload -U compinit && compinit";
|
||||||
|
description = "Initialization commands to run when completion is enabled.";
|
||||||
|
type = types.lines;
|
||||||
|
};
|
||||||
|
|
||||||
enableAutosuggestions = mkOption {
|
enableAutosuggestions = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
description = "Enable zsh autosuggestions";
|
description = "Enable zsh autosuggestions";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableSyntaxHighlighting = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = "Enable zsh syntax highlighting";
|
||||||
|
};
|
||||||
|
|
||||||
history = mkOption {
|
history = mkOption {
|
||||||
type = historyModule;
|
type = historyModule;
|
||||||
default = {};
|
default = {};
|
||||||
@@ -469,13 +480,17 @@ in
|
|||||||
# calling it twice causes slight start up slowdown
|
# calling it twice causes slight start up slowdown
|
||||||
# as all $fpath entries will be traversed again.
|
# as all $fpath entries will be traversed again.
|
||||||
${optionalString (cfg.enableCompletion && !cfg.oh-my-zsh.enable && !cfg.prezto.enable)
|
${optionalString (cfg.enableCompletion && !cfg.oh-my-zsh.enable && !cfg.prezto.enable)
|
||||||
"autoload -U compinit && compinit"
|
cfg.completionInit
|
||||||
}
|
}
|
||||||
|
|
||||||
${optionalString cfg.enableAutosuggestions
|
${optionalString cfg.enableAutosuggestions
|
||||||
"source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
"source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
${optionalString cfg.enableSyntaxHighlighting
|
||||||
|
"source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
||||||
|
}
|
||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
|
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
|
||||||
${envVarsStr}
|
${envVarsStr}
|
||||||
@@ -500,7 +515,7 @@ in
|
|||||||
(builtins.readFile "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zshrc")}
|
(builtins.readFile "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zshrc")}
|
||||||
|
|
||||||
${concatStrings (map (plugin: ''
|
${concatStrings (map (plugin: ''
|
||||||
if [ -f "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}" ]; then
|
if [[ -f "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}" ]]; then
|
||||||
source "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}"
|
source "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}"
|
||||||
fi
|
fi
|
||||||
'') cfg.plugins)}
|
'') cfg.plugins)}
|
||||||
|
|||||||
@@ -6,6 +6,12 @@ in {
|
|||||||
|
|
||||||
meta.maintainers = with maintainers; [ kritnich ];
|
meta.maintainers = with maintainers; [ kritnich ];
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
(mkRemovedOptionModule [ "services" "barrier" "client" "tray" ] ''
|
||||||
|
The tray option is non-functional and has been removed.
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
|
||||||
options.services.barrier = {
|
options.services.barrier = {
|
||||||
|
|
||||||
client = {
|
client = {
|
||||||
@@ -29,8 +35,6 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
tray = mkEnableOption "the system tray icon" // { default = true; };
|
|
||||||
|
|
||||||
enableCrypto = mkEnableOption "crypto (SSL) plugin" // {
|
enableCrypto = mkEnableOption "crypto (SSL) plugin" // {
|
||||||
default = true;
|
default = true;
|
||||||
};
|
};
|
||||||
@@ -51,6 +55,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.client.enable {
|
config = mkIf cfg.client.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.barrier" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.barrierc = {
|
systemd.user.services.barrierc = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Barrier Client daemon";
|
Description = "Barrier Client daemon";
|
||||||
@@ -61,7 +70,6 @@ in {
|
|||||||
Service.ExecStart = with cfg.client;
|
Service.ExecStart = with cfg.client;
|
||||||
toString ([ "${pkgs.barrier}/bin/barrierc" ]
|
toString ([ "${pkgs.barrier}/bin/barrierc" ]
|
||||||
++ optional (name != null) "--name ${name}"
|
++ optional (name != null) "--name ${name}"
|
||||||
++ optional (!tray) "--no-tray"
|
|
||||||
++ optional enableCrypto "--enable-crypto"
|
++ optional enableCrypto "--enable-crypto"
|
||||||
++ optional enableDragDrop "--enable-drag-drop" ++ extraFlags
|
++ optional enableDragDrop "--enable-drag-drop" ++ extraFlags
|
||||||
++ [ server ]);
|
++ [ server ]);
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.caffeine" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.caffeine = {
|
systemd.user.services.caffeine = {
|
||||||
Unit = { Description = "caffeine"; };
|
Unit = { Description = "caffeine"; };
|
||||||
|
|
||||||
|
|||||||
@@ -98,6 +98,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.cbatticon" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
home.packages = [ package ];
|
home.packages = [ package ];
|
||||||
|
|
||||||
systemd.user.services.cbatticon = {
|
systemd.user.services.cbatticon = {
|
||||||
|
|||||||
@@ -21,6 +21,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.clipmenu" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
systemd.user.services.clipmenu = {
|
systemd.user.services.clipmenu = {
|
||||||
|
|||||||
47
modules/services/devilspie2.nix
Normal file
47
modules/services/devilspie2.nix
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let cfg = config.services.devilspie2;
|
||||||
|
in {
|
||||||
|
meta.maintainers = [ maintainers.dawidsowa ];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
services.devilspie2 = {
|
||||||
|
enable = mkEnableOption ''
|
||||||
|
Devilspie2, a window matching utility, allowing the user to
|
||||||
|
perform scripted actions on windows as they are created'';
|
||||||
|
|
||||||
|
config = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
Content of file placed in the devilspie2 config directory.
|
||||||
|
'';
|
||||||
|
example = ''
|
||||||
|
if (get_window_class() == "Gnome-terminal") then
|
||||||
|
make_always_on_top();
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.devilspie2" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
|
systemd.user.services.devilspie2 = {
|
||||||
|
Service.ExecStart = "${pkgs.devilspie2}/bin/devilspie2";
|
||||||
|
Unit = {
|
||||||
|
Description = "devilspie2";
|
||||||
|
After = [ "graphical-session-pre.target" ];
|
||||||
|
PartOf = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
Install.WantedBy = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile."devilspie2/config.lua".text = cfg.config;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -28,6 +28,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.dropbox" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
home.packages = [ pkgs.dropbox-cli ];
|
home.packages = [ pkgs.dropbox-cli ];
|
||||||
|
|
||||||
systemd.user.services.dropbox = {
|
systemd.user.services.dropbox = {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ let
|
|||||||
options = {
|
options = {
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
example = literalExample "pkgs.gnome3.adwaita-icon-theme";
|
example = literalExample "pkgs.gnome.adwaita-icon-theme";
|
||||||
description = "Package providing the theme.";
|
description = "Package providing the theme.";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -78,7 +78,15 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = with types; attrsOf (attrsOf eitherStrBoolIntList);
|
type = types.submodule {
|
||||||
|
freeformType = with types; attrsOf (attrsOf eitherStrBoolIntList);
|
||||||
|
options = {
|
||||||
|
global.icon_path = mkOption {
|
||||||
|
type = types.separatedString ":";
|
||||||
|
description = "Paths where dunst will look for icons.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
default = { };
|
default = { };
|
||||||
description = "Configuration written to ~/.config/dunst/dunstrc";
|
description = "Configuration written to ~/.config/dunst/dunstrc";
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
@@ -103,7 +111,7 @@ in {
|
|||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
{
|
{
|
||||||
home.packages = [ (getOutput "man" pkgs.dunst) ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
xdg.dataFile."dbus-1/services/org.knopwob.dunst.service".source =
|
xdg.dataFile."dbus-1/services/org.knopwob.dunst.service".source =
|
||||||
"${pkgs.dunst}/share/dbus-1/services/org.knopwob.dunst.service";
|
"${pkgs.dunst}/share/dbus-1/services/org.knopwob.dunst.service";
|
||||||
@@ -138,11 +146,14 @@ in {
|
|||||||
"status"
|
"status"
|
||||||
"stock"
|
"stock"
|
||||||
];
|
];
|
||||||
in concatStringsSep ":" (concatMap (theme:
|
|
||||||
concatMap (basePath:
|
mkPath = { basePath, theme, category }:
|
||||||
map (category:
|
"${basePath}/share/icons/${theme.name}/${theme.size}/${category}";
|
||||||
"${basePath}/share/icons/${theme.name}/${theme.size}/${category}")
|
in concatMapStringsSep ":" mkPath (cartesianProductOfSets {
|
||||||
categories) basePaths) themes);
|
basePath = basePaths;
|
||||||
|
theme = themes;
|
||||||
|
category = categories;
|
||||||
|
});
|
||||||
|
|
||||||
systemd.user.services.dunst = {
|
systemd.user.services.dunst = {
|
||||||
Unit = {
|
Unit = {
|
||||||
|
|||||||
@@ -53,6 +53,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.dwm-status" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.dwm-status = {
|
systemd.user.services.dwm-status = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "DWM status service";
|
Description = "DWM status service";
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ let
|
|||||||
emacsBinPath = "${cfg.package}/bin";
|
emacsBinPath = "${cfg.package}/bin";
|
||||||
emacsVersion = getVersion cfg.package;
|
emacsVersion = getVersion cfg.package;
|
||||||
|
|
||||||
|
clientWMClass =
|
||||||
|
if versionAtLeast emacsVersion "28" then "Emacsd" else "Emacs";
|
||||||
|
|
||||||
# Adapted from upstream emacs.desktop
|
# Adapted from upstream emacs.desktop
|
||||||
clientDesktopItem = pkgs.writeTextDir "share/applications/emacsclient.desktop"
|
clientDesktopItem = pkgs.writeTextDir "share/applications/emacsclient.desktop"
|
||||||
(generators.toINI { } {
|
(generators.toINI { } {
|
||||||
@@ -24,26 +27,16 @@ let
|
|||||||
GenericName = "Text Editor";
|
GenericName = "Text Editor";
|
||||||
MimeType =
|
MimeType =
|
||||||
"text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;";
|
"text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;";
|
||||||
Categories = "Utility;TextEditor;";
|
Categories = "Development;TextEditor;";
|
||||||
StartupWMClass = "Emacs";
|
Keywords = "Text;Editor;";
|
||||||
|
StartupWMClass = clientWMClass;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
# Match the default socket path for the Emacs version so emacsclient continues
|
# Match the default socket path for the Emacs version so emacsclient continues
|
||||||
# to work without wrapping it. It might be worthwhile to allow customizing the
|
# to work without wrapping it.
|
||||||
# socket path, but we would want to wrap emacsclient in the user profile to
|
socketDir = "%t/emacs";
|
||||||
# connect to the alternative socket by default for Emacs 26, and set
|
socketPath = "${socketDir}/server";
|
||||||
# EMACS_SOCKET_NAME for Emacs 27.
|
|
||||||
#
|
|
||||||
# As systemd doesn't perform variable expansion for the ListenStream param, we
|
|
||||||
# would also have to solve the problem of matching the shell path to the path
|
|
||||||
# used in the socket unit, which would likely involve templating. It seems of
|
|
||||||
# little value for the most common use case of one Emacs daemon per user
|
|
||||||
# session.
|
|
||||||
socketPath = if versionAtLeast emacsVersion "27" then
|
|
||||||
"%t/emacs/server"
|
|
||||||
else
|
|
||||||
"%T/emacs%U/server";
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
meta.maintainers = [ maintainers.tadfisher ];
|
meta.maintainers = [ maintainers.tadfisher ];
|
||||||
@@ -82,24 +75,30 @@ in {
|
|||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
{
|
{
|
||||||
assertions = [{
|
assertions = [
|
||||||
assertion = cfg.socketActivation.enable
|
(lib.hm.assertions.assertPlatform "services.emacs" pkgs
|
||||||
-> versionAtLeast emacsVersion "26";
|
lib.platforms.linux)
|
||||||
message = "Socket activation requires Emacs 26 or newer.";
|
];
|
||||||
}];
|
|
||||||
|
|
||||||
systemd.user.services.emacs = {
|
systemd.user.services.emacs = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Emacs: the extensible, self-documenting text editor";
|
Description = "Emacs text editor";
|
||||||
Documentation =
|
Documentation =
|
||||||
"info:emacs man:emacs(1) https://gnu.org/software/emacs/";
|
"info:emacs man:emacs(1) https://gnu.org/software/emacs/";
|
||||||
|
|
||||||
# Avoid killing the Emacs session, which may be full of
|
# Avoid killing the Emacs session, which may be full of
|
||||||
# unsaved buffers.
|
# unsaved buffers.
|
||||||
X-RestartIfChanged = false;
|
X-RestartIfChanged = false;
|
||||||
|
} // optionalAttrs (cfg.socketActivation.enable) {
|
||||||
|
# Emacs deletes its socket when shutting down, which systemd doesn't
|
||||||
|
# handle, resulting in a server without a socket.
|
||||||
|
# See https://github.com/nix-community/home-manager/issues/2018
|
||||||
|
RefuseManualStart = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
|
Type = "notify";
|
||||||
|
|
||||||
# We wrap ExecStart in a login shell so Emacs starts with the user's
|
# We wrap ExecStart in a login shell so Emacs starts with the user's
|
||||||
# environment, most importantly $PATH and $NIX_PROFILES. It may be
|
# environment, most importantly $PATH and $NIX_PROFILES. It may be
|
||||||
# worth investigating a more targeted approach for user services to
|
# worth investigating a more targeted approach for user services to
|
||||||
@@ -113,10 +112,19 @@ in {
|
|||||||
optionalString cfg.socketActivation.enable
|
optionalString cfg.socketActivation.enable
|
||||||
"=${escapeShellArg socketPath}"
|
"=${escapeShellArg socketPath}"
|
||||||
}"'';
|
}"'';
|
||||||
# We use '(kill-emacs 0)' to avoid exiting with a failure code, which
|
|
||||||
# would restart the service immediately.
|
# Emacs will exit with status 15 after having received SIGTERM, which
|
||||||
ExecStop = "${emacsBinPath}/emacsclient --eval '(kill-emacs 0)'";
|
# is the default "KillSignal" value systemd uses to stop services.
|
||||||
|
SuccessExitStatus = 15;
|
||||||
|
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
|
} // optionalAttrs (cfg.socketActivation.enable) {
|
||||||
|
# Use read-only directory permissions to prevent emacs from
|
||||||
|
# deleting systemd's socket file before exiting.
|
||||||
|
ExecStartPost =
|
||||||
|
"${pkgs.coreutils}/bin/chmod --changes -w ${socketDir}";
|
||||||
|
ExecStopPost =
|
||||||
|
"${pkgs.coreutils}/bin/chmod --changes +w ${socketDir}";
|
||||||
};
|
};
|
||||||
} // optionalAttrs (!cfg.socketActivation.enable) {
|
} // optionalAttrs (!cfg.socketActivation.enable) {
|
||||||
Install = { WantedBy = [ "default.target" ]; };
|
Install = { WantedBy = [ "default.target" ]; };
|
||||||
@@ -128,7 +136,7 @@ in {
|
|||||||
(mkIf cfg.socketActivation.enable {
|
(mkIf cfg.socketActivation.enable {
|
||||||
systemd.user.sockets.emacs = {
|
systemd.user.sockets.emacs = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Emacs: the extensible, self-documenting text editor";
|
Description = "Emacs text editor";
|
||||||
Documentation =
|
Documentation =
|
||||||
"info:emacs man:emacs(1) https://gnu.org/software/emacs/";
|
"info:emacs man:emacs(1) https://gnu.org/software/emacs/";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ in {
|
|||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
{
|
{
|
||||||
ETESYNC_LISTEN_ADDRESS = "localhost";
|
ETESYNC_LISTEN_ADDRESS = "localhost";
|
||||||
ETESYNC_LISTEN_PORT = 37385;
|
ETESYNC_LISTEN_PORT = 37358;
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
@@ -45,6 +45,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.etesync-dav" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
systemd.user.services.etesync-dav = {
|
systemd.user.services.etesync-dav = {
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ in {
|
|||||||
options = { services.flameshot = { enable = mkEnableOption "Flameshot"; }; };
|
options = { services.flameshot = { enable = mkEnableOption "Flameshot"; }; };
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.flameshot" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
home.packages = [ package ];
|
home.packages = [ package ];
|
||||||
|
|
||||||
systemd.user.services.flameshot = {
|
systemd.user.services.flameshot = {
|
||||||
|
|||||||
@@ -37,6 +37,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.fluidsynth" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.fluidsynth = {
|
systemd.user.services.fluidsynth = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "FluidSynth Daemon";
|
Description = "FluidSynth Daemon";
|
||||||
|
|||||||
@@ -37,6 +37,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.getmail" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.getmail = {
|
systemd.user.services.getmail = {
|
||||||
Unit = { Description = "getmail email fetcher"; };
|
Unit = { Description = "getmail email fetcher"; };
|
||||||
Service = { ExecStart = "${pkgs.getmail}/bin/getmail ${configFiles}"; };
|
Service = { ExecStart = "${pkgs.getmail}/bin/getmail ${configFiles}"; };
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.gnome-keyring" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.gnome-keyring = {
|
systemd.user.services.gnome-keyring = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "GNOME Keyring";
|
Description = "GNOME Keyring";
|
||||||
@@ -36,7 +41,7 @@ in {
|
|||||||
args = concatStringsSep " " ([ "--start" "--foreground" ]
|
args = concatStringsSep " " ([ "--start" "--foreground" ]
|
||||||
++ optional (cfg.components != [ ])
|
++ optional (cfg.components != [ ])
|
||||||
("--components=" + concatStringsSep "," cfg.components));
|
("--components=" + concatStringsSep "," cfg.components));
|
||||||
in "${pkgs.gnome3.gnome-keyring}/bin/gnome-keyring-daemon ${args}";
|
in "${pkgs.gnome.gnome-keyring}/bin/gnome-keyring-daemon ${args}";
|
||||||
Restart = "on-abort";
|
Restart = "on-abort";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.grobi" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.grobi = {
|
systemd.user.services.grobi = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "grobi display auto config daemon";
|
Description = "grobi display auto config daemon";
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.hound" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
home.packages = [ pkgs.hound ];
|
home.packages = [ pkgs.hound ];
|
||||||
|
|
||||||
systemd.user.services.hound = {
|
systemd.user.services.hound = {
|
||||||
|
|||||||
@@ -77,6 +77,8 @@ in {
|
|||||||
+ concatMapStringsSep ", " (a: a.name) badAccounts;
|
+ concatMapStringsSep ", " (a: a.name) badAccounts;
|
||||||
};
|
};
|
||||||
in [
|
in [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.imapnotify" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
(checkAccounts (a: a.maildir == null) "maildir configuration")
|
(checkAccounts (a: a.maildir == null) "maildir configuration")
|
||||||
(checkAccounts (a: a.imap == null) "IMAP configuration")
|
(checkAccounts (a: a.imap == null) "IMAP configuration")
|
||||||
(checkAccounts (a: a.passwordCommand == null) "password command")
|
(checkAccounts (a: a.passwordCommand == null) "password command")
|
||||||
|
|||||||
@@ -187,6 +187,10 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.kanshi" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
xdg.configFile."kanshi/config".text = ''
|
xdg.configFile."kanshi/config".text = ''
|
||||||
${concatStringsSep "\n" (mapAttrsToList profileStr cfg.profiles)}
|
${concatStringsSep "\n" (mapAttrsToList profileStr cfg.profiles)}
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.kbfs" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.kbfs = {
|
systemd.user.services.kbfs = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Keybase File System";
|
Description = "Keybase File System";
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ in {
|
|||||||
options.services.keybase.enable = mkEnableOption "Keybase";
|
options.services.keybase.enable = mkEnableOption "Keybase";
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.keybase" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
home.packages = [ pkgs.keybase ];
|
home.packages = [ pkgs.keybase ];
|
||||||
|
|
||||||
systemd.user.services.keybase = {
|
systemd.user.services.keybase = {
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ in {
|
|||||||
options.services.keynav = { enable = mkEnableOption "keynav"; };
|
options.services.keynav = { enable = mkEnableOption "keynav"; };
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.keynav" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.keynav = {
|
systemd.user.services.keynav = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "keynav";
|
Description = "keynav";
|
||||||
|
|||||||
@@ -61,6 +61,11 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
(lib.hm.assertions.assertPlatform "services.lieer" pkgs
|
||||||
|
lib.platforms.linux)
|
||||||
|
];
|
||||||
|
|
||||||
programs.lieer.enable = true;
|
programs.lieer.enable = true;
|
||||||
systemd.user.services = listToAttrs (map serviceUnit syncAccounts);
|
systemd.user.services = listToAttrs (map serviceUnit syncAccounts);
|
||||||
systemd.user.timers = listToAttrs (map timerUnit syncAccounts);
|
systemd.user.timers = listToAttrs (map timerUnit syncAccounts);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user