mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
Compare commits
96 Commits
release-25
...
putter-poc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02c8ce9f92 | ||
|
|
09de9577d4 | ||
|
|
f575cb24f6 | ||
|
|
3a92ffa192 | ||
|
|
6cdf765eed | ||
|
|
8315c1544f | ||
|
|
58bf3ecb2d | ||
|
|
d787ec69c3 | ||
|
|
07d79726f1 | ||
|
|
4767a9c719 | ||
|
|
39cb677ed9 | ||
|
|
0cf525a5be | ||
|
|
9b5ac85d79 | ||
|
|
574f6d3526 | ||
|
|
e52be4fb78 | ||
|
|
dd18018d06 | ||
|
|
7b34e428f3 | ||
|
|
af7c726e8b | ||
|
|
13cc1efd78 | ||
|
|
e5b1f87841 | ||
|
|
caa47b637d | ||
|
|
a788734077 | ||
|
|
6bdf2a68e1 | ||
|
|
f9d45d664e | ||
|
|
082822b8a6 | ||
|
|
27a6182347 | ||
|
|
012cfcc44a | ||
|
|
36817384a6 | ||
|
|
571c5eed1d | ||
|
|
2e02e22e28 | ||
|
|
ccd22c13b2 | ||
|
|
519828bf1c | ||
|
|
1a99a515a1 | ||
|
|
6bcb2395ab | ||
|
|
f16bfa59e3 | ||
|
|
35545f71dd | ||
|
|
6bbc48804b | ||
|
|
a8b6296a1e | ||
|
|
68f7b34179 | ||
|
|
24cc5c080c | ||
|
|
df7bac2b2b | ||
|
|
05a56dbf24 | ||
|
|
9379fbf4f5 | ||
|
|
a521eab881 | ||
|
|
d441981b20 | ||
|
|
fca4cba863 | ||
|
|
af324afa72 | ||
|
|
12e7786854 | ||
|
|
28741978a3 | ||
|
|
43173abcb4 | ||
|
|
bcc7afa1d8 | ||
|
|
281e9398cc | ||
|
|
93d907a205 | ||
|
|
eca5f967cd | ||
|
|
db44f38047 | ||
|
|
06f81463bb | ||
|
|
ab8e4b2b5a | ||
|
|
c3d1e5c65a | ||
|
|
bf003999ed | ||
|
|
ff067cfc61 | ||
|
|
effe4c007d | ||
|
|
6cedf24ada | ||
|
|
e4e25a8c31 | ||
|
|
13b089b586 | ||
|
|
784a83782c | ||
|
|
704b6ffa8a | ||
|
|
83053e1d33 | ||
|
|
ae400a1dcc | ||
|
|
edbb012a21 | ||
|
|
b1bb534c17 | ||
|
|
780be8ef50 | ||
|
|
40c18076d8 | ||
|
|
d13041d6f0 | ||
|
|
ae9f38e889 | ||
|
|
86ff0ef506 | ||
|
|
c220f242cd | ||
|
|
1ed596c638 | ||
|
|
9f31ea236b | ||
|
|
b414c94d4e | ||
|
|
5b8d259ee6 | ||
|
|
29b672194d | ||
|
|
f302550865 | ||
|
|
23f2ba7ae0 | ||
|
|
470d24d809 | ||
|
|
740134d4af | ||
|
|
c23379a330 | ||
|
|
9651819d75 | ||
|
|
8220473f95 | ||
|
|
946907fa6a | ||
|
|
201c883d0d | ||
|
|
cc0425becf | ||
|
|
ee7f4646da | ||
|
|
ad0b497533 | ||
|
|
089d5bf615 | ||
|
|
4d5fbb182e | ||
|
|
8433591183 |
3
.github/dependabot.yml
vendored
3
.github/dependabot.yml
vendored
@@ -7,10 +7,9 @@ updates:
|
||||
interval: "weekly"
|
||||
commit-message:
|
||||
prefix: "ci:"
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
target-branch: "release-25.05"
|
||||
target-branch: "release-25.11"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
commit-message:
|
||||
|
||||
3
.github/workflows/update-flake.yml
vendored
3
.github/workflows/update-flake.yml
vendored
@@ -9,8 +9,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'schedule' || github.repository_owner == 'nix-community'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branch: [master, release-25.05]
|
||||
branch: [master, release-25.11]
|
||||
steps:
|
||||
- name: Create GitHub App token
|
||||
uses: actions/create-github-app-token@v2
|
||||
|
||||
@@ -121,6 +121,22 @@ Reference commits:
|
||||
- Change `isReleaseBranch` from `false` to `true`
|
||||
- Do NOT change the `release` field (it's already correct from Step 1)
|
||||
|
||||
2. **flake.nix**
|
||||
- Update the nixpkgs input to track the corresponding stable branch
|
||||
- Example: For `release-25.11`, change from:
|
||||
```nix
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
```
|
||||
to:
|
||||
```nix
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
||||
```
|
||||
- Run `nix flake update` to update flake.lock to the stable branch
|
||||
- Commit the flake.nix and flake.lock changes
|
||||
|
||||
**Note**: The release branch should track the stable NixOS release channel
|
||||
(e.g., `nixos-25.11`), while master continues to track `nixos-unstable`.
|
||||
|
||||
#### Step 3.5: On master - Update CI for the New Release Branch
|
||||
|
||||
**When**: After marking the release branch as a release branch (Step 3)
|
||||
@@ -150,6 +166,37 @@ Reference commits:
|
||||
- This ensures automated flake.lock updates run on the current stable branch
|
||||
- Note: We only maintain CI for the latest stable release, not older releases
|
||||
|
||||
2. **.github/dependabot.yml** (on master)
|
||||
- Replace the old stable branch with the new release branch
|
||||
- Example: When creating `release-25.11`, update the target-branch from:
|
||||
|
||||
```yaml
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
target-branch: "release-25.05"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
commit-message:
|
||||
prefix: "ci:"
|
||||
```
|
||||
|
||||
to:
|
||||
|
||||
```yaml
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
target-branch: "release-25.11"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
commit-message:
|
||||
prefix: "ci:"
|
||||
```
|
||||
|
||||
- This ensures automated dependency updates for GitHub Actions on the current
|
||||
stable branch
|
||||
- Note: We only maintain dependabot for the latest stable release, not older
|
||||
releases
|
||||
|
||||
**Important**: CI workflows are executed from master, so this change must be
|
||||
committed to the master branch.
|
||||
|
||||
|
||||
@@ -361,6 +361,11 @@
|
||||
email = "nixpkgs@perchun.it";
|
||||
github = "PerchunPak";
|
||||
githubId = 68118654;
|
||||
keys = [
|
||||
{
|
||||
fingerprint = "BBB5 1142 959D 8549 A3D2 F6C5 313F 67D1 EAB7 70F9";
|
||||
}
|
||||
];
|
||||
name = "Perchun Pak";
|
||||
source = "nixpkgs";
|
||||
};
|
||||
@@ -629,6 +634,13 @@
|
||||
name = "Arjan Schrijver";
|
||||
source = "nixpkgs";
|
||||
};
|
||||
arunoruto = {
|
||||
email = "mirza.arnaut45@gmail.com";
|
||||
github = "arunoruto";
|
||||
githubId = 21687187;
|
||||
name = "Mirza Arnaut";
|
||||
source = "nixpkgs";
|
||||
};
|
||||
asymmetric = {
|
||||
email = "lorenzo@mailbox.org";
|
||||
github = "asymmetric";
|
||||
@@ -2304,6 +2316,13 @@
|
||||
name = "Florian Peter";
|
||||
source = "nixpkgs";
|
||||
};
|
||||
xavwe = {
|
||||
email = "git@xavwe.dev";
|
||||
github = "xavwe";
|
||||
githubId = 125409009;
|
||||
name = "Xaver Wenhart";
|
||||
source = "nixpkgs";
|
||||
};
|
||||
xlambein = {
|
||||
email = "xlambein@gmail.com";
|
||||
github = "xlambein";
|
||||
|
||||
6
docs/flake.lock
generated
6
docs/flake.lock
generated
@@ -2,11 +2,11 @@
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1743938762,
|
||||
"narHash": "sha256-UgFYn8sGv9B8PoFpUfCa43CjMZBl1x/ShQhRDHBFQdI=",
|
||||
"lastModified": 1764081664,
|
||||
"narHash": "sha256-sUoHmPr/EwXzRMpv1u/kH+dXuvJEyyF2Q7muE+t0EU4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "74a40410369a1c35ee09b8a1abee6f4acbedc059",
|
||||
"rev": "dc205f7b4fdb04c8b7877b43edb7b73be7730081",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Home Manager Manual {#home-manager-manual}
|
||||
|
||||
## Version 25.11
|
||||
## Version 26.05 (unstable)
|
||||
|
||||
|
||||
```{=include=} preface
|
||||
|
||||
@@ -4,6 +4,7 @@ This section lists the release notes for stable versions of Home Manager
|
||||
and the current unstable version.
|
||||
|
||||
```{=include=} chapters
|
||||
rl-2605.md
|
||||
rl-2511.md
|
||||
rl-2505.md
|
||||
rl-2411.md
|
||||
|
||||
@@ -57,9 +57,3 @@ 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,8 +27,4 @@ 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.
|
||||
|
||||
- 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.
|
||||
- No changes.
|
||||
|
||||
@@ -80,10 +80,3 @@ 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.
|
||||
|
||||
17
docs/release-notes/rl-2605.md
Normal file
17
docs/release-notes/rl-2605.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Release 26.05 {#sec-release-26.05}
|
||||
|
||||
This is the current unstable branch and the information in this
|
||||
section is therefore not final.
|
||||
|
||||
## Highlights {#sec-release-26.05-highlights}
|
||||
|
||||
This release has the following notable changes:
|
||||
|
||||
## 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.
|
||||
234
flake.lock
generated
234
flake.lock
generated
@@ -1,24 +1,248 @@
|
||||
{
|
||||
"nodes": {
|
||||
"crane": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": [
|
||||
"putter",
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"putter",
|
||||
"nixpkgs"
|
||||
],
|
||||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1697588719,
|
||||
"narHash": "sha256-n9ALgm3S+ygpzjesBkB9qutEtM4dtIkhn8WnstCPOew=",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"rev": "da6b58e270d339a78a6e95728012ec2eea879612",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "ipetkov",
|
||||
"ref": "v0.14.3",
|
||||
"repo": "crane",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1696267196,
|
||||
"narHash": "sha256-AAQ/2sD+0D18bb8hKuEEVpHUYD1GmO2Uh/taFamn6XQ=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "4f910c9827911b1ec2bf26b5a062cd09f8d89f85",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat_2": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1673956053,
|
||||
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1694529238,
|
||||
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"putter",
|
||||
"pre-commit-hooks",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1660459072,
|
||||
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1767799921,
|
||||
"narHash": "sha256-r4GVX+FToWVE2My8VVZH4V0pTIpnu2ZE8/Z4uxGEMBE=",
|
||||
"lastModified": 1765472234,
|
||||
"narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d351d0653aeb7877273920cd3e823994e7579b0b",
|
||||
"rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-25.11",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1685801374,
|
||||
"narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c37ca420157f4abc31e26f436c1145f8951ff373",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-23.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1699094435,
|
||||
"narHash": "sha256-YLZ5/KKZ1PyLrm2MO8UxRe4H3M0/oaYqNhSlq6FDeeA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9d5d25bbfe8c0297ebe85324addcb5020ed1a454",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pre-commit-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_2",
|
||||
"flake-utils": [
|
||||
"putter",
|
||||
"flake-utils"
|
||||
],
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": [
|
||||
"putter",
|
||||
"nixpkgs"
|
||||
],
|
||||
"nixpkgs-stable": "nixpkgs-stable"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1698852633,
|
||||
"narHash": "sha256-Hsc/cCHud8ZXLvmm8pxrXpuaPEeNaaUttaCvtdX/Wug=",
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "dec10399e5b56aa95fcd530e0338be72ad6462a0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"putter": {
|
||||
"inputs": {
|
||||
"crane": "crane",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"pre-commit-hooks": "pre-commit-hooks"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1704013409,
|
||||
"narHash": "sha256-v7CTHSKcD6vnIwXRPav+3XETf+uNJz3G+RUF/SHZ+vE=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "4d773d3aa9feca3af4578dc62cc6f91ebb16b002",
|
||||
"revCount": 33,
|
||||
"type": "git",
|
||||
"url": "file:///home/rycee/devel/putter"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "file:///home/rycee/devel/putter"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": "nixpkgs",
|
||||
"putter": "putter"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
"putter",
|
||||
"crane",
|
||||
"flake-utils"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"putter",
|
||||
"crane",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1696299134,
|
||||
"narHash": "sha256-RS77cAa0N+Sfj5EmKbm5IdncNXaBCE1BSSQvUE8exvo=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "611ccdceed92b4d94ae75328148d84ee4a5b462d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
{
|
||||
description = "Home Manager for Nix";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
inputs.putter.url = "git+file:///home/rycee/devel/putter";
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
putter,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
@@ -1277,7 +1277,7 @@ while [[ $# -gt 0 ]]; do
|
||||
export VERBOSE=1
|
||||
;;
|
||||
--version)
|
||||
echo 25.11-pre
|
||||
echo 26.05-pre
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -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-08-23 20:02+0000\n"
|
||||
"PO-Revision-Date: 2025-11-30 14:00+0000\n"
|
||||
"Last-Translator: Brian E <brianellingsgaard9@gmail.com>\n"
|
||||
"Language-Team: Faroese <https://hosted.weblate.org/projects/home-manager/cli/"
|
||||
"fo/>\n"
|
||||
@@ -17,12 +17,12 @@ 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.13\n"
|
||||
"X-Generator: Weblate 5.15-dev\n"
|
||||
|
||||
#. translators: For example: "home-manager: missing argument for --cores"
|
||||
#: home-manager/home-manager:16
|
||||
msgid "%s: missing argument for %s"
|
||||
msgstr ""
|
||||
msgstr "%s: manglar eitt ávirki fyri %s"
|
||||
|
||||
#. translators: For example: "home-manager: --rollback can only be used after switch"
|
||||
#: home-manager/home-manager:22
|
||||
@@ -31,7 +31,7 @@ msgstr "%s: %s kann bert brúkast aftaná %s"
|
||||
|
||||
#: home-manager/home-manager:71
|
||||
msgid "No configuration file found at %s"
|
||||
msgstr ""
|
||||
msgstr "Eingin samansetingsfíla funni hjá %s"
|
||||
|
||||
#. translators: The first '%s' specifier will be replaced by either
|
||||
#. 'home.nix' or 'flake.nix'.
|
||||
|
||||
@@ -8,8 +8,8 @@ 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-03-07 18:58+0000\n"
|
||||
"Last-Translator: 807 <s10855168@gmail.com>\n"
|
||||
"PO-Revision-Date: 2025-12-04 04:17+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"
|
||||
"Language: zh_Hant\n"
|
||||
@@ -17,21 +17,21 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Weblate 5.10.3-dev\n"
|
||||
"X-Generator: Weblate 5.15-dev\n"
|
||||
|
||||
#. translators: For example: "home-manager: missing argument for --cores"
|
||||
#: home-manager/home-manager:16
|
||||
msgid "%s: missing argument for %s"
|
||||
msgstr "%s: 缺少參數 %s"
|
||||
msgstr "%s:缺少 %s 的引數"
|
||||
|
||||
#. translators: For example: "home-manager: --rollback can only be used after switch"
|
||||
#: home-manager/home-manager:22
|
||||
msgid "%s: %s can only be used after %s"
|
||||
msgstr ""
|
||||
msgstr "%s:%s 只能在 %s 之後使用"
|
||||
|
||||
#: home-manager/home-manager:71
|
||||
msgid "No configuration file found at %s"
|
||||
msgstr "未在 %s 處找到配置檔案"
|
||||
msgstr "在 %s 找不到設定檔"
|
||||
|
||||
#. translators: The first '%s' specifier will be replaced by either
|
||||
#. 'home.nix' or 'flake.nix'.
|
||||
@@ -41,12 +41,12 @@ msgid ""
|
||||
"Keeping your Home Manager %s in %s is deprecated,\n"
|
||||
"please move it to %s"
|
||||
msgstr ""
|
||||
"保持你的 Home Manager 在 %s 中,%s 已被拋棄,\n"
|
||||
"請將它移動到 %s"
|
||||
"將 Home Manager 的 %s 放在 %s 中, 已經被棄用,\n"
|
||||
"請改放到 %s"
|
||||
|
||||
#: home-manager/home-manager:99
|
||||
msgid "No configuration file found. Please create one at %s"
|
||||
msgstr "未找到配置檔案。請在 %s 處建立一份"
|
||||
msgstr "找不到設定檔。請在 %s 建立新的設定檔"
|
||||
|
||||
#: home-manager/home-manager:114
|
||||
msgid "Home Manager not found at %s."
|
||||
@@ -57,7 +57,7 @@ msgstr "在 %s 中找不到 Home Manager。"
|
||||
msgid ""
|
||||
"The fallback Home Manager path %s has been deprecated and a file/directory "
|
||||
"was found there."
|
||||
msgstr "備用的 Home Manager 路徑 %s 已被拋棄,但一個檔案/資料夾在這被找到。"
|
||||
msgstr "備用的 Home Manager 路徑 %s 已被棄用,且在該處找到了檔案/目錄。"
|
||||
|
||||
#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated.
|
||||
#: home-manager/home-manager:125
|
||||
@@ -80,21 +80,21 @@ msgid ""
|
||||
"\n"
|
||||
" $ rm -r \"%s\""
|
||||
msgstr ""
|
||||
"要消除這個警告,請做以下其中一步。\n"
|
||||
"若要移除此警告,請執行下列其中一項。\n"
|
||||
"\n"
|
||||
"1. 告訴Home Manager去使用路徑,例如加入\n"
|
||||
"1. 明確告知 Home Manager 使用該路徑,例如在\n"
|
||||
"\n"
|
||||
" { programs.home-manager.path = \"%s\"; }\n"
|
||||
"\n"
|
||||
" 到你的配置中。\n"
|
||||
" 中,加入您的設定。\n"
|
||||
"\n"
|
||||
" 如果你想要直接引入Home Manager, 請你使用 `path` 參數r\n"
|
||||
" 如果想直接匯入 Home Manager,可以在呼叫時使用 `path` 參數來指定路徑:\n"
|
||||
"\n"
|
||||
" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n"
|
||||
"\n"
|
||||
" 當呼叫 Home Manager 模組。\n"
|
||||
" 這樣就能正確傳遞 Home Manager 的路徑。\n"
|
||||
"\n"
|
||||
"2. 刪除無效的路徑\n"
|
||||
"2. 移除已棄用的路徑。\n"
|
||||
"\n"
|
||||
" $ rm -r \"%s\""
|
||||
|
||||
@@ -104,33 +104,33 @@ msgstr "正在進行 Nix 完整性檢查"
|
||||
|
||||
#: home-manager/home-manager:173
|
||||
msgid "Could not find suitable profile directory, tried %s and %s"
|
||||
msgstr "找不到合適的 profile 目錄,已經嘗試 %s 和 %s"
|
||||
msgstr "找不到合適的設定檔目錄,已嘗試 %s 和 %s"
|
||||
|
||||
#. translators: Here "flake" is a noun that refers to the Nix Flakes feature.
|
||||
#: home-manager/home-manager:230
|
||||
msgid "Can't inspect options of a flake configuration"
|
||||
msgstr "無法檢查 flake 配置中的選項"
|
||||
msgstr "無法檢查 flake 設定的選項"
|
||||
|
||||
#: home-manager/home-manager:305 home-manager/home-manager:328
|
||||
#: home-manager/home-manager:734 home-manager/home-manager:1237
|
||||
msgid "%s: unknown option '%s'"
|
||||
msgstr "%s:未知選項 ‘%s’"
|
||||
msgstr "%s:未知選項 '%s'"
|
||||
|
||||
#: home-manager/home-manager:310 home-manager/home-manager:1238
|
||||
msgid "Run '%s --help' for usage help"
|
||||
msgstr "執行 ‘%s --help’ 獲取用法幫助"
|
||||
msgstr "執行 '%s --help' 以取得使用說明"
|
||||
|
||||
#: home-manager/home-manager:336 home-manager/home-manager:441
|
||||
msgid "The file %s already exists, leaving it unchanged..."
|
||||
msgstr "檔案 %s 已經存在,不更改它..."
|
||||
msgstr "檔案 %s 已存在,保持不變..."
|
||||
|
||||
#: home-manager/home-manager:338 home-manager/home-manager:443
|
||||
msgid "Creating %s..."
|
||||
msgstr "創建 %s 中..."
|
||||
msgstr "正在建立 %s..."
|
||||
|
||||
#: home-manager/home-manager:487
|
||||
msgid "Creating initial Home Manager generation..."
|
||||
msgstr "正在建立初始 Home Manager 世代 ..."
|
||||
msgstr "正在建立初始 Home Manager 世代..."
|
||||
|
||||
#. translators: The "%s" specifier will be replaced by a file path.
|
||||
#: home-manager/home-manager:492
|
||||
@@ -142,12 +142,12 @@ msgid ""
|
||||
"to configure Home Manager. Run 'man home-configuration.nix' to\n"
|
||||
"see all available options."
|
||||
msgstr ""
|
||||
"全部工作完成了!home-manager 工具現應已安裝,您可以編輯\n"
|
||||
"全部完成!home-manager 工具現在應該已被安裝,您可以編輯\n"
|
||||
"\n"
|
||||
" %s\n"
|
||||
"\n"
|
||||
"來配置 Home Manager。執行 ‘man home-configuration.nix’\n"
|
||||
"來檢視所有可用選項。"
|
||||
"來設定 Home Manager。執行 'man home-configuration.nix' 時\n"
|
||||
"可查看所有可用選項。"
|
||||
|
||||
#. translators: The "%s" specifier will be replaced by a URL.
|
||||
#: home-manager/home-manager:497
|
||||
@@ -158,16 +158,16 @@ msgid ""
|
||||
"\n"
|
||||
"if the error seems to be the fault of Home Manager."
|
||||
msgstr ""
|
||||
"啊哦,安裝失敗了!如果感覺是 Home Manager 造成的錯誤,請在下方\n"
|
||||
"糟糕,安裝失敗了!如果感覺是 Home Manager 所造成的錯誤,請在此連結\n"
|
||||
"\n"
|
||||
" %s\n"
|
||||
"\n"
|
||||
"處建立 Issue 告知我們。"
|
||||
"中,建立 Issue 告知我們。"
|
||||
|
||||
#. translators: Here "flake" is a noun that refers to the Nix Flakes feature.
|
||||
#: home-manager/home-manager:508
|
||||
msgid "Can't instantiate a flake configuration"
|
||||
msgstr "無法建立 flake 配置例項"
|
||||
msgstr "無法實例化 flake 設定"
|
||||
|
||||
#: home-manager/home-manager:584
|
||||
msgid ""
|
||||
@@ -177,12 +177,12 @@ msgid_plural ""
|
||||
"There are %d unread and relevant news items.\n"
|
||||
"Read them by running the command \"%s news\"."
|
||||
msgstr[0] ""
|
||||
"有 %d 條未讀的相關新聞或訊息。\n"
|
||||
"可執行 “%s news” 命令進行閱讀。"
|
||||
"有 %d 則未讀且相關的消息項目。\n"
|
||||
"執行指令 \"%s news\" 來進行確認。"
|
||||
|
||||
#: home-manager/home-manager:598
|
||||
msgid "Unknown \"news.display\" setting \"%s\"."
|
||||
msgstr "未知的 “news.display” 設定項 “%s”。"
|
||||
msgstr "未知的 \"news.display\" 設定值 \"%s\"。"
|
||||
|
||||
#: home-manager/home-manager:606
|
||||
#, sh-format
|
||||
@@ -191,11 +191,11 @@ msgstr "請設定 $EDITOR 或 $VISUAL 環境變數"
|
||||
|
||||
#: home-manager/home-manager:624
|
||||
msgid "Cannot run build in read-only directory"
|
||||
msgstr "無法在唯讀目錄中執行構建"
|
||||
msgstr "無法在唯讀目錄中執行建置"
|
||||
|
||||
#: home-manager/home-manager:787
|
||||
msgid "The configuration did not contain the specialisation \"%s\""
|
||||
msgstr ""
|
||||
msgstr "設定中不包含特化設定 \"%s\""
|
||||
|
||||
#: home-manager/home-manager:841
|
||||
msgid "No generation with ID %s"
|
||||
@@ -203,7 +203,7 @@ msgstr "沒有 ID 為 %s 的世代"
|
||||
|
||||
#: home-manager/home-manager:843
|
||||
msgid "Cannot remove the current generation %s"
|
||||
msgstr "無法移除當前世代 %s"
|
||||
msgstr "無法移除目前的世代 %s"
|
||||
|
||||
#: home-manager/home-manager:845
|
||||
msgid "Removing generation %s"
|
||||
|
||||
@@ -57,9 +57,8 @@ let
|
||||
let
|
||||
module = moduleChecks rawModule;
|
||||
in
|
||||
{
|
||||
inherit (module) options config;
|
||||
|
||||
module
|
||||
// {
|
||||
activationPackage = module.config.home.activationPackage;
|
||||
|
||||
# For backwards compatibility. Please use activationPackage instead.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
putter,
|
||||
...
|
||||
}:
|
||||
|
||||
@@ -30,6 +31,8 @@ let
|
||||
name = sourceName;
|
||||
};
|
||||
|
||||
putterStatePath = "${config.xdg.stateHome}/home-manager/putter-state.json";
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
@@ -45,6 +48,14 @@ in
|
||||
internal = true;
|
||||
description = "Package to contain all home files";
|
||||
};
|
||||
|
||||
home.internal = {
|
||||
filePutterConfig = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
internal = true;
|
||||
description = "Putter configuration.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
@@ -91,156 +102,17 @@ in
|
||||
|
||||
# This verifies that the links we are about to create will not
|
||||
# overwrite an existing file.
|
||||
home.activation.checkLinkTargets = lib.hm.dag.entryBefore [ "writeBoundary" ] (
|
||||
let
|
||||
# Paths that should be forcibly overwritten by Home Manager.
|
||||
# Caveat emptor!
|
||||
forcedPaths = lib.concatMapStringsSep " " (p: ''"$HOME"/${lib.escapeShellArg p}'') (
|
||||
lib.mapAttrsToList (n: v: v.target) (lib.filterAttrs (n: v: v.force) cfg)
|
||||
);
|
||||
home.activation.checkLinkTargets = lib.hm.dag.entryBefore [ "writeBoundary" ] ''
|
||||
${lib.getExe putter} check -v \
|
||||
--state-file "${putterStatePath}" \
|
||||
${config.home.internal.filePutterConfig}
|
||||
'';
|
||||
|
||||
storeDir = lib.escapeShellArg builtins.storeDir;
|
||||
|
||||
check = pkgs.replaceVars ./files/check-link-targets.sh {
|
||||
inherit (config.lib.bash) initHomeManagerLib;
|
||||
inherit forcedPaths storeDir;
|
||||
};
|
||||
in
|
||||
''
|
||||
function checkNewGenCollision() {
|
||||
local newGenFiles
|
||||
newGenFiles="$(readlink -e "$newGenPath/home-files")"
|
||||
find "$newGenFiles" \( -type f -or -type l \) \
|
||||
-exec bash ${check} "$newGenFiles" {} +
|
||||
}
|
||||
|
||||
checkNewGenCollision || exit 1
|
||||
''
|
||||
);
|
||||
|
||||
# This activation script will
|
||||
#
|
||||
# 1. Remove files from the old generation that are not in the new
|
||||
# generation.
|
||||
#
|
||||
# 2. Symlink files from the new generation into $HOME.
|
||||
#
|
||||
# This order is needed to ensure that we always know which links
|
||||
# belong to which generation. Specifically, if we're moving from
|
||||
# generation A to generation B having sets of home file links FA
|
||||
# and FB, respectively then cleaning before linking produces state
|
||||
# transitions similar to
|
||||
#
|
||||
# FA → FA ∩ FB → (FA ∩ FB) ∪ FB = FB
|
||||
#
|
||||
# and a failure during the intermediate state FA ∩ FB will not
|
||||
# result in lost links because this set of links are in both the
|
||||
# source and target generation.
|
||||
home.activation.linkGeneration = lib.hm.dag.entryAfter [ "writeBoundary" ] (
|
||||
let
|
||||
link = pkgs.writeShellScript "link" ''
|
||||
${config.lib.bash.initHomeManagerLib}
|
||||
|
||||
newGenFiles="$1"
|
||||
shift
|
||||
for sourcePath in "$@" ; do
|
||||
relativePath="''${sourcePath#$newGenFiles/}"
|
||||
targetPath="$HOME/$relativePath"
|
||||
if [[ -e "$targetPath" && ! -L "$targetPath" ]] ; then
|
||||
if [[ -n "$HOME_MANAGER_BACKUP_COMMAND" ]] ; then
|
||||
verboseEcho "Running $HOME_MANAGER_BACKUP_COMMAND $targetPath."
|
||||
run $HOME_MANAGER_BACKUP_COMMAND "$targetPath" || errorEcho "Running `$HOME_MANAGER_BACKUP_COMMAND` on '$targetPath' failed."
|
||||
elif [[ -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then
|
||||
# The target exists, back it up
|
||||
backup="$targetPath.$HOME_MANAGER_BACKUP_EXT"
|
||||
if [[ -e "$backup" && -n "$HOME_MANAGER_BACKUP_OVERWRITE" ]]; then
|
||||
run rm $VERBOSE_ARG "$backup"
|
||||
fi
|
||||
run mv $VERBOSE_ARG "$targetPath" "$backup" || errorEcho "Moving '$targetPath' failed!"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -e "$targetPath" && ! -L "$targetPath" ]] && cmp -s "$sourcePath" "$targetPath" ; then
|
||||
# The target exists but is identical – don't do anything.
|
||||
verboseEcho "Skipping '$targetPath' as it is identical to '$sourcePath'"
|
||||
else
|
||||
# Place that symlink, --force
|
||||
# This can still fail if the target is a directory, in which case we bail out.
|
||||
run mkdir -p $VERBOSE_ARG "$(dirname "$targetPath")"
|
||||
run ln -Tsf $VERBOSE_ARG "$sourcePath" "$targetPath" || exit 1
|
||||
fi
|
||||
done
|
||||
'';
|
||||
|
||||
cleanup = pkgs.writeShellScript "cleanup" ''
|
||||
${config.lib.bash.initHomeManagerLib}
|
||||
|
||||
# A symbolic link whose target path matches this pattern will be
|
||||
# considered part of a Home Manager generation.
|
||||
homeFilePattern="$(readlink -e ${lib.escapeShellArg builtins.storeDir})/*-home-manager-files/*"
|
||||
|
||||
newGenFiles="$1"
|
||||
shift 1
|
||||
for relativePath in "$@" ; do
|
||||
targetPath="$HOME/$relativePath"
|
||||
if [[ -e "$newGenFiles/$relativePath" ]] ; then
|
||||
verboseEcho "Checking $targetPath: exists"
|
||||
elif [[ ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then
|
||||
warnEcho "Path '$targetPath' does not link into a Home Manager generation. Skipping delete."
|
||||
else
|
||||
verboseEcho "Checking $targetPath: gone (deleting)"
|
||||
run rm $VERBOSE_ARG "$targetPath"
|
||||
|
||||
# Recursively delete empty parent directories.
|
||||
targetDir="$(dirname "$relativePath")"
|
||||
if [[ "$targetDir" != "." ]] ; then
|
||||
pushd "$HOME" > /dev/null
|
||||
|
||||
# Call rmdir with a relative path excluding $HOME.
|
||||
# Otherwise, it might try to delete $HOME and exit
|
||||
# with a permission error.
|
||||
run rmdir $VERBOSE_ARG \
|
||||
-p --ignore-fail-on-non-empty \
|
||||
"$targetDir"
|
||||
|
||||
popd > /dev/null
|
||||
fi
|
||||
fi
|
||||
done
|
||||
'';
|
||||
in
|
||||
''
|
||||
function linkNewGen() {
|
||||
_i "Creating home file links in %s" "$HOME"
|
||||
|
||||
local newGenFiles
|
||||
newGenFiles="$(readlink -e "$newGenPath/home-files")"
|
||||
find "$newGenFiles" \( -type f -or -type l \) \
|
||||
-exec bash ${link} "$newGenFiles" {} +
|
||||
}
|
||||
|
||||
function cleanOldGen() {
|
||||
if [[ ! -v oldGenPath || ! -e "$oldGenPath/home-files" ]] ; then
|
||||
return
|
||||
fi
|
||||
|
||||
_i "Cleaning up orphan links from %s" "$HOME"
|
||||
|
||||
local newGenFiles oldGenFiles
|
||||
newGenFiles="$(readlink -e "$newGenPath/home-files")"
|
||||
oldGenFiles="$(readlink -e "$oldGenPath/home-files")"
|
||||
|
||||
# Apply the cleanup script on each leaf in the old
|
||||
# generation. The find command below will print the
|
||||
# relative path of the entry.
|
||||
find "$oldGenFiles" '(' -type f -or -type l ')' -printf '%P\0' \
|
||||
| xargs -0 bash ${cleanup} "$newGenFiles"
|
||||
}
|
||||
|
||||
cleanOldGen
|
||||
linkNewGen
|
||||
''
|
||||
);
|
||||
home.activation.linkGeneration = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
${lib.getExe putter} apply $VERBOSE_ARG -v ''${DRY_RUN:+--dry-run} \
|
||||
--state-file "${putterStatePath}" \
|
||||
${config.home.internal.filePutterConfig}
|
||||
'';
|
||||
|
||||
home.activation.checkFilesChanged = lib.hm.dag.entryBefore [ "linkGeneration" ] (
|
||||
let
|
||||
@@ -286,6 +158,18 @@ in
|
||||
'') (lib.filter (v: v.onChange != "") (lib.attrValues cfg))
|
||||
);
|
||||
|
||||
home.internal.filePutterConfig =
|
||||
let
|
||||
putter = import ./lib/putter.nix { inherit lib; };
|
||||
manifest = putter.mkPutterManifest {
|
||||
inherit putterStatePath;
|
||||
sourceBaseDirectory = config.home-files;
|
||||
targetBaseDirectory = config.home.homeDirectory;
|
||||
fileEntries = attrValues cfg;
|
||||
};
|
||||
in
|
||||
pkgs.writeText "hm-putter.json" manifest;
|
||||
|
||||
# Symlink directories and files that have the right execute bit.
|
||||
# Copy files that need their execute bit changed.
|
||||
home-files =
|
||||
|
||||
@@ -193,6 +193,13 @@ in
|
||||
description = "The user's username.";
|
||||
};
|
||||
|
||||
home.uid = mkOption {
|
||||
type = types.nullOr types.ints.unsigned;
|
||||
default = null;
|
||||
example = 1000;
|
||||
description = "The user's uid.";
|
||||
};
|
||||
|
||||
home.homeDirectory = mkOption {
|
||||
type = types.path;
|
||||
defaultText = literalExpression ''
|
||||
@@ -570,14 +577,25 @@ in
|
||||
warnings =
|
||||
let
|
||||
hmRelease = config.home.version.release;
|
||||
nixpkgsRelease = lib.trivial.release;
|
||||
releaseMismatch = config.home.enableNixpkgsReleaseCheck && hmRelease != nixpkgsRelease;
|
||||
libRelease = lib.trivial.release;
|
||||
pkgsRelease = pkgs.lib.trivial.release;
|
||||
releaseMismatch = hmRelease != libRelease || hmRelease != pkgsRelease;
|
||||
|
||||
versionsSummary =
|
||||
if libRelease == pkgsRelease then
|
||||
''
|
||||
Home Manager version ${hmRelease} and
|
||||
Nixpkgs version ${libRelease}.''
|
||||
else
|
||||
''
|
||||
Home Manager version: ${hmRelease}
|
||||
Nixpkgs version used to evaluate Home Manager: ${libRelease}
|
||||
Nixpkgs version used for packages (`pkgs`): ${pkgsRelease}'';
|
||||
in
|
||||
lib.optional releaseMismatch ''
|
||||
lib.optional (config.home.enableNixpkgsReleaseCheck && releaseMismatch) ''
|
||||
You are using
|
||||
|
||||
Home Manager version ${hmRelease} and
|
||||
Nixpkgs version ${nixpkgsRelease}.
|
||||
${lib.replaceString "\n" "\n " versionsSummary}
|
||||
|
||||
Using mismatched versions is likely to cause errors and unexpected
|
||||
behavior. It is therefore highly recommended to use a release of Home
|
||||
@@ -831,6 +849,9 @@ in
|
||||
if [[ ! -v SKIP_SANITY_CHECKS ]]; then
|
||||
checkUsername ${lib.escapeShellArg config.home.username}
|
||||
checkHomeDirectory ${lib.escapeShellArg config.home.homeDirectory}
|
||||
${lib.optionalString (config.home.uid != null) ''
|
||||
checkUid ${toString config.home.uid}
|
||||
''}
|
||||
fi
|
||||
|
||||
${lib.optionalString config.home.activationGenerateGcRoot ''
|
||||
@@ -885,6 +906,7 @@ in
|
||||
--subst-var-by GENERATION_DIR $out
|
||||
|
||||
ln -s ${config.home-files} $out/home-files
|
||||
ln -s ${config.home.internal.filePutterConfig} $out/putter.json
|
||||
ln -s ${cfg.path} $out/home-path
|
||||
|
||||
cp "$extraDependenciesPath" "$out/extra-dependencies"
|
||||
|
||||
@@ -117,6 +117,17 @@ function checkHomeDirectory() {
|
||||
fi
|
||||
}
|
||||
|
||||
function checkUid() {
|
||||
local expectedUid="$1"
|
||||
local actualUid
|
||||
actualUid="$(id -u)"
|
||||
|
||||
if [[ "$actualUid" != "$expectedUid" ]]; then
|
||||
_iError 'Error: UID is "%s" but we expect "%s"' "$actualUid" "$expectedUid"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Note, the VERBOSE_ECHO variable is deprecated and should not be used inside
|
||||
# the Home Manager project. It is provided here for backwards compatibility.
|
||||
if [[ -v VERBOSE ]]; then
|
||||
|
||||
81
modules/lib/putter.nix
Normal file
81
modules/lib/putter.nix
Normal file
@@ -0,0 +1,81 @@
|
||||
# Contains some handy functions for generating Putter file manifests.
|
||||
|
||||
{ lib }:
|
||||
|
||||
let
|
||||
|
||||
inherit (lib)
|
||||
concatMap
|
||||
concatLists
|
||||
mapAttrsToList
|
||||
hasPrefix
|
||||
filter
|
||||
;
|
||||
|
||||
in
|
||||
{
|
||||
# Converts a Home Manager style list of file specifications into a Putter
|
||||
# configuration.
|
||||
#
|
||||
# Note, the interface of this function is not considered stable, it may change
|
||||
# as the needs of Home Manager change.
|
||||
mkPutterManifest =
|
||||
{
|
||||
putterStatePath,
|
||||
sourceBaseDirectory,
|
||||
targetBaseDirectory,
|
||||
fileEntries,
|
||||
}:
|
||||
let
|
||||
# Convert a directory to a Putter configuration. Basically, this will
|
||||
# create a file entry for each file in the directory. Any sub-directories
|
||||
# will be handled recursively.
|
||||
mkDirEntry =
|
||||
f:
|
||||
concatLists (
|
||||
mapAttrsToList (
|
||||
n: v:
|
||||
let
|
||||
f' = f // {
|
||||
source = "${f.source}/${n}";
|
||||
target = "${f.target}/${n}";
|
||||
};
|
||||
in
|
||||
mkEntriesForType f' v
|
||||
) (builtins.readDir f.source)
|
||||
);
|
||||
|
||||
mkEntriesForType =
|
||||
f: t:
|
||||
if t == "regular" || t == "symlink" then
|
||||
mkFileEntry f
|
||||
else if t == "directory" then
|
||||
mkDirEntry f
|
||||
else
|
||||
throw "unexpected file type ${t}";
|
||||
|
||||
# Create a file entry for the given file.
|
||||
mkFileEntry = f: [
|
||||
{
|
||||
collision.resolution = if f.force then "force" else "abort";
|
||||
action.type = "symlink";
|
||||
source = "${sourceBaseDirectory}/${f.target}";
|
||||
target = (if hasPrefix "/" f.target then "" else "${targetBaseDirectory}/") + f.target;
|
||||
}
|
||||
];
|
||||
|
||||
# Given a Home Manager file entry, produce a list of Putter entries. For
|
||||
# recursive HM file entries, we recursively traverse the source directory
|
||||
# and generate a Putter entry for each file we encounter.
|
||||
mkEntries = f: if f.recursive then mkEntriesForType f "directory" else mkFileEntry f;
|
||||
|
||||
putterJson = {
|
||||
version = "1";
|
||||
state = putterStatePath;
|
||||
files = concatMap mkEntries (filter (f: f.enable) fileEntries);
|
||||
};
|
||||
|
||||
putterJsonText = builtins.toJSON putterJson;
|
||||
in
|
||||
putterJsonText;
|
||||
}
|
||||
@@ -17,15 +17,29 @@ let
|
||||
# The dconf keys managed by this configuration. We store this as part of the
|
||||
# generation state to be able to reset keys that become unmanaged during
|
||||
# switch.
|
||||
stateDconfKeys = pkgs.writeText "dconf-keys.json" (
|
||||
builtins.toJSON (
|
||||
lib.concatLists (
|
||||
lib.mapAttrsToList (
|
||||
dir: entries: lib.mapAttrsToList (key: _: "/${dir}/${key}") entries
|
||||
) cfg.settings
|
||||
mkStateDconfKeys =
|
||||
nameSuffix: settings:
|
||||
pkgs.writeText "dconf-keys${nameSuffix}.json" (
|
||||
builtins.toJSON (
|
||||
lib.concatLists (
|
||||
lib.mapAttrsToList (dir: entries: lib.mapAttrsToList (key: _: "/${dir}/${key}") entries) settings
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
);
|
||||
|
||||
databases =
|
||||
lib.optional (cfg.settings != { }) {
|
||||
dconfProfile = null;
|
||||
stateDconfKeys = mkStateDconfKeys "" cfg.settings;
|
||||
inherit (cfg) settings;
|
||||
}
|
||||
++ lib.mapAttrsToList (name: value: {
|
||||
dconfProfile = pkgs.writeText "dconf-profile-${name}" ''
|
||||
user-db:${name}
|
||||
'';
|
||||
stateDconfKeys = mkStateDconfKeys "-${name}" value;
|
||||
settings = value;
|
||||
}) cfg.databases;
|
||||
|
||||
in
|
||||
{
|
||||
@@ -81,73 +95,87 @@ in
|
||||
to convert dconf database dumps into compatible Nix expression.
|
||||
'';
|
||||
};
|
||||
databases = lib.mkOption {
|
||||
type = with types; attrsOf (attrsOf (attrsOf lib.hm.types.gvariant));
|
||||
default = { };
|
||||
description = ''
|
||||
Settings to write to specific dconf user databases.
|
||||
See [](#opt-dconf.settings) for details.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (cfg.enable && cfg.settings != { }) {
|
||||
config = lib.mkIf (cfg.enable && databases != [ ]) {
|
||||
# Make sure the dconf directory exists.
|
||||
xdg.configFile."dconf/.keep".source = builtins.toFile "keep" "";
|
||||
|
||||
home.extraBuilderCommands = ''
|
||||
mkdir -p $out/state/
|
||||
ln -s ${stateDconfKeys} $out/state/${stateDconfKeys.name}
|
||||
'';
|
||||
''
|
||||
+ lib.concatMapStrings (db: ''
|
||||
ln -s ${db.stateDconfKeys} $out/state/${db.stateDconfKeys.name}
|
||||
'') databases;
|
||||
|
||||
home.activation.dconfSettings = lib.hm.dag.entryAfter [ "installPackages" ] (
|
||||
let
|
||||
iniFile = pkgs.writeText "hm-dconf.ini" (toDconfIni cfg.settings);
|
||||
lib.concatMapStrings (
|
||||
db:
|
||||
let
|
||||
iniFile = pkgs.writeText "hm-dconf.ini" (toDconfIni db.settings);
|
||||
|
||||
statePath = "state/${stateDconfKeys.name}";
|
||||
statePath = "state/${db.stateDconfKeys.name}";
|
||||
|
||||
cleanup = pkgs.writeShellScript "dconf-cleanup" ''
|
||||
set -euo pipefail
|
||||
cleanup = pkgs.writeShellScript "dconf-cleanup" ''
|
||||
set -euo pipefail
|
||||
|
||||
${config.lib.bash.initHomeManagerLib}
|
||||
${config.lib.bash.initHomeManagerLib}
|
||||
|
||||
PATH=${
|
||||
lib.makeBinPath [
|
||||
pkgs.dconf
|
||||
pkgs.jq
|
||||
]
|
||||
}''${PATH:+:}$PATH
|
||||
PATH=${
|
||||
lib.makeBinPath [
|
||||
pkgs.dconf
|
||||
pkgs.jq
|
||||
]
|
||||
}''${PATH:+:}$PATH
|
||||
|
||||
oldState="$1"
|
||||
newState="$2"
|
||||
oldState="$1"
|
||||
newState="$2"
|
||||
|
||||
# Can't do cleanup if we don't know the old state.
|
||||
if [[ ! -f $oldState ]]; then
|
||||
exit 0
|
||||
# Can't do cleanup if we don't know the old state.
|
||||
if [[ ! -f $oldState ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Reset all keys that are present in the old generation but not the new
|
||||
# one.
|
||||
jq -r -n \
|
||||
--slurpfile old "$oldState" \
|
||||
--slurpfile new "$newState" \
|
||||
'($old[] - $new[])[]' \
|
||||
| while read -r key; do
|
||||
verboseEcho "Resetting dconf key \"$key\""
|
||||
run $DCONF_DBUS_RUN_SESSION dconf reset "$key"
|
||||
done
|
||||
'';
|
||||
envCommand = lib.optionalString (db.dconfProfile != null) "env DCONF_PROFILE=${db.dconfProfile}";
|
||||
in
|
||||
''
|
||||
if [[ -v DBUS_SESSION_BUS_ADDRESS ]]; then
|
||||
export DCONF_DBUS_RUN_SESSION="${envCommand}"
|
||||
else
|
||||
export DCONF_DBUS_RUN_SESSION="${pkgs.dbus}/bin/dbus-run-session --dbus-daemon=${pkgs.dbus}/bin/dbus-daemon ${envCommand}"
|
||||
fi
|
||||
|
||||
# Reset all keys that are present in the old generation but not the new
|
||||
# one.
|
||||
jq -r -n \
|
||||
--slurpfile old "$oldState" \
|
||||
--slurpfile new "$newState" \
|
||||
'($old[] - $new[])[]' \
|
||||
| while read -r key; do
|
||||
verboseEcho "Resetting dconf key \"$key\""
|
||||
run $DCONF_DBUS_RUN_SESSION dconf reset "$key"
|
||||
done
|
||||
'';
|
||||
in
|
||||
''
|
||||
if [[ -v DBUS_SESSION_BUS_ADDRESS ]]; then
|
||||
export DCONF_DBUS_RUN_SESSION=""
|
||||
else
|
||||
export DCONF_DBUS_RUN_SESSION="${pkgs.dbus}/bin/dbus-run-session --dbus-daemon=${pkgs.dbus}/bin/dbus-daemon"
|
||||
fi
|
||||
if [[ -v oldGenPath ]]; then
|
||||
${cleanup} \
|
||||
"$oldGenPath/${statePath}" \
|
||||
"$newGenPath/${statePath}"
|
||||
fi
|
||||
|
||||
if [[ -v oldGenPath ]]; then
|
||||
${cleanup} \
|
||||
"$oldGenPath/${statePath}" \
|
||||
"$newGenPath/${statePath}"
|
||||
fi
|
||||
run $DCONF_DBUS_RUN_SESSION ${pkgs.dconf}/bin/dconf load / < ${iniFile}
|
||||
|
||||
run $DCONF_DBUS_RUN_SESSION ${pkgs.dconf}/bin/dconf load / < ${iniFile}
|
||||
|
||||
unset DCONF_DBUS_RUN_SESSION
|
||||
''
|
||||
unset DCONF_DBUS_RUN_SESSION
|
||||
''
|
||||
) databases
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ in
|
||||
theme = mkOption {
|
||||
type = types.nullOr themeType;
|
||||
default = null;
|
||||
description = "Default theme for all GTK versions.";
|
||||
description = "Default theme for GTK 2/3.";
|
||||
};
|
||||
|
||||
iconTheme = mkOption {
|
||||
|
||||
@@ -45,9 +45,17 @@ in
|
||||
packageExample = "pkgs.gnome.gnome-themes-extra";
|
||||
}
|
||||
);
|
||||
default = cfg.theme;
|
||||
defaultText = literalExpression "config.gtk.theme";
|
||||
description = "Theme for GTK 4 applications.";
|
||||
default = if lib.versionOlder config.home.stateVersion "26.05" then cfg.theme else null;
|
||||
defaultText = literalExpression ''if lib.versionOlder config.home.stateVersion "26.05" then cfg.theme else null'';
|
||||
description = ''
|
||||
Theme for GTK 4 applications.
|
||||
|
||||
Warning: This is not officially supported and applied using a workaround.
|
||||
It may cause issues with some apps.
|
||||
|
||||
For context, see [Please don’t theme our apps](https://stopthemingmy.app/)
|
||||
and [Restyling apps at scale](https://blogs.gnome.org/tbernard/2018/10/15/restyling-apps-at-scale/).
|
||||
'';
|
||||
};
|
||||
|
||||
iconTheme = mkOption {
|
||||
|
||||
9
modules/misc/news/2025/10/2025-10-15_10-44-58.nix
Normal file
9
modules/misc/news/2025/10/2025-10-15_10-44-58.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
time = "2025-10-14T23:44:58+00:00";
|
||||
condition = true;
|
||||
message = ''
|
||||
A new module is available: `services.colima`
|
||||
|
||||
Colima is a tool for orchestrating container runtimes under a linux VM.
|
||||
'';
|
||||
}
|
||||
9
modules/misc/news/2025/11/2025-11-26_06-33-49.nix
Normal file
9
modules/misc/news/2025/11/2025-11-26_06-33-49.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
time = "2025-11-26T05:33:49+00:00";
|
||||
condition = true;
|
||||
message = ''
|
||||
A new module is available: 'programs.cargo'.
|
||||
|
||||
cargo is the build system and package manager of Rust.
|
||||
'';
|
||||
}
|
||||
11
modules/misc/news/2025/11/2025-11-26_11-55-28.nix
Normal file
11
modules/misc/news/2025/11/2025-11-26_11-55-28.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
time = "2025-11-26T10:55:28+00:00";
|
||||
condition = true;
|
||||
message = ''
|
||||
The option 'gtk.theme' does not apply to GTK 4 automatically anymore for new
|
||||
installations (with `home.stateVersion` >= "26.05"). Using a custom theme is
|
||||
not officially supported by GTK 4, and implemented by home-manager using a
|
||||
workaround that may cause issues in some cases. If you still want to use a GTK
|
||||
4 theme, you need to explicitly set 'gtk.gtk4.theme'.
|
||||
'';
|
||||
}
|
||||
10
modules/misc/news/2025/11/2025-11-27_08-22-14.nix
Normal file
10
modules/misc/news/2025/11/2025-11-27_08-22-14.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
time = "2025-11-27T07:22:14+00:00";
|
||||
condition = pkgs.stdenv.hostPlatform.isDarwin;
|
||||
message = ''
|
||||
A new module is available: 'programs.infat'.
|
||||
Infat is a command line tool to set default openers
|
||||
for file formats and url schemes on macOS.
|
||||
'';
|
||||
}
|
||||
7
modules/misc/news/2025/11/2025-11-30_00-04-38.nix
Normal file
7
modules/misc/news/2025/11/2025-11-30_00-04-38.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
time = "2025-11-29T23:04:38+00:00";
|
||||
condition = true;
|
||||
message = ''
|
||||
A new module is available: 'programs.parallel'.
|
||||
'';
|
||||
}
|
||||
16
modules/misc/news/2025/12/2025-12-01_09-35-38.nix
Normal file
16
modules/misc/news/2025/12/2025-12-01_09-35-38.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
time = "2025-12-01T12:35:38+00:00";
|
||||
condition = config.services.ludusavi.enable;
|
||||
message = ''
|
||||
BREAKING CHANGE:
|
||||
|
||||
The `ludusavi` module has changed its default backup and restore path.
|
||||
The new module implements a mechanism to automatically migrate the backups
|
||||
to the new path, but if it doesn't work and you can't find your backups in
|
||||
`ludusavi`, they should be in the old path: ~/\$XDG_STATE_HOME/backups/ludusavi/
|
||||
(that means a directory literally called $XDG_STATE_HOME in your home, rather than
|
||||
the env var expanded). For more info, see pull #8234.
|
||||
'';
|
||||
}
|
||||
12
modules/misc/news/2025/12/2025-12-03_10-14-53.nix
Normal file
12
modules/misc/news/2025/12/2025-12-03_10-14-53.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
time = "2025-12-03T13:14:53+00:00";
|
||||
condition = true;
|
||||
message = ''
|
||||
A new module is available: `programs.calibre`
|
||||
|
||||
Calibre is a powerful and easy to use e-book manager. Users say it’s outstanding
|
||||
and a must-have. It’ll allow you to do nearly everything and it takes things a
|
||||
step beyond normal e-book software. It’s also completely free and open source
|
||||
and great for both casual users and computer experts.
|
||||
'';
|
||||
}
|
||||
12
modules/misc/news/2025/12/2025-12-04_16-34-38.nix
Normal file
12
modules/misc/news/2025/12/2025-12-04_16-34-38.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
time = "2025-12-04T19:34:38+00:00";
|
||||
condition = true;
|
||||
message = ''
|
||||
A new module is available: `programs.screen`
|
||||
|
||||
GNU Screen is a terminal multiplexer, a software application that can
|
||||
be used to multiplex several virtual consoles, allowing a user to access
|
||||
multiple separate login sessions inside a single terminal window, or detach
|
||||
and reattach sessions from a terminal.
|
||||
'';
|
||||
}
|
||||
12
modules/misc/news/2025/12/2025-12-04_22-50-03.nix
Normal file
12
modules/misc/news/2025/12/2025-12-04_22-50-03.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
time = "2025-12-05T01:50:03+00:00";
|
||||
condition = pkgs.stdenv.hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: `programs.hyprlauncher`
|
||||
|
||||
Hyprlauncher is a multipurpose and versatile launcher/picker
|
||||
for hyprland. It’s fast, simple, and provides various modules.
|
||||
'';
|
||||
}
|
||||
10
modules/misc/news/2025/12/2025-12-06_11-03-01.nix
Normal file
10
modules/misc/news/2025/12/2025-12-06_11-03-01.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
time = "2025-12-06T10:03:01+00:00";
|
||||
condition = true;
|
||||
message = ''
|
||||
A new module is available: `programs.npm`
|
||||
|
||||
It allows you manage your npm user configuration (`.npmrc`)
|
||||
and install a specific version of the package.
|
||||
'';
|
||||
}
|
||||
10
modules/misc/news/2025/12/2025-12-06_11-05-43.nix
Normal file
10
modules/misc/news/2025/12/2025-12-06_11-05-43.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
time = "2025-12-06T10:05:43+00:00";
|
||||
condition = true;
|
||||
message = ''
|
||||
A new module is available: `programs.ty`
|
||||
|
||||
It allows to manage the configuration and package
|
||||
of the Python language server `ty` by Astral.
|
||||
'';
|
||||
}
|
||||
32
modules/misc/news/2025/12/2025-12-11_13-04-30.nix
Normal file
32
modules/misc/news/2025/12/2025-12-11_13-04-30.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
time = "2025-12-11T19:04:30+00:00";
|
||||
condition =
|
||||
let
|
||||
helixEnabled = config.programs.helix.enable && config.programs.helix.defaultEditor;
|
||||
kakouneEnabled = config.programs.kakoune.enable && config.programs.kakoune.defaultEditor;
|
||||
neovimEnabled = config.programs.neovim.enable && config.programs.neovim.defaultEditor;
|
||||
vimEnabled = config.programs.vim.enable && config.programs.vim.defaultEditor;
|
||||
emacsEnabled = config.services.emacs.enable && config.services.emacs.defaultEditor;
|
||||
in
|
||||
helixEnabled || kakouneEnabled || neovimEnabled || vimEnabled || emacsEnabled;
|
||||
message = ''
|
||||
The 'defaultEditor' option now sets both {env}`EDITOR` and {env}`VISUAL`
|
||||
environment variables.
|
||||
|
||||
Previously, only {env}`EDITOR` was set. The {env}`VISUAL` variable is now
|
||||
also configured to point to the same editor, which is the expected behavior
|
||||
for modern terminal editors.
|
||||
|
||||
This change affects the following modules:
|
||||
- programs.helix
|
||||
- programs.kakoune
|
||||
- programs.neovim
|
||||
- programs.vim
|
||||
- services.emacs
|
||||
|
||||
No action is required. This change should improve compatibility with tools
|
||||
that check {env}`VISUAL` before {env}`EDITOR`.
|
||||
'';
|
||||
}
|
||||
12
modules/misc/news/2025/12/2025-12-12_19-20-28.nix
Normal file
12
modules/misc/news/2025/12/2025-12-12_19-20-28.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
time = "2025-12-12T19:20:28+00:00";
|
||||
condition = config.xsession.windowManager.herbstluftwm.enable;
|
||||
message = ''
|
||||
It is now possible to disable the `herbstclient` alias in the autostart
|
||||
script by setting `xsession.windowManagers.herbsluftwm.enableAlias = false`.
|
||||
This makes it possible to use the `herbstclient` command in bash functions,
|
||||
though may cause flickering while the autostart script runs.
|
||||
'';
|
||||
}
|
||||
@@ -26,6 +26,7 @@ in
|
||||
"24.11"
|
||||
"25.05"
|
||||
"25.11"
|
||||
"26.05"
|
||||
];
|
||||
description = ''
|
||||
It is occasionally necessary for Home Manager to change
|
||||
|
||||
@@ -8,26 +8,28 @@ 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: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: Automatically generated\n"
|
||||
"Language-Team: none\n"
|
||||
"PO-Revision-Date: 2025-11-30 14:00+0000\n"
|
||||
"Last-Translator: Brian E <brianellingsgaard9@gmail.com>\n"
|
||||
"Language-Team: Faroese <https://hosted.weblate.org/projects/home-manager/"
|
||||
"modules/fo/>\n"
|
||||
"Language: fo\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"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"
|
||||
|
||||
#: modules/files.nix:206
|
||||
msgid "Creating home file links in %s"
|
||||
msgstr ""
|
||||
msgstr "Stávni heimafílaleinkir innaní %s"
|
||||
|
||||
#: modules/files.nix:219
|
||||
msgid "Cleaning up orphan links from %s"
|
||||
msgstr ""
|
||||
msgstr "Ruddi foreldraleys leinkir frá %s"
|
||||
|
||||
#: modules/home-environment.nix:647
|
||||
msgid "Creating new profile generation"
|
||||
msgstr ""
|
||||
msgstr "Stovni nýggjan profil ættarlið"
|
||||
|
||||
#: modules/home-environment.nix:650
|
||||
msgid "No change so reusing latest profile generation"
|
||||
|
||||
@@ -8,8 +8,8 @@ msgstr ""
|
||||
"Project-Id-Version: Home Manager Modules\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n"
|
||||
"POT-Creation-Date: 2025-07-22 10:59+0200\n"
|
||||
"PO-Revision-Date: 2025-03-07 18:58+0000\n"
|
||||
"Last-Translator: 807 <s10855168@gmail.com>\n"
|
||||
"PO-Revision-Date: 2025-12-04 04:17+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/modules/zh_Hant/>\n"
|
||||
"Language: zh_Hant\n"
|
||||
@@ -17,7 +17,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Weblate 5.10.3-dev\n"
|
||||
"X-Generator: Weblate 5.15-dev\n"
|
||||
|
||||
#: modules/files.nix:206
|
||||
msgid "Creating home file links in %s"
|
||||
@@ -25,15 +25,15 @@ msgstr "正在 %s 中建立家目錄檔案連結"
|
||||
|
||||
#: modules/files.nix:219
|
||||
msgid "Cleaning up orphan links from %s"
|
||||
msgstr "正在從 %s 清理孤立連結"
|
||||
msgstr "正在清理 %s 中的孤立連結"
|
||||
|
||||
#: modules/home-environment.nix:647
|
||||
msgid "Creating new profile generation"
|
||||
msgstr "正在建立新一代的配置文件中"
|
||||
msgstr "正在建立新的世代設定檔"
|
||||
|
||||
#: modules/home-environment.nix:650
|
||||
msgid "No change so reusing latest profile generation"
|
||||
msgstr "為發生改變,請重新使用新一代的配置文件"
|
||||
msgstr "沒有變更,將重複使用最新的設定檔世代"
|
||||
|
||||
#: modules/home-environment.nix:699
|
||||
msgid ""
|
||||
@@ -50,18 +50,18 @@ msgid ""
|
||||
"\n"
|
||||
"Then try activating your Home Manager configuration again."
|
||||
msgstr ""
|
||||
"糟糕,Nix 未能安裝您的新 Home Manager 配置文件!\n"
|
||||
"糟糕,Nix 無法安裝您的新 Home Manager 設定檔!\n"
|
||||
"\n"
|
||||
"也許這裏和使用 \"%s\" 安裝的包有衝突?\n"
|
||||
"嘗試運行\n"
|
||||
"可能與使用 \"%s\" 安裝的套件衝突?\n"
|
||||
"請嘗試執行\n"
|
||||
"\n"
|
||||
" %s\n"
|
||||
"\n"
|
||||
"如果有衝突的包,你可以用\n"
|
||||
"如果有衝突的套件,您可以使用以下指令移除\n"
|
||||
"\n"
|
||||
" %s\n"
|
||||
"\n"
|
||||
"來移除。然後嘗試再次啟用您的 Home Manager 配置。"
|
||||
"然後再次嘗試啟用您的 Home Manager 設定。"
|
||||
|
||||
#: modules/home-environment.nix:735
|
||||
msgid "Activating %s"
|
||||
@@ -69,27 +69,27 @@ msgstr "正在啟用 %s"
|
||||
|
||||
#: modules/home-environment.nix:807
|
||||
msgid "%s: unknown option '%s'"
|
||||
msgstr ""
|
||||
msgstr "%s:未知選項 '%s'"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:22
|
||||
msgid "Migrating profile from %s to %s"
|
||||
msgstr "正在從 %S 配置文件轉移到 %s 中"
|
||||
msgstr "正在將設定檔從 %s 遷移至 %s"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:54
|
||||
msgid "Could not find suitable profile directory, tried %s and %s"
|
||||
msgstr "找不到合適的 profile 目錄,已經嘗試 %s 和 %s"
|
||||
msgstr "找不到合適的設定檔目錄,已嘗試 %s 和 %s"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:106
|
||||
msgid "Error: USER is set to \"%s\" but we expect \"%s\""
|
||||
msgstr "錯誤:USER 被設定為 「%s」但我們希望是 「%s」"
|
||||
msgstr "錯誤:USER 被設定為「%s」,但我們的預期為「%s」"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:115
|
||||
msgid "Error: HOME is set to \"%s\" but we expect \"%s\""
|
||||
msgstr "錯誤:HOME 被設定為 「%s」但我們預期得到 「%s」"
|
||||
msgstr "錯誤:HOME 被設定為「%s」,但我們的預期為「%s」"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:132
|
||||
msgid "Starting Home Manager activation"
|
||||
msgstr "正在啟動 Home Manager 初始化程式"
|
||||
msgstr "正在進行 Home Manager 啟用程序"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:136
|
||||
msgid "Sanity checking Nix"
|
||||
@@ -97,19 +97,19 @@ msgstr "正在進行 Nix 完整性檢查"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:149
|
||||
msgid "This is a dry run"
|
||||
msgstr "這是試運行"
|
||||
msgstr "這是模擬執行"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:153
|
||||
msgid "This is a live run"
|
||||
msgstr "這是在實際運行"
|
||||
msgstr "這是實際執行"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:159
|
||||
msgid "Using Nix version: %s"
|
||||
msgstr "正在使用的 Nix 版本: %s"
|
||||
msgstr "使用中的 Nix 版本:%s"
|
||||
|
||||
#: modules/lib-bash/activation-init.sh:162
|
||||
msgid "Activation variables:"
|
||||
msgstr "啟用的變數:"
|
||||
msgstr "啟用變數:"
|
||||
|
||||
#~ msgid "Creating profile generation %s"
|
||||
#~ msgstr "正在建立配置檔案世代 %s"
|
||||
|
||||
@@ -10,6 +10,12 @@ let
|
||||
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
|
||||
configPath =
|
||||
if config.xdg.enable then
|
||||
"${lib.removePrefix config.home.homeDirectory config.xdg.configHome}/aerospace/aerospace.toml"
|
||||
else
|
||||
".aerospace.toml";
|
||||
|
||||
# filterAttrsRecursive supporting lists, as well.
|
||||
filterListAndAttrsRecursive =
|
||||
pred: set:
|
||||
@@ -39,6 +45,19 @@ in
|
||||
{
|
||||
meta.maintainers = with lib.maintainers; [ damidoug ];
|
||||
|
||||
imports = [
|
||||
(lib.mkRenamedOptionModule
|
||||
[ "programs" "aerospace" "userSettings" ]
|
||||
[ "programs" "aerospace" "settings" ]
|
||||
)
|
||||
|
||||
(lib.mkRemovedOptionModule [
|
||||
"programs"
|
||||
"aerospace"
|
||||
"extraConfig"
|
||||
] "This option has been removed. Please use 'programs.aerospace.settings' instead.")
|
||||
];
|
||||
|
||||
options.programs.aerospace = {
|
||||
enable = lib.mkEnableOption "AeroSpace window manager";
|
||||
|
||||
@@ -81,24 +100,7 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Extra configuration to append to the aerospace.toml file.
|
||||
This allows you to add raw TOML content, including multiline strings.
|
||||
'';
|
||||
example = lib.literalExpression ''
|
||||
alt-enter = ''''exec-and-forget osascript -e '
|
||||
tell application "Terminal"
|
||||
do script
|
||||
activate
|
||||
end tell'
|
||||
''''
|
||||
'';
|
||||
};
|
||||
|
||||
userSettings = mkOption {
|
||||
settings = mkOption {
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
@@ -115,6 +117,27 @@ in
|
||||
alt-k = "focus up";
|
||||
alt-l = "focus right";
|
||||
};
|
||||
on-window-detected = [
|
||||
{
|
||||
"if".app-id = "com.apple.finder";
|
||||
run = "move-node-to-workspace 9";
|
||||
}
|
||||
|
||||
{
|
||||
"if" = {
|
||||
app-id = "com.apple.systempreferences";
|
||||
app-name-regex-substring = "settings";
|
||||
window-title-regex-substring = "substring";
|
||||
workspace = "workspace-name";
|
||||
during-aerospace-startup = true;
|
||||
};
|
||||
check-further-callbacks = true;
|
||||
run = [
|
||||
"layout floating"
|
||||
"move-node-to-workspace S"
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
@@ -128,32 +151,68 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "programs.aerospace" pkgs lib.platforms.darwin)
|
||||
|
||||
# 1. Fail if user sets start-at-login = true BUT launchd is disabled.
|
||||
{
|
||||
assertion =
|
||||
!((lib.hasAttr "start-at-login" cfg.settings) && (cfg.settings."start-at-login" == true))
|
||||
|| (cfg.launchd.enable == true);
|
||||
message = ''
|
||||
You have set `programs.aerospace.settings."start-at-login" = true;`
|
||||
but `programs.aerospace.launchd.enable` is false.
|
||||
|
||||
This tells AeroSpace to manage its own startup, which can conflict
|
||||
with Home Manager.
|
||||
|
||||
To manage startup with Home Manager, please set
|
||||
`programs.aerospace.launchd.enable = true;`
|
||||
(You can leave `start-at-login = true` in your settings, it will be
|
||||
correctly overridden).
|
||||
'';
|
||||
}
|
||||
|
||||
# 2. Fail if user sets after-login-command (in any case).
|
||||
{
|
||||
assertion =
|
||||
!(
|
||||
(lib.hasAttr "after-login-command" cfg.settings)
|
||||
&& (lib.isList cfg.settings."after-login-command")
|
||||
&& (cfg.settings."after-login-command" != [ ])
|
||||
);
|
||||
message = ''
|
||||
You have set `programs.aerospace.settings."after-login-command"`.
|
||||
|
||||
This setting is not supported when using this Home Manager module,
|
||||
as it either conflicts with the launchd service (if enabled)
|
||||
or bypasses it (if disabled).
|
||||
|
||||
The correct way to run commands after AeroSpace starts is to use:
|
||||
1. `programs.aerospace.launchd.enable = true;`
|
||||
2. `programs.aerospace.settings."after-startup-command" = [ ... ];`
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
home = {
|
||||
packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
file.".config/aerospace/aerospace.toml".source =
|
||||
let
|
||||
generatedConfig = tomlFormat.generate "aerospace" (
|
||||
filterNulls (
|
||||
cfg.userSettings
|
||||
// lib.optionalAttrs cfg.launchd.enable {
|
||||
# Override these to avoid launchd conflicts
|
||||
start-at-login = false;
|
||||
after-login-command = [ ];
|
||||
}
|
||||
)
|
||||
);
|
||||
extraConfig = pkgs.writeText "aerospace-extra-config" cfg.extraConfig;
|
||||
in
|
||||
pkgs.runCommandLocal "aerospace.toml"
|
||||
{
|
||||
inherit generatedConfig extraConfig;
|
||||
}
|
||||
''
|
||||
cat "$generatedConfig" "$extraConfig" > "$out"
|
||||
'';
|
||||
file.${configPath} = lib.mkIf (cfg.settings != { }) {
|
||||
source = tomlFormat.generate "aerospace" (
|
||||
filterNulls (
|
||||
cfg.settings
|
||||
// {
|
||||
# Override these to avoid launchd conflicts
|
||||
start-at-login = false;
|
||||
after-login-command = [ ];
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
onChange = lib.mkIf cfg.launchd.enable ''
|
||||
echo "AeroSpace config changed, reloading..."
|
||||
${lib.getExe cfg.package} reload-config
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
launchd.agents.aerospace = {
|
||||
|
||||
44
modules/programs/calibre.nix
Normal file
44
modules/programs/calibre.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
types
|
||||
mkIf
|
||||
mkEnableOption
|
||||
mkPackageOption
|
||||
mkOption
|
||||
;
|
||||
|
||||
cfg = config.programs.calibre;
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.hm.maintainers; [ aguirre-matteo ];
|
||||
options.programs.calibre = {
|
||||
enable = mkEnableOption "calibre";
|
||||
package = mkPackageOption pkgs "calibre" { nullable = true; };
|
||||
plugins = mkOption {
|
||||
type = with types; listOf path;
|
||||
default = [ ];
|
||||
description = "List of plugins to install for calibre";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
||||
xdg.configFile = mkIf (cfg.plugins != [ ]) (
|
||||
let
|
||||
symlinkedPlugins = pkgs.symlinkJoin {
|
||||
name = "calibre-plugins";
|
||||
paths = cfg.plugins;
|
||||
};
|
||||
in
|
||||
lib.mapAttrs' (
|
||||
k: _: lib.nameValuePair "calibre/plugins/${k}" { source = (symlinkedPlugins + "/${k}"); }
|
||||
) (builtins.readDir symlinkedPlugins)
|
||||
);
|
||||
};
|
||||
}
|
||||
43
modules/programs/cargo.nix
Normal file
43
modules/programs/cargo.nix
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkEnableOption;
|
||||
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
|
||||
cfg = config.programs.cargo;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.friedrichaltheide ];
|
||||
|
||||
options = {
|
||||
programs = {
|
||||
cargo = {
|
||||
enable = mkEnableOption "management of cargo config";
|
||||
|
||||
settings = lib.mkOption {
|
||||
inherit (tomlFormat) type;
|
||||
default = { };
|
||||
description = ''
|
||||
Available configuration options for the .cargo/config see:
|
||||
https://doc.rust-lang.org/cargo/reference/config.html
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home = {
|
||||
file = {
|
||||
".cargo/config.toml" = {
|
||||
source = tomlFormat.generate "config.toml" cfg.settings;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -40,7 +40,7 @@ let
|
||||
|
||||
finalPackage = mkOption {
|
||||
inherit visible;
|
||||
type = types.package;
|
||||
type = types.nullOr types.package;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
Resulting customized ${name} package
|
||||
@@ -220,15 +220,22 @@ let
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
lib.mkIf cfg.enable {
|
||||
programs.${browser}.finalPackage = lib.mkIf (cfg.package != null) (
|
||||
assertions = [
|
||||
{
|
||||
assertion = !(cfg.package == null && cfg.commandLineArgs != [ ]);
|
||||
message = "Cannot set `commandLineArgs` when `package` is null for ${browser}.";
|
||||
}
|
||||
];
|
||||
|
||||
programs.${browser}.finalPackage =
|
||||
if cfg.commandLineArgs != [ ] then
|
||||
cfg.package.override {
|
||||
commandLineArgs = lib.concatStringsSep " " cfg.commandLineArgs;
|
||||
}
|
||||
else
|
||||
cfg.package
|
||||
);
|
||||
cfg.package;
|
||||
|
||||
home.packages = lib.mkIf (cfg.finalPackage != null) [
|
||||
cfg.finalPackage
|
||||
|
||||
@@ -348,7 +348,7 @@ in
|
||||
makeWrapperArgs = lib.flatten (
|
||||
lib.filter (x: x != [ ]) [
|
||||
(lib.optional (cfg.mcpServers != { }) [
|
||||
"--add-flags"
|
||||
"--append-flags"
|
||||
"--mcp-config ${jsonFormat.generate "claude-code-mcp-config.json" { inherit (cfg) mcpServers; }}"
|
||||
])
|
||||
]
|
||||
|
||||
@@ -68,8 +68,15 @@ in
|
||||
in
|
||||
lib.mkMerge [
|
||||
(mkIf cfg.enable {
|
||||
# Auto-enable git integration if programs.git.diff-highlight.enable was set to true
|
||||
programs.diff-highlight.enableGitIntegration = lib.mkIf oldOptionEnabled (lib.mkOverride 1490 true);
|
||||
assertions = [
|
||||
{
|
||||
assertion = !cfg.enableGitIntegration || config.programs.git.package != null;
|
||||
message = ''
|
||||
programs.diff-highlight.enableGitIntegration requires programs.git.package to be set.
|
||||
Please set programs.git.package to a valid git package.
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
warnings =
|
||||
lib.optional
|
||||
@@ -77,9 +84,12 @@ in
|
||||
cfg.enableGitIntegration && options.programs.diff-highlight.enableGitIntegration.highestPrio == 1490
|
||||
)
|
||||
"`programs.diff-highlight.enableGitIntegration` automatic enablement is deprecated. Please explicitly set `programs.diff-highlight.enableGitIntegration = true`.";
|
||||
|
||||
# Auto-enable git integration if programs.git.diff-highlight.enable was set to true
|
||||
programs.diff-highlight.enableGitIntegration = lib.mkIf oldOptionEnabled (lib.mkOverride 1490 true);
|
||||
})
|
||||
|
||||
(mkIf (cfg.enable && cfg.enableGitIntegration) {
|
||||
(mkIf (cfg.enable && cfg.enableGitIntegration && config.programs.git.package != null) {
|
||||
programs.git = {
|
||||
enable = lib.mkDefault true;
|
||||
iniContent =
|
||||
|
||||
@@ -41,6 +41,7 @@ in
|
||||
enable = mkEnableOption "Git";
|
||||
|
||||
package = lib.mkPackageOption pkgs "git" {
|
||||
nullable = true;
|
||||
example = "pkgs.gitFull";
|
||||
extraDescription = ''
|
||||
Use {var}`pkgs.gitFull`
|
||||
@@ -328,7 +329,7 @@ in
|
||||
config = mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
home.packages = [ cfg.package ];
|
||||
home.packages = lib.optionals (cfg.package != null) [ cfg.package ];
|
||||
|
||||
assertions = [
|
||||
{
|
||||
@@ -516,7 +517,7 @@ in
|
||||
Type = "oneshot";
|
||||
ExecStart =
|
||||
let
|
||||
exe = lib.getExe cfg.package;
|
||||
exe = if cfg.package != null then lib.getExe cfg.package else "git";
|
||||
in
|
||||
''
|
||||
"${exe}" for-each-repo --keep-going --config=maintenance.repo maintenance run --schedule=%i
|
||||
@@ -553,7 +554,7 @@ in
|
||||
launchd.agents =
|
||||
let
|
||||
baseArguments = [
|
||||
"${lib.getExe cfg.package}"
|
||||
"${if cfg.package != null then lib.getExe cfg.package else "git"}"
|
||||
"for-each-repo"
|
||||
"--keep-going"
|
||||
"--config=maintenance.repo"
|
||||
|
||||
@@ -49,7 +49,8 @@ in
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to configure {command}`hx` as the default
|
||||
editor using the {env}`EDITOR` environment variable.
|
||||
editor using the {env}`EDITOR` and {env}`VISUAL`
|
||||
environment variables.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -225,7 +226,10 @@ in
|
||||
else
|
||||
[ cfg.package ];
|
||||
|
||||
home.sessionVariables = mkIf cfg.defaultEditor { EDITOR = "hx"; };
|
||||
home.sessionVariables = mkIf cfg.defaultEditor {
|
||||
EDITOR = "hx";
|
||||
VISUAL = "hx";
|
||||
};
|
||||
|
||||
xdg.configFile =
|
||||
let
|
||||
|
||||
@@ -9,7 +9,7 @@ let
|
||||
jsonFormat = pkgs.formats.json { };
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.perchun ];
|
||||
meta.maintainers = [ lib.maintainers.PerchunPak ];
|
||||
|
||||
imports = [
|
||||
(lib.mkRemovedOptionModule [ "programs" "hyprpanel" "dontAssertNotificationDaemons " ] ''
|
||||
|
||||
81
modules/programs/infat.nix
Normal file
81
modules/programs/infat.nix
Normal file
@@ -0,0 +1,81 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.infat;
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
|
||||
configDir =
|
||||
if config.xdg.enable then
|
||||
config.xdg.configHome
|
||||
else
|
||||
"${config.home.homeDirectory}/Library/Application Support";
|
||||
|
||||
configFile = "${configDir}/infat/config.toml";
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.maintainers; [
|
||||
mirkolenz
|
||||
];
|
||||
|
||||
options = {
|
||||
programs.infat = {
|
||||
enable = lib.mkEnableOption "infat";
|
||||
package = lib.mkPackageOption pkgs "infat" { nullable = true; };
|
||||
settings = lib.mkOption {
|
||||
type = tomlFormat.type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
extensions = {
|
||||
md = "TextEdit";
|
||||
html = "Safari";
|
||||
pdf = "Preview";
|
||||
};
|
||||
schemes = {
|
||||
mailto = "Mail";
|
||||
web = "Safari";
|
||||
};
|
||||
types = {
|
||||
plain-text = "VSCode";
|
||||
};
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Configuration written to
|
||||
{file}`$XDG_CONFIG_HOME/infat/config.toml`.
|
||||
'';
|
||||
};
|
||||
autoActivate = lib.mkEnableOption "auto-activate infat" // {
|
||||
default = true;
|
||||
example = false;
|
||||
description = ''
|
||||
Automatically activate infat on startup.
|
||||
This is useful if you want to use infat as a
|
||||
default application handler for certain file types.
|
||||
If you don't want this, set this to false.
|
||||
This option is only effective if `settings` is set.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "programs.infat" pkgs lib.platforms.darwin)
|
||||
];
|
||||
home = {
|
||||
packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
file.${configFile} = lib.mkIf (cfg.settings != { }) {
|
||||
source = tomlFormat.generate "infat-settings.toml" cfg.settings;
|
||||
};
|
||||
activation = lib.mkIf (cfg.settings != { } && cfg.package != null && cfg.autoActivate) {
|
||||
infat = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
run ${lib.getExe cfg.package} --config "${configFile}" $VERBOSE_ARG
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -705,7 +705,8 @@ in
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to configure {command}`kak` as the default
|
||||
editor using the {env}`EDITOR` environment variable.
|
||||
editor using the {env}`EDITOR` and {env}`VISUAL`
|
||||
environment variables.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -755,7 +756,10 @@ in
|
||||
programs.kakoune.finalPackage = lib.mkIf (cfg.package != null) kakouneWithPlugins;
|
||||
|
||||
home.packages = lib.mkIf (cfg.finalPackage != null) [ cfg.finalPackage ];
|
||||
home.sessionVariables = mkIf cfg.defaultEditor { EDITOR = "kak"; };
|
||||
home.sessionVariables = mkIf cfg.defaultEditor {
|
||||
EDITOR = "kak";
|
||||
VISUAL = "kak";
|
||||
};
|
||||
xdg.configFile = lib.mkMerge [
|
||||
{ "kak/kakrc".source = configFile; }
|
||||
(mkIf (cfg.colorSchemePackage != null) {
|
||||
|
||||
@@ -37,13 +37,17 @@ in
|
||||
options = lib.mkOption {
|
||||
type =
|
||||
with lib.types;
|
||||
attrsOf (oneOf [
|
||||
bool
|
||||
int
|
||||
str
|
||||
]);
|
||||
default = { };
|
||||
description = "GNU-style options to be set via {env}`$LESS`.";
|
||||
let
|
||||
scalar = oneOf [
|
||||
bool
|
||||
int
|
||||
str
|
||||
];
|
||||
attrs = attrsOf (either scalar (listOf scalar));
|
||||
in
|
||||
coercedTo attrs (lib.cli.toGNUCommandLine { }) (listOf str);
|
||||
default = [ ];
|
||||
description = "Options to be set via {env}`$LESS`.";
|
||||
example = {
|
||||
RAW-CONTROL-CHARS = true;
|
||||
quiet = true;
|
||||
@@ -58,10 +62,10 @@ in
|
||||
|
||||
xdg.configFile."lesskey" = lib.mkIf (cfg.config != "") { text = cfg.config; };
|
||||
|
||||
programs.less.config = lib.mkIf (cfg.options != { }) (
|
||||
programs.less.config = lib.mkIf (cfg.options != [ ]) (
|
||||
lib.mkBefore ''
|
||||
#env
|
||||
LESS = ${lib.cli.toGNUCommandLineShell { } cfg.options}
|
||||
LESS = ${lib.concatStringsSep " " cfg.options}
|
||||
''
|
||||
);
|
||||
};
|
||||
|
||||
@@ -289,7 +289,8 @@ in
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to configure {command}`nvim` as the default
|
||||
editor using the {env}`EDITOR` environment variable.
|
||||
editor using the {env}`EDITOR` and {env}`VISUAL`
|
||||
environment variables.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -453,7 +454,10 @@ in
|
||||
|
||||
home.packages = [ cfg.finalPackage ];
|
||||
|
||||
home.sessionVariables = mkIf cfg.defaultEditor { EDITOR = "nvim"; };
|
||||
home.sessionVariables = mkIf cfg.defaultEditor {
|
||||
EDITOR = "nvim";
|
||||
VISUAL = "nvim";
|
||||
};
|
||||
|
||||
home.shellAliases = mkIf cfg.vimdiffAlias { vimdiff = "nvim -d"; };
|
||||
|
||||
|
||||
74
modules/programs/npm.nix
Normal file
74
modules/programs/npm.nix
Normal file
@@ -0,0 +1,74 @@
|
||||
# https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/npm.nix
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.npm;
|
||||
|
||||
xdgConfigHome = lib.removePrefix config.home.homeDirectory config.xdg.configHome;
|
||||
configFile = if config.home.preferXdgDirectories then "${xdgConfigHome}/npm/npmrc" else ".npmrc";
|
||||
|
||||
iniFormat = pkgs.formats.ini {
|
||||
listsAsDuplicateKeys = true;
|
||||
};
|
||||
|
||||
toNpmrc =
|
||||
let
|
||||
mkLine = lib.generators.mkKeyValueDefault { } "=";
|
||||
mkLines = k: v: if lib.isList v then map (x: mkLine "${k}[]" x) v else [ (mkLine k v) ];
|
||||
in
|
||||
attrs: lib.concatLines (lib.concatLists (lib.mapAttrsToList mkLines attrs));
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.maintainers; [ mirkolenz ];
|
||||
|
||||
options = {
|
||||
programs.npm = {
|
||||
enable = lib.mkEnableOption "{command}`npm` user config";
|
||||
|
||||
package = lib.mkPackageOption pkgs [ "nodejs" ] {
|
||||
example = "nodejs_24";
|
||||
nullable = true;
|
||||
};
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = lib.types.attrsOf iniFormat.lib.types.atom;
|
||||
description = ''
|
||||
The user-specific npm configuration.
|
||||
See <https://docs.npmjs.com/cli/using-npm/config> and
|
||||
<https://docs.npmjs.com/cli/configuring-npm/npmrc>
|
||||
for more information.
|
||||
'';
|
||||
default = {
|
||||
prefix = "\${HOME}/.npm";
|
||||
};
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
color = true;
|
||||
include = [
|
||||
"dev"
|
||||
"prod"
|
||||
];
|
||||
init-license = "MIT";
|
||||
prefix = "''${HOME}/.npm";
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home = {
|
||||
packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
file.${configFile} = lib.mkIf (cfg.settings != { }) {
|
||||
text = toNpmrc cfg.settings;
|
||||
};
|
||||
sessionVariables = lib.mkIf (cfg.settings != { }) {
|
||||
NPM_CONFIG_USERCONFIG = "${config.home.homeDirectory}/${configFile}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
42
modules/programs/parallel.nix
Normal file
42
modules/programs/parallel.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
mkIf
|
||||
mkEnableOption
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.programs.parallel;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.xavwe ];
|
||||
|
||||
options.programs.parallel = {
|
||||
enable = mkEnableOption "GNU Parallel";
|
||||
|
||||
package = lib.mkPackageOption pkgs "parallel-full" { nullable = true; };
|
||||
|
||||
will-cite = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Accept GNU Parallels citation policy: <https://www.gnu.org/software/parallel/parallel_design.html#citation-notice>
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home = {
|
||||
packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
file.".parallel/will-cite" = mkIf cfg.will-cite {
|
||||
text = "generated by home manager (programs.parallel.will-cite)";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -153,7 +153,7 @@ in
|
||||
default = { };
|
||||
apply = lib.mergeAttrs {
|
||||
vfs-cache-mode = "full";
|
||||
cache-dir = "%C";
|
||||
cache-dir = "%C/rclone";
|
||||
};
|
||||
description = ''
|
||||
An attribute set of option values passed to `rclone mount`. To set
|
||||
|
||||
55
modules/programs/screen.nix
Normal file
55
modules/programs/screen.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
types
|
||||
mkIf
|
||||
mkEnableOption
|
||||
mkPackageOption
|
||||
mkOption
|
||||
;
|
||||
|
||||
cfg = config.programs.screen;
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.hm.maintainers; [ aguirre-matteo ];
|
||||
options.programs.screen = {
|
||||
enable = mkEnableOption "screen";
|
||||
package = mkPackageOption pkgs "screen" { nullable = true; };
|
||||
screenrc = mkOption {
|
||||
type = with types; nullOr (either path lines);
|
||||
default = null;
|
||||
example = ''
|
||||
screen -t rtorrent rtorrent
|
||||
screen -t irssi irssi
|
||||
screen -t centerim centerim
|
||||
screen -t ncmpc ncmpc -c
|
||||
screen -t bash4
|
||||
screen -t bash5
|
||||
screen -t bash6
|
||||
screen -t bash7
|
||||
screen -t bash8
|
||||
screen -t bash9
|
||||
altscreen on
|
||||
term screen-256color
|
||||
bind ',' prev
|
||||
bind '.' next
|
||||
'';
|
||||
description = ''
|
||||
Config file for GNU Screen. All the details can be found here:
|
||||
<https://www.gnu.org/software/screen/manual/screen.html>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
||||
home.file.".screenrc" = mkIf (cfg.screenrc != null) {
|
||||
source = if lib.isPath cfg.screenrc then cfg.screenrc else pkgs.writeText "screenrc" cfg.screenrc;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -40,12 +40,6 @@ 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"
|
||||
@@ -53,7 +47,6 @@ let
|
||||
"hostbased"
|
||||
"keyboard-interactive"
|
||||
"gssapi-with-mic"
|
||||
"authentication-agent"
|
||||
];
|
||||
default = "publickey";
|
||||
description = "The authentication method to use.";
|
||||
|
||||
@@ -52,7 +52,7 @@ in
|
||||
eval "$(sheldon source)"
|
||||
'';
|
||||
|
||||
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
|
||||
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
|
||||
eval "$(sheldon source)"
|
||||
'';
|
||||
|
||||
|
||||
@@ -151,14 +151,7 @@ let
|
||||
identityFile = mkOption {
|
||||
type = with types; either (listOf str) (nullOr str);
|
||||
default = [ ];
|
||||
apply =
|
||||
p:
|
||||
if p == null then
|
||||
[ ]
|
||||
else if lib.isString p then
|
||||
[ p ]
|
||||
else
|
||||
p;
|
||||
apply = p: if p == null then [ ] else lib.toList p;
|
||||
description = ''
|
||||
Specifies files from which the user identity is read.
|
||||
Identities will be tried in the given order.
|
||||
@@ -168,14 +161,7 @@ let
|
||||
identityAgent = mkOption {
|
||||
type = with types; either (listOf str) (nullOr str);
|
||||
default = [ ];
|
||||
apply =
|
||||
p:
|
||||
if p == null then
|
||||
[ ]
|
||||
else if lib.isString p then
|
||||
[ p ]
|
||||
else
|
||||
p;
|
||||
apply = p: if p == null then [ ] else lib.toList p;
|
||||
description = ''
|
||||
Specifies the location of the ssh identity agent.
|
||||
'';
|
||||
@@ -265,14 +251,7 @@ let
|
||||
certificateFile = mkOption {
|
||||
type = with types; either (listOf str) (nullOr str);
|
||||
default = [ ];
|
||||
apply =
|
||||
p:
|
||||
if p == null then
|
||||
[ ]
|
||||
else if lib.isString p then
|
||||
[ p ]
|
||||
else
|
||||
p;
|
||||
apply = p: if p == null then [ ] else lib.toList p;
|
||||
description = ''
|
||||
Specifies files from which the user certificate is read.
|
||||
'';
|
||||
@@ -451,7 +430,13 @@ 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
|
||||
++ mapAttrsToList (n: v: " ${n} ${v}") cf.extraOptions
|
||||
++ [
|
||||
(lib.generators.toKeyValue {
|
||||
mkKeyValue = lib.generators.mkKeyValueDefault { } " ";
|
||||
listsAsDuplicateKeys = true;
|
||||
indent = " ";
|
||||
} cf.extraOptions)
|
||||
]
|
||||
);
|
||||
|
||||
in
|
||||
|
||||
51
modules/programs/ty.nix
Normal file
51
modules/programs/ty.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
mkEnableOption
|
||||
mkPackageOption
|
||||
mkOption
|
||||
literalExpression
|
||||
;
|
||||
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
cfg = config.programs.ty;
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.maintainers; [ mirkolenz ];
|
||||
|
||||
options.programs.ty = {
|
||||
enable = mkEnableOption "ty";
|
||||
|
||||
package = mkPackageOption pkgs "ty" { nullable = true; };
|
||||
|
||||
settings = mkOption {
|
||||
type = tomlFormat.type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
rules.index-out-of-bounds = "ignore";
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Configuration written to
|
||||
{file}`$XDG_CONFIG_HOME/ty/ty.toml`.
|
||||
See <https://docs.astral.sh/ty/configuration/>
|
||||
and <https://docs.astral.sh/ty/reference/configuration/>
|
||||
for more information.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
xdg.configFile."ty/ty.toml" = lib.mkIf (cfg.settings != { }) {
|
||||
source = tomlFormat.generate "ty-config.toml" cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -162,7 +162,8 @@ in
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to configure {command}`vim` as the default
|
||||
editor using the {env}`EDITOR` environment variable.
|
||||
editor using the {env}`EDITOR` and {env}`VISUAL`
|
||||
environment variables.
|
||||
'';
|
||||
};
|
||||
};
|
||||
@@ -213,7 +214,10 @@ in
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
home.sessionVariables = lib.mkIf cfg.defaultEditor { EDITOR = "vim"; };
|
||||
home.sessionVariables = lib.mkIf cfg.defaultEditor {
|
||||
EDITOR = "vim";
|
||||
VISUAL = "vim";
|
||||
};
|
||||
|
||||
programs.vim = {
|
||||
package = vim;
|
||||
|
||||
@@ -23,7 +23,10 @@ let
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.hm.maintainers; [ aguirre-matteo ];
|
||||
meta.maintainers = [
|
||||
lib.hm.maintainers.aguirre-matteo
|
||||
lib.maintainers.arunoruto
|
||||
];
|
||||
|
||||
options.programs.vivid = {
|
||||
enable = mkEnableOption "vivid";
|
||||
@@ -34,7 +37,14 @@ in
|
||||
enableFishIntegration = mkFishIntegrationOption { inherit config; };
|
||||
|
||||
colorMode = mkOption {
|
||||
type = with types; nullOr str;
|
||||
type =
|
||||
with types;
|
||||
nullOr (
|
||||
either str (enum [
|
||||
"8-bit"
|
||||
"24-bit"
|
||||
])
|
||||
);
|
||||
default = null;
|
||||
example = "8-bit";
|
||||
description = ''
|
||||
@@ -135,7 +145,7 @@ in
|
||||
// (lib.mapAttrs' (
|
||||
name: value:
|
||||
lib.nameValuePair "vivid/themes/${name}.yml" {
|
||||
source = if lib.isAttrs value then yamlFormat.generate "${name}.yml" value else value;
|
||||
source = if lib.isAttrs value then pkgs.writeText "${name}.json" (builtins.toJSON value) else value;
|
||||
}
|
||||
) cfg.themes);
|
||||
|
||||
|
||||
266
modules/services/colima.nix
Normal file
266
modules/services/colima.nix
Normal file
@@ -0,0 +1,266 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.services.colima;
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
in
|
||||
{
|
||||
meta.maintainers = [
|
||||
lib.hm.maintainers.will-lol
|
||||
];
|
||||
|
||||
options.services.colima = {
|
||||
enable = lib.mkEnableOption "Colima, a container runtime";
|
||||
|
||||
package = lib.mkPackageOption pkgs "colima" { };
|
||||
dockerPackage = lib.mkPackageOption pkgs "docker" {
|
||||
extraDescription = "Used by colima to activate profiles. Not needed if no profile is set to isActive.";
|
||||
};
|
||||
perlPackage = lib.mkPackageOption pkgs "perl" {
|
||||
extraDescription = "Used by colima during image download for the shasum command.";
|
||||
};
|
||||
sshPackage = lib.mkPackageOption pkgs "openssh" {
|
||||
extraDescription = "Used by colima to manage the vm.";
|
||||
};
|
||||
coreutilsPackage = lib.mkPackageOption pkgs "coreutils" {
|
||||
extraDescription = "Used in various ways by colima.";
|
||||
};
|
||||
curlPackage = lib.mkPackageOption pkgs "curl" {
|
||||
extraDescription = "Used by colima to donwload images.";
|
||||
};
|
||||
bashPackage = lib.mkPackageOption pkgs "bashNonInteractive" {
|
||||
extraDescription = "Used by colima's internal scripts.";
|
||||
};
|
||||
|
||||
profiles = lib.mkOption {
|
||||
default = {
|
||||
default = {
|
||||
isActive = true;
|
||||
isService = true;
|
||||
};
|
||||
};
|
||||
description = ''
|
||||
Profiles allow multiple colima configurations. The default profile is active by default.
|
||||
If you have used colima before, you may need to delete existing configuration using `colima delete` or use a different profile.
|
||||
|
||||
Note that removing a configured profile will not delete the corresponding Colima instance.
|
||||
You will need to manually run `colima delete <profile-name>` to remove the instance and release resources.
|
||||
'';
|
||||
example = ''
|
||||
{
|
||||
default = {
|
||||
isActive = true;
|
||||
isService = true;
|
||||
};
|
||||
rosetta = {
|
||||
isService = true;
|
||||
settings.rosetta = true;
|
||||
};
|
||||
powerful = {
|
||||
settings.cpu = 8;
|
||||
};
|
||||
};
|
||||
'';
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule (
|
||||
{ name, ... }:
|
||||
{
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = name;
|
||||
readOnly = true;
|
||||
description = "The profile's name.";
|
||||
};
|
||||
|
||||
isService = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = ''
|
||||
Whether this profile will run as a service.
|
||||
'';
|
||||
};
|
||||
|
||||
isActive = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = ''
|
||||
Whether to set this profile as:
|
||||
- active docker context
|
||||
- active kubernetes context
|
||||
- active incus remote
|
||||
Exactly one or zero profiles should have this option set.
|
||||
'';
|
||||
};
|
||||
|
||||
logFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = "${config.home.homeDirectory}/.local/state/colima-${name}.log";
|
||||
defaultText = lib.literalExpression "\${config.home.homeDirectory}/.local/state/colima-\${name}.log";
|
||||
description = "Combined stdout and stderr log file for the Colima service.";
|
||||
};
|
||||
|
||||
settings = lib.mkOption {
|
||||
inherit (yamlFormat) type;
|
||||
default = { };
|
||||
description = "Colima configuration settings, see <https://github.com/abiosoft/colima/blob/main/embedded/defaults/colima.yaml> or run `colima template`.";
|
||||
example = ''
|
||||
{
|
||||
cpu = 2;
|
||||
disk = 100;
|
||||
memory = 2;
|
||||
arch = "host";
|
||||
runtime = "docker";
|
||||
hostname = null;
|
||||
kubernetes = {
|
||||
enabled = false;
|
||||
version = "v1.33.3+k3s1";
|
||||
k3sArgs = [ "--disable=traefik" ];
|
||||
port = 0;
|
||||
};
|
||||
autoActivate = true;
|
||||
network = {
|
||||
address = false;
|
||||
mode = "shared";
|
||||
interface = "en0";
|
||||
preferredRoute = false;
|
||||
dns = [ ];
|
||||
dnsHosts = {
|
||||
"host.docker.internal" = "host.lima.internal";
|
||||
};
|
||||
hostAddresses = false;
|
||||
};
|
||||
forwardAgent = false;
|
||||
docker = { };
|
||||
vmType = "qemu";
|
||||
portForwarder = "ssh";
|
||||
rosetta = false;
|
||||
binfmt = true;
|
||||
nestedVirtualization = false;
|
||||
mountType = "sshfs";
|
||||
mountInotify = false;
|
||||
cpuType = "host";
|
||||
provision = [ ];
|
||||
sshConfig = true;
|
||||
sshPort = 0;
|
||||
mounts = [ ];
|
||||
diskImage = "";
|
||||
rootDisk = 20;
|
||||
env = { };
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable ({
|
||||
assertions = [
|
||||
{
|
||||
assertion = (lib.count (p: p.isActive) (lib.attrValues cfg.profiles)) <= 1;
|
||||
message = "Only one Colima profile can be active at a time.";
|
||||
}
|
||||
];
|
||||
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
home.file = lib.mkMerge (
|
||||
lib.mapAttrsToList (profileName: profile: {
|
||||
".colima/${profileName}/colima.yaml" = {
|
||||
source = yamlFormat.generate "colima.yaml" profile.settings;
|
||||
};
|
||||
}) (lib.filterAttrs (name: profile: profile.settings != { }) cfg.profiles)
|
||||
);
|
||||
|
||||
programs.docker-cli.settings.currentContext =
|
||||
let
|
||||
activeProfile = lib.findFirst (p: p.isActive) null (lib.attrValues cfg.profiles);
|
||||
in
|
||||
lib.mkIf (activeProfile != null) (
|
||||
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)
|
||||
);
|
||||
|
||||
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)
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -113,7 +113,8 @@ in
|
||||
example = !default;
|
||||
description = ''
|
||||
Whether to configure {command}`emacsclient` as the default
|
||||
editor using the {env}`EDITOR` environment variable.
|
||||
editor using the {env}`EDITOR` and {env}`VISUAL`
|
||||
environment variables.
|
||||
'';
|
||||
};
|
||||
};
|
||||
@@ -121,11 +122,16 @@ in
|
||||
config = mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
home.sessionVariables = mkIf cfg.defaultEditor {
|
||||
EDITOR = lib.getBin (
|
||||
pkgs.writeShellScript "editor" ''exec ${lib.getBin cfg.package}/bin/emacsclient "''${@:---create-frame}"''
|
||||
);
|
||||
};
|
||||
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;
|
||||
};
|
||||
}
|
||||
|
||||
(mkIf pkgs.stdenv.isLinux {
|
||||
|
||||
86
modules/services/hyprlauncher.nix
Normal file
86
modules/services/hyprlauncher.nix
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
mkIf
|
||||
mkEnableOption
|
||||
mkPackageOption
|
||||
mkOption
|
||||
;
|
||||
|
||||
cfg = config.services.hyprlauncher;
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.hm.maintainers; [ aguirre-matteo ];
|
||||
|
||||
options.services.hyprlauncher = {
|
||||
enable = mkEnableOption "hyprlauncher";
|
||||
package = mkPackageOption pkgs "hyprlauncher" { nullable = true; };
|
||||
settings = mkOption {
|
||||
type =
|
||||
with lib.types;
|
||||
let
|
||||
valueType =
|
||||
nullOr (oneOf [
|
||||
bool
|
||||
int
|
||||
float
|
||||
str
|
||||
path
|
||||
(attrsOf valueType)
|
||||
(listOf valueType)
|
||||
])
|
||||
// {
|
||||
description = "Hyprland configuration value";
|
||||
};
|
||||
in
|
||||
valueType;
|
||||
default = { };
|
||||
example = {
|
||||
general.grab_focus = true;
|
||||
cache.enabled = true;
|
||||
ui.window_size = "400 260";
|
||||
finders = {
|
||||
math_prefix = "=";
|
||||
desktop_icons = true;
|
||||
};
|
||||
};
|
||||
description = ''
|
||||
Configuration settings for hyprlauncher. All the available options can be found here:
|
||||
<https://wiki.hypr.land/Hypr-Ecosystem/hyprlauncher/#config>
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.hyprlauncher" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
||||
xdg.configFile."hypr/hyprlauncher.conf" = mkIf (cfg.settings != { }) {
|
||||
text = lib.hm.generators.toHyprconf { attrs = cfg.settings; };
|
||||
};
|
||||
systemd.user.services.hyprlauncher = mkIf (cfg.package != null) {
|
||||
Install.WantedBy = [ config.wayland.systemd.target ];
|
||||
Unit = {
|
||||
Description = "hyprlauncher";
|
||||
After = [ config.wayland.systemd.target ];
|
||||
PartOf = [ config.wayland.systemd.target ];
|
||||
X-Restart-Triggers = lib.mkIf (cfg.settings != { }) [
|
||||
"${config.xdg.configFile."hypr/hyprlauncher.conf".source}"
|
||||
];
|
||||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = "${lib.getExe cfg.package} -d";
|
||||
Restart = "always";
|
||||
RestartSec = "10";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -49,9 +49,17 @@ in
|
||||
default = {
|
||||
manifest.url = "https://raw.githubusercontent.com/mtkennerly/ludusavi-manifest/master/data/manifest.yaml";
|
||||
roots = [ ];
|
||||
backup.path = "$XDG_STATE_HOME/backups/ludusavi";
|
||||
restore.path = "$XDG_STATE_HOME/backups/ludusavi";
|
||||
backup.path = "${config.xdg.stateHome}/backups/ludusavi";
|
||||
restore.path = "${config.xdg.stateHome}/backups/ludusavi";
|
||||
};
|
||||
defaultText = ''
|
||||
{
|
||||
manifest.url = "https://raw.githubusercontent.com/mtkennerly/ludusavi-manifest/master/data/manifest.yaml";
|
||||
roots = [ ];
|
||||
backup.path = "$XDG_STATE_HOME/backups/ludusavi";
|
||||
restore.path = "$XDG_STATE_HOME/backups/ludusavi";
|
||||
}
|
||||
'';
|
||||
example = {
|
||||
language = "en-US";
|
||||
theme = "light";
|
||||
@@ -94,6 +102,24 @@ in
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${lib.getExe cfg.package} backup --force";
|
||||
ExecStartPre = "${pkgs.writeShellScript "ludusavi-migrate-backup" ''
|
||||
old_base_dir="${config.home.homeDirectory}/\$XDG_STATE_HOME"
|
||||
old_dir="$old_base_dir/backups/ludusavi"
|
||||
new_base_dir="${config.xdg.stateHome}/backups"
|
||||
new_dir="$new_base_dir/ludusavi"
|
||||
|
||||
if [[ -d "$old_base_dir" ]]; then
|
||||
echo "Migrating old Ludusavi's backup... (See home-manager/#8234)"
|
||||
if [[ ! -d "$new_base_dir" ]]; then
|
||||
mkdir -p "$new_base_dir"
|
||||
fi
|
||||
|
||||
mv "$old_dir" "$new_dir"
|
||||
rmdir "$old_base_dir/backups"
|
||||
rmdir "$old_base_dir"
|
||||
echo "Migration completed successfully."
|
||||
fi
|
||||
''}";
|
||||
}
|
||||
// lib.optionalAttrs cfg.backupNotification {
|
||||
ExecStartPost = "${lib.getExe pkgs.libnotify} 'Ludusavi' 'Backup completed' -i com.mtkennerly.ludusavi -a 'Ludusavi'";
|
||||
|
||||
@@ -43,6 +43,7 @@ in
|
||||
Description = "pimsync calendar and contacts synchronization";
|
||||
PartOf = [ "network-online.target" ];
|
||||
};
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
Service = {
|
||||
# TODO: make use of the readiness notification
|
||||
Type = "simple";
|
||||
|
||||
@@ -475,7 +475,7 @@ in
|
||||
CacheDirectoryMode = "0700";
|
||||
PrivateTmp = true;
|
||||
|
||||
Environment = mkEnvironment backup ++ [ "RESTIC_CACHE_DIR=%C" ];
|
||||
Environment = mkEnvironment backup ++ [ "RESTIC_CACHE_DIR=%C/${serviceName}" ];
|
||||
|
||||
ExecStart =
|
||||
lib.optional doBackup backupCmd
|
||||
@@ -591,7 +591,7 @@ in
|
||||
lib.concatLines
|
||||
]}
|
||||
|
||||
RESTIC_CACHE_DIR=$HOME/.cache/${serviceName}
|
||||
RESTIC_CACHE_DIR=${config.xdg.cacheHome}/${serviceName}
|
||||
|
||||
PATH=${
|
||||
lib.pipe environment [
|
||||
|
||||
@@ -67,6 +67,8 @@ in
|
||||
(lib.hm.assertions.assertPlatform "services.shikane" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."shikane/config.toml" = lib.mkIf (cfg.settings != { }) {
|
||||
source = tomlFormat.generate "shikane-config" cfg.settings;
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
let
|
||||
cfg = config.services.snixembed;
|
||||
waybarCfg = config.programs.waybar;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.DamienCassou ];
|
||||
@@ -32,6 +33,10 @@ in
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "services.snixembed" pkgs lib.platforms.linux)
|
||||
];
|
||||
warnings = lib.optional waybarCfg.enable ''
|
||||
snixembed and waybar should not be enabled at the same time.
|
||||
You may experience inconsistent tray behavior as a result.
|
||||
'';
|
||||
|
||||
systemd.user.services.snixembed = {
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
|
||||
@@ -84,11 +84,13 @@ in
|
||||
'';
|
||||
in
|
||||
{
|
||||
# $SSH_AUTH_SOCK has to be set early since other tools rely on it
|
||||
bash.profileExtra = lib.mkIf cfg.enableBashIntegration (lib.mkOrder 900 bashIntegration);
|
||||
fish.shellInit = lib.mkIf cfg.enableFishIntegration (lib.mkOrder 900 fishIntegration);
|
||||
nushell.extraConfig = lib.mkIf cfg.enableNushellIntegration (lib.mkOrder 900 nushellIntegration);
|
||||
zsh.envExtra = lib.mkIf cfg.enableZshIntegration (lib.mkOrder 900 bashIntegration);
|
||||
bash.initExtra = lib.mkIf cfg.enableBashIntegration bashIntegration;
|
||||
|
||||
zsh.initContent = lib.mkIf cfg.enableZshIntegration bashIntegration;
|
||||
|
||||
fish.interactiveShellInit = lib.mkIf cfg.enableFishIntegration fishIntegration;
|
||||
|
||||
nushell.extraConfig = lib.mkIf cfg.enableNushellIntegration nushellIntegration;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -42,21 +42,30 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
eventModule = {
|
||||
eventsModule = {
|
||||
options = {
|
||||
event = mkOption {
|
||||
type = types.enum [
|
||||
"before-sleep"
|
||||
"after-resume"
|
||||
"lock"
|
||||
"unlock"
|
||||
];
|
||||
description = "Event name.";
|
||||
before-sleep = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "Command to run before suspending.";
|
||||
};
|
||||
|
||||
command = mkOption {
|
||||
type = types.str;
|
||||
description = "Command to run when event occurs.";
|
||||
after-resume = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "Command to run after resuming.";
|
||||
};
|
||||
|
||||
lock = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "Command to run when the logind session is locked.";
|
||||
};
|
||||
|
||||
unlock = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "Command to run when the logind session is unlocked.";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -80,13 +89,31 @@ in
|
||||
};
|
||||
|
||||
events = mkOption {
|
||||
type = with types; listOf (submodule eventModule);
|
||||
default = [ ];
|
||||
type =
|
||||
with types;
|
||||
(coercedTo (listOf attrs)) (
|
||||
events:
|
||||
lib.warn
|
||||
''
|
||||
The syntax of services.swayidle.events has changed. While it
|
||||
previously accepted a list of events, it now accepts an attrset
|
||||
keyed by the event name.
|
||||
''
|
||||
(
|
||||
lib.listToAttrs (
|
||||
map (e: {
|
||||
name = e.event;
|
||||
value = e.command;
|
||||
}) events
|
||||
)
|
||||
)
|
||||
) (submodule eventsModule);
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
[
|
||||
{ event = "before-sleep"; command = "''${pkgs.swaylock}/bin/swaylock -fF"; }
|
||||
{ event = "lock"; command = "lock"; }
|
||||
]
|
||||
{
|
||||
"before-sleep" = "''${pkgs.swaylock}/bin/swaylock -fF";
|
||||
"lock" = "lock";
|
||||
}
|
||||
'';
|
||||
description = "Run command on occurrence of a event.";
|
||||
};
|
||||
@@ -144,13 +171,17 @@ in
|
||||
t.resumeCommand
|
||||
];
|
||||
|
||||
mkEvent = e: [
|
||||
e.event
|
||||
e.command
|
||||
mkEvent = event: command: [
|
||||
event
|
||||
command
|
||||
];
|
||||
|
||||
nonemptyEvents = lib.filterAttrs (event: command: command != null) cfg.events;
|
||||
|
||||
args =
|
||||
cfg.extraArgs ++ (lib.concatMap mkTimeout cfg.timeouts) ++ (lib.concatMap mkEvent cfg.events);
|
||||
cfg.extraArgs
|
||||
++ (lib.concatMap mkTimeout cfg.timeouts)
|
||||
++ (lib.flatten (lib.mapAttrsToList mkEvent nonemptyEvents));
|
||||
in
|
||||
"${lib.getExe cfg.package} ${lib.escapeShellArgs args}";
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@ let
|
||||
cfg = config.services.tldr-update;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.perchun ];
|
||||
meta.maintainers = [ lib.maintainers.PerchunPak ];
|
||||
|
||||
options.services.tldr-update = {
|
||||
enable = lib.mkEnableOption ''
|
||||
|
||||
@@ -119,6 +119,24 @@ in
|
||||
{file}`$XDG_CONFIG_HOME/herbstluftwm/autostart`.
|
||||
'';
|
||||
};
|
||||
|
||||
enableAlias = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Set an alias for the {command}`herbstclient` command in the
|
||||
{file}`autostart` script that only stores its arguments and executes
|
||||
them all at once at the end of the {file}`autostart` script.
|
||||
|
||||
This reduces the amount of flickering you get while all options are
|
||||
being applied and improves the performance.
|
||||
|
||||
On the other hand, this makes it more difficult to write bash functions
|
||||
that call {command}`herbstclient`. You can work around this by calling
|
||||
{command}`command herbstclient` in your functions to still get some of
|
||||
the benefits of enabling this alias.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
@@ -131,11 +149,13 @@ in
|
||||
xsession.windowManager.command = "${cfg.package}/bin/herbstluftwm --locked";
|
||||
|
||||
xdg.configFile."herbstluftwm/autostart".source = pkgs.writeShellScript "herbstluftwm-autostart" ''
|
||||
shopt -s expand_aliases
|
||||
${lib.optionalString cfg.enableAlias ''
|
||||
shopt -s expand_aliases
|
||||
|
||||
# shellcheck disable=SC2142
|
||||
alias herbstclient='set -- "$@" ";"'
|
||||
set --
|
||||
# shellcheck disable=SC2142
|
||||
alias herbstclient='set -- "$@" ";"'
|
||||
set --
|
||||
''}
|
||||
|
||||
herbstclient emit_hook reload
|
||||
|
||||
@@ -169,7 +189,9 @@ in
|
||||
|
||||
herbstclient unlock
|
||||
|
||||
${cfg.package}/bin/herbstclient chain ";" "$@"
|
||||
${lib.optionalString cfg.enableAlias ''
|
||||
${cfg.package}/bin/herbstclient chain ";" "$@"
|
||||
''}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
drivers = mkOption {
|
||||
type = types.package;
|
||||
readOnly = true;
|
||||
internal = true;
|
||||
description = "Resulting drivers package.";
|
||||
};
|
||||
};
|
||||
@@ -104,14 +104,9 @@
|
||||
kernel = null;
|
||||
};
|
||||
|
||||
drivers = cfg.packages.callPackage ./gpu-libs-env.nix {
|
||||
addNvidia = cfg.nvidia.enable;
|
||||
nvidia_x11 = nvidia; # Only used if addNvidia is enabled
|
||||
};
|
||||
|
||||
setupPackage = cfg.packages.callPackage ./setup {
|
||||
inherit (cfg) nixStateDirectory;
|
||||
nonNixosGpuEnv = drivers;
|
||||
nonNixosGpuEnv = cfg.drivers;
|
||||
};
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
@@ -148,7 +143,7 @@
|
||||
in
|
||||
lib.hm.dag.entryAnywhere ''
|
||||
existing=$(readlink /run/opengl-driver || true)
|
||||
new=${drivers}
|
||||
new=${cfg.drivers}
|
||||
verboseEcho Existing drivers: ''${existing}
|
||||
verboseEcho New drivers: ''${new}
|
||||
if [[ -z "''${existing}" ]] ; then
|
||||
@@ -162,7 +157,13 @@
|
||||
'';
|
||||
|
||||
targets.genericLinux.gpu = {
|
||||
inherit setupPackage drivers;
|
||||
inherit setupPackage;
|
||||
drivers = cfg.packages.callPackage ./gpu-libs-env.nix {
|
||||
inherit (pkgs.stdenv.hostPlatform) system;
|
||||
addNvidia = cfg.nvidia.enable;
|
||||
nvidia_x11 = nvidia; # Only used if addNvidia is enabled
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
intel-media-driver,
|
||||
nvidia-vaapi-driver,
|
||||
linuxPackages,
|
||||
system,
|
||||
nvidia_x11 ? linuxPackages.nvidia_x11,
|
||||
addNvidia ? false,
|
||||
}:
|
||||
@@ -15,8 +16,8 @@ buildEnv {
|
||||
paths = [
|
||||
mesa
|
||||
libvdpau-va-gl
|
||||
intel-media-driver
|
||||
]
|
||||
++ lib.optional (system == "x86_64-linux") intel-media-driver
|
||||
++ lib.optionals addNvidia [
|
||||
nvidia_x11
|
||||
nvidia-vaapi-driver
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
# For OS-specific configuration, please edit nixos/default.nix or nix-darwin/default.nix instead.
|
||||
|
||||
{
|
||||
options,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
@@ -36,7 +35,7 @@ let
|
||||
|
||||
modules = [
|
||||
(
|
||||
{ name, ... }:
|
||||
{ name, options, ... }:
|
||||
{
|
||||
imports =
|
||||
import ../modules/modules.nix {
|
||||
@@ -48,22 +47,31 @@ let
|
||||
++ cfg.sharedModules;
|
||||
|
||||
config = {
|
||||
submoduleSupport.enable = true;
|
||||
submoduleSupport.externalPackageInstall = cfg.useUserPackages;
|
||||
submoduleSupport = {
|
||||
enable = true;
|
||||
externalPackageInstall = cfg.useUserPackages;
|
||||
};
|
||||
|
||||
home.username = config.users.users.${name}.name;
|
||||
home.homeDirectory = config.users.users.${name}.home;
|
||||
home = {
|
||||
username = config.users.users.${name}.name;
|
||||
homeDirectory = config.users.users.${name}.home;
|
||||
uid = mkIf (options.users.users.${name}.uid.isDefined or false) config.users.users.${name}.uid;
|
||||
};
|
||||
|
||||
# Forward `nix.enable` from the OS configuration. The
|
||||
# conditional is to check whether nix-darwin is new enough
|
||||
# to have the `nix.enable` option; it was previously a
|
||||
# `mkRemovedOptionModule` error, which we can crudely detect
|
||||
# by `visible` being set to `false`.
|
||||
nix.enable = mkIf (options.nix.enable.visible or true) config.nix.enable;
|
||||
nix = {
|
||||
# Forward `nix.enable` from the OS configuration. The
|
||||
# conditional is to check whether nix-darwin is new enough
|
||||
# to have the `nix.enable` option; it was previously a
|
||||
# `mkRemovedOptionModule` error, which we can crudely detect
|
||||
# by `visible` being set to `false`.
|
||||
enable = mkIf (options.nix.enable.visible or true) config.nix.enable;
|
||||
|
||||
# Make activation script use same version of Nix as system as a whole.
|
||||
# This avoids problems with Nix not being in PATH.
|
||||
nix.package = config.nix.package;
|
||||
# Make activation script use same version of Nix as system as a whole.
|
||||
# This avoids problems with Nix not being in PATH.
|
||||
# Only set package when nix is enabled to avoid errors when
|
||||
# nix-darwin has nix.enable = false (e.g., Determinate Nix users).
|
||||
package = mkIf config.nix.enable config.nix.package;
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
@@ -160,30 +168,28 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = (
|
||||
lib.mkMerge [
|
||||
# Fix potential recursion when configuring home-manager users based on values in users.users #594
|
||||
(mkIf (cfg.useUserPackages && cfg.users != { }) {
|
||||
users.users = (lib.mapAttrs (_username: usercfg: { packages = [ usercfg.home.path ]; }) cfg.users);
|
||||
environment.pathsToLink = [ "/etc/profile.d" ];
|
||||
})
|
||||
(mkIf (cfg.users != { }) {
|
||||
warnings = lib.flatten (
|
||||
flip lib.mapAttrsToList cfg.users (
|
||||
user: config: flip map config.warnings (warning: "${user} profile: ${warning}")
|
||||
)
|
||||
);
|
||||
config = lib.mkMerge [
|
||||
# Fix potential recursion when configuring home-manager users based on values in users.users #594
|
||||
(mkIf (cfg.useUserPackages && cfg.users != { }) {
|
||||
users.users = lib.mapAttrs (_username: usercfg: { packages = [ usercfg.home.path ]; }) cfg.users;
|
||||
environment.pathsToLink = [ "/etc/profile.d" ];
|
||||
})
|
||||
(mkIf (cfg.users != { }) {
|
||||
warnings = lib.flatten (
|
||||
flip lib.mapAttrsToList cfg.users (
|
||||
user: config: flip map config.warnings (warning: "${user} profile: ${warning}")
|
||||
)
|
||||
);
|
||||
|
||||
assertions = lib.flatten (
|
||||
flip lib.mapAttrsToList cfg.users (
|
||||
user: config:
|
||||
flip map config.assertions (assertion: {
|
||||
inherit (assertion) assertion;
|
||||
message = "${user} profile: ${assertion.message}";
|
||||
})
|
||||
)
|
||||
);
|
||||
})
|
||||
]
|
||||
);
|
||||
assertions = lib.flatten (
|
||||
flip lib.mapAttrsToList cfg.users (
|
||||
user: config:
|
||||
flip map config.assertions (assertion: {
|
||||
inherit (assertion) assertion;
|
||||
message = "${user} profile: ${assertion.message}";
|
||||
})
|
||||
)
|
||||
);
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"release": "25.11",
|
||||
"isReleaseBranch": true
|
||||
"release": "26.05",
|
||||
"isReleaseBranch": false
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ let
|
||||
"broot"
|
||||
"browserpass"
|
||||
"btop"
|
||||
"calibre"
|
||||
"carapace"
|
||||
"cava"
|
||||
"claude-code"
|
||||
@@ -96,6 +97,7 @@ let
|
||||
"lf"
|
||||
"lieer"
|
||||
"lsd"
|
||||
"ludusavi"
|
||||
"mbsync"
|
||||
"meli"
|
||||
"mergiraf"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
{
|
||||
description = "Tests of Home Manager for Nix";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
outputs =
|
||||
{ nixpkgs, ... }:
|
||||
|
||||
@@ -27,6 +27,7 @@ let
|
||||
standalone-flake-basics = runTest ./standalone/flake-basics.nix;
|
||||
standalone-specialisation = runTest ./standalone/specialisation.nix;
|
||||
standalone-standard-basics = runTest ./standalone/standard-basics.nix;
|
||||
dconf = runTest ./standalone/dconf.nix;
|
||||
};
|
||||
in
|
||||
tests
|
||||
|
||||
22
tests/integration/standalone/dconf-home.nix
Normal file
22
tests/integration/standalone/dconf-home.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.username = "alice";
|
||||
home.homeDirectory = "/home/alice";
|
||||
|
||||
home.stateVersion = "25.11"; # Please read the comment before changing.
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
dconf.settings = {
|
||||
foo = {
|
||||
bar = 42;
|
||||
};
|
||||
};
|
||||
|
||||
dconf.databases.custom = {
|
||||
foo1 = {
|
||||
bar1 = 42;
|
||||
};
|
||||
};
|
||||
}
|
||||
77
tests/integration/standalone/dconf.nix
Normal file
77
tests/integration/standalone/dconf.nix
Normal file
@@ -0,0 +1,77 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
name = "dconf";
|
||||
meta.maintainers = [ pkgs.lib.maintainers.rycee ];
|
||||
|
||||
nodes.machine = {
|
||||
imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ];
|
||||
virtualisation.memorySize = 2048;
|
||||
users.users.alice = {
|
||||
isNormalUser = true;
|
||||
description = "Alice Foobar";
|
||||
password = "foobar";
|
||||
uid = 1000;
|
||||
};
|
||||
programs.dconf = {
|
||||
enable = true;
|
||||
profiles.custom = pkgs.writeText "dconf-profile-custom" ''
|
||||
user-db:custom
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
machine.wait_for_unit("network.target")
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
|
||||
home_manager = "${../../..}"
|
||||
|
||||
def login_as_alice():
|
||||
machine.wait_until_tty_matches("1", "login: ")
|
||||
machine.send_chars("alice\n")
|
||||
machine.wait_until_tty_matches("1", "Password: ")
|
||||
machine.send_chars("foobar\n")
|
||||
machine.wait_until_tty_matches("1", "alice\\@machine")
|
||||
|
||||
def logout_alice():
|
||||
machine.send_chars("exit\n")
|
||||
|
||||
def alice_cmd(cmd):
|
||||
return f"su -l alice --shell /bin/sh -c $'export XDG_RUNTIME_DIR=/run/user/$UID ; {cmd}'"
|
||||
|
||||
def succeed_as_alice(cmd):
|
||||
return machine.succeed(alice_cmd(cmd))
|
||||
|
||||
def fail_as_alice(cmd):
|
||||
return machine.fail(alice_cmd(cmd))
|
||||
|
||||
# Create a persistent login so that Alice has a systemd session.
|
||||
login_as_alice()
|
||||
|
||||
# Set up a home-manager channel.
|
||||
succeed_as_alice(" ; ".join([
|
||||
"mkdir -p /home/alice/.nix-defexpr/channels",
|
||||
f"ln -s {home_manager} /home/alice/.nix-defexpr/channels/home-manager"
|
||||
]))
|
||||
|
||||
succeed_as_alice("nix-shell \"<home-manager>\" -A install")
|
||||
|
||||
succeed_as_alice("cp ${./dconf-home.nix} /home/alice/.config/home-manager/home.nix")
|
||||
succeed_as_alice("home-manager switch")
|
||||
|
||||
succeed_as_alice("test -e /home/alice/.config/dconf/user")
|
||||
actual = succeed_as_alice("dconf dump /")
|
||||
expected = """[foo]
|
||||
bar=42
|
||||
"""
|
||||
assert actual == expected, "invalid content in dconf database \"user\""
|
||||
|
||||
succeed_as_alice("test -e /home/alice/.config/dconf/custom")
|
||||
actual = succeed_as_alice("DCONF_PROFILE=custom dconf dump /")
|
||||
expected = """[foo1]
|
||||
bar1=42
|
||||
"""
|
||||
assert actual == expected, "invalid content in dconf database \"custom\""
|
||||
'';
|
||||
}
|
||||
@@ -216,7 +216,7 @@ in
|
||||
|
||||
def make_backup(time):
|
||||
global snapshot_count
|
||||
machine.succeed(f"timedatectl set-time '{time}'")
|
||||
machine.succeed(f"date --set='{time}'")
|
||||
systemctl_succeed_as_alice("start restic-backups-prune-me.service")
|
||||
snapshot_count += 1
|
||||
actual = \
|
||||
|
||||
@@ -2,4 +2,7 @@
|
||||
home-session-path = ./session-path.nix;
|
||||
home-session-search-variables = ./session-search-variables.nix;
|
||||
home-session-variables = ./session-variables.nix;
|
||||
home-nixpkgs-release-check-pkgs = ./nixpkgs-release-check-pkgs.nix;
|
||||
home-uid = ./uid.nix;
|
||||
home-uid-null = ./uid-null.nix;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
{ lib, ... }:
|
||||
let
|
||||
releaseInfo = lib.importJSON ../../../release.json;
|
||||
hmRelease = releaseInfo.release;
|
||||
pkgsRelease = "<invalid>";
|
||||
in
|
||||
{
|
||||
test.asserts.warnings.expected = [
|
||||
''
|
||||
You are using
|
||||
|
||||
Home Manager version: ${hmRelease}
|
||||
Nixpkgs version used to evaluate Home Manager: ${hmRelease}
|
||||
Nixpkgs version used for packages (`pkgs`): ${pkgsRelease}
|
||||
|
||||
Using mismatched versions is likely to cause errors and unexpected
|
||||
behavior. It is therefore highly recommended to use a release of Home
|
||||
Manager that corresponds with your chosen release of Nixpkgs.
|
||||
|
||||
If you insist then you can disable this warning by adding
|
||||
|
||||
home.enableNixpkgsReleaseCheck = false;
|
||||
|
||||
to your configuration.
|
||||
''
|
||||
];
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
lib = prev.lib.extend (
|
||||
final: prev: {
|
||||
trivial = prev.trivial // {
|
||||
release = pkgsRelease;
|
||||
};
|
||||
}
|
||||
);
|
||||
})
|
||||
];
|
||||
}
|
||||
7
tests/modules/home-environment/uid-null.nix
Normal file
7
tests/modules/home-environment/uid-null.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
# home.uid defaults to null, so checkUid should not be called in the activation script
|
||||
|
||||
nmt.script = ''
|
||||
assertFileNotRegex activate "checkUid [0-9]+"
|
||||
'';
|
||||
}
|
||||
7
tests/modules/home-environment/uid.nix
Normal file
7
tests/modules/home-environment/uid.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
home.uid = 1000;
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContains activate "checkUid 1000"
|
||||
'';
|
||||
}
|
||||
@@ -17,4 +17,5 @@
|
||||
gtk4-basic-settings = ./gtk4/gtk4-basic-settings.nix;
|
||||
gtk4-theme-css-injection = ./gtk4/gtk4-theme-css-injection.nix;
|
||||
gtk4-no-theme-css-injection = ./gtk4/gtk4-no-theme-css-injection.nix;
|
||||
gtk4-stateversion-no-theme-inheritance = ./gtk4/gtk4-stateversion-no-theme-inheritance.nix;
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
/**
|
||||
* GTK 4 reads the theme configured by gtk-theme-name, but ignores it.
|
||||
* It does however respect user CSS, so import the theme from here.
|
||||
**/
|
||||
@import url("file://@gnome-themes-extra@/share/themes/Adwaita-dark/gtk-4.0/gtk.css");
|
||||
@@ -5,4 +5,3 @@ gtk-cursor-theme-size=24
|
||||
gtk-font-name=Ubuntu 12
|
||||
gtk-icon-theme-name=Adwaita
|
||||
gtk-interface-color-scheme=2
|
||||
gtk-theme-name=Adwaita-dark
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.stateVersion = "26.05";
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
font = {
|
||||
@@ -37,9 +39,5 @@
|
||||
assertFileExists home-files/.config/gtk-4.0/settings.ini
|
||||
assertFileContent home-files/.config/gtk-4.0/settings.ini \
|
||||
${./gtk-global-inheritance-gtk4-expected.ini}
|
||||
|
||||
# Check GTK4 CSS with theme import
|
||||
assertFileExists home-files/.config/gtk-4.0/gtk.css
|
||||
assertFileContent home-files/.config/gtk-4.0/gtk.css ${./gtk-global-inheritance-gtk4-css-expected.css}
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -3,4 +3,3 @@ gtk-cursor-theme-name=Global-Cursor
|
||||
gtk-font-name=GTK4-Font 11
|
||||
gtk-icon-theme-name=Global-Icons
|
||||
gtk-recent-files-limit=20
|
||||
gtk-theme-name=Global-Theme
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{
|
||||
home.stateVersion = "26.05";
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
# Global defaults
|
||||
@@ -46,7 +48,7 @@
|
||||
assertFileContent home-files/.config/gtk-3.0/gtk.css \
|
||||
${./gtk-per-version-override-gtk3-css-expected.css}
|
||||
|
||||
# GTK4 should use overridden font, global theme/icons/cursor
|
||||
# GTK4 should use overridden font, global icons/cursor
|
||||
assertFileExists home-files/.config/gtk-4.0/settings.ini
|
||||
assertFileContent home-files/.config/gtk-4.0/settings.ini \
|
||||
${./gtk-per-version-override-gtk4-expected.ini}
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
{
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme = {
|
||||
name = "catppuccin-macchiato-blue-standard";
|
||||
package = pkgs.catppuccin-gtk;
|
||||
};
|
||||
gtk4 = {
|
||||
theme = {
|
||||
name = "catppuccin-macchiato-blue-standard";
|
||||
package = pkgs.catppuccin-gtk;
|
||||
};
|
||||
extraConfig = {
|
||||
gtk-cursor-blink = false;
|
||||
gtk-recent-files-limit = 20;
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
[Settings]
|
||||
gtk-icon-theme-name=Adwaita
|
||||
@@ -0,0 +1,28 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
# Test that GTK4 theme does NOT inherit from global theme with stateVersion 26.05
|
||||
# This shows the new default behavior where gtk4.theme defaults to null
|
||||
home.stateVersion = "26.05";
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme = {
|
||||
name = "Adwaita-dark";
|
||||
package = pkgs.gnome-themes-extra;
|
||||
};
|
||||
iconTheme = {
|
||||
name = "Adwaita";
|
||||
package = pkgs.adwaita-icon-theme;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
# GTK4 settings should exist but WITHOUT theme (icon theme still inherits)
|
||||
assertFileExists home-files/.config/gtk-4.0/settings.ini
|
||||
assertFileContent home-files/.config/gtk-4.0/settings.ini \
|
||||
${./gtk4-stateversion-no-theme-inheritance-expected.ini}
|
||||
|
||||
# GTK4 CSS should NOT exist since no theme is configured
|
||||
assertPathNotExists home-files/.config/gtk-4.0/gtk.css
|
||||
'';
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
hmPkgs = pkgs.extend (
|
||||
self: super: {
|
||||
aerospace = config.lib.test.mkStubPackage {
|
||||
name = "aerospace";
|
||||
buildScript = ''
|
||||
mkdir -p $out/bin
|
||||
touch $out/bin/aerospace
|
||||
chmod 755 $out/bin/aerospace
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
programs.aerospace = {
|
||||
enable = true;
|
||||
package = hmPkgs.aerospace;
|
||||
|
||||
userSettings = {
|
||||
gaps = {
|
||||
outer.left = 8;
|
||||
outer.bottom = 8;
|
||||
outer.top = 8;
|
||||
outer.right = 8;
|
||||
};
|
||||
mode.main.binding = {
|
||||
alt-h = "focus left";
|
||||
alt-j = "focus down";
|
||||
alt-k = "focus up";
|
||||
alt-l = "focus right";
|
||||
};
|
||||
key-mapping.preset = "colemak";
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent home-files/.config/aerospace/aerospace.toml ${./colemak-settings-expected.toml}
|
||||
'';
|
||||
}
|
||||
28
tests/modules/programs/aerospace/aerospace-no-xdg.nix
Normal file
28
tests/modules/programs/aerospace/aerospace-no-xdg.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
hmPkgs = pkgs.extend (
|
||||
self: super: {
|
||||
aerospace = config.lib.test.mkStubPackage {
|
||||
name = "aerospace";
|
||||
buildScript = ''
|
||||
mkdir -p $out/bin
|
||||
touch $out/bin/aerospace
|
||||
chmod 755 $out/bin/aerospace
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
xdg.enable = false;
|
||||
|
||||
programs.aerospace = {
|
||||
enable = true;
|
||||
package = hmPkgs.aerospace;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
# aerospace just create the config file if we open it by hand, otherwise he's use directly the default config
|
||||
assertPathNotExists "home-files/.aerospace.toml"
|
||||
'';
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user