mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
Compare commits
32 Commits
sumner/296
...
release-22
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6639e3a837 | ||
|
|
071e28c869 | ||
|
|
87d55517f6 | ||
|
|
d148e1dd61 | ||
|
|
d78b3488a7 | ||
|
|
ce4cfdce2c | ||
|
|
2a4d5e6f44 | ||
|
|
f0ecd4b1db | ||
|
|
a13f155be7 | ||
|
|
d8b233ad03 | ||
|
|
b81e128fc0 | ||
|
|
152ecaf9ef | ||
|
|
737a00f5d2 | ||
|
|
17208be516 | ||
|
|
4a3d01fb53 | ||
|
|
a839432a5c | ||
|
|
40ec43d367 | ||
|
|
ac2287df5a | ||
|
|
1808cb66aa | ||
|
|
acad715f78 | ||
|
|
8f3e267051 | ||
|
|
bda2c80b4c | ||
|
|
64831f938b | ||
|
|
51ea4217f7 | ||
|
|
2c8489e57a | ||
|
|
9042c756fa | ||
|
|
d73ba6a534 | ||
|
|
e66f0ff69a | ||
|
|
94780dd888 | ||
|
|
02b15de8ad | ||
|
|
97fac4f282 | ||
|
|
e6869735d2 |
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
@@ -163,6 +163,9 @@
|
||||
|
||||
/modules/programs/mu.nix @KarlJoad
|
||||
|
||||
/modules/programs/mujmap.nix @elizagamedev
|
||||
/tests/modules/programs/mujmap @elizagamedev
|
||||
|
||||
/modules/programs/navi.nix @marsam
|
||||
|
||||
/modules/programs/ncmpcpp.nix @olmokramer
|
||||
|
||||
6
.github/workflows/github_pages.yml
vendored
6
.github/workflows/github_pages.yml
vendored
@@ -11,13 +11,13 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: cachix/install-nix-action@v17
|
||||
- uses: cachix/install-nix-action@v18
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- uses: cachix/cachix-action@v10
|
||||
- uses: cachix/cachix-action@v12
|
||||
with:
|
||||
name: nix-community
|
||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||
- run: |
|
||||
nix-build -A docs.html
|
||||
cp -r result/share/doc/home-manager public
|
||||
|
||||
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
@@ -12,13 +12,13 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: cachix/install-nix-action@v17
|
||||
- uses: cachix/install-nix-action@v18
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- uses: cachix/cachix-action@v10
|
||||
nix_path: nixpkgs=channel:nixos-22.05
|
||||
- uses: cachix/cachix-action@v12
|
||||
with:
|
||||
name: nix-community
|
||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||
- run: |
|
||||
if grep -R --exclude stdlib-extended.nix literalExample modules ; then
|
||||
echo "Error: literalExample should be replaced by literalExpression" > /dev/stderr
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2020 Home Manager contributors
|
||||
Copyright (c) 2017-2022 Home Manager contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
25
README.md
25
README.md
@@ -6,11 +6,16 @@ using the [Nix][] package manager together with the Nix libraries
|
||||
found in [Nixpkgs][]. It allows declarative configuration of user
|
||||
specific (non global) packages and dotfiles.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Before attempting to use Home Manager please read the warning below.
|
||||
|
||||
For a more systematic overview of Home Manager and its available
|
||||
options, please see the Home Manager [manual][manual] and
|
||||
[options][configuration options].
|
||||
For a systematic overview of Home Manager and its available options,
|
||||
please see
|
||||
|
||||
- the [Home Manager manual][manual] and
|
||||
- the [Home Manager configuration options][configuration options].
|
||||
|
||||
If you would like to contribute to Home Manager
|
||||
then please have a look at the [contributing][] chapter of the manual.
|
||||
@@ -36,7 +41,7 @@ will write to your dconf store and cannot tell whether a configuration
|
||||
that it is about to be overwritten was from a previous Home Manager
|
||||
generation or from manual configuration.
|
||||
|
||||
Home Manager targets [NixOS][] unstable and NixOS version 21.11 (the
|
||||
Home Manager targets [NixOS][] unstable and NixOS version 22.05 (the
|
||||
current stable version), it may or may not work on other Linux
|
||||
distributions and NixOS versions.
|
||||
|
||||
@@ -101,7 +106,7 @@ Home Manager is developed against `nixpkgs-unstable` branch, which
|
||||
often causes it to contain tweaks for changes/packages not yet
|
||||
released in stable NixOS. To avoid breaking users' configurations,
|
||||
Home Manager is released in branches corresponding to NixOS releases
|
||||
(e.g. `release-21.11`). These branches get fixes, but usually not new
|
||||
(e.g. `release-22.05`). These branches get fixes, but usually not new
|
||||
modules. If you need a module to be backported, then feel free to open
|
||||
an issue.
|
||||
|
||||
@@ -110,18 +115,18 @@ License
|
||||
|
||||
This project is licensed under the terms of the [MIT license](LICENSE).
|
||||
|
||||
[Nix]: https://nixos.org/nix/
|
||||
[Nix]: https://nixos.org/explore.html
|
||||
[NixOS]: https://nixos.org/
|
||||
[Nixpkgs]: https://nixos.org/nixpkgs/
|
||||
[manual]: https://nix-community.github.io/home-manager/
|
||||
[Nixpkgs]: https://github.com/NixOS/nixpkgs
|
||||
[manual]: https://nix-community.github.io/home-manager/index.html
|
||||
[contributing]: https://nix-community.github.io/home-manager/#ch-contributing
|
||||
[manual usage]: https://nix-community.github.io/home-manager/#ch-usage
|
||||
[configuration options]: https://nix-community.github.io/home-manager/options.html
|
||||
[#home-manager]: https://webchat.oftc.net/?channels=home-manager
|
||||
[OFTC]: https://oftc.net/
|
||||
[Nix Pills]: https://nixos.org/nixos/nix-pills/
|
||||
[Nix Pills]: https://nixos.org/guides/nix-pills/
|
||||
[Nix Flakes]: https://nixos.wiki/wiki/Flakes
|
||||
[nix-darwin]: https://github.com/LnL7/nix-darwin/
|
||||
[nix-darwin]: https://github.com/LnL7/nix-darwin
|
||||
[manual standalone install]: https://nix-community.github.io/home-manager/index.html#sec-install-standalone
|
||||
[manual nixos install]: https://nix-community.github.io/home-manager/index.html#sec-install-nixos-module
|
||||
[manual nix-darwin install]: https://nix-community.github.io/home-manager/index.html#sec-install-nix-darwin-module
|
||||
|
||||
@@ -5,12 +5,10 @@
|
||||
|
||||
let
|
||||
|
||||
nmdSrc = pkgs.fetchFromGitLab {
|
||||
name = "nmd";
|
||||
owner = "rycee";
|
||||
repo = "nmd";
|
||||
rev = "de522bdd533350b3afb41e1ce9b3afb72922fba2";
|
||||
sha256 = "1ji4q7b48nnicgpnnl6yb9xb9zfkmmzkch4yifinphw3ag38qrmd";
|
||||
nmdSrc = fetchTarball {
|
||||
url =
|
||||
"https://gitlab.com/api/v4/projects/rycee%2Fnmd/repository/archive.tar.gz?sha=b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169";
|
||||
sha256 = "0c2nq28rw4v559s3f1nf6y2p6fladgmbqgbsyf3vzs2przn5qn37";
|
||||
};
|
||||
|
||||
nmd = import nmdSrc { inherit lib pkgs; };
|
||||
@@ -89,6 +87,7 @@ let
|
||||
|
||||
docs = nmd.buildDocBookDocs {
|
||||
pathName = "home-manager";
|
||||
projectName = "Home Manager";
|
||||
modulesDocs = [ hmModulesDocs nixDarwinModuleDocs nixosModuleDocs ];
|
||||
documentsDirectory = ./.;
|
||||
documentType = "book";
|
||||
|
||||
@@ -54,11 +54,11 @@ $ nix-channel --add https://github.com/nix-community/home-manager/archive/master
|
||||
$ nix-channel --update
|
||||
----
|
||||
+
|
||||
and if you follow a Nixpkgs version 21.11 channel you can run
|
||||
and if you follow a Nixpkgs version 22.05 channel you can run
|
||||
+
|
||||
[source,console]
|
||||
----
|
||||
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.11.tar.gz home-manager
|
||||
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.05.tar.gz home-manager
|
||||
$ nix-channel --update
|
||||
----
|
||||
+
|
||||
@@ -136,11 +136,11 @@ or an unstable channel, you can run
|
||||
# nix-channel --update
|
||||
----
|
||||
|
||||
and if you follow a Nixpkgs version 21.11 channel, you can run
|
||||
and if you follow a Nixpkgs version 22.05 channel, you can run
|
||||
|
||||
[source,console]
|
||||
----
|
||||
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.11.tar.gz home-manager
|
||||
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.05.tar.gz home-manager
|
||||
# nix-channel --update
|
||||
----
|
||||
|
||||
@@ -247,11 +247,11 @@ or an unstable channel, you can run
|
||||
# nix-channel --update
|
||||
----
|
||||
|
||||
and if you follow a Nixpkgs version 21.11 channel, you can run
|
||||
and if you follow a Nixpkgs version 22.05 channel, you can run
|
||||
|
||||
[source,console]
|
||||
----
|
||||
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.11.tar.gz home-manager
|
||||
# nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.05.tar.gz home-manager
|
||||
# nix-channel --update
|
||||
----
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<title>Home Manager Reference Pages</title>
|
||||
<info>
|
||||
<author><personname>Home Manager contributors</personname></author>
|
||||
<copyright><year>2017–2020</year><holder>Home Manager contributors</holder>
|
||||
<copyright><year>2017–2022</year><holder>Home Manager contributors</holder>
|
||||
</copyright>
|
||||
</info>
|
||||
<xi:include href="man-configuration.xml" />
|
||||
|
||||
@@ -72,7 +72,7 @@ Remove the line containing `home.stateVersion` in the example.
|
||||
# Update the state version as needed.
|
||||
# See the changelog here:
|
||||
# https://nix-community.github.io/home-manager/release-notes.html#sec-release-21.05
|
||||
stateVersion = "21.11";
|
||||
stateVersion = "22.05";
|
||||
|
||||
# Optionally use extraSpecialArgs
|
||||
# to pass through arguments to home.nix
|
||||
@@ -85,9 +85,9 @@ Remove the line containing `home.stateVersion` in the example.
|
||||
====
|
||||
* The above example tracks the master branch of Home Manager
|
||||
and nixos-unstable branch of Nixpkgs.
|
||||
If you would like to use the `release-21.11` branch,
|
||||
change the `home-manager` input url to `github:nix-community/home-manager/release-21.11`
|
||||
and `nixpkgs` url to `github:NixOS/nixpkgs/nixos-21.11`.
|
||||
If you would like to use the `release-22.05` branch,
|
||||
change the `home-manager` input url to `github:nix-community/home-manager/release-22.05`
|
||||
and `nixpkgs` url to `github:NixOS/nixpkgs/nixos-22.05`.
|
||||
Make sure to also update to the `stateVersion` option accordingly.
|
||||
|
||||
* The Home Manager library is exported by the flake under
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[[sec-release-22.05]]
|
||||
== Release 22.05
|
||||
|
||||
This is the current unstable branch and the information in this section is therefore not final.
|
||||
The 22.05 release branch became the stable branch in May, 2022.
|
||||
|
||||
[[sec-release-22.05-highlights]]
|
||||
=== Highlights
|
||||
|
||||
@@ -480,7 +480,10 @@ function doUninstall() {
|
||||
y|Y)
|
||||
_i "Switching to empty Home Manager configuration..."
|
||||
HOME_MANAGER_CONFIG="$(mktemp --tmpdir home-manager.XXXXXXXXXX)"
|
||||
echo "{ lib, ... }: { home.file = lib.mkForce {}; }" > "$HOME_MANAGER_CONFIG"
|
||||
echo "{ lib, ... }: {" > "$HOME_MANAGER_CONFIG"
|
||||
echo " home.file = lib.mkForce {};" >> "$HOME_MANAGER_CONFIG"
|
||||
echo " home.stateVersion = \"18.09\";" >> "$HOME_MANAGER_CONFIG"
|
||||
echo "}" >> "$HOME_MANAGER_CONFIG"
|
||||
doSwitch
|
||||
$DRY_RUN_CMD $REMOVE_CMD home-manager-path || true
|
||||
rm "$HOME_MANAGER_CONFIG"
|
||||
|
||||
@@ -123,6 +123,38 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
jmapModule = types.submodule {
|
||||
options = {
|
||||
host = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
example = "jmap.example.org";
|
||||
description = ''
|
||||
Hostname of JMAP server.
|
||||
</para><para>
|
||||
If both this option and <xref
|
||||
linkend="opt-accounts.email.accounts._name_.jmap.sessionUrl"/> are specified,
|
||||
<code>host</code> is preferred by applications when establishing a
|
||||
session.
|
||||
'';
|
||||
};
|
||||
|
||||
sessionUrl = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
example = "https://jmap.example.org:443/.well-known/jmap";
|
||||
description = ''
|
||||
URL for the JMAP Session resource.
|
||||
</para><para>
|
||||
If both this option and <xref
|
||||
linkend="opt-accounts.email.accounts._name_.jmap.host"/> are specified,
|
||||
<code>host</code> is preferred by applications when establishing a
|
||||
session.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
smtpModule = types.submodule {
|
||||
options = {
|
||||
host = mkOption {
|
||||
@@ -205,7 +237,7 @@ let
|
||||
indicate the nature of the provider.
|
||||
</para><para>
|
||||
When this indicates a specific provider then, for example,
|
||||
the IMAP and SMTP server configuration may be set
|
||||
the IMAP, SMTP, and JMAP server configuration may be set
|
||||
automatically.
|
||||
'';
|
||||
};
|
||||
@@ -234,7 +266,7 @@ let
|
||||
default = null;
|
||||
description = ''
|
||||
The server username of this account. This will be used as
|
||||
the SMTP and IMAP user name.
|
||||
the SMTP, IMAP, and JMAP user name.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -299,6 +331,14 @@ let
|
||||
'';
|
||||
};
|
||||
|
||||
jmap = mkOption {
|
||||
type = types.nullOr jmapModule;
|
||||
default = null;
|
||||
description = ''
|
||||
The JMAP configuration to use for this account.
|
||||
'';
|
||||
};
|
||||
|
||||
signature = mkOption {
|
||||
type = signatureModule;
|
||||
default = { };
|
||||
@@ -343,10 +383,16 @@ let
|
||||
host = "smtp.fastmail.com";
|
||||
port = if config.smtp.tls.useStartTls then 587 else 465;
|
||||
};
|
||||
|
||||
imap = {
|
||||
host = "imap.fastmail.com";
|
||||
port = 993;
|
||||
};
|
||||
|
||||
jmap = {
|
||||
host = "fastmail.com";
|
||||
sessionUrl = "https://jmap.fastmail.com/.well-known/jmap";
|
||||
};
|
||||
})
|
||||
(mkIf (config.flavor == "gmail.com") {
|
||||
userName = mkDefault config.address;
|
||||
|
||||
@@ -581,7 +581,6 @@ in
|
||||
if [[ -e "$nixProfilePath"/manifest.json ]] ; then
|
||||
nix profile list \
|
||||
| { grep 'home-manager-path$' || test $? = 1; } \
|
||||
| awk -F ' ' '{ print $4 }' \
|
||||
| cut -d ' ' -f 4 \
|
||||
| xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG
|
||||
else
|
||||
@@ -592,22 +591,36 @@ in
|
||||
''
|
||||
else
|
||||
''
|
||||
function nixReplaceProfile() {
|
||||
local oldNix="$(command -v nix)"
|
||||
|
||||
nix profile list \
|
||||
| { grep 'home-manager-path$' || test $? = 1; } \
|
||||
| cut -d ' ' -f 4 \
|
||||
| xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG
|
||||
|
||||
$DRY_RUN_CMD $oldNix profile install $1
|
||||
}
|
||||
|
||||
if [[ -e "$nixProfilePath"/manifest.json ]] ; then
|
||||
INSTALL_CMD="nix profile install"
|
||||
INSTALL_CMD_ACTUAL="nixReplaceProfile"
|
||||
LIST_CMD="nix profile list"
|
||||
REMOVE_CMD_SYNTAX='nix profile remove {number | store path}'
|
||||
else
|
||||
INSTALL_CMD="nix-env -i"
|
||||
INSTALL_CMD_ACTUAL="$DRY_RUN_CMD nix-env -i"
|
||||
LIST_CMD="nix-env -q"
|
||||
REMOVE_CMD_SYNTAX='nix-env -e {package name}'
|
||||
fi
|
||||
|
||||
if ! $DRY_RUN_CMD $INSTALL_CMD ${cfg.path} ; then
|
||||
if ! $INSTALL_CMD_ACTUAL ${cfg.path} ; then
|
||||
echo
|
||||
_iError $'Oops, Nix failed to install your new Home Manager profile!\n\nPerhaps there is a conflict with a package that was installed using\n"%s"? Try running\n\n %s\n\nand if there is a conflicting package you can remove it with\n\n %s\n\nThen try activating your Home Manager configuration again.' "$INSTALL_CMD" "$LIST_CMD" "$REMOVE_CMD_SYNTAX"
|
||||
exit 1
|
||||
fi
|
||||
unset INSTALL_CMD LIST_CMD REMOVE_CMD_SYNTAX
|
||||
unset -f nixReplaceProfile
|
||||
unset INSTALL_CMD INSTALL_CMD_ACTUAL LIST_CMD REMOVE_CMD_SYNTAX
|
||||
''
|
||||
);
|
||||
|
||||
@@ -685,6 +698,8 @@ in
|
||||
''
|
||||
mkdir -p $out
|
||||
|
||||
echo "${config.home.version.full}" > $out/hm-version
|
||||
|
||||
cp ${activationScript} $out/activate
|
||||
|
||||
mkdir $out/bin
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -30,5 +30,39 @@ with lib;
|
||||
conversion or moving files.
|
||||
'';
|
||||
};
|
||||
|
||||
home.version = {
|
||||
full = mkOption {
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
type = types.str;
|
||||
default = let
|
||||
inherit (config.home.version) release revision;
|
||||
suffix =
|
||||
optionalString (revision != null) "+${substring 0 8 revision}";
|
||||
in "${release}${suffix}";
|
||||
example = "22.05+213a0629";
|
||||
description = "The full Home Manager version.";
|
||||
};
|
||||
|
||||
release = mkOption {
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
type = types.str;
|
||||
default = fileContents ../../.release;
|
||||
example = "22.05";
|
||||
description = "The Home Manager release.";
|
||||
};
|
||||
|
||||
revision = mkOption {
|
||||
internal = true;
|
||||
type = types.nullOr types.str;
|
||||
default = let gitRepo = "${toString ./../..}/.git";
|
||||
in if pathIsGitRepo gitRepo then commitIdFromGitRepo gitRepo else null;
|
||||
description = ''
|
||||
The Git revision from which this Home Manager configuration was built.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -109,6 +109,7 @@ let
|
||||
./programs/mpv.nix
|
||||
./programs/msmtp.nix
|
||||
./programs/mu.nix
|
||||
./programs/mujmap.nix
|
||||
./programs/navi.nix
|
||||
./programs/ncmpcpp.nix
|
||||
./programs/ncspot.nix
|
||||
|
||||
@@ -8,8 +8,8 @@ msgstr ""
|
||||
"Project-Id-Version: Home Manager Modules\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
|
||||
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
|
||||
"PO-Revision-Date: 2022-03-26 23:57+0000\n"
|
||||
"Last-Translator: Robert Helgesson <robert@rycee.net>\n"
|
||||
"PO-Revision-Date: 2022-05-18 23:12+0000\n"
|
||||
"Last-Translator: Naïm Camille Favier <n@monade.li>\n"
|
||||
"Language-Team: French <https://hosted.weblate.org/projects/home-manager/"
|
||||
"modules/fr/>\n"
|
||||
"Language: fr\n"
|
||||
@@ -17,7 +17,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 4.12-dev\n"
|
||||
"X-Generator: Weblate 4.13-dev\n"
|
||||
|
||||
#: modules/files.nix:233
|
||||
msgid "Creating home file links in %s"
|
||||
@@ -53,11 +53,11 @@ msgstr ""
|
||||
"Oups, Nix n'a pas réussi à installer votre nouveau profil de Home Manager !\n"
|
||||
"\n"
|
||||
"Il y a peut-être un conflit avec un autre paquet qui a été installé avec\n"
|
||||
"« %s » ? Essayez d'éxecuter\n"
|
||||
"« %s » ? Essayez d'exécuter\n"
|
||||
"\n"
|
||||
" %s\n"
|
||||
"\n"
|
||||
"et s'il y a un paquet en conflict, vous pourrez le supprimer avec\n"
|
||||
"et s'il y a un paquet en conflit, vous pourrez le supprimer avec\n"
|
||||
"\n"
|
||||
" %s\n"
|
||||
"\n"
|
||||
@@ -69,7 +69,7 @@ msgstr "Activation de %s"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:31
|
||||
msgid "Sanity checking oldGenNum and oldGenPath"
|
||||
msgstr "Vérification rationnelle de oldGenNum et oldGenPath"
|
||||
msgstr "Vérification de oldGenNum et oldGenPath"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:34
|
||||
msgid ""
|
||||
@@ -86,20 +86,20 @@ msgid ""
|
||||
"\n"
|
||||
"and trying home-manager switch again. Good luck!"
|
||||
msgstr ""
|
||||
"Le numéro et le chemin de la génération dernière sont en conflit ! Ils "
|
||||
"Le numéro et le chemin de la génération précédente sont en conflit ! Ils "
|
||||
"doivent\n"
|
||||
"être vides ou les deux mis à\n"
|
||||
"\n"
|
||||
" '%s' et '%s'\n"
|
||||
"\n"
|
||||
"Si ça ne vous dérange pas de perdre la génération dernière, la solution la "
|
||||
"plus\n"
|
||||
"Si ça ne vous dérange pas de perdre les générations précédentes, la solution "
|
||||
"la plus\n"
|
||||
"simple est probablement d'exécuter\n"
|
||||
"\n"
|
||||
" rm %s/home-manager*\n"
|
||||
" rm %s/current-home\n"
|
||||
"\n"
|
||||
"et d'essayer encore home-manager switch. Bonne chance !"
|
||||
"et de réessayer home-manager switch. Bonne chance !"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:51
|
||||
msgid "Starting Home Manager activation"
|
||||
@@ -107,19 +107,19 @@ msgstr "Démarrage de l'activation de Home Manager"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:55
|
||||
msgid "Sanity checking Nix"
|
||||
msgstr "Vérification rationnelle de Nix"
|
||||
msgstr "Vérification de Nix"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:61
|
||||
msgid "This is a dry run"
|
||||
msgstr "Ceci est une course à sec"
|
||||
msgstr "Ceci est une fausse activation (essai à blanc)"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:64
|
||||
msgid "This is a live run"
|
||||
msgstr "Ceci est une course réelle"
|
||||
msgstr "Ceci est une vraie activation"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:69
|
||||
msgid "Using Nix version: %s"
|
||||
msgstr "Usage de la version de Nix : %s"
|
||||
msgstr "Version de Nix : %s"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:72
|
||||
msgid "Activation variables:"
|
||||
|
||||
@@ -8,8 +8,8 @@ msgstr ""
|
||||
"Project-Id-Version: Home Manager Modules\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
|
||||
"POT-Creation-Date: 2022-03-26 15:08+0100\n"
|
||||
"PO-Revision-Date: 2022-05-05 07:14+0000\n"
|
||||
"Last-Translator: Peng Guanwen <pg999w@outlook.com>\n"
|
||||
"PO-Revision-Date: 2022-05-16 13:18+0000\n"
|
||||
"Last-Translator: Yubo-Cao <Cao2006721@gmail.com>\n"
|
||||
"Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/"
|
||||
"home-manager/modules/zh_Hans/>\n"
|
||||
"Language: zh_Hans\n"
|
||||
@@ -17,7 +17,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Weblate 4.12.1\n"
|
||||
"X-Generator: Weblate 4.13-dev\n"
|
||||
|
||||
#: modules/files.nix:233
|
||||
msgid "Creating home file links in %s"
|
||||
@@ -50,6 +50,18 @@ msgid ""
|
||||
"\n"
|
||||
"Then try activating your Home Manager configuration again."
|
||||
msgstr ""
|
||||
"糟糕,Nix 未能安装您的新 Home Manager 配置文件!\n"
|
||||
"\n"
|
||||
"也许这里和使用 \"%s\" 安装的包有冲突?\n"
|
||||
"尝试运行\n"
|
||||
"\n"
|
||||
" %s\n"
|
||||
"\n"
|
||||
"如果有冲突的包,你可以用\n"
|
||||
"\n"
|
||||
" %s\n"
|
||||
"\n"
|
||||
"来移除。然后尝试再次激活您的 Home Manager 配置。"
|
||||
|
||||
#: modules/home-environment.nix:639
|
||||
msgid "Activating %s"
|
||||
|
||||
@@ -13,11 +13,15 @@ let
|
||||
|
||||
emacsWithPackages = emacsPackages.emacsWithPackages;
|
||||
|
||||
createConfPackage = epkgs:
|
||||
epkgs.trivialBuild {
|
||||
pname = "default";
|
||||
src = pkgs.writeText "default.el" cfg.extraConfig;
|
||||
};
|
||||
extraPackages = epkgs:
|
||||
let
|
||||
packages = cfg.extraPackages epkgs;
|
||||
userConfig = epkgs.trivialBuild {
|
||||
pname = "default";
|
||||
src = pkgs.writeText "default.el" cfg.extraConfig;
|
||||
packageRequires = packages;
|
||||
};
|
||||
in packages ++ optional (cfg.extraConfig != "") userConfig;
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.rycee ];
|
||||
@@ -91,10 +95,6 @@ in {
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.finalPackage ];
|
||||
programs.emacs = {
|
||||
finalPackage = emacsWithPackages cfg.extraPackages;
|
||||
extraPackages = epkgs:
|
||||
optional (cfg.extraConfig != "") (createConfPackage epkgs);
|
||||
};
|
||||
programs.emacs.finalPackage = emacsWithPackages extraPackages;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -14,10 +14,12 @@ let
|
||||
name = account.realName;
|
||||
default = account.primary;
|
||||
|
||||
inbox-folder = account.folders.inbox;
|
||||
sent-folder = account.folders.sent;
|
||||
draft-folder = account.folders.drafts;
|
||||
# NOTE: himalaya does not support configuring the name of the trash folder
|
||||
mailboxes = {
|
||||
inbox = account.folders.inbox;
|
||||
sent = account.folders.sent;
|
||||
draft = account.folders.drafts;
|
||||
# NOTE: himalaya does not support configuring the name of the trash folder
|
||||
};
|
||||
|
||||
# FIXME: does not support disabling TLS altogether
|
||||
# NOTE: does not accept sequence of strings for password commands
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (pkgs.stdenv.hostPlatform) isDarwin;
|
||||
|
||||
cfg = config.programs.htop;
|
||||
|
||||
@@ -73,6 +74,21 @@ let
|
||||
M_PSSWP = 120;
|
||||
};
|
||||
|
||||
defaultFields = with fields; [
|
||||
PID
|
||||
USER
|
||||
PRIORITY
|
||||
NICE
|
||||
M_SIZE
|
||||
M_RESIDENT
|
||||
M_SHARE
|
||||
STATE
|
||||
PERCENT_CPU
|
||||
PERCENT_MEM
|
||||
TIME
|
||||
COMM
|
||||
];
|
||||
|
||||
modes = {
|
||||
Bar = 1;
|
||||
Text = 2;
|
||||
@@ -154,20 +170,10 @@ in {
|
||||
|
||||
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
|
||||
];
|
||||
fields = if isDarwin then
|
||||
remove fields.M_SHARE defaultFields
|
||||
else
|
||||
defaultFields;
|
||||
};
|
||||
|
||||
before = optionalAttrs (cfg.settings ? header_layout) {
|
||||
|
||||
315
modules/programs/mujmap.nix
Normal file
315
modules/programs/mujmap.nix
Normal file
@@ -0,0 +1,315 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.mujmap;
|
||||
|
||||
mujmapAccounts =
|
||||
filter (a: a.mujmap.enable) (attrValues config.accounts.email.accounts);
|
||||
|
||||
missingNotmuchAccounts = map (a: a.name)
|
||||
(filter (a: !a.notmuch.enable && a.mujmap.notmuchSetupWarning)
|
||||
mujmapAccounts);
|
||||
|
||||
notmuchConfigHelp =
|
||||
map (name: "accounts.email.accounts.${name}.notmuch.enable = true;")
|
||||
missingNotmuchAccounts;
|
||||
|
||||
settingsFormat = pkgs.formats.toml { };
|
||||
|
||||
filterNull = attrs: attrsets.filterAttrs (n: v: v != null) attrs;
|
||||
|
||||
configFile = account:
|
||||
let
|
||||
settings'' = if (account.jmap == null) then
|
||||
{ }
|
||||
else
|
||||
filterNull {
|
||||
fqdn = account.jmap.host;
|
||||
session_url = account.jmap.sessionUrl;
|
||||
};
|
||||
|
||||
settings' = settings'' // {
|
||||
username = account.userName;
|
||||
password_command = escapeShellArgs account.passwordCommand;
|
||||
} // filterNull account.mujmap.settings;
|
||||
|
||||
settings = if (hasAttr "fqdn" settings') then
|
||||
(removeAttrs settings' [ "session_url" ])
|
||||
else
|
||||
settings';
|
||||
in {
|
||||
name = "${account.maildir.absPath}/mujmap.toml";
|
||||
value.source = settingsFormat.generate
|
||||
"mujmap-${lib.replaceStrings [ "@" ] [ "_at_" ] account.address}.toml"
|
||||
settings;
|
||||
};
|
||||
|
||||
tagsOpts = {
|
||||
lowercase = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
If true, translate all mailboxes to lowercase names when mapping to notmuch
|
||||
tags.
|
||||
'';
|
||||
};
|
||||
|
||||
directory_separator = mkOption {
|
||||
type = types.str;
|
||||
default = "/";
|
||||
example = ".";
|
||||
description = ''
|
||||
Directory separator for mapping notmuch tags to maildirs.
|
||||
'';
|
||||
};
|
||||
|
||||
inbox = mkOption {
|
||||
type = types.str;
|
||||
default = "inbox";
|
||||
description = ''
|
||||
Tag for notmuch to use for messages stored in the mailbox labeled with the
|
||||
<code>Inbox</code> name attribute.
|
||||
</para><para>
|
||||
If set to an empty string, this mailbox <emphasis>and its child
|
||||
mailboxes</emphasis> are not synchronized with a tag.
|
||||
'';
|
||||
};
|
||||
|
||||
deleted = mkOption {
|
||||
type = types.str;
|
||||
default = "deleted";
|
||||
description = ''
|
||||
Tag for notmuch to use for messages stored in the mailbox labeled with the
|
||||
<code>Trash</code> name attribute.
|
||||
</para><para>
|
||||
If set to an empty string, this mailbox <emphasis>and its child
|
||||
mailboxes</emphasis> are not synchronized with a tag.
|
||||
'';
|
||||
};
|
||||
|
||||
sent = mkOption {
|
||||
type = types.str;
|
||||
default = "sent";
|
||||
description = ''
|
||||
Tag for notmuch to use for messages stored in the mailbox labeled with the
|
||||
<code>Sent</code> name attribute.
|
||||
</para><para>
|
||||
If set to an empty string, this mailbox <emphasis>and its child
|
||||
mailboxes</emphasis> are not synchronized with a tag.
|
||||
'';
|
||||
};
|
||||
|
||||
spam = mkOption {
|
||||
type = types.str;
|
||||
default = "spam";
|
||||
description = ''
|
||||
Tag for notmuch to use for messages stored in the mailbox labeled with the
|
||||
<code>Junk</code> name attribute and/or with the <code>$Junk</code> keyword,
|
||||
<emphasis>except</emphasis> for messages with the <code>$NotJunk</code> keyword.
|
||||
</para><para>
|
||||
If set to an empty string, this mailbox, <emphasis>its child
|
||||
mailboxes</emphasis>, and these keywords are not synchronized with a tag.
|
||||
'';
|
||||
};
|
||||
|
||||
important = mkOption {
|
||||
type = types.str;
|
||||
default = "important";
|
||||
description = ''
|
||||
Tag for notmuch to use for messages stored in the mailbox labeled with the
|
||||
<code>Important</code> name attribute and/or with the <code>$Important</code>
|
||||
keyword.
|
||||
</para><para>
|
||||
If set to an empty string, this mailbox, <emphasis>its child
|
||||
mailboxes</emphasis>, and these keywords are not synchronized with a tag.
|
||||
'';
|
||||
};
|
||||
|
||||
phishing = mkOption {
|
||||
type = types.str;
|
||||
default = "phishing";
|
||||
description = ''
|
||||
Tag for notmuch to use for the IANA <code>$Phishing</code> keyword.
|
||||
</para><para>
|
||||
If set to an empty string, this keyword is not synchronized with a tag.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
rootOpts = {
|
||||
username = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
example = "alice@example.com";
|
||||
description = ''
|
||||
Username for basic HTTP authentication.
|
||||
</para><para>
|
||||
If <literal>null</literal>, defaults to
|
||||
<xref linkend="opt-accounts.email.accounts._name_.userName"/>.
|
||||
'';
|
||||
};
|
||||
|
||||
password_command = mkOption {
|
||||
type = types.nullOr (types.either types.str (types.listOf types.str));
|
||||
default = null;
|
||||
apply = p: if isList p then escapeShellArgs p else p;
|
||||
example = "pass alice@example.com";
|
||||
description = ''
|
||||
Shell command which will print a password to stdout for basic HTTP
|
||||
authentication.
|
||||
</para><para>
|
||||
If <literal>null</literal>, defaults to
|
||||
<xref linkend="opt-accounts.email.accounts._name_.passwordCommand"/>.
|
||||
'';
|
||||
};
|
||||
|
||||
fqdn = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
example = "example.com";
|
||||
description = ''
|
||||
Fully qualified domain name of the JMAP service.
|
||||
</para><para>
|
||||
mujmap looks up the JMAP SRV record for this host to determine the JMAP session
|
||||
URL. Mutually exclusive with
|
||||
<xref linkend="opt-accounts.email.accounts._name_.mujmap.settings.session_url"/>.
|
||||
</para><para>
|
||||
If <literal>null</literal>, defaults to
|
||||
<xref linkend="opt-accounts.email.accounts._name_.jmap.host"/>.
|
||||
'';
|
||||
};
|
||||
|
||||
session_url = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
example = "https://jmap.example.com/.well-known/jmap";
|
||||
description = ''
|
||||
Sesion URL to connect to.
|
||||
</para><para>
|
||||
Mutually exclusive with
|
||||
<xref linkend="opt-accounts.email.accounts._name_.mujmap.settings.fqdn"/>.
|
||||
</para><para>
|
||||
If <literal>null</literal>, defaults to
|
||||
<xref linkend="opt-accounts.email.accounts._name_.jmap.sessionUrl"/>.
|
||||
'';
|
||||
};
|
||||
|
||||
auto_create_new_mailboxes = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to create new mailboxes automatically on the server from notmuch
|
||||
tags.
|
||||
'';
|
||||
};
|
||||
|
||||
cache_dir = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
The cache directory in which to store mail files while they are being
|
||||
downloaded. The default is operating-system specific.
|
||||
'';
|
||||
};
|
||||
|
||||
tags = mkOption {
|
||||
type = types.submodule {
|
||||
freeformType = settingsFormat.type;
|
||||
options = tagsOpts;
|
||||
};
|
||||
default = { };
|
||||
description = ''
|
||||
Tag configuration.
|
||||
</para><para>
|
||||
Beware that there are quirks that require manual consideration if changing the
|
||||
values of these files; please see
|
||||
<link xlink:href="https://github.com/elizagamedev/mujmap/blob/main/mujmap.toml.example"/>
|
||||
for more details.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
mujmapOpts = {
|
||||
enable = mkEnableOption "mujmap JMAP 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 <filename>mujmap.toml</filename> is managed
|
||||
outside of Home Manager.
|
||||
'';
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = types.submodule {
|
||||
freeformType = settingsFormat.type;
|
||||
options = rootOpts;
|
||||
};
|
||||
default = { };
|
||||
description = ''
|
||||
Settings which are applied to <filename>mujmap.toml</filename>
|
||||
for the account.
|
||||
</para><para>
|
||||
See the <link xlink:href="https://github.com/elizagamedev/mujmap">mujmap project</link>
|
||||
for documentation of settings not explicitly covered by this module.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
mujmapModule = types.submodule { options = { mujmap = mujmapOpts; }; };
|
||||
in {
|
||||
meta.maintainers = with maintainers; [ elizagamedev ];
|
||||
|
||||
options = {
|
||||
programs.mujmap = {
|
||||
enable = mkEnableOption "mujmap Gmail synchronization for notmuch";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.mujmap;
|
||||
defaultText = "pkgs.mujmap";
|
||||
description = ''
|
||||
mujmap package to use.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
accounts.email.accounts =
|
||||
mkOption { type = with types; attrsOf mujmapModule; };
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf (missingNotmuchAccounts != [ ]) {
|
||||
warnings = [''
|
||||
mujmap is enabled for the following email accounts, but notmuch is not:
|
||||
|
||||
${concatStringsSep "\n " missingNotmuchAccounts}
|
||||
|
||||
Notmuch can be enabled with:
|
||||
|
||||
${concatStringsSep "\n " notmuchConfigHelp}
|
||||
|
||||
If you have configured notmuch outside of Home Manager, you can suppress this
|
||||
warning with:
|
||||
|
||||
programs.mujmap.notmuchSetupWarning = false;
|
||||
''];
|
||||
})
|
||||
|
||||
{
|
||||
warnings = flatten (map (account: account.warnings) mujmapAccounts);
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
# Notmuch should ignore non-mail files created by mujmap.
|
||||
programs.notmuch.new.ignore = [ "/.*[.](toml|json|lock)$/" ];
|
||||
|
||||
home.file = listToAttrs (map configFile mujmapAccounts);
|
||||
}
|
||||
]);
|
||||
}
|
||||
@@ -66,7 +66,7 @@ let
|
||||
|
||||
allPlugins = cfg.plugins ++ optional cfg.coc.enable {
|
||||
type = "viml";
|
||||
plugin = pkgs.vimPlugins.coc-nvim;
|
||||
plugin = cfg.coc.package;
|
||||
config = cfg.coc.pluginConfig;
|
||||
optional = false;
|
||||
};
|
||||
@@ -302,6 +302,13 @@ in {
|
||||
coc = {
|
||||
enable = mkEnableOption "Coc";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.vimPlugins.coc-nvim;
|
||||
defaultText = literalExpression "pkgs.vimPlugins.coc-nvim";
|
||||
description = "The package to use for the CoC plugin.";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = jsonFormat.type;
|
||||
default = { };
|
||||
|
||||
@@ -21,6 +21,8 @@ let
|
||||
host = cfg.mpd.host;
|
||||
port = cfg.mpd.port;
|
||||
music_dir = cfg.mpd.musicDirectory;
|
||||
} // optionalAttrs (cfg.mpd.password != null) {
|
||||
password = cfg.mpd.password;
|
||||
};
|
||||
|
||||
Bling = {
|
||||
@@ -70,6 +72,14 @@ in {
|
||||
If set, mpDris2 will use this directory to access music artwork.
|
||||
'';
|
||||
};
|
||||
|
||||
password = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
The password to connect to MPD.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -77,11 +87,6 @@ in {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.mpdris2" pkgs
|
||||
lib.platforms.linux)
|
||||
|
||||
{
|
||||
assertion = config.services.mpd.enable;
|
||||
message = "The mpdris2 module requires 'services.mpd.enable = true'.";
|
||||
}
|
||||
];
|
||||
|
||||
xdg.configFile."mpDris2/mpDris2.conf".text = toIni mpdris2Conf;
|
||||
|
||||
@@ -10,9 +10,7 @@ let
|
||||
settingsFormat = pkgs.formats.ini { };
|
||||
|
||||
in {
|
||||
meta = {
|
||||
maintainers = with maintainers; [ rycee petabyteboy thiagokokada ];
|
||||
};
|
||||
meta.maintainers = with maintainers; [ rycee thiagokokada ];
|
||||
|
||||
imports = let
|
||||
mkRenamed = old: new:
|
||||
|
||||
@@ -8,6 +8,8 @@ let
|
||||
|
||||
profileDirectory = config.home.profileDirectory;
|
||||
|
||||
nixPkg = if config.nix.package == null then pkgs.nix else config.nix.package;
|
||||
|
||||
in {
|
||||
imports = [
|
||||
(mkRenamedOptionModule [ "targets" "genericLinux" "extraXdgDataDirs" ] [
|
||||
@@ -55,7 +57,7 @@ in {
|
||||
};
|
||||
|
||||
home.sessionVariablesExtra = ''
|
||||
. "${pkgs.nix}/etc/profile.d/nix.sh"
|
||||
. "${nixPkg}/etc/profile.d/nix.sh"
|
||||
|
||||
# reset TERM with new TERMINFO available (if any)
|
||||
export TERM="$TERM"
|
||||
@@ -64,7 +66,7 @@ in {
|
||||
# We need to source both nix.sh and hm-session-vars.sh as noted in
|
||||
# https://github.com/nix-community/home-manager/pull/797#issuecomment-544783247
|
||||
programs.bash.initExtra = ''
|
||||
. "${pkgs.nix}/etc/profile.d/nix.sh"
|
||||
. "${nixPkg}/etc/profile.d/nix.sh"
|
||||
. "${profileDirectory}/etc/profile.d/hm-session-vars.sh"
|
||||
'';
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ import nmt {
|
||||
./modules/programs/mbsync
|
||||
./modules/programs/mpv
|
||||
./modules/programs/mu
|
||||
./modules/programs/mujmap
|
||||
./modules/programs/ncmpcpp
|
||||
./modules/programs/ne
|
||||
./modules/programs/neomutt
|
||||
@@ -155,6 +156,7 @@ import nmt {
|
||||
./modules/services/lieer
|
||||
./modules/services/mopidy
|
||||
./modules/services/mpd
|
||||
./modules/services/mpdris2
|
||||
./modules/services/pantalaimon
|
||||
./modules/services/pbgopy
|
||||
./modules/services/picom
|
||||
|
||||
@@ -5,16 +5,32 @@ let
|
||||
testScript = pkgs.writeText "test.el" ''
|
||||
;; Emacs won't automatically load default.el when --script is specified
|
||||
(load "default")
|
||||
(kill-emacs (if (eq hm 'home-manager) 0 1))
|
||||
(let* ((test-load-config (eq hm 'home-manager))
|
||||
(test-load-package (eq (hm-test-fn) 'success))
|
||||
(is-ok (and test-load-config test-load-package)))
|
||||
(kill-emacs (if is-ok 0 1)))
|
||||
'';
|
||||
|
||||
emacsBin = "${config.programs.emacs.finalPackage}/bin/emacs";
|
||||
|
||||
mkTestPackage = epkgs:
|
||||
epkgs.trivialBuild {
|
||||
pname = "hm-test";
|
||||
src = pkgs.writeText "hm-test.el" ''
|
||||
(defun hm-test-fn () 'success)
|
||||
(provide 'hm-test)
|
||||
'';
|
||||
};
|
||||
|
||||
in lib.mkIf config.test.enableBig {
|
||||
programs.emacs = {
|
||||
enable = true;
|
||||
package = pkgs.emacs-nox;
|
||||
extraConfig = "(setq hm 'home-manager)";
|
||||
extraConfig = ''
|
||||
(require 'hm-test)
|
||||
(setq hm 'home-manager)
|
||||
'';
|
||||
extraPackages = epkgs: [ (mkTestPackage epkgs) ];
|
||||
};
|
||||
|
||||
# running emacs with --script would enable headless mode
|
||||
|
||||
@@ -4,18 +4,20 @@ name = ""
|
||||
["hm@example.com"]
|
||||
default = true
|
||||
default-page-size = 50
|
||||
draft-folder = "Drafts"
|
||||
email = "hm@example.com"
|
||||
imap-host = "imap.example.com"
|
||||
imap-login = "home.manager"
|
||||
imap-passwd-cmd = "'password-command'"
|
||||
imap-port = 995
|
||||
imap-starttls = false
|
||||
inbox-folder = "In"
|
||||
name = "H. M. Test"
|
||||
sent-folder = "Out"
|
||||
smtp-host = "smtp.example.com"
|
||||
smtp-login = "home.manager"
|
||||
smtp-passwd-cmd = "'password-command'"
|
||||
smtp-port = 465
|
||||
smtp-starttls = false
|
||||
|
||||
["hm@example.com".mailboxes]
|
||||
draft = "Drafts"
|
||||
inbox = "In"
|
||||
sent = "Out"
|
||||
|
||||
@@ -17,7 +17,12 @@ with lib;
|
||||
|
||||
# Test that the 'fields' key is written in addition to the customized
|
||||
# settings or htop won't read the options.
|
||||
nmt.script = ''
|
||||
nmt.script = let
|
||||
fields = if pkgs.stdenv.hostPlatform.isDarwin then
|
||||
"0 48 17 18 38 39 2 46 47 49 1"
|
||||
else
|
||||
"0 48 17 18 38 39 40 2 46 47 49 1";
|
||||
in ''
|
||||
htoprc=home-files/.config/htop/htoprc
|
||||
assertFileExists $htoprc
|
||||
assertFileContent $htoprc \
|
||||
@@ -28,7 +33,7 @@ with lib;
|
||||
column_meters_1=Tasks LoadAverage Uptime Systemd
|
||||
column_meters_modes_0=1 1 1 2
|
||||
column_meters_modes_1=2 2 2 2
|
||||
fields=0 48 17 18 38 39 40 2 46 47 49 1
|
||||
fields=${fields}
|
||||
''
|
||||
}
|
||||
'';
|
||||
|
||||
@@ -11,14 +11,19 @@ with lib;
|
||||
|
||||
# Test that the 'fields' key is written in addition to the customized
|
||||
# settings or htop won't read the options.
|
||||
nmt.script = ''
|
||||
nmt.script = let
|
||||
fields = if pkgs.stdenv.hostPlatform.isDarwin then
|
||||
"0 48 17 18 38 39 2 46 47 49 1"
|
||||
else
|
||||
"0 48 17 18 38 39 40 2 46 47 49 1";
|
||||
in ''
|
||||
htoprc=home-files/.config/htop/htoprc
|
||||
assertFileExists $htoprc
|
||||
assertFileContent $htoprc \
|
||||
${
|
||||
builtins.toFile "htoprc-expected" ''
|
||||
color_scheme=6
|
||||
fields=0 48 17 18 38 39 40 2 46 47 49 1
|
||||
fields=${fields}
|
||||
''
|
||||
}
|
||||
'';
|
||||
|
||||
5
tests/modules/programs/mujmap/default.nix
Normal file
5
tests/modules/programs/mujmap/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
mujmap-defaults = ./mujmap-defaults.nix;
|
||||
mujmap-fqdn-and-session-url-specified =
|
||||
./mujmap-fqdn-and-session-url-specified.nix;
|
||||
}
|
||||
14
tests/modules/programs/mujmap/mujmap-defaults-expected.toml
Normal file
14
tests/modules/programs/mujmap/mujmap-defaults-expected.toml
Normal file
@@ -0,0 +1,14 @@
|
||||
auto_create_new_mailboxes = true
|
||||
fqdn = "example.com"
|
||||
password_command = "'password-command'"
|
||||
username = "home.manager"
|
||||
|
||||
[tags]
|
||||
deleted = "deleted"
|
||||
directory_separator = "/"
|
||||
important = "important"
|
||||
inbox = "inbox"
|
||||
lowercase = false
|
||||
phishing = "phishing"
|
||||
sent = "sent"
|
||||
spam = "spam"
|
||||
25
tests/modules/programs/mujmap/mujmap-defaults.nix
Normal file
25
tests/modules/programs/mujmap/mujmap-defaults.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports = [ ../../accounts/email-test-accounts.nix ];
|
||||
|
||||
config = {
|
||||
programs.mujmap.enable = true;
|
||||
programs.mujmap.package = config.lib.test.mkStubPackage { };
|
||||
|
||||
accounts.email.accounts."hm@example.com" = {
|
||||
jmap.host = "example.com";
|
||||
mujmap.enable = true;
|
||||
notmuch.enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/Mail/hm@example.com/mujmap.toml
|
||||
assertFileContent home-files/Mail/hm@example.com/mujmap.toml ${
|
||||
./mujmap-defaults-expected.toml
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports = [ ../../accounts/email-test-accounts.nix ];
|
||||
|
||||
config = {
|
||||
programs.mujmap.enable = true;
|
||||
programs.mujmap.package = config.lib.test.mkStubPackage { };
|
||||
|
||||
accounts.email.accounts."hm@example.com" = {
|
||||
jmap.host = "example.com";
|
||||
jmap.sessionUrl = "https://jmap.example.com/";
|
||||
mujmap.enable = true;
|
||||
notmuch.enable = true;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/Mail/hm@example.com/mujmap.toml
|
||||
assertFileContent home-files/Mail/hm@example.com/mujmap.toml ${
|
||||
./mujmap-defaults-expected.toml
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
[Bling]
|
||||
mmkeys = True
|
||||
notify = True
|
||||
|
||||
[Connection]
|
||||
host = 127.0.0.1
|
||||
music_dir = /home/hm-user/music
|
||||
port = 6600
|
||||
19
tests/modules/services/mpdris2/basic-configuration.nix
Normal file
19
tests/modules/services/mpdris2/basic-configuration.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.mpdris2 = {
|
||||
enable = true;
|
||||
notifications = true;
|
||||
multimediaKeys = true;
|
||||
};
|
||||
|
||||
test.stubs.mpdris2 = { };
|
||||
|
||||
nmt.script = ''
|
||||
serviceFile=home-files/.config/systemd/user/mpdris2.service
|
||||
assertFileContent "$serviceFile" ${./basic-configuration.service}
|
||||
|
||||
configFile=home-files/.config/mpDris2/mpDris2.conf
|
||||
assertFileContent "$configFile" ${./basic-configuration.config}
|
||||
'';
|
||||
}
|
||||
13
tests/modules/services/mpdris2/basic-configuration.service
Normal file
13
tests/modules/services/mpdris2/basic-configuration.service
Normal file
@@ -0,0 +1,13 @@
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
|
||||
[Service]
|
||||
BusName=org.mpris.MediaPlayer2.mpd
|
||||
ExecStart=@mpdris2@/bin/mpDris2
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
Type=simple
|
||||
|
||||
[Unit]
|
||||
After=mpd.service
|
||||
Description=MPRIS 2 support for MPD
|
||||
4
tests/modules/services/mpdris2/default.nix
Normal file
4
tests/modules/services/mpdris2/default.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
mpdris2-basic-configuration = ./basic-configuration.nix;
|
||||
mpdris2-with-password = ./with-password.nix;
|
||||
}
|
||||
9
tests/modules/services/mpdris2/with-password.config
Normal file
9
tests/modules/services/mpdris2/with-password.config
Normal file
@@ -0,0 +1,9 @@
|
||||
[Bling]
|
||||
mmkeys = False
|
||||
notify = False
|
||||
|
||||
[Connection]
|
||||
host = somehost
|
||||
music_dir = /home/hm-user/music
|
||||
password = foo
|
||||
port = 42
|
||||
22
tests/modules/services/mpdris2/with-password.nix
Normal file
22
tests/modules/services/mpdris2/with-password.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.mpdris2 = {
|
||||
enable = true;
|
||||
mpd = {
|
||||
host = "somehost";
|
||||
port = 42;
|
||||
password = "foo";
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.mpdris2 = { };
|
||||
|
||||
nmt.script = ''
|
||||
serviceFile=home-files/.config/systemd/user/mpdris2.service
|
||||
assertFileContent "$serviceFile" ${./basic-configuration.service}
|
||||
|
||||
configFile=home-files/.config/mpDris2/mpDris2.conf
|
||||
assertFileContent "$configFile" ${./with-password.config}
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user