Project import generated by Copybara.
GitOrigin-RevId: ac319fd3149b23a3ad8ee24cb2def6e67acf194c
This commit is contained in:
parent
0d3567ea7e
commit
a0869759be
491 changed files with 14231 additions and 2701 deletions
118
third_party/home-manager/.github/CODEOWNERS
vendored
118
third_party/home-manager/.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
|
||||||
|
@ -11,6 +14,9 @@
|
||||||
|
|
||||||
/modules/misc/gtk.nix @rycee
|
/modules/misc/gtk.nix @rycee
|
||||||
|
|
||||||
|
/modules/config/i18n.nix @midchildan
|
||||||
|
/tests/modules/config/i18n @midchildan
|
||||||
|
|
||||||
/modules/misc/news.nix @rycee
|
/modules/misc/news.nix @rycee
|
||||||
|
|
||||||
/modules/misc/numlock.nix @evanjs
|
/modules/misc/numlock.nix @evanjs
|
||||||
|
@ -31,6 +37,14 @@
|
||||||
|
|
||||||
/modules/misc/xdg-user-dirs.nix @pacien
|
/modules/misc/xdg-user-dirs.nix @pacien
|
||||||
|
|
||||||
|
/modules/misc/xdg-system-dirs.nix @tadfisher
|
||||||
|
/tests/modules/misc/xdg/system-dirs.nix @tadfisher
|
||||||
|
|
||||||
|
/modules/misc/xdg-desktop-entries.nix @cwyc
|
||||||
|
/tests/modules/misc/xdg/desktop-entries.nix @cwyc
|
||||||
|
/tests/modules/misc/xdg/desktop-full-expected.desktop @cwyc
|
||||||
|
/tests/modules/misc/xdg/desktop-min-expected.desktop @cwyc
|
||||||
|
|
||||||
/modules/programs/aria2.nix @JustinLovinger
|
/modules/programs/aria2.nix @JustinLovinger
|
||||||
|
|
||||||
/modules/programs/autojump.nix @evanjs
|
/modules/programs/autojump.nix @evanjs
|
||||||
|
@ -54,23 +68,37 @@
|
||||||
|
|
||||||
/modules/programs/emacs.nix @rycee
|
/modules/programs/emacs.nix @rycee
|
||||||
|
|
||||||
|
/modules/programs/exa.nix @kalhauge
|
||||||
|
|
||||||
/modules/programs/firefox.nix @rycee
|
/modules/programs/firefox.nix @rycee
|
||||||
|
|
||||||
|
/modules/programs/foot.nix @plabadens
|
||||||
|
/tests/modules/programs/foot @plabadens
|
||||||
|
|
||||||
/modules/programs/gh.nix @Gerschtli
|
/modules/programs/gh.nix @Gerschtli
|
||||||
/tests/modules/programs/gh @Gerschtli
|
/tests/modules/programs/gh @Gerschtli
|
||||||
|
|
||||||
/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/i3status.nix @JustinLovinger
|
/modules/programs/i3status.nix @JustinLovinger
|
||||||
|
|
||||||
|
/modules/programs/i3status-rust.nix @workflow
|
||||||
|
|
||||||
/modules/programs/keychain.nix @marsam
|
/modules/programs/keychain.nix @marsam
|
||||||
|
|
||||||
|
/modules/programs/lazygit.nix @kalhauge
|
||||||
|
|
||||||
/modules/programs/lesspipe.nix @rycee
|
/modules/programs/lesspipe.nix @rycee
|
||||||
|
|
||||||
/modules/programs/lf.nix @owm111
|
/modules/programs/lf.nix @owm111
|
||||||
|
@ -82,12 +110,16 @@
|
||||||
|
|
||||||
/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
|
||||||
|
|
||||||
/modules/programs/mcfly.nix @marsam
|
/modules/programs/mcfly.nix @marsam
|
||||||
|
|
||||||
/modules/programs/mpv.nix @tadeokondrak
|
/modules/programs/mpv.nix @tadeokondrak @thiagokokada
|
||||||
|
/tests/modules/programs/mpv @thiagokokada
|
||||||
|
|
||||||
/modules/programs/mu.nix @KarlJoad
|
/modules/programs/mu.nix @KarlJoad
|
||||||
|
|
||||||
|
@ -95,9 +127,17 @@
|
||||||
/tests/modules/programs/ncmpcpp @olmokramer
|
/tests/modules/programs/ncmpcpp @olmokramer
|
||||||
/tests/modules/programs/ncmpcpp-linux @olmokramer
|
/tests/modules/programs/ncmpcpp-linux @olmokramer
|
||||||
|
|
||||||
|
/modules/programs/ncspot.nix @marsam
|
||||||
|
|
||||||
/modules/programs/ne.nix @cwyc
|
/modules/programs/ne.nix @cwyc
|
||||||
/tests/modules/programs/ne @cwyc
|
/tests/modules/programs/ne @cwyc
|
||||||
|
|
||||||
|
/modules/programs/newsboat.nix @sumnerevans
|
||||||
|
/tests/modules/programs/newsboat @sumnerevans
|
||||||
|
|
||||||
|
/modules/programs/nix-index.nix @ambroisie
|
||||||
|
/tests/modules/programs/nix-index @ambroisie
|
||||||
|
|
||||||
/modules/programs/noti.nix @marsam
|
/modules/programs/noti.nix @marsam
|
||||||
|
|
||||||
/modules/programs/nushell.nix @Philipp-M
|
/modules/programs/nushell.nix @Philipp-M
|
||||||
|
@ -105,6 +145,8 @@
|
||||||
|
|
||||||
/modules/programs/obs-studio.nix @adisbladis
|
/modules/programs/obs-studio.nix @adisbladis
|
||||||
|
|
||||||
|
/modules/programs/octant.nix @06kellyjac
|
||||||
|
|
||||||
/modules/programs/opam.nix @marsam
|
/modules/programs/opam.nix @marsam
|
||||||
|
|
||||||
/modules/programs/openssh.nix @rycee
|
/modules/programs/openssh.nix @rycee
|
||||||
|
@ -115,19 +157,46 @@
|
||||||
|
|
||||||
/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
|
||||||
|
/tests/modules/programs/rofi @thiagokokada
|
||||||
|
|
||||||
|
/modules/programs/rofi-pass.nix @seylerius
|
||||||
|
/tests/modules/programs/rofi-pass @seylerius
|
||||||
|
|
||||||
/modules/programs/rtorrent.nix @marsam
|
/modules/programs/rtorrent.nix @marsam
|
||||||
|
|
||||||
|
/modules/programs/sbt.nix @kubukoz
|
||||||
|
/tests/modules/programs/sbt @kubukoz
|
||||||
|
|
||||||
|
/modules/programs/scmpuff.nix @cpcloud
|
||||||
|
/tests/modules/programs/scmpuff @cpcloud
|
||||||
|
|
||||||
|
/modules/programs/senpai.nix @malte-v
|
||||||
|
|
||||||
/modules/programs/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
|
||||||
|
/tests/modules/programs/topgrade @msfjarvis
|
||||||
|
|
||||||
/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
|
||||||
|
@ -136,6 +205,11 @@
|
||||||
|
|
||||||
/modules/programs/zsh/prezto.nix @NickHu
|
/modules/programs/zsh/prezto.nix @NickHu
|
||||||
|
|
||||||
|
/modules/services/barrier.nix @Kritnich
|
||||||
|
/tests/modules/services/barrier @Kritnich
|
||||||
|
|
||||||
|
/modules/services/caffeine.nix @uvNikita
|
||||||
|
|
||||||
/modules/services/cbatticon.nix @pmiddend
|
/modules/services/cbatticon.nix @pmiddend
|
||||||
|
|
||||||
/modules/services/clipmenu.nix @DamienCassou
|
/modules/services/clipmenu.nix @DamienCassou
|
||||||
|
@ -147,12 +221,12 @@
|
||||||
|
|
||||||
/modules/services/emacs.nix @tadfisher
|
/modules/services/emacs.nix @tadfisher
|
||||||
|
|
||||||
|
/modules/services/etesync-dav.nix @Valodim
|
||||||
|
|
||||||
/modules/services/flameshot.nix @moredhel
|
/modules/services/flameshot.nix @moredhel
|
||||||
|
|
||||||
/modules/services/fluidsynth.nix @Valodim
|
/modules/services/fluidsynth.nix @Valodim
|
||||||
|
|
||||||
/modules/services/gammastep.nix @petabyteboy
|
|
||||||
|
|
||||||
/modules/services/gnome-keyring.nix @rycee
|
/modules/services/gnome-keyring.nix @rycee
|
||||||
|
|
||||||
/modules/services/gpg-agent.nix @rycee
|
/modules/services/gpg-agent.nix @rycee
|
||||||
|
@ -180,21 +254,39 @@
|
||||||
|
|
||||||
/modules/services/mpdris2.nix @pjones
|
/modules/services/mpdris2.nix @pjones
|
||||||
|
|
||||||
|
/modules/services/mpris-proxy.nix @ThibautMarty
|
||||||
|
|
||||||
/modules/services/muchsync.nix @pacien
|
/modules/services/muchsync.nix @pacien
|
||||||
|
|
||||||
/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/password-store-sync.nix @pacien
|
/modules/services/password-store-sync.nix @pacien
|
||||||
|
|
||||||
/modules/services/pasystray.nix @pltanton
|
/modules/services/pasystray.nix @pltanton
|
||||||
|
|
||||||
|
/modules/services/pbgopy.nix @ivarwithoutbones
|
||||||
|
/tests/modules/services/pbgopy @ivarwithoutbones
|
||||||
|
|
||||||
|
/modules/services/plan9port.nix @ehmry
|
||||||
|
|
||||||
|
/modules/services/playerctld.nix @fendse
|
||||||
|
/tests/modules/playerctld @fendse
|
||||||
|
|
||||||
|
/modules/services/poweralertd.nix @ThibautMarty
|
||||||
|
|
||||||
/modules/services/pulseeffects.nix @jonringer
|
/modules/services/pulseeffects.nix @jonringer
|
||||||
|
|
||||||
/modules/services/random-background.nix @rycee
|
/modules/services/random-background.nix @rycee
|
||||||
|
|
||||||
/modules/services/redshift.nix @rycee
|
/modules/services/redshift-gammastep @rycee @petabyteboy @thiagokokada
|
||||||
|
/tests/modules/redshift-gammastep @thiagokokada
|
||||||
|
|
||||||
/modules/services/status-notifier-watcher.nix @pltanton
|
/modules/services/status-notifier-watcher.nix @pltanton
|
||||||
|
|
||||||
|
@ -210,12 +302,26 @@
|
||||||
|
|
||||||
/modules/services/unison.nix @pacien
|
/modules/services/unison.nix @pacien
|
||||||
|
|
||||||
/modules/services/window-managers/i3-sway/sway.nix @alexarice
|
/modules/services/window-managers/bspwm @ncfavier
|
||||||
|
/tests/modules/services/window-managers/bspwm @ncfavier
|
||||||
|
|
||||||
|
/modules/services/window-managers/i3-sway/i3.nix @sumnerevans
|
||||||
|
/tests/modules/services/window-managers/i3 @sumnerevans
|
||||||
|
|
||||||
|
/modules/services/window-managers/i3-sway/lib @sumnerevans
|
||||||
|
|
||||||
|
/modules/services/window-managers/i3-sway/sway.nix @alexarice @sumnerevans
|
||||||
|
/tests/modules/services/window-managers/sway @sumnerevans
|
||||||
|
|
||||||
|
/modules/services/wlsunset.nix @matrss
|
||||||
|
/tests/modules/services/wlsunset @matrss
|
||||||
|
|
||||||
/modules/services/xcape.nix @nickhu
|
/modules/services/xcape.nix @nickhu
|
||||||
|
|
||||||
/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
|
||||||
|
|
|
@ -1,8 +1,16 @@
|
||||||
|
<!--
|
||||||
|
|
||||||
|
Don't forget to check if there already exists a relevant issue before
|
||||||
|
creating a new one.
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
### Issue description
|
### Issue description
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Please describe the issue. For support and help please use the IRC
|
Please describe the issue. For support and help please use the IRC
|
||||||
channel #home-manager @ freenode.net instead.
|
channel #home-manager at irc.oftc.net or Matrix room
|
||||||
|
https://matrix.to/#/#hm:rycee.net instead.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### Meta
|
### Meta
|
||||||
|
|
17
third_party/home-manager/.github/dependabot.yml
vendored
Normal file
17
third_party/home-manager/.github/dependabot.yml
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
target-branch: "master"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
commit-message:
|
||||||
|
prefix: "ci:"
|
||||||
|
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
target-branch: "release-20.09"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
commit-message:
|
||||||
|
prefix: "ci:"
|
75
third_party/home-manager/.github/stale.yml
vendored
Normal file
75
third_party/home-manager/.github/stale.yml
vendored
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
# Configuration for probot-stale - https://github.com/probot/stale
|
||||||
|
daysUntilStale: 90
|
||||||
|
daysUntilClose: 7
|
||||||
|
staleLabel: "status: stale"
|
||||||
|
closeComment: false
|
||||||
|
issues:
|
||||||
|
markComment: |
|
||||||
|
<p>
|
||||||
|
Thank you for your contribution!
|
||||||
|
I marked this issue as stale due to inactivity.
|
||||||
|
If this remains inactive for another 7 days, I will close this issue.
|
||||||
|
<b>Please read the relevant sections below before commenting.</b>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><b>If you are the original author of the issue</b></summary>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
* If this is resolved, please consider closing it so that the maintainers know not to focus on this.
|
||||||
|
* If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
|
||||||
|
* If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
|
||||||
|
|
||||||
|
</p>
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><b>If you are <i>not</i> the original author of the issue</b></summary>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
* If you are also experiencing this issue, please add details of your situation to help with the debugging process.
|
||||||
|
* If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
|
||||||
|
|
||||||
|
</p>
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><b>Memorandum on closing issues</b></summary>
|
||||||
|
<p>
|
||||||
|
If you have nothing of substance to add, please refrain from commenting and allow the bot close the issue.
|
||||||
|
Also, don't be afraid to manually close an issue, even if it holds valuable information.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Closed issues stay in the system for people to search, read, cross-reference, or even reopen--nothing is lost!
|
||||||
|
Closing obsolete issues is an important way to help maintainers focus their time and effort.
|
||||||
|
</p>
|
||||||
|
</details>
|
||||||
|
pulls:
|
||||||
|
markComment: |
|
||||||
|
<p>
|
||||||
|
Thank you for your contribution!
|
||||||
|
I marked this pull request as stale due to inactivity.
|
||||||
|
If this remains inactive for another 7 days, I will close this PR.
|
||||||
|
<b>Please read the relevant sections below before commenting.</b>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><b>If you are the original author of the PR</b></summary>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
* GitHub sometimes doesn't notify people who commented / reviewed a PR previously, when you (force) push commits. *If you have addressed the reviews* you can [officially ask for a review](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/requesting-a-pull-request-review) from those who commented to you or anyone else.
|
||||||
|
* If it is unfinished but you plan to finish it, please mark it as a draft.
|
||||||
|
* If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
|
||||||
|
* To get things rolling again, rebase the PR against the target branch and address valid comments.
|
||||||
|
|
||||||
|
</p>
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><b>If you are <i>not</i> the original author of the issue</b></summary>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
* If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.
|
||||||
|
|
||||||
|
</p>
|
||||||
|
</details>
|
|
@ -11,10 +11,10 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: cachix/install-nix-action@v10
|
- uses: cachix/install-nix-action@v13
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
- uses: cachix/cachix-action@v6
|
- uses: cachix/cachix-action@v10
|
||||||
with:
|
with:
|
||||||
name: nix-community
|
name: nix-community
|
||||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||||
|
|
|
@ -11,12 +11,13 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: cachix/install-nix-action@v10
|
- uses: cachix/install-nix-action@v13
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
- uses: cachix/cachix-action@v6
|
- uses: cachix/cachix-action@v10
|
||||||
with:
|
with:
|
||||||
name: nix-community
|
name: nix-community
|
||||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||||
|
- run: ./format -c
|
||||||
- run: nix-shell . -A install
|
- run: nix-shell . -A install
|
||||||
- run: nix-shell --pure --max-jobs 4 tests -A run.all
|
- run: nix-shell --pure tests -A run.all
|
||||||
|
|
3
third_party/home-manager/.gitlab-ci.yml
vendored
3
third_party/home-manager/.gitlab-ci.yml
vendored
|
@ -1,8 +1,7 @@
|
||||||
image: nixos/nix:latest
|
image: nixos/nix:latest
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
# Pinned 2020-09-11.
|
NIX_PATH: "nixpkgs=channel:nixos-unstable"
|
||||||
NIX_PATH: "nixpkgs=https://github.com/NixOS/nixpkgs/archive/6d4b93323e7f78121f8d6db6c59f3889aa1dd931.tar.gz"
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
|
|
1
third_party/home-manager/.release
vendored
Normal file
1
third_party/home-manager/.release
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
21.11
|
11
third_party/home-manager/CONTRIBUTING.adoc
vendored
11
third_party/home-manager/CONTRIBUTING.adoc
vendored
|
@ -44,9 +44,10 @@ The first option is good if you only temporarily want to use your clone.
|
||||||
|
|
||||||
[[sec-guidelines]]
|
[[sec-guidelines]]
|
||||||
=== Guidelines
|
=== Guidelines
|
||||||
:irc-home-manager: https://webchat.freenode.net/?url=irc%3A%2F%2Firc.freenode.net%2Fhome-manager
|
:irc-home-manager: https://webchat.oftc.net/?channels=home-manager
|
||||||
:valuable-options: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md#valuable-options
|
:valuable-options: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md#valuable-options
|
||||||
:rfc-42: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md
|
:rfc-42: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md
|
||||||
|
:assertions: https://nixos.org/manual/nixos/stable/index.html#sec-assertions
|
||||||
|
|
||||||
If your contribution satisfy the following rules then there is a good chance it will be merged without too much trouble. The rules are enforced by the Home Manager maintainers and to a lesser extent the Home Manager CI system.
|
If your contribution satisfy the following rules then there is a good chance it will be merged without too much trouble. The rules are enforced by the Home Manager maintainers and to a lesser extent the Home Manager CI system.
|
||||||
|
|
||||||
|
@ -55,7 +56,9 @@ If you are uncertain how these rules affect the change you would like to make th
|
||||||
[[sec-guidelines-back-compat]]
|
[[sec-guidelines-back-compat]]
|
||||||
==== Maintain backward compatibility
|
==== Maintain backward compatibility
|
||||||
|
|
||||||
Your contribution should never cause another user's existing configuration to break. Home Manager is used in many different environments and you should consider how you change may effect others. For example,
|
Your contribution should not cause another user's existing configuration to break unless there is a very good reason and the change should be announced to the user through an {assertions}[assertion] or similar.
|
||||||
|
|
||||||
|
Remember that Home Manager is used in many different environments and you should consider how your change may effect others. For example,
|
||||||
|
|
||||||
- Does your change work for people that do not use NixOS? Consider other GNU/Linux distributions and macOS.
|
- Does your change work for people that do not use NixOS? Consider other GNU/Linux distributions and macOS.
|
||||||
- Does your change work for people whose configuration is built on one system and deployed on another system?
|
- Does your change work for people whose configuration is built on one system and deployed on another system?
|
||||||
|
@ -88,7 +91,7 @@ All contributed code _must_ pass the test suite.
|
||||||
==== Add relevant documentation
|
==== Add relevant documentation
|
||||||
:docbook: https://tdg.docbook.org/
|
:docbook: https://tdg.docbook.org/
|
||||||
:asciidoc: https://asciidoc.org/
|
:asciidoc: https://asciidoc.org/
|
||||||
:docbook-rocks: https://docbook.rocks/
|
:docbook-rocks: https://berbiche.github.io/docbook.rocks/
|
||||||
|
|
||||||
Many code changes require changing the documentation as well. Module options should be documented with DocBook. See {docbook-rocks}[DocBook rocks!] for a quick introduction and {docbook}[DocBook 5: The Definitive Guide] for in-depth information of DocBook. Home Manager is itself documented using a combination of DocBook and {asciidoc}[AsciiDoc]. All text is hosted in Home Manager's Git repository.
|
Many code changes require changing the documentation as well. Module options should be documented with DocBook. See {docbook-rocks}[DocBook rocks!] for a quick introduction and {docbook}[DocBook 5: The Definitive Guide] for in-depth information of DocBook. Home Manager is itself documented using a combination of DocBook and {asciidoc}[AsciiDoc]. All text is hosted in Home Manager's Git repository.
|
||||||
|
|
||||||
|
@ -160,7 +163,7 @@ The commit messages should follow the {seven-rules}[seven rules]. We also ask yo
|
||||||
{long description}
|
{long description}
|
||||||
----
|
----
|
||||||
|
|
||||||
where `{component}` refers to the code component (or module) your change affects, `{description}` is a very brief description of your change, and `{long description}` is an optional clarifying description. Note, `{description}` should start with a lower case letter. As a rare exception, if there is no clear component, or your change affects many components, then the `{component}` part is optional. See <<ex-commit-message>> for a commit message that fulfills these requirements.
|
where `{component}` refers to the code component (or module) your change affects, `{description}` is a very brief description of your change, and `{long description}` is an optional clarifying description. As a rare exception, if there is no clear component, or your change affects many components, then the `{component}` part is optional. See <<ex-commit-message>> for a commit message that fulfills these requirements.
|
||||||
|
|
||||||
[[ex-commit-message]]
|
[[ex-commit-message]]
|
||||||
.Compliant commit message
|
.Compliant commit message
|
||||||
|
|
6
third_party/home-manager/FAQ.adoc
vendored
6
third_party/home-manager/FAQ.adoc
vendored
|
@ -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
|
||||||
|
@ -51,7 +53,7 @@ Home Manager is only able to set session variables automatically if it manages y
|
||||||
|
|
||||||
to your `.profile` and `.zshrc` files, respectively. The `hm-session-vars.sh` file should work in most Bourne-like shells.
|
to your `.profile` and `.zshrc` files, respectively. The `hm-session-vars.sh` file should work in most Bourne-like shells.
|
||||||
|
|
||||||
=== How do set up a configuration for multiple users/machines?
|
=== How to set up a configuration for multiple users/machines?
|
||||||
:post-your-homenix: https://www.reddit.com/r/NixOS/comments/9bb9h9/post_your_homemanager_homenix_file/
|
:post-your-homenix: https://www.reddit.com/r/NixOS/comments/9bb9h9/post_your_homemanager_homenix_file/
|
||||||
|
|
||||||
A typical way to prepare a repository of configurations for multiple logins and machines is to prepare one "top-level" file for each unique combination.
|
A typical way to prepare a repository of configurations for multiple logins and machines is to prepare one "top-level" file for each unique combination.
|
||||||
|
@ -92,7 +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.
|
||||||
|
|
||||||
|
|
2
third_party/home-manager/LICENSE
vendored
2
third_party/home-manager/LICENSE
vendored
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2017-2020 Robert Helgesson and Home Manager contributors
|
Copyright (c) 2017-2020 Home Manager contributors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
70
third_party/home-manager/README.md
vendored
70
third_party/home-manager/README.md
vendored
|
@ -3,8 +3,10 @@ Home Manager using Nix
|
||||||
|
|
||||||
This project provides a basic system for managing a user environment
|
This project provides a basic system for managing a user environment
|
||||||
using the [Nix][] package manager together with the Nix libraries
|
using the [Nix][] package manager together with the Nix libraries
|
||||||
found in [Nixpkgs][]. Before attempting to use Home Manager please
|
found in [Nixpkgs][]. It allows declarative configuration of user
|
||||||
read the warning below.
|
specific (non global) packages and dotfiles.
|
||||||
|
|
||||||
|
Before attempting to use Home Manager please read the warning below.
|
||||||
|
|
||||||
For a more systematic overview of Home Manager and its available
|
For a more systematic overview of Home Manager and its available
|
||||||
options, please see the [Home Manager manual][manual].
|
options, please see the [Home Manager manual][manual].
|
||||||
|
@ -12,22 +14,25 @@ options, please see the [Home Manager manual][manual].
|
||||||
Words of warning
|
Words of warning
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
This project is under development. I personally use it to manage
|
Unfortunately, it is quite possible to get difficult to understand
|
||||||
several user configurations but it may fail catastrophically for you.
|
errors when working with Home Manager, such as infinite loops with no
|
||||||
So beware!
|
clear source reference. You should therefore be comfortable using the
|
||||||
|
Nix language and the various tools in the Nix ecosystem. Reading
|
||||||
|
through the [Nix Pills][] document is a good way to familiarize
|
||||||
|
yourself with them.
|
||||||
|
|
||||||
Before using Home Manager you should be comfortable using the Nix
|
If you are not very familiar with Nix but still want to use Home
|
||||||
language and the various tools in the Nix ecosystem. Reading through
|
Manager then you are strongly encouraged to start with a small and
|
||||||
the [Nix Pills][] document is a good way to familiarize yourself with
|
very simple configuration and gradually make it more elaborate as you
|
||||||
them.
|
learn.
|
||||||
|
|
||||||
In some cases Home Manager cannot detect whether it will overwrite a
|
In some cases Home Manager cannot detect whether it will overwrite a
|
||||||
previous manual configuration. For example, the Gnome Terminal module
|
previous manual configuration. For example, the Gnome Terminal module
|
||||||
will write to your dconf store and cannot tell whether a configuration
|
will write to your dconf store and cannot tell whether a configuration
|
||||||
that it is about to be overwrite was from a previous Home Manager
|
that it is about to be overwritten was from a previous Home Manager
|
||||||
generation or from manual configuration.
|
generation or from manual configuration.
|
||||||
|
|
||||||
Home Manager targets [NixOS][] unstable and NixOS version 20.03 (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.
|
||||||
|
|
||||||
|
@ -43,8 +48,7 @@ Contact
|
||||||
-------
|
-------
|
||||||
|
|
||||||
You can chat with us on IRC in the channel [#home-manager][] on
|
You can chat with us on IRC in the channel [#home-manager][] on
|
||||||
[freenode][]. The [channel logs][] are hosted courtesy of
|
[OFTC][].
|
||||||
[samueldr][].
|
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
@ -61,22 +65,23 @@ Currently the easiest way to install Home Manager is as follows:
|
||||||
control this option using the
|
control this option using the
|
||||||
[`nix.allowedUsers`][nixosAllowedUsers] system option.
|
[`nix.allowedUsers`][nixosAllowedUsers] system option.
|
||||||
|
|
||||||
2. Add the appropriate Home Manager channel. Typically this is
|
Note that Nix 2.4 (`nixUnstable`) is not yet supported.
|
||||||
|
|
||||||
|
2. Add the appropriate Home Manager channel. If you are following
|
||||||
|
Nixpkgs master or an unstable channel you can run
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||||
$ nix-channel --update
|
$ nix-channel --update
|
||||||
```
|
```
|
||||||
|
|
||||||
if you are following Nixpkgs master or an unstable channel and
|
and if you follow a Nixpkgs version 21.05 channel you can run
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.03.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
|
||||||
```
|
```
|
||||||
|
|
||||||
if you follow a Nixpkgs version 20.03 channel.
|
|
||||||
|
|
||||||
On NixOS you may need to log out and back in for the channel to
|
On NixOS you may need to log out and back in for the channel to
|
||||||
become available. On non-NixOS you may have to add
|
become available. On non-NixOS you may have to add
|
||||||
|
|
||||||
|
@ -112,6 +117,13 @@ Currently the easiest way to install Home Manager is as follows:
|
||||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
or this when managing home configuration together with system
|
||||||
|
configuration
|
||||||
|
|
||||||
|
```bash
|
||||||
|
. "/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh"
|
||||||
|
```
|
||||||
|
|
||||||
to your `~/.profile` file.
|
to your `~/.profile` file.
|
||||||
|
|
||||||
If instead of using channels you want to run Home Manager from a Git
|
If instead of using channels you want to run Home Manager from a Git
|
||||||
|
@ -129,8 +141,8 @@ 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 the
|
Emacs with a few extra packages enabled, install Firefox with
|
||||||
IcedTea plugin 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:
|
||||||
|
@ -267,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
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -331,7 +343,7 @@ as follows:
|
||||||
{
|
{
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
home-manager.users.user = import ./home.nix;
|
home-manager.users.jdoe = import ./home.nix;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -340,6 +352,13 @@ as follows:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note, the Home Manager library is exported by the flake under
|
||||||
|
`lib.hm`.
|
||||||
|
|
||||||
|
When using flakes, switch to new configurations as you do for the
|
||||||
|
whole system (e. g. `nixos-rebuild switch --flake <path>`) instead of
|
||||||
|
using the `home-manager` command line tool.
|
||||||
|
|
||||||
Releases
|
Releases
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@ -347,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.03`). 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.
|
||||||
|
|
||||||
|
@ -360,9 +379,8 @@ an issue.
|
||||||
[Z shell]: http://zsh.sourceforge.net/
|
[Z shell]: http://zsh.sourceforge.net/
|
||||||
[manual]: https://nix-community.github.io/home-manager/
|
[manual]: https://nix-community.github.io/home-manager/
|
||||||
[configuration options]: https://nix-community.github.io/home-manager/options.html
|
[configuration options]: https://nix-community.github.io/home-manager/options.html
|
||||||
[#home-manager]: https://webchat.freenode.net/?url=irc%3A%2F%2Firc.freenode.net%2Fhome-manager
|
[#home-manager]: https://webchat.oftc.net/?channels=home-manager
|
||||||
[freenode]: https://freenode.net/
|
[OFTC]: https://oftc.net/
|
||||||
[channel logs]: https://logs.nix.samueldr.com/home-manager/
|
|
||||||
[samueldr]: https://github.com/samueldr/
|
[samueldr]: https://github.com/samueldr/
|
||||||
[Nix Pills]: https://nixos.org/nixos/nix-pills/
|
[Nix Pills]: https://nixos.org/nixos/nix-pills/
|
||||||
[Nix Flakes]: https://nixos.wiki/wiki/Flakes
|
[Nix Flakes]: https://nixos.wiki/wiki/Flakes
|
||||||
|
|
11
third_party/home-manager/doc/contributing.adoc
vendored
11
third_party/home-manager/doc/contributing.adoc
vendored
|
@ -44,9 +44,10 @@ The first option is good if you only temporarily want to use your clone.
|
||||||
|
|
||||||
[[sec-guidelines]]
|
[[sec-guidelines]]
|
||||||
=== Guidelines
|
=== Guidelines
|
||||||
:irc-home-manager: https://webchat.freenode.net/?url=irc%3A%2F%2Firc.freenode.net%2Fhome-manager
|
:irc-home-manager: https://webchat.oftc.net/?channels=home-manager
|
||||||
:valuable-options: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md#valuable-options
|
:valuable-options: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md#valuable-options
|
||||||
:rfc-42: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md
|
:rfc-42: https://github.com/Infinisil/rfcs/blob/config-option/rfcs/0042-config-option.md
|
||||||
|
:assertions: https://nixos.org/manual/nixos/stable/index.html#sec-assertions
|
||||||
|
|
||||||
If your contribution satisfy the following rules then there is a good chance it will be merged without too much trouble. The rules are enforced by the Home Manager maintainers and to a lesser extent the Home Manager CI system.
|
If your contribution satisfy the following rules then there is a good chance it will be merged without too much trouble. The rules are enforced by the Home Manager maintainers and to a lesser extent the Home Manager CI system.
|
||||||
|
|
||||||
|
@ -55,7 +56,9 @@ If you are uncertain how these rules affect the change you would like to make th
|
||||||
[[sec-guidelines-back-compat]]
|
[[sec-guidelines-back-compat]]
|
||||||
==== Maintain backward compatibility
|
==== Maintain backward compatibility
|
||||||
|
|
||||||
Your contribution should never cause another user's existing configuration to break. Home Manager is used in many different environments and you should consider how you change may effect others. For example,
|
Your contribution should not cause another user's existing configuration to break unless there is a very good reason and the change should be announced to the user through an {assertions}[assertion] or similar.
|
||||||
|
|
||||||
|
Remember that Home Manager is used in many different environments and you should consider how your change may effect others. For example,
|
||||||
|
|
||||||
- Does your change work for people that do not use NixOS? Consider other GNU/Linux distributions and macOS.
|
- Does your change work for people that do not use NixOS? Consider other GNU/Linux distributions and macOS.
|
||||||
- Does your change work for people whose configuration is built on one system and deployed on another system?
|
- Does your change work for people whose configuration is built on one system and deployed on another system?
|
||||||
|
@ -88,7 +91,7 @@ All contributed code _must_ pass the test suite.
|
||||||
==== Add relevant documentation
|
==== Add relevant documentation
|
||||||
:docbook: https://tdg.docbook.org/
|
:docbook: https://tdg.docbook.org/
|
||||||
:asciidoc: https://asciidoc.org/
|
:asciidoc: https://asciidoc.org/
|
||||||
:docbook-rocks: https://docbook.rocks/
|
:docbook-rocks: https://berbiche.github.io/docbook.rocks/
|
||||||
|
|
||||||
Many code changes require changing the documentation as well. Module options should be documented with DocBook. See {docbook-rocks}[DocBook rocks!] for a quick introduction and {docbook}[DocBook 5: The Definitive Guide] for in-depth information of DocBook. Home Manager is itself documented using a combination of DocBook and {asciidoc}[AsciiDoc]. All text is hosted in Home Manager's Git repository.
|
Many code changes require changing the documentation as well. Module options should be documented with DocBook. See {docbook-rocks}[DocBook rocks!] for a quick introduction and {docbook}[DocBook 5: The Definitive Guide] for in-depth information of DocBook. Home Manager is itself documented using a combination of DocBook and {asciidoc}[AsciiDoc]. All text is hosted in Home Manager's Git repository.
|
||||||
|
|
||||||
|
@ -160,7 +163,7 @@ The commit messages should follow the {seven-rules}[seven rules]. We also ask yo
|
||||||
{long description}
|
{long description}
|
||||||
----
|
----
|
||||||
|
|
||||||
where `{component}` refers to the code component (or module) your change affects, `{description}` is a very brief description of your change, and `{long description}` is an optional clarifying description. Note, `{description}` should start with a lower case letter. As a rare exception, if there is no clear component, or your change affects many components, then the `{component}` part is optional. See <<ex-commit-message>> for a commit message that fulfills these requirements.
|
where `{component}` refers to the code component (or module) your change affects, `{description}` is a very brief description of your change, and `{long description}` is an optional clarifying description. As a rare exception, if there is no clear component, or your change affects many components, then the `{component}` part is optional. See <<ex-commit-message>> for a commit message that fulfills these requirements.
|
||||||
|
|
||||||
[[ex-commit-message]]
|
[[ex-commit-message]]
|
||||||
.Compliant commit message
|
.Compliant commit message
|
||||||
|
|
63
third_party/home-manager/doc/default.nix
vendored
63
third_party/home-manager/doc/default.nix
vendored
|
@ -26,27 +26,78 @@ let
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
|
|
||||||
hmModulesDocs = nmd.buildModulesDocs {
|
buildModulesDocs = args:
|
||||||
|
nmd.buildModulesDocs ({
|
||||||
|
moduleRootPaths = [ ./.. ];
|
||||||
|
mkModuleUrl = path:
|
||||||
|
"https://github.com/nix-community/home-manager/blob/master/${path}#blob-path";
|
||||||
|
channelName = "home-manager";
|
||||||
|
} // args);
|
||||||
|
|
||||||
|
hmModulesDocs = buildModulesDocs {
|
||||||
modules = import ../modules/modules.nix {
|
modules = import ../modules/modules.nix {
|
||||||
inherit lib pkgs;
|
inherit lib pkgs;
|
||||||
check = false;
|
check = false;
|
||||||
} ++ [ scrubbedPkgsModule ];
|
} ++ [ scrubbedPkgsModule ];
|
||||||
moduleRootPaths = [ ./.. ];
|
|
||||||
mkModuleUrl = path:
|
|
||||||
"https://github.com/nix-community/home-manager/blob/master/${path}#blob-path";
|
|
||||||
channelName = "home-manager";
|
|
||||||
docBook.id = "home-manager-options";
|
docBook.id = "home-manager-options";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nixosModuleDocs = buildModulesDocs {
|
||||||
|
modules = let
|
||||||
|
nixosModule = module: pkgs.path + "/nixos/modules" + module;
|
||||||
|
mockedNixos = with lib; {
|
||||||
|
options = {
|
||||||
|
environment.pathsToLink = mkSinkUndeclaredOptions { };
|
||||||
|
systemd.services = mkSinkUndeclaredOptions { };
|
||||||
|
users.users = mkSinkUndeclaredOptions { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in [
|
||||||
|
../nixos/default.nix
|
||||||
|
mockedNixos
|
||||||
|
(nixosModule "/misc/assertions.nix")
|
||||||
|
scrubbedPkgsModule
|
||||||
|
];
|
||||||
|
docBook = {
|
||||||
|
id = "nixos-options";
|
||||||
|
optionIdPrefix = "nixos-opt";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nixDarwinModuleDocs = buildModulesDocs {
|
||||||
|
modules = let
|
||||||
|
nixosModule = module: pkgs.path + "/nixos/modules" + module;
|
||||||
|
mockedNixDarwin = with lib; {
|
||||||
|
options = {
|
||||||
|
environment.pathsToLink = mkSinkUndeclaredOptions { };
|
||||||
|
system.activationScripts.postActivation.text =
|
||||||
|
mkSinkUndeclaredOptions { };
|
||||||
|
users.users = mkSinkUndeclaredOptions { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in [
|
||||||
|
../nix-darwin/default.nix
|
||||||
|
mockedNixDarwin
|
||||||
|
(nixosModule "/misc/assertions.nix")
|
||||||
|
scrubbedPkgsModule
|
||||||
|
];
|
||||||
|
docBook = {
|
||||||
|
id = "nix-darwin-options";
|
||||||
|
optionIdPrefix = "nix-darwin-opt";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
docs = nmd.buildDocBookDocs {
|
docs = nmd.buildDocBookDocs {
|
||||||
pathName = "home-manager";
|
pathName = "home-manager";
|
||||||
modulesDocs = [ hmModulesDocs ];
|
modulesDocs = [ hmModulesDocs nixDarwinModuleDocs nixosModuleDocs ];
|
||||||
documentsDirectory = ./.;
|
documentsDirectory = ./.;
|
||||||
documentType = "book";
|
documentType = "book";
|
||||||
chunkToc = ''
|
chunkToc = ''
|
||||||
<toc>
|
<toc>
|
||||||
<d:tocentry xmlns:d="http://docbook.org/ns/docbook" linkend="book-home-manager-manual"><?dbhtml filename="index.html"?>
|
<d:tocentry xmlns:d="http://docbook.org/ns/docbook" linkend="book-home-manager-manual"><?dbhtml filename="index.html"?>
|
||||||
<d:tocentry linkend="ch-options"><?dbhtml filename="options.html"?></d:tocentry>
|
<d:tocentry linkend="ch-options"><?dbhtml filename="options.html"?></d:tocentry>
|
||||||
|
<d:tocentry linkend="ch-nixos-options"><?dbhtml filename="nixos-options.html"?></d:tocentry>
|
||||||
|
<d:tocentry linkend="ch-nix-darwin-options"><?dbhtml filename="nix-darwin-options.html"?></d:tocentry>
|
||||||
<d:tocentry linkend="ch-tools"><?dbhtml filename="tools.html"?></d:tocentry>
|
<d:tocentry linkend="ch-tools"><?dbhtml filename="tools.html"?></d:tocentry>
|
||||||
<d:tocentry linkend="ch-release-notes"><?dbhtml filename="release-notes.html"?></d:tocentry>
|
<d:tocentry linkend="ch-release-notes"><?dbhtml filename="release-notes.html"?></d:tocentry>
|
||||||
</d:tocentry>
|
</d:tocentry>
|
||||||
|
|
6
third_party/home-manager/doc/faq.adoc
vendored
6
third_party/home-manager/doc/faq.adoc
vendored
|
@ -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
|
||||||
|
@ -51,7 +53,7 @@ Home Manager is only able to set session variables automatically if it manages y
|
||||||
|
|
||||||
to your `.profile` and `.zshrc` files, respectively. The `hm-session-vars.sh` file should work in most Bourne-like shells.
|
to your `.profile` and `.zshrc` files, respectively. The `hm-session-vars.sh` file should work in most Bourne-like shells.
|
||||||
|
|
||||||
=== How do set up a configuration for multiple users/machines?
|
=== How to set up a configuration for multiple users/machines?
|
||||||
:post-your-homenix: https://www.reddit.com/r/NixOS/comments/9bb9h9/post_your_homemanager_homenix_file/
|
:post-your-homenix: https://www.reddit.com/r/NixOS/comments/9bb9h9/post_your_homemanager_homenix_file/
|
||||||
|
|
||||||
A typical way to prepare a repository of configurations for multiple logins and machines is to prepare one "top-level" file for each unique combination.
|
A typical way to prepare a repository of configurations for multiple logins and machines is to prepare one "top-level" file for each unique combination.
|
||||||
|
@ -92,7 +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.
|
||||||
|
|
||||||
|
|
263
third_party/home-manager/doc/installation.adoc
vendored
Normal file
263
third_party/home-manager/doc/installation.adoc
vendored
Normal file
|
@ -0,0 +1,263 @@
|
||||||
|
[[ch-installation]]
|
||||||
|
== Installing Home Manager
|
||||||
|
|
||||||
|
:nix-darwin: https://github.com/LnL7/nix-darwin/
|
||||||
|
|
||||||
|
Home Manager can be used in three primary ways:
|
||||||
|
|
||||||
|
1. Using the standalone `home-manager` tool. For platforms other than
|
||||||
|
NixOS and Darwin, this is the only available choice. It is also
|
||||||
|
recommended for people on NixOS or Darwin that want to manage their
|
||||||
|
home directory independent of the system as a whole. See
|
||||||
|
<<sec-install-standalone>> for instructions on how to perform this
|
||||||
|
installation.
|
||||||
|
|
||||||
|
2. As a module within a NixOS system configuration. This allows the
|
||||||
|
user profiles to be built together with the system when running
|
||||||
|
`nixos-rebuild`. See <<sec-install-nixos-module>> for a description of
|
||||||
|
this setup.
|
||||||
|
|
||||||
|
3. As a module within a {nix-darwin}[nix-darwin] system configuration.
|
||||||
|
This allows the user profiles to be built together with the system
|
||||||
|
when running `darwin-rebuild`. See <<sec-install-nix-darwin-module>>
|
||||||
|
for a description of this setup.
|
||||||
|
|
||||||
|
[[sec-install-standalone]]
|
||||||
|
=== Standalone installation
|
||||||
|
|
||||||
|
:nix-allowed-users: https://nixos.org/nix/manual/#conf-allowed-users
|
||||||
|
:nixos-allowed-users: https://nixos.org/nixos/manual/options.html#opt-nix.allowedUsers
|
||||||
|
|
||||||
|
1. Make sure you have a working Nix installation. Specifically, make
|
||||||
|
sure that your user is able to build and install Nix packages. For
|
||||||
|
example, you should be able to successfully run a command like
|
||||||
|
`nix-instantiate '<nixpkgs>' -A hello` without having to switch to the
|
||||||
|
root user. For a multi-user install of Nix this means that your user
|
||||||
|
must be covered by the {nix-allowed-users}[`allowed-users`] Nix
|
||||||
|
option. On NixOS you can control this option using the
|
||||||
|
{nixos-allowed-users}[`nix.allowedUsers`] system option.
|
||||||
|
|
||||||
|
2. Add the Home Manager channel that you wish to follow. If you are
|
||||||
|
following Nixpkgs master or an unstable channel then this is done by
|
||||||
|
running
|
||||||
|
+
|
||||||
|
[source,console]
|
||||||
|
----
|
||||||
|
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||||
|
$ nix-channel --update
|
||||||
|
----
|
||||||
|
+
|
||||||
|
and if you follow a Nixpkgs version 21.05 channel, you can run
|
||||||
|
+
|
||||||
|
[source,console]
|
||||||
|
----
|
||||||
|
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
|
||||||
|
$ nix-channel --update
|
||||||
|
----
|
||||||
|
+
|
||||||
|
On NixOS you may need to log out and back in for the channel to become
|
||||||
|
available. On non-NixOS you may have to add
|
||||||
|
+
|
||||||
|
[source,bash]
|
||||||
|
export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
|
||||||
|
+
|
||||||
|
to your shell (see
|
||||||
|
https://github.com/NixOS/nix/issues/2033[nix#2033]).
|
||||||
|
|
||||||
|
3. Run the Home Manager installation command and create the first Home
|
||||||
|
Manager generation:
|
||||||
|
+
|
||||||
|
[source,console]
|
||||||
|
$ nix-shell '<home-manager>' -A install
|
||||||
|
+
|
||||||
|
Once finished, Home Manager should be active and available in your
|
||||||
|
user environment.
|
||||||
|
|
||||||
|
4. If you do not plan on having Home Manager manage your shell
|
||||||
|
configuration then you must source the
|
||||||
|
+
|
||||||
|
[source,bash]
|
||||||
|
$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||||
|
+
|
||||||
|
file in your shell configuration. Alternatively source
|
||||||
|
+
|
||||||
|
[source,bash]
|
||||||
|
/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh
|
||||||
|
+
|
||||||
|
when managing home configuration together with system configuration.
|
||||||
|
+
|
||||||
|
Unfortunately, we currently only support POSIX.2-like shells such as
|
||||||
|
https://www.gnu.org/software/bash/[Bash] or
|
||||||
|
http://zsh.sourceforge.net/[Z shell].
|
||||||
|
+
|
||||||
|
For example, if you use Bash then add
|
||||||
|
+
|
||||||
|
[source,bash]
|
||||||
|
----
|
||||||
|
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||||
|
----
|
||||||
|
+
|
||||||
|
to your `~/.profile` file.
|
||||||
|
|
||||||
|
If instead of using channels you want to run Home Manager from a Git
|
||||||
|
checkout of the repository then you can use the
|
||||||
|
<<opt-programs.home-manager.path>> option to specify the absolute path
|
||||||
|
to the repository.
|
||||||
|
|
||||||
|
[[sec-install-nixos-module]]
|
||||||
|
=== NixOS module
|
||||||
|
|
||||||
|
Home Manager provides a NixOS module that allows you to prepare user
|
||||||
|
environments directly from the system configuration file, which often
|
||||||
|
is more convenient than using the `home-manager` tool. It also opens
|
||||||
|
up additional possibilities, for example, to automatically configure
|
||||||
|
user environments in NixOS declarative containers or on systems
|
||||||
|
deployed through NixOps.
|
||||||
|
|
||||||
|
To make the NixOS module available for use you must `import` it into
|
||||||
|
your system configuration. This is most conveniently done by adding a
|
||||||
|
Home Manager channel. For example, if you are following Nixpkgs master
|
||||||
|
or an unstable channel, you can run
|
||||||
|
|
||||||
|
[source,console]
|
||||||
|
----
|
||||||
|
# nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||||
|
# nix-channel --update
|
||||||
|
----
|
||||||
|
|
||||||
|
and if you follow a Nixpkgs version 21.05 channel, you can run
|
||||||
|
|
||||||
|
[source,console]
|
||||||
|
----
|
||||||
|
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
|
||||||
|
# nix-channel --update
|
||||||
|
----
|
||||||
|
|
||||||
|
It is then possible to add
|
||||||
|
|
||||||
|
[source,nix]
|
||||||
|
imports = [ <home-manager/nixos> ];
|
||||||
|
|
||||||
|
to your system `configuration.nix` file, which will introduce a new
|
||||||
|
NixOS option called `home-manager.users` whose type is an attribute
|
||||||
|
set that maps user names to Home Manager configurations.
|
||||||
|
|
||||||
|
For example, a NixOS configuration may include the lines
|
||||||
|
|
||||||
|
[source,nix]
|
||||||
|
----
|
||||||
|
users.users.eve.isNormalUser = true;
|
||||||
|
home-manager.users.eve = { pkgs, ... }: {
|
||||||
|
home.packages = [ pkgs.atool pkgs.httpie ];
|
||||||
|
programs.bash.enable = true;
|
||||||
|
};
|
||||||
|
----
|
||||||
|
|
||||||
|
and after a `nixos-rebuild switch` the user eve's environment should
|
||||||
|
include a basic Bash configuration and the packages atool and httpie.
|
||||||
|
|
||||||
|
[NOTE]
|
||||||
|
====
|
||||||
|
By default packages will be installed to `$HOME/.nix-profile` but they
|
||||||
|
can be installed to `/etc/profiles` if
|
||||||
|
|
||||||
|
[source,nix]
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
|
||||||
|
is added to the system configuration. This is necessary if, for
|
||||||
|
example, you wish to use `nixos-rebuild build-vm`. This option may
|
||||||
|
become the default value in the future.
|
||||||
|
====
|
||||||
|
|
||||||
|
[NOTE]
|
||||||
|
====
|
||||||
|
By default, Home Manager uses a private `pkgs` instance that is
|
||||||
|
configured via the `home-manager.users.<name>.nixpkgs` options. To
|
||||||
|
instead use the global `pkgs` that is configured via the system level
|
||||||
|
`nixpkgs` options, set
|
||||||
|
|
||||||
|
[source,nix]
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
|
||||||
|
This saves an extra Nixpkgs evaluation, adds consistency, and removes
|
||||||
|
the dependency on `NIX_PATH`, which is otherwise used for importing
|
||||||
|
Nixpkgs.
|
||||||
|
====
|
||||||
|
|
||||||
|
[[sec-install-nix-darwin-module]]
|
||||||
|
=== nix-darwin module
|
||||||
|
|
||||||
|
Home Manager provides a module that allows you to prepare user
|
||||||
|
environments directly from the {nix-darwin}[nix-darwin] configuration
|
||||||
|
file, which often is more convenient than using the `home-manager`
|
||||||
|
tool.
|
||||||
|
|
||||||
|
To make the NixOS module available for use you must `import` it into
|
||||||
|
your system configuration. This is most conveniently done by adding a
|
||||||
|
Home Manager channel. For example, if you are following Nixpkgs master
|
||||||
|
or an unstable channel, you can run
|
||||||
|
|
||||||
|
[source,console]
|
||||||
|
----
|
||||||
|
# nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||||
|
# nix-channel --update
|
||||||
|
----
|
||||||
|
|
||||||
|
and if you follow a Nixpkgs version 21.05 channel, you can run
|
||||||
|
|
||||||
|
[source,console]
|
||||||
|
----
|
||||||
|
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
|
||||||
|
# nix-channel --update
|
||||||
|
----
|
||||||
|
|
||||||
|
It is then possible to add
|
||||||
|
|
||||||
|
[source,nix]
|
||||||
|
imports = [ <home-manager/nix-darwin> ];
|
||||||
|
|
||||||
|
to your nix-darwin `configuration.nix` file, which will introduce a
|
||||||
|
new NixOS option called `home-manager` whose type is an attribute set
|
||||||
|
that maps user names to Home Manager configurations.
|
||||||
|
|
||||||
|
For example, a nix-darwin configuration may include the lines
|
||||||
|
|
||||||
|
[source,nix]
|
||||||
|
----
|
||||||
|
home-manager.users.eve = { pkgs, ... }: {
|
||||||
|
home.packages = [ pkgs.atool pkgs.httpie ];
|
||||||
|
programs.bash.enable = true;
|
||||||
|
};
|
||||||
|
----
|
||||||
|
|
||||||
|
and after a `darwin-rebuild switch` the user eve's environment
|
||||||
|
should include a basic Bash configuration and the packages atool and
|
||||||
|
httpie.
|
||||||
|
|
||||||
|
[NOTE]
|
||||||
|
====
|
||||||
|
By default user packages will not be ignored in favor of
|
||||||
|
`environment.systemPackages`, but they will be intalled to
|
||||||
|
`/etc/profiles/per-user/$USERNAME` if
|
||||||
|
|
||||||
|
[source,nix]
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
|
||||||
|
is added to the nix-darwin configuration. This option may become the
|
||||||
|
default value in the future.
|
||||||
|
====
|
||||||
|
|
||||||
|
[NOTE]
|
||||||
|
====
|
||||||
|
By default, Home Manager uses a private `pkgs` instance that is
|
||||||
|
configured via the `home-manager.users.<name>.nixpkgs` options. To
|
||||||
|
instead use the global `pkgs` that is configured via the system level
|
||||||
|
`nixpkgs` options, set
|
||||||
|
|
||||||
|
[source,nix]
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
|
||||||
|
This saves an extra Nixpkgs evaluation, adds consistency, and removes
|
||||||
|
the dependency on `NIX_PATH`, which is otherwise used for importing
|
||||||
|
Nixpkgs.
|
||||||
|
====
|
334
third_party/home-manager/doc/installation.xml
vendored
334
third_party/home-manager/doc/installation.xml
vendored
|
@ -1,334 +0,0 @@
|
||||||
<chapter xmlns="http://docbook.org/ns/docbook"
|
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
||||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
|
||||||
version="5.0"
|
|
||||||
xml:id="ch-installation">
|
|
||||||
<title>Installing Home Manager</title>
|
|
||||||
<para>
|
|
||||||
Home Manager can be used in three primary ways:
|
|
||||||
<orderedlist>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Using the standalone <command>home-manager</command> tool. For platforms
|
|
||||||
other than NixOS and Darwin, this is the only available choice. It is also
|
|
||||||
recommended for people on NixOS or Darwin that want to manage their home
|
|
||||||
directory independent of the system as a whole. See
|
|
||||||
<xref linkend="sec-install-standalone"/> for instructions on how to
|
|
||||||
perform this installation.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
As a module within a NixOS system configuration. This allows the user
|
|
||||||
profiles to be built together with the system when running
|
|
||||||
<command>nixos-rebuild</command>. See
|
|
||||||
<xref linkend="sec-install-nixos-module"/> for a description of this
|
|
||||||
setup.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
As a module within a
|
|
||||||
<link xlink:href="https://github.com/LnL7/nix-darwin/">nix-darwin</link>
|
|
||||||
system configuration. This allows the user profiles to be built together
|
|
||||||
with the system when running <command>darwin-rebuild</command>. See
|
|
||||||
<xref linkend="sec-install-nix-darwin-module"/> for a description of this
|
|
||||||
setup.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</orderedlist>
|
|
||||||
</para>
|
|
||||||
<section xml:id="sec-install-standalone">
|
|
||||||
<title>Standalone installation</title>
|
|
||||||
|
|
||||||
<orderedlist>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Make sure you have a working Nix installation. Specifically, make
|
|
||||||
sure that your user is able to build and install Nix packages.
|
|
||||||
For example, you should be able to successfully run a command
|
|
||||||
like <literal>nix-instantiate '<nixpkgs>' -A hello</literal>
|
|
||||||
without having to switch to the root user. For a multi-user
|
|
||||||
install of Nix this means that your user must be covered by the
|
|
||||||
<link xlink:href="https://nixos.org/nix/manual/#conf-allowed-users"><literal>allowed-users</literal></link>
|
|
||||||
Nix option. On NixOS you can control this option using the
|
|
||||||
<link xlink:href="https://nixos.org/nixos/manual/options.html#opt-nix.allowedUsers"><literal>nix.allowedUsers</literal></link>
|
|
||||||
system option.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Add the Home Manager channel that you wish to follow. This is done by
|
|
||||||
running
|
|
||||||
</para>
|
|
||||||
<screen>
|
|
||||||
<prompt>$</prompt> <userinput>nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager</userinput>
|
|
||||||
<prompt>$</prompt> <userinput>nix-channel --update</userinput>
|
|
||||||
</screen>
|
|
||||||
<para>
|
|
||||||
if you are following Nixpkgs master or an unstable channel and
|
|
||||||
</para>
|
|
||||||
<screen>
|
|
||||||
<prompt>$</prompt> <userinput>nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.03.tar.gz home-manager</userinput>
|
|
||||||
<prompt>$</prompt> <userinput>nix-channel --update</userinput>
|
|
||||||
</screen>
|
|
||||||
<para>
|
|
||||||
if you follow a Nixpkgs version 20.03 channel.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
On NixOS you may need to log out and back in for the channel to become
|
|
||||||
available. On non-NixOS you may have to add
|
|
||||||
<programlisting language="bash">
|
|
||||||
export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
|
|
||||||
</programlisting>
|
|
||||||
to your shell (see
|
|
||||||
<link xlink:href="https://github.com/NixOS/nix/issues/2033">nix#2033</link>).
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Run the Home Manager installation command and create the first Home
|
|
||||||
Manager generation:
|
|
||||||
</para>
|
|
||||||
<screen>
|
|
||||||
<prompt>$</prompt> <userinput>nix-shell '<home-manager>' -A install</userinput>
|
|
||||||
</screen>
|
|
||||||
<para>
|
|
||||||
Once finished, Home Manager should be active and available in your user
|
|
||||||
environment.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
If you do not plan on having Home Manager manage your shell configuration
|
|
||||||
then you must source the
|
|
||||||
</para>
|
|
||||||
<programlisting language="bash">
|
|
||||||
$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
|
||||||
</programlisting>
|
|
||||||
<para>
|
|
||||||
file in your shell configuration. Unfortunately, we currently only support
|
|
||||||
POSIX.2-like shells such as
|
|
||||||
<link xlink:href="https://www.gnu.org/software/bash/">Bash</link> or
|
|
||||||
<link xlink:href="http://zsh.sourceforge.net/">Z shell</link>.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
For example, if you use Bash then add
|
|
||||||
</para>
|
|
||||||
<programlisting language="bash">
|
|
||||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
|
||||||
</programlisting>
|
|
||||||
<para>
|
|
||||||
to your <literal>~/.profile</literal> file.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</orderedlist>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
If instead of using channels you want to run Home Manager from a Git
|
|
||||||
checkout of the repository then you can use the
|
|
||||||
<literal>programs.home-manager.path</literal> option to specify the absolute
|
|
||||||
path to the repository.
|
|
||||||
</para>
|
|
||||||
</section>
|
|
||||||
<section xml:id="sec-install-nixos-module">
|
|
||||||
<title>NixOS module</title>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
Home Manager provides a NixOS module that allows you to prepare user
|
|
||||||
environments directly from the system configuration file, which often is
|
|
||||||
more convenient than using the <command>home-manager</command> tool. It also
|
|
||||||
opens up additional possibilities, for example, to automatically configure
|
|
||||||
user environments in NixOS declarative containers or on systems deployed
|
|
||||||
through NixOps.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
To make the NixOS module available for use you must <option>import</option>
|
|
||||||
it into your system configuration. This is most conveniently done by adding
|
|
||||||
a Home Manager channel, for example
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<screen language="console">
|
|
||||||
<prompt>#</prompt> <userinput>nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager</userinput>
|
|
||||||
<prompt>#</prompt> <userinput>nix-channel --update</userinput>
|
|
||||||
</screen>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
if you are following Nixpkgs master or an unstable channel and
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<screen language="console">
|
|
||||||
<prompt>#</prompt> <userinput>nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.03.tar.gz home-manager</userinput>
|
|
||||||
<prompt>#</prompt> <userinput>nix-channel --update</userinput>
|
|
||||||
</screen>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
if you follow a Nixpkgs version 20.03 channel.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
It is then possible to add
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<programlisting language="nix">
|
|
||||||
imports = [ <home-manager/nixos> ];
|
|
||||||
</programlisting>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
to your system <filename>configuration.nix</filename> file, which will
|
|
||||||
introduce a new NixOS option called <option>home-manager.users</option>
|
|
||||||
whose type is an attribute set that maps user names to Home Manager
|
|
||||||
configurations.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
For example, a NixOS configuration may include the lines
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<programlisting language="nix">
|
|
||||||
users.users.eve.isNormalUser = true;
|
|
||||||
home-manager.users.eve = { pkgs, ... }: {
|
|
||||||
home.packages = [ pkgs.atool pkgs.httpie ];
|
|
||||||
programs.bash.enable = true;
|
|
||||||
};
|
|
||||||
</programlisting>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
and after a <command>nixos-rebuild switch</command> the user eve's
|
|
||||||
environment should include a basic Bash configuration and the packages atool
|
|
||||||
and httpie.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<note>
|
|
||||||
<para>
|
|
||||||
By default packages will be installed to
|
|
||||||
<filename>$HOME/.nix-profile</filename> but they can be installed to
|
|
||||||
<filename>/etc/profiles</filename> if
|
|
||||||
</para>
|
|
||||||
<programlisting language="nix">
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
</programlisting>
|
|
||||||
<para>
|
|
||||||
is added to the system configuration. This is necessary if, for example,
|
|
||||||
you wish to use <command>nixos-rebuild build-vm</command>. This option may
|
|
||||||
become the default value in the future.
|
|
||||||
</para>
|
|
||||||
</note>
|
|
||||||
|
|
||||||
<note>
|
|
||||||
<para>
|
|
||||||
By default, Home Manager uses a private <literal>pkgs</literal> instance
|
|
||||||
that is configured via the <option>home-manager.users.<name>.nixpkgs</option> options.
|
|
||||||
To instead use the global <literal>pkgs</literal> that is configured via
|
|
||||||
the system level <option>nixpkgs</option> options, set
|
|
||||||
</para>
|
|
||||||
<programlisting language="nix">
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
</programlisting>
|
|
||||||
<para>
|
|
||||||
This saves an extra Nixpkgs evaluation, adds consistency, and removes the
|
|
||||||
dependency on <envar>NIX_PATH</envar>, which is otherwise used for
|
|
||||||
importing Nixpkgs.
|
|
||||||
</para>
|
|
||||||
</note>
|
|
||||||
</section>
|
|
||||||
<section xml:id="sec-install-nix-darwin-module">
|
|
||||||
<title>nix-darwin module</title>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
Home Manager provides a module that allows you to prepare user
|
|
||||||
environments directly from the nix-darwin configuration file, which often is
|
|
||||||
more convenient than using the <command>home-manager</command> tool.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
To make the NixOS module available for use you must <option>import</option>
|
|
||||||
it into your system configuration. This is most conveniently done by adding
|
|
||||||
a Home Manager channel, for example
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<screen language="console">
|
|
||||||
<prompt>#</prompt> <userinput>nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager</userinput>
|
|
||||||
<prompt>#</prompt> <userinput>nix-channel --update</userinput>
|
|
||||||
</screen>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
if you are following Nixpkgs master or an unstable channel and
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<screen language="console">
|
|
||||||
<prompt>#</prompt> <userinput>nix-channel --add https://github.com/nix-community/home-manager/archive/release-20.03.tar.gz home-manager</userinput>
|
|
||||||
<prompt>#</prompt> <userinput>nix-channel --update</userinput>
|
|
||||||
</screen>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
if you follow a Nixpkgs version 20.03 channel.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
It is then possible to add
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<programlisting language="nix">
|
|
||||||
imports = [ <home-manager/nix-darwin> ];
|
|
||||||
</programlisting>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
to your nix-darwin <filename>configuration.nix</filename> file, which will
|
|
||||||
introduce a new NixOS option called <option>home-manager</option> whose type
|
|
||||||
is an attribute set that maps user names to Home Manager configurations.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
For example, a nix-darwin configuration may include the lines
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<programlisting language="nix">
|
|
||||||
home-manager.users.eve = { pkgs, ... }: {
|
|
||||||
home.packages = [ pkgs.atool pkgs.httpie ];
|
|
||||||
programs.bash.enable = true;
|
|
||||||
};
|
|
||||||
</programlisting>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
and after a <command>darwin-rebuild --switch</command> the user eve's
|
|
||||||
environment should include a basic Bash configuration and the packages atool
|
|
||||||
and httpie.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<note>
|
|
||||||
<para>
|
|
||||||
By default user packages will not be ignored in favor of
|
|
||||||
<option>environment.systemPackages</option>, but they will be intalled to
|
|
||||||
<option>/etc/profiles/per-user/$USERNAME</option> if
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<programlisting language="nix">
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
</programlisting>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
is added to the nix-darwin configuration. This option may become the default
|
|
||||||
value in the future.
|
|
||||||
</para>
|
|
||||||
</note>
|
|
||||||
|
|
||||||
<note>
|
|
||||||
<para>
|
|
||||||
By default, Home Manager uses a private <literal>pkgs</literal> instance
|
|
||||||
that is configured via the <option>home-manager.users.<name>.nixpkgs</option> options.
|
|
||||||
To instead use the global <literal>pkgs</literal> that is configured via
|
|
||||||
the system level <option>nixpkgs</option> options, set
|
|
||||||
</para>
|
|
||||||
<programlisting language="nix">
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
</programlisting>
|
|
||||||
<para>
|
|
||||||
This saves an extra Nixpkgs evaluation, adds consistency, and removes the
|
|
||||||
dependency on <envar>NIX_PATH</envar>, which is otherwise used for
|
|
||||||
importing Nixpkgs.
|
|
||||||
</para>
|
|
||||||
</note>
|
|
||||||
</section>
|
|
||||||
</chapter>
|
|
128
third_party/home-manager/doc/man-home-manager.xml
vendored
128
third_party/home-manager/doc/man-home-manager.xml
vendored
|
@ -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,85 +65,102 @@
|
||||||
<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>
|
||||||
|
--flake <replaceable>flake-uri</replaceable>
|
||||||
|
</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>
|
||||||
--max-jobs <replaceable>number</replaceable>
|
<group choice="req">
|
||||||
|
<arg choice="plain">
|
||||||
|
-j
|
||||||
|
</arg>
|
||||||
|
|
||||||
|
<arg choice="plain">
|
||||||
|
--max-jobs
|
||||||
|
</arg>
|
||||||
|
</group>
|
||||||
|
<replaceable>number</replaceable>
|
||||||
</arg>
|
</arg>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
@ -151,7 +172,7 @@
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
<para>
|
<para>
|
||||||
This command updates the user environment so that it corresponds to the
|
This command updates the user environment so that it corresponds to the
|
||||||
configuration specified in <filename>~/.config/nixpkgs/home.nix</filename>.
|
configuration specified in <filename>~/.config/nixpkgs/home.nix</filename> or <filename>~/.config/nixpkgs/flake.nix</filename>.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
All operations using this tool expects a sub-command that indicates the
|
All operations using this tool expects a sub-command that indicates the
|
||||||
|
@ -233,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>
|
||||||
|
@ -334,6 +367,18 @@
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<option>--flake <replaceable>flake-uri[#name]</replaceable></option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Build Home Manager configuration from the flake, which must contain the
|
||||||
|
output homeConfigurations.name. If no name is specified it will first try
|
||||||
|
username@hostname and then username.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<option>-b <replaceable>extension</replaceable></option>
|
<option>-b <replaceable>extension</replaceable></option>
|
||||||
|
@ -417,6 +462,9 @@
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<option>-j <replaceable>number</replaceable></option>
|
||||||
|
</term>
|
||||||
<term>
|
<term>
|
||||||
<option>--max-jobs <replaceable>number</replaceable></option>
|
<option>--max-jobs <replaceable>number</replaceable></option>
|
||||||
</term>
|
</term>
|
||||||
|
@ -428,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>
|
||||||
|
|
14
third_party/home-manager/doc/manual.xml
vendored
14
third_party/home-manager/doc/manual.xml
vendored
|
@ -14,10 +14,8 @@
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
If you encounter problems then please reach out on the IRC channel
|
If you encounter problems then please reach out on the IRC channel
|
||||||
<link xlink:href="https://webchat.freenode.net/?url=irc%3A%2F%2Firc.freenode.net%2Fhome-manager">#home-manager</link>
|
<link xlink:href="https://webchat.oftc.net/?channels=home-manager">#home-manager</link>
|
||||||
hosted by <link xlink:href="https://freenode.net/">freenode</link>.
|
hosted by <link xlink:href="https://oftc.net/">OFTC</link>.
|
||||||
The <link xlink:href="https://logs.nix.samueldr.com/home-manager/">channel logs</link>
|
|
||||||
are hosted courtesy of <link xlink:href="https://github.com/samueldr/">samueldr</link>.
|
|
||||||
If your problem is caused by a bug in Home Manager then it should
|
If your problem is caused by a bug in Home Manager then it should
|
||||||
be reported on the
|
be reported on the
|
||||||
<link xlink:href="https://github.com/nix-community/home-manager/issues">Home Manager issue tracker</link>.
|
<link xlink:href="https://github.com/nix-community/home-manager/issues">Home Manager issue tracker</link>.
|
||||||
|
@ -38,6 +36,14 @@
|
||||||
<title>Configuration Options</title>
|
<title>Configuration Options</title>
|
||||||
<xi:include href="./nmd-result/home-manager-options.xml" />
|
<xi:include href="./nmd-result/home-manager-options.xml" />
|
||||||
</appendix>
|
</appendix>
|
||||||
|
<appendix xml:id="ch-nixos-options">
|
||||||
|
<title>NixOS Module Options</title>
|
||||||
|
<xi:include href="./nmd-result/nixos-options.xml" />
|
||||||
|
</appendix>
|
||||||
|
<appendix xml:id="ch-nix-darwin-options">
|
||||||
|
<title>nix-darwin Module Options</title>
|
||||||
|
<xi:include href="./nmd-result/nix-darwin-options.xml" />
|
||||||
|
</appendix>
|
||||||
<appendix xml:id="ch-tools">
|
<appendix xml:id="ch-tools">
|
||||||
<title>Tools</title>
|
<title>Tools</title>
|
||||||
<xi:include href="./man-home-manager.xml" />
|
<xi:include href="./man-home-manager.xml" />
|
||||||
|
|
|
@ -6,6 +6,10 @@ This section lists the release notes for stable versions of Home Manager and the
|
||||||
|
|
||||||
:leveloffset: 1
|
:leveloffset: 1
|
||||||
|
|
||||||
|
include::rl-2111.adoc[]
|
||||||
|
|
||||||
|
include::rl-2105.adoc[]
|
||||||
|
|
||||||
include::rl-2009.adoc[]
|
include::rl-2009.adoc[]
|
||||||
|
|
||||||
include::rl-2003.adoc[]
|
include::rl-2003.adoc[]
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
[[sec-release-20.09]]
|
[[sec-release-20.09]]
|
||||||
== Release 20.09 (unreleased)
|
== Release 20.09
|
||||||
|
|
||||||
This is the current unstable branch and the information in this
|
The 20.09 release branch became the stable branch in late September, 2020.
|
||||||
section is therefore not final.
|
|
||||||
|
|
||||||
[[sec-release-20.09-highlights]]
|
[[sec-release-20.09-highlights]]
|
||||||
=== Highlights
|
=== Highlights
|
||||||
|
|
200
third_party/home-manager/doc/release-notes/rl-2105.adoc
vendored
Normal file
200
third_party/home-manager/doc/release-notes/rl-2105.adoc
vendored
Normal file
|
@ -0,0 +1,200 @@
|
||||||
|
[[sec-release-21.05]]
|
||||||
|
== Release 21.05
|
||||||
|
|
||||||
|
The 21.05 release branch became the stable branch in May, 2021.
|
||||||
|
|
||||||
|
[[sec-release-21.05-highlights]]
|
||||||
|
=== Highlights
|
||||||
|
|
||||||
|
This release has the following notable changes:
|
||||||
|
|
||||||
|
* The <<opt-programs.broot.verbs>> option is now a list rather than an
|
||||||
|
attribute set. To migrate, move the keys of the attrset into the list
|
||||||
|
items' `invocation` keys. For example,
|
||||||
|
+
|
||||||
|
[source,nix]
|
||||||
|
----
|
||||||
|
programs.broot.verbs = {
|
||||||
|
"p" = { execution = ":parent"; };
|
||||||
|
};
|
||||||
|
----
|
||||||
|
+
|
||||||
|
becomes
|
||||||
|
+
|
||||||
|
[source,nix]
|
||||||
|
----
|
||||||
|
programs.broot.verbs = [
|
||||||
|
{
|
||||||
|
invocation = "p";
|
||||||
|
execution = ":parent";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
----
|
||||||
|
|
||||||
|
* The <<opt-programs.mpv.package>> option has been changed to allow custom
|
||||||
|
derivations. The following configuration is now possible:
|
||||||
|
+
|
||||||
|
[source,nix]
|
||||||
|
----
|
||||||
|
programs.mpv.package = (pkgs.wrapMpv (pkgs.mpv-unwrapped.override {
|
||||||
|
vapoursynthSupport = true;
|
||||||
|
}) {
|
||||||
|
extraMakeWrapperArgs = [
|
||||||
|
"--prefix" "LD_LIBRARY_PATH" ":" "${pkgs.vapoursynth-mvtools}/lib/vapoursynth"
|
||||||
|
];
|
||||||
|
});
|
||||||
|
----
|
||||||
|
+
|
||||||
|
As a result of this change, <<opt-programs.mpv.package>> is no longer the
|
||||||
|
resulting derivation. Use the newly introduced `programs.mpv.finalPackage`
|
||||||
|
instead.
|
||||||
|
|
||||||
|
* The <<opt-programs.rofi.extraConfig>> option is now an attribute set rather
|
||||||
|
than a string. To migrate, move each line into the attribute set,
|
||||||
|
removing the `rofi.` prefix from the keys. For example,
|
||||||
|
+
|
||||||
|
[source,nix]
|
||||||
|
----
|
||||||
|
programs.rofi.extraConfig = ''
|
||||||
|
rofi.show-icons: true
|
||||||
|
rofi.modi: drun,emoji,ssh
|
||||||
|
'';
|
||||||
|
----
|
||||||
|
+
|
||||||
|
becomes
|
||||||
|
+
|
||||||
|
[source,nix]
|
||||||
|
----
|
||||||
|
programs.rofi.extraConfig = {
|
||||||
|
show-icons = true;
|
||||||
|
modi = "drun,emoji,ssh";
|
||||||
|
};
|
||||||
|
----
|
||||||
|
+
|
||||||
|
* The <<opt-programs.rofi.theme>> option now supports defining a theme
|
||||||
|
using an attribute set, the following configuration is now possible:
|
||||||
|
+
|
||||||
|
[source,nix]
|
||||||
|
----
|
||||||
|
programs.rofi.theme = let
|
||||||
|
# Necessary to avoid quoting non-string values
|
||||||
|
inherit (config.lib.formats.rasi) mkLiteral;
|
||||||
|
in {
|
||||||
|
"@import" = "~/.config/rofi/theme.rasi";
|
||||||
|
|
||||||
|
"*" = {
|
||||||
|
background-color = mkLiteral "#000000";
|
||||||
|
foreground-color = mkLiteral "rgba ( 250, 251, 252, 100 % )";
|
||||||
|
border-color = mkLiteral "#FFFFFF";
|
||||||
|
width = 512;
|
||||||
|
};
|
||||||
|
|
||||||
|
"#textbox-prompt-colon" = {
|
||||||
|
expand = false;
|
||||||
|
str = ":";
|
||||||
|
margin = mkLiteral "0px 0.3em 0em 0em";
|
||||||
|
text-color = mkLiteral "@foreground-color";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
|
* The `services.redshift.extraOptions` and `services.gammastep.extraOptions`
|
||||||
|
options were removed in favor of <<opt-services.redshift.settings>> and
|
||||||
|
`services.gammastep.settings`, that are now an attribute set rather
|
||||||
|
than a string. They also support new features not available before, for
|
||||||
|
example:
|
||||||
|
+
|
||||||
|
[source,nix]
|
||||||
|
----
|
||||||
|
services.redshift = {
|
||||||
|
dawnTime = "6:00-7:45";
|
||||||
|
duskTime = "18:35-20:15";
|
||||||
|
settings = {
|
||||||
|
redshift = {
|
||||||
|
gamma = 0.8;
|
||||||
|
adjustment-method = "randr";
|
||||||
|
};
|
||||||
|
|
||||||
|
randr = {
|
||||||
|
screen = 0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
----
|
||||||
|
+
|
||||||
|
It is recommended to check either
|
||||||
|
https://github.com/jonls/redshift/blob/master/redshift.conf.sample[redshift.conf.sample] or
|
||||||
|
https://gitlab.com/chinstrap/gammastep/-/blob/master/gammastep.conf.sample[gammastep.conf.sample]
|
||||||
|
for the available additional options in each program.
|
||||||
|
|
||||||
|
* Specifying `programs.neomutt.binds.map` or `programs.neomutt.macros.map` as a
|
||||||
|
single string is now deprecated in favor of specfiying it as a list of
|
||||||
|
strings.
|
||||||
|
|
||||||
|
* The `programs.neovim.configure` is deprecated in favor of other `programs.neovim` options;
|
||||||
|
please use the other options at your disposal:
|
||||||
|
+
|
||||||
|
[source,nix]
|
||||||
|
----
|
||||||
|
configure.packages.*.opt -> programs.neovim.plugins = [ { plugin = ...; optional = true; }]
|
||||||
|
configure.packages.*.start -> programs.neovim.plugins = [ { plugin = ...; }]
|
||||||
|
configure.customRC -> programs.neovim.extraConfig
|
||||||
|
----
|
||||||
|
|
||||||
|
* Home Manager now respects the `NO_COLOR` environment variable as per
|
||||||
|
https://no-color.org/[].
|
||||||
|
|
||||||
|
* Qt module now supports <<opt-qt.style.name>> to specify a theme name and
|
||||||
|
<<opt-qt.style.package>> to specify a theme package. If you have set
|
||||||
|
<<opt-qt.platformTheme>> to `gnome`, a <<opt-qt.style.package>> compatible
|
||||||
|
with both Qt and Gtk is now required to be set. For instance:
|
||||||
|
+
|
||||||
|
[source,nix]
|
||||||
|
----
|
||||||
|
qt = {
|
||||||
|
platformTheme = "gnome";
|
||||||
|
style = {
|
||||||
|
name = "adwaita-dark";
|
||||||
|
package = pkgs.adwaita-qt;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
----
|
||||||
|
|
||||||
|
* The library type `fontType` now has a `size` attribute in addition to `name`. For example:
|
||||||
|
+
|
||||||
|
[source,nix]
|
||||||
|
----
|
||||||
|
font = {
|
||||||
|
name = "DejaVu Sans";
|
||||||
|
size = 8;
|
||||||
|
};
|
||||||
|
----
|
||||||
|
|
||||||
|
* The <<opt-programs.htop.settings>> option is introduced to replace individual
|
||||||
|
options in `programs.htop`. To migrate, set the htop options directly in
|
||||||
|
<<opt-programs.htop.settings>>. For example:
|
||||||
|
+
|
||||||
|
[source,nix]
|
||||||
|
----
|
||||||
|
programs.htop = {
|
||||||
|
enabled = true;
|
||||||
|
settings = {
|
||||||
|
color_scheme = 5;
|
||||||
|
delay = 15;
|
||||||
|
highlight_base_name = 1;
|
||||||
|
highlight_megabytes = 1;
|
||||||
|
highlight_threads = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
----
|
||||||
|
|
||||||
|
[[sec-release-21.05-state-version-changes]]
|
||||||
|
=== State Version Changes
|
||||||
|
|
||||||
|
The state version in this release includes the changes below. These
|
||||||
|
changes are only active if the `home.stateVersion` option is set to
|
||||||
|
"21.05" or later.
|
||||||
|
|
||||||
|
* The `newsboat` module now stores generated configuration in
|
||||||
|
`$XDG_CONFIG_HOME/newsboat`.
|
21
third_party/home-manager/doc/release-notes/rl-2111.adoc
vendored
Normal file
21
third_party/home-manager/doc/release-notes/rl-2111.adoc
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
[[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:
|
||||||
|
|
||||||
|
* Nothing has happened.
|
||||||
|
|
||||||
|
[[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.
|
53
third_party/home-manager/flake.nix
vendored
53
third_party/home-manager/flake.nix
vendored
|
@ -1,23 +1,46 @@
|
||||||
{
|
{
|
||||||
description = "Home Manager for Nix";
|
description = "Home Manager for Nix";
|
||||||
|
|
||||||
outputs = { self, nixpkgs }: rec {
|
outputs = { self, nixpkgs }:
|
||||||
nixosModules.home-manager = import ./nixos;
|
let
|
||||||
|
# List of systems supported by home-manager binary
|
||||||
|
supportedSystems = nixpkgs.lib.platforms.unix;
|
||||||
|
|
||||||
darwinModules.home-manager = import ./nix-darwin;
|
# Function to generate a set based on supported systems
|
||||||
|
forAllSystems = f:
|
||||||
|
nixpkgs.lib.genAttrs supportedSystems (system: f system);
|
||||||
|
|
||||||
lib = {
|
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
|
||||||
homeManagerConfiguration = { configuration, system, homeDirectory
|
in rec {
|
||||||
, username
|
nixosModules.home-manager = import ./nixos;
|
||||||
, pkgs ? builtins.getAttr system nixpkgs.outputs.legacyPackages
|
nixosModule = self.nixosModules.home-manager;
|
||||||
, check ? true }@args:
|
|
||||||
import ./modules {
|
darwinModules.home-manager = import ./nix-darwin;
|
||||||
inherit pkgs check;
|
darwinModule = self.darwinModules.home-manager;
|
||||||
configuration = { ... }: {
|
|
||||||
imports = [ configuration ];
|
packages = forAllSystems (system: {
|
||||||
home = { inherit homeDirectory username; };
|
home-manager = nixpkgsFor.${system}.callPackage ./home-manager { };
|
||||||
|
});
|
||||||
|
|
||||||
|
defaultPackage =
|
||||||
|
forAllSystems (system: self.packages.${system}.home-manager);
|
||||||
|
|
||||||
|
lib = {
|
||||||
|
hm = import ./modules/lib { lib = nixpkgs.lib; };
|
||||||
|
homeManagerConfiguration = { configuration, system, homeDirectory
|
||||||
|
, username, extraModules ? [ ], extraSpecialArgs ? { }
|
||||||
|
, pkgs ? builtins.getAttr system nixpkgs.outputs.legacyPackages
|
||||||
|
, check ? true, stateVersion ? "20.09" }@args:
|
||||||
|
assert nixpkgs.lib.versionAtLeast stateVersion "20.09";
|
||||||
|
|
||||||
|
import ./modules {
|
||||||
|
inherit pkgs check extraSpecialArgs;
|
||||||
|
configuration = { ... }: {
|
||||||
|
imports = [ configuration ] ++ extraModules;
|
||||||
|
home = { inherit homeDirectory stateVersion username; };
|
||||||
|
nixpkgs = { inherit (pkgs) config overlays; };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
9
third_party/home-manager/format
vendored
9
third_party/home-manager/format
vendored
|
@ -18,7 +18,6 @@ esac
|
||||||
find . -name '*.nix' \
|
find . -name '*.nix' \
|
||||||
! -path ./modules/programs/irssi.nix \
|
! -path ./modules/programs/irssi.nix \
|
||||||
\
|
\
|
||||||
! -path ./home-manager/default.nix \
|
|
||||||
! -path ./home-manager/home-manager.nix \
|
! -path ./home-manager/home-manager.nix \
|
||||||
! -path ./modules/default.nix \
|
! -path ./modules/default.nix \
|
||||||
! -path ./modules/files.nix \
|
! -path ./modules/files.nix \
|
||||||
|
@ -26,32 +25,24 @@ find . -name '*.nix' \
|
||||||
! -path ./modules/lib/default.nix \
|
! -path ./modules/lib/default.nix \
|
||||||
! -path ./modules/lib/file-type.nix \
|
! -path ./modules/lib/file-type.nix \
|
||||||
! -path ./modules/manual.nix \
|
! -path ./modules/manual.nix \
|
||||||
! -path ./modules/misc/dconf.nix \
|
|
||||||
! -path ./modules/misc/news.nix \
|
! -path ./modules/misc/news.nix \
|
||||||
! -path ./modules/misc/nixpkgs.nix \
|
! -path ./modules/misc/nixpkgs.nix \
|
||||||
! -path ./modules/misc/xdg.nix \
|
! -path ./modules/misc/xdg.nix \
|
||||||
! -path ./modules/modules.nix \
|
! -path ./modules/modules.nix \
|
||||||
! -path ./modules/programs/afew.nix \
|
|
||||||
! -path ./modules/programs/bash.nix \
|
! -path ./modules/programs/bash.nix \
|
||||||
! -path ./modules/programs/firefox.nix \
|
! -path ./modules/programs/firefox.nix \
|
||||||
! -path ./modules/programs/gpg.nix \
|
! -path ./modules/programs/gpg.nix \
|
||||||
! -path ./modules/programs/lesspipe.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/kbfs.nix \
|
|
||||||
! -path ./modules/services/keybase.nix \
|
|
||||||
! -path ./modules/services/mpd.nix \
|
! -path ./modules/services/mpd.nix \
|
||||||
! -path ./modules/services/sxhkd.nix \
|
! -path ./modules/services/sxhkd.nix \
|
||||||
! -path ./modules/services/window-managers/i3.nix \
|
|
||||||
! -path ./modules/systemd.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/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/tmux/default.nix \
|
|
||||||
! -path ./tests/modules/programs/zsh/session-variables.nix \
|
! -path ./tests/modules/programs/zsh/session-variables.nix \
|
||||||
! -path ./tests/modules/services/sxhkd/service.nix \
|
! -path ./tests/modules/services/sxhkd/service.nix \
|
||||||
! -path ./tests/modules/systemd/services.nix \
|
! -path ./tests/modules/systemd/services.nix \
|
||||||
|
|
|
@ -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,14 +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" \
|
||||||
|
"--cores" "--debug" "--keep-failed" "--keep-going" "-j" "--max-jobs" "--no-substitute" "--show-trace" "--substitute")
|
||||||
|
|
||||||
# ^ « home-manager »'s options.
|
# ^ « home-manager »'s options.
|
||||||
|
|
||||||
|
@ -353,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
|
||||||
|
|
59
third_party/home-manager/home-manager/completion.zsh
vendored
Normal file
59
third_party/home-manager/home-manager/completion.zsh
vendored
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
#compdef home-manager
|
||||||
|
|
||||||
|
local state ret=1
|
||||||
|
|
||||||
|
_arguments \
|
||||||
|
'-A[attribute]:ATTRIBUTE:()' \
|
||||||
|
'-I[search path]:PATH:_files -/' \
|
||||||
|
'-b[backup files]:EXT:()' \
|
||||||
|
'--cores[cores]:NUM:()' \
|
||||||
|
'--debug[debug]' \
|
||||||
|
'--keep-failed[keep failed]' \
|
||||||
|
'--keep-going[keep going]' \
|
||||||
|
'(-h --help)'{--help,-h}'[help]' \
|
||||||
|
'(-v --verbose)'{--verbose,-v}'[verbose]' \
|
||||||
|
'(-n --dry-run)'{--dry-run,-n}'[dry run]' \
|
||||||
|
'(-f --file)'{--file,-f}'[configuration file]:FILE:_files' \
|
||||||
|
'(-j --max-jobs)'{--max-jobs,-j}'[max jobs]:NUM:()' \
|
||||||
|
'--option[option]:NAME VALUE:()' \
|
||||||
|
'--show-trace[show trace]' \
|
||||||
|
'1: :->cmds' \
|
||||||
|
'*:: :->args' && ret=0
|
||||||
|
|
||||||
|
case "$state" in
|
||||||
|
cmds)
|
||||||
|
_values 'command' \
|
||||||
|
'help[help]' \
|
||||||
|
'edit[edit]' \
|
||||||
|
'option[inspect option]' \
|
||||||
|
'build[build]' \
|
||||||
|
'switch[switch]' \
|
||||||
|
'generations[list generations]' \
|
||||||
|
'remove-generations[remove generations]' \
|
||||||
|
'expire-generations[expire generations]' \
|
||||||
|
'packages[managed packages]' \
|
||||||
|
'news[read the news]' \
|
||||||
|
'uninstall[uninstall]' && ret=0
|
||||||
|
;;
|
||||||
|
args)
|
||||||
|
case $line[1] in
|
||||||
|
remove-generations)
|
||||||
|
_values 'generations' \
|
||||||
|
$(home-manager generations | cut -d ' ' -f 5) && ret=0
|
||||||
|
;;
|
||||||
|
build|switch)
|
||||||
|
_arguments \
|
||||||
|
'--cores[cores]:NUM:()' \
|
||||||
|
'--debug[debug]' \
|
||||||
|
'--keep-failed[keep failed]' \
|
||||||
|
'--keep-going[keep going]' \
|
||||||
|
'--max-jobs[max jobs]:NUM:()' \
|
||||||
|
'--no-substitute[no substitute]' \
|
||||||
|
'--option[option]:NAME VALUE:()' \
|
||||||
|
'--show-trace[show trace]' \
|
||||||
|
'--substitute[substitute]'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
esac
|
||||||
|
|
||||||
|
return ret
|
|
@ -1,40 +1,42 @@
|
||||||
{ 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
|
||||||
# `$HOME/.nixpkgs/home-manager`.
|
# `$HOME/.nixpkgs/home-manager`.
|
||||||
, path ? null
|
, path ? null }:
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
pathStr = if path == null then "" else path;
|
pathStr = if path == null then "" else path;
|
||||||
|
|
||||||
in
|
nixos-option =
|
||||||
|
callPackage (pkgs.path + "/nixos/modules/installer/tools/nixos-option") { };
|
||||||
|
|
||||||
runCommand
|
in runCommand "home-manager" {
|
||||||
"home-manager"
|
preferLocalBuild = true;
|
||||||
{
|
allowSubstitutes = false;
|
||||||
preferLocalBuild = true;
|
meta = with lib; {
|
||||||
allowSubstitutes = false;
|
description = "A user environment configurator";
|
||||||
meta = with lib; {
|
maintainers = [ maintainers.rycee ];
|
||||||
description = "A user environment configurator";
|
platforms = platforms.unix;
|
||||||
maintainers = [ maintainers.rycee ];
|
license = licenses.mit;
|
||||||
platforms = platforms.unix;
|
};
|
||||||
license = licenses.mit;
|
} ''
|
||||||
};
|
install -v -D -m755 ${./home-manager} $out/bin/home-manager
|
||||||
}
|
|
||||||
''
|
|
||||||
install -v -D -m755 ${./home-manager} $out/bin/home-manager
|
|
||||||
|
|
||||||
substituteInPlace $out/bin/home-manager \
|
substituteInPlace $out/bin/home-manager \
|
||||||
--subst-var-by bash "${bash}" \
|
--subst-var-by bash "${bash}" \
|
||||||
--subst-var-by coreutils "${coreutils}" \
|
--subst-var-by coreutils "${coreutils}" \
|
||||||
--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 HOME_MANAGER_PATH '${pathStr}'
|
--subst-var-by nixos-option "${nixos-option}" \
|
||||||
|
--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} \
|
||||||
|
$out/share/zsh/site-functions/_home-manager
|
||||||
|
''
|
||||||
|
|
152
third_party/home-manager/home-manager/home-manager
vendored
152
third_party/home-manager/home-manager/home-manager
vendored
|
@ -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
|
||||||
|
|
||||||
|
@ -74,7 +74,75 @@ function setHomeManagerNixPath() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setFlakeAttribute() {
|
||||||
|
local configFlake="${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/flake.nix"
|
||||||
|
if [[ -z $FLAKE_ARG && ! -v HOME_MANAGER_CONFIG && -e "$configFlake" ]]; then
|
||||||
|
FLAKE_ARG="$(dirname "$(readlink -f "$configFlake")")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "$FLAKE_ARG" ]]; then
|
||||||
|
local flake="${FLAKE_ARG%#*}"
|
||||||
|
case $FLAKE_ARG in
|
||||||
|
*#*)
|
||||||
|
local name="${FLAKE_ARG#*#}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
local name="$USER@$(hostname)"
|
||||||
|
if [ "$(nix eval "$flake#homeConfigurations" --apply "x: x ? \"$name\"")" = "false" ]; then
|
||||||
|
name="$USER"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
export FLAKE_CONFIG_URI="$flake#homeConfigurations.\"$name\""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function doInspectOption() {
|
||||||
|
setFlakeAttribute
|
||||||
|
if [[ -v FLAKE_CONFIG_URI ]]; then
|
||||||
|
errorEcho "Can't inspect options of a flake configuration"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
setConfigFile
|
||||||
|
setHomeManagerNixPath
|
||||||
|
|
||||||
|
local extraArgs=("$@")
|
||||||
|
|
||||||
|
for p in "${EXTRA_NIX_PATH[@]}"; do
|
||||||
|
extraArgs=("${extraArgs[@]}" "-I" "$p")
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -v VERBOSE ]]; then
|
||||||
|
extraArgs=("${extraArgs[@]}" "--show-trace")
|
||||||
|
fi
|
||||||
|
|
||||||
|
local HOME_MANAGER_CONFIG_NIX HOME_MANAGER_CONFIG_ATTRIBUTE_NIX
|
||||||
|
HOME_MANAGER_CONFIG_NIX=${HOME_MANAGER_CONFIG//'\'/'\\'}
|
||||||
|
HOME_MANAGER_CONFIG_NIX=${HOME_MANAGER_CONFIG_NIX//'"'/'\"'}
|
||||||
|
HOME_MANAGER_CONFIG_NIX=${HOME_MANAGER_CONFIG_NIX//$'\n'/$'\\n'}
|
||||||
|
HOME_MANAGER_CONFIG_ATTRIBUTE_NIX=${HOME_MANAGER_CONFIG_ATTRIBUTE//'\'/'\\'}
|
||||||
|
HOME_MANAGER_CONFIG_ATTRIBUTE_NIX=${HOME_MANAGER_CONFIG_ATTRIBUTE_NIX//'"'/'\"'}
|
||||||
|
HOME_MANAGER_CONFIG_ATTRIBUTE_NIX=${HOME_MANAGER_CONFIG_ATTRIBUTE_NIX//$'\n'/$'\\n'}
|
||||||
|
local modulesExpr
|
||||||
|
modulesExpr="let confPath = \"${HOME_MANAGER_CONFIG_NIX}\"; "
|
||||||
|
modulesExpr+="confAttr = \"${HOME_MANAGER_CONFIG_ATTRIBUTE_NIX}\"; in "
|
||||||
|
modulesExpr+="(import <home-manager/modules> {"
|
||||||
|
modulesExpr+=" configuration = if confAttr == \"\" then confPath else (import confPath).\${confAttr};"
|
||||||
|
modulesExpr+=" pkgs = import <nixpkgs> {}; check = true; })"
|
||||||
|
|
||||||
|
nixos-option \
|
||||||
|
--options_expr "$modulesExpr.options" \
|
||||||
|
--config_expr "$modulesExpr.config" \
|
||||||
|
"${extraArgs[@]}" \
|
||||||
|
"${PASSTHROUGH_OPTS[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
function doInstantiate() {
|
function doInstantiate() {
|
||||||
|
setFlakeAttribute
|
||||||
|
if [[ -v FLAKE_CONFIG_URI ]]; then
|
||||||
|
errorEcho "Can't instantiate a flake configuration"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
setConfigFile
|
setConfigFile
|
||||||
setHomeManagerNixPath
|
setHomeManagerNixPath
|
||||||
|
|
||||||
|
@ -178,6 +246,17 @@ function doBuild() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
setFlakeAttribute
|
||||||
|
if [[ -v FLAKE_CONFIG_URI ]]; then
|
||||||
|
local exitCode=0
|
||||||
|
nix build \
|
||||||
|
"${PASSTHROUGH_OPTS[@]}" \
|
||||||
|
${DRY_RUN+--dry-run} \
|
||||||
|
"$FLAKE_CONFIG_URI.activationPackage" \
|
||||||
|
|| exitCode=1
|
||||||
|
return $exitCode
|
||||||
|
fi
|
||||||
|
|
||||||
setWorkDir
|
setWorkDir
|
||||||
|
|
||||||
local newsInfo
|
local newsInfo
|
||||||
|
@ -194,6 +273,16 @@ function doBuild() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function doSwitch() {
|
function doSwitch() {
|
||||||
|
setFlakeAttribute
|
||||||
|
if [[ -v FLAKE_CONFIG_URI ]]; then
|
||||||
|
local exitCode=0
|
||||||
|
nix run \
|
||||||
|
"${PASSTHROUGH_OPTS[@]}" \
|
||||||
|
"$FLAKE_CONFIG_URI.activationPackage" \
|
||||||
|
|| exitCode=1
|
||||||
|
return $exitCode
|
||||||
|
fi
|
||||||
|
|
||||||
setWorkDir
|
setWorkDir
|
||||||
|
|
||||||
local newsInfo
|
local newsInfo
|
||||||
|
@ -221,7 +310,7 @@ function doSwitch() {
|
||||||
function doListGens() {
|
function doListGens() {
|
||||||
# Whether to colorize the generations output.
|
# Whether to colorize the generations output.
|
||||||
local color="never"
|
local color="never"
|
||||||
if [[ -t 1 ]]; then
|
if [[ ! -v NO_COLOR && -t 1 ]]; then
|
||||||
color="always"
|
color="always"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -409,22 +498,25 @@ function doHelp() {
|
||||||
echo
|
echo
|
||||||
echo "Options"
|
echo "Options"
|
||||||
echo
|
echo
|
||||||
echo " -f FILE The home configuration file."
|
echo " -f FILE The home configuration file."
|
||||||
echo " Default is '~/.config/nixpkgs/home.nix'."
|
echo " Default is '~/.config/nixpkgs/home.nix'."
|
||||||
echo " -A ATTRIBUTE Optional attribute that selects a configuration"
|
echo " -A ATTRIBUTE Optional attribute that selects a configuration"
|
||||||
echo " expression in the configuration file."
|
echo " expression in the configuration file."
|
||||||
echo " -I PATH Add a path to the Nix expression search path."
|
echo " -I PATH Add a path to the Nix expression search path."
|
||||||
echo " -b EXT Move existing files to new path rather than fail."
|
echo " --flake flake-uri Use home-manager configuration at flake-uri"
|
||||||
echo " -v Verbose output"
|
echo " -b EXT Move existing files to new path rather than fail."
|
||||||
echo " -n Do a dry run, only prints what actions would be taken"
|
echo " -v Verbose output"
|
||||||
echo " -h Print this help"
|
echo " -n Do a dry run, only prints what actions would be taken"
|
||||||
|
echo " -h Print this help"
|
||||||
echo
|
echo
|
||||||
echo "Options passed on to nix-build(1)"
|
echo "Options passed on to nix-build(1)"
|
||||||
echo
|
echo
|
||||||
|
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 " --max-jobs NUM"
|
echo " -j, --max-jobs NUM"
|
||||||
echo " --option NAME VALUE"
|
echo " --option NAME VALUE"
|
||||||
echo " --show-trace"
|
echo " --show-trace"
|
||||||
echo " --(no-)substitute"
|
echo " --(no-)substitute"
|
||||||
|
@ -435,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"
|
||||||
|
@ -466,12 +561,13 @@ HOME_MANAGER_CONFIG_ATTRIBUTE=""
|
||||||
PASSTHROUGH_OPTS=()
|
PASSTHROUGH_OPTS=()
|
||||||
COMMAND=""
|
COMMAND=""
|
||||||
COMMAND_ARGS=()
|
COMMAND_ARGS=()
|
||||||
|
FLAKE_ARG=""
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
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)
|
||||||
|
@ -490,6 +586,21 @@ while [[ $# -gt 0 ]]; do
|
||||||
HOME_MANAGER_CONFIG="$1"
|
HOME_MANAGER_CONFIG="$1"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--flake)
|
||||||
|
FLAKE_ARG="$1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--recreate-lock-file|--no-update-lock-file|--no-write-lock-file|--no-registries|--commit-lock-file)
|
||||||
|
PASSTHROUGH_OPTS+=("$opt")
|
||||||
|
;;
|
||||||
|
--update-input)
|
||||||
|
PASSTHROUGH_OPTS+=("$opt" "$1")
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--override-input)
|
||||||
|
PASSTHROUGH_OPTS+=("$opt" "$1" "$2")
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
doHelp
|
doHelp
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -497,24 +608,28 @@ while [[ $# -gt 0 ]]; do
|
||||||
-n|--dry-run)
|
-n|--dry-run)
|
||||||
export DRY_RUN=1
|
export DRY_RUN=1
|
||||||
;;
|
;;
|
||||||
--option)
|
--option|--arg|--argstr)
|
||||||
PASSTHROUGH_OPTS+=("$opt" "$1" "$2")
|
PASSTHROUGH_OPTS+=("$opt" "$1" "$2")
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
--max-jobs|--cores)
|
-j|--max-jobs|--cores)
|
||||||
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")
|
||||||
;;
|
;;
|
||||||
-v|--verbose)
|
-v|--verbose)
|
||||||
export VERBOSE=1
|
export VERBOSE=1
|
||||||
;;
|
;;
|
||||||
|
--version)
|
||||||
|
echo 21.11
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
case $COMMAND in
|
case $COMMAND in
|
||||||
expire-generations|remove-generations)
|
expire-generations|remove-generations|option)
|
||||||
COMMAND_ARGS+=("$opt")
|
COMMAND_ARGS+=("$opt")
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -559,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 = "20.09";
|
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";
|
||||||
|
|
46
third_party/home-manager/modules/config/i18n.nix
vendored
Normal file
46
third_party/home-manager/modules/config/i18n.nix
vendored
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
# The glibc package in Nixpkgs is patched to make it possible to specify
|
||||||
|
# an alternative path for the locale archive through a special environment
|
||||||
|
# variable. This would allow different versions of glibc to coexist on the
|
||||||
|
# same system because each version of glibc could look up different paths
|
||||||
|
# for its locale archive should the archive format ever change in
|
||||||
|
# incompatible ways.
|
||||||
|
#
|
||||||
|
# See also:
|
||||||
|
# - localedef(1)
|
||||||
|
# - https://nixos.org/manual/nixpkgs/stable/#locales
|
||||||
|
# - https://github.com/NixOS/nixpkgs/issues/38991
|
||||||
|
#
|
||||||
|
# Note, the name of the said environment variable gets updated with each
|
||||||
|
# breaking release of the glibcLocales package. Periodically check the link
|
||||||
|
# below for changes:
|
||||||
|
# https://github.com/NixOS/nixpkgs/blob/nixpkgs-unstable/pkgs/development/libraries/glibc/nix-locale-archive.patch
|
||||||
|
|
||||||
|
{ lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
inherit (pkgs.glibcLocales) version;
|
||||||
|
|
||||||
|
archivePath = "${pkgs.glibcLocales}/lib/locale/locale-archive";
|
||||||
|
|
||||||
|
# lookup the version of glibcLocales and set the appropriate environment vars
|
||||||
|
localeVars = if versionAtLeast version "2.27" then {
|
||||||
|
LOCALE_ARCHIVE_2_27 = archivePath;
|
||||||
|
} else if versionAtLeast version "2.11" then {
|
||||||
|
LOCALE_ARCHIVE_2_11 = archivePath;
|
||||||
|
} else
|
||||||
|
{ };
|
||||||
|
|
||||||
|
in {
|
||||||
|
meta.maintainers = with maintainers; [ midchildan ];
|
||||||
|
|
||||||
|
config = {
|
||||||
|
# For shell sessions.
|
||||||
|
home.sessionVariables = localeVars;
|
||||||
|
|
||||||
|
# For desktop apps.
|
||||||
|
systemd.user.sessionVariables = localeVars;
|
||||||
|
};
|
||||||
|
}
|
6
third_party/home-manager/modules/default.nix
vendored
6
third_party/home-manager/modules/default.nix
vendored
|
@ -1,9 +1,11 @@
|
||||||
{ configuration
|
{ configuration
|
||||||
, pkgs
|
, pkgs
|
||||||
, lib ? pkgs.stdenv.lib
|
, lib ? pkgs.lib
|
||||||
|
|
||||||
# Whether to check that each option has a matching declaration.
|
# Whether to check that each option has a matching declaration.
|
||||||
, check ? true
|
, check ? true
|
||||||
|
# Extra arguments passed to specialArgs.
|
||||||
|
, extraSpecialArgs ? { }
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
@ -31,7 +33,7 @@ let
|
||||||
modules = [ configuration ] ++ hmModules;
|
modules = [ configuration ] ++ hmModules;
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
modulesPath = builtins.toString ./.;
|
modulesPath = builtins.toString ./.;
|
||||||
};
|
} // extraSpecialArgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
module = showWarnings (
|
module = showWarnings (
|
||||||
|
|
75
third_party/home-manager/modules/files.nix
vendored
75
third_party/home-manager/modules/files.nix
vendored
|
@ -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})
|
||||||
|
|
||||||
|
@ -140,7 +162,7 @@ in
|
||||||
# source and target generation.
|
# source and target generation.
|
||||||
home.activation.linkGeneration = hm.dag.entryAfter ["writeBoundary"] (
|
home.activation.linkGeneration = hm.dag.entryAfter ["writeBoundary"] (
|
||||||
let
|
let
|
||||||
link = pkgs.writeText "link" ''
|
link = pkgs.writeShellScript "link" ''
|
||||||
newGenFiles="$1"
|
newGenFiles="$1"
|
||||||
shift
|
shift
|
||||||
for sourcePath in "$@" ; do
|
for sourcePath in "$@" ; do
|
||||||
|
@ -155,12 +177,12 @@ in
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
cleanup = pkgs.writeText "cleanup" ''
|
cleanup = pkgs.writeShellScript "cleanup" ''
|
||||||
. ${./lib-bash/color-echo.sh}
|
. ${./lib-bash/color-echo.sh}
|
||||||
|
|
||||||
# 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/*"
|
||||||
|
|
||||||
newGenFiles="$1"
|
newGenFiles="$1"
|
||||||
shift 1
|
shift 1
|
||||||
|
@ -235,18 +257,34 @@ in
|
||||||
);
|
);
|
||||||
|
|
||||||
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 +292,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 +309,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")"
|
||||||
|
|
|
@ -390,6 +390,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 +419,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"));
|
||||||
|
@ -493,7 +533,24 @@ in
|
||||||
''
|
''
|
||||||
else
|
else
|
||||||
''
|
''
|
||||||
$DRY_RUN_CMD nix-env -i ${cfg.path}
|
if ! $DRY_RUN_CMD nix-env -i ${cfg.path} ; then
|
||||||
|
cat <<EOF
|
||||||
|
|
||||||
|
Oops, nix-env failed to install your new Home Manager profile!
|
||||||
|
|
||||||
|
Perhaps there is a conflict with a package that was installed using
|
||||||
|
'nix-env -i'? Try running
|
||||||
|
|
||||||
|
nix-env -q
|
||||||
|
|
||||||
|
and if there is a conflicting package you can remove it with
|
||||||
|
|
||||||
|
nix-env -e {package name}
|
||||||
|
|
||||||
|
Then try activating your Home Manager configuration again.
|
||||||
|
EOF
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -524,9 +581,7 @@ in
|
||||||
]
|
]
|
||||||
+ optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";
|
+ optionalString (!cfg.emptyActivationPath) "\${PATH:+:}$PATH";
|
||||||
|
|
||||||
activationScript = pkgs.writeScript "activation-script" ''
|
activationScript = pkgs.writeShellScript "activation-script" ''
|
||||||
#!${pkgs.runtimeShell}
|
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
@ -552,6 +607,9 @@ in
|
||||||
|
|
||||||
cp ${activationScript} $out/activate
|
cp ${activationScript} $out/activate
|
||||||
|
|
||||||
|
mkdir $out/bin
|
||||||
|
ln -s $out/activate $out/bin/home-manager-generation
|
||||||
|
|
||||||
substituteInPlace $out/activate \
|
substituteInPlace $out/activate \
|
||||||
--subst-var-by GENERATION_DIR $out
|
--subst-var-by GENERATION_DIR $out
|
||||||
|
|
||||||
|
|
102
third_party/home-manager/modules/i18n/input-method/default.nix
vendored
Normal file
102
third_party/home-manager/modules/i18n/input-method/default.nix
vendored
Normal file
|
@ -0,0 +1,102 @@
|
||||||
|
{ 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) {
|
||||||
|
home.packages = [ cfg.package gtk2Cache gtk3Cache ];
|
||||||
|
};
|
||||||
|
|
||||||
|
meta.maintainers = with lib; [ hm.maintainers.kranzes ];
|
||||||
|
}
|
50
third_party/home-manager/modules/i18n/input-method/fcitx.nix
vendored
Normal file
50
third_party/home-manager/modules/i18n/input-method/fcitx.nix
vendored
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
third_party/home-manager/modules/i18n/input-method/fcitx5.nix
vendored
Normal file
42
third_party/home-manager/modules/i18n/input-method/fcitx5.nix
vendored
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
third_party/home-manager/modules/i18n/input-method/hime.nix
vendored
Normal file
23
third_party/home-manager/modules/i18n/input-method/hime.nix
vendored
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
third_party/home-manager/modules/i18n/input-method/kime.nix
vendored
Normal file
58
third_party/home-manager/modules/i18n/input-method/kime.nix
vendored
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
third_party/home-manager/modules/i18n/input-method/nabi.nix
vendored
Normal file
23
third_party/home-manager/modules/i18n/input-method/nabi.nix
vendored
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
third_party/home-manager/modules/i18n/input-method/uim.nix
vendored
Normal file
45
third_party/home-manager/modules/i18n/input-method/uim.nix
vendored
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" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
# The check for terminal output and color support is heavily inspired
|
# The check for terminal output and color support is heavily inspired
|
||||||
# by https://unix.stackexchange.com/a/10065.
|
# by https://unix.stackexchange.com/a/10065.
|
||||||
|
#
|
||||||
|
# Allow opt out by respecting the `NO_COLOR` environment variable.
|
||||||
|
|
||||||
function setupColors() {
|
function setupColors() {
|
||||||
normalColor=""
|
normalColor=""
|
||||||
|
@ -7,8 +9,8 @@ function setupColors() {
|
||||||
warnColor=""
|
warnColor=""
|
||||||
noteColor=""
|
noteColor=""
|
||||||
|
|
||||||
# Check if stdout is a terminal.
|
# Enable colors for terminals, and allow opting out.
|
||||||
if [[ -t 1 ]]; then
|
if [[ ! -v NO_COLOR && -t 1 ]]; then
|
||||||
# See if it supports colors.
|
# See if it supports colors.
|
||||||
local ncolors
|
local ncolors
|
||||||
ncolors=$(tput colors)
|
ncolors=$(tput colors)
|
||||||
|
|
|
@ -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,10 +25,94 @@
|
||||||
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";
|
||||||
github = "olmokramer";
|
github = "olmokramer";
|
||||||
githubId = 3612514;
|
githubId = 3612514;
|
||||||
};
|
};
|
||||||
|
kalhauge = {
|
||||||
|
name = "Christian Gram Kalhauge";
|
||||||
|
email = "kalhauge@users.noreply.github.com";
|
||||||
|
github = "kalhauge";
|
||||||
|
githubId = 1182166;
|
||||||
|
};
|
||||||
|
kamadorueda = {
|
||||||
|
name = "Kevin Amado";
|
||||||
|
email = "kamadorueda@gmail.com";
|
||||||
|
github = "kamadorueda";
|
||||||
|
githubId = 47480384;
|
||||||
|
keys = [{
|
||||||
|
longkeyid = "rsa4096/0x04D0CEAF916A9A40";
|
||||||
|
fingerprint = "2BE3 BAFD 793E A349 ED1F F00F 04D0 CEAF 916A 9A40";
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
kubukoz = {
|
||||||
|
name = "Jakub Kozłowski";
|
||||||
|
email = "kubukoz@users.noreply.github.com";
|
||||||
|
github = "kubukoz";
|
||||||
|
githubId = 894884;
|
||||||
|
};
|
||||||
|
matrss = {
|
||||||
|
name = "Matthias Riße";
|
||||||
|
email = "matrss@users.noreply.github.com";
|
||||||
|
github = "matrss";
|
||||||
|
githubId = 9308656;
|
||||||
|
};
|
||||||
|
seylerius = {
|
||||||
|
email = "sable@seyleri.us";
|
||||||
|
name = "Sable Seyler";
|
||||||
|
github = "seylerius";
|
||||||
|
githubId = 1145981;
|
||||||
|
keys = [{
|
||||||
|
logkeyid = "rsa4096/0x68BF2EAE6D91CAFF";
|
||||||
|
fingerprint = "F0E0 0311 126A CD72 4392 25E6 68BF 2EAE 6D91 CAFF";
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
thiagokokada = {
|
||||||
|
email = "thiagokokada@gmail.com";
|
||||||
|
name = "Thiago Kenji Okada";
|
||||||
|
github = "thiagokokada";
|
||||||
|
githubId = 844343;
|
||||||
|
};
|
||||||
|
fendse = {
|
||||||
|
email = "46252070+Fendse@users.noreply.github.com";
|
||||||
|
github = "Fendse";
|
||||||
|
githubId = 46252070;
|
||||||
|
name = "Sara Johnsson";
|
||||||
|
};
|
||||||
|
msfjarvis = {
|
||||||
|
email = "me@msfjarvis.dev";
|
||||||
|
github = "msfjarvis";
|
||||||
|
githubId = "13348378";
|
||||||
|
name = "Harsh Shandilya";
|
||||||
|
keys = [{
|
||||||
|
longkeyid = "rsa4096/0xB7843F823355E9B9";
|
||||||
|
fingerprint = "8F87 050B 0F9C B841 1515 7399 B784 3F82 3355 E9B9";
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
ambroisie = {
|
||||||
|
email = "bruno.home-manager@belanyi.fr";
|
||||||
|
github = "ambroisie";
|
||||||
|
githubId = 12465195;
|
||||||
|
name = "Bruno BELANYI";
|
||||||
|
};
|
||||||
|
malvo = {
|
||||||
|
email = "malte@malvo.org";
|
||||||
|
github = "malte-v";
|
||||||
|
githubId = 34393802;
|
||||||
|
name = "Malte Voos";
|
||||||
|
};
|
||||||
|
kranzes = {
|
||||||
|
email = "personal@ilanjoselevich.com";
|
||||||
|
github = "Kranzes";
|
||||||
|
githubId = 56614642;
|
||||||
|
name = "Ilan Joselevich";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
13
third_party/home-manager/modules/lib/types.nix
vendored
13
third_party/home-manager/modules/lib/types.nix
vendored
|
@ -47,9 +47,18 @@ in rec {
|
||||||
|
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
example = "DejaVu Sans 8";
|
example = "DejaVu Sans";
|
||||||
description = ''
|
description = ''
|
||||||
The family name and size of the font within the package.
|
The family name of the font within the package.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
size = mkOption {
|
||||||
|
type = types.nullOr types.int;
|
||||||
|
default = null;
|
||||||
|
example = "8";
|
||||||
|
description = ''
|
||||||
|
The size of the font.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
47
third_party/home-manager/modules/misc/dconf.nix
vendored
47
third_party/home-manager/modules/misc/dconf.nix
vendored
|
@ -8,12 +8,9 @@ let
|
||||||
|
|
||||||
toDconfIni = generators.toINI { mkKeyValue = mkIniKeyValue; };
|
toDconfIni = generators.toINI { mkKeyValue = mkIniKeyValue; };
|
||||||
|
|
||||||
mkIniKeyValue = key: value:
|
mkIniKeyValue = key: value: "${key}=${toString (hm.gvariant.mkValue value)}";
|
||||||
"${key}=${toString (hm.gvariant.mkValue value)}";
|
|
||||||
|
|
||||||
in
|
in {
|
||||||
|
|
||||||
{
|
|
||||||
meta.maintainers = [ maintainers.gnidorah maintainers.rycee ];
|
meta.maintainers = [ maintainers.gnidorah maintainers.rycee ];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
@ -29,7 +26,7 @@ in
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = with types; attrsOf (attrsOf hm.types.gvariant);
|
type = with types; attrsOf (attrsOf hm.types.gvariant);
|
||||||
default = {};
|
default = { };
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
{
|
{
|
||||||
"org/gnome/calculator" = {
|
"org/gnome/calculator" = {
|
||||||
|
@ -48,26 +45,26 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf (cfg.enable && cfg.settings != {}) {
|
config = mkIf (cfg.enable && cfg.settings != { }) {
|
||||||
home.activation.dconfSettings = hm.dag.entryAfter ["installPackages"] (
|
# Make sure the dconf directory exists.
|
||||||
let
|
xdg.configFile."dconf/.keep".source = builtins.toFile "keep" "";
|
||||||
iniFile = pkgs.writeText "hm-dconf.ini" (toDconfIni cfg.settings);
|
|
||||||
in
|
|
||||||
''
|
|
||||||
if [[ -v DBUS_SESSION_BUS_ADDRESS ]]; then
|
|
||||||
DCONF_DBUS_RUN_SESSION=""
|
|
||||||
else
|
|
||||||
DCONF_DBUS_RUN_SESSION="${pkgs.dbus}/bin/dbus-run-session"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -v DRY_RUN ]]; then
|
home.activation.dconfSettings = hm.dag.entryAfter [ "installPackages" ]
|
||||||
echo $DCONF_DBUS_RUN_SESSION ${pkgs.dconf}/bin/dconf load / "<" ${iniFile}
|
(let iniFile = pkgs.writeText "hm-dconf.ini" (toDconfIni cfg.settings);
|
||||||
else
|
in ''
|
||||||
$DCONF_DBUS_RUN_SESSION ${pkgs.dconf}/bin/dconf load / < ${iniFile}
|
if [[ -v DBUS_SESSION_BUS_ADDRESS ]]; then
|
||||||
fi
|
DCONF_DBUS_RUN_SESSION=""
|
||||||
|
else
|
||||||
|
DCONF_DBUS_RUN_SESSION="${pkgs.dbus}/bin/dbus-run-session"
|
||||||
|
fi
|
||||||
|
|
||||||
unset DCONF_DBUS_RUN_SESSION
|
if [[ -v DRY_RUN ]]; then
|
||||||
''
|
echo $DCONF_DBUS_RUN_SESSION ${pkgs.dconf}/bin/dconf load / "<" ${iniFile}
|
||||||
);
|
else
|
||||||
|
$DCONF_DBUS_RUN_SESSION ${pkgs.dconf}/bin/dconf load / < ${iniFile}
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset DCONF_DBUS_RUN_SESSION
|
||||||
|
'');
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
34
third_party/home-manager/modules/misc/gtk.nix
vendored
34
third_party/home-manager/modules/misc/gtk.nix
vendored
|
@ -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
|
||||||
|
@ -92,6 +92,18 @@ in {
|
||||||
<filename>~/.gtkrc-2.0</filename>.
|
<filename>~/.gtkrc-2.0</filename>.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
configLocation = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
default = "${config.home.homeDirectory}/.gtkrc-2.0";
|
||||||
|
defaultText =
|
||||||
|
literalExample ''"''${config.home.homeDirectory}/.gtkrc-2.0"'';
|
||||||
|
example =
|
||||||
|
literalExample ''"''${config.xdg.configHome}/gtk-2.0/gtkrc"'';
|
||||||
|
description = ''
|
||||||
|
The location to put the GTK configuration file.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
gtk3 = {
|
gtk3 = {
|
||||||
|
@ -128,14 +140,22 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (let
|
config = mkIf cfg.enable (let
|
||||||
ini = optionalAttrs (cfg.font != null) { gtk-font-name = cfg.font.name; }
|
ini = optionalAttrs (cfg.font != null) {
|
||||||
// optionalAttrs (cfg.theme != null) { gtk-theme-name = cfg.theme.name; }
|
gtk-font-name = let
|
||||||
|
fontSize =
|
||||||
|
optionalString (cfg.font.size != null) " ${toString cfg.font.size}";
|
||||||
|
in "${cfg.font.name}" + fontSize;
|
||||||
|
} // optionalAttrs (cfg.theme != null) { gtk-theme-name = cfg.theme.name; }
|
||||||
// optionalAttrs (cfg.iconTheme != null) {
|
// optionalAttrs (cfg.iconTheme != null) {
|
||||||
gtk-icon-theme-name = cfg.iconTheme.name;
|
gtk-icon-theme-name = cfg.iconTheme.name;
|
||||||
};
|
};
|
||||||
|
|
||||||
dconfIni = optionalAttrs (cfg.font != null) { font-name = cfg.font.name; }
|
dconfIni = optionalAttrs (cfg.font != null) {
|
||||||
// optionalAttrs (cfg.theme != null) { gtk-theme = cfg.theme.name; }
|
font-name = let
|
||||||
|
fontSize =
|
||||||
|
optionalString (cfg.font.size != null) " ${toString cfg.font.size}";
|
||||||
|
in "${cfg.font.name}" + fontSize;
|
||||||
|
} // optionalAttrs (cfg.theme != null) { gtk-theme = cfg.theme.name; }
|
||||||
// optionalAttrs (cfg.iconTheme != null) {
|
// optionalAttrs (cfg.iconTheme != null) {
|
||||||
icon-theme = cfg.iconTheme.name;
|
icon-theme = cfg.iconTheme.name;
|
||||||
};
|
};
|
||||||
|
@ -146,10 +166,12 @@ in {
|
||||||
home.packages = optionalPackage cfg.font ++ optionalPackage cfg.theme
|
home.packages = optionalPackage cfg.font ++ optionalPackage cfg.theme
|
||||||
++ optionalPackage cfg.iconTheme;
|
++ optionalPackage cfg.iconTheme;
|
||||||
|
|
||||||
home.file.".gtkrc-2.0".text =
|
home.file.${cfg2.configLocation}.text =
|
||||||
concatStringsSep "\n" (mapAttrsToList formatGtk2Option ini) + "\n"
|
concatStringsSep "\n" (mapAttrsToList formatGtk2Option ini) + "\n"
|
||||||
+ cfg2.extraConfig;
|
+ cfg2.extraConfig;
|
||||||
|
|
||||||
|
home.sessionVariables.GTK2_RC_FILES = cfg2.configLocation;
|
||||||
|
|
||||||
xdg.configFile."gtk-3.0/settings.ini".text =
|
xdg.configFile."gtk-3.0/settings.ini".text =
|
||||||
toGtk3Ini { Settings = ini // cfg3.extraConfig; };
|
toGtk3Ini { Settings = ini // cfg3.extraConfig; };
|
||||||
|
|
||||||
|
|
398
third_party/home-manager/modules/misc/news.nix
vendored
398
third_party/home-manager/modules/misc/news.nix
vendored
|
@ -116,6 +116,9 @@ in
|
||||||
#
|
#
|
||||||
# date --iso-8601=second --universal
|
# date --iso-8601=second --universal
|
||||||
#
|
#
|
||||||
|
# On darwin (or BSD like systems) use
|
||||||
|
#
|
||||||
|
# date -u +'%Y-%m-%dT%H:%M:%S+00:00'
|
||||||
news.entries = [
|
news.entries = [
|
||||||
{
|
{
|
||||||
time = "2017-09-01T10:56:28+00:00";
|
time = "2017-09-01T10:56:28+00:00";
|
||||||
|
@ -1720,6 +1723,401 @@ in
|
||||||
A new module is available: 'programs.gh'.
|
A new module is available: 'programs.gh'.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2020-11-01T11:17:02+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.caffeine'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2020-11-05T22:59:21+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.i3status-rust'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2020-11-14T13:02:40+00:00";
|
||||||
|
condition = config.programs.broot.enable;
|
||||||
|
message = ''
|
||||||
|
The 'programs.broot.verbs' option is now a list rather than an
|
||||||
|
attribute set. To migrate, move the keys of the attrset into the
|
||||||
|
list items' 'invocation' keys. For example,
|
||||||
|
|
||||||
|
programs.broot.verbs = {
|
||||||
|
"p" = { execution = ":parent"; };
|
||||||
|
};
|
||||||
|
|
||||||
|
becomes
|
||||||
|
|
||||||
|
programs.broot.verbs = [
|
||||||
|
{
|
||||||
|
invocation = "p";
|
||||||
|
execution = ":parent";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2020-12-01T20:46:14+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.wlsunset'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2020-12-09T22:34:33+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.pbgopy'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2020-12-18T22:22:25+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.rofi.pass'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2020-12-31T14:16:47+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.octant'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-01-01T08:51:11+00:00";
|
||||||
|
condition = config.pam.sessionVariables != {};
|
||||||
|
message = ''
|
||||||
|
The option 'pam.sessionVariables' will be deprecated in the future.
|
||||||
|
This is due to PAM 1.5.0 deprecating reading of the user environment.
|
||||||
|
The deprecation will not take place immediately but you may wish to
|
||||||
|
consider alternatives to PAM environment variables.
|
||||||
|
|
||||||
|
See
|
||||||
|
|
||||||
|
https://github.com/nix-community/home-manager/issues/1691
|
||||||
|
|
||||||
|
for discussion.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-01-02T07:49:15+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.plan9port'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-01-31T11:23:30+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.playerctld'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-01-28T15:07:34+00:00";
|
||||||
|
condition = hostPlatform.isDarwin;
|
||||||
|
message = ''
|
||||||
|
New options are available for 'targets.darwin':
|
||||||
|
|
||||||
|
- targets.darwin.defaults
|
||||||
|
|
||||||
|
This adds options for configuring macOS through the defaults(1)
|
||||||
|
system.
|
||||||
|
|
||||||
|
- targets.darwin.keybindings
|
||||||
|
|
||||||
|
This adds options for configuring the default keybindings for macOS
|
||||||
|
text fields.
|
||||||
|
|
||||||
|
- targets.darwin.search
|
||||||
|
|
||||||
|
This adds options for configuring the default search engine for
|
||||||
|
macOS.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-02-04T22:28:26+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.sbt'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-02-20T00:00:00+00:00";
|
||||||
|
condition = config.services.polybar.enable;
|
||||||
|
message = ''
|
||||||
|
The polybar configuration can now be written in a more nix-friendly format.
|
||||||
|
The new 'services.polybar.settings' option is an alternative to
|
||||||
|
'services.polybar.config' that supports nested keys and converts nix
|
||||||
|
lists to polybar-style 'foo-0, foo-1, ...' lists.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-02-25T22:36:43+00:00";
|
||||||
|
condition = config.programs.git.enable && any (msmtp: msmtp.enable)
|
||||||
|
(mapAttrsToList (name: account: account.msmtp)
|
||||||
|
config.accounts.email.accounts);
|
||||||
|
message = ''
|
||||||
|
Git will now defer to msmtp for sending emails if
|
||||||
|
'accounts.email.accounts.<name>.msmtp.enable' is true.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-03-03T22:16:05+00:00";
|
||||||
|
message = ''
|
||||||
|
Home Manager now respects the 'NO_COLOR' environment variable as per
|
||||||
|
https://no-color.org/.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-03-29T21:05:50+00:00";
|
||||||
|
message = ''
|
||||||
|
Configuration specified by 'programs.dircolors.extraConfig' is now
|
||||||
|
applied after 'programs.dircolors.settings'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-04-11T20:44:54+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.exa'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-04-23T10:00:00+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.pass-secret-service'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-04-26T07:00:00+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new service is available: 'services.poweralertd'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-04-28T10:00:00+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new service is available: 'services.mpris-proxy'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-04-28T12:00:00+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.topgrade'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-04-30T22:05:01+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new service is available: 'services.barrier'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-05-01T15:16:08+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.lazygit'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-04-27T00:00:00+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.ncspot'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-05-02T11:22:42+00:00";
|
||||||
|
condition = hostPlatform.isLinux && config.services.sxhkd.enable;
|
||||||
|
message = ''
|
||||||
|
The sxhkd service now is started using 'xsession.initExtra',
|
||||||
|
therefore this module loses systemd service management capabilities
|
||||||
|
and works only if Home Manager starts the user X session.
|
||||||
|
|
||||||
|
The option 'services.sxhkd.extraPath' has been deprecated.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-05-06T20:47:37+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.etesync-dav'
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-05-06T11:01:41+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.nix-index'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-05-10T18:50:07+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'xdg.systemDirs'. Options are:
|
||||||
|
|
||||||
|
- xdg.systemDirs.config
|
||||||
|
|
||||||
|
Extra directory names to add to $XDG_CONFIG_DIRS in the user
|
||||||
|
session.
|
||||||
|
|
||||||
|
- xdg.systemDirs.data
|
||||||
|
|
||||||
|
Extra directory names to add to $XDG_DATA_DIRS in the user
|
||||||
|
session.
|
||||||
|
|
||||||
|
These variables are visible in both systemd user services and
|
||||||
|
login shells.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-05-18T12:22:42+00:00";
|
||||||
|
condition = config.services.syncthing != {};
|
||||||
|
message = ''
|
||||||
|
Setting 'services.syncthing.tray' as a boolean will be deprecated in
|
||||||
|
the future.
|
||||||
|
|
||||||
|
This is to make the syncthing tray package configurable, with
|
||||||
|
`services.syncthing.tray.package`, following QSyncthingTray becoming
|
||||||
|
no longer actively maintained. The default syncthing tray package has
|
||||||
|
also changed to https://github.com/Martchus/syncthingtray. To
|
||||||
|
continue as before, set `services.syncthing.tray.enable`.
|
||||||
|
|
||||||
|
See
|
||||||
|
|
||||||
|
https://github.com/nix-community/home-manager/pull/1257
|
||||||
|
|
||||||
|
for discussion.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-05-18T20:28:50+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.foot'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-05-23T18:31:38+00:00";
|
||||||
|
condition = config.programs.mbsync.enable;
|
||||||
|
message = ''
|
||||||
|
mbsync channels no longer accepts the masterPattern or slavePattern
|
||||||
|
attribute keys. This is due to an upstream change.
|
||||||
|
They have been renamed: masterPattern -> farPattern, and
|
||||||
|
slavePattern -> nearPattern.
|
||||||
|
This is a stateful change, where the database file(s) used to keep track
|
||||||
|
of mail are silently upgraded once you upgrade both your configuration file
|
||||||
|
and the mbsync program.
|
||||||
|
|
||||||
|
Note that this change is non-reversible, meaning once you choose to switch to
|
||||||
|
near/farPattern, you can no longer use your previous slave/masterPattern
|
||||||
|
configuration file.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-05-10T20:41:44+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.rbw'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-05-30T15:22:10+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.piston-cli'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-06-02T04:24:10+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.xidlehook'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-06-07T20:44:00+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.pantalaimon'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-06-12T05:00:22+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.mangohud'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-06-16T01:26:16+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
The xmonad module now compiles the configuration before
|
||||||
|
linking the binary to the place xmonad expects to find
|
||||||
|
the compiled configuration (the binary).
|
||||||
|
|
||||||
|
This breaks recompilation of xmonad (i.e. the 'q' binding or
|
||||||
|
'xmonad --recompile').
|
||||||
|
|
||||||
|
If this behavior is undesirable, do not use the
|
||||||
|
'xsession.windowManager.xmonad.config' option. Instead, set the
|
||||||
|
contents of the configuration file with
|
||||||
|
'home.file.".xmonad/config.hs".text = "content of the file"'
|
||||||
|
or 'home.file.".xmonad/config.hs".source = ./path-to-config'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-06-24T22:36:11+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'i18n.inputMethod'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2021-06-22T14:43:53+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.himalaya'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,9 @@ in {
|
||||||
<refentrytitle>pam_env.conf</refentrytitle>
|
<refentrytitle>pam_env.conf</refentrytitle>
|
||||||
<manvolnum>5</manvolnum>
|
<manvolnum>5</manvolnum>
|
||||||
</citerefentry>.
|
</citerefentry>.
|
||||||
|
</para><para>
|
||||||
|
Note, this option will become deprecated in the future and its use is
|
||||||
|
therefore discouraged.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
59
third_party/home-manager/modules/misc/qt.nix
vendored
59
third_party/home-manager/modules/misc/qt.nix
vendored
|
@ -44,19 +44,72 @@ in {
|
||||||
</variablelist>
|
</variablelist>
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
style = {
|
||||||
|
name = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
example = "adwaita-dark";
|
||||||
|
relatedPackages = [ "adwaita-qt" [ "libsForQt5" "qtstyleplugins" ] ];
|
||||||
|
description = ''
|
||||||
|
Selects the style to use for Qt5 applications.</para>
|
||||||
|
<para>The options are
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>adwaita</literal></term>
|
||||||
|
<term><literal>adwaita-dark</literal></term>
|
||||||
|
<listitem><para>Use Adwaita Qt style with
|
||||||
|
<link xlink:href="https://github.com/FedoraQt/adwaita-qt">adwaita</link>
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>cleanlooks</literal></term>
|
||||||
|
<term><literal>gtk2</literal></term>
|
||||||
|
<term><literal>motif</literal></term>
|
||||||
|
<term><literal>plastique</literal></term>
|
||||||
|
<listitem><para>Use styles from
|
||||||
|
<link xlink:href="https://github.com/qt/qtstyleplugins">qtstyleplugins</link>
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.nullOr types.package;
|
||||||
|
default = null;
|
||||||
|
example = literalExample "pkgs.adwaita-qt";
|
||||||
|
description = "Theme package to be used in Qt5 applications.";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf (cfg.enable && cfg.platformTheme != null) {
|
config = mkIf (cfg.enable && cfg.platformTheme != null) {
|
||||||
home.sessionVariables.QT_QPA_PLATFORMTHEME =
|
assertions = [{
|
||||||
if cfg.platformTheme == "gnome" then "gnome" else "gtk2";
|
assertion = (cfg.platformTheme == "gnome")
|
||||||
|
-> ((cfg.style.name != null) && (cfg.style.package != null));
|
||||||
|
message = ''
|
||||||
|
`qt.platformTheme` "gnome" must have `qt.style` set to a theme that
|
||||||
|
supports both Qt and Gtk, for example "adwaita" or "adwaita-dark".
|
||||||
|
'';
|
||||||
|
}];
|
||||||
|
|
||||||
|
# Necessary because home.sessionVariables is of types.attrs
|
||||||
|
home.sessionVariables = (filterAttrs (n: v: v != null) {
|
||||||
|
QT_QPA_PLATFORMTHEME =
|
||||||
|
if cfg.platformTheme == "gnome" then "gnome" else "gtk2";
|
||||||
|
QT_STYLE_OVERRIDE = cfg.style.name;
|
||||||
|
});
|
||||||
|
|
||||||
home.packages = if cfg.platformTheme == "gnome" then
|
home.packages = if cfg.platformTheme == "gnome" then
|
||||||
[ pkgs.qgnomeplatform ]
|
[ pkgs.qgnomeplatform ]
|
||||||
|
++ lib.optionals (cfg.style.package != null) [ cfg.style.package ]
|
||||||
else
|
else
|
||||||
[ pkgs.libsForQt5.qtstyleplugins ];
|
[ pkgs.libsForQt5.qtstyleplugins ];
|
||||||
|
|
||||||
xsession.importedVariables = [ "QT_QPA_PLATFORMTHEME" ];
|
xsession.importedVariables = [ "QT_QPA_PLATFORMTHEME" ]
|
||||||
|
++ lib.optionals (cfg.style != null) [ "QT_STYLE_OVERRIDE" ];
|
||||||
|
|
||||||
# Enable GTK+ style for Qt4 in either case.
|
# Enable GTK+ style for Qt4 in either case.
|
||||||
# It doesn’t support the platform theme packages.
|
# It doesn’t support the platform theme packages.
|
||||||
|
|
|
@ -5,7 +5,16 @@ with lib;
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
home.stateVersion = mkOption {
|
home.stateVersion = mkOption {
|
||||||
type = types.enum [ "18.09" "19.03" "19.09" "20.03" "20.09" ];
|
type = types.enum [
|
||||||
|
"18.09"
|
||||||
|
"19.03"
|
||||||
|
"19.09"
|
||||||
|
"20.03"
|
||||||
|
"20.09"
|
||||||
|
"21.03"
|
||||||
|
"21.05"
|
||||||
|
"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
|
||||||
|
|
178
third_party/home-manager/modules/misc/xdg-desktop-entries.nix
vendored
Normal file
178
third_party/home-manager/modules/misc/xdg-desktop-entries.nix
vendored
Normal file
|
@ -0,0 +1,178 @@
|
||||||
|
{ 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.home.packages = mkIf (config.xdg.desktopEntries != { })
|
||||||
|
(map hiPrio # we need hiPrio to override existing entries
|
||||||
|
(attrsets.mapAttrsToList makeFile config.xdg.desktopEntries));
|
||||||
|
|
||||||
|
}
|
55
third_party/home-manager/modules/misc/xdg-system-dirs.nix
vendored
Normal file
55
third_party/home-manager/modules/misc/xdg-system-dirs.nix
vendored
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.xdg.systemDirs;
|
||||||
|
|
||||||
|
configDirs = concatStringsSep ":" cfg.config;
|
||||||
|
|
||||||
|
dataDirs = concatStringsSep ":" cfg.data;
|
||||||
|
|
||||||
|
in {
|
||||||
|
meta.maintainers = with maintainers; [ tadfisher ];
|
||||||
|
|
||||||
|
options.xdg.systemDirs = {
|
||||||
|
config = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ ];
|
||||||
|
example = literalExample ''[ "/etc/xdg" ]'';
|
||||||
|
description = ''
|
||||||
|
Directory names to add to <envar>XDG_CONFIG_DIRS</envar>
|
||||||
|
in the user session.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
data = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ ];
|
||||||
|
example = literalExample ''[ "/usr/share" "/usr/local/share" ]'';
|
||||||
|
description = ''
|
||||||
|
Directory names to add to <envar>XDG_DATA_DIRS</envar>
|
||||||
|
in the user session.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkMerge [
|
||||||
|
(mkIf (cfg.config != [ ]) {
|
||||||
|
home.sessionVariables.XDG_CONFIG_DIRS =
|
||||||
|
"${configDirs}\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}";
|
||||||
|
|
||||||
|
systemd.user.sessionVariables.XDG_CONFIG_DIRS =
|
||||||
|
"${configDirs}\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}";
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf (cfg.data != [ ]) {
|
||||||
|
home.sessionVariables.XDG_DATA_DIRS =
|
||||||
|
"${dataDirs}\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}";
|
||||||
|
|
||||||
|
systemd.user.sessionVariables.XDG_DATA_DIRS =
|
||||||
|
"${dataDirs}\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
|
@ -86,25 +86,36 @@ in {
|
||||||
example = { XDG_MISC_DIR = "$HOME/Misc"; };
|
example = { XDG_MISC_DIR = "$HOME/Misc"; };
|
||||||
description = "Other user directories.";
|
description = "Other user directories.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
createDirectories =
|
||||||
|
mkEnableOption "automatic creation of the XDG user directories";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = let
|
||||||
|
directories = {
|
||||||
|
XDG_DESKTOP_DIR = cfg.desktop;
|
||||||
|
XDG_DOCUMENTS_DIR = cfg.documents;
|
||||||
|
XDG_DOWNLOAD_DIR = cfg.download;
|
||||||
|
XDG_MUSIC_DIR = cfg.music;
|
||||||
|
XDG_PICTURES_DIR = cfg.pictures;
|
||||||
|
XDG_PUBLICSHARE_DIR = cfg.publicShare;
|
||||||
|
XDG_TEMPLATES_DIR = cfg.templates;
|
||||||
|
XDG_VIDEOS_DIR = cfg.videos;
|
||||||
|
} // cfg.extraConfig;
|
||||||
|
in mkIf cfg.enable {
|
||||||
xdg.configFile."user-dirs.dirs".text = let
|
xdg.configFile."user-dirs.dirs".text = let
|
||||||
options = {
|
|
||||||
XDG_DESKTOP_DIR = cfg.desktop;
|
|
||||||
XDG_DOCUMENTS_DIR = cfg.documents;
|
|
||||||
XDG_DOWNLOAD_DIR = cfg.download;
|
|
||||||
XDG_MUSIC_DIR = cfg.music;
|
|
||||||
XDG_PICTURES_DIR = cfg.pictures;
|
|
||||||
XDG_PUBLICSHARE_DIR = cfg.publicShare;
|
|
||||||
XDG_TEMPLATES_DIR = cfg.templates;
|
|
||||||
XDG_VIDEOS_DIR = cfg.videos;
|
|
||||||
} // cfg.extraConfig;
|
|
||||||
|
|
||||||
# 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}"'') options;
|
wrapped = mapAttrs (_: value: ''"${value}"'') directories;
|
||||||
in generators.toKeyValue { } wrapped;
|
in generators.toKeyValue { } wrapped;
|
||||||
|
|
||||||
xdg.configFile."user-dirs.conf".text = "enabled=False";
|
xdg.configFile."user-dirs.conf".text = "enabled=False";
|
||||||
|
|
||||||
|
home.activation = mkIf cfg.createDirectories {
|
||||||
|
createXdgUserDirectories = let
|
||||||
|
directoriesList = attrValues directories;
|
||||||
|
mkdir = (dir: ''$DRY_RUN_CMD mkdir -p $VERBOSE_ARG "${dir}"'');
|
||||||
|
in lib.hm.dag.entryAfter [ "writeBoundary" ]
|
||||||
|
(strings.concatMapStringsSep "\n" mkdir directoriesList);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,6 @@ let
|
||||||
|
|
||||||
cfg = config.xdg;
|
cfg = config.xdg;
|
||||||
|
|
||||||
dag = config.lib.dag;
|
|
||||||
|
|
||||||
fileType = (import ../lib/file-type.nix {
|
fileType = (import ../lib/file-type.nix {
|
||||||
inherit (config.home) homeDirectory;
|
inherit (config.home) homeDirectory;
|
||||||
inherit lib pkgs;
|
inherit lib pkgs;
|
||||||
|
|
40
third_party/home-manager/modules/modules.nix
vendored
40
third_party/home-manager/modules/modules.nix
vendored
|
@ -22,8 +22,10 @@ let
|
||||||
|
|
||||||
allModules = [
|
allModules = [
|
||||||
(loadModule ./accounts/email.nix { })
|
(loadModule ./accounts/email.nix { })
|
||||||
|
(loadModule ./config/i18n.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./files.nix { })
|
(loadModule ./files.nix { })
|
||||||
(loadModule ./home-environment.nix { })
|
(loadModule ./home-environment.nix { })
|
||||||
|
(loadModule ./i18n/input-method/default.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./manual.nix { })
|
(loadModule ./manual.nix { })
|
||||||
(loadModule ./misc/dconf.nix { })
|
(loadModule ./misc/dconf.nix { })
|
||||||
(loadModule ./misc/debug.nix { })
|
(loadModule ./misc/debug.nix { })
|
||||||
|
@ -39,6 +41,8 @@ let
|
||||||
(loadModule ./misc/tmpfiles.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./misc/tmpfiles.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./misc/version.nix { })
|
(loadModule ./misc/version.nix { })
|
||||||
(loadModule ./misc/vte.nix { })
|
(loadModule ./misc/vte.nix { })
|
||||||
|
(loadModule ./misc/xdg-system-dirs.nix { condition = hostPlatform.isLinux; })
|
||||||
|
(loadModule ./misc/xdg-desktop-entries.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./misc/xdg-mime.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./misc/xdg-mime.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./misc/xdg-mime-apps.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./misc/xdg-mime-apps.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./misc/xdg-user-dirs.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./misc/xdg-user-dirs.nix { condition = hostPlatform.isLinux; })
|
||||||
|
@ -62,9 +66,11 @@ let
|
||||||
(loadModule ./programs/direnv.nix { })
|
(loadModule ./programs/direnv.nix { })
|
||||||
(loadModule ./programs/eclipse.nix { })
|
(loadModule ./programs/eclipse.nix { })
|
||||||
(loadModule ./programs/emacs.nix { })
|
(loadModule ./programs/emacs.nix { })
|
||||||
|
(loadModule ./programs/exa.nix { })
|
||||||
(loadModule ./programs/feh.nix { })
|
(loadModule ./programs/feh.nix { })
|
||||||
(loadModule ./programs/firefox.nix { })
|
(loadModule ./programs/firefox.nix { })
|
||||||
(loadModule ./programs/fish.nix { })
|
(loadModule ./programs/fish.nix { })
|
||||||
|
(loadModule ./programs/foot.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./programs/fzf.nix { })
|
(loadModule ./programs/fzf.nix { })
|
||||||
(loadModule ./programs/getmail.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./programs/getmail.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./programs/gh.nix { })
|
(loadModule ./programs/gh.nix { })
|
||||||
|
@ -72,9 +78,11 @@ let
|
||||||
(loadModule ./programs/gnome-terminal.nix { })
|
(loadModule ./programs/gnome-terminal.nix { })
|
||||||
(loadModule ./programs/go.nix { })
|
(loadModule ./programs/go.nix { })
|
||||||
(loadModule ./programs/gpg.nix { })
|
(loadModule ./programs/gpg.nix { })
|
||||||
|
(loadModule ./programs/himalaya.nix { })
|
||||||
(loadModule ./programs/home-manager.nix { })
|
(loadModule ./programs/home-manager.nix { })
|
||||||
(loadModule ./programs/htop.nix { })
|
(loadModule ./programs/htop.nix { })
|
||||||
(loadModule ./programs/i3status.nix { })
|
(loadModule ./programs/i3status.nix { })
|
||||||
|
(loadModule ./programs/i3status-rust.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./programs/info.nix { })
|
(loadModule ./programs/info.nix { })
|
||||||
(loadModule ./programs/irssi.nix { })
|
(loadModule ./programs/irssi.nix { })
|
||||||
(loadModule ./programs/lieer.nix { })
|
(loadModule ./programs/lieer.nix { })
|
||||||
|
@ -82,10 +90,12 @@ let
|
||||||
(loadModule ./programs/kakoune.nix { })
|
(loadModule ./programs/kakoune.nix { })
|
||||||
(loadModule ./programs/keychain.nix { })
|
(loadModule ./programs/keychain.nix { })
|
||||||
(loadModule ./programs/kitty.nix { })
|
(loadModule ./programs/kitty.nix { })
|
||||||
|
(loadModule ./programs/lazygit.nix { })
|
||||||
(loadModule ./programs/lesspipe.nix { })
|
(loadModule ./programs/lesspipe.nix { })
|
||||||
(loadModule ./programs/lf.nix { })
|
(loadModule ./programs/lf.nix { })
|
||||||
(loadModule ./programs/lsd.nix { })
|
(loadModule ./programs/lsd.nix { })
|
||||||
(loadModule ./programs/man.nix { })
|
(loadModule ./programs/man.nix { })
|
||||||
|
(loadModule ./programs/mangohud.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./programs/matplotlib.nix { })
|
(loadModule ./programs/matplotlib.nix { })
|
||||||
(loadModule ./programs/mbsync.nix { })
|
(loadModule ./programs/mbsync.nix { })
|
||||||
(loadModule ./programs/mcfly.nix { })
|
(loadModule ./programs/mcfly.nix { })
|
||||||
|
@ -94,44 +104,58 @@ let
|
||||||
(loadModule ./programs/msmtp.nix { })
|
(loadModule ./programs/msmtp.nix { })
|
||||||
(loadModule ./programs/mu.nix { })
|
(loadModule ./programs/mu.nix { })
|
||||||
(loadModule ./programs/ncmpcpp.nix { })
|
(loadModule ./programs/ncmpcpp.nix { })
|
||||||
|
(loadModule ./programs/ncspot.nix { })
|
||||||
(loadModule ./programs/ne.nix { })
|
(loadModule ./programs/ne.nix { })
|
||||||
(loadModule ./programs/neomutt.nix { })
|
(loadModule ./programs/neomutt.nix { })
|
||||||
(loadModule ./programs/neovim.nix { })
|
(loadModule ./programs/neovim.nix { })
|
||||||
(loadModule ./programs/newsboat.nix { })
|
(loadModule ./programs/newsboat.nix { })
|
||||||
|
(loadModule ./programs/nix-index.nix { })
|
||||||
(loadModule ./programs/noti.nix { })
|
(loadModule ./programs/noti.nix { })
|
||||||
(loadModule ./programs/notmuch.nix { })
|
(loadModule ./programs/notmuch.nix { })
|
||||||
(loadModule ./programs/nushell.nix { })
|
(loadModule ./programs/nushell.nix { })
|
||||||
(loadModule ./programs/obs-studio.nix { })
|
(loadModule ./programs/obs-studio.nix { })
|
||||||
|
(loadModule ./programs/octant.nix { })
|
||||||
(loadModule ./programs/offlineimap.nix { })
|
(loadModule ./programs/offlineimap.nix { })
|
||||||
(loadModule ./programs/opam.nix { })
|
(loadModule ./programs/opam.nix { })
|
||||||
(loadModule ./programs/password-store.nix { })
|
(loadModule ./programs/password-store.nix { })
|
||||||
(loadModule ./programs/pazi.nix { })
|
(loadModule ./programs/pazi.nix { })
|
||||||
(loadModule ./programs/pet.nix { })
|
(loadModule ./programs/pet.nix { })
|
||||||
(loadModule ./programs/pidgin.nix { })
|
(loadModule ./programs/pidgin.nix { })
|
||||||
|
(loadModule ./programs/piston-cli.nix { })
|
||||||
(loadModule ./programs/powerline-go.nix { })
|
(loadModule ./programs/powerline-go.nix { })
|
||||||
(loadModule ./programs/qutebrowser.nix { })
|
(loadModule ./programs/qutebrowser.nix { })
|
||||||
|
(loadModule ./programs/rbw.nix { })
|
||||||
(loadModule ./programs/readline.nix { })
|
(loadModule ./programs/readline.nix { })
|
||||||
(loadModule ./programs/rofi.nix { })
|
(loadModule ./programs/rofi.nix { })
|
||||||
|
(loadModule ./programs/rofi-pass.nix { })
|
||||||
(loadModule ./programs/rtorrent.nix { })
|
(loadModule ./programs/rtorrent.nix { })
|
||||||
|
(loadModule ./programs/scmpuff.nix { })
|
||||||
|
(loadModule ./programs/senpai.nix { })
|
||||||
(loadModule ./programs/skim.nix { })
|
(loadModule ./programs/skim.nix { })
|
||||||
(loadModule ./programs/starship.nix { })
|
(loadModule ./programs/starship.nix { })
|
||||||
|
(loadModule ./programs/sbt.nix { })
|
||||||
(loadModule ./programs/ssh.nix { })
|
(loadModule ./programs/ssh.nix { })
|
||||||
(loadModule ./programs/taskwarrior.nix { })
|
(loadModule ./programs/taskwarrior.nix { })
|
||||||
(loadModule ./programs/termite.nix { })
|
(loadModule ./programs/termite.nix { })
|
||||||
(loadModule ./programs/texlive.nix { })
|
(loadModule ./programs/texlive.nix { })
|
||||||
(loadModule ./programs/tmux.nix { })
|
(loadModule ./programs/tmux.nix { })
|
||||||
|
(loadModule ./programs/terminator.nix { condition = hostPlatform.isLinux; })
|
||||||
|
(loadModule ./programs/topgrade.nix { })
|
||||||
(loadModule ./programs/urxvt.nix { })
|
(loadModule ./programs/urxvt.nix { })
|
||||||
(loadModule ./programs/vim.nix { })
|
(loadModule ./programs/vim.nix { })
|
||||||
(loadModule ./programs/vscode.nix { })
|
(loadModule ./programs/vscode.nix { })
|
||||||
(loadModule ./programs/vscode/haskell.nix { })
|
(loadModule ./programs/vscode/haskell.nix { })
|
||||||
(loadModule ./programs/waybar.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./programs/waybar.nix { condition = hostPlatform.isLinux; })
|
||||||
|
(loadModule ./programs/xmobar.nix { })
|
||||||
(loadModule ./programs/z-lua.nix { })
|
(loadModule ./programs/z-lua.nix { })
|
||||||
(loadModule ./programs/zathura.nix { })
|
(loadModule ./programs/zathura.nix { })
|
||||||
(loadModule ./programs/zoxide.nix { })
|
(loadModule ./programs/zoxide.nix { })
|
||||||
(loadModule ./programs/zplug.nix { })
|
(loadModule ./programs/zplug.nix { })
|
||||||
(loadModule ./programs/zsh.nix { })
|
(loadModule ./programs/zsh.nix { })
|
||||||
(loadModule ./programs/zsh/prezto.nix { })
|
(loadModule ./programs/zsh/prezto.nix { })
|
||||||
|
(loadModule ./services/barrier.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/blueman-applet.nix { })
|
(loadModule ./services/blueman-applet.nix { })
|
||||||
|
(loadModule ./services/caffeine.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/cbatticon.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/cbatticon.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/clipmenu.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/clipmenu.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/compton.nix { })
|
(loadModule ./services/compton.nix { })
|
||||||
|
@ -139,9 +163,10 @@ let
|
||||||
(loadModule ./services/dunst.nix { })
|
(loadModule ./services/dunst.nix { })
|
||||||
(loadModule ./services/dwm-status.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/dwm-status.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/emacs.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/emacs.nix { condition = hostPlatform.isLinux; })
|
||||||
|
(loadModule ./services/etesync-dav.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/flameshot.nix { })
|
(loadModule ./services/flameshot.nix { })
|
||||||
(loadModule ./services/fluidsynth.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/fluidsynth.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/gammastep.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/redshift-gammastep/gammastep.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/getmail.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/getmail.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/gnome-keyring.nix { })
|
(loadModule ./services/gnome-keyring.nix { })
|
||||||
(loadModule ./services/gpg-agent.nix { })
|
(loadModule ./services/gpg-agent.nix { })
|
||||||
|
@ -160,18 +185,25 @@ let
|
||||||
(loadModule ./services/mbsync.nix { })
|
(loadModule ./services/mbsync.nix { })
|
||||||
(loadModule ./services/mpd.nix { })
|
(loadModule ./services/mpd.nix { })
|
||||||
(loadModule ./services/mpdris2.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/mpdris2.nix { condition = hostPlatform.isLinux; })
|
||||||
|
(loadModule ./services/mpris-proxy.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/muchsync.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/muchsync.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/network-manager-applet.nix { })
|
(loadModule ./services/network-manager-applet.nix { })
|
||||||
(loadModule ./services/nextcloud-client.nix { })
|
(loadModule ./services/nextcloud-client.nix { })
|
||||||
(loadModule ./services/owncloud-client.nix { })
|
(loadModule ./services/owncloud-client.nix { })
|
||||||
|
(loadModule ./services/pantalaimon.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/parcellite.nix { })
|
(loadModule ./services/parcellite.nix { })
|
||||||
|
(loadModule ./services/pass-secret-service.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/password-store-sync.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/password-store-sync.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/pasystray.nix { })
|
(loadModule ./services/pasystray.nix { })
|
||||||
|
(loadModule ./services/pbgopy.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/picom.nix { })
|
(loadModule ./services/picom.nix { })
|
||||||
|
(loadModule ./services/plan9port.nix { condition = hostPlatform.isLinux; })
|
||||||
|
(loadModule ./services/playerctld.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/polybar.nix { })
|
(loadModule ./services/polybar.nix { })
|
||||||
|
(loadModule ./services/poweralertd.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/pulseeffects.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/pulseeffects.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/random-background.nix { })
|
(loadModule ./services/random-background.nix { })
|
||||||
(loadModule ./services/redshift.nix { })
|
(loadModule ./services/redshift-gammastep/redshift.nix { })
|
||||||
(loadModule ./services/rsibreak.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/rsibreak.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/screen-locker.nix { })
|
(loadModule ./services/screen-locker.nix { })
|
||||||
(loadModule ./services/stalonetray.nix { })
|
(loadModule ./services/stalonetray.nix { })
|
||||||
|
@ -190,12 +222,14 @@ let
|
||||||
(loadModule ./services/window-managers/i3-sway/i3.nix { })
|
(loadModule ./services/window-managers/i3-sway/i3.nix { })
|
||||||
(loadModule ./services/window-managers/i3-sway/sway.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/window-managers/i3-sway/sway.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/window-managers/xmonad.nix { })
|
(loadModule ./services/window-managers/xmonad.nix { })
|
||||||
|
(loadModule ./services/wlsunset.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/xcape.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/xcape.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/xembed-sni-proxy.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/xembed-sni-proxy.nix { condition = hostPlatform.isLinux; })
|
||||||
|
(loadModule ./services/xidlehook.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./services/xscreensaver.nix { })
|
(loadModule ./services/xscreensaver.nix { })
|
||||||
(loadModule ./services/xsuspender.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./services/xsuspender.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./systemd.nix { })
|
(loadModule ./systemd.nix { })
|
||||||
(loadModule ./targets/darwin.nix { condition = hostPlatform.isDarwin; })
|
(loadModule ./targets/darwin { condition = hostPlatform.isDarwin; })
|
||||||
(loadModule ./targets/generic-linux.nix { condition = hostPlatform.isLinux; })
|
(loadModule ./targets/generic-linux.nix { condition = hostPlatform.isLinux; })
|
||||||
(loadModule ./xcursor.nix { })
|
(loadModule ./xcursor.nix { })
|
||||||
(loadModule ./xresources.nix { })
|
(loadModule ./xresources.nix { })
|
||||||
|
|
|
@ -6,9 +6,7 @@ let
|
||||||
|
|
||||||
cfg = config.programs.afew;
|
cfg = config.programs.afew;
|
||||||
|
|
||||||
in
|
in {
|
||||||
|
|
||||||
{
|
|
||||||
options.programs.afew = {
|
options.programs.afew = {
|
||||||
enable = mkEnableOption "the afew initial tagging script for Notmuch";
|
enable = mkEnableOption "the afew initial tagging script for Notmuch";
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
cfg = config.programs.alacritty;
|
cfg = config.programs.alacritty;
|
||||||
|
yamlFormat = pkgs.formats.yaml { };
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
programs.alacritty = {
|
programs.alacritty = {
|
||||||
|
@ -19,7 +18,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = types.attrs;
|
type = yamlFormat.type;
|
||||||
default = { };
|
default = { };
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
{
|
{
|
||||||
|
@ -51,6 +50,11 @@ in {
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
xdg.configFile."alacritty/alacritty.yml" = mkIf (cfg.settings != { }) {
|
xdg.configFile."alacritty/alacritty.yml" = mkIf (cfg.settings != { }) {
|
||||||
|
# TODO: Replace by the generate function but need to figure out how to
|
||||||
|
# handle the escaping first.
|
||||||
|
#
|
||||||
|
# source = yamlFormat.generate "alacritty.yml" cfg.settings;
|
||||||
|
|
||||||
text =
|
text =
|
||||||
replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.settings);
|
replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.settings);
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,9 +7,12 @@ let
|
||||||
|
|
||||||
cfg = config.programs.alot;
|
cfg = config.programs.alot;
|
||||||
|
|
||||||
alotAccounts =
|
enabledAccounts =
|
||||||
filter (a: a.notmuch.enable) (attrValues config.accounts.email.accounts);
|
filter (a: a.notmuch.enable) (attrValues config.accounts.email.accounts);
|
||||||
|
|
||||||
|
# sorted: primary first
|
||||||
|
alotAccounts = sort (a: b: !(a.primary -> b.primary)) enabledAccounts;
|
||||||
|
|
||||||
boolStr = v: if v then "True" else "False";
|
boolStr = v: if v then "True" else "False";
|
||||||
|
|
||||||
mkKeyValue = key: value:
|
mkKeyValue = key: value:
|
||||||
|
|
|
@ -16,7 +16,7 @@ with lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
extraConfig = mkOption {
|
extraConfig = mkOption {
|
||||||
type = types.attrs;
|
type = types.attrsOf types.anything;
|
||||||
default = { };
|
default = { };
|
||||||
example = { select_query = ""; };
|
example = { select_query = ""; };
|
||||||
description = ''
|
description = ''
|
||||||
|
|
|
@ -7,6 +7,8 @@ let
|
||||||
|
|
||||||
cfg = config.programs.astroid;
|
cfg = config.programs.astroid;
|
||||||
|
|
||||||
|
jsonFormat = pkgs.formats.json { };
|
||||||
|
|
||||||
astroidAccounts =
|
astroidAccounts =
|
||||||
filterAttrs (n: v: v.astroid.enable) config.accounts.email.accounts;
|
filterAttrs (n: v: v.astroid.enable) config.accounts.email.accounts;
|
||||||
|
|
||||||
|
@ -36,19 +38,18 @@ let
|
||||||
} // astroid.extraConfig;
|
} // astroid.extraConfig;
|
||||||
|
|
||||||
# See https://github.com/astroidmail/astroid/wiki/Configuration-Reference
|
# See https://github.com/astroidmail/astroid/wiki/Configuration-Reference
|
||||||
configFile = mailAccounts:
|
finalConfig = let
|
||||||
let
|
template = fromJSON (readFile ./astroid-config-template.json);
|
||||||
template = fromJSON (readFile ./astroid-config-template.json);
|
astroidConfig = foldl' recursiveUpdate template [
|
||||||
astroidConfig = foldl' recursiveUpdate template [
|
{
|
||||||
{
|
astroid.notmuch_config = "${config.xdg.configHome}/notmuch/notmuchrc";
|
||||||
astroid.notmuch_config = "${config.xdg.configHome}/notmuch/notmuchrc";
|
accounts = mapAttrs (n: accountAttr) astroidAccounts;
|
||||||
accounts = mapAttrs (n: accountAttr) astroidAccounts;
|
crypto.gpg.path = "${pkgs.gnupg}/bin/gpg";
|
||||||
crypto.gpg.path = "${pkgs.gnupg}/bin/gpg";
|
}
|
||||||
}
|
cfg.extraConfig
|
||||||
cfg.extraConfig
|
cfg.externalEditor
|
||||||
cfg.externalEditor
|
];
|
||||||
];
|
in astroidConfig;
|
||||||
in builtins.toJSON astroidConfig;
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
|
@ -90,9 +91,13 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
extraConfig = mkOption {
|
extraConfig = mkOption {
|
||||||
type = types.attrs;
|
type = jsonFormat.type;
|
||||||
default = { };
|
default = { };
|
||||||
example = { poll.interval = 0; };
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
poll.interval = 0;
|
||||||
|
}
|
||||||
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
JSON config that will override the default Astroid configuration.
|
JSON config that will override the default Astroid configuration.
|
||||||
'';
|
'';
|
||||||
|
@ -107,13 +112,8 @@ in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ pkgs.astroid ];
|
home.packages = [ pkgs.astroid ];
|
||||||
|
|
||||||
xdg.configFile."astroid/config".source = pkgs.runCommand "out.json" {
|
xdg.configFile."astroid/config".source =
|
||||||
json = configFile astroidAccounts;
|
jsonFormat.generate "astroid-config" finalConfig;
|
||||||
preferLocalBuild = true;
|
|
||||||
allowSubstitutes = false;
|
|
||||||
} ''
|
|
||||||
echo -n "$json" | ${pkgs.jq}/bin/jq . > $out
|
|
||||||
'';
|
|
||||||
|
|
||||||
xdg.configFile."astroid/poll.sh" = {
|
xdg.configFile."astroid/poll.sh" = {
|
||||||
executable = true;
|
executable = true;
|
||||||
|
|
|
@ -30,8 +30,8 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
historyFile = mkOption {
|
historyFile = mkOption {
|
||||||
type = types.str;
|
type = types.nullOr types.str;
|
||||||
default = "$HOME/.bash_history";
|
default = null;
|
||||||
description = "Location of the bash history file.";
|
description = "Location of the bash history file.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -111,17 +111,6 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
bashrcExtra = mkOption {
|
|
||||||
# Hide for now, may want to rename in the future.
|
|
||||||
visible = false;
|
|
||||||
default = "";
|
|
||||||
type = types.lines;
|
|
||||||
description = ''
|
|
||||||
Extra commands that should be added to
|
|
||||||
<filename>~/.bashrc</filename>.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
initExtra = mkOption {
|
initExtra = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
|
@ -131,6 +120,15 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bashrcExtra = mkOption {
|
||||||
|
default = "";
|
||||||
|
type = types.lines;
|
||||||
|
description = ''
|
||||||
|
Extra commands that should be placed in <filename>~/.bashrc</filename>.
|
||||||
|
Note that these commands will be run even in non-interactive shells.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
logoutExtra = mkOption {
|
logoutExtra = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
|
@ -157,10 +155,12 @@ in
|
||||||
historyControlStr =
|
historyControlStr =
|
||||||
concatStringsSep "\n" (mapAttrsToList (n: v: "${n}=${v}") (
|
concatStringsSep "\n" (mapAttrsToList (n: v: "${n}=${v}") (
|
||||||
{
|
{
|
||||||
HISTFILE = "\"${cfg.historyFile}\"";
|
|
||||||
HISTFILESIZE = toString cfg.historyFileSize;
|
HISTFILESIZE = toString cfg.historyFileSize;
|
||||||
HISTSIZE = toString cfg.historySize;
|
HISTSIZE = toString cfg.historySize;
|
||||||
}
|
}
|
||||||
|
// optionalAttrs (cfg.historyFile != null) {
|
||||||
|
HISTFILE = "\"${cfg.historyFile}\"";
|
||||||
|
}
|
||||||
// optionalAttrs (cfg.historyControl != []) {
|
// optionalAttrs (cfg.historyControl != []) {
|
||||||
HISTCONTROL = concatStringsSep ":" cfg.historyControl;
|
HISTCONTROL = concatStringsSep ":" cfg.historyControl;
|
||||||
}
|
}
|
||||||
|
@ -169,22 +169,7 @@ in
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
in mkIf cfg.enable {
|
in mkIf cfg.enable {
|
||||||
programs.bash.bashrcExtra = ''
|
home.file.".bash_profile".source = pkgs.writeShellScript "bash_profile" ''
|
||||||
# Commands that should be applied only for interactive shells.
|
|
||||||
if [[ $- == *i* ]]; then
|
|
||||||
${historyControlStr}
|
|
||||||
|
|
||||||
${shoptsStr}
|
|
||||||
|
|
||||||
${aliasesStr}
|
|
||||||
|
|
||||||
${cfg.initExtra}
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
home.file.".bash_profile".text = ''
|
|
||||||
# -*- mode: sh -*-
|
|
||||||
|
|
||||||
# include .profile if it exists
|
# include .profile if it exists
|
||||||
[[ -f ~/.profile ]] && . ~/.profile
|
[[ -f ~/.profile ]] && . ~/.profile
|
||||||
|
|
||||||
|
@ -192,9 +177,7 @@ in
|
||||||
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
||||||
'';
|
'';
|
||||||
|
|
||||||
home.file.".profile".text = ''
|
home.file.".profile".source = pkgs.writeShellScript "profile" ''
|
||||||
# -*- mode: sh -*-
|
|
||||||
|
|
||||||
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
|
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
|
||||||
|
|
||||||
${sessionVarsStr}
|
${sessionVarsStr}
|
||||||
|
@ -202,18 +185,23 @@ in
|
||||||
${cfg.profileExtra}
|
${cfg.profileExtra}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
home.file.".bashrc".text = ''
|
home.file.".bashrc".source = pkgs.writeShellScript "bashrc" ''
|
||||||
# -*- mode: sh -*-
|
|
||||||
|
|
||||||
${cfg.bashrcExtra}
|
${cfg.bashrcExtra}
|
||||||
|
|
||||||
|
# Commands that should be applied only for interactive shells.
|
||||||
|
[[ $- == *i* ]] || return
|
||||||
|
|
||||||
|
${historyControlStr}
|
||||||
|
|
||||||
|
${shoptsStr}
|
||||||
|
|
||||||
|
${aliasesStr}
|
||||||
|
|
||||||
|
${cfg.initExtra}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
home.file.".bash_logout" = mkIf (cfg.logoutExtra != "") {
|
home.file.".bash_logout" = mkIf (cfg.logoutExtra != "") {
|
||||||
text = ''
|
source = pkgs.writeShellScript "bash_logout" cfg.logoutExtra;
|
||||||
# -*- mode: sh -*-
|
|
||||||
|
|
||||||
${cfg.logoutExtra}
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -6,6 +6,8 @@ let
|
||||||
|
|
||||||
cfg = config.programs.beets;
|
cfg = config.programs.beets;
|
||||||
|
|
||||||
|
yamlFormat = pkgs.formats.yaml { };
|
||||||
|
|
||||||
in {
|
in {
|
||||||
meta.maintainers = [ maintainers.rycee ];
|
meta.maintainers = [ maintainers.rycee ];
|
||||||
|
|
||||||
|
@ -39,7 +41,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = types.attrs;
|
type = yamlFormat.type;
|
||||||
default = { };
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
Configuration written to
|
Configuration written to
|
||||||
|
@ -52,7 +54,7 @@ in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
xdg.configFile."beets/config.yaml".text =
|
xdg.configFile."beets/config.yaml".source =
|
||||||
builtins.toJSON config.programs.beets.settings;
|
yamlFormat.generate "beets-config" cfg.settings;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,20 +6,10 @@ let
|
||||||
|
|
||||||
cfg = config.programs.broot;
|
cfg = config.programs.broot;
|
||||||
|
|
||||||
configFile = config:
|
tomlFormat = pkgs.formats.toml { };
|
||||||
pkgs.runCommand "conf.toml" {
|
|
||||||
buildInputs = [ pkgs.remarshal ];
|
|
||||||
preferLocalBuild = true;
|
|
||||||
allowSubstitutes = false;
|
|
||||||
} ''
|
|
||||||
remarshal -if json -of toml \
|
|
||||||
< ${pkgs.writeText "verbs.json" (builtins.toJSON config)} \
|
|
||||||
> $out
|
|
||||||
'';
|
|
||||||
|
|
||||||
brootConf = {
|
brootConf = {
|
||||||
verbs =
|
verbs = cfg.verbs;
|
||||||
mapAttrsToList (name: value: value // { invocation = name; }) cfg.verbs;
|
|
||||||
skin = cfg.skin;
|
skin = cfg.skin;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -54,41 +44,60 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
verbs = mkOption {
|
verbs = mkOption {
|
||||||
type = with types; attrsOf (attrsOf (either bool str));
|
type = with types; listOf (attrsOf (either bool str));
|
||||||
default = {
|
default = [
|
||||||
"p" = { execution = ":parent"; };
|
{
|
||||||
"edit" = {
|
invocation = "p";
|
||||||
|
execution = ":parent";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
invocation = "edit";
|
||||||
shortcut = "e";
|
shortcut = "e";
|
||||||
execution = "$EDITOR {file}";
|
execution = "$EDITOR {file}";
|
||||||
};
|
}
|
||||||
"create {subpath}" = { execution = "$EDITOR {directory}/{subpath}"; };
|
|
||||||
"view" = { execution = "less {file}"; };
|
|
||||||
};
|
|
||||||
example = literalExample ''
|
|
||||||
{
|
{
|
||||||
"p" = { execution = ":parent"; };
|
invocation = "create {subpath}";
|
||||||
"edit" = { shortcut = "e"; execution = "$EDITOR {file}" ; };
|
execution = "$EDITOR {directory}/{subpath}";
|
||||||
"create {subpath}" = { execution = "$EDITOR {directory}/{subpath}"; };
|
}
|
||||||
"view" = { execution = "less {file}"; };
|
{
|
||||||
"blop {name}\\.{type}" = {
|
invocation = "view";
|
||||||
|
execution = "less {file}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
example = literalExample ''
|
||||||
|
[
|
||||||
|
{ invocation = "p"; execution = ":parent"; }
|
||||||
|
{ invocation = "edit"; shortcut = "e"; execution = "$EDITOR {file}" ; }
|
||||||
|
{ invocation = "create {subpath}"; execution = "$EDITOR {directory}/{subpath}"; }
|
||||||
|
{ invocation = "view"; execution = "less {file}"; }
|
||||||
|
{
|
||||||
|
invocation = "blop {name}\\.{type}";
|
||||||
execution = "/bin/mkdir {parent}/{type} && /usr/bin/nvim {parent}/{type}/{name}.{type}";
|
execution = "/bin/mkdir {parent}/{type} && /usr/bin/nvim {parent}/{type}/{name}.{type}";
|
||||||
from_shell = true;
|
from_shell = true;
|
||||||
};
|
}
|
||||||
}
|
]
|
||||||
'';
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
Define new verbs. The attribute name indicates how the verb is
|
Define new verbs. For more information, see
|
||||||
called by the user, with placeholders for arguments.
|
<link xlink:href="https://dystroy.org/broot/documentation/configuration/#verb-definition-attributes"/>.
|
||||||
</para><para>
|
</para><para>
|
||||||
The possible attributes are:
|
The possible attributes are:
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>invocation</literal> (optional)</term>
|
||||||
|
<listitem><para>how the verb is called by the user, with placeholders for arguments</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><literal>execution</literal> (mandatory)</term>
|
<term><literal>execution</literal> (mandatory)</term>
|
||||||
<listitem><para>how the verb is executed</para></listitem>
|
<listitem><para>how the verb is executed</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>key</literal> (optional)</term>
|
||||||
|
<listitem><para>a keyboard key triggering execution</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><literal>shortcut</literal> (optional)</term>
|
<term><literal>shortcut</literal> (optional)</term>
|
||||||
<listitem><para>an alternate way to call the verb (without
|
<listitem><para>an alternate way to call the verb (without
|
||||||
|
@ -109,6 +118,13 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.broot;
|
||||||
|
defaultText = literalExample "pkgs.broot";
|
||||||
|
description = "Package providing broot";
|
||||||
|
};
|
||||||
|
|
||||||
skin = mkOption {
|
skin = mkOption {
|
||||||
type = types.attrsOf types.str;
|
type = types.attrsOf types.str;
|
||||||
default = { };
|
default = { };
|
||||||
|
@ -167,9 +183,10 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ pkgs.broot ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
xdg.configFile."broot/conf.toml".source = configFile brootConf;
|
xdg.configFile."broot/conf.toml".source =
|
||||||
|
tomlFormat.generate "broot-config" brootConf;
|
||||||
|
|
||||||
# Dummy file to prevent broot from trying to reinstall itself
|
# Dummy file to prevent broot from trying to reinstall itself
|
||||||
xdg.configFile."broot/launcher/installed-v1".text = "";
|
xdg.configFile."broot/launcher/installed-v1".text = "";
|
||||||
|
|
|
@ -5,7 +5,9 @@ with lib;
|
||||||
let
|
let
|
||||||
|
|
||||||
browserModule = defaultPkg: name: visible:
|
browserModule = defaultPkg: name: visible:
|
||||||
let browser = (builtins.parseDrvName defaultPkg.name).name;
|
let
|
||||||
|
browser = (builtins.parseDrvName defaultPkg.name).name;
|
||||||
|
isProprietaryChrome = hasPrefix "Google Chrome" name;
|
||||||
in {
|
in {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
inherit visible;
|
inherit visible;
|
||||||
|
@ -22,23 +24,78 @@ let
|
||||||
defaultText = literalExample "pkgs.${browser}";
|
defaultText = literalExample "pkgs.${browser}";
|
||||||
description = "The ${name} package to use.";
|
description = "The ${name} package to use.";
|
||||||
};
|
};
|
||||||
|
} // optionalAttrs (!isProprietaryChrome) {
|
||||||
|
# Extensions do not work with Google Chrome
|
||||||
|
# see https://github.com/nix-community/home-manager/issues/1383
|
||||||
extensions = mkOption {
|
extensions = mkOption {
|
||||||
inherit visible;
|
inherit visible;
|
||||||
type = types.listOf types.str;
|
type = with types;
|
||||||
|
let
|
||||||
|
extensionType = submodule {
|
||||||
|
options = {
|
||||||
|
id = mkOption {
|
||||||
|
type = strMatching "[a-zA-Z]{32}";
|
||||||
|
description = ''
|
||||||
|
The extension's ID from the Chome Web Store url or the unpacked crx.
|
||||||
|
'';
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
updateUrl = mkOption {
|
||||||
|
type = str;
|
||||||
|
description = ''
|
||||||
|
URL of the extension's update manifest XML file. Linux only.
|
||||||
|
'';
|
||||||
|
default = "https://clients2.google.com/service/update2/crx";
|
||||||
|
visible = pkgs.stdenv.isLinux;
|
||||||
|
readOnly = pkgs.stdenv.isDarwin;
|
||||||
|
};
|
||||||
|
|
||||||
|
crxPath = mkOption {
|
||||||
|
type = nullOr path;
|
||||||
|
description = ''
|
||||||
|
Path to the extension's crx file. Linux only.
|
||||||
|
'';
|
||||||
|
default = null;
|
||||||
|
visible = pkgs.stdenv.isLinux;
|
||||||
|
};
|
||||||
|
|
||||||
|
version = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
description = ''
|
||||||
|
The extension's version, required for local installation. Linux only.
|
||||||
|
'';
|
||||||
|
default = null;
|
||||||
|
visible = pkgs.stdenv.isLinux;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in listOf (coercedTo str (v: { id = v; }) extensionType);
|
||||||
default = [ ];
|
default = [ ];
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
[
|
[
|
||||||
"chlffgpmiacpedhhbkiomidkjlcfhogd" # pushbullet
|
{ id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; } # ublock origin
|
||||||
"mbniclmhobmnbdlbpiphghaielnnpgdp" # lightshot
|
{
|
||||||
"gcbommkclmclpchllfjekcdonpmejbdp" # https everywhere
|
id = "dcpihecpambacapedldabdbpakmachpb";
|
||||||
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock origin
|
updateUrl = "https://raw.githubusercontent.com/iamadamdev/bypass-paywalls-chrome/master/updates.xml";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
id = "aaaaaaaaaabbbbbbbbbbcccccccccc";
|
||||||
|
crxPath = "/home/share/extension.crx";
|
||||||
|
version = "1.0";
|
||||||
|
}
|
||||||
]
|
]
|
||||||
'';
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
List of ${name} extensions to install.
|
List of ${name} extensions to install.
|
||||||
To find the extension ID, check its URL on the
|
To find the extension ID, check its URL on the
|
||||||
<link xlink:href="https://chrome.google.com/webstore/category/extensions">Chrome Web Store</link>.
|
<link xlink:href="https://chrome.google.com/webstore/category/extensions">Chrome Web Store</link>.
|
||||||
|
</para><para>
|
||||||
|
To install extensions outside of the Chrome Web Store set
|
||||||
|
<literal>updateUrl</literal> or <literal>crxPath</literal> and
|
||||||
|
<literal>version</literal> as explained in the
|
||||||
|
<link xlink:href="https://developer.chrome.com/docs/extensions/mv2/external_extensions">Chrome
|
||||||
|
documentation</link>.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -46,13 +103,15 @@ let
|
||||||
browserConfig = cfg:
|
browserConfig = cfg:
|
||||||
let
|
let
|
||||||
|
|
||||||
browser = (builtins.parseDrvName cfg.package.name).name;
|
drvName = (builtins.parseDrvName cfg.package.name).name;
|
||||||
|
browser = if drvName == "ungoogled-chromium" then "chromium" else drvName;
|
||||||
|
|
||||||
darwinDirs = {
|
darwinDirs = {
|
||||||
chromium = "Chromium";
|
chromium = "Chromium";
|
||||||
google-chrome = "Google/Chrome";
|
google-chrome = "Google/Chrome";
|
||||||
google-chrome-beta = "Google/Chrome Beta";
|
google-chrome-beta = "Google/Chrome Beta";
|
||||||
google-chrome-dev = "Google/Chrome Dev";
|
google-chrome-dev = "Google/Chrome Dev";
|
||||||
|
brave = "BraveSoftware/Brave-Browser";
|
||||||
};
|
};
|
||||||
|
|
||||||
configDir = if pkgs.stdenv.isDarwin then
|
configDir = if pkgs.stdenv.isDarwin then
|
||||||
|
@ -60,20 +119,33 @@ let
|
||||||
else
|
else
|
||||||
"${config.xdg.configHome}/${browser}";
|
"${config.xdg.configHome}/${browser}";
|
||||||
|
|
||||||
extensionJson = ext: {
|
extensionJson = ext:
|
||||||
name = "${configDir}/External Extensions/${ext}.json";
|
assert ext.crxPath != null -> ext.version != null;
|
||||||
value.text = builtins.toJSON {
|
with builtins; {
|
||||||
external_update_url =
|
name = "${configDir}/External Extensions/${ext.id}.json";
|
||||||
"https://clients2.google.com/service/update2/crx";
|
value.text = toJSON (if ext.crxPath != null then {
|
||||||
|
external_crx = ext.crxPath;
|
||||||
|
external_version = ext.version;
|
||||||
|
} else {
|
||||||
|
external_update_url = ext.updateUrl;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
in mkIf cfg.enable {
|
in mkIf cfg.enable {
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
home.file = listToAttrs (map extensionJson cfg.extensions);
|
home.file = listToAttrs (map extensionJson (cfg.extensions or [ ]));
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
# Extensions do not work with the proprietary Google Chrome version
|
||||||
|
# see https://github.com/nix-community/home-manager/issues/1383
|
||||||
|
imports = map (flip mkRemovedOptionModule
|
||||||
|
"The `extensions` option does not work on Google Chrome anymore.") [
|
||||||
|
[ "programs" "google-chrome" "extensions" ]
|
||||||
|
[ "programs" "google-chrome-beta" "extensions" ]
|
||||||
|
[ "programs" "google-chrome-dev" "extensions" ]
|
||||||
|
];
|
||||||
|
|
||||||
options.programs = {
|
options.programs = {
|
||||||
chromium = browserModule pkgs.chromium "Chromium" true;
|
chromium = browserModule pkgs.chromium "Chromium" true;
|
||||||
google-chrome = browserModule pkgs.google-chrome "Google Chrome" false;
|
google-chrome = browserModule pkgs.google-chrome "Google Chrome" false;
|
||||||
|
@ -81,6 +153,7 @@ in {
|
||||||
browserModule pkgs.google-chrome-beta "Google Chrome Beta" false;
|
browserModule pkgs.google-chrome-beta "Google Chrome Beta" false;
|
||||||
google-chrome-dev =
|
google-chrome-dev =
|
||||||
browserModule pkgs.google-chrome-dev "Google Chrome Dev" false;
|
browserModule pkgs.google-chrome-dev "Google Chrome Dev" false;
|
||||||
|
brave = browserModule pkgs.brave "Brave Browser" false;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkMerge [
|
config = mkMerge [
|
||||||
|
@ -88,5 +161,6 @@ in {
|
||||||
(browserConfig config.programs.google-chrome)
|
(browserConfig config.programs.google-chrome)
|
||||||
(browserConfig config.programs.google-chrome-beta)
|
(browserConfig config.programs.google-chrome-beta)
|
||||||
(browserConfig config.programs.google-chrome-dev)
|
(browserConfig config.programs.google-chrome-dev)
|
||||||
|
(browserConfig config.programs.brave)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -204,8 +204,8 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
home.file.".dir_colors".text = concatStringsSep "\n" ([ ]
|
home.file.".dir_colors".text = concatStringsSep "\n" ([ ]
|
||||||
++ optional (cfg.extraConfig != "") cfg.extraConfig
|
++ mapAttrsToList formatLine cfg.settings ++ [ "" ]
|
||||||
++ mapAttrsToList formatLine cfg.settings) + "\n";
|
++ optional (cfg.extraConfig != "") cfg.extraConfig);
|
||||||
|
|
||||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
|
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
|
||||||
eval $(${pkgs.coreutils}/bin/dircolors -b ~/.dir_colors)
|
eval $(${pkgs.coreutils}/bin/dircolors -b ~/.dir_colors)
|
||||||
|
|
|
@ -5,25 +5,25 @@ with lib;
|
||||||
let
|
let
|
||||||
|
|
||||||
cfg = config.programs.direnv;
|
cfg = config.programs.direnv;
|
||||||
configFile = config:
|
|
||||||
pkgs.runCommand "config.toml" {
|
tomlFormat = pkgs.formats.toml { };
|
||||||
buildInputs = [ pkgs.remarshal ];
|
|
||||||
preferLocalBuild = true;
|
|
||||||
allowSubstitutes = false;
|
|
||||||
} ''
|
|
||||||
remarshal -if json -of toml \
|
|
||||||
< ${pkgs.writeText "config.json" (builtins.toJSON config)} \
|
|
||||||
> $out
|
|
||||||
'';
|
|
||||||
|
|
||||||
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 = {
|
||||||
enable = mkEnableOption "direnv, the environment switcher";
|
enable = mkEnableOption "direnv, the environment switcher";
|
||||||
|
|
||||||
config = mkOption {
|
config = mkOption {
|
||||||
type = types.attrs;
|
type = tomlFormat.type;
|
||||||
default = { };
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
Configuration written to
|
Configuration written to
|
||||||
|
@ -71,22 +71,29 @@ 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 {
|
||||||
home.packages = [ pkgs.direnv ];
|
home.packages = [ pkgs.direnv ];
|
||||||
|
|
||||||
xdg.configFile."direnv/config.toml" =
|
xdg.configFile."direnv/config.toml" = mkIf (cfg.config != { }) {
|
||||||
mkIf (cfg.config != { }) { source = configFile cfg.config; };
|
source = tomlFormat.generate "direnv-config" cfg.config;
|
||||||
|
};
|
||||||
|
|
||||||
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 (
|
||||||
|
@ -101,7 +108,7 @@ in {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
|
programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
|
||||||
eval (${pkgs.direnv}/bin/direnv hook fish)
|
${pkgs.direnv}/bin/direnv hook fish | source
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
36
third_party/home-manager/modules/programs/exa.nix
vendored
Normal file
36
third_party/home-manager/modules/programs/exa.nix
vendored
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.programs.exa;
|
||||||
|
|
||||||
|
aliases = {
|
||||||
|
ls = "${pkgs.exa}/bin/exa";
|
||||||
|
ll = "${pkgs.exa}/bin/exa -l";
|
||||||
|
la = "${pkgs.exa}/bin/exa -a";
|
||||||
|
lt = "${pkgs.exa}/bin/exa --tree";
|
||||||
|
lla = "${pkgs.exa}/bin/exa -la";
|
||||||
|
};
|
||||||
|
|
||||||
|
in {
|
||||||
|
meta.maintainers = [ maintainers.kalhauge ];
|
||||||
|
|
||||||
|
options.programs.exa = {
|
||||||
|
enable =
|
||||||
|
mkEnableOption "exa, a modern replacement for <command>ls</command>";
|
||||||
|
enableAliases = mkEnableOption "recommended exa aliases";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [ pkgs.exa ];
|
||||||
|
|
||||||
|
programs.bash.shellAliases = mkIf cfg.enableAliases aliases;
|
||||||
|
|
||||||
|
programs.zsh.shellAliases = mkIf cfg.enableAliases aliases;
|
||||||
|
|
||||||
|
programs.fish.shellAliases = mkIf cfg.enableAliases aliases;
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
|
@ -67,6 +67,8 @@ in
|
||||||
meta.maintainers = [ maintainers.rycee ];
|
meta.maintainers = [ maintainers.rycee ];
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
|
(mkRemovedOptionModule ["programs" "firefox" "enableAdobeFlash"]
|
||||||
|
"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"]
|
||||||
|
@ -84,6 +86,17 @@ in
|
||||||
then pkgs.firefox
|
then pkgs.firefox
|
||||||
else pkgs.firefox-unwrapped;
|
else pkgs.firefox-unwrapped;
|
||||||
defaultText = literalExample "pkgs.firefox";
|
defaultText = literalExample "pkgs.firefox";
|
||||||
|
example = literalExample ''
|
||||||
|
pkgs.firefox.override {
|
||||||
|
# See nixpkgs' firefox/wrapper.nix to check which options you can use
|
||||||
|
cfg = {
|
||||||
|
# Gnome shell native connector
|
||||||
|
enableGnomeExtensions = true;
|
||||||
|
# Tridactyl native connector
|
||||||
|
enableTridactylNative = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
The Firefox package to use. If state version ≥ 19.09 then
|
The Firefox package to use. If state version ≥ 19.09 then
|
||||||
this should be a wrapped Firefox package. For earlier state
|
this should be a wrapped Firefox package. For earlier state
|
||||||
|
@ -215,12 +228,6 @@ in
|
||||||
description = "Attribute set of Firefox profiles.";
|
description = "Attribute set of Firefox profiles.";
|
||||||
};
|
};
|
||||||
|
|
||||||
enableAdobeFlash = mkOption {
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "Whether to enable the unfree Adobe Flash plugin.";
|
|
||||||
};
|
|
||||||
|
|
||||||
enableGnomeExtensions = mkOption {
|
enableGnomeExtensions = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
@ -268,11 +275,17 @@ in
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
warnings = optional (cfg.enableGnomeExtensions or false) ''
|
||||||
|
Using 'programs.firefox.enableGnomeExtensions' has been deprecated and
|
||||||
|
will be removed in the future. Please change to overriding the package
|
||||||
|
configuration using 'programs.firefox.package' instead. You can refer to
|
||||||
|
its example for how to do this.
|
||||||
|
'';
|
||||||
|
|
||||||
home.packages =
|
home.packages =
|
||||||
let
|
let
|
||||||
# The configuration expected by the Firefox wrapper.
|
# The configuration expected by the Firefox wrapper.
|
||||||
fcfg = {
|
fcfg = {
|
||||||
enableAdobeFlash = cfg.enableAdobeFlash;
|
|
||||||
enableGnomeExtensions = cfg.enableGnomeExtensions;
|
enableGnomeExtensions = cfg.enableGnomeExtensions;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -287,7 +300,7 @@ in
|
||||||
if isDarwin then
|
if isDarwin then
|
||||||
cfg.package
|
cfg.package
|
||||||
else if versionAtLeast config.home.stateVersion "19.09" then
|
else if versionAtLeast config.home.stateVersion "19.09" then
|
||||||
cfg.package.override { cfg = fcfg; }
|
cfg.package.override (old: { cfg = old.cfg or {} // fcfg; })
|
||||||
else
|
else
|
||||||
(pkgs.wrapFirefox.override { config = bcfg; }) cfg.package { };
|
(pkgs.wrapFirefox.override { config = bcfg; }) cfg.package { };
|
||||||
in
|
in
|
||||||
|
@ -305,6 +318,8 @@ in
|
||||||
};
|
};
|
||||||
}]
|
}]
|
||||||
++ flip mapAttrsToList cfg.profiles (_: profile: {
|
++ flip mapAttrsToList cfg.profiles (_: profile: {
|
||||||
|
"${profilesPath}/${profile.path}/.keep".text = "";
|
||||||
|
|
||||||
"${profilesPath}/${profile.path}/chrome/userChrome.css" =
|
"${profilesPath}/${profile.path}/chrome/userChrome.css" =
|
||||||
mkIf (profile.userChrome != "") {
|
mkIf (profile.userChrome != "") {
|
||||||
text = profile.userChrome;
|
text = profile.userChrome;
|
||||||
|
|
|
@ -343,7 +343,12 @@ in {
|
||||||
# if we haven't sourced the general config, do it
|
# if we haven't sourced the general config, do it
|
||||||
if not set -q __fish_general_config_sourced
|
if not set -q __fish_general_config_sourced
|
||||||
|
|
||||||
set -p fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions
|
set --prepend fish_function_path ${
|
||||||
|
if pkgs ? fishPlugins && pkgs.fishPlugins ? foreign-env then
|
||||||
|
"${pkgs.fishPlugins.foreign-env}/share/fish/vendor_functions.d"
|
||||||
|
else
|
||||||
|
"${pkgs.fish-foreign-env}/share/fish-foreign-env/functions"
|
||||||
|
}
|
||||||
fenv source ${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh > /dev/null
|
fenv source ${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh > /dev/null
|
||||||
set -e fish_function_path[1]
|
set -e fish_function_path[1]
|
||||||
|
|
||||||
|
|
77
third_party/home-manager/modules/programs/foot.nix
vendored
Normal file
77
third_party/home-manager/modules/programs/foot.nix
vendored
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.programs.foot;
|
||||||
|
iniFormat = pkgs.formats.ini { };
|
||||||
|
|
||||||
|
in {
|
||||||
|
meta.maintainers = with lib.maintainers; [ plabadens ];
|
||||||
|
|
||||||
|
options.programs.foot = {
|
||||||
|
enable = mkEnableOption "Foot terminal";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.foot;
|
||||||
|
defaultText = literalExample "pkgs.foot";
|
||||||
|
description = "The foot package to install";
|
||||||
|
};
|
||||||
|
|
||||||
|
server.enable = mkEnableOption "Foot terminal server";
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = iniFormat.type;
|
||||||
|
default = { };
|
||||||
|
description = ''
|
||||||
|
Configuration written to
|
||||||
|
<filename>$XDG_CONFIG_HOME/foot/foot.ini</filename>. See <link
|
||||||
|
xlink:href="https://codeberg.org/dnkl/foot/src/branch/master/foot.ini"/>
|
||||||
|
for a list of available options.
|
||||||
|
'';
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
main = {
|
||||||
|
term = "xterm-256color";
|
||||||
|
|
||||||
|
font = "Fira Code:size=11";
|
||||||
|
dpi-aware = "yes";
|
||||||
|
};
|
||||||
|
|
||||||
|
mouse = {
|
||||||
|
hide-when-typing = "yes";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
|
xdg.configFile."foot/foot.ini" = mkIf (cfg.settings != { }) {
|
||||||
|
source = iniFormat.generate "foot.ini" cfg.settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.services = mkIf cfg.server.enable {
|
||||||
|
foot = {
|
||||||
|
Unit = {
|
||||||
|
Description =
|
||||||
|
"Fast, lightweight and minimalistic Wayland terminal emulator.";
|
||||||
|
Documentation = "man:foot(1)";
|
||||||
|
PartOf = [ "graphical-session.target" ];
|
||||||
|
After = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
Service = {
|
||||||
|
ExecStart = "${cfg.package}/bin/foot --server";
|
||||||
|
Restart = "on-failure";
|
||||||
|
};
|
||||||
|
|
||||||
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -7,9 +7,21 @@ let
|
||||||
cfg = config.programs.fzf;
|
cfg = config.programs.fzf;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
imports = [
|
||||||
|
(mkRemovedOptionModule [ "programs" "fzf" "historyWidgetCommand" ]
|
||||||
|
"This option is no longer supported by fzf.")
|
||||||
|
];
|
||||||
|
|
||||||
options.programs.fzf = {
|
options.programs.fzf = {
|
||||||
enable = mkEnableOption "fzf - a command-line fuzzy finder";
|
enable = mkEnableOption "fzf - a command-line fuzzy finder";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.fzf;
|
||||||
|
defaultText = literalExample "pkgs.fzf";
|
||||||
|
description = "Package providing the <command>fzf</command> tool.";
|
||||||
|
};
|
||||||
|
|
||||||
defaultCommand = mkOption {
|
defaultCommand = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -67,15 +79,6 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
historyWidgetCommand = mkOption {
|
|
||||||
type = types.nullOr types.str;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
The command that gets executed as the source for fzf for the
|
|
||||||
CTRL-R keybinding.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
historyWidgetOptions = mkOption {
|
historyWidgetOptions = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
|
@ -85,6 +88,23 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tmux = {
|
||||||
|
enableShellIntegration = mkEnableOption ''
|
||||||
|
setting <literal>FZF_TMUX=1</literal> which causes shell integration to use fzf-tmux
|
||||||
|
'';
|
||||||
|
|
||||||
|
shellIntegrationOptions = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ ];
|
||||||
|
example = literalExample ''[ "-d 40%" ]'';
|
||||||
|
description = ''
|
||||||
|
If <option>programs.fzf.tmux.enableShellIntegration</option> is set to <literal>true</literal>,
|
||||||
|
shell integration will use these options for fzf-tmux.
|
||||||
|
See <command>fzf-tmux --help</command> for available options.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
enableBashIntegration = mkOption {
|
enableBashIntegration = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
|
@ -111,36 +131,37 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ pkgs.fzf ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
home.sessionVariables = mapAttrs (n: v: toString v)
|
home.sessionVariables = mapAttrs (n: v: toString v)
|
||||||
(filterAttrs (n: v: v != [ ] && v != null) {
|
(filterAttrs (n: v: v != [ ] && v != null) {
|
||||||
FZF_ALT_C_COMMAND = cfg.changeDirWidgetCommand;
|
FZF_ALT_C_COMMAND = cfg.changeDirWidgetCommand;
|
||||||
FZF_ALT_C_OPTS = cfg.changeDirWidgetOptions;
|
FZF_ALT_C_OPTS = cfg.changeDirWidgetOptions;
|
||||||
FZF_CTRL_R_COMMAND = cfg.historyWidgetCommand;
|
|
||||||
FZF_CTRL_R_OPTS = cfg.historyWidgetOptions;
|
FZF_CTRL_R_OPTS = cfg.historyWidgetOptions;
|
||||||
FZF_CTRL_T_COMMAND = cfg.fileWidgetCommand;
|
FZF_CTRL_T_COMMAND = cfg.fileWidgetCommand;
|
||||||
FZF_CTRL_T_OPTS = cfg.fileWidgetOptions;
|
FZF_CTRL_T_OPTS = cfg.fileWidgetOptions;
|
||||||
FZF_DEFAULT_COMMAND = cfg.defaultCommand;
|
FZF_DEFAULT_COMMAND = cfg.defaultCommand;
|
||||||
FZF_DEFAULT_OPTS = cfg.defaultOptions;
|
FZF_DEFAULT_OPTS = cfg.defaultOptions;
|
||||||
|
FZF_TMUX = if cfg.tmux.enableShellIntegration then "1" else null;
|
||||||
|
FZF_TMUX_OPTS = cfg.tmux.shellIntegrationOptions;
|
||||||
});
|
});
|
||||||
|
|
||||||
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
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,7 @@ let
|
||||||
with account;
|
with account;
|
||||||
let
|
let
|
||||||
passCmd = concatMapStringsSep ", " (x: "'${x}'") passwordCommand;
|
passCmd = concatMapStringsSep ", " (x: "'${x}'") passwordCommand;
|
||||||
renderedMailboxes =
|
renderedMailboxes = concatMapStrings (x: "'${x}', ") getmail.mailboxes;
|
||||||
concatMapStringsSep ", " (x: "'${x}'") getmail.mailboxes;
|
|
||||||
retrieverType = if imap.tls.enable then
|
retrieverType = if imap.tls.enable then
|
||||||
"SimpleIMAPSSLRetriever"
|
"SimpleIMAPSSLRetriever"
|
||||||
else
|
else
|
||||||
|
|
|
@ -45,9 +45,11 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ pkgs.gitAndTools.gh ];
|
home.packages = [ pkgs.gh ];
|
||||||
|
|
||||||
xdg.configFile."gh/config.yml".text =
|
xdg.configFile."gh/config.yml".text = builtins.toJSON {
|
||||||
builtins.toJSON { inherit (cfg) aliases editor gitProtocol; };
|
inherit (cfg) aliases editor;
|
||||||
|
git_protocol = cfg.gitProtocol;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,8 +61,13 @@ let
|
||||||
signModule = types.submodule {
|
signModule = types.submodule {
|
||||||
options = {
|
options = {
|
||||||
key = mkOption {
|
key = mkOption {
|
||||||
type = types.str;
|
type = types.nullOr types.str;
|
||||||
description = "The default GPG signing key fingerprint.";
|
description = ''
|
||||||
|
The default GPG signing key fingerprint.
|
||||||
|
</para><para>
|
||||||
|
Set to <literal>null</literal> to let GnuPG decide what signing key
|
||||||
|
to use depending on commit’s author.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
signByDefault = mkOption {
|
signByDefault = mkOption {
|
||||||
|
@ -101,7 +106,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
contents = mkOption {
|
contents = mkOption {
|
||||||
type = types.attrs;
|
type = types.attrsOf types.anything;
|
||||||
default = { };
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
Configuration to include. If empty then a path must be given.
|
Configuration to include. If empty then a path must be given.
|
||||||
|
@ -276,28 +281,34 @@ in {
|
||||||
|
|
||||||
genIdentity = name: account:
|
genIdentity = name: account:
|
||||||
with account;
|
with account;
|
||||||
nameValuePair "sendemail.${name}" ({
|
nameValuePair "sendemail.${name}" (if account.msmtp.enable then {
|
||||||
smtpEncryption = if smtp.tls.enable then
|
smtpServer = "${pkgs.msmtp}/bin/msmtp";
|
||||||
(if smtp.tls.useStartTls
|
envelopeSender = "auto";
|
||||||
|| versionOlder config.home.stateVersion "20.09" then
|
|
||||||
"tls"
|
|
||||||
else
|
|
||||||
"ssl")
|
|
||||||
else
|
|
||||||
"";
|
|
||||||
smtpServer = smtp.host;
|
|
||||||
smtpUser = userName;
|
|
||||||
from = address;
|
from = address;
|
||||||
} // optionalAttrs (smtp.port != null) {
|
} else
|
||||||
smtpServerPort = smtp.port;
|
{
|
||||||
});
|
smtpEncryption = if smtp.tls.enable then
|
||||||
|
(if smtp.tls.useStartTls
|
||||||
|
|| versionOlder config.home.stateVersion "20.09" then
|
||||||
|
"tls"
|
||||||
|
else
|
||||||
|
"ssl")
|
||||||
|
else
|
||||||
|
"";
|
||||||
|
smtpSslCertPath = mkIf smtp.tls.enable smtp.tls.certificatesFile;
|
||||||
|
smtpServer = smtp.host;
|
||||||
|
smtpUser = userName;
|
||||||
|
from = address;
|
||||||
|
} // optionalAttrs (smtp.port != null) {
|
||||||
|
smtpServerPort = smtp.port;
|
||||||
|
});
|
||||||
in mapAttrs' genIdentity
|
in mapAttrs' genIdentity
|
||||||
(filterAttrs hasSmtp config.accounts.email.accounts);
|
(filterAttrs hasSmtp config.accounts.email.accounts);
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkIf (cfg.signing != null) {
|
(mkIf (cfg.signing != null) {
|
||||||
programs.git.iniContent = {
|
programs.git.iniContent = {
|
||||||
user.signingKey = cfg.signing.key;
|
user.signingKey = mkIf (cfg.signing.key != null) cfg.signing.key;
|
||||||
commit.gpgSign = cfg.signing.signByDefault;
|
commit.gpgSign = cfg.signing.signByDefault;
|
||||||
gpg.program = cfg.signing.gpgPath;
|
gpg.program = cfg.signing.gpgPath;
|
||||||
};
|
};
|
||||||
|
@ -348,13 +359,14 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.delta.enable {
|
(mkIf cfg.delta.enable {
|
||||||
programs.git.iniContent =
|
home.packages = [ pkgs.delta ];
|
||||||
let deltaCommand = "${pkgs.gitAndTools.delta}/bin/delta";
|
|
||||||
in {
|
programs.git.iniContent = let deltaCommand = "${pkgs.delta}/bin/delta";
|
||||||
core.pager = deltaCommand;
|
in {
|
||||||
interactive.diffFilter = "${deltaCommand} --color-only";
|
core.pager = deltaCommand;
|
||||||
delta = cfg.delta.options;
|
interactive.diffFilter = "${deltaCommand} --color-only";
|
||||||
};
|
delta = cfg.delta.options;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
@ -228,12 +234,26 @@ let
|
||||||
</variablelist>
|
</variablelist>
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
audibleBell = mkOption {
|
||||||
|
default = true;
|
||||||
|
type = types.bool;
|
||||||
|
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.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
buildProfileSet = pcfg:
|
buildProfileSet = pcfg:
|
||||||
{
|
{
|
||||||
|
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;
|
||||||
|
@ -266,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;
|
||||||
|
@ -278,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 = {
|
||||||
|
@ -308,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 {
|
||||||
|
|
|
@ -5,31 +5,74 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.programs.gpg;
|
cfg = config.programs.gpg;
|
||||||
|
|
||||||
cfgText =
|
mkKeyValue = key: value:
|
||||||
concatStringsSep "\n"
|
if isString value
|
||||||
(attrValues
|
then "${key} ${value}"
|
||||||
(mapAttrs (key: value:
|
else optionalString value key;
|
||||||
if isString value
|
|
||||||
then "${key} ${value}"
|
|
||||||
else optionalString value key)
|
|
||||||
cfg.settings));
|
|
||||||
|
|
||||||
in {
|
cfgText = generators.toKeyValue {
|
||||||
|
inherit mkKeyValue;
|
||||||
|
listsAsDuplicateKeys = true;
|
||||||
|
} cfg.settings;
|
||||||
|
|
||||||
|
scdaemonCfgText = generators.toKeyValue {
|
||||||
|
inherit mkKeyValue;
|
||||||
|
listsAsDuplicateKeys = true;
|
||||||
|
} cfg.scdaemonSettings;
|
||||||
|
|
||||||
|
primitiveType = types.oneOf [ types.str types.bool ];
|
||||||
|
in
|
||||||
|
{
|
||||||
options.programs.gpg = {
|
options.programs.gpg = {
|
||||||
enable = mkEnableOption "GnuPG";
|
enable = mkEnableOption "GnuPG";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.gnupg;
|
||||||
|
defaultText = literalExample "pkgs.gnupg";
|
||||||
|
example = literalExample "pkgs.gnupg23";
|
||||||
|
description = "The Gnupg package to use (also used the gpg-agent service).";
|
||||||
|
};
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = types.attrsOf (types.either types.str types.bool);
|
type = types.attrsOf (types.either primitiveType (types.listOf types.str));
|
||||||
example = {
|
example = literalExample ''
|
||||||
no-comments = false;
|
{
|
||||||
s2k-cipher-algo = "AES128";
|
no-comments = false;
|
||||||
};
|
s2k-cipher-algo = "AES128";
|
||||||
|
}
|
||||||
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
GnuPG configuration options. Available options are described
|
GnuPG configuration options. Available options are described
|
||||||
in the gpg manpage:
|
in the gpg manpage:
|
||||||
<link xlink:href="https://gnupg.org/documentation/manpage.html"/>.
|
<link xlink:href="https://gnupg.org/documentation/manpage.html"/>.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Note that lists are converted to duplicate keys.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
scdaemonSettings = mkOption {
|
||||||
|
type = types.attrsOf (types.either primitiveType (types.listOf types.str));
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
disable-ccid = true;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
SCdaemon configuration options. Available options are described
|
||||||
|
in the gpg scdaemon manpage:
|
||||||
|
<link xlink:href="https://www.gnupg.org/documentation/manuals/gnupg/Scdaemon-Options.html"/>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
homedir = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
example = literalExample "\"\${config.xdg.dataHome}/gnupg\"";
|
||||||
|
default = "${config.home.homeDirectory}/.gnupg";
|
||||||
|
defaultText = literalExample "\"\${config.home.homeDirectory}/.gnupg\"";
|
||||||
|
description = "Directory to store keychains and configuration.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -54,8 +97,17 @@ in {
|
||||||
use-agent = mkDefault true;
|
use-agent = mkDefault true;
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = [ pkgs.gnupg ];
|
programs.gpg.scdaemonSettings = {
|
||||||
|
# no defaults for scdaemon
|
||||||
|
};
|
||||||
|
|
||||||
home.file.".gnupg/gpg.conf".text = cfgText;
|
home.packages = [ cfg.package ];
|
||||||
|
home.sessionVariables = {
|
||||||
|
GNUPGHOME = cfg.homedir;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.file."${cfg.homedir}/gpg.conf".text = cfgText;
|
||||||
|
|
||||||
|
home.file."${cfg.homedir}/scdaemon.conf".text = scdaemonCfgText;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
100
third_party/home-manager/modules/programs/himalaya.nix
vendored
Normal file
100
third_party/home-manager/modules/programs/himalaya.nix
vendored
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;
|
||||||
|
};
|
||||||
|
}
|
|
@ -6,8 +6,6 @@ let
|
||||||
|
|
||||||
cfg = config.programs.home-manager;
|
cfg = config.programs.home-manager;
|
||||||
|
|
||||||
dag = config.lib.dag;
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
meta.maintainers = [ maintainers.rycee ];
|
meta.maintainers = [ maintainers.rycee ];
|
||||||
|
|
||||||
|
|
511
third_party/home-manager/modules/programs/htop.nix
vendored
511
third_party/home-manager/modules/programs/htop.nix
vendored
|
@ -6,9 +6,20 @@ let
|
||||||
|
|
||||||
cfg = config.programs.htop;
|
cfg = config.programs.htop;
|
||||||
|
|
||||||
list = xs: concatMapStrings (x: "${toString x} ") xs;
|
formatOption = n: v:
|
||||||
|
let v' = if isBool v then (if v then "1" else "0") else toString v;
|
||||||
|
in "${n}=${v'}";
|
||||||
|
|
||||||
bool = b: if b then "1" else "0";
|
formatMeters = side: meters:
|
||||||
|
let
|
||||||
|
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";
|
||||||
|
rightMeters = formatMeters "right";
|
||||||
|
|
||||||
fields = {
|
fields = {
|
||||||
PID = 0;
|
PID = 0;
|
||||||
|
@ -66,13 +77,32 @@ let
|
||||||
M_PSSWP = 120;
|
M_PSSWP = 120;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
modes = {
|
||||||
|
Bar = 1;
|
||||||
|
Text = 2;
|
||||||
|
Graph = 3;
|
||||||
|
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;
|
||||||
|
Date = 2;
|
||||||
|
DateTime = 2;
|
||||||
LoadAverage = 2;
|
LoadAverage = 2;
|
||||||
Load = 2;
|
Load = 2;
|
||||||
Memory = 1;
|
Memory = 1;
|
||||||
Swap = 1;
|
Swap = 1;
|
||||||
|
Zram = 2;
|
||||||
|
HugePages = 2;
|
||||||
Tasks = 2;
|
Tasks = 2;
|
||||||
Uptime = 2;
|
Uptime = 2;
|
||||||
Battery = 2;
|
Battery = 2;
|
||||||
|
@ -80,6 +110,7 @@ let
|
||||||
AllCPUs = 1;
|
AllCPUs = 1;
|
||||||
AllCPUs2 = 1;
|
AllCPUs2 = 1;
|
||||||
AllCPUs4 = 1;
|
AllCPUs4 = 1;
|
||||||
|
AllCPUs8 = 1;
|
||||||
LeftCPUs = 1;
|
LeftCPUs = 1;
|
||||||
RightCPUs = 1;
|
RightCPUs = 1;
|
||||||
Right = 1;
|
Right = 1;
|
||||||
|
@ -88,6 +119,8 @@ let
|
||||||
RightCPUs2 = 1;
|
RightCPUs2 = 1;
|
||||||
LeftCPUs4 = 1;
|
LeftCPUs4 = 1;
|
||||||
RightCPUs4 = 1;
|
RightCPUs4 = 1;
|
||||||
|
LeftCPUs8 = 1;
|
||||||
|
RightCPUs8 = 1;
|
||||||
Blank = 2;
|
Blank = 2;
|
||||||
PressureStallCPUSome = 2;
|
PressureStallCPUSome = 2;
|
||||||
PressureStallIOSome = 2;
|
PressureStallIOSome = 2;
|
||||||
|
@ -105,6 +138,10 @@ let
|
||||||
"CPU(6)" = 1;
|
"CPU(6)" = 1;
|
||||||
"CPU(7)" = 1;
|
"CPU(7)" = 1;
|
||||||
"CPU(8)" = 1;
|
"CPU(8)" = 1;
|
||||||
|
SELinux = 2;
|
||||||
|
Systemd = 2;
|
||||||
|
DiskIO = 2;
|
||||||
|
NetworkIO = 2;
|
||||||
};
|
};
|
||||||
|
|
||||||
singleMeterType = let
|
singleMeterType = let
|
||||||
|
@ -166,22 +203,102 @@ in {
|
||||||
options.programs.htop = {
|
options.programs.htop = {
|
||||||
enable = mkEnableOption "htop";
|
enable = mkEnableOption "htop";
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = types.attrs;
|
||||||
|
default = {
|
||||||
|
account_guest_in_cpu_meter = false;
|
||||||
|
color_scheme = 0;
|
||||||
|
cpu_count_from_zero = false;
|
||||||
|
delay = 15;
|
||||||
|
detailed_cpu_time = false;
|
||||||
|
enable_mouse = true;
|
||||||
|
fields = with fields; [
|
||||||
|
PID
|
||||||
|
USER
|
||||||
|
PRIORITY
|
||||||
|
NICE
|
||||||
|
M_SIZE
|
||||||
|
M_RESIDENT
|
||||||
|
M_SHARE
|
||||||
|
STATE
|
||||||
|
PERCENT_CPU
|
||||||
|
PERCENT_MEM
|
||||||
|
TIME
|
||||||
|
COMM
|
||||||
|
];
|
||||||
|
header_margin = true;
|
||||||
|
hide_kernel_threads = true;
|
||||||
|
hide_threads = false;
|
||||||
|
hide_userland_threads = false;
|
||||||
|
highlight_base_name = false;
|
||||||
|
highlight_megabytes = true;
|
||||||
|
highlight_threads = true;
|
||||||
|
shadow_other_users = false;
|
||||||
|
show_cpu_frequency = false;
|
||||||
|
show_cpu_usage = false;
|
||||||
|
show_program_path = true;
|
||||||
|
show_thread_names = false;
|
||||||
|
sort_direction = 1;
|
||||||
|
sort_key = fields.PERCENT_CPU;
|
||||||
|
tree_view = false;
|
||||||
|
update_process_names = false;
|
||||||
|
vim_mode = false;
|
||||||
|
} // (leftMeters [
|
||||||
|
(bar "AllCPUs2")
|
||||||
|
(bar "Memory")
|
||||||
|
(bar "Swap")
|
||||||
|
(text "Zram")
|
||||||
|
]) // (rightMeters [
|
||||||
|
(text "Tasks")
|
||||||
|
(text "LoadAverage")
|
||||||
|
(text "Uptime")
|
||||||
|
(text "Systemd")
|
||||||
|
]);
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
color_scheme = 6;
|
||||||
|
cpu_count_from_one = 0;
|
||||||
|
delay = 15;
|
||||||
|
fields = with config.lib.htop.fields; [
|
||||||
|
PID
|
||||||
|
USER
|
||||||
|
PRIORITY
|
||||||
|
NICE
|
||||||
|
M_SIZE
|
||||||
|
M_RESIDENT
|
||||||
|
M_SHARE
|
||||||
|
STATE
|
||||||
|
PERCENT_CPU
|
||||||
|
PERCENT_MEM
|
||||||
|
TIME
|
||||||
|
COMM
|
||||||
|
];
|
||||||
|
highlight_base_name = 1;
|
||||||
|
highlight_megabytes = 1;
|
||||||
|
highlight_threads = 1;
|
||||||
|
} // (with config.lib.htop; leftMeters [
|
||||||
|
(bar "AllCPUs2")
|
||||||
|
(bar "Memory")
|
||||||
|
(bar "Swap")
|
||||||
|
(text "Zram")
|
||||||
|
]) // (with config.lib.htop; rightMeters [
|
||||||
|
(text "Tasks")
|
||||||
|
(text "LoadAverage")
|
||||||
|
(text "Uptime")
|
||||||
|
(text "Systemd")
|
||||||
|
]);
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Configuration options to add to
|
||||||
|
<filename>~/.config/htop/htoprc</filename>.
|
||||||
|
|
||||||
|
This superseedes any other (deprecated) settings in this module.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
fields = mkOption {
|
fields = mkOption {
|
||||||
type = types.listOf (types.enum (attrNames fields));
|
type = types.nullOr (types.listOf (types.enum (attrNames fields)));
|
||||||
default = [
|
default = null;
|
||||||
"PID"
|
|
||||||
"USER"
|
|
||||||
"PRIORITY"
|
|
||||||
"NICE"
|
|
||||||
"M_SIZE"
|
|
||||||
"M_RESIDENT"
|
|
||||||
"M_SHARE"
|
|
||||||
"STATE"
|
|
||||||
"PERCENT_CPU"
|
|
||||||
"PERCENT_MEM"
|
|
||||||
"TIME"
|
|
||||||
"COMM"
|
|
||||||
];
|
|
||||||
example = [
|
example = [
|
||||||
"PID"
|
"PID"
|
||||||
"USER"
|
"USER"
|
||||||
|
@ -192,151 +309,247 @@ in {
|
||||||
"TIME"
|
"TIME"
|
||||||
"COMM"
|
"COMM"
|
||||||
];
|
];
|
||||||
description = "Active fields shown in the table.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.fields instead.
|
||||||
|
|
||||||
|
Active fields shown in the table.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
sortKey = mkOption {
|
sortKey = mkOption {
|
||||||
type = types.enum (attrNames fields);
|
type = types.nullOr (types.enum (attrNames fields));
|
||||||
default = "PERCENT_CPU";
|
default = null;
|
||||||
example = "TIME";
|
example = "TIME";
|
||||||
description = "Which field to use for sorting.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.sort_key instead.
|
||||||
|
|
||||||
|
Which field to use for sorting.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
sortDescending = mkOption {
|
sortDescending = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = true;
|
default = null;
|
||||||
description = "Whether to sort descending or not.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.sort_direction instead.
|
||||||
|
|
||||||
|
Whether to sort descending or not.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
hideThreads = mkOption {
|
hideThreads = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = false;
|
default = null;
|
||||||
description = "Hide threads.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.hide_threads instead.
|
||||||
|
|
||||||
|
Hide threads.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
hideKernelThreads = mkOption {
|
hideKernelThreads = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = true;
|
default = null;
|
||||||
description = "Hide kernel threads.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.hide_kernel_threads instead.
|
||||||
|
|
||||||
|
Hide kernel threads.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
hideUserlandThreads = mkOption {
|
hideUserlandThreads = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = false;
|
default = null;
|
||||||
description = "Hide userland process threads.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.hide_userland_threads instead.
|
||||||
|
|
||||||
|
Hide userland process threads.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
shadowOtherUsers = mkOption {
|
shadowOtherUsers = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = false;
|
default = null;
|
||||||
description = "Shadow other users' processes.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.shadow_other_users instead.
|
||||||
|
|
||||||
|
Shadow other users' processes.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
showThreadNames = mkOption {
|
showThreadNames = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = false;
|
default = null;
|
||||||
description = "Show custom thread names.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.show_thread_names instead.
|
||||||
|
|
||||||
|
Show custom thread names.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
showProgramPath = mkOption {
|
showProgramPath = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = true;
|
default = null;
|
||||||
description = "Show program path.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.show_program_path instead.
|
||||||
|
|
||||||
|
Show program path.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
highlightBaseName = mkOption {
|
highlightBaseName = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = false;
|
default = null;
|
||||||
description = "Highlight program <quote>basename</quote>.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.highlight_base_name instead.
|
||||||
|
|
||||||
|
Highlight program <quote>basename</quote>.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
highlightMegabytes = mkOption {
|
highlightMegabytes = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = true;
|
default = null;
|
||||||
description = "Highlight large numbers in memory counters.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.highlight_megabytes instead.
|
||||||
|
|
||||||
|
Highlight large numbers in memory counters.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
highlightThreads = mkOption {
|
highlightThreads = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = true;
|
default = null;
|
||||||
description = "Display threads in a different color.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.highlight_threads instead.
|
||||||
|
|
||||||
|
Display threads in a different color.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
treeView = mkOption {
|
treeView = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = false;
|
default = null;
|
||||||
description = "Tree view.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.tree_view instead.
|
||||||
|
|
||||||
|
Tree view.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
headerMargin = mkOption {
|
headerMargin = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = true;
|
default = null;
|
||||||
description = "Leave a margin around header.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.header_margin instead.
|
||||||
|
|
||||||
|
Leave a margin around header.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
detailedCpuTime = mkOption {
|
detailedCpuTime = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = false;
|
default = null;
|
||||||
description =
|
description = ''
|
||||||
"Detailed CPU time (System/IO-Wait/Hard-IRQ/Soft-IRQ/Steal/Guest).";
|
Deprecated. Please use programs.htop.settings.detailed_cpu_time instead.
|
||||||
|
|
||||||
|
Detailed CPU time (System/IO-Wait/Hard-IRQ/Soft-IRQ/Steal/Guest).
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
cpuCountFromZero = mkOption {
|
cpuCountFromZero = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = false;
|
default = null;
|
||||||
description = "Count CPUs from 0 instead of 1.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.cpu_count_from_zero instead.
|
||||||
|
|
||||||
|
Count CPUs from 0 instead of 1.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
showCpuUsage = mkOption {
|
showCpuUsage = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = false;
|
default = null;
|
||||||
description = "Show CPU usage frequency.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.show_cpu_usage instead.
|
||||||
|
|
||||||
|
Show CPU usage frequency.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
showCpuFrequency = mkOption {
|
showCpuFrequency = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = false;
|
default = null;
|
||||||
description = "Show CPU frequency.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.show_cpu_frequency instead.
|
||||||
|
|
||||||
|
Show CPU frequency.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
updateProcessNames = mkOption {
|
updateProcessNames = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = false;
|
default = null;
|
||||||
description = "Update process names on every refresh.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.update_process_names instead.
|
||||||
|
|
||||||
|
Update process names on every refresh.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
accountGuestInCpuMeter = mkOption {
|
accountGuestInCpuMeter = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = false;
|
default = null;
|
||||||
description = "Add guest time in CPU meter percentage.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.account_guest_in_cpu_meter instead.
|
||||||
|
|
||||||
|
Add guest time in CPU meter percentage.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
colorScheme = mkOption {
|
colorScheme = mkOption {
|
||||||
type = types.enum [ 0 1 2 3 4 5 6 ];
|
type = types.nullOr (types.enum [ 0 1 2 3 4 5 6 ]);
|
||||||
default = 0;
|
default = null;
|
||||||
example = 6;
|
example = 6;
|
||||||
description = "Which color scheme to use.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.color_scheme instead.
|
||||||
|
|
||||||
|
Which color scheme to use.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
enableMouse = mkOption {
|
enableMouse = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = true;
|
default = null;
|
||||||
description = "Enable mouse support.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.enable_mouse instead.
|
||||||
|
|
||||||
|
Enable mouse support.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
delay = mkOption {
|
delay = mkOption {
|
||||||
type = types.int;
|
type = types.nullOr types.int;
|
||||||
default = 15;
|
default = null;
|
||||||
example = 2;
|
example = 2;
|
||||||
description = "Set the delay between updates, in tenths of seconds.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.delay instead.
|
||||||
|
|
||||||
|
Set the delay between updates, in tenths of seconds.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
meters = mkOption {
|
meters = mkOption {
|
||||||
description = "Meters shown in the header.";
|
description = ''
|
||||||
default = {
|
Deprecated. Please use programs.htop.settings.left_meters,
|
||||||
left = [ "AllCPUs" "Memory" "Swap" ];
|
programs.htop.settings.left_meter_modes,
|
||||||
right = [ "Tasks" "LoadAverage" "Uptime" ];
|
programs.htop.settings.right_meters and
|
||||||
};
|
programs.htop.settings.right_meter_modes instead. Or consider using
|
||||||
|
lib.htop.leftMeters and lib.htop.rightMeters.
|
||||||
|
|
||||||
|
Meters shown in the header.
|
||||||
|
'';
|
||||||
|
default = null;
|
||||||
example = {
|
example = {
|
||||||
left = [
|
left = [
|
||||||
"Memory"
|
"Memory"
|
||||||
|
@ -362,55 +575,93 @@ in {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
type = meterType;
|
type = types.nullOr meterType;
|
||||||
};
|
};
|
||||||
|
|
||||||
vimMode = mkOption {
|
vimMode = mkOption {
|
||||||
type = types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = false;
|
default = null;
|
||||||
description = "Vim key bindings.";
|
description = ''
|
||||||
|
Deprecated. Please use programs.htop.settings.vim_mode instead.
|
||||||
|
|
||||||
|
Vim key bindings.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
lib.htop = {
|
||||||
|
inherit fields modes leftMeters rightMeters bar text graph led blank;
|
||||||
|
};
|
||||||
|
|
||||||
home.packages = [ pkgs.htop ];
|
home.packages = [ pkgs.htop ];
|
||||||
|
|
||||||
xdg.configFile."htop/htoprc".text = let
|
xdg.configFile."htop/htoprc".text = let
|
||||||
leftMeters = map (m: m.kind) cfg.meters.left;
|
|
||||||
leftModes = map (m: m.mode) cfg.meters.left;
|
deprecate = settingsKey: optionKey: optionValue:
|
||||||
rightMeters = map (m: m.kind) cfg.meters.right;
|
let
|
||||||
rightModes = map (m: m.mode) cfg.meters.right;
|
warn' = warn
|
||||||
in ''
|
"htop: programs.htop.${optionKey} is deprecated; please is programs.htop.settings.${settingsKey} instead";
|
||||||
# This file is regenerated by home-manager
|
in if !isNull optionValue then
|
||||||
# when options are changed in the config
|
warn' optionValue
|
||||||
fields=${list (map (n: fields.${n}) cfg.fields)}
|
else if hasAttr settingsKey cfg.settings then
|
||||||
sort_key=${toString (fields.${cfg.sortKey})}
|
cfg.settings.${settingsKey}
|
||||||
sort_direction=${bool cfg.sortDescending}
|
else
|
||||||
hide_threads=${bool cfg.hideThreads}
|
null;
|
||||||
hide_kernel_threads=${bool cfg.hideKernelThreads}
|
|
||||||
hide_userland_threads=${bool cfg.hideUserlandThreads}
|
deprecate' = settingsKey: optionKey:
|
||||||
shadow_other_users=${bool cfg.shadowOtherUsers}
|
deprecate settingsKey optionKey cfg.${optionKey};
|
||||||
show_thread_names=${bool cfg.showThreadNames}
|
|
||||||
show_program_path=${bool cfg.showProgramPath}
|
ifNonNull = x: y: if isNull x then null else y;
|
||||||
highlight_base_name=${bool cfg.highlightBaseName}
|
|
||||||
highlight_megabytes=${bool cfg.highlightMegabytes}
|
leftMeters = deprecate "left_meters" "meters.left"
|
||||||
highlight_threads=${bool cfg.highlightThreads}
|
(ifNonNull cfg.meters (map (m: m.kind) cfg.meters.left));
|
||||||
tree_view=${bool cfg.treeView}
|
leftModes = deprecate "left_meter_modes" "meters.left"
|
||||||
header_margin=${bool cfg.headerMargin}
|
(ifNonNull cfg.meters (map (m: m.mode) cfg.meters.left));
|
||||||
detailed_cpu_time=${bool cfg.detailedCpuTime}
|
rightMeters = deprecate "right_meters" "meters.right"
|
||||||
cpu_count_from_zero=${bool cfg.cpuCountFromZero}
|
(ifNonNull cfg.meters (map (m: m.kind) cfg.meters.right));
|
||||||
show_cpu_usage=${bool cfg.showCpuUsage}
|
rightModes = deprecate "right_meter_modes" "meters.right"
|
||||||
show_cpu_frequency=${bool cfg.showCpuFrequency}
|
(ifNonNull cfg.meters (map (m: m.mode) cfg.meters.right));
|
||||||
update_process_names=${bool cfg.updateProcessNames}
|
|
||||||
account_guest_in_cpu_meter=${bool cfg.accountGuestInCpuMeter}
|
settings' = cfg.settings // (filterAttrs (_: v: !isNull v) {
|
||||||
color_scheme=${toString cfg.colorScheme}
|
fields = deprecate "fields" "fields"
|
||||||
enable_mouse=${bool cfg.enableMouse}
|
(ifNonNull cfg.fields (map (n: fields.${n}) cfg.fields));
|
||||||
delay=${toString cfg.delay}
|
sort_key = deprecate "sort_key" "sortKey"
|
||||||
left_meters=${list leftMeters}
|
(ifNonNull cfg.sortKey fields.${cfg.sortKey});
|
||||||
left_meter_modes=${list leftModes}
|
sort_direction = deprecate' "sort_direction" "sortDescending";
|
||||||
right_meters=${list rightMeters}
|
hide_threads = deprecate' "hide_threads" "hideThreads";
|
||||||
right_meter_modes=${list rightModes}
|
hide_kernel_threads =
|
||||||
vim_mode=${bool cfg.vimMode}
|
deprecate' "hide_kernel_threads" "hideKernelThreads";
|
||||||
'';
|
hide_userland_threads =
|
||||||
|
deprecate' "hide_userland_threads" "hideUserlandThreads";
|
||||||
|
shadow_other_users = deprecate' "shadow_other_users" "shadowOtherUsers";
|
||||||
|
show_thread_names = deprecate' "show_thread_names" "showThreadNames";
|
||||||
|
show_program_path = deprecate' "show_program_path" "showProgramPath";
|
||||||
|
highlight_base_name =
|
||||||
|
deprecate' "highlight_base_name" "highlightBaseName";
|
||||||
|
highlight_megabytes =
|
||||||
|
deprecate' "highlight_megabytes" "highlightMegabytes";
|
||||||
|
highlight_threads = deprecate' "highlight_threads" "highlightThreads";
|
||||||
|
tree_view = deprecate' "tree_view" "treeView";
|
||||||
|
header_margin = deprecate' "header_margin" "headerMargin";
|
||||||
|
detailed_cpu_time = deprecate' "detailed_cpu_time" "detailedCpuTime";
|
||||||
|
cpu_count_from_zero =
|
||||||
|
deprecate' "cpu_count_from_zero" "cpuCountFromZero";
|
||||||
|
show_cpu_usage = deprecate' "show_cpu_usage" "showCpuUsage";
|
||||||
|
show_cpu_frequency = deprecate' "show_cpu_frequency" "showCpuFrequency";
|
||||||
|
update_process_names =
|
||||||
|
deprecate' "update_process_names" "updateProcessNames";
|
||||||
|
account_guest_in_cpu_meter =
|
||||||
|
deprecate' "account_guest_in_cpu_meter" "accountGuestInCpuMeter";
|
||||||
|
color_scheme = deprecate' "color_scheme" "colorScheme";
|
||||||
|
enable_mouse = deprecate' "enable_mouse" "enableMouse";
|
||||||
|
delay = deprecate' "delay" "delay";
|
||||||
|
left_meters = leftMeters;
|
||||||
|
left_meter_modes = leftModes;
|
||||||
|
right_meters = rightMeters;
|
||||||
|
right_meter_modes = rightModes;
|
||||||
|
vim_mode = deprecate' "vim_mode" "vimMode";
|
||||||
|
});
|
||||||
|
in concatStringsSep "\n" (mapAttrsToList formatOption settings');
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
265
third_party/home-manager/modules/programs/i3status-rust.nix
vendored
Normal file
265
third_party/home-manager/modules/programs/i3status-rust.nix
vendored
Normal file
|
@ -0,0 +1,265 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.programs.i3status-rust;
|
||||||
|
|
||||||
|
restartI3 = ''
|
||||||
|
i3Socket=''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*
|
||||||
|
if [ -S $i3Socket ]; then
|
||||||
|
echo "Reloading i3"
|
||||||
|
$DRY_RUN_CMD ${config.xsession.windowManager.i3.package}/bin/i3-msg -s $i3Socket restart 1>/dev/null
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
settingsFormat = pkgs.formats.toml { };
|
||||||
|
|
||||||
|
in {
|
||||||
|
meta.maintainers = [ maintainers.farlion ];
|
||||||
|
|
||||||
|
options.programs.i3status-rust = {
|
||||||
|
enable = mkEnableOption "a replacement for i3-status written in Rust";
|
||||||
|
|
||||||
|
bars = mkOption {
|
||||||
|
type = types.attrsOf (types.submodule {
|
||||||
|
options = {
|
||||||
|
|
||||||
|
blocks = mkOption {
|
||||||
|
type = settingsFormat.type;
|
||||||
|
default = [
|
||||||
|
{
|
||||||
|
block = "disk_space";
|
||||||
|
path = "/";
|
||||||
|
alias = "/";
|
||||||
|
info_type = "available";
|
||||||
|
unit = "GB";
|
||||||
|
interval = 60;
|
||||||
|
warning = 20.0;
|
||||||
|
alert = 10.0;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "memory";
|
||||||
|
display_type = "memory";
|
||||||
|
format_mem = "{mem_used_percents}";
|
||||||
|
format_swap = "{swap_used_percents}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "cpu";
|
||||||
|
interval = 1;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "load";
|
||||||
|
interval = 1;
|
||||||
|
format = "{1m}";
|
||||||
|
}
|
||||||
|
{ block = "sound"; }
|
||||||
|
{
|
||||||
|
block = "time";
|
||||||
|
interval = 60;
|
||||||
|
format = "%a %d/%m %R";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
description = ''
|
||||||
|
Configuration blocks to add to i3status-rust
|
||||||
|
<filename>config</filename>. See
|
||||||
|
<link xlink:href="https://github.com/greshake/i3status-rust/blob/master/blocks.md"/>
|
||||||
|
for block options.
|
||||||
|
'';
|
||||||
|
example = literalExample ''
|
||||||
|
[
|
||||||
|
{
|
||||||
|
block = "disk_space";
|
||||||
|
path = "/";
|
||||||
|
alias = "/";
|
||||||
|
info_type = "available";
|
||||||
|
unit = "GB";
|
||||||
|
interval = 60;
|
||||||
|
warning = 20.0;
|
||||||
|
alert = 10.0;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "sound";
|
||||||
|
format = "{output_name} {volume}%";
|
||||||
|
on_click = "pavucontrol --tab=3";
|
||||||
|
mappings = {
|
||||||
|
"alsa_output.pci-0000_00_1f.3.analog-stereo" = "";
|
||||||
|
"bluez_sink.70_26_05_DA_27_A4.a2dp_sink" = "";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = settingsFormat.type;
|
||||||
|
default = { };
|
||||||
|
description = ''
|
||||||
|
Any extra options to add to i3status-rust
|
||||||
|
<filename>config</filename>.
|
||||||
|
'';
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
theme = {
|
||||||
|
name = "solarized-dark";
|
||||||
|
overrides = {
|
||||||
|
idle_bg = "#123456";
|
||||||
|
idle_fg = "#abcdef";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
icons = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "none";
|
||||||
|
description = ''
|
||||||
|
The icons set to use. See
|
||||||
|
<link xlink:href="https://github.com/greshake/i3status-rust/blob/master/themes.md"/>
|
||||||
|
for a list of available icon sets.
|
||||||
|
'';
|
||||||
|
example = "awesome5";
|
||||||
|
};
|
||||||
|
|
||||||
|
theme = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "plain";
|
||||||
|
description = ''
|
||||||
|
The theme to use. See
|
||||||
|
<link xlink:href="https://github.com/greshake/i3status-rust/blob/master/themes.md"/>
|
||||||
|
for a list of available themes.
|
||||||
|
'';
|
||||||
|
example = "gruvbox-dark";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
default = {
|
||||||
|
default = {
|
||||||
|
blocks = [
|
||||||
|
{
|
||||||
|
block = "disk_space";
|
||||||
|
path = "/";
|
||||||
|
alias = "/";
|
||||||
|
info_type = "available";
|
||||||
|
unit = "GB";
|
||||||
|
interval = 60;
|
||||||
|
warning = 20.0;
|
||||||
|
alert = 10.0;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "memory";
|
||||||
|
display_type = "memory";
|
||||||
|
format_mem = "{Mup}%";
|
||||||
|
format_swap = "{SUp}%";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "cpu";
|
||||||
|
interval = 1;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "load";
|
||||||
|
interval = 1;
|
||||||
|
format = "{1m}";
|
||||||
|
}
|
||||||
|
{ block = "sound"; }
|
||||||
|
{
|
||||||
|
block = "time";
|
||||||
|
interval = 60;
|
||||||
|
format = "%a %d/%m %R";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
description = ''
|
||||||
|
Attribute set of i3status-rust bars, each with their own configuration.
|
||||||
|
Each bar <varname>name</varname> generates a config file suffixed with
|
||||||
|
the bar's <varname>name</varname> from the attribute set, like so:
|
||||||
|
<filename>config-<replaceable>name</replaceable>.toml</filename>.
|
||||||
|
</para><para>
|
||||||
|
This way, multiple config files can be generated, such as for having a
|
||||||
|
top and a bottom bar.
|
||||||
|
</para><para>
|
||||||
|
See
|
||||||
|
<citerefentry>
|
||||||
|
<refentrytitle>i3status-rust</refentrytitle>
|
||||||
|
<manvolnum>1</manvolnum>
|
||||||
|
</citerefentry>
|
||||||
|
for options.
|
||||||
|
'';
|
||||||
|
example = literalExample ''
|
||||||
|
bottom = {
|
||||||
|
blocks = [
|
||||||
|
{
|
||||||
|
block = "disk_space";
|
||||||
|
path = "/";
|
||||||
|
alias = "/";
|
||||||
|
info_type = "available";
|
||||||
|
unit = "GB";
|
||||||
|
interval = 60;
|
||||||
|
warning = 20.0;
|
||||||
|
alert = 10.0;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "memory";
|
||||||
|
display_type = "memory";
|
||||||
|
format_mem = "{mem_used_percents}";
|
||||||
|
format_swap = "{swap_used_percents}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "cpu";
|
||||||
|
interval = 1;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "load";
|
||||||
|
interval = 1;
|
||||||
|
format = "{1m}";
|
||||||
|
}
|
||||||
|
{ block = "sound"; }
|
||||||
|
{
|
||||||
|
block = "time";
|
||||||
|
interval = 60;
|
||||||
|
format = "%a %d/%m %R";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
settings = {
|
||||||
|
theme = {
|
||||||
|
name = "solarized-dark";
|
||||||
|
overrides = {
|
||||||
|
idle_bg = "#123456";
|
||||||
|
idle_fg = "#abcdef";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
icons = "awesome5";
|
||||||
|
theme = "gruvbox-dark";
|
||||||
|
};
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.i3status-rust;
|
||||||
|
defaultText = literalExample "pkgs.i3status-rust";
|
||||||
|
description = "Package providing i3status-rust";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
|
xdg.configFile = mapAttrs' (cfgFileSuffix: cfg:
|
||||||
|
nameValuePair ("i3status-rust/config-${cfgFileSuffix}.toml") ({
|
||||||
|
onChange = mkIf config.xsession.windowManager.i3.enable restartI3;
|
||||||
|
|
||||||
|
source = settingsFormat.generate ("config-${cfgFileSuffix}.toml") ({
|
||||||
|
theme = cfg.theme;
|
||||||
|
icons = cfg.icons;
|
||||||
|
block = cfg.blocks;
|
||||||
|
} // cfg.settings);
|
||||||
|
})) cfg.bars;
|
||||||
|
};
|
||||||
|
}
|
|
@ -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 {
|
||||||
|
|
19
third_party/home-manager/modules/programs/jq.nix
vendored
19
third_party/home-manager/modules/programs/jq.nix
vendored
|
@ -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>
|
||||||
|
@ -51,12 +58,12 @@ in {
|
||||||
|
|
||||||
default = {
|
default = {
|
||||||
null = "1;30";
|
null = "1;30";
|
||||||
false = "0;39";
|
false = "0;37";
|
||||||
true = "0;39";
|
true = "0;37";
|
||||||
numbers = "0;39";
|
numbers = "0;37";
|
||||||
strings = "0;32";
|
strings = "0;32";
|
||||||
arrays = "1;39";
|
arrays = "1;37";
|
||||||
objects = "1;39";
|
objects = "1;37";
|
||||||
};
|
};
|
||||||
|
|
||||||
type = colorsType;
|
type = colorsType;
|
||||||
|
@ -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 {
|
||||||
|
|
|
@ -574,7 +574,7 @@ let
|
||||||
hookString = h:
|
hookString = h:
|
||||||
concatStringsSep " " [
|
concatStringsSep " " [
|
||||||
"hook"
|
"hook"
|
||||||
"${optionalString (h.group != null) "-group ${group}"}"
|
"${optionalString (h.group != null) "-group ${h.group}"}"
|
||||||
"${optionalString (h.once) "-once"}"
|
"${optionalString (h.once) "-once"}"
|
||||||
"global"
|
"global"
|
||||||
"${h.name}"
|
"${h.name}"
|
||||||
|
|
|
@ -79,7 +79,11 @@ in {
|
||||||
# Generated by Home Manager.
|
# Generated by Home Manager.
|
||||||
# See https://sw.kovidgoyal.net/kitty/conf.html
|
# See https://sw.kovidgoyal.net/kitty/conf.html
|
||||||
|
|
||||||
${optionalString (cfg.font != null) "font_family ${cfg.font.name}"}
|
${optionalString (cfg.font != null) ''
|
||||||
|
font_family ${cfg.font.name}
|
||||||
|
${optionalString (cfg.font.size != null)
|
||||||
|
"font_size ${toString cfg.font.size}"}
|
||||||
|
''}
|
||||||
|
|
||||||
${toKittyConfig cfg.settings}
|
${toKittyConfig cfg.settings}
|
||||||
|
|
||||||
|
|
56
third_party/home-manager/modules/programs/lazygit.nix
vendored
Normal file
56
third_party/home-manager/modules/programs/lazygit.nix
vendored
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.programs.lazygit;
|
||||||
|
|
||||||
|
yamlFormat = pkgs.formats.yaml { };
|
||||||
|
|
||||||
|
inherit (pkgs.stdenv.hostPlatform) isDarwin;
|
||||||
|
|
||||||
|
in {
|
||||||
|
meta.maintainers = [ maintainers.kalhauge ];
|
||||||
|
|
||||||
|
options.programs.lazygit = {
|
||||||
|
enable = mkEnableOption "lazygit, a simple terminal UI for git commands";
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = yamlFormat.type;
|
||||||
|
default = { };
|
||||||
|
defaultText = literalExample "{ }";
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
gui.theme = {
|
||||||
|
lightTheme = true;
|
||||||
|
activeBorderColor = [ "blue" "bold" ];
|
||||||
|
inactiveBorderColor = [ "black" ];
|
||||||
|
selectedLineBgColor = [ "default" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Configuration written to
|
||||||
|
<filename>~/.config/lazygit/config.yml</filename> on Linux
|
||||||
|
or <filename>~/Library/Application Support/lazygit/config.yml</filename> on Darwin. See
|
||||||
|
<link xlink:href="https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md"/>
|
||||||
|
for supported values.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [ pkgs.lazygit ];
|
||||||
|
|
||||||
|
home.file."Library/Application Support/lazygit/config.yml" =
|
||||||
|
mkIf (cfg.settings != { } && isDarwin) {
|
||||||
|
source = yamlFormat.generate "lazygit-config" cfg.settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile."lazygit/config.yml" =
|
||||||
|
mkIf (cfg.settings != { } && !isDarwin) {
|
||||||
|
source = yamlFormat.generate "lazygit-config" cfg.settings;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -6,12 +6,14 @@ let
|
||||||
|
|
||||||
cfg = config.programs.lsd;
|
cfg = config.programs.lsd;
|
||||||
|
|
||||||
|
yamlFormat = pkgs.formats.yaml { };
|
||||||
|
|
||||||
aliases = {
|
aliases = {
|
||||||
ls = "${pkgs.lsd}/bin/lsd";
|
ls = "${pkgs.lsd}/bin/lsd";
|
||||||
ll = "ls -l";
|
ll = "${pkgs.lsd}/bin/lsd -l";
|
||||||
la = "ls -a";
|
la = "${pkgs.lsd}/bin/lsd -a";
|
||||||
lt = "ls --tree";
|
lt = "${pkgs.lsd}/bin/lsd --tree";
|
||||||
lla = "ls -la";
|
lla = "${pkgs.lsd}/bin/lsd -la";
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
@ -27,6 +29,21 @@ in {
|
||||||
Whether to enable recommended lsd aliases.
|
Whether to enable recommended lsd aliases.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = yamlFormat.type;
|
||||||
|
default = { };
|
||||||
|
example = {
|
||||||
|
date = "relative";
|
||||||
|
ignore-globs = [ ".git" ".hg" ];
|
||||||
|
};
|
||||||
|
description = ''
|
||||||
|
Configuration written to
|
||||||
|
<filename>~/.config/lsd/config.yaml</filename>. See
|
||||||
|
<link xlink:href="https://github.com/Peltoche/lsd#config-file-content"/>
|
||||||
|
for supported values.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -37,5 +54,9 @@ in {
|
||||||
programs.zsh.shellAliases = mkIf cfg.enableAliases aliases;
|
programs.zsh.shellAliases = mkIf cfg.enableAliases aliases;
|
||||||
|
|
||||||
programs.fish.shellAliases = mkIf cfg.enableAliases aliases;
|
programs.fish.shellAliases = mkIf cfg.enableAliases aliases;
|
||||||
|
|
||||||
|
xdg.configFile."lsd/config.yaml" = mkIf (cfg.settings != { }) {
|
||||||
|
source = yamlFormat.generate "lsd-config" cfg.settings;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
105
third_party/home-manager/modules/programs/mangohud.nix
vendored
Normal file
105
third_party/home-manager/modules/programs/mangohud.nix
vendored
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
{ 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 (mkMerge [
|
||||||
|
{
|
||||||
|
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; };
|
||||||
|
}
|
||||||
|
{
|
||||||
|
xdg.configFile = mapAttrs'
|
||||||
|
(n: v: nameValuePair "MangoHud/${n}.conf" { text = renderSettings v; })
|
||||||
|
cfg.settingsPerApplication;
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
meta.maintainers = with maintainers; [ zeratax ];
|
||||||
|
}
|
|
@ -23,7 +23,7 @@ in {
|
||||||
|
|
||||||
config = mkOption {
|
config = mkOption {
|
||||||
default = { };
|
default = { };
|
||||||
type = types.attrs;
|
type = types.attrsOf types.anything;
|
||||||
description = ''
|
description = ''
|
||||||
Add terms to the <filename>matplotlibrc</filename> file to
|
Add terms to the <filename>matplotlibrc</filename> file to
|
||||||
control the default matplotlib behavior.
|
control the default matplotlib behavior.
|
||||||
|
|
|
@ -50,13 +50,13 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
masterPattern = mkOption {
|
farPattern = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "";
|
default = "";
|
||||||
example = "[Gmail]/Sent Mail";
|
example = "[Gmail]/Sent Mail";
|
||||||
description = ''
|
description = ''
|
||||||
IMAP4 patterns for which mailboxes on the remote mail server to sync.
|
IMAP4 patterns for which mailboxes on the remote mail server to sync.
|
||||||
If <literal>Patterns</literal> are specified, <literal>masterPattern</literal>
|
If <literal>Patterns</literal> are specified, <literal>farPattern</literal>
|
||||||
is interpreted as a prefix which is not matched against the patterns,
|
is interpreted as a prefix which is not matched against the patterns,
|
||||||
and is not affected by mailbox list overrides.
|
and is not affected by mailbox list overrides.
|
||||||
</para><para>
|
</para><para>
|
||||||
|
@ -65,14 +65,14 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
slavePattern = mkOption {
|
nearPattern = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "";
|
default = "";
|
||||||
example = "Sent";
|
example = "Sent";
|
||||||
description = ''
|
description = ''
|
||||||
Name for where mail coming from the master mail server will end up
|
Name for where mail coming from the remote (far) mail server will end up
|
||||||
locally. The mailbox specified by the master's pattern will be placed
|
locally. The mailbox specified by the far pattern will be placed in
|
||||||
in this directory.
|
this directory.
|
||||||
</para><para>
|
</para><para>
|
||||||
If this is left as the default, then mbsync will default to the pattern
|
If this is left as the default, then mbsync will default to the pattern
|
||||||
<literal>INBOX</literal>.
|
<literal>INBOX</literal>.
|
||||||
|
@ -85,7 +85,7 @@ let
|
||||||
example = [ "INBOX" ];
|
example = [ "INBOX" ];
|
||||||
description = ''
|
description = ''
|
||||||
Instead of synchronizing <emphasis>just</emphasis> the mailboxes that
|
Instead of synchronizing <emphasis>just</emphasis> the mailboxes that
|
||||||
match the <literal>masterPattern</literal>, use it as a prefix which is
|
match the <literal>farPattern</literal>, use it as a prefix which is
|
||||||
not matched against the patterns, and is not affected by mailbox list
|
not matched against the patterns, and is not affected by mailbox list
|
||||||
overrides.
|
overrides.
|
||||||
'';
|
'';
|
||||||
|
@ -125,6 +125,16 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
subFolders = mkOption {
|
||||||
|
type = types.enum [ "Verbatim" "Maildir++" "Legacy" ];
|
||||||
|
default = "Verbatim";
|
||||||
|
example = "Maildir++";
|
||||||
|
description = ''
|
||||||
|
The on-disk folder naming style. This option has no
|
||||||
|
effect when <option>flatten</option> is used.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
create = mkOption {
|
create = mkOption {
|
||||||
type = types.enum [ "none" "maildir" "imap" "both" ];
|
type = types.enum [ "none" "maildir" "imap" "both" ];
|
||||||
default = "none";
|
default = "none";
|
||||||
|
|
155
third_party/home-manager/modules/programs/mbsync.nix
vendored
155
third_party/home-manager/modules/programs/mbsync.nix
vendored
|
@ -10,6 +10,24 @@ let
|
||||||
mbsyncAccounts =
|
mbsyncAccounts =
|
||||||
filter (a: a.mbsync.enable) (attrValues config.accounts.email.accounts);
|
filter (a: a.mbsync.enable) (attrValues config.accounts.email.accounts);
|
||||||
|
|
||||||
|
# Given a SINGLE group's channels attribute set, return true if ANY of the channel's
|
||||||
|
# patterns use the invalidOption attribute set value name.
|
||||||
|
channelInvalidOption = channels: invalidOption:
|
||||||
|
any (c: c) (mapAttrsToList (c: hasAttr invalidOption) channels);
|
||||||
|
|
||||||
|
# Given a SINGLE account's groups attribute set, return true if ANY of the account's group's channel's patterns use the invalidOption attribute set value name.
|
||||||
|
groupInvalidOption = groups: invalidOption:
|
||||||
|
any (g: g) (mapAttrsToList (groupName: groupVals:
|
||||||
|
channelInvalidOption groupVals.channels invalidOption) groups);
|
||||||
|
|
||||||
|
# Given all accounts (ensure that accounts passed in here ARE mbsync-using accounts)
|
||||||
|
# return true if ANY of the account's groups' channels' patterns use the
|
||||||
|
# invalidOption attribute set value name.
|
||||||
|
accountInvalidOption = accounts: invalidOption:
|
||||||
|
any (a: a)
|
||||||
|
(map (account: groupInvalidOption account.mbsync.groups invalidOption)
|
||||||
|
mbsyncAccounts);
|
||||||
|
|
||||||
genTlsConfig = tls:
|
genTlsConfig = tls:
|
||||||
{
|
{
|
||||||
SSLType = if !tls.enable then
|
SSLType = if !tls.enable then
|
||||||
|
@ -22,10 +40,18 @@ let
|
||||||
CertificateFile = toString tls.certificatesFile;
|
CertificateFile = toString tls.certificatesFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
masterSlaveMapping = {
|
imports = [
|
||||||
|
(mkRenamedOptionModule [ "programs" "mbsync" "masterSlaveMapping" ] [
|
||||||
|
"programs"
|
||||||
|
"mbsync"
|
||||||
|
"nearFarMapping"
|
||||||
|
])
|
||||||
|
];
|
||||||
|
|
||||||
|
nearFarMapping = {
|
||||||
none = "None";
|
none = "None";
|
||||||
imap = "Master";
|
imap = "Far";
|
||||||
maildir = "Slave";
|
maildir = "Near";
|
||||||
both = "Both";
|
both = "Both";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -65,10 +91,13 @@ let
|
||||||
+ genSection "IMAPStore ${name}-remote"
|
+ genSection "IMAPStore ${name}-remote"
|
||||||
({ Account = name; } // mbsync.extraConfig.remote) + "\n"
|
({ Account = name; } // mbsync.extraConfig.remote) + "\n"
|
||||||
+ genSection "MaildirStore ${name}-local" ({
|
+ genSection "MaildirStore ${name}-local" ({
|
||||||
Path = "${maildir.absPath}/";
|
|
||||||
Inbox = "${maildir.absPath}/${folders.inbox}";
|
Inbox = "${maildir.absPath}/${folders.inbox}";
|
||||||
SubFolders = "Verbatim";
|
} // optionalAttrs
|
||||||
} // optionalAttrs (mbsync.flatten != null) { Flatten = mbsync.flatten; }
|
(mbsync.subFolders != "Maildir++" || mbsync.flatten != null) {
|
||||||
|
Path = "${maildir.absPath}/";
|
||||||
|
} // optionalAttrs (mbsync.flatten == null) {
|
||||||
|
SubFolders = mbsync.subFolders;
|
||||||
|
} // optionalAttrs (mbsync.flatten != null) { Flatten = mbsync.flatten; }
|
||||||
// mbsync.extraConfig.local) + "\n" + genChannels account;
|
// mbsync.extraConfig.local) + "\n" + genChannels account;
|
||||||
|
|
||||||
genChannels = account:
|
genChannels = account:
|
||||||
|
@ -85,18 +114,18 @@ let
|
||||||
genAccountWideChannel = account:
|
genAccountWideChannel = account:
|
||||||
with account;
|
with account;
|
||||||
genSection "Channel ${name}" ({
|
genSection "Channel ${name}" ({
|
||||||
Master = ":${name}-remote:";
|
Far = ":${name}-remote:";
|
||||||
Slave = ":${name}-local:";
|
Near = ":${name}-local:";
|
||||||
Patterns = mbsync.patterns;
|
Patterns = mbsync.patterns;
|
||||||
Create = masterSlaveMapping.${mbsync.create};
|
Create = nearFarMapping.${mbsync.create};
|
||||||
Remove = masterSlaveMapping.${mbsync.remove};
|
Remove = nearFarMapping.${mbsync.remove};
|
||||||
Expunge = masterSlaveMapping.${mbsync.expunge};
|
Expunge = nearFarMapping.${mbsync.expunge};
|
||||||
SyncState = "*";
|
SyncState = "*";
|
||||||
} // mbsync.extraConfig.channel) + "\n";
|
} // mbsync.extraConfig.channel) + "\n";
|
||||||
|
|
||||||
# Given the attr set of groups, return a string of channels that will direct
|
# Given the attr set of groups, return a string of channels that will direct
|
||||||
# mail to the proper directories, according to the pattern used in channel's
|
# mail to the proper directories, according to the pattern used in channel's
|
||||||
# master pattern definition.
|
# "far" pattern definition.
|
||||||
genGroupChannelConfig = storeName: groups:
|
genGroupChannelConfig = storeName: groups:
|
||||||
let
|
let
|
||||||
# Given the name of the group this channel is part of and the channel
|
# Given the name of the group this channel is part of and the channel
|
||||||
|
@ -115,8 +144,8 @@ let
|
||||||
else
|
else
|
||||||
"";
|
"";
|
||||||
in genSection "Channel ${groupName}-${channel.name}" ({
|
in genSection "Channel ${groupName}-${channel.name}" ({
|
||||||
Master = ":${storeName}-remote:${channel.masterPattern}";
|
Far = ":${storeName}-remote:${channel.farPattern}";
|
||||||
Slave = ":${storeName}-local:${channel.slavePattern}";
|
Near = ":${storeName}-local:${channel.nearPattern}";
|
||||||
} // channel.extraConfig) + genChannelPatterns channel.patterns;
|
} // channel.extraConfig) + genChannelPatterns channel.patterns;
|
||||||
# Given the group name, and a attr set of channels within that group,
|
# Given the group name, and a attr set of channels within that group,
|
||||||
# Generate a list of strings for each channels' configuration.
|
# Generate a list of strings for each channels' configuration.
|
||||||
|
@ -203,50 +232,66 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable (mkMerge [
|
||||||
assertions = let
|
{
|
||||||
checkAccounts = pred: msg:
|
assertions = let
|
||||||
let badAccounts = filter pred mbsyncAccounts;
|
checkAccounts = pred: msg:
|
||||||
in {
|
let badAccounts = filter pred mbsyncAccounts;
|
||||||
assertion = badAccounts == [ ];
|
in {
|
||||||
message = "mbsync: ${msg} for accounts: "
|
assertion = badAccounts == [ ];
|
||||||
+ concatMapStringsSep ", " (a: a.name) badAccounts;
|
message = "mbsync: ${msg} for accounts: "
|
||||||
};
|
+ concatMapStringsSep ", " (a: a.name) badAccounts;
|
||||||
in [
|
};
|
||||||
(checkAccounts (a: a.maildir == null) "Missing maildir configuration")
|
in [
|
||||||
(checkAccounts (a: a.imap == null) "Missing IMAP configuration")
|
(checkAccounts (a: a.maildir == null) "Missing maildir configuration")
|
||||||
(checkAccounts (a: a.passwordCommand == null) "Missing passwordCommand")
|
(checkAccounts (a: a.imap == null) "Missing IMAP configuration")
|
||||||
(checkAccounts (a: a.userName == null) "Missing username")
|
(checkAccounts (a: a.passwordCommand == null) "Missing passwordCommand")
|
||||||
];
|
(checkAccounts (a: a.userName == null) "Missing username")
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
home.packages = [ cfg.package ];
|
(mkIf (accountInvalidOption mbsyncAccounts "masterPattern") {
|
||||||
|
warnings = [
|
||||||
|
"mbsync channels no longer use masterPattern. Use farPattern in its place."
|
||||||
|
];
|
||||||
|
})
|
||||||
|
|
||||||
programs.notmuch.new.ignore = [ ".uidvalidity" ".mbsyncstate" ];
|
(mkIf (accountInvalidOption mbsyncAccounts "slavePattern") {
|
||||||
|
warnings = [
|
||||||
|
"mbsync channels no longer use slavePattern. Use nearPattern in its place."
|
||||||
|
];
|
||||||
|
})
|
||||||
|
|
||||||
home.file.".mbsyncrc".text = let
|
{
|
||||||
accountsConfig = map genAccountConfig mbsyncAccounts;
|
home.packages = [ cfg.package ];
|
||||||
# Only generate this kind of Group configuration if there are ANY accounts
|
|
||||||
# that do NOT have a per-account groups/channels option(s) specified.
|
|
||||||
groupsConfig =
|
|
||||||
if any (account: account.mbsync.groups == { }) mbsyncAccounts then
|
|
||||||
mapAttrsToList genGroupConfig cfg.groups
|
|
||||||
else
|
|
||||||
[ ];
|
|
||||||
in ''
|
|
||||||
# Generated by Home Manager.
|
|
||||||
|
|
||||||
''
|
programs.notmuch.new.ignore = [ ".uidvalidity" ".mbsyncstate" ];
|
||||||
+ concatStringsSep "\n" (optional (cfg.extraConfig != "") cfg.extraConfig)
|
|
||||||
+ concatStringsSep "\n\n" accountsConfig
|
|
||||||
+ concatStringsSep "\n" groupsConfig;
|
|
||||||
|
|
||||||
home.activation = mkIf (mbsyncAccounts != [ ]) {
|
home.file.".mbsyncrc".text = let
|
||||||
createMaildir =
|
accountsConfig = map genAccountConfig mbsyncAccounts;
|
||||||
hm.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] ''
|
# Only generate this kind of Group configuration if there are ANY accounts
|
||||||
$DRY_RUN_CMD mkdir -m700 -p $VERBOSE_ARG ${
|
# that do NOT have a per-account groups/channels option(s) specified.
|
||||||
concatMapStringsSep " " (a: a.maildir.absPath) mbsyncAccounts
|
groupsConfig =
|
||||||
}
|
if any (account: account.mbsync.groups == { }) mbsyncAccounts then
|
||||||
'';
|
mapAttrsToList genGroupConfig cfg.groups
|
||||||
};
|
else
|
||||||
};
|
[ ];
|
||||||
|
in ''
|
||||||
|
# Generated by Home Manager.
|
||||||
|
|
||||||
|
''
|
||||||
|
+ concatStringsSep "\n" (optional (cfg.extraConfig != "") cfg.extraConfig)
|
||||||
|
+ concatStringsSep "\n\n" accountsConfig
|
||||||
|
+ concatStringsSep "\n" groupsConfig;
|
||||||
|
|
||||||
|
home.activation = mkIf (mbsyncAccounts != [ ]) {
|
||||||
|
createMaildir =
|
||||||
|
hm.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] ''
|
||||||
|
$DRY_RUN_CMD mkdir -m700 -p $VERBOSE_ARG ${
|
||||||
|
concatMapStringsSep " " (a: a.maildir.absPath) mbsyncAccounts
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,14 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableFuzzySearch = mkOption {
|
||||||
|
default = false;
|
||||||
|
type = types.bool;
|
||||||
|
description = ''
|
||||||
|
Whether to enable fuzzy searching.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
enableBashIntegration = mkOption {
|
enableBashIntegration = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
|
@ -75,5 +83,7 @@ in {
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkIf cfg.enableLightTheme { home.sessionVariables.MCFLY_LIGHT = "TRUE"; })
|
(mkIf cfg.enableLightTheme { home.sessionVariables.MCFLY_LIGHT = "TRUE"; })
|
||||||
|
|
||||||
|
(mkIf cfg.enableFuzzySearch { home.sessionVariables.MCFLY_FUZZY = "TRUE"; })
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ let
|
||||||
|
|
||||||
cfg = config.programs.mercurial;
|
cfg = config.programs.mercurial;
|
||||||
|
|
||||||
|
iniFormat = pkgs.formats.ini { };
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
@ -30,19 +32,19 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
aliases = mkOption {
|
aliases = mkOption {
|
||||||
type = types.attrs;
|
type = types.attrsOf types.anything;
|
||||||
default = { };
|
default = { };
|
||||||
description = "Mercurial aliases to define.";
|
description = "Mercurial aliases to define.";
|
||||||
};
|
};
|
||||||
|
|
||||||
extraConfig = mkOption {
|
extraConfig = mkOption {
|
||||||
type = types.either types.attrs types.lines;
|
type = types.either (types.attrsOf types.anything) types.lines;
|
||||||
default = { };
|
default = { };
|
||||||
description = "Additional configuration to add.";
|
description = "Additional configuration to add.";
|
||||||
};
|
};
|
||||||
|
|
||||||
iniContent = mkOption {
|
iniContent = mkOption {
|
||||||
type = types.attrsOf types.attrs;
|
type = iniFormat.type;
|
||||||
internal = true;
|
internal = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -71,7 +73,8 @@ in {
|
||||||
username = cfg.userName + " <" + cfg.userEmail + ">";
|
username = cfg.userName + " <" + cfg.userEmail + ">";
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile."hg/hgrc".text = generators.toINI { } cfg.iniContent;
|
xdg.configFile."hg/hgrc".source =
|
||||||
|
iniFormat.generate "hgrc" cfg.iniContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkIf (cfg.ignores != [ ] || cfg.ignoresRegexp != [ ]) {
|
(mkIf (cfg.ignores != [ ] || cfg.ignoresRegexp != [ ]) {
|
||||||
|
|
|
@ -8,9 +8,11 @@ let
|
||||||
cfg = config.programs.mpv;
|
cfg = config.programs.mpv;
|
||||||
|
|
||||||
mpvOption = with types; either str (either int (either bool float));
|
mpvOption = with types; either str (either int (either bool float));
|
||||||
mpvOptions = with types; attrsOf mpvOption;
|
mpvOptionDup = with types; either mpvOption (listOf mpvOption);
|
||||||
|
mpvOptions = with types; attrsOf mpvOptionDup;
|
||||||
mpvProfiles = with types; attrsOf mpvOptions;
|
mpvProfiles = with types; attrsOf mpvOptions;
|
||||||
mpvBindings = with types; attrsOf str;
|
mpvBindings = with types; attrsOf str;
|
||||||
|
mpvDefaultProfiles = with types; listOf str;
|
||||||
|
|
||||||
renderOption = option:
|
renderOption = option:
|
||||||
rec {
|
rec {
|
||||||
|
@ -22,25 +24,33 @@ let
|
||||||
string = option;
|
string = option;
|
||||||
}.${typeOf option};
|
}.${typeOf option};
|
||||||
|
|
||||||
renderOptions = options:
|
renderOptionValue = value:
|
||||||
concatStringsSep "\n" (mapAttrsToList (name: value:
|
let
|
||||||
let
|
rendered = renderOption value;
|
||||||
rendered = renderOption value;
|
length = toString (stringLength rendered);
|
||||||
length = toString (stringLength rendered);
|
in "%${length}%${rendered}";
|
||||||
in "${name}=%${length}%${rendered}") options);
|
|
||||||
|
|
||||||
renderProfiles = profiles:
|
renderOptions = generators.toKeyValue {
|
||||||
concatStringsSep "\n" (mapAttrsToList (name: value: ''
|
mkKeyValue =
|
||||||
[${name}]
|
generators.mkKeyValueDefault { mkValueString = renderOptionValue; } "=";
|
||||||
${renderOptions value}
|
listsAsDuplicateKeys = true;
|
||||||
'') profiles);
|
};
|
||||||
|
|
||||||
|
renderProfiles = generators.toINI {
|
||||||
|
mkKeyValue =
|
||||||
|
generators.mkKeyValueDefault { mkValueString = renderOptionValue; } "=";
|
||||||
|
listsAsDuplicateKeys = true;
|
||||||
|
};
|
||||||
|
|
||||||
renderBindings = bindings:
|
renderBindings = bindings:
|
||||||
concatStringsSep "\n"
|
concatStringsSep "\n"
|
||||||
(mapAttrsToList (name: value: "${name} ${value}") bindings);
|
(mapAttrsToList (name: value: "${name} ${value}") bindings);
|
||||||
|
|
||||||
|
renderDefaultProfiles = profiles:
|
||||||
|
renderOptions { profile = concatStringsSep "," profiles; };
|
||||||
|
|
||||||
mpvPackage = if cfg.scripts == [ ] then
|
mpvPackage = if cfg.scripts == [ ] then
|
||||||
pkgs.mpv
|
cfg.package
|
||||||
else
|
else
|
||||||
pkgs.wrapMpv pkgs.mpv-unwrapped { scripts = cfg.scripts; };
|
pkgs.wrapMpv pkgs.mpv-unwrapped { scripts = cfg.scripts; };
|
||||||
|
|
||||||
|
@ -50,8 +60,19 @@ in {
|
||||||
enable = mkEnableOption "mpv";
|
enable = mkEnableOption "mpv";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.mpv;
|
||||||
|
example = literalExample
|
||||||
|
"pkgs.wrapMpv (pkgs.mpv-unwrapped.override { vapoursynthSupport = true; }) { youtubeSupport = true; }";
|
||||||
|
description = ''
|
||||||
|
Package providing mpv.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
finalPackage = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
|
visible = false;
|
||||||
description = ''
|
description = ''
|
||||||
Resulting mpv package.
|
Resulting mpv package.
|
||||||
'';
|
'';
|
||||||
|
@ -81,7 +102,7 @@ in {
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
{
|
{
|
||||||
profile = "gpu-hq";
|
profile = "gpu-hq";
|
||||||
force-window = "yes";
|
force-window = true;
|
||||||
ytdl-format = "bestvideo+bestaudio";
|
ytdl-format = "bestvideo+bestaudio";
|
||||||
cache-default = 4000000;
|
cache-default = 4000000;
|
||||||
}
|
}
|
||||||
|
@ -109,6 +130,16 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
defaultProfiles = mkOption {
|
||||||
|
description = ''
|
||||||
|
Profiles to be applied by default. Options set by them are overridden
|
||||||
|
by options set in <xref linkend="opt-programs.mpv.config"/>.
|
||||||
|
'';
|
||||||
|
type = mpvDefaultProfiles;
|
||||||
|
default = [ ];
|
||||||
|
example = [ "gpu-hq" ];
|
||||||
|
};
|
||||||
|
|
||||||
bindings = mkOption {
|
bindings = mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
Input configuration written to
|
Input configuration written to
|
||||||
|
@ -133,12 +164,21 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
{
|
||||||
|
assertions = [{
|
||||||
|
assertion = (cfg.scripts == [ ]) || (cfg.package == pkgs.mpv);
|
||||||
|
message = ''
|
||||||
|
The programs.mpv "package" option is mutually exclusive with "scripts" option.'';
|
||||||
|
}];
|
||||||
|
}
|
||||||
{
|
{
|
||||||
home.packages = [ mpvPackage ];
|
home.packages = [ mpvPackage ];
|
||||||
programs.mpv.package = mpvPackage;
|
programs.mpv.finalPackage = mpvPackage;
|
||||||
}
|
}
|
||||||
(mkIf (cfg.config != { } || cfg.profiles != { }) {
|
(mkIf (cfg.config != { } || cfg.profiles != { }) {
|
||||||
xdg.configFile."mpv/mpv.conf".text = ''
|
xdg.configFile."mpv/mpv.conf".text = ''
|
||||||
|
${optionalString (cfg.defaultProfiles != [ ])
|
||||||
|
(renderDefaultProfiles cfg.defaultProfiles)}
|
||||||
${optionalString (cfg.config != { }) (renderOptions cfg.config)}
|
${optionalString (cfg.config != { }) (renderOptions cfg.config)}
|
||||||
${optionalString (cfg.profiles != { }) (renderProfiles cfg.profiles)}
|
${optionalString (cfg.profiles != { }) (renderProfiles cfg.profiles)}
|
||||||
'';
|
'';
|
||||||
|
@ -148,5 +188,5 @@ in {
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
||||||
meta.maintainers = with maintainers; [ tadeokondrak ];
|
meta.maintainers = with maintainers; [ tadeokondrak thiagokokada ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,7 @@ let
|
||||||
tls_fingerprint = msmtp.tls.fingerprint;
|
tls_fingerprint = msmtp.tls.fingerprint;
|
||||||
} // optionalAttrs (smtp.port != null) { port = toString smtp.port; }
|
} // optionalAttrs (smtp.port != null) { port = toString smtp.port; }
|
||||||
// optionalAttrs (passwordCommand != null) {
|
// optionalAttrs (passwordCommand != null) {
|
||||||
# msmtp requires the password to finish with a newline.
|
passwordeval = toString passwordCommand;
|
||||||
passwordeval =
|
|
||||||
''${pkgs.bash}/bin/bash -c "${toString passwordCommand}; echo"'';
|
|
||||||
} // msmtp.extraConfig) ++ optional primary ''
|
} // msmtp.extraConfig) ++ optional primary ''
|
||||||
|
|
||||||
account default : ${name}'');
|
account default : ${name}'');
|
||||||
|
@ -39,6 +37,8 @@ let
|
||||||
${cfg.extraConfig}
|
${cfg.extraConfig}
|
||||||
|
|
||||||
${concatStringsSep "\n\n" (map accountStr mailAccounts)}
|
${concatStringsSep "\n\n" (map accountStr mailAccounts)}
|
||||||
|
|
||||||
|
${cfg.extraAccounts}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
@ -53,6 +53,20 @@ in {
|
||||||
description = ''
|
description = ''
|
||||||
Extra configuration lines to add to <filename>~/.msmtprc</filename>.
|
Extra configuration lines to add to <filename>~/.msmtprc</filename>.
|
||||||
See <link xlink:href="https://marlam.de/msmtp/msmtprc.txt"/> for examples.
|
See <link xlink:href="https://marlam.de/msmtp/msmtprc.txt"/> for examples.
|
||||||
|
</para><para>
|
||||||
|
Note, if running msmtp fails with the error message "account default
|
||||||
|
was already defined" then you probably have an account command here.
|
||||||
|
Account commands should be placed in
|
||||||
|
<xref linkend="opt-accounts.email.accounts._name_.msmtp.extraConfig"/>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraAccounts = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
Extra configuration lines to add to the end of <filename>~/.msmtprc</filename>.
|
||||||
|
See <link xlink:href="https://marlam.de/msmtp/msmtprc.txt"/> for examples.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -50,7 +50,7 @@ in {
|
||||||
# In theory, mu is the only thing that creates that directory, and it is
|
# In theory, mu is the only thing that creates that directory, and it is
|
||||||
# only created during the initial index.
|
# only created during the initial index.
|
||||||
if [[ ! -d "${dbLocation}" ]]; then
|
if [[ ! -d "${dbLocation}" ]]; then
|
||||||
$DRY_RUN_CMD mu init ${maildirOption} $VERBOSE_ARG;
|
$DRY_RUN_CMD mu init ${maildirOption} ${myAddresses} $VERBOSE_ARG;
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
50
third_party/home-manager/modules/programs/ncspot.nix
vendored
Normal file
50
third_party/home-manager/modules/programs/ncspot.nix
vendored
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.programs.ncspot;
|
||||||
|
|
||||||
|
tomlFormat = pkgs.formats.toml { };
|
||||||
|
|
||||||
|
in {
|
||||||
|
meta.maintainers = [ maintainers.marsam ];
|
||||||
|
|
||||||
|
options.programs.ncspot = {
|
||||||
|
enable = mkEnableOption "ncspot";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.ncspot;
|
||||||
|
defaultText = literalExample "pkgs.ncspot";
|
||||||
|
description = "The package to use for ncspot.";
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = tomlFormat.type;
|
||||||
|
default = { };
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
shuffle = true;
|
||||||
|
gapless = true;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Configuration written to
|
||||||
|
<filename>~/.config/ncspot/config.toml</filename>.
|
||||||
|
</para><para>
|
||||||
|
See <link xlink:href="https://github.com/hrkfdn/ncspot#configuration" />
|
||||||
|
for the full list of options.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
|
xdg.configFile."ncspot/config.toml" = mkIf (cfg.settings != { }) {
|
||||||
|
source = tomlFormat.generate "ncspot-config" cfg.settings;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue