mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
Compare commits
130 Commits
update/mai
...
cd6e96d56e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd6e96d56e | ||
|
|
b1b1c68033 | ||
|
|
081234b704 | ||
|
|
2be878259a | ||
|
|
fa6de26b4d | ||
|
|
9fff37e6ff | ||
|
|
a2cc7b0bab | ||
|
|
37158e5267 | ||
|
|
cd74467526 | ||
|
|
72476602b9 | ||
|
|
e926e27968 | ||
|
|
db116ceb76 | ||
|
|
f7b2bdf042 | ||
|
|
a1a11393d9 | ||
|
|
802ce0a7b1 | ||
|
|
e69fbc243a | ||
|
|
ebab435f3e | ||
|
|
bacad23b8c | ||
|
|
6067be4770 | ||
|
|
12a723df97 | ||
|
|
40deed4ffe | ||
|
|
9500721e96 | ||
|
|
db105fadc4 | ||
|
|
609846bfd2 | ||
|
|
2db6bcc7ca | ||
|
|
a3ac4bb1f8 | ||
|
|
47db0fde35 | ||
|
|
3351348827 | ||
|
|
7688293f06 | ||
|
|
92394f9dea | ||
|
|
fb6a8404ee | ||
|
|
9afe77a70b | ||
|
|
246b8eaffb | ||
|
|
f9ce7c5234 | ||
|
|
d1da1de5c2 | ||
|
|
af7f14ddf7 | ||
|
|
46c9af8a92 | ||
|
|
a630bbdedd | ||
|
|
86e0f6f227 | ||
|
|
d4c406cfa8 | ||
|
|
4fee4bd14b | ||
|
|
c068188a8e | ||
|
|
bdaa374383 | ||
|
|
d28cc9f4a6 | ||
|
|
a97b0a0999 | ||
|
|
a4a571c2d6 | ||
|
|
aea57993a8 | ||
|
|
1c7be243ea | ||
|
|
93da26b426 | ||
|
|
0d3183953c | ||
|
|
4e8b7bef66 | ||
|
|
6e94d8157c | ||
|
|
6e3931c01f | ||
|
|
c91dbdf61a | ||
|
|
38e187fd2f | ||
|
|
9bfca5b3a7 | ||
|
|
bfaba198af | ||
|
|
b1421bdfe5 | ||
|
|
4cd7ae4cd4 | ||
|
|
e43f7c3321 | ||
|
|
6841643203 | ||
|
|
a755d94ab0 | ||
|
|
33fe25dbe5 | ||
|
|
337d3602c0 | ||
|
|
5d814af6af | ||
|
|
787784fb6f | ||
|
|
2379f704b0 | ||
|
|
a26335db1b | ||
|
|
d016674f6a | ||
|
|
c2d3a75ebe | ||
|
|
93af99ec02 | ||
|
|
c8b68aafed | ||
|
|
bca7415de4 | ||
|
|
d070d83048 | ||
|
|
048104c098 | ||
|
|
af894fbbc7 | ||
|
|
53084c95ce | ||
|
|
a65c04965c | ||
|
|
c4eabb884b | ||
|
|
156b698b75 | ||
|
|
9d1c71f390 | ||
|
|
47e195783e | ||
|
|
f894bc4ffd | ||
|
|
73f5a5ecc9 | ||
|
|
7d5927b63c | ||
|
|
8f7d6bacb6 | ||
|
|
12cc14271b | ||
|
|
c211298f7e | ||
|
|
1cfa305fba | ||
|
|
3e87b442b5 | ||
|
|
99a037de18 | ||
|
|
3b3164dfe3 | ||
|
|
bc43546503 | ||
|
|
78a8fae57f | ||
|
|
b558d54215 | ||
|
|
9ef24320f1 | ||
|
|
18f9d668aa | ||
|
|
2f06b72606 | ||
|
|
d4e4d5cfa3 | ||
|
|
e4e78a2cbe | ||
|
|
ae1ea768ef | ||
|
|
365cbc13c4 | ||
|
|
d99b4ca5de | ||
|
|
64f4dadb80 | ||
|
|
7a7b43c723 | ||
|
|
a84cccefd4 | ||
|
|
9d32c214db | ||
|
|
87785ddbc7 | ||
|
|
113b155fe8 | ||
|
|
398bc87bc8 | ||
|
|
3613abcbd7 | ||
|
|
d7e794fe12 | ||
|
|
8969535f1c | ||
|
|
80cca72314 | ||
|
|
d2e0458d65 | ||
|
|
b3ae822959 | ||
|
|
d761c0ce89 | ||
|
|
f84f474c1b | ||
|
|
ea6dfabe3c | ||
|
|
5432dc5bc4 | ||
|
|
bec08ef6e3 | ||
|
|
4067ca1ffb | ||
|
|
2d36a6de2f | ||
|
|
91cdb0e2d5 | ||
|
|
7eca7f7081 | ||
|
|
20728df08f | ||
|
|
af3c24de76 | ||
|
|
624c7e80fb | ||
|
|
9c790e687e | ||
|
|
2f93d7333e |
5
.github/workflows/validate-maintainers.yml
vendored
5
.github/workflows/validate-maintainers.yml
vendored
@@ -1,7 +1,10 @@
|
||||
name: Validate maintainers.nix
|
||||
on:
|
||||
pull_request:
|
||||
paths: ["modules/lib/maintainers.nix"]
|
||||
paths:
|
||||
- "modules/lib/maintainers.nix"
|
||||
- "flake.lock"
|
||||
- "all-maintainers.nix"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
run_tests:
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2025 Home Manager contributors
|
||||
Copyright (c) 2017-2026 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
|
||||
|
||||
2
Makefile
2
Makefile
@@ -17,4 +17,4 @@ test-install:
|
||||
HOME=$(shell mktemp -d) NIX_PATH=${NIX_PATH} nix-shell . -A install
|
||||
|
||||
format:
|
||||
nix-shell -p treefmt nixfmt deadnix keep-sorted --run "treefmt --config-file ./treefmt.toml"
|
||||
nix-shell -p treefmt nixfmt deadnix keep-sorted nixf-diagnose --run "treefmt --config-file ./treefmt.toml"
|
||||
|
||||
@@ -19,6 +19,11 @@
|
||||
email = "da157@voidq.com";
|
||||
github = "0xda157";
|
||||
githubId = 153149335;
|
||||
keys = [
|
||||
{
|
||||
fingerprint = "5A66 FF95 36DE B501 DDD2 1647 B7AC 1B10 365D 45FF";
|
||||
}
|
||||
];
|
||||
matrix = "@da157:catgirl.cloud";
|
||||
name = "0xda157";
|
||||
source = "nixpkgs";
|
||||
@@ -65,14 +70,6 @@
|
||||
name = "Alex";
|
||||
source = "home-manager";
|
||||
};
|
||||
AndersonTorres = {
|
||||
email = "torres.anderson.85@protonmail.com";
|
||||
github = "AndersonTorres";
|
||||
githubId = 5954806;
|
||||
matrix = "@anderson_torres:matrix.org";
|
||||
name = "Anderson Torres";
|
||||
source = "nixpkgs";
|
||||
};
|
||||
AndreasMager = {
|
||||
email = "andreas@mager.eu";
|
||||
github = "AndreasMager";
|
||||
@@ -1097,19 +1094,6 @@
|
||||
name = "Hoang Nguyen";
|
||||
source = "home-manager";
|
||||
};
|
||||
foo-dogsquared = {
|
||||
email = "foodogsquared@foodogsquared.one";
|
||||
github = "foo-dogsquared";
|
||||
githubId = 34962634;
|
||||
keys = [
|
||||
{
|
||||
fingerprint = "DDD7 D0BD 602E 564B AA04 FC35 1431 0D91 4115 2B92";
|
||||
}
|
||||
];
|
||||
matrix = "@foodogsquared:matrix.org";
|
||||
name = "Gabriel Arazas";
|
||||
source = "nixpkgs";
|
||||
};
|
||||
fpob = {
|
||||
email = "fpob@proton.me";
|
||||
github = "fpob";
|
||||
@@ -1773,7 +1757,7 @@
|
||||
github = "nickthegroot";
|
||||
githubId = 1966472;
|
||||
name = "Nick DeGroot";
|
||||
source = "home-manager";
|
||||
source = "nixpkgs";
|
||||
};
|
||||
nikp123 = {
|
||||
email = "nikp123@users.noreply.github.com";
|
||||
@@ -2025,7 +2009,7 @@
|
||||
github = "rrvsh";
|
||||
githubId = 20300874;
|
||||
name = "Mohammad Rafiq";
|
||||
source = "home-manager";
|
||||
source = "nixpkgs";
|
||||
};
|
||||
rszamszur = {
|
||||
email = "radoslawszamszur@gmail.com";
|
||||
@@ -2078,7 +2062,7 @@
|
||||
source = "nixpkgs";
|
||||
};
|
||||
shikanime = {
|
||||
email = "deva.shikanime@protonmail.com";
|
||||
email = "william.phetsinorath@shikanime.studio";
|
||||
github = "shikanime";
|
||||
githubId = 22115108;
|
||||
name = "William Phetsinorath";
|
||||
|
||||
@@ -110,8 +110,7 @@ let
|
||||
in
|
||||
pkgs.buildPackages.nixosOptionsDoc (
|
||||
{
|
||||
options =
|
||||
if includeModuleSystemOptions then options else builtins.removeAttrs options [ "_module" ];
|
||||
options = if includeModuleSystemOptions then options else removeAttrs options [ "_module" ];
|
||||
transformOptions =
|
||||
opt:
|
||||
opt
|
||||
@@ -133,7 +132,7 @@ let
|
||||
) opt.declarations;
|
||||
};
|
||||
}
|
||||
// builtins.removeAttrs args [
|
||||
// removeAttrs args [
|
||||
"modules"
|
||||
"includeModuleSystemOptions"
|
||||
]
|
||||
|
||||
@@ -17,8 +17,11 @@ way. In Bash and Z shell this can be done by adding
|
||||
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 [the foreign-env
|
||||
plugin](https://github.com/oh-my-fish/plugin-foreign-env)
|
||||
plugin](https://github.com/oh-my-fish/plugin-foreign-env) or using the builtin
|
||||
[babelfish](https://github.com/bouk/babelfish)-translated variables:
|
||||
|
||||
``` bash
|
||||
fenv source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" > /dev/null
|
||||
# or
|
||||
source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.fish"
|
||||
```
|
||||
|
||||
@@ -57,3 +57,9 @@ changes are only active if the `home.stateVersion` option is set to
|
||||
|
||||
now default to `true` which is consistent with the default values
|
||||
for those options used by `i3` and `sway`.
|
||||
|
||||
- The [](#opt-programs.swaylock.enable) option now defaults to `false`
|
||||
and must be explicitly enabled. Previously, it would be implicitly
|
||||
enabled when `programs.swaylock.settings` was non-empty. Users with
|
||||
`home.stateVersion` set to earlier versions will continue to get the
|
||||
old implicit behavior.
|
||||
|
||||
@@ -27,4 +27,8 @@ The state version in this release includes the changes below. These
|
||||
changes are only active if the `home.stateVersion` option is set to
|
||||
\"25.05\" or later.
|
||||
|
||||
- No changes.
|
||||
- The [](#opt-programs.git.signing.format) option no longer defaults to
|
||||
`"openpgp"`. Users who use Git signing with GPG should explicitly set
|
||||
this option to `"openpgp"` to maintain the previous behavior. Users
|
||||
with `home.stateVersion` set to earlier versions will continue to get
|
||||
the `"openpgp"` default for backwards compatibility.
|
||||
|
||||
@@ -80,3 +80,10 @@ changes are only active if the `home.stateVersion` option is set to
|
||||
`{ PASSWORD_STORE_DIR = $XDG_DATA_HOME/password-store; }` anymore by its
|
||||
default value. This will revert to the default behaviour of the program,
|
||||
namely `$HOME/.password-store` to be used as the store path.
|
||||
|
||||
- On macOS, [](#opt-targets.darwin.copyApps.enable) is now enabled by
|
||||
default instead of [](#opt-targets.darwin.linkApps.enable). This means
|
||||
applications from `home.packages` will be copied to
|
||||
`~/Applications/Home Manager Apps` rather than symlinked, making them
|
||||
work properly with Spotlight. Users with `home.stateVersion` set to
|
||||
earlier versions will continue to use `linkApps` by default.
|
||||
|
||||
@@ -7,11 +7,19 @@ section is therefore not final.
|
||||
|
||||
This release has the following notable changes:
|
||||
|
||||
- The [](#opt-programs.anki.uiScale) option now expects a value in the
|
||||
range 1.0–2.0, previously it erroneously expected values in the
|
||||
range `0.0–1.0`.
|
||||
|
||||
## State Version Changes {#sec-release-26.05-state-version-changes}
|
||||
|
||||
The state version in this release includes the changes below. These
|
||||
changes are only active if the `home.stateVersion` option is set to
|
||||
\"26.05\" or later.
|
||||
|
||||
- The `gtk.gtk4.theme` option does not mirror `gtk.theme` by default
|
||||
anymore.
|
||||
- The [](#opt-gtk.gtk4.theme) option does not mirror
|
||||
[](#opt-gtk.theme) by default anymore.
|
||||
|
||||
- The [](#opt-programs.zsh.dotDir) option now defaults to the XDG
|
||||
configuration directory (usually `~/.config/zsh`) when
|
||||
[](#opt-xdg.enable) is true.
|
||||
|
||||
6
flake.lock
generated
6
flake.lock
generated
@@ -2,11 +2,11 @@
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1766070988,
|
||||
"narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=",
|
||||
"lastModified": 1767767207,
|
||||
"narHash": "sha256-Mj3d3PfwltLmukFal5i3fFt27L6NiKXdBezC1EBuZs4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c6245e83d836d0433170a16eb185cefe0572f8b8",
|
||||
"rev": "5912c1772a44e31bf1c63c0390b90501e5026886",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
nixfmt
|
||||
deadnix
|
||||
keep-sorted
|
||||
nixf-diagnose
|
||||
];
|
||||
settings = pkgs.lib.importTOML ./treefmt.toml;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ msgstr ""
|
||||
"Project-Id-Version: Home Manager\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
|
||||
"POT-Creation-Date: 2025-07-22 10:59+0200\n"
|
||||
"PO-Revision-Date: 2025-11-30 14:00+0000\n"
|
||||
"PO-Revision-Date: 2026-01-07 17:01+0000\n"
|
||||
"Last-Translator: Brian E <brianellingsgaard9@gmail.com>\n"
|
||||
"Language-Team: Faroese <https://hosted.weblate.org/projects/home-manager/cli/"
|
||||
"fo/>\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 5.15-dev\n"
|
||||
"X-Generator: Weblate 5.15.1\n"
|
||||
|
||||
#. translators: For example: "home-manager: missing argument for --cores"
|
||||
#: home-manager/home-manager:16
|
||||
@@ -41,10 +41,12 @@ msgid ""
|
||||
"Keeping your Home Manager %s in %s is deprecated,\n"
|
||||
"please move it to %s"
|
||||
msgstr ""
|
||||
"At hava Heimvørðurin %s í %s er fyrnast,\n"
|
||||
"vinarliga flyt hann til %s"
|
||||
|
||||
#: home-manager/home-manager:99
|
||||
msgid "No configuration file found. Please create one at %s"
|
||||
msgstr ""
|
||||
msgstr "Eingin samansetingsfíla funni. Vinarliga stovna ein hjá %s"
|
||||
|
||||
#: home-manager/home-manager:114
|
||||
msgid "Home Manager not found at %s."
|
||||
|
||||
@@ -8,7 +8,7 @@ msgstr ""
|
||||
"Project-Id-Version: Home Manager\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
|
||||
"POT-Creation-Date: 2025-07-22 10:59+0200\n"
|
||||
"PO-Revision-Date: 2025-12-04 04:17+0000\n"
|
||||
"PO-Revision-Date: 2025-12-04 09:16+0000\n"
|
||||
"Last-Translator: \"Urocissa Caerulea.Tw\" <urocissa.tw@proton.me>\n"
|
||||
"Language-Team: Chinese (Traditional Han script) <https://hosted.weblate.org/"
|
||||
"projects/home-manager/cli/zh_Hant/>\n"
|
||||
@@ -215,7 +215,7 @@ msgstr "沒有即將過期的世代"
|
||||
|
||||
#: home-manager/home-manager:877
|
||||
msgid "No home-manager packages seem to be installed."
|
||||
msgstr "似乎沒有安裝 home-manager 軟體包。"
|
||||
msgstr "似乎沒有安裝 home-manager 套件。"
|
||||
|
||||
#: home-manager/home-manager:962
|
||||
msgid "Unknown argument %s"
|
||||
@@ -223,11 +223,11 @@ msgstr "未知引數 %s"
|
||||
|
||||
#: home-manager/home-manager:987
|
||||
msgid "This will remove Home Manager from your system."
|
||||
msgstr "這將會從系統中移除 Home Manager。"
|
||||
msgstr "這將會從您的系統中移除 Home Manager。"
|
||||
|
||||
#: home-manager/home-manager:990
|
||||
msgid "This is a dry run, nothing will actually be uninstalled."
|
||||
msgstr "這是試執行結果,沒有實際解除安裝任何軟體包。"
|
||||
msgstr "這是模擬執行,實際上並不會解除安裝任何內容。"
|
||||
|
||||
#: home-manager/home-manager:994
|
||||
msgid "Really uninstall Home Manager?"
|
||||
@@ -235,27 +235,27 @@ msgstr "確定要解除安裝 Home Manager 嗎?"
|
||||
|
||||
#: home-manager/home-manager:1000
|
||||
msgid "Switching to empty Home Manager configuration..."
|
||||
msgstr "正在切換至空的 Home Manager 配置 ..."
|
||||
msgstr "正在切換至空的 Home Manager 設定..."
|
||||
|
||||
#: home-manager/home-manager:1015
|
||||
msgid "Yay!"
|
||||
msgstr "好耶!"
|
||||
msgstr "太好了!"
|
||||
|
||||
#: home-manager/home-manager:1020
|
||||
msgid "Home Manager is uninstalled but your home.nix is left untouched."
|
||||
msgstr "Home Manager 已解除安裝,但未改動您的 home.nix 配置檔案。"
|
||||
msgstr "Home Manager 已解除安裝,但您的 home.nix 保持不變。"
|
||||
|
||||
#: home-manager/home-manager:1285
|
||||
msgid "expire-generations expects one argument, got %d."
|
||||
msgstr "expire-generations 須要一個引數,但獲取到了 %d 個。"
|
||||
msgstr "expire-generations 預期一個引數,但得到了 %d 個。"
|
||||
|
||||
#: home-manager/home-manager:1310
|
||||
msgid "Unknown command: %s"
|
||||
msgstr "未知命令:%s"
|
||||
msgstr "未知指令:%s"
|
||||
|
||||
#: home-manager/install.nix:21
|
||||
msgid "This derivation is not buildable, please run it using nix-shell."
|
||||
msgstr "此配置檔案/變體不可構建,請在 nix-shell 中執行它。"
|
||||
msgstr "此 derivation 無法建置,請使用 nix-shell 執行。"
|
||||
|
||||
#, sh-format
|
||||
#~ msgid "Please set the $EDITOR environment variable"
|
||||
|
||||
@@ -31,7 +31,7 @@ let
|
||||
modules = [ configuration ] ++ hmModules;
|
||||
class = "homeManager";
|
||||
specialArgs = {
|
||||
modulesPath = builtins.toString ./.;
|
||||
modulesPath = toString ./.;
|
||||
}
|
||||
// extraSpecialArgs;
|
||||
};
|
||||
|
||||
@@ -192,7 +192,7 @@ in
|
||||
++ lib.optionals (cfg.quickPhraseFiles != { }) [
|
||||
(pkgs.linkFarm "quickPhraseFiles" (
|
||||
lib.mapAttrs' (
|
||||
name: value: lib.nameValuePair ("share/fcitx5/data/quickphrase.d/${name}.mb") value
|
||||
name: value: lib.nameValuePair "share/fcitx5/data/quickphrase.d/${name}.mb" value
|
||||
) cfg.quickPhraseFiles
|
||||
))
|
||||
];
|
||||
|
||||
@@ -270,9 +270,7 @@ in
|
||||
setupLaunchAgents
|
||||
|
||||
# Restore errexit
|
||||
if [[ -o errexit ]]; then
|
||||
set -e
|
||||
fi
|
||||
set -e
|
||||
'';
|
||||
})
|
||||
];
|
||||
|
||||
@@ -13,12 +13,9 @@ let
|
||||
mergeDefinitions
|
||||
;
|
||||
inherit (builtins)
|
||||
map
|
||||
filter
|
||||
length
|
||||
deepSeq
|
||||
throw
|
||||
toString
|
||||
concatLists
|
||||
;
|
||||
inherit (lib.options) showDefs;
|
||||
|
||||
@@ -63,12 +63,12 @@ let
|
||||
intervalsString = lib.concatStringsSep ", " intervals;
|
||||
|
||||
assertInterval = option: interval: pkgs: {
|
||||
assertion = (!pkgs.stdenv.isDarwin) || (lib.elem interval intervals);
|
||||
message = "On Darwin ${option} must be one of: ${intervalsString}.";
|
||||
assertion = pkgs.stdenv.isDarwin -> lib.elem interval intervals;
|
||||
message = "On Darwin, ${option} must be one of: ${intervalsString}.";
|
||||
};
|
||||
|
||||
intervalDocumentation = ''
|
||||
On Darwin it must be one of: ${intervalsString}, which are implemented as defined in {manpage}`systemd.time(7)`.
|
||||
On Darwin, it must be one of: ${intervalsString}, which are implemented as defined in {manpage}`systemd.time(7)`.
|
||||
'';
|
||||
in
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
isList
|
||||
mapAttrsToList
|
||||
replicate
|
||||
attrNames
|
||||
;
|
||||
|
||||
initialIndent = concatStrings (replicate indentLevel " ");
|
||||
@@ -28,31 +29,36 @@
|
||||
toHyprconf' =
|
||||
indent: attrs:
|
||||
let
|
||||
sections = filterAttrs (n: v: isAttrs v || (isList v && all isAttrs v)) attrs;
|
||||
isImportantField =
|
||||
n: _: foldl (acc: prev: if hasPrefix prev n then true else acc) false importantPrefixes;
|
||||
importantFields = filterAttrs isImportantField attrs;
|
||||
withoutImportantFields = fields: removeAttrs fields (attrNames importantFields);
|
||||
|
||||
allSections = filterAttrs (n: v: isAttrs v || isList v) attrs;
|
||||
sections = withoutImportantFields allSections;
|
||||
|
||||
mkSection =
|
||||
n: attrs:
|
||||
if lib.isList attrs then
|
||||
(concatMapStringsSep "\n" (a: mkSection n a) attrs)
|
||||
else
|
||||
if isList attrs then
|
||||
let
|
||||
separator = if all isAttrs attrs then "\n" else "";
|
||||
in
|
||||
(concatMapStringsSep separator (a: mkSection n a) attrs)
|
||||
else if isAttrs attrs then
|
||||
''
|
||||
${indent}${n} {
|
||||
${toHyprconf' " ${indent}" attrs}${indent}}
|
||||
'';
|
||||
''
|
||||
else
|
||||
toHyprconf' indent { ${n} = attrs; };
|
||||
|
||||
mkFields = generators.toKeyValue {
|
||||
listsAsDuplicateKeys = true;
|
||||
inherit indent;
|
||||
};
|
||||
|
||||
allFields = filterAttrs (n: v: !(isAttrs v || (isList v && all isAttrs v))) attrs;
|
||||
|
||||
isImportantField =
|
||||
n: _: foldl (acc: prev: if hasPrefix prev n then true else acc) false importantPrefixes;
|
||||
|
||||
importantFields = filterAttrs isImportantField allFields;
|
||||
|
||||
fields = builtins.removeAttrs allFields (mapAttrsToList (n: _: n) importantFields);
|
||||
allFields = filterAttrs (n: v: !(isAttrs v || isList v)) attrs;
|
||||
fields = withoutImportantFields allFields;
|
||||
in
|
||||
mkFields importantFields
|
||||
+ concatStringsSep "\n" (mapAttrsToList mkSection sections)
|
||||
|
||||
@@ -423,12 +423,6 @@
|
||||
github = "natecox";
|
||||
githubId = 2782695;
|
||||
};
|
||||
nickthegroot = {
|
||||
name = "Nick DeGroot";
|
||||
email = "nick@nickthegroot.com";
|
||||
github = "nickthegroot";
|
||||
githubId = 1966472;
|
||||
};
|
||||
nikp123 = {
|
||||
name = "nikp123";
|
||||
email = "nikp123@users.noreply.github.com";
|
||||
@@ -507,12 +501,6 @@
|
||||
github = "Rosuavio";
|
||||
githubId = 7164552;
|
||||
};
|
||||
rrvsh = {
|
||||
name = "Mohammad Rafiq";
|
||||
email = "rafiq@rrv.sh";
|
||||
github = "rrvsh";
|
||||
githubId = 20300874;
|
||||
};
|
||||
rszamszur = {
|
||||
name = "Radosław Szamszur";
|
||||
email = "radoslawszamszur@gmail.com";
|
||||
|
||||
@@ -278,7 +278,7 @@ in
|
||||
else if builtins.isString value then
|
||||
"<const>${value}</const>"
|
||||
else
|
||||
throw ("expected bool or string but got ${builtins.typeOf value}: ${toString value}");
|
||||
throw "expected bool or string but got ${builtins.typeOf value}: ${toString value}";
|
||||
in
|
||||
''
|
||||
<match target="font">
|
||||
@@ -338,7 +338,7 @@ in
|
||||
|
||||
xdg.configFile = lib.mapAttrs' (
|
||||
name: config:
|
||||
lib.nameValuePair "fontconfig/conf.d/${builtins.toString config.priority}-hm-${config.label}.conf" {
|
||||
lib.nameValuePair "fontconfig/conf.d/${toString config.priority}-hm-${config.label}.conf" {
|
||||
inherit (config) enable text;
|
||||
source = lib.mkIf (config.source != null) config.source;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ let
|
||||
fileList ++ subdirFiles;
|
||||
|
||||
newsFiles = collectNixFiles ./news;
|
||||
newsEntries = builtins.map (
|
||||
newsEntries = map (
|
||||
newsFile:
|
||||
let
|
||||
imported = import newsFile;
|
||||
|
||||
20
modules/misc/news/2025/12/2025-12-27_13-32-14.nix
Normal file
20
modules/misc/news/2025/12/2025-12-27_13-32-14.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
time = "2025-12-27T19:00:00+00:00";
|
||||
condition = config.programs.zsh.enable;
|
||||
|
||||
message = ''
|
||||
The default value of `programs.zsh.dotDir` has changed.
|
||||
|
||||
When `home.stateVersion` is set to "26.05" or later, and `xdg.enable` is
|
||||
`true` (the default), `programs.zsh.dotDir` now defaults to
|
||||
`''${config.xdg.configHome}/zsh`. Previously, it defaulted to the home
|
||||
directory.
|
||||
|
||||
This means your Zsh configuration files (`.zshrc`, `.zshenv`, etc.) will be
|
||||
moved to `~/.config/zsh` (or your configured XDG config home).
|
||||
|
||||
If you prefer the old behavior, you can explicitly set:
|
||||
`programs.zsh.dotDir = config.home.homeDirectory;`
|
||||
'';
|
||||
}
|
||||
10
modules/misc/news/2026/01/2026-01-02_00-03-48.nix
Normal file
10
modules/misc/news/2026/01/2026-01-02_00-03-48.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
time = "2026-01-02T00:03:48+00:00";
|
||||
condition = config.services.mpd.enable;
|
||||
message = ''
|
||||
`MPD_HOST` and `MPD_PORT` environment variables are now set automatically.
|
||||
|
||||
This can be disabled with `services.mpd.enableSessionVariables = false`.
|
||||
'';
|
||||
}
|
||||
@@ -47,9 +47,9 @@ in
|
||||
desktop: terminals:
|
||||
# Map desktop name such as GNOME to `.config/gnome-xdg-terminals.list`,
|
||||
# default to `.config/xdg-terminals.list`.
|
||||
lib.nameValuePair (
|
||||
"${if desktop == "default" then "" else "${lib.toLower desktop}-"}xdg-terminals.list"
|
||||
) { text = lib.concatLines terminals; }
|
||||
lib.nameValuePair "${
|
||||
if desktop == "default" then "" else "${lib.toLower desktop}-"
|
||||
}xdg-terminals.list" { text = lib.concatLines terminals; }
|
||||
) cfg.settings;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ in
|
||||
xdg.stateHome = mkOptionDefault defaultStateHome;
|
||||
|
||||
home.sessionVariables = variables;
|
||||
systemd.user.sessionVariables = mkIf pkgs.stdenv.hostPlatform.isLinux variables;
|
||||
systemd.user.sessionVariables = variables;
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ in
|
||||
home.activation.xfconfSettings = lib.hm.dag.entryAfter [ "installPackages" ] (
|
||||
let
|
||||
mkCommand = channel: property: value: ''
|
||||
run ${pkgs.xfce.xfconf}/bin/xfconf-query \
|
||||
run ${pkgs.xfconf}/bin/xfconf-query \
|
||||
${lib.escapeShellArgs (
|
||||
[
|
||||
"-c"
|
||||
|
||||
@@ -8,7 +8,7 @@ msgstr ""
|
||||
"Project-Id-Version: Home Manager Modules\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
|
||||
"POT-Creation-Date: 2025-07-22 10:59+0200\n"
|
||||
"PO-Revision-Date: 2025-11-30 14:00+0000\n"
|
||||
"PO-Revision-Date: 2026-01-07 17:01+0000\n"
|
||||
"Last-Translator: Brian E <brianellingsgaard9@gmail.com>\n"
|
||||
"Language-Team: Faroese <https://hosted.weblate.org/projects/home-manager/"
|
||||
"modules/fo/>\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 5.15-dev\n"
|
||||
"X-Generator: Weblate 5.15.1\n"
|
||||
|
||||
#: modules/files.nix:206
|
||||
msgid "Creating home file links in %s"
|
||||
@@ -33,7 +33,7 @@ msgstr "Stovni nýggjan profil ættarlið"
|
||||
|
||||
#: modules/home-environment.nix:650
|
||||
msgid "No change so reusing latest profile generation"
|
||||
msgstr ""
|
||||
msgstr "Eingin broyting. Seinastið umhvarv ættarlið er enn í brúk"
|
||||
|
||||
#: modules/home-environment.nix:699
|
||||
msgid ""
|
||||
|
||||
@@ -104,7 +104,7 @@ in
|
||||
};
|
||||
|
||||
stylesets = mkOption {
|
||||
type = with types; attrsOf (sectionsOrLines);
|
||||
type = with types; attrsOf sectionsOrLines;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{ default = { ui = { "tab.selected.reverse" = "toggle"; }; }; };
|
||||
|
||||
@@ -82,7 +82,7 @@ in
|
||||
};
|
||||
|
||||
uiScale = lib.mkOption {
|
||||
type = with lib.types; nullOr (numbers.between 0.0 1.0);
|
||||
type = with lib.types; nullOr (numbers.between 1.0 2.0);
|
||||
default = null;
|
||||
example = 1.0;
|
||||
description = "User interface scale.";
|
||||
|
||||
@@ -112,7 +112,7 @@ let
|
||||
|
||||
answer_keys: tuple[tuple[int, str], ...] = (${
|
||||
lib.strings.concatMapStringsSep ", " (val: "(${toString val.ease}, '${val.key}')") cfg.answerKeys
|
||||
})
|
||||
}${if cfg.answerKeys != [ ] then "," else ""})
|
||||
for ease, key in answer_keys:
|
||||
profile_manager.set_answer_key(ease, key)
|
||||
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
}:
|
||||
let
|
||||
inherit (builtins)
|
||||
map
|
||||
toJSON
|
||||
toString
|
||||
substring
|
||||
stringLength
|
||||
;
|
||||
@@ -185,7 +183,7 @@ in
|
||||
|
||||
extraCss = mkOption {
|
||||
type = nullOr lines;
|
||||
default = "";
|
||||
default = null;
|
||||
description = ''
|
||||
Extra CSS lines to add to {file}`~/.config/anyrun/style.css`.
|
||||
'';
|
||||
|
||||
@@ -11,7 +11,6 @@ let
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
|
||||
inherit (lib) mkIf mkOption types;
|
||||
inherit (pkgs.stdenv) isLinux isDarwin;
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.maintainers; [
|
||||
@@ -221,98 +220,82 @@ in
|
||||
};
|
||||
}
|
||||
|
||||
(mkIf daemonCfg.enable (
|
||||
lib.mkMerge [
|
||||
(mkIf daemonCfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertions = [
|
||||
{
|
||||
assertion = lib.versionAtLeast cfg.package.version "18.2.0";
|
||||
message = ''
|
||||
The Atuin daemon requires at least version 18.2.0 or later.
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = isLinux || isDarwin;
|
||||
message = "The Atuin daemon can only be configured on either Linux or macOS.";
|
||||
}
|
||||
];
|
||||
|
||||
programs.atuin.settings = {
|
||||
daemon = {
|
||||
enabled = true;
|
||||
};
|
||||
};
|
||||
assertion = lib.versionAtLeast cfg.package.version "18.2.0";
|
||||
message = ''
|
||||
The Atuin daemon requires at least version 18.2.0 or later.
|
||||
'';
|
||||
}
|
||||
(mkIf isLinux {
|
||||
programs.atuin.settings = {
|
||||
daemon = {
|
||||
systemd_socket = true;
|
||||
};
|
||||
};
|
||||
{
|
||||
assertion = config.systemd.user.enable || config.launchd.enable;
|
||||
message = "The Atuin daemon can only be configured on systems with systemd or launchd.";
|
||||
}
|
||||
];
|
||||
|
||||
systemd.user.services.atuin-daemon = {
|
||||
Unit = {
|
||||
Description = "Atuin daemon";
|
||||
Requires = [ "atuin-daemon.socket" ];
|
||||
};
|
||||
Install = {
|
||||
Also = [ "atuin-daemon.socket" ];
|
||||
WantedBy = [ "default.target" ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${lib.getExe cfg.package} daemon";
|
||||
Environment = lib.optionals (daemonCfg.logLevel != null) [ "ATUIN_LOG=${daemonCfg.logLevel}" ];
|
||||
Restart = "on-failure";
|
||||
RestartSteps = 3;
|
||||
RestartMaxDelaySec = 6;
|
||||
};
|
||||
};
|
||||
programs.atuin.settings.daemon = {
|
||||
enabled = true;
|
||||
systemd_socket = config.systemd.user.enable;
|
||||
socket_path = lib.mkIf (!config.systemd.user.enable) (
|
||||
lib.mkDefault "${config.xdg.dataHome}/atuin/daemon.sock"
|
||||
);
|
||||
};
|
||||
|
||||
systemd.user.sockets.atuin-daemon =
|
||||
let
|
||||
socket_dir = if lib.versionAtLeast cfg.package.version "18.4.0" then "%t" else "%D/atuin";
|
||||
in
|
||||
{
|
||||
Unit = {
|
||||
Description = "Atuin daemon socket";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "sockets.target" ];
|
||||
};
|
||||
Socket = {
|
||||
ListenStream = "${socket_dir}/atuin.sock";
|
||||
SocketMode = "0600";
|
||||
RemoveOnStop = true;
|
||||
};
|
||||
};
|
||||
})
|
||||
(mkIf isDarwin {
|
||||
programs.atuin.settings = {
|
||||
daemon = {
|
||||
socket_path = lib.mkDefault "${config.xdg.dataHome}/atuin/daemon.sock";
|
||||
};
|
||||
};
|
||||
systemd.user.services.atuin-daemon = {
|
||||
Unit = {
|
||||
Description = "Atuin daemon";
|
||||
Requires = [ "atuin-daemon.socket" ];
|
||||
};
|
||||
Install = {
|
||||
Also = [ "atuin-daemon.socket" ];
|
||||
WantedBy = [ "default.target" ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${lib.getExe cfg.package} daemon";
|
||||
Environment = lib.optionals (daemonCfg.logLevel != null) [ "ATUIN_LOG=${daemonCfg.logLevel}" ];
|
||||
Restart = "on-failure";
|
||||
RestartSteps = 3;
|
||||
RestartMaxDelaySec = 6;
|
||||
};
|
||||
};
|
||||
|
||||
launchd.agents.atuin-daemon = {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
"${lib.getExe cfg.package}"
|
||||
"daemon"
|
||||
];
|
||||
EnvironmentVariables = lib.optionalAttrs (daemonCfg.logLevel != null) {
|
||||
ATUIN_LOG = daemonCfg.logLevel;
|
||||
};
|
||||
KeepAlive = {
|
||||
Crashed = true;
|
||||
SuccessfulExit = false;
|
||||
};
|
||||
ProcessType = "Background";
|
||||
};
|
||||
systemd.user.sockets.atuin-daemon =
|
||||
let
|
||||
socket_dir = if lib.versionAtLeast cfg.package.version "18.4.0" then "%t" else "%D/atuin";
|
||||
in
|
||||
{
|
||||
Unit = {
|
||||
Description = "Atuin daemon socket";
|
||||
};
|
||||
})
|
||||
]
|
||||
))
|
||||
Install = {
|
||||
WantedBy = [ "sockets.target" ];
|
||||
};
|
||||
Socket = {
|
||||
ListenStream = "${socket_dir}/atuin.sock";
|
||||
SocketMode = "0600";
|
||||
RemoveOnStop = true;
|
||||
};
|
||||
};
|
||||
|
||||
launchd.agents.atuin-daemon = {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
"${lib.getExe cfg.package}"
|
||||
"daemon"
|
||||
];
|
||||
EnvironmentVariables = lib.optionalAttrs (daemonCfg.logLevel != null) {
|
||||
ATUIN_LOG = daemonCfg.logLevel;
|
||||
};
|
||||
KeepAlive = {
|
||||
Crashed = true;
|
||||
SuccessfulExit = false;
|
||||
};
|
||||
ProcessType = "Background";
|
||||
};
|
||||
};
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ let
|
||||
cfg = config.programs.bashmount;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.AndersonTorres ];
|
||||
meta.maintainers = [ ];
|
||||
|
||||
options.programs.bashmount = {
|
||||
enable = lib.mkEnableOption "bashmount";
|
||||
|
||||
@@ -54,7 +54,7 @@ in
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
home.sessionVariables = lib.mkIf (cfg.settings != { }) {
|
||||
BEMENU_OPTS = lib.cli.toGNUCommandLineShell { } cfg.settings;
|
||||
BEMENU_OPTS = lib.cli.toCommandLineShellGNU { } cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ in
|
||||
) supportedBrowsers;
|
||||
|
||||
config = lib.mkMerge (
|
||||
builtins.map (browser: browserConfig browser config.programs.${browser}) (
|
||||
map (browser: browserConfig browser config.programs.${browser}) (
|
||||
builtins.attrNames supportedBrowsers
|
||||
)
|
||||
);
|
||||
|
||||
@@ -129,7 +129,7 @@ in
|
||||
enable = lib.mkDefault true;
|
||||
iniContent =
|
||||
let
|
||||
difftCommand = "${lib.getExe cfg.package} ${lib.cli.toGNUCommandLineShell { } cfg.options}";
|
||||
difftCommand = "${lib.getExe cfg.package} ${lib.cli.toCommandLineShellGNU { } cfg.options}";
|
||||
in
|
||||
mkMerge [
|
||||
{
|
||||
|
||||
@@ -75,25 +75,7 @@ in
|
||||
|
||||
enableBashIntegration = lib.hm.shell.mkBashIntegrationOption { inherit config; };
|
||||
|
||||
enableFishIntegration =
|
||||
lib.hm.shell.mkFishIntegrationOption {
|
||||
inherit config;
|
||||
extraDescription = ''
|
||||
Note, enabling the direnv module will always activate its functionality
|
||||
for Fish since the direnv package automatically gets loaded in Fish.
|
||||
If this is not the case try adding
|
||||
|
||||
```nix
|
||||
environment.pathsToLink = [ "/share/fish" ];
|
||||
```
|
||||
|
||||
to the system configuration.
|
||||
'';
|
||||
}
|
||||
// {
|
||||
default = true;
|
||||
readOnly = true;
|
||||
};
|
||||
enableFishIntegration = lib.hm.shell.mkFishIntegrationOption { inherit config; };
|
||||
|
||||
enableNushellIntegration = lib.hm.shell.mkNushellIntegrationOption { inherit config; };
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@ let
|
||||
|
||||
generateConfig = lib.generators.toKeyValue {
|
||||
mkKeyValue =
|
||||
name: value:
|
||||
if lib.isString value then ''${name}="${value}"'' else "${name}=${builtins.toString value}";
|
||||
name: value: if lib.isString value then ''${name}="${value}"'' else "${name}=${toString value}";
|
||||
};
|
||||
|
||||
iniFormat = pkgs.formats.ini { listsAsDuplicateKeys = true; };
|
||||
|
||||
@@ -103,7 +103,7 @@ in
|
||||
{
|
||||
name = path;
|
||||
value = {
|
||||
source = jsonFormat.generate "config.json" (ctx);
|
||||
source = jsonFormat.generate "config.json" ctx;
|
||||
};
|
||||
}
|
||||
) cfg.contexts;
|
||||
|
||||
@@ -471,7 +471,7 @@ in
|
||||
|
||||
order = mkOption {
|
||||
type = with types; uniq (listOf str);
|
||||
apply = builtins.map migrateEngineNameToIdV7;
|
||||
apply = map migrateEngineNameToIdV7;
|
||||
default = [ ];
|
||||
example = [
|
||||
"ddg"
|
||||
|
||||
@@ -301,20 +301,13 @@ let
|
||||
let
|
||||
name = if isAttrs def && def.name != null then def.name else attrName;
|
||||
mods =
|
||||
lib.cli.toGNUCommandLineShell
|
||||
{
|
||||
mkOption =
|
||||
k: v:
|
||||
if v == null then
|
||||
[ ]
|
||||
else if k == "set-cursor" then
|
||||
[ "--${k}=${lib.generators.mkValueStringDefault { } v}" ]
|
||||
else
|
||||
[
|
||||
"--${k}"
|
||||
(lib.generators.mkValueStringDefault { } v)
|
||||
];
|
||||
}
|
||||
lib.cli.toCommandLineShell
|
||||
(optionName: {
|
||||
option = "--${optionName}";
|
||||
sep = if optionName == "set-cursor" then "=" else null;
|
||||
explicitBool = false;
|
||||
formatArg = lib.generators.mkValueStringDefault { };
|
||||
})
|
||||
{
|
||||
inherit (def)
|
||||
position
|
||||
@@ -395,12 +388,14 @@ let
|
||||
passAsFile = [ "text" ];
|
||||
} "env HOME=$(mktemp -d) fish_indent < $textPath > $out";
|
||||
|
||||
translatedSessionVariables = pkgs.runCommandLocal "hm-session-vars.fish" { } ''
|
||||
sessionVarsFile = "etc/profile.d/hm-session-vars.fish";
|
||||
sessionVarsPkg = pkgs.runCommandLocal "hm-session-vars.fish" { } ''
|
||||
mkdir -p "$(dirname $out/${sessionVarsFile})"
|
||||
(echo "function setup_hm_session_vars;"
|
||||
${pkgs.buildPackages.babelfish}/bin/babelfish \
|
||||
<${config.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh
|
||||
<${config.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh
|
||||
echo "end"
|
||||
echo "setup_hm_session_vars") > $out
|
||||
echo "setup_hm_session_vars") > $out/${sessionVarsFile}
|
||||
'';
|
||||
|
||||
in
|
||||
@@ -598,11 +593,25 @@ in
|
||||
<https://fishshell.com/docs/current/completions.html>.
|
||||
'';
|
||||
};
|
||||
|
||||
programs.fish.sessionVariablesPackage = mkOption {
|
||||
type = types.package;
|
||||
internal = true;
|
||||
description = ''
|
||||
The package containing the translated {file}`hm-session-vars.fish` file.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{ home.packages = [ cfg.package ]; }
|
||||
{
|
||||
home.packages = [
|
||||
cfg.package
|
||||
cfg.sessionVariablesPackage
|
||||
];
|
||||
programs.fish.sessionVariablesPackage = sessionVarsPkg;
|
||||
}
|
||||
|
||||
(mkIf cfg.generateCompletions (
|
||||
let
|
||||
@@ -618,7 +627,7 @@ in
|
||||
package
|
||||
]
|
||||
++ lib.filter (p: p != null) (
|
||||
builtins.map (outName: package.${outName} or null) config.home.extraOutputsToInstall
|
||||
map (outName: package.${outName} or null) config.home.extraOutputsToInstall
|
||||
);
|
||||
nativeBuildInputs = [ pkgs.python3 ];
|
||||
buildInputs = [ cfg.package ];
|
||||
@@ -715,7 +724,7 @@ in
|
||||
set -q __fish_home_manager_config_sourced; and exit
|
||||
set -g __fish_home_manager_config_sourced 1
|
||||
|
||||
source ${translatedSessionVariables}
|
||||
source ${cfg.sessionVariablesPackage}/${sessionVarsFile}
|
||||
|
||||
${cfg.shellInit}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ let
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.hm.maintainers.rrvsh ];
|
||||
meta.maintainers = [ lib.maintainers.rrvsh ];
|
||||
|
||||
options.programs.gemini-cli = {
|
||||
enable = lib.mkEnableOption "gemini-cli";
|
||||
|
||||
@@ -204,7 +204,7 @@ in
|
||||
|
||||
xdg.dataFile."gh/extensions" = mkIf (cfg.extensions != [ ]) {
|
||||
source = pkgs.linkFarm "gh-extensions" (
|
||||
builtins.map (p: {
|
||||
map (p: {
|
||||
name = p.pname;
|
||||
path = "${p}/bin";
|
||||
}) cfg.extensions
|
||||
|
||||
@@ -224,8 +224,24 @@ in
|
||||
message = "Ghostty systemd integration cannot be enabled for non-linux platforms";
|
||||
}
|
||||
];
|
||||
|
||||
xdg.configFile."systemd/user/app-com.mitchellh.ghostty.service".source =
|
||||
"${cfg.package}/share/systemd/user/app-com.mitchellh.ghostty.service";
|
||||
|
||||
xdg.configFile."systemd/user/app-com.mitchellh.ghostty.service.d/overrides.conf".text = ''
|
||||
[Unit]
|
||||
X-SwitchMethod=keep-old
|
||||
X-Reload-Triggers=${
|
||||
let
|
||||
storePathOf = name: config.xdg.configFile.${name}.source;
|
||||
in
|
||||
toString (
|
||||
lib.optionals (cfg.settings != { }) [ (storePathOf "ghostty/config") ]
|
||||
++ lib.mapAttrsToList (name: _: storePathOf "ghostty/themes/${name}") cfg.themes
|
||||
)
|
||||
}
|
||||
'';
|
||||
|
||||
dbus.packages = [ cfg.package ];
|
||||
})
|
||||
|
||||
|
||||
@@ -16,18 +16,13 @@ let
|
||||
|
||||
cfg = config.programs.gpg;
|
||||
|
||||
mkKeyValue =
|
||||
key: value: if lib.isString value then "${key} ${value}" else lib.optionalString value key;
|
||||
|
||||
cfgText = lib.generators.toKeyValue {
|
||||
inherit mkKeyValue;
|
||||
listsAsDuplicateKeys = true;
|
||||
} cfg.settings;
|
||||
|
||||
scdaemonCfgText = lib.generators.toKeyValue {
|
||||
inherit mkKeyValue;
|
||||
listsAsDuplicateKeys = true;
|
||||
} cfg.scdaemonSettings;
|
||||
toKeyValue =
|
||||
settings:
|
||||
lib.generators.toKeyValue {
|
||||
mkKeyValue =
|
||||
key: value: if lib.isString value then "${key} ${value}" else lib.optionalString value key;
|
||||
listsAsDuplicateKeys = true;
|
||||
} settings;
|
||||
|
||||
primitiveType = types.oneOf [
|
||||
types.str
|
||||
@@ -193,6 +188,7 @@ in
|
||||
|
||||
scdaemonSettings = mkOption {
|
||||
type = types.attrsOf (types.either primitiveType (types.listOf types.str));
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
disable-ccid = true;
|
||||
@@ -207,6 +203,41 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
dirmngrSettings = mkOption {
|
||||
type = types.attrsOf (types.either primitiveType (types.listOf types.str));
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
allow-version-check = true;
|
||||
keyserver = "ldaps://ldap.example.com";
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Dirmngr configuration options. Available options are described
|
||||
in
|
||||
[
|
||||
{manpage}`dirmngr(1)`
|
||||
](https://www.gnupg.org/documentation/manuals/gnupg/Dirmngr-Options.html)
|
||||
'';
|
||||
};
|
||||
|
||||
gpgsmSettings = mkOption {
|
||||
type = types.attrsOf (types.either primitiveType (types.listOf types.str));
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
with-key-data = true;
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
GPGSM configuration options. Available options are described
|
||||
in
|
||||
[
|
||||
{manpage}`gpgsm(1)`
|
||||
](https://www.gnupg.org/documentation/manuals/gnupg/GPGSM-Options.html)
|
||||
'';
|
||||
};
|
||||
|
||||
homedir = mkOption {
|
||||
type = types.path;
|
||||
example = literalExpression ''"''${config.xdg.dataHome}/gnupg"'';
|
||||
@@ -267,8 +298,7 @@ in
|
||||
cert-digest-algo = mkDefault "SHA512";
|
||||
s2k-digest-algo = mkDefault "SHA512";
|
||||
s2k-cipher-algo = mkDefault "AES256";
|
||||
charset = mkDefault "utf-8";
|
||||
fixed-list-mode = mkDefault true;
|
||||
display-charset = mkDefault "utf-8";
|
||||
no-comments = mkDefault true;
|
||||
no-emit-version = mkDefault true;
|
||||
keyid-format = mkDefault "0xlong";
|
||||
@@ -277,11 +307,6 @@ in
|
||||
with-fingerprint = mkDefault true;
|
||||
require-cross-certification = mkDefault true;
|
||||
no-symkey-cache = mkDefault true;
|
||||
use-agent = mkDefault true;
|
||||
};
|
||||
|
||||
programs.gpg.scdaemonSettings = {
|
||||
# no defaults for scdaemon
|
||||
};
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
@@ -289,9 +314,21 @@ in
|
||||
GNUPGHOME = cfg.homedir;
|
||||
};
|
||||
|
||||
home.file."${cfg.homedir}/gpg.conf".text = cfgText;
|
||||
home.file."${cfg.homedir}/gpg.conf" = mkIf (cfg.settings != { }) {
|
||||
text = toKeyValue cfg.settings;
|
||||
};
|
||||
|
||||
home.file."${cfg.homedir}/scdaemon.conf".text = scdaemonCfgText;
|
||||
home.file."${cfg.homedir}/scdaemon.conf" = mkIf (cfg.scdaemonSettings != { }) {
|
||||
text = toKeyValue cfg.scdaemonSettings;
|
||||
};
|
||||
|
||||
home.file."${cfg.homedir}/dirmngr.conf" = mkIf (cfg.dirmngrSettings != { }) {
|
||||
text = toKeyValue cfg.dirmngrSettings;
|
||||
};
|
||||
|
||||
home.file."${cfg.homedir}/gpgsm.conf" = mkIf (cfg.gpgsmSettings != { }) {
|
||||
text = toKeyValue cfg.gpgsmSettings;
|
||||
};
|
||||
|
||||
# Link keyring if keys are not mutable
|
||||
home.file."${cfg.homedir}/pubring.kbx" = mkIf (!cfg.mutableKeys && cfg.publicKeys != [ ]) {
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
let
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
cfg = config.programs.gurk-rs;
|
||||
configDir =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.da157 ];
|
||||
@@ -46,9 +48,8 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
home.file."${
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome
|
||||
}/gurk/gurk.toml".source =
|
||||
lib.mkIf (cfg.settings != { }) (tomlFormat.generate "gurk-config" cfg.settings);
|
||||
home.file."${configDir}/gurk/gurk.toml" = lib.mkIf (cfg.settings != { }) {
|
||||
source = tomlFormat.generate "gurk-config" cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ let
|
||||
iniFormat = pkgs.formats.ini { };
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.maintainers; [ AndersonTorres ];
|
||||
meta.maintainers = [ ];
|
||||
|
||||
options.programs.havoc = {
|
||||
enable = lib.mkEnableOption "Havoc terminal";
|
||||
|
||||
@@ -70,7 +70,7 @@ in
|
||||
"mako"
|
||||
];
|
||||
in
|
||||
builtins.map (name: {
|
||||
map (name: {
|
||||
assertion = !config.services.${name}.enable;
|
||||
message = ''
|
||||
Only one notification daemon can be enabled at once. You have enabled
|
||||
|
||||
@@ -139,7 +139,7 @@ in
|
||||
in
|
||||
lib.hm.dag.entryAfter [ "linkGeneration" ] ''
|
||||
# Ensure that settings.json exists.
|
||||
mkdir -p ${builtins.dirOf configPath}
|
||||
mkdir -p ${dirOf configPath}
|
||||
touch ${configPath}
|
||||
# Config has to be written to temporary variable because jq cannot edit files in place.
|
||||
config="$(jq -s '.[0] + .[1]' ${configPath} ${newConfig})"
|
||||
|
||||
@@ -62,8 +62,15 @@ in
|
||||
Configuration written to
|
||||
{file}`$XDG_CONFIG_HOME/keepassxc/keepassxc.ini`.
|
||||
|
||||
See <https://github.com/keepassxreboot/keepassxc/blob/647272e9c5542297d3fcf6502e6173c96f12a9a0/src/core/Config.cpp#L49-L223>
|
||||
See <https://github.com/keepassxreboot/keepassxc/blob/develop/src/core/Config.cpp>
|
||||
for the full list of options.
|
||||
|
||||
::: {.note}
|
||||
When the settings are non-empty, the configuration file will be linked
|
||||
into the Nix store and KeePassXC will report an access error for its
|
||||
configuration file. This is expected and can not be fixed in a way that
|
||||
aligns with Home Manager's principles. See [#8257](https://github.com/nix-community/home-manager/issues/8257) for more details.
|
||||
:::
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ let
|
||||
renderSettings =
|
||||
with lib.generators;
|
||||
toINI {
|
||||
mkKeyValue = mkKeyValueDefault rec {
|
||||
mkKeyValue = mkKeyValueDefault {
|
||||
mkValueString =
|
||||
v:
|
||||
if lib.isList v then
|
||||
@@ -139,7 +139,7 @@ in
|
||||
let
|
||||
makePath =
|
||||
baseDir: subDir:
|
||||
builtins.toString (
|
||||
toString (
|
||||
/.
|
||||
+ lib.concatStringsSep "/" [
|
||||
baseDir
|
||||
|
||||
@@ -341,16 +341,13 @@ in
|
||||
# See https://sw.kovidgoyal.net/kitty/conf.html
|
||||
${cfg.extraConfig}
|
||||
'';
|
||||
}
|
||||
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||
onChange = ''
|
||||
${pkgs.procps}/bin/pkill -USR1 -u $USER kitty || true
|
||||
'';
|
||||
}
|
||||
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isDarwin {
|
||||
onChange = ''
|
||||
/usr/bin/pkill -USR1 -u $USER kitty || true
|
||||
'';
|
||||
onChange =
|
||||
let
|
||||
prefix = if pkgs.stdenv.hostPlatform.isDarwin then "/usr" else pkgs.procps;
|
||||
in
|
||||
''
|
||||
${prefix}/bin/pkill -USR1 -u $USER kitty || true
|
||||
'';
|
||||
};
|
||||
|
||||
xdg.configFile."kitty/quick-access-terminal.conf" = mkIf (cfg.quickAccessTerminalConfig != { }) {
|
||||
|
||||
@@ -9,7 +9,6 @@ let
|
||||
|
||||
cfg = config.programs.kubecolor;
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
inherit (pkgs.stdenv.hostPlatform) isDarwin;
|
||||
|
||||
in
|
||||
{
|
||||
@@ -50,18 +49,20 @@ in
|
||||
|
||||
config =
|
||||
let
|
||||
preferXdgDirectories = config.home.preferXdgDirectories && (!isDarwin || config.xdg.enable);
|
||||
preferXdgDirectories =
|
||||
config.home.preferXdgDirectories && (!pkgs.stdenv.hostPlatform.isDarwin || config.xdg.enable);
|
||||
configDir =
|
||||
if preferXdgDirectories then
|
||||
"${config.xdg.configHome}/kube"
|
||||
else if pkgs.stdenv.hostPlatform.isDarwin then
|
||||
"Library/Application Support/kube"
|
||||
else
|
||||
".kube";
|
||||
|
||||
# https://github.com/kubecolor/kubecolor/pull/145
|
||||
configPathSuffix =
|
||||
if
|
||||
cfg.package.pname == "kubecolor"
|
||||
&& lib.strings.toInt (lib.versions.major cfg.package.version) == 0
|
||||
&& lib.strings.toInt (lib.versions.minor cfg.package.version) < 4
|
||||
then
|
||||
"kube/"
|
||||
else
|
||||
"kube/color.yaml";
|
||||
configPathSuffix = lib.optionalString (
|
||||
cfg.package.pname == "kubecolor" && lib.versionOlder (lib.getVersion cfg.package) "0.4"
|
||||
) "color.yaml";
|
||||
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
@@ -73,31 +74,10 @@ in
|
||||
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
home.sessionVariables =
|
||||
if preferXdgDirectories then
|
||||
{
|
||||
KUBECOLOR_CONFIG = "${config.xdg.configHome}/${configPathSuffix}";
|
||||
}
|
||||
else if isDarwin then
|
||||
{
|
||||
KUBECOLOR_CONFIG = "${config.home.homeDirectory}/Library/Application Support/${configPathSuffix}";
|
||||
}
|
||||
else
|
||||
{ };
|
||||
home.sessionVariables.KUBECOLOR_CONFIG = "${configDir}/${configPathSuffix}";
|
||||
|
||||
xdg.configFile = mkIf preferXdgDirectories {
|
||||
"kube/color.yaml" = mkIf (cfg.settings != { }) {
|
||||
source = yamlFormat.generate "kubecolor-settings" cfg.settings;
|
||||
};
|
||||
};
|
||||
|
||||
home.file = mkIf (!preferXdgDirectories) {
|
||||
"Library/Application Support/kube/color.yaml" = mkIf (isDarwin && cfg.settings != { }) {
|
||||
source = yamlFormat.generate "kubecolor-settings" cfg.settings;
|
||||
};
|
||||
".kube/color.yaml" = mkIf (!isDarwin && cfg.settings != { }) {
|
||||
source = yamlFormat.generate "kubecolor-settings" cfg.settings;
|
||||
};
|
||||
home.file."${configDir}/color.yaml" = mkIf (cfg.settings != { }) {
|
||||
source = yamlFormat.generate "kubecolor-settings" cfg.settings;
|
||||
};
|
||||
|
||||
home.shellAliases = lib.mkIf (cfg.enableAlias && (cfg.package != null)) {
|
||||
|
||||
@@ -201,7 +201,7 @@ let
|
||||
plugins:
|
||||
pkgs.linkFarm "lapce-plugins" (
|
||||
builtins.listToAttrs (
|
||||
builtins.map (
|
||||
map (
|
||||
{
|
||||
author,
|
||||
name,
|
||||
|
||||
@@ -11,7 +11,11 @@ let
|
||||
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
|
||||
inherit (pkgs.stdenv.hostPlatform) isDarwin;
|
||||
configDir =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin && !config.xdg.enable then
|
||||
"Library/Application Support/jesseduffield"
|
||||
else
|
||||
config.xdg.configHome;
|
||||
|
||||
in
|
||||
{
|
||||
@@ -51,16 +55,8 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
home.file."Library/Application Support/jesseduffield/lazydocker/config.yml" =
|
||||
lib.mkIf (cfg.settings != { } && (isDarwin && !config.xdg.enable))
|
||||
{
|
||||
source = yamlFormat.generate "lazydocker-config" cfg.settings;
|
||||
};
|
||||
|
||||
xdg.configFile."lazydocker/config.yml" =
|
||||
lib.mkIf (cfg.settings != { } && !(isDarwin && !config.xdg.enable))
|
||||
{
|
||||
source = yamlFormat.generate "lazydocker-config" cfg.settings;
|
||||
};
|
||||
home.file."${configDir}/lazydocker/config.yml" = lib.mkIf (cfg.settings != { }) {
|
||||
source = yamlFormat.generate "lazydocker-config" cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -11,8 +11,11 @@ let
|
||||
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
|
||||
inherit (pkgs.stdenv.hostPlatform) isDarwin;
|
||||
|
||||
configDir =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin && !config.xdg.enable then
|
||||
"Library/Application Support"
|
||||
else
|
||||
config.xdg.configHome;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [
|
||||
@@ -71,17 +74,10 @@ in
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
home.file."Library/Application Support/lazygit/config.yml" =
|
||||
mkIf (cfg.settings != { } && (isDarwin && !config.xdg.enable))
|
||||
{
|
||||
source = yamlFormat.generate "lazygit-config" cfg.settings;
|
||||
};
|
||||
|
||||
xdg.configFile."lazygit/config.yml" =
|
||||
mkIf (cfg.settings != { } && !(isDarwin && !config.xdg.enable))
|
||||
{
|
||||
source = yamlFormat.generate "lazygit-config" cfg.settings;
|
||||
};
|
||||
home.file."${configDir}/lazygit/config.yml" = {
|
||||
enable = cfg.settings != { };
|
||||
source = yamlFormat.generate "lazygit-config" cfg.settings;
|
||||
};
|
||||
|
||||
programs =
|
||||
let
|
||||
|
||||
@@ -45,7 +45,7 @@ in
|
||||
];
|
||||
attrs = attrsOf (either scalar (listOf scalar));
|
||||
in
|
||||
coercedTo attrs (lib.cli.toGNUCommandLine { }) (listOf str);
|
||||
coercedTo attrs (lib.cli.toCommandLineGNU { }) (listOf str);
|
||||
default = [ ];
|
||||
description = "Options to be set via {env}`$LESS`.";
|
||||
example = {
|
||||
|
||||
@@ -24,7 +24,8 @@ let
|
||||
meliAccounts = (lib.attrsets.mapAttrs (name: value: (mkMeliAccounts name value)) enabledAccounts);
|
||||
|
||||
mkMeliAccounts = (
|
||||
name: account: {
|
||||
name: account:
|
||||
{
|
||||
root_mailbox = "${config.accounts.email.maildirBasePath}/${account.maildir.path}";
|
||||
format = "Maildir";
|
||||
identity = account.address;
|
||||
@@ -33,6 +34,14 @@ let
|
||||
send_mail = mkSmtp account;
|
||||
mailboxes = account.meli.mailboxAliases;
|
||||
}
|
||||
// lib.optionalAttrs (account.flavor == "fastmail.com") {
|
||||
server_username = account.userName;
|
||||
server_password_command = lib.concatMapStringsSep " " lib.escapeShellArg account.passwordCommand;
|
||||
format = "jmap";
|
||||
server_url = "https://api.fastmail.com/jmap/session";
|
||||
use_token = true;
|
||||
}
|
||||
// account.meli.settings
|
||||
);
|
||||
|
||||
mkSmtp = account: {
|
||||
@@ -73,7 +82,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "meli" { };
|
||||
|
||||
includes = mkOption {
|
||||
type = with types; listOf (str);
|
||||
type = with types; listOf str;
|
||||
description = "Paths of the various meli configuration files to include.";
|
||||
default = [ ];
|
||||
};
|
||||
@@ -153,6 +162,14 @@ in
|
||||
};
|
||||
description = "Folder display name";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = types.submodule {
|
||||
freeformType = tomlFormat.type;
|
||||
};
|
||||
default = { };
|
||||
description = "Account specific meli configuration";
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
@@ -160,6 +177,15 @@ in
|
||||
};
|
||||
};
|
||||
config = mkIf config.programs.meli.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.settings ? accounts == false;
|
||||
message = ''
|
||||
programs.meli.settings.accounts override the accounts.email values.
|
||||
Use per-email accounts.email.<ACCOUNT>.meli.settings instead'';
|
||||
}
|
||||
];
|
||||
|
||||
home.packages = [ config.programs.meli.package ];
|
||||
|
||||
# Generate meli configuration from email accounts
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
let
|
||||
cfg = config.programs.mullvad-vpn;
|
||||
jsonFormat = pkgs.formats.json { };
|
||||
configDir =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.da157 ];
|
||||
@@ -42,11 +44,8 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
home.file."${
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome
|
||||
}/Mullvad VPN/gui_settings.json" =
|
||||
lib.mkIf (cfg.settings != { }) {
|
||||
source = jsonFormat.generate "mullvad-gui-settings" cfg.settings;
|
||||
};
|
||||
home.file."${configDir}/Mullvad VPN/gui_settings.json" = lib.mkIf (cfg.settings != { }) {
|
||||
source = jsonFormat.generate "mullvad-gui-settings" cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -213,11 +213,17 @@ in
|
||||
extraLuaConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
example = ''
|
||||
vim.opt.nobackup = true
|
||||
example = lib.literalExpression ''
|
||||
let
|
||||
nvimEarlyInit = lib.mkOrder 500 "set rtp+=vim.opt.rtp:prepend('/home/user/myplugin')";
|
||||
nvimLateInit = lib.mkAfter "vim.opt.signcolumn = 'auto:1-3'";
|
||||
in
|
||||
lib.mkMerge [ nvimEarlyInit nvimLateInit ];
|
||||
'';
|
||||
description = ''
|
||||
Custom lua lines.
|
||||
Content to be added to {file}`init.lua`.
|
||||
|
||||
To specify the order, use `lib.mkOrder`, `lib.mkBefore`, `lib.mkAfter`.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -426,7 +432,10 @@ in
|
||||
(concatMapStringsSep ";" luaPackages.getLuaPath resolvedExtraLuaPackages)
|
||||
];
|
||||
|
||||
neovimConfig = pkgs.neovimUtils.makeNeovimConfig {
|
||||
wrappedNeovim' = pkgs.wrapNeovimUnstable cfg.package {
|
||||
withNodeJs = cfg.withNodeJs || cfg.coc.enable;
|
||||
plugins = map suppressNotVimlConfig pluginsNormalized;
|
||||
|
||||
inherit (cfg)
|
||||
extraPython3Packages
|
||||
withPython3
|
||||
@@ -434,38 +443,23 @@ in
|
||||
withPerl
|
||||
viAlias
|
||||
vimAlias
|
||||
extraName
|
||||
autowrapRuntimeDeps
|
||||
waylandSupport
|
||||
;
|
||||
withNodeJs = cfg.withNodeJs || cfg.coc.enable;
|
||||
plugins = map suppressNotVimlConfig pluginsNormalized;
|
||||
customRC = cfg.extraConfig;
|
||||
neovimRcContent = cfg.extraConfig;
|
||||
wrapperArgs =
|
||||
cfg.extraWrapperArgs ++ extraMakeWrapperArgs ++ extraMakeWrapperLuaCArgs ++ extraMakeWrapperLuaArgs;
|
||||
wrapRc = false;
|
||||
};
|
||||
|
||||
wrappedNeovim' = pkgs.wrapNeovimUnstable cfg.package (
|
||||
neovimConfig
|
||||
// {
|
||||
inherit (cfg)
|
||||
extraName
|
||||
autowrapRuntimeDeps
|
||||
waylandSupport
|
||||
withNodeJs
|
||||
;
|
||||
wrapperArgs =
|
||||
neovimConfig.wrapperArgs
|
||||
++ cfg.extraWrapperArgs
|
||||
++ extraMakeWrapperArgs
|
||||
++ extraMakeWrapperLuaCArgs
|
||||
++ extraMakeWrapperLuaArgs;
|
||||
wrapRc = false;
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
programs.neovim = {
|
||||
generatedConfigViml = neovimConfig.neovimRcContent;
|
||||
generatedConfigViml = cfg.extraConfig;
|
||||
|
||||
generatedConfigs =
|
||||
let
|
||||
grouped = builtins.groupBy (x: x.type) pluginsNormalized;
|
||||
grouped = lib.groupBy (x: x.type) pluginsNormalized;
|
||||
configsOnly = lib.foldl (acc: p: if p.config != null then acc ++ [ p.config ] else acc) [ ];
|
||||
in
|
||||
lib.mapAttrs (_name: vals: lib.concatStringsSep "\n" (configsOnly vals)) grouped;
|
||||
@@ -484,29 +478,28 @@ in
|
||||
shellAliases = mkIf cfg.vimdiffAlias { vimdiff = "nvim -d"; };
|
||||
};
|
||||
|
||||
xdg.configFile =
|
||||
let
|
||||
hasLuaConfig = lib.hasAttr "lua" config.programs.neovim.generatedConfigs;
|
||||
luaRcContent =
|
||||
lib.optionalString (
|
||||
wrappedNeovim'.initRc != ""
|
||||
) "vim.cmd [[source ${pkgs.writeText "nvim-init-home-manager.vim" wrappedNeovim'.initRc}]]\n"
|
||||
+ config.programs.neovim.extraLuaConfig
|
||||
+ lib.optionalString hasLuaConfig config.programs.neovim.generatedConfigs.lua;
|
||||
in
|
||||
lib.mkMerge (
|
||||
# writes runtime
|
||||
(map (x: x.runtime) pluginsNormalized)
|
||||
++ [
|
||||
{
|
||||
"nvim/init.lua" = mkIf (luaRcContent != "") { text = luaRcContent; };
|
||||
programs.neovim.extraLuaConfig = lib.mkMerge [
|
||||
(lib.mkIf (wrappedNeovim'.initRc != "") (
|
||||
lib.mkBefore "vim.cmd [[source ${pkgs.writeText "nvim-init-home-manager.vim" wrappedNeovim'.initRc}]]"
|
||||
))
|
||||
(lib.mkIf (lib.hasAttr "lua" cfg.generatedConfigs) (lib.mkAfter cfg.generatedConfigs.lua))
|
||||
];
|
||||
|
||||
"nvim/coc-settings.json" = mkIf cfg.coc.enable {
|
||||
source = jsonFormat.generate "coc-settings.json" cfg.coc.settings;
|
||||
};
|
||||
}
|
||||
]
|
||||
);
|
||||
xdg.configFile = lib.mkMerge (
|
||||
# writes runtime
|
||||
(map (x: x.runtime) pluginsNormalized)
|
||||
++ [
|
||||
{
|
||||
"nvim/init.lua" = mkIf (cfg.extraLuaConfig != "") {
|
||||
text = cfg.extraLuaConfig;
|
||||
};
|
||||
|
||||
"nvim/coc-settings.json" = mkIf cfg.coc.enable {
|
||||
source = jsonFormat.generate "coc-settings.json" cfg.coc.settings;
|
||||
};
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ in
|
||||
lib.optional (cfg.clean.enable && config.nix.gc.automatic)
|
||||
"programs.nh.clean.enable and nix.gc.automatic (Home-Manager) are both enabled. Please use one or the other to avoid conflict.";
|
||||
|
||||
assertions = lib.optionals pkgs.stdenv.isDarwin [
|
||||
assertions = [
|
||||
(lib.hm.darwin.assertInterval "programs.nh.clean.dates" cfg.clean.dates pkgs)
|
||||
];
|
||||
|
||||
@@ -131,30 +131,25 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
systemd.user = lib.mkIf (cfg.clean.enable && pkgs.stdenv.isLinux) {
|
||||
systemd.user = lib.mkIf cfg.clean.enable {
|
||||
services.nh-clean = {
|
||||
Unit.Description = "Nh clean (user)";
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${lib.getExe cfg.package} clean user ${cfg.clean.extraArgs}";
|
||||
};
|
||||
};
|
||||
|
||||
timers.nh-clean = {
|
||||
Unit.Description = "Run nh clean";
|
||||
|
||||
Timer = {
|
||||
OnCalendar = cfg.clean.dates;
|
||||
Persistent = true;
|
||||
};
|
||||
|
||||
Install.WantedBy = [ "timers.target" ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
launchd.agents.nh-clean = lib.mkIf (cfg.clean.enable && pkgs.stdenv.isDarwin) {
|
||||
launchd.agents.nh-clean = lib.mkIf cfg.clean.enable {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
@@ -163,9 +158,7 @@ in
|
||||
"user"
|
||||
]
|
||||
++ lib.optional (cfg.clean.extraArgs != "") cfg.clean.extraArgs;
|
||||
|
||||
StartCalendarInterval = lib.hm.darwin.mkCalendarInterval cfg.clean.dates;
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -66,10 +66,7 @@ in
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = pkgs.stdenv.hostPlatform.isLinux;
|
||||
message = "niriswitcher is only available on Linux.";
|
||||
}
|
||||
(lib.hm.assertions.assertPlatform "programs.niriswitcher" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
@@ -13,7 +13,7 @@ let
|
||||
|
||||
renderSettings = settings: lib.concatStringsSep ";" (lib.mapAttrsToList renderSetting settings);
|
||||
|
||||
pluginModule = types.submodule ({
|
||||
pluginModule = types.submodule {
|
||||
options = {
|
||||
src = mkOption {
|
||||
type = with types; nullOr path;
|
||||
@@ -46,7 +46,7 @@ let
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.maintainers; [ thiagokokada ];
|
||||
|
||||
@@ -254,7 +254,7 @@ in
|
||||
cssSnippets =
|
||||
let
|
||||
checkCssPath = path: lib.filesystem.pathIsRegularFile path && lib.strings.hasSuffix ".css" path;
|
||||
toCssName = path: lib.strings.removeSuffix ".css" (builtins.baseNameOf path);
|
||||
toCssName = path: lib.strings.removeSuffix ".css" (baseNameOf path);
|
||||
cssSnippetsOptions =
|
||||
{ config, ... }:
|
||||
{
|
||||
@@ -423,7 +423,7 @@ in
|
||||
source = (pkgs.formats.json { }).generate "appearance.json" (
|
||||
vault.settings.appearance
|
||||
// {
|
||||
enabledCssSnippets = builtins.map (snippet: snippet.name) enabledCssSnippets;
|
||||
enabledCssSnippets = map (snippet: snippet.name) enabledCssSnippets;
|
||||
}
|
||||
// lib.attrsets.optionalAttrs (activeTheme != null) {
|
||||
cssTheme = getManifest activeTheme;
|
||||
@@ -438,14 +438,14 @@ in
|
||||
{
|
||||
name = "${vault.target}/.obsidian/core-plugins.json";
|
||||
value.source = (pkgs.formats.json { }).generate "core-plugins.json" (
|
||||
builtins.map (plugin: plugin.name) vault.settings.corePlugins
|
||||
map (plugin: plugin.name) vault.settings.corePlugins
|
||||
);
|
||||
}
|
||||
{
|
||||
name = "${vault.target}/.obsidian/core-plugins-migration.json";
|
||||
value.source = (pkgs.formats.json { }).generate "core-plugins-migration.json" (
|
||||
builtins.listToAttrs (
|
||||
builtins.map (name: {
|
||||
map (name: {
|
||||
inherit name;
|
||||
value = builtins.any (plugin: name == plugin.name && plugin.enable) vault.settings.corePlugins;
|
||||
}) corePlugins
|
||||
@@ -453,7 +453,7 @@ in
|
||||
);
|
||||
}
|
||||
]
|
||||
++ builtins.map (plugin: {
|
||||
++ map (plugin: {
|
||||
name = "${vault.target}/.obsidian/${plugin.name}.json";
|
||||
value.source = (pkgs.formats.json { }).generate "${plugin.name}.json" plugin.settings;
|
||||
}) (builtins.filter (plugin: plugin.settings != { }) vault.settings.corePlugins);
|
||||
@@ -464,25 +464,25 @@ in
|
||||
{
|
||||
name = "${vault.target}/.obsidian/community-plugins.json";
|
||||
value.source = (pkgs.formats.json { }).generate "community-plugins.json" (
|
||||
builtins.map getManifest (builtins.filter (plugin: plugin.enable) vault.settings.communityPlugins)
|
||||
map getManifest (builtins.filter (plugin: plugin.enable) vault.settings.communityPlugins)
|
||||
);
|
||||
}
|
||||
]
|
||||
++ builtins.map (plugin: {
|
||||
++ map (plugin: {
|
||||
name = "${vault.target}/.obsidian/plugins/${getManifest plugin}";
|
||||
value = {
|
||||
source = plugin.pkg;
|
||||
recursive = true;
|
||||
};
|
||||
}) vault.settings.communityPlugins
|
||||
++ builtins.map (plugin: {
|
||||
++ map (plugin: {
|
||||
name = "${vault.target}/.obsidian/plugins/${getManifest plugin}/data.json";
|
||||
value.source = (pkgs.formats.json { }).generate "data.json" plugin.settings;
|
||||
}) (builtins.filter (plugin: plugin.settings != { }) vault.settings.communityPlugins);
|
||||
|
||||
mkCssSnippets =
|
||||
vault:
|
||||
builtins.map (snippet: {
|
||||
map (snippet: {
|
||||
name = "${vault.target}/.obsidian/snippets/${snippet.name}.css";
|
||||
value =
|
||||
if snippet.source != null then
|
||||
@@ -497,7 +497,7 @@ in
|
||||
|
||||
mkThemes =
|
||||
vault:
|
||||
builtins.map (theme: {
|
||||
map (theme: {
|
||||
name = "${vault.target}/.obsidian/themes/${getManifest theme}";
|
||||
value.source = theme.pkg;
|
||||
}) vault.settings.themes;
|
||||
@@ -509,7 +509,7 @@ in
|
||||
|
||||
mkExtraFiles =
|
||||
vault:
|
||||
builtins.map (file: {
|
||||
map (file: {
|
||||
name = "${vault.target}/.obsidian/${file.target}";
|
||||
value =
|
||||
if file.source != null then
|
||||
@@ -524,7 +524,7 @@ in
|
||||
in
|
||||
builtins.listToAttrs (
|
||||
lib.lists.flatten (
|
||||
builtins.map (vault: [
|
||||
map (vault: [
|
||||
(mkApp vault)
|
||||
(mkAppearance vault)
|
||||
(mkCorePlugins vault)
|
||||
@@ -540,7 +540,7 @@ in
|
||||
|
||||
xdg.configFile."obsidian/obsidian.json".source = (pkgs.formats.json { }).generate "obsidian.json" {
|
||||
vaults = builtins.listToAttrs (
|
||||
builtins.map (vault: {
|
||||
map (vault: {
|
||||
name = builtins.hashString "md5" vault.target;
|
||||
value = {
|
||||
path = "${config.home.homeDirectory}/${vault.target}";
|
||||
|
||||
@@ -126,14 +126,22 @@ in
|
||||
};
|
||||
|
||||
commands = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.either lib.types.lines lib.types.path);
|
||||
type = lib.types.either (lib.types.attrsOf (lib.types.either lib.types.lines lib.types.path)) lib.types.path;
|
||||
default = { };
|
||||
description = ''
|
||||
Custom commands for opencode.
|
||||
The attribute name becomes the command filename, and the value is either:
|
||||
- Inline content as a string
|
||||
- A path to a file containing the command content
|
||||
Commands are stored in {file}`$XDG_CONFIG_HOME/.config/opencode/command/` directory.
|
||||
|
||||
This option can either be:
|
||||
- An attribute set defining commands
|
||||
- A path to a directory containing multiple command files
|
||||
|
||||
If an attribute set is used, the attribute name becomes the command filename,
|
||||
and the value is either:
|
||||
- Inline content as a string (creates `opencode/command/<name>.md`)
|
||||
- A path to a file (creates `opencode/command/<name>.md`)
|
||||
|
||||
If a path is used, it is expected to contain command files.
|
||||
The directory is symlinked to {file}`$XDG_CONFIG_HOME/opencode/command/`.
|
||||
'';
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
@@ -155,14 +163,22 @@ in
|
||||
};
|
||||
|
||||
agents = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.either lib.types.lines lib.types.path);
|
||||
type = lib.types.either (lib.types.attrsOf (lib.types.either lib.types.lines lib.types.path)) lib.types.path;
|
||||
default = { };
|
||||
description = ''
|
||||
Custom agents for opencode.
|
||||
The attribute name becomes the agent filename, and the value is either:
|
||||
- Inline content as a string
|
||||
- A path to a file containing the agent content
|
||||
Agents are stored in {file}`$XDG_CONFIG_HOME/.config/opencode/agent/` directory.
|
||||
|
||||
This option can either be:
|
||||
- An attribute set defining agents
|
||||
- A path to a directory containing multiple agent files
|
||||
|
||||
If an attribute set is used, the attribute name becomes the agent filename,
|
||||
and the value is either:
|
||||
- Inline content as a string (creates `opencode/agent/<name>.md`)
|
||||
- A path to a file (creates `opencode/agent/<name>.md`)
|
||||
|
||||
If a path is used, it is expected to contain agent files.
|
||||
The directory is symlinked to {file}`$XDG_CONFIG_HOME/opencode/agent/`.
|
||||
'';
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
@@ -183,22 +199,140 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
themes = mkOption {
|
||||
type = lib.types.attrsOf (lib.types.either jsonFormat.type lib.types.path);
|
||||
skills = lib.mkOption {
|
||||
type = lib.types.either (lib.types.attrsOf (lib.types.either lib.types.lines lib.types.path)) lib.types.path;
|
||||
default = { };
|
||||
description = ''
|
||||
Custom themes for opencode. The attribute name becomes the theme
|
||||
filename, and the value is either:
|
||||
- An attribute set, that is converted to a json
|
||||
- A path to a file containing the content
|
||||
Themes are stored in {file}`$XDG_CONFIG_HOME/opencode/themes/` directory.
|
||||
Custom agent skills for opencode.
|
||||
|
||||
This option can either be:
|
||||
- An attribute set defining skills
|
||||
- A path to a directory containing multiple skill folders
|
||||
|
||||
If an attribute set is used, the attribute name becomes the skill directory name,
|
||||
and the value is either:
|
||||
- Inline content as a string (creates `opencode/skill/<name>/SKILL.md`)
|
||||
- A path to a file (creates `opencode/skill/<name>/SKILL.md`)
|
||||
- A path to a directory (creates `opencode/skill/<name>/` with all files)
|
||||
|
||||
If a path is used, it is expected to contain one folder per skill name, each
|
||||
containing a {file}`SKILL.md`. The directory is symlinked to
|
||||
{file}`$XDG_CONFIG_HOME/opencode/skill/`.
|
||||
|
||||
See <https://opencode.ai/docs/skills/> for the documentation.
|
||||
'';
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
git-release = '''
|
||||
---
|
||||
name: git-release
|
||||
description: Create consistent releases and changelogs
|
||||
---
|
||||
|
||||
## What I do
|
||||
|
||||
- Draft release notes from merged PRs
|
||||
- Propose a version bump
|
||||
- Provide a copy-pasteable `gh release create` command
|
||||
''';
|
||||
|
||||
# A skill can also be a directory containing SKILL.md and other files.
|
||||
data-analysis = ./skills/data-analysis;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
themes = mkOption {
|
||||
type = lib.types.either (lib.types.attrsOf (lib.types.either jsonFormat.type lib.types.path)) lib.types.path;
|
||||
default = { };
|
||||
description = ''
|
||||
Custom themes for opencode.
|
||||
|
||||
This option can either be:
|
||||
- An attribute set defining themes
|
||||
- A path to a directory containing multiple theme files
|
||||
|
||||
If an attribute set is used, the attribute name becomes the theme filename,
|
||||
and the value is either:
|
||||
- An attribute set that is converted to a JSON file (creates `opencode/themes/<name>.json`)
|
||||
- A path to a file (creates `opencode/themes/<name>.json`)
|
||||
|
||||
If a path is used, it is expected to contain theme files.
|
||||
The directory is symlinked to {file}`$XDG_CONFIG_HOME/opencode/themes/`.
|
||||
|
||||
Set `programs.opencode.settings.theme` to enable the custom theme.
|
||||
See <https://opencode.ai/docs/themes/> for the documentation.
|
||||
'';
|
||||
};
|
||||
|
||||
tools = lib.mkOption {
|
||||
type = lib.types.either (lib.types.attrsOf (lib.types.either lib.types.lines lib.types.path)) lib.types.path;
|
||||
default = { };
|
||||
description = ''
|
||||
Custom tools for opencode.
|
||||
|
||||
This option can either be:
|
||||
- An attribute set defining tools
|
||||
- A path to a directory containing multiple tool files
|
||||
|
||||
If an attribute set is used, the attribute name becomes the tool filename,
|
||||
and the value is either:
|
||||
- Inline content as a string (creates `opencode/tool/<name>.ts`)
|
||||
- A path to a file (creates `opencode/tool/<name>.ts` or `opencode/tool/<name>.js`)
|
||||
|
||||
If a path is used, it is expected to contain tool files.
|
||||
The directory is symlinked to {file}`$XDG_CONFIG_HOME/opencode/tool/`.
|
||||
|
||||
See <https://opencode.ai/docs/tools/> for the documentation.
|
||||
'';
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
database-query = '''
|
||||
import { tool } from "@opencode-ai/plugin"
|
||||
|
||||
export default tool({
|
||||
description: "Query the project database",
|
||||
args: {
|
||||
query: tool.schema.string().describe("SQL query to execute"),
|
||||
},
|
||||
async execute(args) {
|
||||
// Your database logic here
|
||||
return `Executed query: ''${args.query}`
|
||||
},
|
||||
})
|
||||
''';
|
||||
|
||||
# Or reference an existing file
|
||||
api-client = ./tools/api-client.ts;
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = !lib.isPath cfg.commands || lib.pathIsDirectory cfg.commands;
|
||||
message = "`programs.opencode.commands` must be a directory when set to a path";
|
||||
}
|
||||
{
|
||||
assertion = !lib.isPath cfg.agents || lib.pathIsDirectory cfg.agents;
|
||||
message = "`programs.opencode.agents` must be a directory when set to a path";
|
||||
}
|
||||
{
|
||||
assertion = !lib.isPath cfg.tools || lib.pathIsDirectory cfg.tools;
|
||||
message = "`programs.opencode.tools` must be a directory when set to a path";
|
||||
}
|
||||
{
|
||||
assertion = !lib.isPath cfg.skills || lib.pathIsDirectory cfg.skills;
|
||||
message = "`programs.opencode.skills` must be a directory when set to a path";
|
||||
}
|
||||
{
|
||||
assertion = !lib.isPath cfg.themes || lib.pathIsDirectory cfg.themes;
|
||||
message = "`programs.opencode.themes` must be a directory when set to a path";
|
||||
}
|
||||
];
|
||||
|
||||
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
xdg.configFile = {
|
||||
@@ -227,36 +361,87 @@ in
|
||||
text = cfg.rules;
|
||||
})
|
||||
);
|
||||
|
||||
"opencode/command" = mkIf (lib.isPath cfg.commands) {
|
||||
source = cfg.commands;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
"opencode/agent" = mkIf (lib.isPath cfg.agents) {
|
||||
source = cfg.agents;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
"opencode/tool" = mkIf (lib.isPath cfg.tools) {
|
||||
source = cfg.tools;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
"opencode/skill" = mkIf (lib.isPath cfg.skills) {
|
||||
source = cfg.skills;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
"opencode/themes" = mkIf (lib.isPath cfg.themes) {
|
||||
source = cfg.themes;
|
||||
recursive = true;
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs (builtins.isAttrs cfg.commands) (
|
||||
lib.mapAttrs' (
|
||||
name: content:
|
||||
lib.nameValuePair "opencode/command/${name}.md" (
|
||||
if lib.isPath content then { source = content; } else { text = content; }
|
||||
)
|
||||
) cfg.commands
|
||||
)
|
||||
// lib.optionalAttrs (builtins.isAttrs cfg.agents) (
|
||||
lib.mapAttrs' (
|
||||
name: content:
|
||||
lib.nameValuePair "opencode/agent/${name}.md" (
|
||||
if lib.isPath content then { source = content; } else { text = content; }
|
||||
)
|
||||
) cfg.agents
|
||||
)
|
||||
// lib.optionalAttrs (builtins.isAttrs cfg.tools) (
|
||||
lib.mapAttrs' (
|
||||
name: content:
|
||||
lib.nameValuePair "opencode/tool/${name}.ts" (
|
||||
if lib.isPath content then { source = content; } else { text = content; }
|
||||
)
|
||||
) cfg.tools
|
||||
)
|
||||
// lib.mapAttrs' (
|
||||
name: content:
|
||||
lib.nameValuePair "opencode/command/${name}.md" (
|
||||
if lib.isPath content then { source = content; } else { text = content; }
|
||||
)
|
||||
) cfg.commands
|
||||
// lib.mapAttrs' (
|
||||
name: content:
|
||||
lib.nameValuePair "opencode/agent/${name}.md" (
|
||||
if lib.isPath content then { source = content; } else { text = content; }
|
||||
)
|
||||
) cfg.agents
|
||||
// lib.mapAttrs' (
|
||||
name: content:
|
||||
lib.nameValuePair "opencode/themes/${name}.json" (
|
||||
if lib.isPath content then
|
||||
{
|
||||
source = content;
|
||||
}
|
||||
else
|
||||
{
|
||||
source = jsonFormat.generate "opencode-${name}.json" (
|
||||
{
|
||||
"$schema" = "https://opencode.ai/theme.json";
|
||||
}
|
||||
// content
|
||||
);
|
||||
}
|
||||
)
|
||||
) cfg.themes;
|
||||
if lib.isPath content && lib.pathIsDirectory content then
|
||||
lib.nameValuePair "opencode/skill/${name}" {
|
||||
source = content;
|
||||
recursive = true;
|
||||
}
|
||||
else
|
||||
lib.nameValuePair "opencode/skill/${name}/SKILL.md" (
|
||||
if lib.isPath content then { source = content; } else { text = content; }
|
||||
)
|
||||
) (if builtins.isAttrs cfg.skills then cfg.skills else { })
|
||||
// lib.optionalAttrs (builtins.isAttrs cfg.themes) (
|
||||
lib.mapAttrs' (
|
||||
name: content:
|
||||
lib.nameValuePair "opencode/themes/${name}.json" (
|
||||
if lib.isPath content then
|
||||
{
|
||||
source = content;
|
||||
}
|
||||
else
|
||||
{
|
||||
source = jsonFormat.generate "opencode-${name}.json" (
|
||||
{
|
||||
"$schema" = "https://opencode.ai/theme.json";
|
||||
}
|
||||
// content
|
||||
);
|
||||
}
|
||||
)
|
||||
) cfg.themes
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ let
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.hm.maintainers.nickthegroot ];
|
||||
meta.maintainers = [ lib.maintainers.nickthegroot ];
|
||||
|
||||
options.programs.pgcli = {
|
||||
enable = mkEnableOption "pgcli";
|
||||
|
||||
@@ -9,6 +9,9 @@ let
|
||||
|
||||
cfg = config.programs.pistol;
|
||||
|
||||
configDir =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Preferences" else config.xdg.configHome;
|
||||
|
||||
configFile = lib.concatStringsSep "\n" (
|
||||
map (
|
||||
{
|
||||
@@ -74,31 +77,23 @@ in
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertions = [
|
||||
{
|
||||
assertion = lib.all (
|
||||
{ fpath, mime, ... }: (fpath != "" && mime == "") || (fpath == "" && mime != "")
|
||||
) cfg.associations;
|
||||
message = ''
|
||||
Each entry in programs.pistol.associations must contain exactly one
|
||||
of fpath or mime.
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
assertion = lib.all (
|
||||
{ fpath, mime, ... }: (fpath != "" && mime == "") || (fpath == "" && mime != "")
|
||||
) cfg.associations;
|
||||
message = ''
|
||||
Each entry in programs.pistol.associations must contain exactly one
|
||||
of fpath or mime.
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
(mkIf (cfg.associations != [ ] && pkgs.stdenv.hostPlatform.isDarwin) {
|
||||
home.file."Library/Preferences/pistol/pistol.conf".text = configFile;
|
||||
})
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
(mkIf (cfg.associations != [ ] && !pkgs.stdenv.hostPlatform.isDarwin) {
|
||||
xdg.configFile."pistol/pistol.conf".text = configFile;
|
||||
})
|
||||
]
|
||||
);
|
||||
home.file."${configDir}/pistol/pistol.conf" = mkIf (cfg.associations != [ ]) {
|
||||
text = configFile;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -19,11 +19,11 @@ let
|
||||
valueToString =
|
||||
value:
|
||||
if builtins.isList value then
|
||||
builtins.concatStringsSep "," (builtins.map valueToString value)
|
||||
builtins.concatStringsSep "," (map valueToString value)
|
||||
else if builtins.isAttrs value then
|
||||
valueToString (lib.mapAttrsToList (key: val: "${valueToString key}=${valueToString val}") value)
|
||||
else
|
||||
builtins.toString value;
|
||||
toString value;
|
||||
|
||||
modulesArgument = optionalString (cfg.modules != null) " -modules ${valueToString cfg.modules}";
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ let
|
||||
else if builtins.isList v then
|
||||
"[${concatStringsSep ", " (map pythonize v)}]"
|
||||
else
|
||||
builtins.toString v;
|
||||
toString v;
|
||||
|
||||
formatDictLine =
|
||||
o: n: v:
|
||||
@@ -336,22 +336,20 @@ in
|
||||
greasemonkeyDir = lib.optionals (
|
||||
cfg.greasemonkey != [ ]
|
||||
) pkgs.linkFarmFromDrvs "greasemonkey-userscripts" cfg.greasemonkey;
|
||||
|
||||
configDir =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then
|
||||
".qutebrowser"
|
||||
else
|
||||
"${config.xdg.configHome}/qutebrowser";
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
home.file.".qutebrowser/config.py" = mkIf pkgs.stdenv.hostPlatform.isDarwin {
|
||||
text = qutebrowserConfig;
|
||||
};
|
||||
|
||||
home.file.".qutebrowser/quickmarks" =
|
||||
mkIf (cfg.quickmarks != { } && pkgs.stdenv.hostPlatform.isDarwin)
|
||||
{
|
||||
text = quickmarksFile;
|
||||
};
|
||||
|
||||
xdg.configFile."qutebrowser/config.py" = mkIf pkgs.stdenv.hostPlatform.isLinux {
|
||||
home.file."${configDir}/config.py" = {
|
||||
text = qutebrowserConfig;
|
||||
}
|
||||
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||
onChange = ''
|
||||
hash="$(echo -n "$USER" | md5sum | cut -d' ' -f1)"
|
||||
socket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/qutebrowser/ipc-$hash"
|
||||
@@ -371,22 +369,12 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
xdg.configFile."qutebrowser/quickmarks" =
|
||||
mkIf (cfg.quickmarks != { } && pkgs.stdenv.hostPlatform.isLinux)
|
||||
{
|
||||
text = quickmarksFile;
|
||||
};
|
||||
home.file."${configDir}/quickmarks" = mkIf (cfg.quickmarks != { }) {
|
||||
text = quickmarksFile;
|
||||
};
|
||||
|
||||
home.file.".qutebrowser/greasemonkey" =
|
||||
mkIf (cfg.greasemonkey != [ ] && pkgs.stdenv.hostPlatform.isDarwin)
|
||||
{
|
||||
source = greasemonkeyDir;
|
||||
};
|
||||
|
||||
xdg.configFile."qutebrowser/greasemonkey" =
|
||||
mkIf (cfg.greasemonkey != [ ] && pkgs.stdenv.hostPlatform.isLinux)
|
||||
{
|
||||
source = greasemonkeyDir;
|
||||
};
|
||||
home.file."${configDir}/greasemonkey" = mkIf (cfg.greasemonkey != [ ]) {
|
||||
source = greasemonkeyDir;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ in
|
||||
}
|
||||
{
|
||||
assertion = cfg.uri.web-rad.enable -> cfg.uri.web-rad.browser != null;
|
||||
message = "Could not detect preferred browser. Please set `${builtins.toString opt.uri.web-rad.browser}`.";
|
||||
message = "Could not detect preferred browser. Please set `${toString opt.uri.web-rad.browser}`.";
|
||||
}
|
||||
{
|
||||
assertion =
|
||||
|
||||
@@ -71,7 +71,7 @@ in
|
||||
|
||||
home.file.".rbenv/plugins" = mkIf (cfg.plugins != [ ]) {
|
||||
source = pkgs.linkFarm "rbenv-plugins" (
|
||||
builtins.map (p: {
|
||||
map (p: {
|
||||
name = p.name;
|
||||
path = p.src;
|
||||
}) cfg.plugins
|
||||
|
||||
@@ -10,7 +10,6 @@ let
|
||||
jsonFormat = pkgs.formats.json { };
|
||||
|
||||
inherit (lib) mkOption types;
|
||||
inherit (pkgs.stdenv.hostPlatform) isDarwin;
|
||||
|
||||
settingsModule = types.submodule {
|
||||
freeformType = jsonFormat.type;
|
||||
@@ -62,6 +61,9 @@ let
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configDir =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome;
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.maintainers; [ ambroisie ];
|
||||
@@ -93,21 +95,11 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
home.packages = [ cfg.package ];
|
||||
}
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
# Only manage configuration if not empty
|
||||
(lib.mkIf (cfg.settings != null && !isDarwin) {
|
||||
xdg.configFile."rbw/config.json".source = jsonFormat.generate "rbw-config.json" cfg.settings;
|
||||
})
|
||||
|
||||
(lib.mkIf (cfg.settings != null && isDarwin) {
|
||||
home.file."Library/Application Support/rbw/config.json".source =
|
||||
jsonFormat.generate "rbw-config.json" cfg.settings;
|
||||
})
|
||||
]
|
||||
);
|
||||
home.file."${configDir}/rbw/config.json" = lib.mkIf (cfg.settings != null) {
|
||||
source = jsonFormat.generate "rbw-config.json" cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ let
|
||||
modes = map (mode: if isString mode then mode else "${mode.name}:${mode.path}") cfg.modes;
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.maintainers; [ ];
|
||||
meta.maintainers = [ ];
|
||||
|
||||
options.programs.rofi = {
|
||||
enable = lib.mkEnableOption "Rofi: A window switcher, application launcher and dmenu replacement";
|
||||
|
||||
@@ -11,6 +11,9 @@ let
|
||||
|
||||
iniFormat = pkgs.formats.ini { };
|
||||
|
||||
configDir =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Preferences" else config.xdg.configHome;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.pbar ];
|
||||
@@ -55,32 +58,22 @@ in
|
||||
{
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
programs.sapling.iniContent.ui = {
|
||||
username = cfg.userName + " <" + cfg.userEmail + ">";
|
||||
programs.sapling.iniContent = {
|
||||
alias = mkIf (cfg.aliases != { }) cfg.aliases;
|
||||
ui.username = cfg.userName + " <" + cfg.userEmail + ">";
|
||||
};
|
||||
|
||||
home.file."${configDir}/sapling/sapling.conf" = mkIf (cfg.iniContent != { }) {
|
||||
source = iniFormat.generate "sapling.conf" cfg.iniContent;
|
||||
};
|
||||
}
|
||||
|
||||
(mkIf (!pkgs.stdenv.isDarwin) {
|
||||
xdg.configFile."sapling/sapling.conf".source = iniFormat.generate "sapling.conf" cfg.iniContent;
|
||||
})
|
||||
(mkIf (pkgs.stdenv.isDarwin) {
|
||||
home.file."Library/Preferences/sapling/sapling.conf".source =
|
||||
iniFormat.generate "sapling.conf" cfg.iniContent;
|
||||
})
|
||||
|
||||
(mkIf (cfg.aliases != { }) {
|
||||
programs.sapling.iniContent.alias = cfg.aliases;
|
||||
})
|
||||
|
||||
(mkIf (lib.isAttrs cfg.extraConfig) {
|
||||
programs.sapling.iniContent = cfg.extraConfig;
|
||||
})
|
||||
|
||||
(mkIf (lib.isString cfg.extraConfig && !pkgs.stdenv.isDarwin) {
|
||||
xdg.configFile."sapling/sapling.conf".text = cfg.extraConfig;
|
||||
})
|
||||
(mkIf (lib.isString cfg.extraConfig && pkgs.stdenv.isDarwin) {
|
||||
home.file."Library/Preferences/sapling/sapling.conf".text = cfg.extraConfig;
|
||||
(mkIf (lib.isString cfg.extraConfig) {
|
||||
home.file."${configDir}/sapling/sapling.conf".text = cfg.extraConfig;
|
||||
})
|
||||
]
|
||||
);
|
||||
|
||||
@@ -40,6 +40,12 @@ let
|
||||
description = "The remote path to mount.";
|
||||
};
|
||||
|
||||
mountDestPath = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "The path on the current machine where the remote path would be mounted.";
|
||||
};
|
||||
|
||||
authType = mkOption {
|
||||
type = types.enum [
|
||||
"password"
|
||||
@@ -47,6 +53,7 @@ let
|
||||
"hostbased"
|
||||
"keyboard-interactive"
|
||||
"gssapi-with-mic"
|
||||
"authentication-agent"
|
||||
];
|
||||
default = "publickey";
|
||||
description = "The authentication method to use.";
|
||||
|
||||
@@ -158,7 +158,7 @@ in
|
||||
prjConf =
|
||||
lib.attrsets.mapAttrs' (
|
||||
name: value:
|
||||
(lib.attrsets.nameValuePair (if name == "beforeStart" then "before_start" else name) (value))
|
||||
(lib.attrsets.nameValuePair (if name == "beforeStart" then "before_start" else name) value)
|
||||
) v
|
||||
// {
|
||||
session = k;
|
||||
|
||||
@@ -30,44 +30,42 @@ let
|
||||
mapAttrsToList (name: value: ''${name}="${lib.escape [ ''"'' "\\" ] (toString value)}"'') envStr
|
||||
);
|
||||
|
||||
bindOptions = {
|
||||
address = mkOption {
|
||||
type = types.str;
|
||||
default = "localhost";
|
||||
example = "example.org";
|
||||
description = "The address where to bind the port.";
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.nullOr types.port;
|
||||
default = null;
|
||||
example = 8080;
|
||||
description = "Specifies port number to bind on bind address.";
|
||||
};
|
||||
};
|
||||
|
||||
dynamicForwardModule = types.submodule { options = bindOptions; };
|
||||
|
||||
forwardModule = types.submodule {
|
||||
options = {
|
||||
bind = bindOptions;
|
||||
|
||||
host = {
|
||||
mkAddressPortModule =
|
||||
{
|
||||
actionType,
|
||||
nullableAddress ? actionType == "forward",
|
||||
}:
|
||||
types.submodule {
|
||||
options = {
|
||||
address = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
type = if nullableAddress then types.nullOr types.str else types.str;
|
||||
default = if nullableAddress then null else "localhost";
|
||||
example = "example.org";
|
||||
description = "The address where to forward the traffic to.";
|
||||
description = "The address to ${actionType} to.";
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.nullOr types.port;
|
||||
default = null;
|
||||
example = 80;
|
||||
description = "Specifies port number to forward the traffic to.";
|
||||
example = 8080;
|
||||
description = "Specifies port number to ${actionType} to.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
dynamicForwardModule = mkAddressPortModule { actionType = "bind"; };
|
||||
|
||||
forwardModule = types.submodule {
|
||||
options = {
|
||||
bind = mkOption {
|
||||
type = mkAddressPortModule { actionType = "bind"; };
|
||||
description = "Local port binding options";
|
||||
};
|
||||
host = mkOption {
|
||||
type = mkAddressPortModule { actionType = "forward"; };
|
||||
description = "Host port binding options";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
matchBlockModule = types.submodule {
|
||||
@@ -383,6 +381,18 @@ let
|
||||
example = "10m";
|
||||
description = "Whether control socket should remain open in the background.";
|
||||
};
|
||||
|
||||
kexAlgorithms = mkOption {
|
||||
type = types.nullOr (types.listOf types.str);
|
||||
default = null;
|
||||
example = [
|
||||
"curve25519-sha256@libssh.org"
|
||||
"diffie-hellman-group-exchange-sha256"
|
||||
];
|
||||
description = ''
|
||||
Specifies the available KEX (Key Exchange) algorithms.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
# config.host = mkDefault dagName;
|
||||
@@ -430,6 +440,9 @@ let
|
||||
++ map (f: " LocalForward" + addressPort f.bind + addressPort f.host) cf.localForwards
|
||||
++ map (f: " RemoteForward" + addressPort f.bind + addressPort f.host) cf.remoteForwards
|
||||
++ map (f: " DynamicForward" + addressPort f) cf.dynamicForwards
|
||||
++ optional (
|
||||
cf.kexAlgorithms != null
|
||||
) " KexAlgorithms ${builtins.concatStringsSep "," cf.kexAlgorithms}"
|
||||
++ [
|
||||
(lib.generators.toKeyValue {
|
||||
mkKeyValue = lib.generators.mkKeyValueDefault { } " ";
|
||||
|
||||
@@ -9,6 +9,11 @@ let
|
||||
|
||||
cfg = config.programs.streamlink;
|
||||
|
||||
configDir =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome;
|
||||
dataDir =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.dataHome;
|
||||
|
||||
renderSettings =
|
||||
settings:
|
||||
lib.concatLines (
|
||||
@@ -18,9 +23,9 @@ let
|
||||
if (builtins.isBool value) then
|
||||
if value then name else ""
|
||||
else if (builtins.isList value) then
|
||||
lib.concatStringsSep "\n" (builtins.map (item: "${name}=${builtins.toString item}") value)
|
||||
lib.concatStringsSep "\n" (map (item: "${name}=${toString item}") value)
|
||||
else
|
||||
"${name}=${builtins.toString value}"
|
||||
"${name}=${toString value}"
|
||||
) settings
|
||||
)
|
||||
);
|
||||
@@ -130,72 +135,36 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{ home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; }
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
(lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
|
||||
xdg.configFile = {
|
||||
"streamlink/config" = lib.mkIf (cfg.settings != { }) {
|
||||
text = renderSettings cfg.settings;
|
||||
};
|
||||
home.file = {
|
||||
"${configDir}/streamlink/config" = lib.mkIf (cfg.settings != { }) {
|
||||
text = renderSettings cfg.settings;
|
||||
};
|
||||
}
|
||||
// (lib.mapAttrs' (
|
||||
name: value:
|
||||
lib.nameValuePair "${configDir}/streamlink/config.${name}" (
|
||||
lib.mkIf (value.settings != { }) {
|
||||
text = renderSettings value.settings;
|
||||
}
|
||||
// (lib.mapAttrs' (
|
||||
name: value:
|
||||
lib.nameValuePair "streamlink/config.${name}" (
|
||||
lib.mkIf (value.settings != { }) {
|
||||
text = renderSettings value.settings;
|
||||
)
|
||||
) cfg.plugins)
|
||||
// (lib.mapAttrs' (
|
||||
name: value:
|
||||
lib.nameValuePair "${dataDir}/streamlink/plugins/${name}.py" (
|
||||
lib.mkIf (value.src != null) (
|
||||
if (builtins.isPath value.src) then
|
||||
{
|
||||
source = value.src;
|
||||
}
|
||||
)
|
||||
) cfg.plugins);
|
||||
|
||||
xdg.dataFile = lib.mapAttrs' (
|
||||
name: value:
|
||||
lib.nameValuePair "streamlink/plugins/${name}.py" (
|
||||
lib.mkIf (value.src != null) (
|
||||
if (builtins.isPath value.src) then
|
||||
{
|
||||
source = value.src;
|
||||
}
|
||||
else
|
||||
{
|
||||
text = value.src;
|
||||
}
|
||||
)
|
||||
)
|
||||
) cfg.plugins;
|
||||
})
|
||||
|
||||
(lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
|
||||
home.file = {
|
||||
"Library/Application Support/streamlink/config" = lib.mkIf (cfg.settings != { }) {
|
||||
text = renderSettings cfg.settings;
|
||||
};
|
||||
}
|
||||
// (lib.mapAttrs' (
|
||||
name: value:
|
||||
lib.nameValuePair "Library/Application Support/streamlink/config.${name}" (
|
||||
lib.mkIf (value.settings != { }) {
|
||||
text = renderSettings value.settings;
|
||||
else
|
||||
{
|
||||
text = value.src;
|
||||
}
|
||||
)
|
||||
) cfg.plugins)
|
||||
// (lib.mapAttrs' (
|
||||
name: value:
|
||||
lib.nameValuePair "Library/Application Support/streamlink/plugins/${name}.py" (
|
||||
lib.mkIf (value.src != null) (
|
||||
if (builtins.isPath value.src) then
|
||||
{
|
||||
source = value.src;
|
||||
}
|
||||
else
|
||||
{
|
||||
text = value.src;
|
||||
}
|
||||
)
|
||||
)
|
||||
) cfg.plugins);
|
||||
})
|
||||
]
|
||||
);
|
||||
)
|
||||
)
|
||||
) cfg.plugins);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -85,8 +85,7 @@ in
|
||||
if v == false then
|
||||
""
|
||||
else
|
||||
(if v == true then n else n + "=" + (if builtins.isPath v then "${v}" else builtins.toString v))
|
||||
+ "\n"
|
||||
(if v == true then n else n + "=" + (if builtins.isPath v then "${v}" else toString v)) + "\n"
|
||||
) cfg.settings
|
||||
);
|
||||
};
|
||||
|
||||
@@ -183,14 +183,12 @@ let
|
||||
3;
|
||||
"mail.smtpserver.smtp_${id}.username" = account.userName;
|
||||
}
|
||||
// builtins.foldl' (a: b: a // b) { } (
|
||||
builtins.map (address: toThunderbirdSMTP account address) addresses
|
||||
)
|
||||
// builtins.foldl' (a: b: a // b) { } (map (address: toThunderbirdSMTP account address) addresses)
|
||||
// optionalAttrs (account.smtp != null && account.primary) {
|
||||
"mail.smtp.defaultserver" = "smtp_${id}";
|
||||
}
|
||||
// builtins.foldl' (a: b: a // b) { } (
|
||||
builtins.map (address: toThunderbirdIdentity account address) addresses
|
||||
map (address: toThunderbirdIdentity account address) addresses
|
||||
)
|
||||
// account.thunderbird.settings id;
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ in
|
||||
let
|
||||
conf =
|
||||
optional (cfg.host != null) ''set -g tmate-server-host "${cfg.host}"''
|
||||
++ optional (cfg.port != null) "set -g tmate-server-port ${builtins.toString cfg.port}"
|
||||
++ optional (cfg.port != null) "set -g tmate-server-port ${toString cfg.port}"
|
||||
++ optional (
|
||||
cfg.dsaFingerprint != null
|
||||
) ''set -g tmate-server-ed25519-fingerprint "${cfg.dsaFingerprint}"''
|
||||
|
||||
@@ -92,9 +92,12 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable (
|
||||
config =
|
||||
let
|
||||
config =
|
||||
configDir =
|
||||
if pkgs.stdenv.hostPlatform.isDarwin then "Library/Application Support" else config.xdg.configHome;
|
||||
|
||||
configFiles =
|
||||
lib.attrsets.unionOfDisjoint
|
||||
{
|
||||
"vesktop/settings.json" = lib.mkIf (cfg.settings != { }) {
|
||||
@@ -117,16 +120,11 @@ in
|
||||
) cfg.vencord.themes
|
||||
);
|
||||
in
|
||||
lib.mkMerge [
|
||||
{
|
||||
home.packages = [
|
||||
(cfg.package.override { withSystemVencord = cfg.vencord.useSystem; })
|
||||
];
|
||||
}
|
||||
(lib.mkIf (!pkgs.stdenv.hostPlatform.isDarwin) { xdg.configFile = config; })
|
||||
(lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
|
||||
home.file = lib.mapAttrs' (n: v: lib.nameValuePair "Library/Application Support/${n}" v) config;
|
||||
})
|
||||
]
|
||||
);
|
||||
lib.mkIf cfg.enable {
|
||||
home.packages = [
|
||||
(cfg.package.override { withSystemVencord = cfg.vencord.useSystem; })
|
||||
];
|
||||
|
||||
home.file = lib.mapAttrs' (n: lib.nameValuePair "${configDir}/${n}") configFiles;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ let
|
||||
|
||||
packageVersion = if cfg.package != null then lib.getVersion cfg.package else null;
|
||||
themeIsToml = lib.versionAtLeast packageVersion "0.15.0";
|
||||
versionPost0_17 = lib.versionAtLeast packageVersion "0.17.0";
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.leiserfg ];
|
||||
@@ -43,7 +44,12 @@ in
|
||||
useLayerShell = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "If vicinae should use the layer shell";
|
||||
description = ''
|
||||
Whether vicinae should use the layer shell.
|
||||
If you are using version 0.17 or newer, you should use
|
||||
{option}.programs.vicinae.settings.launcher_window.layer_shell.enabled = false
|
||||
instead.
|
||||
'';
|
||||
};
|
||||
|
||||
extensions = lib.mkOption {
|
||||
@@ -127,27 +133,22 @@ in
|
||||
settings = lib.mkOption {
|
||||
inherit (jsonFormat) type;
|
||||
default = { };
|
||||
description = "Settings written as JSON to `~/.config/vicinae/vicinae.json.";
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
faviconService = "twenty";
|
||||
font = {
|
||||
size = 10;
|
||||
};
|
||||
popToRootOnClose = false;
|
||||
rootSearch = {
|
||||
searchFiles = false;
|
||||
};
|
||||
favicon_service = "twenty";
|
||||
font.normal.size = 10;
|
||||
pop_to_root_on_close=false;
|
||||
search_files_in_root= false;
|
||||
theme = {
|
||||
name = "vicinae-dark";
|
||||
};
|
||||
window = {
|
||||
csd = true;
|
||||
opacity = 0.95;
|
||||
rounding = 10;
|
||||
dark.name = "vicinae-dark";
|
||||
light.name = "vicinae-light";
|
||||
};
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Settings written as JSON to {file}`~/.config/vicinae/settings.json`.
|
||||
See {command}`vicinae config default`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
@@ -158,6 +159,10 @@ in
|
||||
assertion = cfg.systemd.enable -> cfg.package != null;
|
||||
message = "{option}programs.vicinae.systemd.enable requires non null {option}programs.vicinae.package";
|
||||
}
|
||||
{
|
||||
assertion = !cfg.useLayerShell -> !versionPost0_17;
|
||||
message = ''After version 0.17, if you want to explicitly disable the use of layer shell, you need to set {option}.programs.vicinae.settings.launcher_window.layer_shell.enabled = false.'';
|
||||
}
|
||||
];
|
||||
lib.vicinae.mkExtension = (
|
||||
{
|
||||
@@ -223,10 +228,11 @@ in
|
||||
source = themeFormat.generate "vicinae-${name}-theme" theme;
|
||||
}
|
||||
) cfg.themes;
|
||||
settingsPath = if versionPost0_17 then "vicinae/settings.json" else "vicinae/vicinae.json";
|
||||
in
|
||||
{
|
||||
configFile = {
|
||||
"vicinae/vicinae.json" = lib.mkIf (cfg.settings != { }) {
|
||||
"${settingsPath}" = lib.mkIf (cfg.settings != { }) {
|
||||
source = jsonFormat.generate "vicinae-settings" cfg.settings;
|
||||
};
|
||||
}
|
||||
@@ -234,7 +240,7 @@ in
|
||||
|
||||
dataFile =
|
||||
builtins.listToAttrs (
|
||||
builtins.map (item: {
|
||||
map (item: {
|
||||
name = "vicinae/extensions/${item.name}";
|
||||
value.source = item;
|
||||
}) cfg.extensions
|
||||
@@ -250,14 +256,16 @@ in
|
||||
PartOf = [ cfg.systemd.target ];
|
||||
};
|
||||
Service = {
|
||||
EnvironmentFile = pkgs.writeText "vicinae-env" ''
|
||||
USE_LAYER_SHELL=${if cfg.useLayerShell then builtins.toString 1 else builtins.toString 0}
|
||||
'';
|
||||
Type = "simple";
|
||||
ExecStart = "${lib.getExe' cfg.package "vicinae"} server";
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
KillMode = "process";
|
||||
EnvironmentFile = lib.mkIf (!versionPost0_17) (
|
||||
pkgs.writeText "vicinae-env" ''
|
||||
USE_LAYER_SHELL=${if cfg.useLayerShell then toString 1 else toString 0}
|
||||
''
|
||||
);
|
||||
};
|
||||
Install = lib.mkIf cfg.systemd.autoStart {
|
||||
WantedBy = [ cfg.systemd.target ];
|
||||
|
||||
@@ -517,7 +517,7 @@ in
|
||||
else
|
||||
{ };
|
||||
# Merge MCP servers: transformed servers + user servers, with user servers taking precedence
|
||||
mergedServers = transformedMcpServers // ((v.userMcp.servers or { }));
|
||||
mergedServers = transformedMcpServers // (v.userMcp.servers or { });
|
||||
# Merge all MCP config
|
||||
mergedMcpConfig =
|
||||
v.userMcp // (lib.optionalAttrs (mergedServers != { }) { servers = mergedServers; });
|
||||
|
||||
@@ -301,7 +301,7 @@ in
|
||||
{
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "programs.waybar" pkgs lib.platforms.linux)
|
||||
({
|
||||
{
|
||||
assertion =
|
||||
if lib.versionAtLeast config.home.stateVersion "22.05" then
|
||||
all (x: !hasAttr "modules" x || x.modules == null) settings
|
||||
@@ -311,7 +311,7 @@ in
|
||||
The `programs.waybar.settings.[].modules` option has been removed.
|
||||
It is now possible to declare modules in the configuration without nesting them under the `modules` option.
|
||||
'';
|
||||
})
|
||||
}
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
@@ -58,7 +58,7 @@ in
|
||||
xdg.configFile."waylogout/config" = lib.mkIf (cfg.settings != { }) {
|
||||
text = lib.concatStrings (
|
||||
lib.mapAttrsToList (
|
||||
n: v: if v == false then "" else (if v == true then n else n + "=" + builtins.toString v) + "\n"
|
||||
n: v: if v == false then "" else (if v == true then n else n + "=" + toString v) + "\n"
|
||||
) cfg.settings
|
||||
);
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@ let
|
||||
'';
|
||||
}
|
||||
else
|
||||
builtins.dirOf value;
|
||||
dirOf value;
|
||||
|
||||
makePluginSearchPath = p: "${p}/?/init.lua;${p}/?.lua";
|
||||
|
||||
@@ -46,9 +46,9 @@ let
|
||||
searchPaths = map makePluginSearchPath wrappedPlugins;
|
||||
pluginSearchPath = lib.concatStringsSep ";" searchPaths;
|
||||
in
|
||||
(''
|
||||
''
|
||||
package.path = "${pluginSearchPath};" .. package.path
|
||||
'')
|
||||
''
|
||||
else
|
||||
"\n";
|
||||
|
||||
|
||||
@@ -9,12 +9,27 @@ let
|
||||
|
||||
cfg = config.programs.yt-dlp;
|
||||
|
||||
renderSettings = lib.mapAttrsToList (
|
||||
configAtom =
|
||||
with types;
|
||||
oneOf [
|
||||
bool
|
||||
int
|
||||
str
|
||||
];
|
||||
|
||||
renderSingleOption =
|
||||
name: value:
|
||||
if lib.isBool value then
|
||||
if value then "--${name}" else "--no-${name}"
|
||||
else
|
||||
"--${name} ${toString value}"
|
||||
"--${name} ${toString value}";
|
||||
|
||||
renderSettings = lib.mapAttrsToList (
|
||||
name: value:
|
||||
if lib.isList value then
|
||||
lib.concatStringsSep "\n" (map (renderSingleOption name) value)
|
||||
else
|
||||
renderSingleOption name value
|
||||
);
|
||||
|
||||
in
|
||||
@@ -27,13 +42,7 @@ in
|
||||
package = lib.mkPackageOption pkgs "yt-dlp" { };
|
||||
|
||||
settings = mkOption {
|
||||
type =
|
||||
with types;
|
||||
attrsOf (oneOf [
|
||||
bool
|
||||
int
|
||||
str
|
||||
]);
|
||||
type = with types; attrsOf (either configAtom (listOf configAtom));
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
@@ -42,6 +51,10 @@ in
|
||||
sub-langs = "all";
|
||||
downloader = "aria2c";
|
||||
downloader-args = "aria2c:'-c -x8 -s8 -k1M'";
|
||||
color = [
|
||||
"stdout:no_color"
|
||||
"stderr:always"
|
||||
];
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
options,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -100,9 +101,18 @@ in
|
||||
};
|
||||
|
||||
dotDir = mkOption {
|
||||
default = homeDir;
|
||||
defaultText = "`config.home.homeDirectory`";
|
||||
example = "`\${config.xdg.configHome}/zsh`";
|
||||
default =
|
||||
if config.xdg.enable && lib.versionAtLeast config.home.stateVersion "26.05" then
|
||||
"${config.xdg.configHome}/zsh"
|
||||
else
|
||||
homeDir;
|
||||
defaultText = lib.literalExpression ''
|
||||
if config.xdg.enable && lib.versionAtLeast config.home.stateVersion "26.05" then
|
||||
"''${config.xdg.configHome}/zsh"
|
||||
else
|
||||
config.home.homeDirectory
|
||||
'';
|
||||
example = literalExpression ''"''${config.xdg.configHome}/zsh"'';
|
||||
description = ''
|
||||
Directory where the zsh configuration and more should be located,
|
||||
relative to the users home directory. The default is the home
|
||||
@@ -391,7 +401,24 @@ in
|
||||
- config.xdg.dataHome (XDG data directory)
|
||||
- config.xdg.cacheHome (XDG cache directory)
|
||||
''
|
||||
];
|
||||
]
|
||||
++
|
||||
lib.optionals
|
||||
(
|
||||
config.xdg.enable
|
||||
&& !lib.versionAtLeast config.home.stateVersion "26.05"
|
||||
&& options.programs.zsh.dotDir.highestPrio >= 1500
|
||||
)
|
||||
[
|
||||
''
|
||||
The default value of `programs.zsh.dotDir` will change in future versions.
|
||||
You are currently using the legacy default (home directory) because `home.stateVersion` is less than "26.05".
|
||||
To silence this warning and lock in the current behavior, set:
|
||||
programs.zsh.dotDir = config.home.homeDirectory;
|
||||
To adopt the new behavior (XDG config directory), set:
|
||||
programs.zsh.dotDir = "''${config.xdg.configHome}/zsh";
|
||||
''
|
||||
];
|
||||
}
|
||||
|
||||
(mkIf (cfg.envExtra != "") {
|
||||
@@ -412,7 +439,7 @@ in
|
||||
|
||||
(mkIf (dotDirAbs != homeDir) {
|
||||
home.file."${dotDirRel}/.zshenv".text = ''
|
||||
export ZDOTDIR=${dotDirAbs}
|
||||
${config.lib.zsh.export "ZDOTDIR" dotDirAbs}
|
||||
'';
|
||||
|
||||
# When dotDir is set, only use ~/.zshenv to source ZDOTDIR/.zshenv,
|
||||
@@ -420,7 +447,7 @@ in
|
||||
# already set correctly (by e.g. spawning a zsh inside a zsh), all env
|
||||
# vars still get exported
|
||||
home.file.".zshenv".text = ''
|
||||
source ${dotDirAbs}/.zshenv
|
||||
source ${lib.escapeShellArg "${dotDirAbs}/.zshenv"}
|
||||
'';
|
||||
})
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.programs.zsh;
|
||||
|
||||
stripSlash = lib.removeSuffix "/";
|
||||
in
|
||||
rec {
|
||||
homeDir = config.home.homeDirectory;
|
||||
# Raw home directory, no trailing slash.
|
||||
homeDir = stripSlash config.home.homeDirectory;
|
||||
|
||||
/*
|
||||
Escape a path string for shell usage and remove trailing slashes.
|
||||
@@ -18,10 +21,11 @@ rec {
|
||||
cleanPathStr "/path/to/dir/" => "'/path/to/dir'"
|
||||
cleanPathStr "path with spaces" => "'path with spaces'"
|
||||
*/
|
||||
cleanPathStr = pathStr: lib.escapeShellArg (lib.removeSuffix "/" pathStr);
|
||||
cleanPathStr = pathStr: lib.escapeShellArg (stripSlash pathStr);
|
||||
|
||||
/*
|
||||
Convert an absolute path to a relative path by stripping the home directory prefix.
|
||||
Returns the raw path (unescaped) for use in home.file keys.
|
||||
|
||||
This function converts absolute paths within the home directory to relative paths
|
||||
by removing the home directory prefix. Paths already relative are returned as-is.
|
||||
@@ -30,19 +34,22 @@ rec {
|
||||
Type: String -> String
|
||||
|
||||
Example:
|
||||
mkRelPathStr "/home/user/config" => "'config'"
|
||||
mkRelPathStr "config" => "'config'"
|
||||
mkRelPathStr "/home/user/config" => "config"
|
||||
mkRelPathStr "config" => "config"
|
||||
mkRelPathStr "/home/user" => "."
|
||||
mkRelPathStr "/etc/config" => <error>
|
||||
*/
|
||||
mkRelPathStr =
|
||||
pathStr:
|
||||
# is already a relative path
|
||||
if (!lib.hasPrefix "/" pathStr) then
|
||||
cleanPathStr pathStr
|
||||
# is an absolute path within home dir
|
||||
else if (lib.hasPrefix homeDir pathStr) then
|
||||
cleanPathStr (lib.removePrefix "${homeDir}/" pathStr)
|
||||
# is an absolute path not in home dir
|
||||
let
|
||||
normPath = stripSlash pathStr;
|
||||
in
|
||||
if (!lib.hasPrefix "/" normPath) then
|
||||
normPath
|
||||
else if normPath == homeDir then
|
||||
"."
|
||||
else if (lib.hasPrefix "${homeDir}/" normPath) then
|
||||
lib.removePrefix "${homeDir}/" normPath
|
||||
else
|
||||
throw ''
|
||||
Attempted to convert an absolute path not within home directory to a
|
||||
@@ -54,47 +61,47 @@ rec {
|
||||
'';
|
||||
|
||||
/*
|
||||
Convert a relative path to an absolute path by prepending the home directory.
|
||||
Convert a relative path to an absolute path.
|
||||
Returns RAW path (unescaped).
|
||||
|
||||
This function ensures paths are absolute by prepending the home directory
|
||||
to relative paths. Already absolute paths are returned unchanged (after cleaning).
|
||||
This function does NOT support shell variables.
|
||||
|
||||
Type: String -> String
|
||||
|
||||
Example:
|
||||
mkAbsPathStr "config" => "'/home/user/config'"
|
||||
mkAbsPathStr "/absolute/path" => "'/absolute/path'"
|
||||
mkAbsPathStr "config" => "/home/user/config"
|
||||
mkAbsPathStr "/absolute/path" => "/absolute/path"
|
||||
*/
|
||||
mkAbsPathStr =
|
||||
pathStr: cleanPathStr ((lib.optionalString (!lib.hasPrefix "/" pathStr) "${homeDir}/") + pathStr);
|
||||
pathStr:
|
||||
let
|
||||
normPath = stripSlash pathStr;
|
||||
in
|
||||
if lib.hasPrefix "/" normPath then normPath else "${homeDir}/${normPath}";
|
||||
|
||||
/*
|
||||
Convert a path to absolute form while preserving shell variables for runtime expansion.
|
||||
Convert a path to absolute form while preserving shell variables.
|
||||
Returns RAW path (unescaped) unless vars are present (then preserves vars).
|
||||
|
||||
This function handles both literal paths and shell variable expressions.
|
||||
Shell variables (containing '$') are preserved unescaped to allow runtime expansion.
|
||||
Literal paths are made absolute and properly escaped for shell usage.
|
||||
Literal paths are made absolute.
|
||||
|
||||
Type: String -> String
|
||||
|
||||
Example:
|
||||
mkShellVarPathStr "config" => "'/home/user/config'"
|
||||
mkShellVarPathStr "config" => "/home/user/config"
|
||||
mkShellVarPathStr "$HOME/config" => "$HOME/config"
|
||||
mkShellVarPathStr "\${XDG_CONFIG_HOME:-$HOME/.config}/app" => "\${XDG_CONFIG_HOME:-$HOME/.config}/app"
|
||||
*/
|
||||
mkShellVarPathStr =
|
||||
pathStr:
|
||||
let
|
||||
cleanPath = lib.removeSuffix "/" pathStr;
|
||||
hasShellVars = lib.hasInfix "$" cleanPath;
|
||||
normPath = stripSlash pathStr;
|
||||
hasShellVars = lib.hasInfix "$" normPath;
|
||||
in
|
||||
if hasShellVars then
|
||||
# Does not escape shell variables, allowing them to be expanded at runtime
|
||||
cleanPath
|
||||
else
|
||||
# For literal paths, make them absolute if needed and escape them
|
||||
cleanPathStr ((lib.optionalString (!lib.hasPrefix "/" cleanPath) "${homeDir}/") + cleanPath);
|
||||
if hasShellVars then normPath else mkAbsPathStr normPath;
|
||||
|
||||
dotDirAbs = mkAbsPathStr cfg.dotDir;
|
||||
dotDirRel = mkRelPathStr cfg.dotDir;
|
||||
@@ -107,5 +114,5 @@ rec {
|
||||
|
||||
Type: String
|
||||
*/
|
||||
pluginsDir = dotDirAbs + (lib.optionalString (homeDir == dotDirAbs) "/.zsh") + "/plugins";
|
||||
pluginsDir = dotDirAbs + (lib.optionalString (mkRelPathStr cfg.dotDir == ".") "/.zsh") + "/plugins";
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ let
|
||||
);
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.maintainers; [ foo-dogsquared ];
|
||||
meta.maintainers = [ ];
|
||||
|
||||
options.services.activitywatch = {
|
||||
enable = lib.mkEnableOption "ActivityWatch, an automated time tracker";
|
||||
|
||||
@@ -32,78 +32,72 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf serviceConfig.enable (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf pkgs.stdenv.isLinux {
|
||||
systemd.user = {
|
||||
services.borgmatic = {
|
||||
Unit = {
|
||||
Description = "borgmatic backup";
|
||||
# Prevent borgmatic from running unless the machine is
|
||||
# plugged into power:
|
||||
ConditionACPower = true;
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
|
||||
# Lower CPU and I/O priority:
|
||||
Nice = 19;
|
||||
IOSchedulingClass = "best-effort";
|
||||
IOSchedulingPriority = 7;
|
||||
IOWeight = 100;
|
||||
|
||||
Restart = "no";
|
||||
LogRateLimitIntervalSec = 0;
|
||||
|
||||
# Delay start to prevent backups running during boot:
|
||||
ExecStartPre = "${pkgs.coreutils}/bin/sleep 3m";
|
||||
|
||||
ExecStart = ''
|
||||
${pkgs.systemd}/bin/systemd-inhibit \
|
||||
--who="borgmatic" \
|
||||
--what="sleep:shutdown" \
|
||||
--why="Prevent interrupting scheduled backup" \
|
||||
${programConfig.package}/bin/borgmatic \
|
||||
--stats \
|
||||
--verbosity -1 \
|
||||
--list \
|
||||
--syslog-verbosity 1
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
timers.borgmatic = {
|
||||
Unit.Description = "Run borgmatic backup";
|
||||
Timer = {
|
||||
OnCalendar = serviceConfig.frequency;
|
||||
Persistent = true;
|
||||
RandomizedDelaySec = "10m";
|
||||
};
|
||||
Install.WantedBy = [ "timers.target" ];
|
||||
};
|
||||
config = lib.mkIf serviceConfig.enable {
|
||||
systemd.user = {
|
||||
services.borgmatic = {
|
||||
Unit = {
|
||||
Description = "borgmatic backup";
|
||||
# Prevent borgmatic from running unless the machine is
|
||||
# plugged into power:
|
||||
ConditionACPower = true;
|
||||
};
|
||||
})
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
|
||||
(lib.mkIf pkgs.stdenv.isDarwin {
|
||||
assertions = [
|
||||
(lib.hm.darwin.assertInterval "services.borgmatic.frequency" serviceConfig.frequency pkgs)
|
||||
# Lower CPU and I/O priority:
|
||||
Nice = 19;
|
||||
IOSchedulingClass = "best-effort";
|
||||
IOSchedulingPriority = 7;
|
||||
IOWeight = 100;
|
||||
|
||||
Restart = "no";
|
||||
LogRateLimitIntervalSec = 0;
|
||||
|
||||
# Delay start to prevent backups running during boot:
|
||||
ExecStartPre = "${pkgs.coreutils}/bin/sleep 3m";
|
||||
|
||||
ExecStart = ''
|
||||
${pkgs.systemd}/bin/systemd-inhibit \
|
||||
--who="borgmatic" \
|
||||
--what="sleep:shutdown" \
|
||||
--why="Prevent interrupting scheduled backup" \
|
||||
${programConfig.package}/bin/borgmatic \
|
||||
--stats \
|
||||
--verbosity -1 \
|
||||
--list \
|
||||
--syslog-verbosity 1
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
timers.borgmatic = {
|
||||
Unit.Description = "Run borgmatic backup";
|
||||
Timer = {
|
||||
OnCalendar = serviceConfig.frequency;
|
||||
Persistent = true;
|
||||
RandomizedDelaySec = "10m";
|
||||
};
|
||||
Install.WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
assertions = [
|
||||
(lib.hm.darwin.assertInterval "services.borgmatic.frequency" serviceConfig.frequency pkgs)
|
||||
];
|
||||
|
||||
launchd.agents.borgmatic = {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
(lib.getExe programConfig.package)
|
||||
"--stats"
|
||||
"--list"
|
||||
];
|
||||
|
||||
launchd.agents.borgmatic = {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
(lib.getExe programConfig.package)
|
||||
"--stats"
|
||||
"--list"
|
||||
];
|
||||
ProcessType = "Background";
|
||||
StartCalendarInterval = lib.hm.darwin.mkCalendarInterval serviceConfig.frequency;
|
||||
StandardOutPath = "${config.home.homeDirectory}/Library/Logs/borgmatic/launchd-stdout.log";
|
||||
StandardErrorPath = "${config.home.homeDirectory}/Library/Logs/borgmatic/launchd-stderr.log";
|
||||
};
|
||||
};
|
||||
})
|
||||
]
|
||||
);
|
||||
ProcessType = "Background";
|
||||
StartCalendarInterval = lib.hm.darwin.mkCalendarInterval serviceConfig.frequency;
|
||||
StandardOutPath = "${config.home.homeDirectory}/Library/Logs/borgmatic/launchd-stdout.log";
|
||||
StandardErrorPath = "${config.home.homeDirectory}/Library/Logs/borgmatic/launchd-stderr.log";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ in
|
||||
|
||||
xdg.configFile."clipse/custom_theme.json".source = jsonFormat.generate "theme" cfg.theme;
|
||||
|
||||
systemd.user.services.clipse = lib.mkIf (pkgs.stdenv.isLinux && (cfg.package != null)) {
|
||||
systemd.user.services.clipse = lib.mkIf (cfg.package != null) {
|
||||
Unit = {
|
||||
Description = "Clipse listener";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
|
||||
@@ -163,7 +163,7 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable ({
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = (lib.count (p: p.isActive) (lib.attrValues cfg.profiles)) <= 1;
|
||||
@@ -189,78 +189,74 @@ in
|
||||
if activeProfile.name != "default" then "colima-${activeProfile.name}" else "colima"
|
||||
);
|
||||
|
||||
launchd.agents = lib.mkIf pkgs.stdenv.isDarwin (
|
||||
lib.mapAttrs' (
|
||||
name: profile:
|
||||
lib.nameValuePair "colima-${name}" {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
"${lib.getExe cfg.package}"
|
||||
"start"
|
||||
name
|
||||
"-f"
|
||||
"--activate=${if profile.isActive then "true" else "false"}"
|
||||
"--save-config=false"
|
||||
];
|
||||
KeepAlive = true;
|
||||
RunAtLoad = true;
|
||||
EnvironmentVariables.PATH = lib.makeBinPath [
|
||||
cfg.package
|
||||
cfg.perlPackage
|
||||
cfg.dockerPackage
|
||||
cfg.sshPackage
|
||||
cfg.coreutilsPackage
|
||||
cfg.curlPackage
|
||||
cfg.bashPackage
|
||||
pkgs.darwin.DarwinTools
|
||||
];
|
||||
StandardOutPath = profile.logFile;
|
||||
StandardErrorPath = profile.logFile;
|
||||
};
|
||||
}
|
||||
) (lib.filterAttrs (_: p: p.isService) cfg.profiles)
|
||||
);
|
||||
launchd.agents = lib.mapAttrs' (
|
||||
name: profile:
|
||||
lib.nameValuePair "colima-${name}" {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
"${lib.getExe cfg.package}"
|
||||
"start"
|
||||
name
|
||||
"-f"
|
||||
"--activate=${if profile.isActive then "true" else "false"}"
|
||||
"--save-config=false"
|
||||
];
|
||||
KeepAlive = true;
|
||||
RunAtLoad = true;
|
||||
EnvironmentVariables.PATH = lib.makeBinPath [
|
||||
cfg.package
|
||||
cfg.perlPackage
|
||||
cfg.dockerPackage
|
||||
cfg.sshPackage
|
||||
cfg.coreutilsPackage
|
||||
cfg.curlPackage
|
||||
cfg.bashPackage
|
||||
pkgs.darwin.DarwinTools
|
||||
];
|
||||
StandardOutPath = profile.logFile;
|
||||
StandardErrorPath = profile.logFile;
|
||||
};
|
||||
}
|
||||
) (lib.filterAttrs (_: p: p.isService) cfg.profiles);
|
||||
|
||||
systemd.user.services = lib.mkIf pkgs.stdenv.isLinux (
|
||||
lib.mapAttrs' (
|
||||
name: profile:
|
||||
lib.nameValuePair "colima-${name}" {
|
||||
Unit = {
|
||||
Description = "Colima container runtime (${name} profile)";
|
||||
After = [ "network-online.target" ];
|
||||
Wants = [ "network-online.target" ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = ''
|
||||
${lib.getExe cfg.package} start ${name} \
|
||||
-f \
|
||||
--activate=${if profile.isActive then "true" else "false"} \
|
||||
--save-config=false
|
||||
'';
|
||||
Restart = "always";
|
||||
RestartSec = 2;
|
||||
Environment = [
|
||||
"PATH=${
|
||||
lib.makeBinPath [
|
||||
cfg.package
|
||||
cfg.perlPackage
|
||||
cfg.dockerPackage
|
||||
cfg.sshPackage
|
||||
cfg.coreutilsPackage
|
||||
cfg.curlPackage
|
||||
cfg.bashPackage
|
||||
]
|
||||
}"
|
||||
];
|
||||
StandardOutput = "append:${profile.logFile}";
|
||||
StandardError = "append:${profile.logFile}";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "default.target" ];
|
||||
};
|
||||
}
|
||||
) (lib.filterAttrs (_: p: p.isService) cfg.profiles)
|
||||
);
|
||||
});
|
||||
systemd.user.services = lib.mapAttrs' (
|
||||
name: profile:
|
||||
lib.nameValuePair "colima-${name}" {
|
||||
Unit = {
|
||||
Description = "Colima container runtime (${name} profile)";
|
||||
After = [ "network-online.target" ];
|
||||
Wants = [ "network-online.target" ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = ''
|
||||
${lib.getExe cfg.package} start ${name} \
|
||||
-f \
|
||||
--activate=${if profile.isActive then "true" else "false"} \
|
||||
--save-config=false
|
||||
'';
|
||||
Restart = "always";
|
||||
RestartSec = 2;
|
||||
Environment = [
|
||||
"PATH=${
|
||||
lib.makeBinPath [
|
||||
cfg.package
|
||||
cfg.perlPackage
|
||||
cfg.dockerPackage
|
||||
cfg.sshPackage
|
||||
cfg.coreutilsPackage
|
||||
cfg.curlPackage
|
||||
cfg.bashPackage
|
||||
]
|
||||
}"
|
||||
];
|
||||
StandardOutput = "append:${profile.logFile}";
|
||||
StandardError = "append:${profile.logFile}";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "default.target" ];
|
||||
};
|
||||
}
|
||||
) (lib.filterAttrs (_: p: p.isService) cfg.profiles);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -117,6 +117,8 @@ in
|
||||
systemd.user.services.easyeffects = {
|
||||
Unit = {
|
||||
Description = "Easyeffects daemon";
|
||||
After = [ "graphical-session.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
|
||||
@@ -107,10 +107,10 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
defaultEditor = mkOption rec {
|
||||
defaultEditor = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
example = !default;
|
||||
example = true;
|
||||
description = ''
|
||||
Whether to configure {command}`emacsclient` as the default
|
||||
editor using the {env}`EDITOR` and {env}`VISUAL`
|
||||
@@ -119,127 +119,117 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
home.sessionVariables =
|
||||
let
|
||||
editorBin = lib.getBin (
|
||||
pkgs.writeShellScript "editor" ''exec ${lib.getBin cfg.package}/bin/emacsclient "''${@:---create-frame}"''
|
||||
);
|
||||
in
|
||||
mkIf cfg.defaultEditor {
|
||||
EDITOR = editorBin;
|
||||
VISUAL = editorBin;
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
home.sessionVariables =
|
||||
let
|
||||
editorBin = lib.getBin (
|
||||
pkgs.writeShellScript "editor" ''exec ${lib.getBin cfg.package}/bin/emacsclient "''${@:---create-frame}"''
|
||||
);
|
||||
in
|
||||
mkIf cfg.defaultEditor {
|
||||
EDITOR = editorBin;
|
||||
VISUAL = editorBin;
|
||||
};
|
||||
|
||||
home.packages = optional (cfg.client.enable && pkgs.stdenv.isLinux) (lib.hiPrio clientDesktopItem);
|
||||
|
||||
systemd.user.services.emacs = {
|
||||
Unit = {
|
||||
Description = "Emacs text editor";
|
||||
Documentation = "info:emacs man:emacs(1) https://gnu.org/software/emacs/";
|
||||
|
||||
After = optional (cfg.startWithUserSession == "graphical") "graphical-session.target";
|
||||
PartOf = optional (cfg.startWithUserSession == "graphical") "graphical-session.target";
|
||||
|
||||
# Avoid killing the Emacs session, which may be full of
|
||||
# unsaved buffers.
|
||||
X-RestartIfChanged = false;
|
||||
}
|
||||
// optionalAttrs needsSocketWorkaround {
|
||||
# Emacs deletes its socket when shutting down, which systemd doesn't
|
||||
# handle, resulting in a server without a socket.
|
||||
# See https://github.com/nix-community/home-manager/issues/2018
|
||||
RefuseManualStart = true;
|
||||
};
|
||||
|
||||
(mkIf pkgs.stdenv.isLinux {
|
||||
systemd.user.services.emacs = {
|
||||
Unit = {
|
||||
Description = "Emacs text editor";
|
||||
Documentation = "info:emacs man:emacs(1) https://gnu.org/software/emacs/";
|
||||
Service = {
|
||||
Type = "notify";
|
||||
|
||||
After = optional (cfg.startWithUserSession == "graphical") "graphical-session.target";
|
||||
PartOf = optional (cfg.startWithUserSession == "graphical") "graphical-session.target";
|
||||
# We wrap ExecStart in a login shell so Emacs starts with the user's
|
||||
# environment, most importantly $PATH and $NIX_PROFILES. It may be
|
||||
# worth investigating a more targeted approach for user services to
|
||||
# import the user environment.
|
||||
ExecStart = ''${pkgs.runtimeShell} -l -c "${emacsBinPath}/emacs --fg-daemon${
|
||||
# In case the user sets 'server-directory' or 'server-name' in
|
||||
# their Emacs config, we want to specify the socket path explicitly
|
||||
# so launching 'emacs.service' manually doesn't break emacsclient
|
||||
# when using socket activation.
|
||||
lib.optionalString cfg.socketActivation.enable "=${lib.escapeShellArg socketPath}"
|
||||
} ${lib.escapeShellArgs cfg.extraOptions}"'';
|
||||
|
||||
# Avoid killing the Emacs session, which may be full of
|
||||
# unsaved buffers.
|
||||
X-RestartIfChanged = false;
|
||||
}
|
||||
// optionalAttrs needsSocketWorkaround {
|
||||
# Emacs deletes its socket when shutting down, which systemd doesn't
|
||||
# handle, resulting in a server without a socket.
|
||||
# See https://github.com/nix-community/home-manager/issues/2018
|
||||
RefuseManualStart = true;
|
||||
};
|
||||
# Emacs will exit with status 15 after having received SIGTERM, which
|
||||
# is the default "KillSignal" value systemd uses to stop services.
|
||||
SuccessExitStatus = 15;
|
||||
|
||||
Service = {
|
||||
Type = "notify";
|
||||
Restart = "on-failure";
|
||||
}
|
||||
// optionalAttrs needsSocketWorkaround {
|
||||
# Use read-only directory permissions to prevent emacs from
|
||||
# deleting systemd's socket file before exiting.
|
||||
ExecStartPost = "${pkgs.coreutils}/bin/chmod --changes -w ${socketDir}";
|
||||
ExecStopPost = "${pkgs.coreutils}/bin/chmod --changes +w ${socketDir}";
|
||||
};
|
||||
}
|
||||
// optionalAttrs (cfg.startWithUserSession != false) {
|
||||
Install = {
|
||||
WantedBy = [
|
||||
(if cfg.startWithUserSession == true then "default.target" else "graphical-session.target")
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# We wrap ExecStart in a login shell so Emacs starts with the user's
|
||||
# environment, most importantly $PATH and $NIX_PROFILES. It may be
|
||||
# worth investigating a more targeted approach for user services to
|
||||
# import the user environment.
|
||||
ExecStart = ''${pkgs.runtimeShell} -l -c "${emacsBinPath}/emacs --fg-daemon${
|
||||
# In case the user sets 'server-directory' or 'server-name' in
|
||||
# their Emacs config, we want to specify the socket path explicitly
|
||||
# so launching 'emacs.service' manually doesn't break emacsclient
|
||||
# when using socket activation.
|
||||
lib.optionalString cfg.socketActivation.enable "=${lib.escapeShellArg socketPath}"
|
||||
} ${lib.escapeShellArgs cfg.extraOptions}"'';
|
||||
systemd.user.sockets.emacs = mkIf cfg.socketActivation.enable {
|
||||
Unit = {
|
||||
Description = "Emacs text editor";
|
||||
Documentation = "info:emacs man:emacs(1) https://gnu.org/software/emacs/";
|
||||
};
|
||||
|
||||
# Emacs will exit with status 15 after having received SIGTERM, which
|
||||
# is the default "KillSignal" value systemd uses to stop services.
|
||||
SuccessExitStatus = 15;
|
||||
Socket = {
|
||||
ListenStream = socketPath;
|
||||
FileDescriptorName = "server";
|
||||
SocketMode = "0600";
|
||||
DirectoryMode = "0700";
|
||||
# This prevents the service from immediately starting again
|
||||
# after being stopped, due to the function
|
||||
# `server-force-stop' present in `kill-emacs-hook', which
|
||||
# calls `server-running-p', which opens the socket file.
|
||||
FlushPending = true;
|
||||
};
|
||||
|
||||
Restart = "on-failure";
|
||||
}
|
||||
// optionalAttrs needsSocketWorkaround {
|
||||
# Use read-only directory permissions to prevent emacs from
|
||||
# deleting systemd's socket file before exiting.
|
||||
ExecStartPost = "${pkgs.coreutils}/bin/chmod --changes -w ${socketDir}";
|
||||
ExecStopPost = "${pkgs.coreutils}/bin/chmod --changes +w ${socketDir}";
|
||||
};
|
||||
}
|
||||
// optionalAttrs (cfg.startWithUserSession != false) {
|
||||
Install = {
|
||||
WantedBy = [
|
||||
(if cfg.startWithUserSession == true then "default.target" else "graphical-session.target")
|
||||
];
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "sockets.target" ];
|
||||
# Adding this Requires= dependency ensures that systemd
|
||||
# manages the socket file, in the case where the service is
|
||||
# started when the socket is stopped.
|
||||
# The socket unit is implicitly ordered before the service.
|
||||
RequiredBy = [ "emacs.service" ];
|
||||
};
|
||||
};
|
||||
|
||||
launchd.agents.emacs = {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
"${cfg.package}/bin/emacs"
|
||||
"--fg-daemon"
|
||||
]
|
||||
++ cfg.extraOptions;
|
||||
RunAtLoad = true;
|
||||
KeepAlive = {
|
||||
Crashed = true;
|
||||
SuccessfulExit = false;
|
||||
};
|
||||
|
||||
home.packages = optional cfg.client.enable (lib.hiPrio clientDesktopItem);
|
||||
})
|
||||
|
||||
(mkIf (cfg.socketActivation.enable && pkgs.stdenv.isLinux) {
|
||||
systemd.user.sockets.emacs = {
|
||||
Unit = {
|
||||
Description = "Emacs text editor";
|
||||
Documentation = "info:emacs man:emacs(1) https://gnu.org/software/emacs/";
|
||||
};
|
||||
|
||||
Socket = {
|
||||
ListenStream = socketPath;
|
||||
FileDescriptorName = "server";
|
||||
SocketMode = "0600";
|
||||
DirectoryMode = "0700";
|
||||
# This prevents the service from immediately starting again
|
||||
# after being stopped, due to the function
|
||||
# `server-force-stop' present in `kill-emacs-hook', which
|
||||
# calls `server-running-p', which opens the socket file.
|
||||
FlushPending = true;
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "sockets.target" ];
|
||||
# Adding this Requires= dependency ensures that systemd
|
||||
# manages the socket file, in the case where the service is
|
||||
# started when the socket is stopped.
|
||||
# The socket unit is implicitly ordered before the service.
|
||||
RequiredBy = [ "emacs.service" ];
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf pkgs.stdenv.isDarwin {
|
||||
launchd.agents.emacs = {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
"${cfg.package}/bin/emacs"
|
||||
"--fg-daemon"
|
||||
]
|
||||
++ cfg.extraOptions;
|
||||
RunAtLoad = true;
|
||||
KeepAlive = {
|
||||
Crashed = true;
|
||||
SuccessfulExit = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
]
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ in
|
||||
};
|
||||
|
||||
Service = {
|
||||
Environment = with pkgs; "PATH=${makeBinPath cfg.extraPackages}";
|
||||
Environment = "PATH=${makeBinPath cfg.extraPackages}";
|
||||
ExecStart = "${cfg.package}/bin/fusuma";
|
||||
};
|
||||
|
||||
|
||||
@@ -15,49 +15,12 @@ let
|
||||
|
||||
cfg = config.services.git-sync;
|
||||
|
||||
mkUnit = name: repo: {
|
||||
Unit.Description = "Git Sync ${name}";
|
||||
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
|
||||
Service = {
|
||||
Environment = [
|
||||
"PATH=${
|
||||
lib.makeBinPath (
|
||||
with pkgs;
|
||||
[
|
||||
openssh
|
||||
git
|
||||
]
|
||||
++ repo.extraPackages
|
||||
)
|
||||
}"
|
||||
"GIT_SYNC_DIRECTORY=${lib.strings.escapeShellArg repo.path}"
|
||||
"GIT_SYNC_COMMAND=${cfg.package}/bin/git-sync"
|
||||
"GIT_SYNC_REPOSITORY=${lib.strings.escapeShellArg repo.uri}"
|
||||
"GIT_SYNC_INTERVAL=${toString repo.interval}"
|
||||
];
|
||||
ExecStart = "${cfg.package}/bin/git-sync-on-inotify";
|
||||
Restart = "on-abort";
|
||||
};
|
||||
};
|
||||
|
||||
mkAgent = name: repo: {
|
||||
enable = true;
|
||||
config = {
|
||||
StartInterval = repo.interval;
|
||||
ProcessType = "Background";
|
||||
WorkingDirectory = "${repo.path}";
|
||||
WatchPaths = [ "${repo.path}" ];
|
||||
ProgramArguments = [ "${cfg.package}/bin/git-sync" ];
|
||||
};
|
||||
};
|
||||
|
||||
mkService = if pkgs.stdenv.isLinux then mkUnit else mkAgent;
|
||||
services = lib.mapAttrs' (name: repo: {
|
||||
name = "git-sync-${name}";
|
||||
value = mkService name repo;
|
||||
}) cfg.repositories;
|
||||
services =
|
||||
mkService:
|
||||
lib.mapAttrs' (name: repo: {
|
||||
name = "git-sync-${name}";
|
||||
value = mkService name repo;
|
||||
}) cfg.repositories;
|
||||
|
||||
repositoryType = types.submodule (
|
||||
{ name, ... }:
|
||||
@@ -141,11 +104,48 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
(mkIf pkgs.stdenv.isLinux { systemd.user.services = services; })
|
||||
(mkIf pkgs.stdenv.isDarwin { launchd.agents = services; })
|
||||
]
|
||||
);
|
||||
config = mkIf cfg.enable {
|
||||
launchd.agents = services (
|
||||
name: repo: {
|
||||
enable = true;
|
||||
config = {
|
||||
StartInterval = repo.interval;
|
||||
ProcessType = "Background";
|
||||
WorkingDirectory = "${repo.path}";
|
||||
WatchPaths = [ "${repo.path}" ];
|
||||
ProgramArguments = [ "${cfg.package}/bin/git-sync" ];
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
systemd.user.services = services (
|
||||
name: repo: {
|
||||
Unit.Description = "Git Sync ${name}";
|
||||
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
|
||||
Service = {
|
||||
Environment = [
|
||||
"PATH=${
|
||||
lib.makeBinPath (
|
||||
with pkgs;
|
||||
[
|
||||
openssh
|
||||
git
|
||||
]
|
||||
++ repo.extraPackages
|
||||
)
|
||||
}"
|
||||
"GIT_SYNC_DIRECTORY=${lib.strings.escapeShellArg repo.path}"
|
||||
"GIT_SYNC_COMMAND=${cfg.package}/bin/git-sync"
|
||||
"GIT_SYNC_REPOSITORY=${lib.strings.escapeShellArg repo.uri}"
|
||||
"GIT_SYNC_INTERVAL=${toString repo.interval}"
|
||||
];
|
||||
ExecStart = "${cfg.package}/bin/git-sync-on-inotify";
|
||||
Restart = "on-abort";
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user