mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
Compare commits
76 Commits
generation
...
emacs-pkgs
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
677f1f05df | ||
|
|
959217e51d | ||
|
|
cb09a968e9 | ||
|
|
b0651cc217 | ||
|
|
eee807560b | ||
|
|
58aa667e28 | ||
|
|
821299e90e | ||
|
|
4320399a3e | ||
|
|
7cb118c9d2 | ||
|
|
371576cdc2 | ||
|
|
562449b503 | ||
|
|
514acaebb9 | ||
|
|
4b964d2f7b | ||
|
|
2cfea84e6f | ||
|
|
5199bc841a | ||
|
|
208e310e94 | ||
|
|
039f786e60 | ||
|
|
275f39611d | ||
|
|
0dab813748 | ||
|
|
5e46262cb1 | ||
|
|
2952168ed5 | ||
|
|
bd747c5a53 | ||
|
|
21a2ff4496 | ||
|
|
61ca2fc1c0 | ||
|
|
33db7cc6a6 | ||
|
|
f637e145d7 | ||
|
|
521a03d8bf | ||
|
|
84d54402a5 | ||
|
|
2cf19d1d98 | ||
|
|
9029fd2b9d | ||
|
|
f6d1cad6ba | ||
|
|
c5b3069145 | ||
|
|
4367119ca3 | ||
|
|
bf6b85136b | ||
|
|
1a6df903e3 | ||
|
|
49a03303e1 | ||
|
|
a5c609b4b1 | ||
|
|
ec260995e2 | ||
|
|
72394f6d6b | ||
|
|
d11afee973 | ||
|
|
5569770d1e | ||
|
|
8d68dbd144 | ||
|
|
7ef3db3730 | ||
|
|
ad0fc085c7 | ||
|
|
763b1a1c55 | ||
|
|
5ed3a41afa | ||
|
|
2c3a968f57 | ||
|
|
e60dca7bb3 | ||
|
|
447f80f676 | ||
|
|
e4553546cc | ||
|
|
7226c2db46 | ||
|
|
6eb88173e9 | ||
|
|
72f3bc6fa4 | ||
|
|
654d82f888 | ||
|
|
a965b097b1 | ||
|
|
a3d691c053 | ||
|
|
d819e0741a | ||
|
|
479e26dc8c | ||
|
|
3d93e1e802 | ||
|
|
604561ba9a | ||
|
|
c049a09d1a | ||
|
|
a4a8307897 | ||
|
|
a57ef9dad1 | ||
|
|
5515ec99cc | ||
|
|
2c4234cb79 | ||
|
|
59be1f4983 | ||
|
|
b0d769691c | ||
|
|
29ea37374d | ||
|
|
d490797179 | ||
|
|
ab6517d34a | ||
|
|
7f976da068 | ||
|
|
7c19bcb822 | ||
|
|
5f6364fc28 | ||
|
|
2272fc312d | ||
|
|
e08c696524 | ||
|
|
ae8cb242f2 |
17
.github/CODEOWNERS
vendored
17
.github/CODEOWNERS
vendored
@@ -58,6 +58,9 @@
|
||||
|
||||
/modules/programs/beets.nix @rycee
|
||||
|
||||
/modules/programs/bottom.nix @polykernel
|
||||
/tests/modules/programs/bottom @polykernel
|
||||
|
||||
/modules/programs/broot.nix @aheaume
|
||||
|
||||
/modules/programs/dircolors.nix @JustinLovinger
|
||||
@@ -90,11 +93,14 @@
|
||||
/modules/programs/home-manager.nix @rycee
|
||||
|
||||
/modules/programs/htop.nix @bjpbakker
|
||||
/tests/modules/htop @bjpbakker
|
||||
|
||||
/modules/programs/i3status.nix @JustinLovinger
|
||||
|
||||
/modules/programs/i3status-rust.nix @workflow
|
||||
|
||||
/modules/programs/java.nix @ShamrockLee
|
||||
|
||||
/modules/programs/keychain.nix @marsam
|
||||
|
||||
/modules/programs/lazygit.nix @kalhauge
|
||||
@@ -211,6 +217,8 @@
|
||||
/modules/services/barrier.nix @Kritnich
|
||||
/tests/modules/services/barrier @Kritnich
|
||||
|
||||
/modules/services/betterlockscreen.nix @SebTM
|
||||
|
||||
/modules/services/caffeine.nix @uvNikita
|
||||
|
||||
/modules/services/cbatticon.nix @pmiddend
|
||||
@@ -225,6 +233,8 @@
|
||||
|
||||
/modules/services/dunst.nix @rycee
|
||||
|
||||
/modules/services/easyeffects.nix @fufexan
|
||||
|
||||
/modules/services/emacs.nix @tadfisher
|
||||
|
||||
/modules/services/etesync-dav.nix @Valodim
|
||||
@@ -233,6 +243,11 @@
|
||||
|
||||
/modules/services/fluidsynth.nix @Valodim
|
||||
|
||||
/modules/services/fnott.nix @polykernel
|
||||
/tests/modules/services/fnott @polykernel
|
||||
|
||||
/modules/services/git-sync.nix @IvanMalison
|
||||
|
||||
/modules/services/gnome-keyring.nix @rycee
|
||||
|
||||
/modules/services/gpg-agent.nix @rycee
|
||||
@@ -266,6 +281,8 @@
|
||||
|
||||
/modules/services/network-manager-applet.nix @rycee
|
||||
|
||||
/modules/services/notify-osd.nix @imalison
|
||||
|
||||
/modules/services/pantalaimon.nix @jojosch
|
||||
/tests/modules/services/pantalaimon @jojosch
|
||||
|
||||
|
||||
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -15,7 +15,7 @@ pull-request.
|
||||
|
||||
Also make sure to read the guidelines found at
|
||||
|
||||
https://github.com/nix-community/home-manager/blob/master/doc/contributing.adoc#sec-guidelines
|
||||
https://github.com/nix-community/home-manager/blob/master/docs/contributing.adoc#sec-guidelines
|
||||
|
||||
-->
|
||||
|
||||
@@ -35,7 +35,7 @@ Also make sure to read the guidelines found at
|
||||
{long description}
|
||||
```
|
||||
|
||||
See [CONTRIBUTING](https://github.com/nix-community/home-manager/blob/master/doc/contributing.adoc#sec-commit-style) for more information and [recent commit messages](https://github.com/nix-community/home-manager/commits/master) for examples.
|
||||
See [CONTRIBUTING](https://github.com/nix-community/home-manager/blob/master/docs/contributing.adoc#sec-commit-style) for more information and [recent commit messages](https://github.com/nix-community/home-manager/commits/master) for examples.
|
||||
|
||||
- If this PR adds a new module
|
||||
|
||||
|
||||
2
.github/workflows/github_pages.yml
vendored
2
.github/workflows/github_pages.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: cachix/install-nix-action@v13
|
||||
- uses: cachix/install-nix-action@v14
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- uses: cachix/cachix-action@v10
|
||||
|
||||
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: cachix/install-nix-action@v13
|
||||
- uses: cachix/install-nix-action@v14
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- uses: cachix/cachix-action@v10
|
||||
@@ -20,4 +20,4 @@ jobs:
|
||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||
- run: ./format -c
|
||||
- run: nix-shell . -A install
|
||||
- run: nix-shell --pure tests -A run.all
|
||||
- run: nix-shell --arg enableBig false --pure tests -A run.all
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
doc/contributing.adoc
|
||||
@@ -107,9 +107,8 @@ Currently the easiest way to install Home Manager is as follows:
|
||||
$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
|
||||
```
|
||||
|
||||
file in your shell configuration. Unfortunately, in this specific
|
||||
case we currently only support POSIX.2-like shells such as
|
||||
[Bash][] or [Z shell][].
|
||||
file in your shell configuration. This file can be sourced
|
||||
directly by POSIX.2-like shells such as [Bash][] or [Z shell][].
|
||||
|
||||
For example, if you use Bash then add
|
||||
|
||||
@@ -124,7 +123,9 @@ Currently the easiest way to install Home Manager is as follows:
|
||||
. "/etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh"
|
||||
```
|
||||
|
||||
to your `~/.profile` file.
|
||||
to your `~/.profile` file. For fish shell, it is possible to use
|
||||
[foreign-env](https://github.com/oh-my-fish/plugin-foreign-env) to
|
||||
source the file.
|
||||
|
||||
If instead of using channels you want to run Home Manager from a Git
|
||||
checkout of the repository then you can use the
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
|
||||
rec {
|
||||
docs = with import ./doc { inherit pkgs; }; {
|
||||
docs = with import ./docs { inherit pkgs; }; {
|
||||
html = manual.html;
|
||||
manPages = manPages;
|
||||
json = options.json;
|
||||
|
||||
@@ -43,15 +43,21 @@ The solution is typically to uninstall the package from the environment using `n
|
||||
You could also opt to unistall _all_ of the packages from your profile with `nix-env --uninstall '*'`.
|
||||
|
||||
=== Why are the session variables not set?
|
||||
:foreign-env: https://github.com/oh-my-fish/plugin-foreign-env
|
||||
|
||||
Home Manager is only able to set session variables automatically if it manages your Bash 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, Z shell, or fish shell configuration. If you don't want to let Home Manager manage your shell then you will have to manually source the `~/.nix-profile/etc/profile.d/hm-session-vars.sh` file in an appropriate way. In Bash and Z shell this can be done by adding
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
----
|
||||
|
||||
to your `.profile` and `.zshrc` files, respectively. The `hm-session-vars.sh` file should work in most Bourne-like shells.
|
||||
to your `.profile` and `.zshrc` files, respectively. The `hm-session-vars.sh` file should work in most Bourne-like shells. For fish shell, it is possible to source it using {foreign-env}[the foreign-env plugin]
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
fenv source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" > /dev/null
|
||||
----
|
||||
|
||||
=== How to set up a configuration for multiple users/machines?
|
||||
:post-your-homenix: https://www.reddit.com/r/NixOS/comments/9bb9h9/post_your_homemanager_homenix_file/
|
||||
@@ -94,7 +100,7 @@ error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.
|
||||
The solution on NixOS is to add
|
||||
|
||||
[source,nix]
|
||||
services.dbus.packages = with pkgs; [ gnome.dconf ];
|
||||
programs.dconf.enable = true;
|
||||
|
||||
to your system configuration.
|
||||
|
||||
@@ -86,7 +86,7 @@ file in your shell configuration. Alternatively source
|
||||
+
|
||||
when managing home configuration together with system configuration.
|
||||
+
|
||||
Unfortunately, we currently only support POSIX.2-like shells such as
|
||||
This file can be sourced directly by POSIX.2-like shells such as
|
||||
https://www.gnu.org/software/bash/[Bash] or
|
||||
http://zsh.sourceforge.net/[Z shell].
|
||||
+
|
||||
@@ -97,7 +97,9 @@ For example, if you use Bash then add
|
||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
----
|
||||
+
|
||||
to your `~/.profile` file.
|
||||
to your `~/.profile` file. For fish shell, it is possible to use
|
||||
https://github.com/oh-my-fish/plugin-foreign-env[foreign-env] to
|
||||
source the file.
|
||||
|
||||
If instead of using channels you want to run Home Manager from a Git
|
||||
checkout of the repository then you can use the
|
||||
@@ -224,6 +226,10 @@ For example, a nix-darwin configuration may include the lines
|
||||
|
||||
[source,nix]
|
||||
----
|
||||
users.users.eve = {
|
||||
name = "eve";
|
||||
home = "/Users/eve";
|
||||
}
|
||||
home-manager.users.eve = { pkgs, ... }: {
|
||||
home.packages = [ pkgs.atool pkgs.httpie ];
|
||||
programs.bash.enable = true;
|
||||
@@ -139,6 +139,10 @@
|
||||
--debug
|
||||
</arg>
|
||||
|
||||
<arg>
|
||||
--impure
|
||||
</arg>
|
||||
|
||||
<arg>
|
||||
--keep-failed
|
||||
</arg>
|
||||
@@ -155,6 +159,10 @@
|
||||
--(no-)substitute
|
||||
</arg>
|
||||
|
||||
<arg>
|
||||
--no-out-link
|
||||
</arg>
|
||||
|
||||
<arg>
|
||||
<group choice="req">
|
||||
<arg choice="plain">
|
||||
@@ -488,6 +496,18 @@
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--impure</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Passed on to <citerefentry>
|
||||
<refentrytitle>nix-build</refentrytitle>
|
||||
<manvolnum>1</manvolnum> </citerefentry>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--keep-failed</option>
|
||||
@@ -536,6 +556,19 @@
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--no-out-link</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Passed on to <citerefentry>
|
||||
<refentrytitle>nix-build</refentrytitle>
|
||||
<manvolnum>1</manvolnum> </citerefentry>
|
||||
when running <command>home-manager build</command>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-v</option>
|
||||
@@ -9,7 +9,7 @@
|
||||
<preface>
|
||||
<title>Preface</title>
|
||||
<para>
|
||||
This manual will eventually describes how to install, use, and extend Home
|
||||
This manual will eventually describe how to install, use, and extend Home
|
||||
Manager.
|
||||
</para>
|
||||
<para>
|
||||
11
flake.nix
11
flake.nix
@@ -18,9 +18,14 @@
|
||||
darwinModules.home-manager = import ./nix-darwin;
|
||||
darwinModule = self.darwinModules.home-manager;
|
||||
|
||||
packages = forAllSystems (system: {
|
||||
home-manager = nixpkgsFor.${system}.callPackage ./home-manager { };
|
||||
});
|
||||
packages = forAllSystems (system:
|
||||
let docs = import ./docs { pkgs = nixpkgsFor.${system}; };
|
||||
in {
|
||||
home-manager = nixpkgsFor.${system}.callPackage ./home-manager { };
|
||||
docs-html = docs.manual.html;
|
||||
docs-manpages = docs.manPages;
|
||||
docs-json = docs.options.json;
|
||||
});
|
||||
|
||||
defaultPackage =
|
||||
forAllSystems (system: self.packages.${system}.home-manager);
|
||||
|
||||
2
format
2
format
@@ -1,5 +1,5 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/05f0934825c2a0750d4888c4735f9420c906b388.tar.gz -i bash -p findutils nixfmt
|
||||
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/5edf5b60c3d8f82b5fc5e73e822b6f7460584945.tar.gz -i bash -p findutils nixfmt
|
||||
|
||||
CHECK_ARG=
|
||||
|
||||
|
||||
@@ -290,8 +290,10 @@ _home-manager_completions ()
|
||||
#--------------------------#
|
||||
|
||||
local Options
|
||||
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")
|
||||
Options=( "-f" "--file" "-b" "-A" "-I" "-h" "--help" "-n" "--dry-run" "-v" \
|
||||
"--verbose" "--cores" "--debug" "--impure" "--keep-failed" \
|
||||
"--keep-going" "-j" "--max-jobs" "--no-substitute" "--no-out-link" \
|
||||
"--show-trace" "--substitute" "--builders")
|
||||
|
||||
# ^ « home-manager »'s options.
|
||||
|
||||
|
||||
@@ -53,10 +53,13 @@ complete -c home-manager -x -l "arg" -d "Override inputs passed to home-manager.
|
||||
complete -c home-manager -x -l "argstr" -d "Like --arg but the value is a string"
|
||||
complete -c home-manager -x -l "cores" -d "Threads per job (e.g. -j argument to make)"
|
||||
complete -c home-manager -x -l "debug"
|
||||
complete -c home-manager -x -l "impure"
|
||||
complete -c home-manager -f -l "keep-failed" -d "Keep temporary directory used by failed builds"
|
||||
complete -c home-manager -f -l "keep-going" -d "Keep going in case of failed builds"
|
||||
complete -c home-manager -x -s j -l "max-jobs" -d "Max number of build jobs in parallel"
|
||||
complete -c home-manager -x -l "option" -d "Set Nix configuration option"
|
||||
complete -c home-manager -x -l "builders" -d "Remote builders"
|
||||
complete -c home-manager -f -l "show-trace" -d "Print stack trace of evaluation errors"
|
||||
complete -c home-manager -f -l "substitute"
|
||||
complete -c home-manager -f -l "no-substitute"
|
||||
complete -c home-manager -f -l "no-out-link"
|
||||
|
||||
@@ -8,6 +8,7 @@ _arguments \
|
||||
'-b[backup files]:EXT:()' \
|
||||
'--cores[cores]:NUM:()' \
|
||||
'--debug[debug]' \
|
||||
'--impure[impure]' \
|
||||
'--keep-failed[keep failed]' \
|
||||
'--keep-going[keep going]' \
|
||||
'(-h --help)'{--help,-h}'[help]' \
|
||||
@@ -16,6 +17,7 @@ _arguments \
|
||||
'(-f --file)'{--file,-f}'[configuration file]:FILE:_files' \
|
||||
'(-j --max-jobs)'{--max-jobs,-j}'[max jobs]:NUM:()' \
|
||||
'--option[option]:NAME VALUE:()' \
|
||||
'--builders[builders]:SPEC:()' \
|
||||
'--show-trace[show trace]' \
|
||||
'1: :->cmds' \
|
||||
'*:: :->args' && ret=0
|
||||
@@ -45,13 +47,16 @@ case "$state" in
|
||||
_arguments \
|
||||
'--cores[cores]:NUM:()' \
|
||||
'--debug[debug]' \
|
||||
'--impure[impure]' \
|
||||
'--keep-failed[keep failed]' \
|
||||
'--keep-going[keep going]' \
|
||||
'--max-jobs[max jobs]:NUM:()' \
|
||||
'--no-out-link[no out link]' \
|
||||
'--no-substitute[no substitute]' \
|
||||
'--option[option]:NAME VALUE:()' \
|
||||
'--show-trace[show trace]' \
|
||||
'--substitute[substitute]'
|
||||
'--substitute[substitute]' \
|
||||
'--builders[builders]:SPEC:()'
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
@@ -252,6 +252,7 @@ function doBuild() {
|
||||
nix build \
|
||||
"${PASSTHROUGH_OPTS[@]}" \
|
||||
${DRY_RUN+--dry-run} \
|
||||
${NO_OUT_LINK+--no-out-link} \
|
||||
"$FLAKE_CONFIG_URI.activationPackage" \
|
||||
|| exitCode=1
|
||||
return $exitCode
|
||||
@@ -263,8 +264,9 @@ function doBuild() {
|
||||
newsInfo=$(buildNews)
|
||||
|
||||
local exitCode
|
||||
|
||||
doBuildAttr --attr activationPackage \
|
||||
doBuildAttr \
|
||||
${NO_OUT_LINK+--no-out-link} \
|
||||
--attr activationPackage \
|
||||
&& exitCode=0 || exitCode=1
|
||||
|
||||
presentNews "$newsInfo"
|
||||
@@ -514,12 +516,15 @@ function doHelp() {
|
||||
echo " --arg(str) NAME VALUE Override inputs passed to home-manager.nix"
|
||||
echo " --cores NUM"
|
||||
echo " --debug"
|
||||
echo " --impure"
|
||||
echo " --keep-failed"
|
||||
echo " --keep-going"
|
||||
echo " -j, --max-jobs NUM"
|
||||
echo " --option NAME VALUE"
|
||||
echo " --show-trace"
|
||||
echo " --(no-)substitute"
|
||||
echo " --no-out-link Do not create a symlink to the output path"
|
||||
echo " --builders VALUE"
|
||||
echo
|
||||
echo "Commands"
|
||||
echo
|
||||
@@ -601,6 +606,9 @@ while [[ $# -gt 0 ]]; do
|
||||
PASSTHROUGH_OPTS+=("$opt" "$1" "$2")
|
||||
shift 2
|
||||
;;
|
||||
--no-out-link)
|
||||
NO_OUT_LINK=1
|
||||
;;
|
||||
-h|--help)
|
||||
doHelp
|
||||
exit 0
|
||||
@@ -612,12 +620,12 @@ while [[ $# -gt 0 ]]; do
|
||||
PASSTHROUGH_OPTS+=("$opt" "$1" "$2")
|
||||
shift 2
|
||||
;;
|
||||
-j|--max-jobs|--cores)
|
||||
-j|--max-jobs|--cores|--builders)
|
||||
PASSTHROUGH_OPTS+=("$opt" "$1")
|
||||
shift
|
||||
;;
|
||||
--debug|--keep-failed|--keep-going|--show-trace\
|
||||
|--substitute|--no-substitute)
|
||||
|--substitute|--no-substitute|--impure)
|
||||
PASSTHROUGH_OPTS+=("$opt")
|
||||
;;
|
||||
-v|--verbose)
|
||||
@@ -695,3 +703,5 @@ case $COMMAND in
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# vim: ft=bash
|
||||
|
||||
@@ -71,7 +71,7 @@ let
|
||||
};
|
||||
|
||||
certificatesFile = mkOption {
|
||||
type = types.path;
|
||||
type = types.nullOr types.path;
|
||||
default = config.accounts.email.certificatesFile;
|
||||
defaultText = "config.accounts.email.certificatesFile";
|
||||
description = ''
|
||||
@@ -354,7 +354,7 @@ let
|
||||
in {
|
||||
options.accounts.email = {
|
||||
certificatesFile = mkOption {
|
||||
type = types.path;
|
||||
type = types.nullOr types.path;
|
||||
default = "/etc/ssl/certs/ca-certificates.crt";
|
||||
description = ''
|
||||
Path to default file containing certificate authorities that
|
||||
|
||||
@@ -106,7 +106,12 @@ in
|
||||
$VERBOSE_ECHO "Skipping collision check for $targetPath"
|
||||
elif [[ -e "$targetPath" \
|
||||
&& ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then
|
||||
if [[ ! -L "$targetPath" && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
|
||||
# The target file already exists and it isn't a symlink owned by Home Manager.
|
||||
if cmp -s $sourcePath $targetPath; then
|
||||
# First compare the files' content. If they're equal, we're fine.
|
||||
warnEcho "Existing file '$targetPath' is in the way of '$sourcePath', will be skipped since they are the same"
|
||||
elif [[ ! -L "$targetPath" && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
|
||||
# Next, try to move the file to a backup location if configured and possible
|
||||
backup="$targetPath.$HOME_MANAGER_BACKUP_EXT"
|
||||
if [[ -e "$backup" ]]; then
|
||||
errorEcho "Existing file '$backup' would be clobbered by backing up '$targetPath'"
|
||||
@@ -115,6 +120,7 @@ in
|
||||
warnEcho "Existing file '$targetPath' is in the way of '$sourcePath', will be moved to '$backup'"
|
||||
fi
|
||||
else
|
||||
# Fail if nothing else works
|
||||
errorEcho "Existing file '$targetPath' is in the way of '$sourcePath'"
|
||||
collision=1
|
||||
fi
|
||||
@@ -122,7 +128,7 @@ in
|
||||
done
|
||||
|
||||
if [[ -v collision ]] ; then
|
||||
errorEcho "Please move the above files and try again or use -b <ext> to move automatically."
|
||||
errorEcho "Please move the above files and try again or use 'home-manager switch -b backup' to back up existing files automatically."
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
@@ -169,11 +175,19 @@ in
|
||||
relativePath="''${sourcePath#$newGenFiles/}"
|
||||
targetPath="$HOME/$relativePath"
|
||||
if [[ -e "$targetPath" && ! -L "$targetPath" && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
|
||||
# The target exists, back it up
|
||||
backup="$targetPath.$HOME_MANAGER_BACKUP_EXT"
|
||||
$DRY_RUN_CMD mv $VERBOSE_ARG "$targetPath" "$backup" || errorEcho "Moving '$targetPath' failed!"
|
||||
fi
|
||||
$DRY_RUN_CMD mkdir -p $VERBOSE_ARG "$(dirname "$targetPath")"
|
||||
$DRY_RUN_CMD ln -nsf $VERBOSE_ARG "$sourcePath" "$targetPath"
|
||||
|
||||
if [[ -e "$targetPath" && ! -L "$targetPath" ]] && cmp -s $sourcePath $targetPath ; then
|
||||
# The target exists but is identical – don't do anything.
|
||||
$VERBOSE_ECHO "Skipping '$targetPath' as it is identical to '$sourcePath'"
|
||||
else
|
||||
# Place that symlink, --force
|
||||
$DRY_RUN_CMD mkdir -p $VERBOSE_ARG "$(dirname "$targetPath")"
|
||||
$DRY_RUN_CMD ln -nsf $VERBOSE_ARG "$sourcePath" "$targetPath"
|
||||
fi
|
||||
done
|
||||
'';
|
||||
|
||||
@@ -284,8 +298,13 @@ in
|
||||
|
||||
home.activation.onFilesChange = hm.dag.entryAfter ["linkGeneration"] (
|
||||
concatMapStrings (v: ''
|
||||
if [[ ''${changedFiles[${escapeShellArg v.target}]} -eq 1 ]]; then
|
||||
${v.onChange}
|
||||
if (( ''${changedFiles[${escapeShellArg v.target}]} == 1 )); then
|
||||
if [[ -v DRY_RUN || -v VERBOSE ]]; then
|
||||
echo "Running onChange hook for" ${escapeShellArg v.target}
|
||||
fi
|
||||
if [[ ! -v DRY_RUN ]]; then
|
||||
${v.onChange}
|
||||
fi
|
||||
fi
|
||||
'') (filter (v: v.onChange != "") (attrValues cfg))
|
||||
);
|
||||
|
||||
@@ -5,9 +5,9 @@ function setupVars() {
|
||||
local profilesPath="$nixStateDir/profiles/per-user/$USER"
|
||||
local gcPath="$nixStateDir/gcroots/per-user/$USER"
|
||||
|
||||
genProfilePath="$profilesPath/home-manager"
|
||||
newGenPath="@GENERATION_DIR@";
|
||||
newGenGcPath="$gcPath/current-home"
|
||||
declare -gr genProfilePath="$profilesPath/home-manager"
|
||||
declare -gr newGenPath="@GENERATION_DIR@";
|
||||
declare -gr newGenGcPath="$gcPath/current-home"
|
||||
|
||||
local greatestGenNum
|
||||
greatestGenNum=$( \
|
||||
@@ -16,14 +16,15 @@ function setupVars() {
|
||||
| sed -E 's/ *([[:digit:]]+) .*/\1/')
|
||||
|
||||
if [[ -n $greatestGenNum ]] ; then
|
||||
oldGenNum=$greatestGenNum
|
||||
newGenNum=$((oldGenNum + 1))
|
||||
declare -gr oldGenNum=$greatestGenNum
|
||||
declare -gr newGenNum=$((oldGenNum + 1))
|
||||
else
|
||||
newGenNum=1
|
||||
declare -gr newGenNum=1
|
||||
fi
|
||||
|
||||
if [[ -e $profilesPath/home-manager ]] ; then
|
||||
oldGenPath="$(readlink -e "$profilesPath/home-manager")"
|
||||
declare -gr oldGenPath
|
||||
fi
|
||||
|
||||
$VERBOSE_ECHO "Sanity checking oldGenNum and oldGenPath"
|
||||
|
||||
@@ -71,6 +71,8 @@ in rec {
|
||||
|
||||
inherit type typeOf;
|
||||
|
||||
isGVariant = v: v._type or "" == "gvariant";
|
||||
|
||||
isArray = hasPrefix "a";
|
||||
isMaybe = hasPrefix "m";
|
||||
isTuple = hasPrefix "(";
|
||||
@@ -122,8 +124,9 @@ in rec {
|
||||
};
|
||||
|
||||
mkString = v:
|
||||
mkPrimitive type.string v // {
|
||||
__toString = self: "'${escape [ "'" "\\" ] self.value}'";
|
||||
let sanitize = s: replaceStrings [ "\n" ] [ "\\n" ] (escape [ "'" "\\" ] s);
|
||||
in mkPrimitive type.string v // {
|
||||
__toString = self: "'${sanitize self.value}'";
|
||||
};
|
||||
|
||||
mkObjectpath = v:
|
||||
|
||||
@@ -121,4 +121,10 @@
|
||||
githubId = 5646732;
|
||||
name = "Andreas Mager";
|
||||
};
|
||||
bjpbakker = {
|
||||
email = "bart@thesoftwarecraft.com";
|
||||
github = "bjpbakker";
|
||||
githubId = 605641;
|
||||
name = "Bart Bakker";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -70,7 +70,11 @@ in rec {
|
||||
check = v: gvar.mkValue v != null;
|
||||
merge = loc: defs:
|
||||
let
|
||||
vdefs = map (d: d // { value = gvar.mkValue d.value; }) defs;
|
||||
vdefs = map (d:
|
||||
d // {
|
||||
value =
|
||||
if gvar.isGVariant d.value then d.value else gvar.mkValue d.value;
|
||||
}) defs;
|
||||
vals = map (d: d.value) vdefs;
|
||||
defTypes = map (x: x.type) vals;
|
||||
sameOrNull = x: y: if x == y then y else null;
|
||||
@@ -82,8 +86,10 @@ in rec {
|
||||
+ " mismatched GVariant types given in"
|
||||
+ " ${showFiles (getFiles defs)}.")
|
||||
else if gvar.isArray sharedDefType && allChecked then
|
||||
(types.listOf gvariant).merge loc
|
||||
(map (d: d // { value = d.value.value; }) vdefs)
|
||||
gvar.mkValue ((types.listOf gvariant).merge loc
|
||||
(map (d: d // { value = d.value.value; }) vdefs)) // {
|
||||
type = sharedDefType;
|
||||
}
|
||||
else if gvar.isTuple sharedDefType && allChecked then
|
||||
mergeOneOption loc defs
|
||||
else if gvar.isMaybe sharedDefType && allChecked then
|
||||
|
||||
@@ -6,7 +6,7 @@ let
|
||||
|
||||
cfg = config.manual;
|
||||
|
||||
docs = import ../doc { inherit lib pkgs; };
|
||||
docs = import ../docs { inherit lib pkgs; };
|
||||
|
||||
in
|
||||
|
||||
|
||||
@@ -2149,6 +2149,60 @@ in
|
||||
A new module is available: 'services.trayer'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-07-19T01:30:46+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.notify-osd'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-08-10T21:28:40+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.java'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-08-11T13:55:51+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.easyeffects'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-08-16T21:59:02+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.git-sync'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-08-26T06:40:59+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.fnott'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-08-31T18:44:26+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.betterlockscreen'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2021-09-14T21:31:03+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.bottom'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ let
|
||||
defaultConfigHome = "${config.home.homeDirectory}/.config";
|
||||
defaultDataHome = "${config.home.homeDirectory}/.local/share";
|
||||
|
||||
getXdgDir = name: fallback:
|
||||
getEnvFallback = name: fallback:
|
||||
let value = builtins.getEnv name;
|
||||
in if value != "" then value else fallback;
|
||||
|
||||
@@ -26,6 +26,7 @@ in {
|
||||
cacheHome = mkOption {
|
||||
type = types.path;
|
||||
defaultText = "~/.cache";
|
||||
apply = toString;
|
||||
description = ''
|
||||
Absolute path to directory holding application caches.
|
||||
'';
|
||||
@@ -43,6 +44,7 @@ in {
|
||||
configHome = mkOption {
|
||||
type = types.path;
|
||||
defaultText = "~/.config";
|
||||
apply = toString;
|
||||
description = ''
|
||||
Absolute path to directory holding application configurations.
|
||||
'';
|
||||
@@ -60,6 +62,7 @@ in {
|
||||
dataHome = mkOption {
|
||||
type = types.path;
|
||||
defaultText = "~/.local/share";
|
||||
apply = toString;
|
||||
description = ''
|
||||
Absolute path to directory holding application data.
|
||||
'';
|
||||
@@ -81,9 +84,11 @@ in {
|
||||
|
||||
# Legacy non-deterministic setup.
|
||||
(mkIf (!cfg.enable && versionOlder config.home.stateVersion "20.09") {
|
||||
xdg.cacheHome = getXdgDir "XDG_CACHE_HOME" defaultCacheHome;
|
||||
xdg.configHome = getXdgDir "XDG_CONFIG_HOME" defaultConfigHome;
|
||||
xdg.dataHome = getXdgDir "XDG_DATA_HOME" defaultDataHome;
|
||||
xdg.cacheHome =
|
||||
mkDefault (getEnvFallback "XDG_CACHE_HOME" defaultCacheHome);
|
||||
xdg.configHome =
|
||||
mkDefault (getEnvFallback "XDG_CONFIG_HOME" defaultConfigHome);
|
||||
xdg.dataHome = mkDefault (getEnvFallback "XDG_DATA_HOME" defaultDataHome);
|
||||
})
|
||||
|
||||
# "Modern" deterministic setup.
|
||||
@@ -95,13 +100,11 @@ in {
|
||||
|
||||
{
|
||||
home.file = mkMerge [
|
||||
(mapAttrs'
|
||||
(name: file: nameValuePair "${config.xdg.configHome}/${name}" file)
|
||||
(mapAttrs' (name: file: nameValuePair "${cfg.configHome}/${name}" file)
|
||||
cfg.configFile)
|
||||
(mapAttrs'
|
||||
(name: file: nameValuePair "${config.xdg.dataHome}/${name}" file)
|
||||
(mapAttrs' (name: file: nameValuePair "${cfg.dataHome}/${name}" file)
|
||||
cfg.dataFile)
|
||||
{ "${config.xdg.cacheHome}/.keep".text = ""; }
|
||||
{ "${cfg.cacheHome}/.keep".text = ""; }
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
@@ -50,6 +50,7 @@ let
|
||||
./programs/bash.nix
|
||||
./programs/bat.nix
|
||||
./programs/beets.nix
|
||||
./programs/bottom.nix
|
||||
./programs/broot.nix
|
||||
./programs/browserpass.nix
|
||||
./programs/chromium.nix
|
||||
@@ -77,6 +78,7 @@ let
|
||||
./programs/i3status.nix
|
||||
./programs/info.nix
|
||||
./programs/irssi.nix
|
||||
./programs/java.nix
|
||||
./programs/jq.nix
|
||||
./programs/kakoune.nix
|
||||
./programs/keychain.nix
|
||||
@@ -147,6 +149,7 @@ let
|
||||
./programs/zsh.nix
|
||||
./programs/zsh/prezto.nix
|
||||
./services/barrier.nix
|
||||
./services/betterlockscreen.nix
|
||||
./services/blueman-applet.nix
|
||||
./services/caffeine.nix
|
||||
./services/cbatticon.nix
|
||||
@@ -156,11 +159,14 @@ let
|
||||
./services/dropbox.nix
|
||||
./services/dunst.nix
|
||||
./services/dwm-status.nix
|
||||
./services/easyeffects.nix
|
||||
./services/emacs.nix
|
||||
./services/etesync-dav.nix
|
||||
./services/flameshot.nix
|
||||
./services/fluidsynth.nix
|
||||
./services/fnott.nix
|
||||
./services/getmail.nix
|
||||
./services/git-sync.nix
|
||||
./services/gnome-keyring.nix
|
||||
./services/gpg-agent.nix
|
||||
./services/grobi.nix
|
||||
@@ -182,6 +188,7 @@ let
|
||||
./services/muchsync.nix
|
||||
./services/network-manager-applet.nix
|
||||
./services/nextcloud-client.nix
|
||||
./services/notify-osd.nix
|
||||
./services/owncloud-client.nix
|
||||
./services/pantalaimon.nix
|
||||
./services/parcellite.nix
|
||||
@@ -206,9 +213,9 @@ let
|
||||
./services/sxhkd.nix
|
||||
./services/syncthing.nix
|
||||
./services/taffybar.nix
|
||||
./services/trayer.nix
|
||||
./services/tahoe-lafs.nix
|
||||
./services/taskwarrior-sync.nix
|
||||
./services/trayer.nix
|
||||
./services/udiskie.nix
|
||||
./services/unclutter.nix
|
||||
./services/unison.nix
|
||||
|
||||
@@ -22,9 +22,9 @@ let
|
||||
sendmail = astroid.sendMailCommand;
|
||||
additional_sent_tags = "";
|
||||
default = boolOpt primary;
|
||||
save_drafts_to = "${maildir.absPath}/${folders.drafts}";
|
||||
save_drafts_to = "${maildir.absPath}/${folders.drafts}/cur/";
|
||||
save_sent = "true";
|
||||
save_sent_to = "${maildir.absPath}/${folders.sent}";
|
||||
save_sent_to = "${maildir.absPath}/${folders.sent}/cur/";
|
||||
select_query = "";
|
||||
} // optionalAttrs (signature.showSignature != "none") {
|
||||
signature_attach = boolOpt (signature.showSignature == "attach");
|
||||
|
||||
@@ -75,7 +75,14 @@ in
|
||||
# Warn if closing shell with running jobs.
|
||||
"checkjobs"
|
||||
];
|
||||
description = "Shell options to set.";
|
||||
example = [
|
||||
"extglob"
|
||||
"-cdspell"
|
||||
];
|
||||
description = ''
|
||||
Shell options to set. Prefix an option with
|
||||
<quote><literal>-</literal></quote> to unset.
|
||||
'';
|
||||
};
|
||||
|
||||
sessionVariables = mkOption {
|
||||
@@ -146,8 +153,10 @@ in
|
||||
mapAttrsToList (k: v: "alias ${k}=${escapeShellArg v}") cfg.shellAliases
|
||||
);
|
||||
|
||||
shoptsStr = concatStringsSep "\n" (
|
||||
map (v: "shopt -s ${v}") cfg.shellOptions
|
||||
shoptsStr = let
|
||||
switch = v: if hasPrefix "-" v then "-u" else "-s";
|
||||
in concatStringsSep "\n" (
|
||||
map (v: "shopt ${switch v} ${removePrefix "-" v}") cfg.shellOptions
|
||||
);
|
||||
|
||||
sessionVarsStr = config.lib.shell.exportAll cfg.sessionVariables;
|
||||
|
||||
@@ -6,6 +6,11 @@ let
|
||||
|
||||
cfg = config.programs.bat;
|
||||
|
||||
toConfigFile = generators.toKeyValue {
|
||||
mkKeyValue = k: v: "--${k}=${lib.escapeShellArg v}";
|
||||
listsAsDuplicateKeys = true;
|
||||
};
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.marsam ];
|
||||
|
||||
@@ -13,11 +18,12 @@ in {
|
||||
enable = mkEnableOption "bat, a cat clone with wings";
|
||||
|
||||
config = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
type = with types; attrsOf (either str (listOf str));
|
||||
default = { };
|
||||
example = {
|
||||
theme = "TwoDark";
|
||||
pager = "less -FR";
|
||||
map-syntax = [ "*.jenkinsfile:Groovy" "*.props:Java Properties" ];
|
||||
};
|
||||
description = ''
|
||||
Bat configuration.
|
||||
@@ -48,10 +54,8 @@ in {
|
||||
home.packages = [ pkgs.bat ];
|
||||
|
||||
xdg.configFile = mkMerge ([{
|
||||
"bat/config" = mkIf (cfg.config != { }) {
|
||||
text = concatStringsSep "\n"
|
||||
(mapAttrsToList (n: v: ''--${n}="${v}"'') cfg.config);
|
||||
};
|
||||
"bat/config" =
|
||||
mkIf (cfg.config != { }) { text = toConfigFile cfg.config; };
|
||||
}] ++ flip mapAttrsToList cfg.themes
|
||||
(name: body: { "bat/themes/${name}.tmTheme" = { text = body; }; }));
|
||||
};
|
||||
|
||||
66
modules/programs/bottom.nix
Normal file
66
modules/programs/bottom.nix
Normal file
@@ -0,0 +1,66 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.bottom;
|
||||
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
|
||||
configDir = if pkgs.stdenv.isDarwin then
|
||||
"Library/Application Support"
|
||||
else
|
||||
config.xdg.configHome;
|
||||
|
||||
in {
|
||||
options = {
|
||||
programs.bottom = {
|
||||
enable = mkEnableOption ''
|
||||
bottom, a cross-platform graphical process/system monitor with a
|
||||
customizable interface'';
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.bottom;
|
||||
defaultText = literalExample "pkgs.bottom";
|
||||
description = "Package providing <command>bottom</command>.";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = tomlFormat.type;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to
|
||||
<filename>$XDG_CONFIG_HOME/bottom/bottom.toml</filename> on Linux or
|
||||
<filename>$HOME/Library/Application Support/bottom/bottom.toml</filename> on Darwin.
|
||||
</para><para>
|
||||
See <link xlink:href="https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml"/>
|
||||
for the default configuration.
|
||||
'';
|
||||
example = literalExample ''
|
||||
{
|
||||
flags = {
|
||||
avg_cpu = true;
|
||||
temperature_type = "c";
|
||||
};
|
||||
|
||||
colors = {
|
||||
low_battery_color = "red";
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
home.file."${configDir}/bottom/bottom.toml" = mkIf (cfg.settings != { }) {
|
||||
source = tomlFormat.generate "bottom.toml" cfg.settings;
|
||||
};
|
||||
};
|
||||
|
||||
meta.maintainers = [ maintainers.polykernel ];
|
||||
}
|
||||
@@ -11,6 +11,7 @@ let
|
||||
brootConf = {
|
||||
verbs = cfg.verbs;
|
||||
skin = cfg.skin;
|
||||
modal = cfg.modal;
|
||||
};
|
||||
|
||||
in {
|
||||
@@ -43,6 +44,8 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
modal = mkEnableOption "modal (vim) mode";
|
||||
|
||||
verbs = mkOption {
|
||||
type = with types; listOf (attrsOf (either bool str));
|
||||
default = [
|
||||
|
||||
@@ -6,13 +6,15 @@ let
|
||||
|
||||
cfg = config.programs.emacs;
|
||||
|
||||
# Copied from all-packages.nix, with modifications to support
|
||||
# overrides.
|
||||
emacsPackages = let epkgs = pkgs.emacsPackagesFor cfg.package;
|
||||
in epkgs.overrideScope' cfg.overrides;
|
||||
|
||||
emacsPackages = cfg.package.pkgs.overrideScope' cfg.overrides;
|
||||
emacsWithPackages = emacsPackages.emacsWithPackages;
|
||||
|
||||
createConfPackage = epkgs:
|
||||
epkgs.trivialBuild {
|
||||
pname = "default";
|
||||
src = pkgs.writeText "default.el" cfg.extraConfig;
|
||||
};
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
|
||||
@@ -28,6 +30,23 @@ in {
|
||||
description = "The Emacs package to use.";
|
||||
};
|
||||
|
||||
# NOTE: The config is placed in default.el instead of ~/.emacs.d so that
|
||||
# it won't conflict with Emacs configuration frameworks. Users of these
|
||||
# frameworks would still benefit from this option as it would easily allow
|
||||
# them to have Nix-computed paths in their configuration.
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
example = ''
|
||||
(setq standard-indent 2)
|
||||
'';
|
||||
description = ''
|
||||
Configuration to include in the Emacs default init file. See
|
||||
<link xlink:href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Init-File.html"/>
|
||||
for more.
|
||||
'';
|
||||
};
|
||||
|
||||
extraPackages = mkOption {
|
||||
default = self: [ ];
|
||||
type = hm.types.selectorFunction;
|
||||
@@ -68,6 +87,10 @@ in {
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.finalPackage ];
|
||||
programs.emacs.finalPackage = emacsWithPackages cfg.extraPackages;
|
||||
programs.emacs = {
|
||||
finalPackage = emacsWithPackages cfg.extraPackages;
|
||||
extraPackages = epkgs:
|
||||
optional (cfg.extraConfig != "") (createConfPackage epkgs);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -164,8 +164,8 @@ in {
|
||||
default = { };
|
||||
example = literalExample ''
|
||||
{
|
||||
ll = "ls -l";
|
||||
".." = "cd ..";
|
||||
g = "git";
|
||||
"..." = "cd ../..";
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
|
||||
@@ -108,8 +108,26 @@ let
|
||||
contents = mkOption {
|
||||
type = types.attrsOf types.anything;
|
||||
default = { };
|
||||
example = literalExample ''
|
||||
{
|
||||
user = {
|
||||
email = "bob@work.example.com";
|
||||
name = "Bob Work";
|
||||
signingKey = "1A2B3C4D5E6F7G8H";
|
||||
};
|
||||
commit = {
|
||||
gpgSign = true;
|
||||
};
|
||||
};
|
||||
'';
|
||||
description = ''
|
||||
Configuration to include. If empty then a path must be given.
|
||||
|
||||
This follows the configuration structure as described in
|
||||
<citerefentry>
|
||||
<refentrytitle>git-config</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
</citerefentry>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
@@ -295,7 +313,8 @@ in {
|
||||
"ssl")
|
||||
else
|
||||
"";
|
||||
smtpSslCertPath = mkIf smtp.tls.enable smtp.tls.certificatesFile;
|
||||
smtpSslCertPath =
|
||||
mkIf smtp.tls.enable (toString smtp.tls.certificatesFile);
|
||||
smtpServer = smtp.host;
|
||||
smtpUser = userName;
|
||||
from = address;
|
||||
|
||||
@@ -10,14 +10,10 @@ let
|
||||
let v' = if isBool v then (if v then "1" else "0") else toString v;
|
||||
in "${n}=${v'}";
|
||||
|
||||
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';
|
||||
};
|
||||
formatMeters = side: meters: {
|
||||
"${side}_meters" = concatMap (mapAttrsToList (x: _: x)) meters;
|
||||
"${side}_meter_modes" = concatMap (mapAttrsToList (_: y: y)) meters;
|
||||
};
|
||||
leftMeters = formatMeters "left";
|
||||
rightMeters = formatMeters "right";
|
||||
|
||||
@@ -92,168 +88,15 @@ let
|
||||
led = meter modes.LED;
|
||||
blank = text "Blank";
|
||||
|
||||
# Mapping from names to defaults
|
||||
meters = {
|
||||
Clock = 2;
|
||||
Date = 2;
|
||||
DateTime = 2;
|
||||
LoadAverage = 2;
|
||||
Load = 2;
|
||||
Memory = 1;
|
||||
Swap = 1;
|
||||
Zram = 2;
|
||||
HugePages = 2;
|
||||
Tasks = 2;
|
||||
Uptime = 2;
|
||||
Battery = 2;
|
||||
Hostname = 2;
|
||||
AllCPUs = 1;
|
||||
AllCPUs2 = 1;
|
||||
AllCPUs4 = 1;
|
||||
AllCPUs8 = 1;
|
||||
LeftCPUs = 1;
|
||||
RightCPUs = 1;
|
||||
Right = 1;
|
||||
CPUs = 1;
|
||||
LeftCPUs2 = 1;
|
||||
RightCPUs2 = 1;
|
||||
LeftCPUs4 = 1;
|
||||
RightCPUs4 = 1;
|
||||
LeftCPUs8 = 1;
|
||||
RightCPUs8 = 1;
|
||||
Blank = 2;
|
||||
PressureStallCPUSome = 2;
|
||||
PressureStallIOSome = 2;
|
||||
PressureStallIOFull = 2;
|
||||
PressureStallMemorySome = 2;
|
||||
PressureStallMemoryFull = 2;
|
||||
ZFSARC = 2;
|
||||
ZFSCARC = 2;
|
||||
CPU = 1;
|
||||
"CPU(1)" = 1;
|
||||
"CPU(2)" = 1;
|
||||
"CPU(3)" = 1;
|
||||
"CPU(4)" = 1;
|
||||
"CPU(5)" = 1;
|
||||
"CPU(6)" = 1;
|
||||
"CPU(7)" = 1;
|
||||
"CPU(8)" = 1;
|
||||
SELinux = 2;
|
||||
Systemd = 2;
|
||||
DiskIO = 2;
|
||||
NetworkIO = 2;
|
||||
};
|
||||
|
||||
singleMeterType = let
|
||||
meterEnum = types.enum (attrNames meters);
|
||||
meterSubmodule = types.submodule {
|
||||
options = {
|
||||
kind = mkOption {
|
||||
type = types.enum (attrNames meters);
|
||||
example = "AllCPUs";
|
||||
description = "What kind of meter.";
|
||||
};
|
||||
|
||||
mode = mkOption {
|
||||
type = types.enum [ 1 2 3 4 ];
|
||||
example = 2;
|
||||
description =
|
||||
"Which mode the meter should use, one of 1(Bar) 2(Text) 3(Graph) 4(LED).";
|
||||
};
|
||||
};
|
||||
};
|
||||
in types.coercedTo meterEnum (m: {
|
||||
kind = m;
|
||||
mode = meters.${m};
|
||||
}) meterSubmodule;
|
||||
|
||||
meterType = types.submodule {
|
||||
options = {
|
||||
left = mkOption {
|
||||
description = "Meters shown in the left header.";
|
||||
default = [ "AllCPUs" "Memory" "Swap" ];
|
||||
example = [
|
||||
"Memory"
|
||||
"LeftCPUs2"
|
||||
"RightCPUs2"
|
||||
{
|
||||
kind = "CPU";
|
||||
mode = 3;
|
||||
}
|
||||
];
|
||||
type = types.listOf singleMeterType;
|
||||
};
|
||||
right = mkOption {
|
||||
description = "Meters shown in the right header.";
|
||||
default = [ "Tasks" "LoadAverage" "Uptime" ];
|
||||
example = [
|
||||
{
|
||||
kind = "Clock";
|
||||
mode = 4;
|
||||
}
|
||||
"Uptime"
|
||||
"Tasks"
|
||||
];
|
||||
type = types.listOf singleMeterType;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.bjpbakker ];
|
||||
|
||||
options.programs.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")
|
||||
]);
|
||||
default = { };
|
||||
example = literalExample ''
|
||||
{
|
||||
color_scheme = 6;
|
||||
@@ -291,300 +134,6 @@ in {
|
||||
description = ''
|
||||
Configuration options to add to
|
||||
<filename>~/.config/htop/htoprc</filename>.
|
||||
|
||||
This superseedes any other (deprecated) settings in this module.
|
||||
'';
|
||||
};
|
||||
|
||||
fields = mkOption {
|
||||
type = types.nullOr (types.listOf (types.enum (attrNames fields)));
|
||||
default = null;
|
||||
example = [
|
||||
"PID"
|
||||
"USER"
|
||||
"PRIORITY"
|
||||
"PERCENT_CPU"
|
||||
"M_RESIDENT"
|
||||
"PERCENT_MEM"
|
||||
"TIME"
|
||||
"COMM"
|
||||
];
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.fields instead.
|
||||
|
||||
Active fields shown in the table.
|
||||
'';
|
||||
};
|
||||
|
||||
sortKey = mkOption {
|
||||
type = types.nullOr (types.enum (attrNames fields));
|
||||
default = null;
|
||||
example = "TIME";
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.sort_key instead.
|
||||
|
||||
Which field to use for sorting.
|
||||
'';
|
||||
};
|
||||
|
||||
sortDescending = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.sort_direction instead.
|
||||
|
||||
Whether to sort descending or not.
|
||||
'';
|
||||
};
|
||||
|
||||
hideThreads = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.hide_threads instead.
|
||||
|
||||
Hide threads.
|
||||
'';
|
||||
};
|
||||
|
||||
hideKernelThreads = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.hide_kernel_threads instead.
|
||||
|
||||
Hide kernel threads.
|
||||
'';
|
||||
};
|
||||
|
||||
hideUserlandThreads = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.hide_userland_threads instead.
|
||||
|
||||
Hide userland process threads.
|
||||
'';
|
||||
};
|
||||
|
||||
shadowOtherUsers = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.shadow_other_users instead.
|
||||
|
||||
Shadow other users' processes.
|
||||
'';
|
||||
};
|
||||
|
||||
showThreadNames = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.show_thread_names instead.
|
||||
|
||||
Show custom thread names.
|
||||
'';
|
||||
};
|
||||
|
||||
showProgramPath = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.show_program_path instead.
|
||||
|
||||
Show program path.
|
||||
'';
|
||||
};
|
||||
|
||||
highlightBaseName = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.highlight_base_name instead.
|
||||
|
||||
Highlight program <quote>basename</quote>.
|
||||
'';
|
||||
};
|
||||
|
||||
highlightMegabytes = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.highlight_megabytes instead.
|
||||
|
||||
Highlight large numbers in memory counters.
|
||||
'';
|
||||
};
|
||||
|
||||
highlightThreads = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.highlight_threads instead.
|
||||
|
||||
Display threads in a different color.
|
||||
'';
|
||||
};
|
||||
|
||||
treeView = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.tree_view instead.
|
||||
|
||||
Tree view.
|
||||
'';
|
||||
};
|
||||
|
||||
headerMargin = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.header_margin instead.
|
||||
|
||||
Leave a margin around header.
|
||||
'';
|
||||
};
|
||||
|
||||
detailedCpuTime = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.detailed_cpu_time instead.
|
||||
|
||||
Detailed CPU time (System/IO-Wait/Hard-IRQ/Soft-IRQ/Steal/Guest).
|
||||
'';
|
||||
};
|
||||
|
||||
cpuCountFromZero = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.cpu_count_from_zero instead.
|
||||
|
||||
Count CPUs from 0 instead of 1.
|
||||
'';
|
||||
};
|
||||
|
||||
showCpuUsage = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.show_cpu_usage instead.
|
||||
|
||||
Show CPU usage frequency.
|
||||
'';
|
||||
};
|
||||
|
||||
showCpuFrequency = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.show_cpu_frequency instead.
|
||||
|
||||
Show CPU frequency.
|
||||
'';
|
||||
};
|
||||
|
||||
updateProcessNames = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.update_process_names instead.
|
||||
|
||||
Update process names on every refresh.
|
||||
'';
|
||||
};
|
||||
|
||||
accountGuestInCpuMeter = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.account_guest_in_cpu_meter instead.
|
||||
|
||||
Add guest time in CPU meter percentage.
|
||||
'';
|
||||
};
|
||||
|
||||
colorScheme = mkOption {
|
||||
type = types.nullOr (types.enum [ 0 1 2 3 4 5 6 ]);
|
||||
default = null;
|
||||
example = 6;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.color_scheme instead.
|
||||
|
||||
Which color scheme to use.
|
||||
'';
|
||||
};
|
||||
|
||||
enableMouse = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.enable_mouse instead.
|
||||
|
||||
Enable mouse support.
|
||||
'';
|
||||
};
|
||||
|
||||
delay = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
default = null;
|
||||
example = 2;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.delay instead.
|
||||
|
||||
Set the delay between updates, in tenths of seconds.
|
||||
'';
|
||||
};
|
||||
|
||||
meters = mkOption {
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.left_meters,
|
||||
programs.htop.settings.left_meter_modes,
|
||||
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 = {
|
||||
left = [
|
||||
"Memory"
|
||||
"CPU"
|
||||
"LeftCPUs2"
|
||||
"RightCPUs2"
|
||||
{
|
||||
kind = "CPU";
|
||||
mode = 3;
|
||||
}
|
||||
];
|
||||
right = [
|
||||
{
|
||||
kind = "Clock";
|
||||
mode = 4;
|
||||
}
|
||||
"Uptime"
|
||||
"Tasks"
|
||||
"LoadAverage"
|
||||
{
|
||||
kind = "Battery";
|
||||
mode = 1;
|
||||
}
|
||||
];
|
||||
};
|
||||
type = types.nullOr meterType;
|
||||
};
|
||||
|
||||
vimMode = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Deprecated. Please use programs.htop.settings.vim_mode instead.
|
||||
|
||||
Vim key bindings.
|
||||
'';
|
||||
};
|
||||
};
|
||||
@@ -596,72 +145,27 @@ in {
|
||||
|
||||
home.packages = [ pkgs.htop ];
|
||||
|
||||
xdg.configFile."htop/htoprc".text = let
|
||||
xdg.configFile."htop/htoprc" = let
|
||||
defaults = {
|
||||
fields = with fields; [
|
||||
PID
|
||||
USER
|
||||
PRIORITY
|
||||
NICE
|
||||
M_SIZE
|
||||
M_RESIDENT
|
||||
M_SHARE
|
||||
STATE
|
||||
PERCENT_CPU
|
||||
PERCENT_MEM
|
||||
TIME
|
||||
COMM
|
||||
];
|
||||
};
|
||||
|
||||
deprecate = settingsKey: optionKey: optionValue:
|
||||
let
|
||||
warn' = warn
|
||||
"htop: programs.htop.${optionKey} is deprecated; please is programs.htop.settings.${settingsKey} instead";
|
||||
in if !isNull optionValue then
|
||||
warn' optionValue
|
||||
else if hasAttr settingsKey cfg.settings then
|
||||
cfg.settings.${settingsKey}
|
||||
else
|
||||
null;
|
||||
|
||||
deprecate' = settingsKey: optionKey:
|
||||
deprecate settingsKey optionKey cfg.${optionKey};
|
||||
|
||||
ifNonNull = x: y: if isNull x then null else y;
|
||||
|
||||
leftMeters = deprecate "left_meters" "meters.left"
|
||||
(ifNonNull cfg.meters (map (m: m.kind) cfg.meters.left));
|
||||
leftModes = deprecate "left_meter_modes" "meters.left"
|
||||
(ifNonNull cfg.meters (map (m: m.mode) cfg.meters.left));
|
||||
rightMeters = deprecate "right_meters" "meters.right"
|
||||
(ifNonNull cfg.meters (map (m: m.kind) cfg.meters.right));
|
||||
rightModes = deprecate "right_meter_modes" "meters.right"
|
||||
(ifNonNull cfg.meters (map (m: m.mode) cfg.meters.right));
|
||||
|
||||
settings' = cfg.settings // (filterAttrs (_: v: !isNull v) {
|
||||
fields = deprecate "fields" "fields"
|
||||
(ifNonNull cfg.fields (map (n: fields.${n}) cfg.fields));
|
||||
sort_key = deprecate "sort_key" "sortKey"
|
||||
(ifNonNull cfg.sortKey fields.${cfg.sortKey});
|
||||
sort_direction = deprecate' "sort_direction" "sortDescending";
|
||||
hide_threads = deprecate' "hide_threads" "hideThreads";
|
||||
hide_kernel_threads =
|
||||
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');
|
||||
in mkIf (cfg.settings != { }) {
|
||||
text = concatStringsSep "\n"
|
||||
(mapAttrsToList formatOption (defaults // cfg.settings)) + "\n";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,14 +6,6 @@ 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 {
|
||||
@@ -258,7 +250,12 @@ in {
|
||||
|
||||
xdg.configFile = mapAttrs' (cfgFileSuffix: cfg:
|
||||
nameValuePair ("i3status-rust/config-${cfgFileSuffix}.toml") ({
|
||||
onChange = mkIf config.xsession.windowManager.i3.enable restartI3;
|
||||
onChange = mkIf config.xsession.windowManager.i3.enable ''
|
||||
i3Socket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*"
|
||||
if [[ -S $i3Socket ]]; then
|
||||
${config.xsession.windowManager.i3.package}/bin/i3-msg -s $i3Socket restart >/dev/null
|
||||
fi
|
||||
'';
|
||||
|
||||
source = settingsFormat.generate ("config-${cfgFileSuffix}.toml") ({
|
||||
theme = cfg.theme;
|
||||
|
||||
46
modules/programs/java.nix
Normal file
46
modules/programs/java.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
# This module provides JAVA_HOME, with a different way to install java locally.
|
||||
# This module is modified from the NixOS module `programs.java`
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.java;
|
||||
|
||||
in {
|
||||
meta.maintainers = with maintainers; [ ShamrockLee ];
|
||||
|
||||
options = {
|
||||
programs.java = {
|
||||
enable = mkEnableOption "" // {
|
||||
description = ''
|
||||
Install the Java development kit and set the <envar>JAVA_HOME</envar>
|
||||
variable.
|
||||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.jdk;
|
||||
defaultText = "pkgs.jdk";
|
||||
description = ''
|
||||
Java package to install. Typical values are
|
||||
<literal>pkgs.jdk</literal> or <literal>pkgs.jre</literal>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
home.sessionVariables = {
|
||||
JAVA_HOME = fileContents (pkgs.runCommandLocal "java-home" { } ''
|
||||
source "${cfg.package}/nix-support/setup-hook"
|
||||
echo "$JAVA_HOME" > $out
|
||||
'');
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -25,10 +25,26 @@ let
|
||||
mkKeyValue = key: command: "map ${key} ${command}";
|
||||
};
|
||||
|
||||
toKittyEnv =
|
||||
generators.toKeyValue { mkKeyValue = name: value: "env ${name}=${value}"; };
|
||||
|
||||
in {
|
||||
options.programs.kitty = {
|
||||
enable = mkEnableOption "Kitty terminal emulator";
|
||||
|
||||
darwinLaunchOptions = mkOption {
|
||||
type = types.nullOr (types.listOf types.str);
|
||||
default = null;
|
||||
description = "Command-line options to use when launched by Mac OS GUI";
|
||||
example = literalExample ''
|
||||
[
|
||||
"--single-instance"
|
||||
"--directory=/tmp/my-dir"
|
||||
"--listen-on=unix:/tmp/my-socket"
|
||||
]
|
||||
'';
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = types.attrsOf eitherStrBoolInt;
|
||||
default = { };
|
||||
@@ -65,6 +81,17 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
environment = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = { };
|
||||
description = "Environment variables to set or override.";
|
||||
example = literalExample ''
|
||||
{
|
||||
"LS_COLORS" = "1";
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
default = "";
|
||||
type = types.lines;
|
||||
@@ -73,6 +100,14 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [{
|
||||
assertion = (cfg.darwinLaunchOptions != null)
|
||||
-> pkgs.stdenv.hostPlatform.isDarwin;
|
||||
message = ''
|
||||
The 'programs.kitty.darwinLaunchOptions' option is only available on darwin.
|
||||
'';
|
||||
}];
|
||||
|
||||
home.packages = [ pkgs.kitty ] ++ optionalPackage cfg.font;
|
||||
|
||||
xdg.configFile."kitty/kitty.conf".text = ''
|
||||
@@ -89,7 +124,14 @@ in {
|
||||
|
||||
${toKittyKeybindings cfg.keybindings}
|
||||
|
||||
${toKittyEnv cfg.environment}
|
||||
|
||||
${cfg.extraConfig}
|
||||
'';
|
||||
|
||||
xdg.configFile."kitty/macos-launch-services-cmdline" =
|
||||
mkIf (cfg.darwinLaunchOptions != null) {
|
||||
text = concatStringsSep " " cfg.darwinLaunchOptions;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
{ lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options.lieer = {
|
||||
enable = mkEnableOption "lieer Gmail synchronization for notmuch";
|
||||
|
||||
timeout = mkOption {
|
||||
type = types.ints.unsigned;
|
||||
default = 0;
|
||||
description = ''
|
||||
HTTP timeout in seconds. 0 means forever or system timeout.
|
||||
'';
|
||||
};
|
||||
|
||||
replaceSlashWithDot = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Replace '/' with '.' in Gmail labels.
|
||||
'';
|
||||
};
|
||||
|
||||
dropNonExistingLabels = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Allow missing labels on the Gmail side to be dropped.
|
||||
'';
|
||||
};
|
||||
|
||||
ignoreTagsLocal = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Set custom tags to ignore when syncing from local to
|
||||
remote (after translations).
|
||||
'';
|
||||
};
|
||||
|
||||
ignoreTagsRemote = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [
|
||||
"CATEGORY_FORUMS"
|
||||
"CATEGORY_PROMOTIONS"
|
||||
"CATEGORY_UPDATES"
|
||||
"CATEGORY_SOCIAL"
|
||||
"CATEGORY_PERSONAL"
|
||||
];
|
||||
description = ''
|
||||
Set custom tags to ignore when syncing from remote to
|
||||
local (before translations).
|
||||
'';
|
||||
};
|
||||
|
||||
notmuchSetupWarning = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Warn if Notmuch is not also enabled for this account.
|
||||
</para><para>
|
||||
This can safely be disabled if <command>notmuch init</command>
|
||||
has been used to configure this account outside of Home
|
||||
Manager.
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -23,30 +23,231 @@ let
|
||||
map (name: "accounts.email.accounts.${name}.notmuch.enable = true;")
|
||||
missingNotmuchAccounts;
|
||||
|
||||
settingsFormat = pkgs.formats.json { };
|
||||
|
||||
configFile = account: {
|
||||
name = "${account.maildir.absPath}/.gmailieer.json";
|
||||
value = {
|
||||
text = builtins.toJSON {
|
||||
inherit (account.lieer) timeout;
|
||||
account = account.address;
|
||||
replace_slash_with_dot = account.lieer.replaceSlashWithDot;
|
||||
drop_non_existing_label = account.lieer.dropNonExistingLabels;
|
||||
ignore_tags = account.lieer.ignoreTagsLocal;
|
||||
ignore_remote_labels = account.lieer.ignoreTagsRemote;
|
||||
} + "\n";
|
||||
value.source = settingsFormat.generate "lieer-${account.address}.json"
|
||||
({ account = account.address; } // account.lieer.settings);
|
||||
};
|
||||
|
||||
settingsOpts = {
|
||||
drop_non_existing_label = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Allow missing labels on the Gmail side to be dropped.
|
||||
'';
|
||||
};
|
||||
|
||||
file_extension = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
example = "mbox";
|
||||
description = ''
|
||||
Extension to include in local file names, which can be useful
|
||||
for indexing with third-party programs.
|
||||
'';
|
||||
};
|
||||
|
||||
ignore_empty_history = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Work around a Gmail API quirk where an empty change history
|
||||
is sometimes returned.
|
||||
</para><para>
|
||||
See this
|
||||
<link xlink:href="https://github.com/gauteh/lieer/issues/120">GitHub issue</link>
|
||||
for more details.
|
||||
'';
|
||||
};
|
||||
|
||||
ignore_remote_labels = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [
|
||||
"CATEGORY_FORUMS"
|
||||
"CATEGORY_PROMOTIONS"
|
||||
"CATEGORY_UPDATES"
|
||||
"CATEGORY_SOCIAL"
|
||||
"CATEGORY_PERSONAL"
|
||||
];
|
||||
description = ''
|
||||
Set Gmail labels to ignore when syncing from remote labels to
|
||||
local tags (before translations).
|
||||
'';
|
||||
};
|
||||
|
||||
ignore_tags = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Set labels to ignore when syncing from local tags to
|
||||
remote labels (after translations).
|
||||
'';
|
||||
};
|
||||
|
||||
local_trash_tag = mkOption {
|
||||
type = types.str;
|
||||
default = "trash";
|
||||
description = ''
|
||||
Local tag to which the remote Gmail 'TRASH' label is translated.
|
||||
'';
|
||||
};
|
||||
|
||||
remove_local_messages = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Remove local messages that have been deleted on the remote.
|
||||
'';
|
||||
};
|
||||
|
||||
replace_slash_with_dot = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Replace '/' with '.' in Gmail labels.
|
||||
'';
|
||||
};
|
||||
|
||||
timeout = mkOption {
|
||||
type = types.ints.unsigned;
|
||||
default = 600;
|
||||
description = ''
|
||||
HTTP timeout in seconds. 0 means forever or system timeout.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
syncOpts = {
|
||||
enable = mkEnableOption "lieer synchronization service";
|
||||
|
||||
frequency = mkOption {
|
||||
type = types.str;
|
||||
default = "*:0/5";
|
||||
description = ''
|
||||
How often to synchronize the account.
|
||||
</para><para>
|
||||
This value is passed to the systemd timer configuration as the
|
||||
onCalendar option. See
|
||||
<citerefentry>
|
||||
<refentrytitle>systemd.time</refentrytitle>
|
||||
<manvolnum>7</manvolnum>
|
||||
</citerefentry>
|
||||
for more information about the format.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
lieerOpts = {
|
||||
enable = mkEnableOption "lieer Gmail synchronization for notmuch";
|
||||
|
||||
notmuchSetupWarning = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Warn if Notmuch is not also enabled for this account.
|
||||
</para><para>
|
||||
This can safely be disabled if <command>notmuch init</command>
|
||||
has been used to configure this account outside of Home
|
||||
Manager.
|
||||
'';
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = types.submodule {
|
||||
freeformType = settingsFormat.type;
|
||||
options = settingsOpts;
|
||||
};
|
||||
default = { };
|
||||
description = ''
|
||||
Settings which are applied to <filename>.gmailieer.json</filename>
|
||||
for the account.
|
||||
</para><para>
|
||||
See the <link xlink:href="https://github.com/gauteh/lieer/">lieer manual</link>
|
||||
for documentation of settings not explicitly covered by this module.
|
||||
'';
|
||||
};
|
||||
|
||||
sync = syncOpts;
|
||||
};
|
||||
|
||||
lieerModule = types.submodule {
|
||||
imports = [
|
||||
(mkRenamedOptionModule [ "lieer" "dropNonExistingLabels" ] [
|
||||
"lieer"
|
||||
"settings"
|
||||
"drop_non_existing_label"
|
||||
])
|
||||
(mkRenamedOptionModule [ "lieer" "ignoreTagsRemote" ] [
|
||||
"lieer"
|
||||
"settings"
|
||||
"ignore_remote_labels"
|
||||
])
|
||||
(mkRenamedOptionModule [ "lieer" "ignoreTagsLocal" ] [
|
||||
"lieer"
|
||||
"settings"
|
||||
"ignore_tags"
|
||||
])
|
||||
(mkRenamedOptionModule [ "lieer" "timeout" ] [
|
||||
"lieer"
|
||||
"settings"
|
||||
"timeout"
|
||||
])
|
||||
(mkRenamedOptionModule [ "lieer" "replaceSlashWithDot" ] [
|
||||
"lieer"
|
||||
"settings"
|
||||
"replace_slash_with_dot"
|
||||
])
|
||||
];
|
||||
|
||||
options = {
|
||||
lieer = lieerOpts;
|
||||
|
||||
warnings = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
internal = true;
|
||||
visible = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
renamedOptions = account:
|
||||
let prefix = [ "accounts" "email" "accounts" account.name "lieer" ];
|
||||
in [
|
||||
(mkRenamedOptionModule (prefix ++ [ "dropNonExistingLabels" ])
|
||||
(prefix ++ [ "settings" "drop_non_existing_label" ]))
|
||||
(mkRenamedOptionModule (prefix ++ [ "ignoreTagsRemote" ])
|
||||
(prefix ++ [ "settings" "ignore_remote_labels" ]))
|
||||
(mkRenamedOptionModule (prefix ++ [ "ignoreTagsLocal" ])
|
||||
(prefix ++ [ "settings" "ignore_tags" ]))
|
||||
(mkRenamedOptionModule (prefix ++ [ "timeout" ])
|
||||
(prefix ++ [ "settings" "timeout" ]))
|
||||
(mkRenamedOptionModule (prefix ++ [ "replaceSlashWithDot" ])
|
||||
(prefix ++ [ "settings" "replace_slash_with_dot" ]))
|
||||
];
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.tadfisher ];
|
||||
|
||||
options = {
|
||||
programs.lieer.enable =
|
||||
mkEnableOption "lieer Gmail synchronization for notmuch";
|
||||
programs.lieer = {
|
||||
enable = mkEnableOption "lieer Gmail synchronization for notmuch";
|
||||
|
||||
accounts.email.accounts = mkOption {
|
||||
type = with types; attrsOf (submodule (import ./lieer-accounts.nix));
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.gmailieer;
|
||||
defaultText = "pkgs.gmailieer";
|
||||
description = ''
|
||||
lieer package to use.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
accounts.email.accounts =
|
||||
mkOption { type = with types; attrsOf lieerModule; };
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
@@ -82,7 +283,9 @@ in {
|
||||
'';
|
||||
}];
|
||||
|
||||
home.packages = [ pkgs.gmailieer ];
|
||||
warnings = flatten (map (account: account.warnings) lieerAccounts);
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
# Notmuch should ignore non-mail files created by lieer.
|
||||
programs.notmuch.new.ignore = [ "/.*[.](json|lock|bak)$/" ];
|
||||
|
||||
@@ -65,18 +65,15 @@ in {
|
||||
home.packages = [ pkgs.mcfly ];
|
||||
|
||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
|
||||
source "${pkgs.mcfly}/share/mcfly/mcfly.bash"
|
||||
eval "$(${pkgs.mcfly}/bin/mcfly init bash)"
|
||||
'';
|
||||
|
||||
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
|
||||
source "${pkgs.mcfly}/share/mcfly/mcfly.zsh"
|
||||
eval "$(${pkgs.mcfly}/bin/mcfly init zsh)"
|
||||
'';
|
||||
|
||||
programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
|
||||
source "${pkgs.mcfly}/share/mcfly/mcfly.fish"
|
||||
if status is-interactive
|
||||
mcfly_key_bindings
|
||||
end
|
||||
${pkgs.mcfly}/bin/mcfly init fish | source
|
||||
'';
|
||||
|
||||
home.sessionVariables.MCFLY_KEY_SCHEME = cfg.keyScheme;
|
||||
|
||||
@@ -21,11 +21,12 @@ let
|
||||
user = userName;
|
||||
tls = onOff smtp.tls.enable;
|
||||
tls_starttls = onOff smtp.tls.useStartTls;
|
||||
tls_trust_file = smtp.tls.certificatesFile;
|
||||
} // optionalAttrs (msmtp.tls.fingerprint != null) {
|
||||
tls_fingerprint = msmtp.tls.fingerprint;
|
||||
} // optionalAttrs (smtp.port != null) { port = toString smtp.port; }
|
||||
// optionalAttrs (passwordCommand != null) {
|
||||
// optionalAttrs (smtp.tls.certificatesFile != null) {
|
||||
tls_trust_file = smtp.tls.certificatesFile;
|
||||
} // optionalAttrs (passwordCommand != null) {
|
||||
passwordeval = toString passwordCommand;
|
||||
} // msmtp.extraConfig) ++ optional primary ''
|
||||
|
||||
|
||||
@@ -2,7 +2,25 @@
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
let
|
||||
extraMailboxOptions = {
|
||||
options = {
|
||||
mailbox = mkOption {
|
||||
type = types.str;
|
||||
example = "Sent";
|
||||
description = "Name of mailbox folder to be included";
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
example = "Junk";
|
||||
default = null;
|
||||
description = "Name to display";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
in {
|
||||
options.neomutt = {
|
||||
enable = mkEnableOption "NeoMutt";
|
||||
|
||||
@@ -32,5 +50,18 @@ with lib;
|
||||
Extra lines to add to the folder hook for this account.
|
||||
'';
|
||||
};
|
||||
|
||||
mailboxName = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
example = "==== <mailbox-name> ===";
|
||||
description = "Use a different name as mailbox name";
|
||||
};
|
||||
|
||||
extraMailboxes = mkOption {
|
||||
type = with types; listOf (either str (submodule extraMailboxOptions));
|
||||
default = [ ];
|
||||
description = "List of extra mailboxes";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ let
|
||||
|
||||
format = mkOption {
|
||||
type = types.str;
|
||||
default = "%B%?F? [%F]?%* %?N?%N/?%S";
|
||||
default = "%D%?F? [%F]?%* %?N?%N/?%S";
|
||||
description = ''
|
||||
Sidebar format. Check neomutt documentation for details.
|
||||
'';
|
||||
@@ -133,10 +133,25 @@ let
|
||||
'';
|
||||
|
||||
registerAccount = account:
|
||||
with account; ''
|
||||
let
|
||||
mailboxes = if account.neomutt.mailboxName == null then
|
||||
"mailboxes"
|
||||
else
|
||||
''named-mailboxes "${account.neomutt.mailboxName}"'';
|
||||
extraMailboxes = concatMapStringsSep "\n" (extra:
|
||||
if isString extra then
|
||||
''mailboxes "${account.maildir.absPath}/${extra}"''
|
||||
else if extra.name == null then
|
||||
''mailboxes "${account.maildir.absPath}/${extra.mailbox}"''
|
||||
else
|
||||
''
|
||||
named-mailboxes "${extra.name}" "${account.maildir.absPath}/${extra.mailbox}"'')
|
||||
account.neomutt.extraMailboxes;
|
||||
in with account; ''
|
||||
# register account ${name}
|
||||
mailboxes "${account.maildir.absPath}/${folders.inbox}"
|
||||
folder-hook ${account.maildir.absPath}/ " \
|
||||
${mailboxes} "${maildir.absPath}/${folders.inbox}"
|
||||
${extraMailboxes}
|
||||
folder-hook ${maildir.absPath}/ " \
|
||||
source ${accountFilename account} "
|
||||
'';
|
||||
|
||||
@@ -185,7 +200,7 @@ let
|
||||
''
|
||||
# Generated by Home Manager.
|
||||
set ssl_force_tls = yes
|
||||
set certificate_file=${config.accounts.email.certificatesFile}
|
||||
set certificate_file=${toString config.accounts.email.certificatesFile}
|
||||
|
||||
# GPG section
|
||||
set crypt_use_gpgme = yes
|
||||
@@ -216,6 +231,13 @@ in {
|
||||
programs.neomutt = {
|
||||
enable = mkEnableOption "the NeoMutt mail client";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.neomutt;
|
||||
defaultText = literalExample "pkgs.neomutt";
|
||||
description = "The neomutt package to use.";
|
||||
};
|
||||
|
||||
sidebar = mkOption {
|
||||
type = sidebarModule;
|
||||
default = { };
|
||||
@@ -285,7 +307,7 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.neomutt ];
|
||||
home.packages = [ cfg.package ];
|
||||
home.file = let
|
||||
rcFile = account: {
|
||||
"${accountFilename account}".text = accountStr account;
|
||||
|
||||
@@ -56,7 +56,7 @@ let
|
||||
|
||||
ssl = if imap.tls.enable then {
|
||||
ssl = true;
|
||||
sslcacertfile = imap.tls.certificatesFile;
|
||||
sslcacertfile = toString imap.tls.certificatesFile;
|
||||
starttls = imap.tls.useStartTls;
|
||||
} else {
|
||||
ssl = false;
|
||||
|
||||
@@ -140,5 +140,14 @@ in {
|
||||
install_powerline_precmd
|
||||
fi
|
||||
'';
|
||||
|
||||
# https://github.com/justjanne/powerline-go#fish
|
||||
programs.fish.promptInit =
|
||||
mkIf (cfg.enable && config.programs.fish.enable) ''
|
||||
function fish_prompt
|
||||
eval ${pkgs.powerline-go}/bin/powerline-go -error $status -jobs (count (jobs -p)) ${commandLineArguments}
|
||||
${cfg.extraUpdatePS1}
|
||||
end
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -309,10 +309,9 @@ in {
|
||||
mkIf pkgs.stdenv.hostPlatform.isLinux {
|
||||
text = qutebrowserConfig;
|
||||
onChange = ''
|
||||
hash="$(echo -n $USER | md5sum | cut -d' ' -f1)"
|
||||
hash="$(echo -n "$USER" | md5sum | cut -d' ' -f1)"
|
||||
socket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/qutebrowser/ipc-$hash"
|
||||
if [ -S $socket ]; then
|
||||
echo "Reloading qutebrowser"
|
||||
if [[ -S $socket ]]; then
|
||||
command=${
|
||||
escapeShellArg (builtins.toJSON {
|
||||
args = [ ":config-source" ];
|
||||
@@ -320,7 +319,7 @@ in {
|
||||
protocol_version = 1;
|
||||
})
|
||||
}
|
||||
$DRY_RUN_CMD echo $command | ${pkgs.socat}/bin/socat -lf /dev/null - UNIX-CONNECT:$socket
|
||||
echo "$command" | ${pkgs.socat}/bin/socat -lf /dev/null - UNIX-CONNECT:"$socket"
|
||||
fi
|
||||
unset hash socket command
|
||||
'';
|
||||
|
||||
@@ -9,7 +9,7 @@ let
|
||||
'';
|
||||
|
||||
renderCredential = cred: ''
|
||||
credentials += Credentials("${cred.realm}", "${cred.host}", "${cred.user}", "${cred.passwordCommand}".!!)
|
||||
credentials += Credentials("${cred.realm}", "${cred.host}", "${cred.user}", "${cred.passwordCommand}".lazyLines.mkString("\n"))
|
||||
'';
|
||||
|
||||
renderCredentials = creds: ''
|
||||
|
||||
@@ -8,6 +8,8 @@ let
|
||||
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
|
||||
starshipCmd = "${config.home.profileDirectory}/bin/starship";
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.marsam ];
|
||||
|
||||
@@ -90,19 +92,19 @@ in {
|
||||
|
||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
|
||||
if [[ $TERM != "dumb" && (-z $INSIDE_EMACS || $INSIDE_EMACS == "vterm") ]]; then
|
||||
eval "$(${cfg.package}/bin/starship init bash)"
|
||||
eval "$(${starshipCmd} init bash)"
|
||||
fi
|
||||
'';
|
||||
|
||||
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
|
||||
if [[ $TERM != "dumb" && (-z $INSIDE_EMACS || $INSIDE_EMACS == "vterm") ]]; then
|
||||
eval "$(${cfg.package}/bin/starship init zsh)"
|
||||
eval "$(${starshipCmd} init zsh)"
|
||||
fi
|
||||
'';
|
||||
|
||||
programs.fish.promptInit = mkIf cfg.enableFishIntegration ''
|
||||
if test "$TERM" != "dumb" -a \( -z "$INSIDE_EMACS" -o "$INSIDE_EMACS" = "vterm" \)
|
||||
eval (${cfg.package}/bin/starship init fish)
|
||||
eval (${starshipCmd} init fish)
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
55
modules/services/betterlockscreen.nix
Normal file
55
modules/services/betterlockscreen.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.services.betterlockscreen;
|
||||
|
||||
in {
|
||||
meta.maintainers = with maintainers; [ sebtm ];
|
||||
|
||||
options = {
|
||||
services.betterlockscreen = {
|
||||
enable = mkEnableOption "betterlockscreen, a screen-locker module";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.betterlockscreen;
|
||||
defaultText = literalExample "pkgs.betterlockscreen";
|
||||
description = "Package providing <command>betterlockscreen</command>.";
|
||||
};
|
||||
|
||||
arguments = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description =
|
||||
"List of arguments appended to <literal>./betterlockscreen --lock [args]</literal>";
|
||||
};
|
||||
|
||||
inactiveInterval = mkOption {
|
||||
type = types.int;
|
||||
default = 10;
|
||||
description = ''
|
||||
Value used for <option>services.screen-locker.inactiveInterval</option>.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.betterlockscreen" pkgs
|
||||
lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
services.screen-locker = {
|
||||
enable = true;
|
||||
inactiveInterval = cfg.inactiveInterval;
|
||||
lockCmd = "${cfg.package}/bin/betterlockscreen --lock ${
|
||||
concatStringsSep " " cfg.arguments
|
||||
}";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -64,6 +64,21 @@ in {
|
||||
description = "Package providing <command>dunst</command>.";
|
||||
};
|
||||
|
||||
configFile = mkOption {
|
||||
type = with types; either str path;
|
||||
default = "${config.xdg.configHome}/dunst/dunstrc";
|
||||
defaultText = "$XDG_CONFIG_HOME/dunst/dunstrc";
|
||||
description = ''
|
||||
Path to the configuration file read by dunst.
|
||||
</para><para>
|
||||
Note that the configuration generated by Home Manager will be
|
||||
written to <filename>$XDG_CONFIG_HOME/dunst/dunstrc</filename>
|
||||
regardless. This allows using a mutable configuration file generated
|
||||
from the immutable one, useful in scenarios where live reloading is
|
||||
desired.
|
||||
'';
|
||||
};
|
||||
|
||||
iconTheme = mkOption {
|
||||
type = themeType;
|
||||
default = hicolorTheme;
|
||||
@@ -88,7 +103,8 @@ in {
|
||||
};
|
||||
};
|
||||
default = { };
|
||||
description = "Configuration written to ~/.config/dunst/dunstrc";
|
||||
description =
|
||||
"Configuration written to <filename>$XDG_CONFIG_HOME/dunst/dunstrc</filename>.";
|
||||
example = literalExample ''
|
||||
{
|
||||
global = {
|
||||
@@ -165,7 +181,7 @@ in {
|
||||
Service = {
|
||||
Type = "dbus";
|
||||
BusName = "org.freedesktop.Notifications";
|
||||
ExecStart = "${cfg.package}/bin/dunst";
|
||||
ExecStart = "${cfg.package}/bin/dunst -config ${cfg.configFile}";
|
||||
Environment = optionalString (cfg.waylandDisplay != "")
|
||||
"WAYLAND_DISPLAY=${cfg.waylandDisplay}";
|
||||
};
|
||||
@@ -176,12 +192,7 @@ in {
|
||||
xdg.configFile."dunst/dunstrc" = {
|
||||
text = toDunstIni cfg.settings;
|
||||
onChange = ''
|
||||
pkillVerbose=""
|
||||
if [[ -v VERBOSE ]]; then
|
||||
pkillVerbose="-e"
|
||||
fi
|
||||
$DRY_RUN_CMD ${pkgs.procps}/bin/pkill -u $USER $pkillVerbose dunst || true
|
||||
unset pkillVerbose
|
||||
${pkgs.procps}/bin/pkill -u "$USER" ''${VERBOSE+-e} dunst || true
|
||||
'';
|
||||
};
|
||||
})
|
||||
|
||||
62
modules/services/easyeffects.nix
Normal file
62
modules/services/easyeffects.nix
Normal file
@@ -0,0 +1,62 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.easyeffects;
|
||||
|
||||
presetOpts = optionalString (cfg.preset != "") "--load-preset ${cfg.preset}";
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.fufexan ];
|
||||
|
||||
options.services.easyeffects = {
|
||||
enable = mkEnableOption ''
|
||||
Easyeffects daemon.
|
||||
Note, it is necessary to add
|
||||
<programlisting language="nix">
|
||||
programs.dconf.enable = true;
|
||||
</programlisting>
|
||||
to your system configuration for the daemon to work correctly'';
|
||||
|
||||
preset = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = ''
|
||||
Which preset to use when starting easyeffects.
|
||||
Will likely need to launch easyeffects to initially create preset.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
(hm.assertions.assertPlatform "services.easyeffects" pkgs platforms.linux)
|
||||
];
|
||||
|
||||
# running easyeffects will just attach itself to gapplication service
|
||||
# at-spi2-core is to minimize journalctl noise of:
|
||||
# "AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files"
|
||||
home.packages = with pkgs; [ easyeffects at-spi2-core ];
|
||||
|
||||
systemd.user.services.easyeffects = {
|
||||
Unit = {
|
||||
Description = "Easyeffects daemon";
|
||||
Requires = [ "dbus.service" ];
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" "pipewire.service" ];
|
||||
};
|
||||
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
|
||||
Service = {
|
||||
ExecStart =
|
||||
"${pkgs.easyeffects}/bin/easyeffects --gapplication-service ${presetOpts}";
|
||||
ExecStop = "${pkgs.easyeffects}/bin/easyeffects --quit";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -34,6 +34,15 @@ in {
|
||||
Environment = "PATH=${config.home.profileDirectory}/bin";
|
||||
ExecStart = "${package}/bin/flameshot";
|
||||
Restart = "on-abort";
|
||||
|
||||
# Sandboxing.
|
||||
LockPersonality = true;
|
||||
MemoryDenyWriteExecute = true;
|
||||
NoNewPrivileges = true;
|
||||
PrivateUsers = true;
|
||||
RestrictNamespaces = true;
|
||||
SystemCallArchitectures = "native";
|
||||
SystemCallFilter = "@system-service";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -21,6 +21,15 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
soundService = mkOption {
|
||||
type = types.enum [ "jack" "pipewire-pulse" "pulseaudio" ];
|
||||
default = "pulseaudio";
|
||||
example = "pipewire-pulse";
|
||||
description = ''
|
||||
The systemd sound service to depend on.
|
||||
'';
|
||||
};
|
||||
|
||||
extraOptions = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
@@ -46,8 +55,8 @@ in {
|
||||
Unit = {
|
||||
Description = "FluidSynth Daemon";
|
||||
Documentation = "man:fluidsynth(1)";
|
||||
BindsTo = [ "pulseaudio.service" ];
|
||||
After = [ "pulseaudio.service" ];
|
||||
BindsTo = [ (cfg.soundService + ".service") ];
|
||||
After = [ (cfg.soundService + ".service") ];
|
||||
};
|
||||
|
||||
Install = { WantedBy = [ "default.target" ]; };
|
||||
|
||||
127
modules/services/fnott.nix
Normal file
127
modules/services/fnott.nix
Normal file
@@ -0,0 +1,127 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.fnott;
|
||||
|
||||
concatStringsSep' = sep: list:
|
||||
concatStringsSep sep (filter (x: x != "") list);
|
||||
|
||||
mkKeyValue = generators.mkKeyValueDefault { } "=";
|
||||
genINI = generators.toINI { };
|
||||
|
||||
iniFormatType = with types;
|
||||
let
|
||||
iniAtom = types.nullOr (types.oneOf [ bool int float str ]) // {
|
||||
description = "INI atom (null, bool, int, float or string)";
|
||||
};
|
||||
in attrsOf (attrsOf iniAtom);
|
||||
in {
|
||||
options = {
|
||||
services.fnott = {
|
||||
enable = mkEnableOption ''
|
||||
fnott, a lightweight Wayland notification daemon for wlroots-based compositors
|
||||
'';
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.fnott;
|
||||
defaultText = literalExample "pkgs.fnott";
|
||||
description = "Package providing <command>fnott</command>.";
|
||||
};
|
||||
|
||||
extraFlags = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = [ "-s" ];
|
||||
description = ''
|
||||
Extra arguments to use for executing fnott.
|
||||
'';
|
||||
};
|
||||
|
||||
configFile = mkOption {
|
||||
type = types.either types.str types.path;
|
||||
default = "${config.xdg.configHome}/fnott/fnott.ini";
|
||||
defaultText = "$XDG_CONFIG_HOME/fnott/fnott.ini";
|
||||
description = ''
|
||||
Path to the configuration file read by fnott.
|
||||
</para><para>
|
||||
Note that environment variables in the path won't be properly expanded.
|
||||
</para><para>
|
||||
The configuration specified under
|
||||
<option>services.fnott.settings</option> will be generated and
|
||||
written to <filename>$XDG_CONFIG_HOME/fnott/fnott.ini</filename>
|
||||
regardless of this option. This allows using a mutable configuration file
|
||||
generated from the immutable one, useful in scenarios where live reloading is desired.
|
||||
'';
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = iniFormatType;
|
||||
default = { };
|
||||
description = ''
|
||||
Configuration written to
|
||||
<filename>$XDG_CONFIG_HOME/fnott/fnott.ini</filename>.
|
||||
</para><para>
|
||||
See
|
||||
<citerefentry>
|
||||
<refentrytitle>fnott.ini</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry> for a list of avaliable options and <link
|
||||
xlink:href="https://codeberg.org/dnkl/fnott/src/branch/master/fnott.ini"/>
|
||||
for an example configuration.
|
||||
'';
|
||||
example = literalExample ''
|
||||
{
|
||||
main = {
|
||||
notification-margin = 5;
|
||||
};
|
||||
|
||||
low = {
|
||||
timeout = 5;
|
||||
title-font = "Dina:weight=bold:slant=italic";
|
||||
title-color = "ffffff";
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions =
|
||||
[ (hm.assertions.assertPlatform "services.fnott" pkgs platforms.linux) ];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
systemd.user.services.fnott = {
|
||||
Unit = {
|
||||
Description = "Fnott notification daemon";
|
||||
Documentation = "man:fnott(1)";
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "dbus";
|
||||
BusName = "org.freedesktop.Notifications";
|
||||
ExecStart = concatStringsSep' " " [
|
||||
"${cfg.package}/bin/fnott"
|
||||
"-c ${escapeShellArg cfg.configFile}"
|
||||
(escapeShellArgs cfg.extraFlags)
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
xdg.configFile."fnott/fnott.ini" = {
|
||||
# FIXME: Remove after next version release (https://codeberg.org/dnkl/fnott/pulls/24).
|
||||
text = concatStringsSep' "\n" [
|
||||
(optionalString (cfg.settings ? main) ''
|
||||
${concatStringsSep "\n" (mapAttrsToList mkKeyValue cfg.settings.main)}
|
||||
'')
|
||||
(genINI (removeAttrs cfg.settings [ "main" ]))
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
100
modules/services/git-sync.nix
Normal file
100
modules/services/git-sync.nix
Normal file
@@ -0,0 +1,100 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.git-sync;
|
||||
|
||||
mkUnit = name: repo: {
|
||||
Unit.Description = "Git Sync ${name}";
|
||||
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
|
||||
Service = {
|
||||
Environment = [
|
||||
"GIT_SYNC_DIRECTORY=${repo.path}"
|
||||
"GIT_SYNC_COMMAND=${cfg.package}/bin/git-sync"
|
||||
"GIT_SYNC_REPOSITORY=${repo.uri}"
|
||||
"GIT_SYNC_INTERVAL=${toString repo.interval}"
|
||||
];
|
||||
ExecStart = "${cfg.package}/bin/git-sync-on-inotify";
|
||||
Restart = "on-abort";
|
||||
};
|
||||
};
|
||||
|
||||
services = mapAttrs' (name: repo: {
|
||||
name = "git-sync-${name}";
|
||||
value = mkUnit name repo;
|
||||
}) cfg.repositories;
|
||||
|
||||
repositoryType = types.submodule ({ name, ... }: {
|
||||
options = {
|
||||
name = mkOption {
|
||||
internal = true;
|
||||
default = name;
|
||||
type = types.str;
|
||||
description = "The name that should be given to this unit.";
|
||||
};
|
||||
|
||||
path = mkOption {
|
||||
type = types.path;
|
||||
description = "The path at which to sync the repository";
|
||||
};
|
||||
|
||||
uri = mkOption {
|
||||
type = types.str;
|
||||
example = "git+ssh://user@example.com:/~[user]/path/to/repo.git";
|
||||
description = ''
|
||||
The URI of the remote to be synchronized. This is only used in the
|
||||
event that the directory does not already exist. See
|
||||
<link xlink:href="https://git-scm.com/docs/git-clone#_git_urls"/>
|
||||
for the supported URIs.
|
||||
'';
|
||||
};
|
||||
|
||||
interval = mkOption {
|
||||
type = types.int;
|
||||
default = 500;
|
||||
description = ''
|
||||
The interval, specified in seconds, at which the synchronization will
|
||||
be triggered even without filesystem changes.
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.imalison ];
|
||||
|
||||
options = {
|
||||
services.git-sync = {
|
||||
enable = mkEnableOption "git-sync services";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.git-sync;
|
||||
defaultText = literalExample "pkgs.git-sync";
|
||||
description = ''
|
||||
Package containing the <command>git-sync</command> program.
|
||||
'';
|
||||
};
|
||||
|
||||
repositories = mkOption {
|
||||
type = with types; attrsOf repositoryType;
|
||||
description = ''
|
||||
The repositories that should be synchronized.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.git-sync" pkgs
|
||||
lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services = services;
|
||||
};
|
||||
}
|
||||
@@ -20,22 +20,19 @@ let
|
||||
# we cannot use `gpgconf` directly because it heavily depends on system
|
||||
# state, but we need the values at build time. original:
|
||||
# https://github.com/gpg/gnupg/blob/c6702d77d936b3e9d91b34d8fdee9599ab94ee1b/common/homedir.c#L672-L681
|
||||
gpgconf = dir: let
|
||||
f = pkgs.runCommand dir {} ''
|
||||
PATH=${pkgs.coreutils}/bin:${pkgs.xxd}/bin:$PATH
|
||||
gpgconf = dir:
|
||||
if homedir == options.programs.gpg.homedir.default then
|
||||
"%t/gnupg/${dir}"
|
||||
else
|
||||
builtins.readFile (pkgs.runCommand dir {} ''
|
||||
PATH=${pkgs.xxd}/bin:$PATH
|
||||
|
||||
if [[ ${homedir} = ${options.programs.gpg.homedir.default} ]]
|
||||
then
|
||||
echo -n "%t/gnupg/${dir}" > $out
|
||||
else
|
||||
hash=$(echo -n ${homedir} | sha1sum -b | xxd -r -p | base32 | \
|
||||
cut -c -24 | tr '[:upper:]' '[:lower:]' | \
|
||||
tr abcdefghijklmnopqrstuvwxyz234567 \
|
||||
ybndrfg8ejkmcpqxot1uwisza345h769)
|
||||
echo -n "%t/gnupg/d.$hash/${dir}" > $out
|
||||
fi
|
||||
'';
|
||||
in "${builtins.readFile f}";
|
||||
echo -n "%t/gnupg/d.$hash/${dir}" > "$out"
|
||||
'');
|
||||
|
||||
in
|
||||
|
||||
@@ -203,10 +200,11 @@ in
|
||||
[ cfg.extraConfig ]
|
||||
);
|
||||
|
||||
home.sessionVariables =
|
||||
optionalAttrs cfg.enableSshSupport {
|
||||
SSH_AUTH_SOCK = "$(${gpgPkg}/bin/gpgconf --list-dirs agent-ssh-socket)";
|
||||
};
|
||||
home.sessionVariablesExtra = optionalString cfg.enableSshSupport ''
|
||||
if [[ -z "$SSH_AUTH_SOCK" ]]; then
|
||||
export SSH_AUTH_SOCK="$(${gpgPkg}/bin/gpgconf --list-dirs agent-ssh-socket)"
|
||||
fi
|
||||
'';
|
||||
|
||||
programs.bash.initExtra = gpgInitStr;
|
||||
programs.zsh.initExtra = gpgInitStr;
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
{ lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options.lieer.sync = {
|
||||
enable = mkEnableOption "lieer synchronization service";
|
||||
|
||||
frequency = mkOption {
|
||||
type = types.str;
|
||||
default = "*:0/5";
|
||||
description = ''
|
||||
How often to synchronize the account.
|
||||
</para><para>
|
||||
This value is passed to the systemd timer configuration as the
|
||||
onCalendar option. See
|
||||
<citerefentry>
|
||||
<refentrytitle>systemd.time</refentrytitle>
|
||||
<manvolnum>7</manvolnum>
|
||||
</citerefentry>
|
||||
for more information about the format.
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -51,14 +51,8 @@ let
|
||||
in {
|
||||
meta.maintainers = [ maintainers.tadfisher ];
|
||||
|
||||
options = {
|
||||
services.lieer.enable =
|
||||
mkEnableOption "lieer Gmail synchronization service";
|
||||
|
||||
accounts.email.accounts = mkOption {
|
||||
type = with types; attrsOf (submodule (import ./lieer-accounts.nix));
|
||||
};
|
||||
};
|
||||
options.services.lieer.enable =
|
||||
mkEnableOption "lieer Gmail synchronization service";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
|
||||
48
modules/services/notify-osd.nix
Normal file
48
modules/services/notify-osd.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.notify-osd;
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.imalison ];
|
||||
|
||||
options = {
|
||||
services.notify-osd = {
|
||||
enable = mkEnableOption "notify-osd";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.notify-osd;
|
||||
defaultText = literalExample "pkgs.notify-osd";
|
||||
description = ''
|
||||
Package containing the <command>notify-osd</command> program.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.notify-osd" pkgs
|
||||
lib.platforms.linux)
|
||||
];
|
||||
|
||||
systemd.user.services.notify-osd = {
|
||||
Unit = {
|
||||
Description = "notify-osd";
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
|
||||
Service = {
|
||||
ExecStart = "${cfg.package}/bin/notify-osd";
|
||||
Restart = "on-abort";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -12,14 +12,19 @@ in {
|
||||
meta.maintainers = [ maintainers.jonringer ];
|
||||
|
||||
options.services.pulseeffects = {
|
||||
enable = mkEnableOption "Pulseeffects daemon";
|
||||
enable = mkEnableOption ''
|
||||
Pulseeffects daemon
|
||||
Note, it is necessary to add
|
||||
<programlisting language="nix">
|
||||
programs.dconf.enable = true;
|
||||
</programlisting>
|
||||
to your system configuration for the daemon to work correctly'';
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.pulseeffects;
|
||||
defaultText = literalExample "pkgs.pulseeffects";
|
||||
default = pkgs.pulseeffects-legacy;
|
||||
defaultText = literalExample "pkgs.pulseeffects-legacy";
|
||||
description = "Pulseeffects package to use.";
|
||||
example = literalExample "pkgs.pulseeffects-pw";
|
||||
};
|
||||
|
||||
preset = mkOption {
|
||||
@@ -43,9 +48,6 @@ in {
|
||||
# "AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files"
|
||||
home.packages = [ cfg.package pkgs.at-spi2-core ];
|
||||
|
||||
# Will need to add `services.dbus.packages = with pkgs; [ gnome.dconf ];`
|
||||
# to /etc/nixos/configuration.nix for daemon to work correctly
|
||||
|
||||
systemd.user.services.pulseeffects = {
|
||||
Unit = {
|
||||
Description = "Pulseeffects daemon";
|
||||
|
||||
@@ -61,8 +61,15 @@ with lib;
|
||||
Restart = "on-failure";
|
||||
SuccessExitStatus = [ 3 4 ];
|
||||
RestartForceExitStatus = [ 3 4 ];
|
||||
|
||||
# Sandboxing.
|
||||
LockPersonality = true;
|
||||
MemoryDenyWriteExecute = true;
|
||||
NoNewPrivileges = true;
|
||||
PrivateUsers = true;
|
||||
RestrictNamespaces = true;
|
||||
SystemCallArchitectures = "native";
|
||||
SystemCallFilter = "@system-service";
|
||||
};
|
||||
|
||||
Install = { WantedBy = [ "default.target" ]; };
|
||||
|
||||
@@ -10,15 +10,17 @@ in {
|
||||
meta.maintainers = [ maintainers.imalison ];
|
||||
|
||||
options = {
|
||||
services.volnoti = { enable = mkEnableOption "Volnoti volume HUD daemon"; };
|
||||
services.volnoti = {
|
||||
enable = mkEnableOption "Volnoti volume HUD daemon";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.volnoti;
|
||||
defaultText = literalExample "pkgs.volnoti";
|
||||
description = ''
|
||||
Package containing the <command>volnoti</command> program.
|
||||
'';
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.volnoti;
|
||||
defaultText = literalExample "pkgs.volnoti";
|
||||
description = ''
|
||||
Package containing the <command>volnoti</command> program.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ in {
|
||||
List of lua packages available for being
|
||||
used in the Awesome configuration.
|
||||
'';
|
||||
example = literalExample "[ luaPackages.oocairo ]";
|
||||
example = literalExample "[ pkgs.luaPackages.vicious ]";
|
||||
};
|
||||
|
||||
noArgb = mkOption {
|
||||
|
||||
@@ -255,8 +255,7 @@ in {
|
||||
onChange = ''
|
||||
i3Socket=''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*
|
||||
if [ -S $i3Socket ]; then
|
||||
echo "Reloading i3"
|
||||
$DRY_RUN_CMD ${cfg.package}/bin/i3-msg -s $i3Socket reload 1>/dev/null
|
||||
${cfg.package}/bin/i3-msg -s $i3Socket reload >/dev/null
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -4,9 +4,13 @@ with lib;
|
||||
|
||||
rec {
|
||||
criteriaStr = criteria:
|
||||
"[${
|
||||
concatStringsSep " " (mapAttrsToList (k: v: ''${k}="${v}"'') criteria)
|
||||
}]";
|
||||
let
|
||||
toCriteria = k: v:
|
||||
if builtins.isBool v then
|
||||
(if v then "${k}" else "")
|
||||
else
|
||||
''${k}="${v}"'';
|
||||
in "[${concatStringsSep " " (mapAttrsToList toCriteria criteria)}]";
|
||||
|
||||
keybindingDefaultWorkspace = filterAttrs (n: v:
|
||||
cfg.config.defaultWorkspace != null && v == cfg.config.defaultWorkspace)
|
||||
|
||||
@@ -353,14 +353,23 @@ let
|
||||
|
||||
criteria = mkOption {
|
||||
type = criteriaModule;
|
||||
description =
|
||||
"Criteria of the windows on which command should be executed.";
|
||||
example = { title = "x200: ~/work"; };
|
||||
description = ''
|
||||
Criteria of the windows on which command should be executed.
|
||||
</para><para>
|
||||
A value of <literal>true</literal> is equivalent to using an empty
|
||||
criteria (which is different from an empty string criteria).
|
||||
'';
|
||||
example = literalExample ''
|
||||
{
|
||||
title = "x200: ~/work";
|
||||
floating = true;
|
||||
};
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
criteriaModule = types.attrsOf types.str;
|
||||
criteriaModule = types.attrsOf (types.either types.str types.bool);
|
||||
in {
|
||||
fonts = mkOption {
|
||||
type = with types; either (listOf str) fontOptions;
|
||||
@@ -538,7 +547,7 @@ in {
|
||||
};
|
||||
|
||||
workspaceLayout = mkOption {
|
||||
type = types.enum [ "default" "stacked" "tabbed" ];
|
||||
type = types.enum [ "default" "stacking" "tabbed" ];
|
||||
default = "default";
|
||||
example = "tabbed";
|
||||
description = ''
|
||||
|
||||
@@ -438,10 +438,9 @@ in {
|
||||
xdg.configFile."sway/config" = {
|
||||
source = configFile;
|
||||
onChange = ''
|
||||
swaySocket=''${XDG_RUNTIME_DIR:-/run/user/$UID}/sway-ipc.$UID.$(${pkgs.procps}/bin/pgrep -x sway || ${pkgs.coreutils}/bin/true).sock
|
||||
swaySocket=''${XDG_RUNTIME_DIR:-/run/user/$UID}/sway-ipc.$UID.$(${pkgs.procps}/bin/pgrep -x sway || true).sock
|
||||
if [ -S $swaySocket ]; then
|
||||
echo "Reloading sway"
|
||||
$DRY_RUN_CMD ${pkgs.sway}/bin/swaymsg -s $swaySocket reload
|
||||
${pkgs.sway}/bin/swaymsg -s $swaySocket reload
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -161,9 +161,8 @@ in {
|
||||
source = xmonadBin;
|
||||
onChange = ''
|
||||
# Attempt to restart xmonad if X is running.
|
||||
if [[ -v DISPLAY ]] ; then
|
||||
echo "Restarting xmonad"
|
||||
$DRY_RUN_CMD ${config.xsession.windowManager.command} --restart
|
||||
if [[ -v DISPLAY ]]; then
|
||||
${config.xsession.windowManager.command} --restart
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -57,6 +57,24 @@ in {
|
||||
. "${profileDirectory}/etc/profile.d/hm-session-vars.sh"
|
||||
'';
|
||||
|
||||
programs.zsh.envExtra = ''
|
||||
# Make system functions available to zsh
|
||||
() {
|
||||
setopt LOCAL_OPTIONS CASE_GLOB EXTENDED_GLOB
|
||||
|
||||
local system_fpaths=(
|
||||
# Package default
|
||||
/usr/share/zsh/site-functions(/-N)
|
||||
|
||||
# Debian
|
||||
/usr/share/zsh/functions/**/*(/-N)
|
||||
/usr/share/zsh/vendor-completions/(/-N)
|
||||
/usr/share/zsh/vendor-functions/(/-N)
|
||||
)
|
||||
fpath=(''${fpath} ''${system_fpaths})
|
||||
}
|
||||
'';
|
||||
|
||||
systemd.user.sessionVariables = let
|
||||
# https://github.com/archlinux/svntogit-packages/blob/packages/ncurses/trunk/PKGBUILD
|
||||
# https://salsa.debian.org/debian/ncurses/-/blob/master/debian/rules
|
||||
|
||||
@@ -93,8 +93,8 @@ in {
|
||||
++ optionals (cfg.properties != null)
|
||||
(mapAttrsToList formatLine cfg.properties)) + "\n";
|
||||
onChange = ''
|
||||
if [[ -v DISPLAY ]] ; then
|
||||
$DRY_RUN_CMD ${xrdbMerge}
|
||||
if [[ -v DISPLAY ]]; then
|
||||
${xrdbMerge}
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -43,8 +43,13 @@ in {
|
||||
in
|
||||
"''${xmonad}/bin/xmonad";
|
||||
'';
|
||||
default = ''test -n "$1" && eval "$@"'';
|
||||
description = ''
|
||||
Window manager start command.
|
||||
Command to use to start the window manager.
|
||||
</para><para>
|
||||
The default value allows integration with NixOS' generated xserver configuration.
|
||||
</para><para>
|
||||
Extra actions and commands can be specified in <option>xsession.initExtra</option>.
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
@@ -129,6 +129,7 @@ in {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "nix-daemon.socket" ];
|
||||
after = [ "nix-daemon.socket" ];
|
||||
before = [ "systemd-user-sessions.service" ];
|
||||
|
||||
environment = serviceEnvironment;
|
||||
|
||||
@@ -140,15 +141,38 @@ in {
|
||||
User = usercfg.home.username;
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = "yes";
|
||||
TimeoutStartSec = 90;
|
||||
SyslogIdentifier = "hm-activate-${username}";
|
||||
|
||||
# The activation script is run by a login shell to make sure
|
||||
# that the user is given a sane Nix environment.
|
||||
ExecStart = pkgs.writeScript "activate-${username}" ''
|
||||
#! ${pkgs.runtimeShell} -el
|
||||
echo Activating home-manager configuration for ${username}
|
||||
exec ${usercfg.home.activationPackage}/activate
|
||||
'';
|
||||
ExecStart = let
|
||||
systemctl =
|
||||
"XDG_RUNTIME_DIR=\${XDG_RUNTIME_DIR:-/run/user/$UID} systemctl";
|
||||
|
||||
sed = "${pkgs.gnused}/bin/sed";
|
||||
|
||||
exportedSystemdVariables = concatStringsSep "|" [
|
||||
"DBUS_SESSION_BUS_ADDRESS"
|
||||
"DISPLAY"
|
||||
"WAYLAND_DISPLAY"
|
||||
"XAUTHORITY"
|
||||
"XDG_RUNTIME_DIR"
|
||||
];
|
||||
|
||||
setupEnv = pkgs.writeScript "hm-setup-env" ''
|
||||
#! ${pkgs.runtimeShell} -el
|
||||
|
||||
# The activation script is run by a login shell to make sure
|
||||
# that the user is given a sane environment.
|
||||
# If the user is logged in, import variables from their current
|
||||
# session environment.
|
||||
eval "$(
|
||||
${systemctl} --user show-environment 2> /dev/null \
|
||||
| ${sed} -En '/^(${exportedSystemdVariables})=/s/^/export /p'
|
||||
)"
|
||||
|
||||
exec "$1/activate"
|
||||
'';
|
||||
in "${setupEnv} ${usercfg.home.activationPackage}";
|
||||
};
|
||||
}) cfg.users;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
{ pkgs ? import <nixpkgs> {}, enableBig ? true }:
|
||||
|
||||
let
|
||||
|
||||
@@ -26,10 +26,13 @@ let
|
||||
# unnecessary rebuilds of the tests.
|
||||
manual.manpages.enable = false;
|
||||
|
||||
imports = [ ./asserts.nix ];
|
||||
imports = [ ./asserts.nix ./stubs.nix ];
|
||||
}
|
||||
];
|
||||
|
||||
isDarwin = pkgs.stdenv.hostPlatform.isDarwin;
|
||||
isLinux = pkgs.stdenv.hostPlatform.isLinux;
|
||||
|
||||
in
|
||||
|
||||
import nmt {
|
||||
@@ -45,6 +48,9 @@ import nmt {
|
||||
./modules/programs/aria2
|
||||
./modules/programs/autojump
|
||||
./modules/programs/bash
|
||||
./modules/programs/bat
|
||||
./modules/programs/bottom
|
||||
./modules/programs/broot
|
||||
./modules/programs/browserpass
|
||||
./modules/programs/dircolors
|
||||
./modules/programs/direnv
|
||||
@@ -86,12 +92,11 @@ import nmt {
|
||||
./modules/programs/zplug
|
||||
./modules/programs/zsh
|
||||
./modules/xresources
|
||||
] ++ lib.optionals pkgs.stdenv.hostPlatform.isDarwin [
|
||||
] ++ lib.optionals isDarwin [
|
||||
./modules/targets-darwin
|
||||
] ++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [
|
||||
] ++ lib.optionals isLinux [
|
||||
./modules/config/i18n
|
||||
./modules/i18n/input-method
|
||||
./modules/misc/debug
|
||||
./modules/misc/gtk
|
||||
./modules/misc/numlock
|
||||
./modules/misc/pam
|
||||
@@ -100,7 +105,6 @@ import nmt {
|
||||
./modules/misc/xsession
|
||||
./modules/programs/abook
|
||||
./modules/programs/autorandr
|
||||
./modules/programs/firefox
|
||||
./modules/programs/foot
|
||||
./modules/programs/getmail
|
||||
./modules/programs/gnome-terminal
|
||||
@@ -119,6 +123,8 @@ import nmt {
|
||||
./modules/services/dropbox
|
||||
./modules/services/emacs
|
||||
./modules/services/fluidsynth
|
||||
./modules/services/fnott
|
||||
./modules/services/git-sync
|
||||
./modules/services/kanshi
|
||||
./modules/services/lieer
|
||||
./modules/services/pantalaimon
|
||||
@@ -135,5 +141,10 @@ import nmt {
|
||||
./modules/services/wlsunset
|
||||
./modules/systemd
|
||||
./modules/targets-linux
|
||||
] ++ lib.optionals enableBig [
|
||||
./modules/programs/emacs
|
||||
] ++ lib.optionals (enableBig && isLinux) [
|
||||
./modules/misc/debug
|
||||
./modules/programs/firefox
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -15,18 +15,39 @@ in {
|
||||
|
||||
{ float = 3.14; }
|
||||
|
||||
{ int = 42; }
|
||||
{ int = 42; }
|
||||
{ int = -42; }
|
||||
{ int = -42; }
|
||||
|
||||
{ list = [ "one" ]; }
|
||||
{ list = mkArray type.string [ "two" ]; }
|
||||
{ uint32 = mkUint32 42; }
|
||||
{ uint32 = mkUint32 42; }
|
||||
|
||||
{ int16 = mkInt16 (-42); }
|
||||
{ int16 = mkInt16 (-42); }
|
||||
|
||||
{ uint16 = mkUint16 42; }
|
||||
{ uint16 = mkUint16 42; }
|
||||
|
||||
{ int64 = mkInt64 (-42); }
|
||||
{ int64 = mkInt64 (-42); }
|
||||
|
||||
{ uint64 = mkUint64 42; }
|
||||
{ uint64 = mkUint64 42; }
|
||||
|
||||
{ array1 = [ "one" ]; }
|
||||
{ array1 = mkArray type.string [ "two" ]; }
|
||||
{ array2 = mkArray type.uint32 [ 1 ]; }
|
||||
{ array2 = mkArray type.uint32 [ 2 ]; }
|
||||
|
||||
{ emptyArray1 = [ ]; }
|
||||
{ emptyArray2 = mkEmptyArray type.uint32; }
|
||||
|
||||
{ string = "foo"; }
|
||||
{ string = "foo"; }
|
||||
{ escapedString = "' \\"; }
|
||||
{
|
||||
escapedString = ''
|
||||
'\
|
||||
'';
|
||||
}
|
||||
|
||||
{ tuple = mkTuple [ 1 [ "foo" ] ]; }
|
||||
|
||||
@@ -44,17 +65,23 @@ in {
|
||||
home-files/result.txt \
|
||||
${
|
||||
pkgs.writeText "expected.txt" ''
|
||||
array1 = @as ['one','two']
|
||||
array2 = @au [1,2]
|
||||
bool = true
|
||||
emptyArray1 = @as []
|
||||
emptyArray2 = @as []
|
||||
escapedString = '\' \\'
|
||||
emptyArray2 = @au []
|
||||
escapedString = '\'\\\n'
|
||||
float = 3.140000
|
||||
int = 42
|
||||
list = @as ['one','two']
|
||||
int = -42
|
||||
int16 = @n -42
|
||||
int64 = @x -42
|
||||
maybe1 = @ms nothing
|
||||
maybe2 = just @u 4
|
||||
string = 'foo'
|
||||
tuple = @(ias) (1,@as ['foo'])
|
||||
uint16 = @q 42
|
||||
uint32 = @u 42
|
||||
uint64 = @t 42
|
||||
''
|
||||
}
|
||||
'';
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config = {
|
||||
nixpkgs.overlays = [ (import ./fcitx5-overlay.nix) ];
|
||||
i18n.inputMethod = {
|
||||
enabled = "fcitx5";
|
||||
fcitx5.addons = with pkgs; [ fcitx5-chinese-addons ];
|
||||
};
|
||||
imports = [ ./fcitx5-stubs.nix ];
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/systemd/user/fcitx5-daemon.service
|
||||
'';
|
||||
i18n.inputMethod = {
|
||||
enabled = "fcitx5";
|
||||
fcitx5.addons = with pkgs; [ fcitx5-chinese-addons ];
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/systemd/user/fcitx5-daemon.service
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
final: prev:
|
||||
|
||||
let
|
||||
|
||||
dummy = prev.runCommandLocal "dummy-package" { } "mkdir $out";
|
||||
|
||||
in {
|
||||
fcitx5 = prev.runCommandLocal "fcitx5" { version = "0"; } ''
|
||||
mkdir -p $out/bin $out/share/applications $out/etc/xdg/autostart
|
||||
touch $out/bin/fcitx5 \
|
||||
$out/share/applications/org.fcitx.Fcitx5.desktop \
|
||||
$out/etc/xdg/autostart/org.fcitx.Fcitx5.desktop
|
||||
chmod +x $out/bin/fcitx5
|
||||
'';
|
||||
fcitx5-configtool = dummy;
|
||||
fcitx5-lua = dummy;
|
||||
fcitx5-qt = dummy;
|
||||
fcitx5-gtk = dummy;
|
||||
fcitx5-with-addons =
|
||||
prev.fcitx5-with-addons.override { inherit (final) fcitx5-qt; };
|
||||
fcitx5-chinese-addons = dummy;
|
||||
}
|
||||
27
tests/modules/i18n/input-method/fcitx5-stubs.nix
Normal file
27
tests/modules/i18n/input-method/fcitx5-stubs.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
test.stubs = {
|
||||
fcitx5 = {
|
||||
version = "0";
|
||||
outPath = null;
|
||||
buildScript = ''
|
||||
mkdir -p $out/bin $out/share/applications $out/etc/xdg/autostart
|
||||
touch $out/bin/fcitx5 \
|
||||
$out/share/applications/org.fcitx.Fcitx5.desktop \
|
||||
$out/etc/xdg/autostart/org.fcitx.Fcitx5.desktop
|
||||
chmod +x $out/bin/fcitx5
|
||||
'';
|
||||
};
|
||||
fcitx5-configtool = { outPath = null; };
|
||||
fcitx5-lua = { outPath = null; };
|
||||
fcitx5-qt = { outPath = null; };
|
||||
fcitx5-gtk = { outPath = null; };
|
||||
fcitx5-chinese-addons = { outPath = null; };
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
fcitx5-with-addons =
|
||||
super.fcitx5-with-addons.override { inherit (self) fcitx5-qt; };
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -9,6 +9,8 @@ with lib;
|
||||
gtk2.extraConfig = "gtk-can-change-accels = 1";
|
||||
};
|
||||
|
||||
test.stubs.dconf = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.gtkrc-2.0
|
||||
assertFileContent home-files/.gtkrc-2.0 ${
|
||||
|
||||
@@ -7,6 +7,8 @@ with lib;
|
||||
gtk.enable = true;
|
||||
gtk.gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||
|
||||
test.stubs.dconf = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/gtk-2.0/gtkrc
|
||||
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
|
||||
|
||||
@@ -6,9 +6,7 @@ with lib;
|
||||
config = {
|
||||
xsession.numlock.enable = true;
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: { numlockx = pkgs.writeScriptBin "dummy-numlockx" ""; })
|
||||
];
|
||||
test.stubs.numlockx = { };
|
||||
|
||||
nmt.script = ''
|
||||
serviceFile=home-files/.config/systemd/user/numlockx.service
|
||||
|
||||
@@ -7,15 +7,11 @@
|
||||
platformTheme = "gnome";
|
||||
style = {
|
||||
name = "adwaita";
|
||||
package = pkgs.dummyTheme;
|
||||
package = config.lib.test.mkStubPackage { };
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
dummyTheme = pkgs.runCommandLocal "theme" { } "mkdir $out";
|
||||
})
|
||||
];
|
||||
test.stubs.qgnomeplatform = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
xdg-mime-apps-basics = ./mime-apps-basics.nix;
|
||||
xdg-file-attr-names = ./file-attr-names.nix;
|
||||
xdg-system-dirs = ./system-dirs.nix;
|
||||
xdg-desktop-entries = ./desktop-entries.nix;
|
||||
xdg-file-gen = ./file-gen.nix;
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
xdg.configFile.test.text = "config";
|
||||
xdg.dataFile.test.text = "data";
|
||||
home.file.test.text = "home";
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/test
|
||||
assertFileExists home-files/.local/share/test
|
||||
assertFileExists home-files/test
|
||||
assertFileContent \
|
||||
home-files/.config/test \
|
||||
${builtins.toFile "test" "config"}
|
||||
assertFileContent \
|
||||
home-files/.local/share/test \
|
||||
${builtins.toFile "test" "data"}
|
||||
assertFileContent \
|
||||
home-files/test \
|
||||
${builtins.toFile "test" "home"}
|
||||
'';
|
||||
};
|
||||
}
|
||||
30
tests/modules/misc/xdg/file-gen.nix
Normal file
30
tests/modules/misc/xdg/file-gen.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
xdg.configHome = /. + "${config.home.homeDirectory}/.dummy-config";
|
||||
xdg.dataHome = /. + "${config.home.homeDirectory}/.dummy-data";
|
||||
xdg.cacheHome = /. + "${config.home.homeDirectory}/.dummy-cache";
|
||||
|
||||
xdg.configFile.test.text = "config";
|
||||
xdg.dataFile.test.text = "data";
|
||||
home.file."${config.xdg.cacheHome}/test".text = "cache";
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.dummy-config/test
|
||||
assertFileExists home-files/.dummy-cache/test
|
||||
assertFileExists home-files/.dummy-data/test
|
||||
assertFileContent \
|
||||
home-files/.dummy-config/test \
|
||||
${builtins.toFile "test" "config"}
|
||||
assertFileContent \
|
||||
home-files/.dummy-data/test \
|
||||
${builtins.toFile "test" "data"}
|
||||
assertFileContent \
|
||||
home-files/.dummy-cache/test \
|
||||
${builtins.toFile "test" "cache"}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user