Skip to content

Commit

Permalink
Merge branch 'nix-community:master' into forceFlakes
Browse files Browse the repository at this point in the history
  • Loading branch information
tnichols217 authored Dec 9, 2024
2 parents ad2f4c7 + d00c6f6 commit d62174f
Show file tree
Hide file tree
Showing 820 changed files with 23,374 additions and 5,693 deletions.
3 changes: 2 additions & 1 deletion .builds/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ environment:
NIX_CONFIG: "experimental-features = nix-command flakes"
packages:
- nixos.cachix
- nixos.jq
tasks:
- setup: |
cachix use rycee
Expand All @@ -26,7 +27,7 @@ tasks:
if [[ $gitBranch == master ]]; then
dirName="unstable"
else
dirName="$(cat .release)"
dirName="$(jq -r .release < release.json)"
fi
rsync --delete -r --info=stats \
Expand Down
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ indent_style = tab

[*.md]
trim_trailing_whitespace = false

[*.plist]
insert_final_newline = false
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ updates:

- package-ecosystem: "github-actions"
directory: "/"
target-branch: "release-23.05"
target-branch: "release-24.05"
schedule:
interval: "weekly"
commit-message:
prefix: "ci:"

- package-ecosystem: "github-actions"
directory: "/"
target-branch: "release-23.11"
target-branch: "release-24.11"
schedule:
interval: "weekly"
commit-message:
Expand Down
64 changes: 37 additions & 27 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,46 @@
"mail":
- modules/programs/aerc*.nix
- modules/programs/alot*.nix
- tests/modules/programs/aerc/*
- tests/modules/programs/alot/*
- modules/programs/mujmap.nix
- tests/modules/programs/mujmap/*
- modules/programs/notmuch.nix
- modules/programs/neomutt*
- tests/modules/programs/neomutt/*
- modules/programs/getmail*
- modules/*/mbsync*
- tests/modules/programs/mbsync/*
- modules/programs/himalaya.nix
- tests/modules/programs/himalaya/*
- modules/programs/thunderbird.nix
- tests/modules/programs/thunderbird/*
- modules/services/imapnotify.nix
- changed-files:
- any-glob-to-any-file:
- modules/programs/aerc*.nix
- modules/programs/alot*.nix
- tests/modules/programs/aerc/*
- tests/modules/programs/alot/*
- modules/programs/mujmap.nix
- tests/modules/programs/mujmap/*
- modules/programs/notmuch.nix
- modules/programs/neomutt*
- tests/modules/programs/neomutt/*
- modules/programs/getmail*
- modules/*/mbsync*
- tests/modules/programs/mbsync/*
- modules/programs/himalaya.nix
- tests/modules/programs/himalaya/*
- modules/programs/thunderbird.nix
- tests/modules/programs/thunderbird/*
- modules/services/imapnotify.nix

"neovim":
- modules/programs/neovim.nix
- tests/modules/programs/neovim/**/*
- changed-files:
- any-glob-to-any-file:
- modules/programs/neovim.nix
- tests/modules/programs/neovim/**/*

"shell":
- modules/lib/zsh.nix
- modules/programs/zsh*
- modules/programs/bash*
- tests/modules/programs/zsh/**/*
- changed-files:
- any-glob-to-any-file:
- modules/lib/zsh.nix
- modules/programs/zsh*
- modules/programs/bash*
- tests/modules/programs/zsh/**/*

"calendar":
- modules/programs/khal*
- modules/*/vdirsyncer*
- modules/accounts/calendar.nix
- changed-files:
- any-glob-to-any-file:
- modules/programs/khal*
- modules/*/vdirsyncer*
- modules/accounts/calendar.nix

"contacts":
- modules/accounts/contacts.nix
- changed-files:
- any-glob-to-any-file:
- modules/accounts/contacts.nix
6 changes: 3 additions & 3 deletions .github/workflows/github_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v13
- uses: cachix/cachix-action@v15
with:
name: nix-community
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix-build -A docs.html
cp -r result/share/doc/home-manager public
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
3 changes: 1 addition & 2 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
runs-on: ubuntu-latest
if: github.repository_owner == 'nix-community'
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
sync-labels: true

8 changes: 3 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v13
with:
name: nix-community
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
if grep -R --exclude stdlib-extended.nix literalExample modules ; then
echo "Error: literalExample should be replaced by literalExpression" > /dev/stderr
Expand All @@ -29,3 +25,5 @@ jobs:
- run: nix-shell --show-trace . -A install
- run: yes | home-manager -I home-manager=. uninstall
- run: nix-shell --show-trace --arg enableBig false --pure tests -A run.all
# Somebody please help us fix the macos tests.
if: matrix.os != 'macos-latest'
4 changes: 2 additions & 2 deletions .github/workflows/update-flake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v23
uses: cachix/install-nix-action@v30
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@v20
uses: DeterminateSystems/update-flake-lock@v24
with:
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
pr-labels: dependencies
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For a systematic overview of Home Manager and its available options, please see:
- [Home Manager manual][manual]
- [Home Manager configuration options][configuration options]
- [3rd party Home Manager option
search](https://mipmip.github.io/home-manager-option-search/)
search](https://home-manager-options.extranix.com/)

If you would like to contribute to Home Manager, then please have a look at
["Contributing" in the manual][contributing].
Expand All @@ -28,7 +28,7 @@ Releases
Home Manager is developed against `nixpkgs-unstable` branch, which often causes
it to contain tweaks for changes/packages not yet released in stable [NixOS][].
To avoid breaking users' configurations, Home Manager is released in branches
corresponding to NixOS releases (e.g. `release-23.11`). These branches get
corresponding to NixOS releases (e.g. `release-24.11`). These branches get
fixes, but usually not new modules. If you need a module to be backported, then
feel free to open an issue.

Expand All @@ -49,7 +49,7 @@ dconf store and cannot tell whether a configuration that it is about to be
overwritten was from a previous Home Manager generation or from manual
configuration.

Home Manager targets [NixOS][] unstable and NixOS version 23.11 (the current
Home Manager targets [NixOS][] unstable and NixOS version 24.11 (the current
stable version), it may or may not work on other Linux distributions and NixOS
versions.

Expand Down Expand Up @@ -112,7 +112,7 @@ License
This project is licensed under the terms of the [MIT license](LICENSE).

[#home-manager]: https://webchat.oftc.net/?channels=home-manager
[Nix Flakes]: https://nixos.wiki/wiki/Flakes
[Nix Flakes]: https://wiki.nixos.org/wiki/Flakes
[NixOS]: https://nixos.org/
[Nix]: https://nixos.org/explore.html
[Nixpkgs]: https://github.com/NixOS/nixpkgs
Expand All @@ -125,4 +125,4 @@ This project is licensed under the terms of the [MIT license](LICENSE).
[manual standalone install]: https://nix-community.github.io/home-manager/#sec-install-standalone
[manual]: https://nix-community.github.io/home-manager/
[nix-darwin]: https://github.com/LnL7/nix-darwin
[rollbacks]: https://nix-community.github.io/home-manager/#sec-usage-rollbacks
[rollbacks]: https://nix-community.github.io/home-manager/index.xhtml#sec-usage-rollbacks
53 changes: 32 additions & 21 deletions docs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,37 @@

let

nmdSrc = fetchTarball {
url = "https://git.sr.ht/~rycee/nmd/archive/v0.5.0.tar.gz";
sha256 = "0hnd86jd19zb5j3hmpwmdmdiasg65lgahqv7n8frl9p1vdqz6z67";
};

nmd = import nmdSrc {
inherit lib;
# The DocBook output of `nixos-render-docs` doesn't have the change
# `nmd` uses to work around the broken stylesheets in
# `docbook-xsl-ns`, so we restore the patched version here.
pkgs = pkgs // {
docbook-xsl-ns =
pkgs.docbook-xsl-ns.override { withManOptDedupPatch = true; };
};
};
# Recursively replace each derivation in the given attribute set
# with the same derivation but with the `outPath` attribute set to
# the string `"\${pkgs.attribute.path}"`. This allows the
# documentation to refer to derivations through their values without
# establishing an actual dependency on the derivation output.
#
# This is not perfect, but it seems to cover a vast majority of use
# cases.
#
# Caveat: even if the package is reached by a different means, the
# path above will be shown and not e.g.
# `${config.services.foo.package}`.
scrubDerivations = prefixPath: attrs:
let
scrubDerivation = name: value:
let pkgAttrName = prefixPath + "." + name;
in if lib.isAttrs value then
scrubDerivations pkgAttrName value
// lib.optionalAttrs (lib.isDerivation value) {
outPath = "\${${pkgAttrName}}";
}
else
value;
in lib.mapAttrs scrubDerivation attrs;

# Make sure the used package is scrubbed to avoid actually
# instantiating derivations.
scrubbedPkgsModule = {
imports = [{
_module.args = {
pkgs = lib.mkForce (nmd.scrubDerivations "pkgs" pkgs);
pkgs = lib.mkForce (scrubDerivations "pkgs" pkgs);
pkgs_i686 = lib.mkForce { };
};
}];
Expand All @@ -46,7 +55,11 @@ let
hmPath = toString ./..;

buildOptionsDocs = args@{ modules, includeModuleSystemOptions ? true, ... }:
let options = (lib.evalModules { inherit modules; }).options;
let
options = (lib.evalModules {
inherit modules;
class = "homeManager";
}).options;
in pkgs.buildPackages.nixosOptionsDoc ({
options = if includeModuleSystemOptions then
options
Expand Down Expand Up @@ -113,7 +126,6 @@ let
'';
# Generate the HTML manual pages
home-manager-manual = pkgs.callPackage ./home-manager-manual.nix {
nmd = nmdSrc;
home-manager-options = {
home-manager = hmOptionsDocs.optionsJSON;
nixos = nixosOptionsDocs.optionsJSON;
Expand All @@ -124,8 +136,6 @@ let
html = home-manager-manual;
htmlOpenTool = pkgs.callPackage ./html-open-tool.nix { } { inherit html; };
in {
inherit nmdSrc;

options = {
# TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream
# `nixosOptionsDoc` is more customizable.
Expand All @@ -137,7 +147,7 @@ in {
substitute \
${hmOptionsDocs.optionsJSON}/nix-support/hydra-build-products \
$out/nix-support/hydra-build-products \
--replace \
--replace-fail \
'${hmOptionsDocs.optionsJSON}/share/doc/nixos' \
"$out/share/doc/home-manager"
'';
Expand All @@ -154,6 +164,7 @@ in {
inherit lib pkgs;
check = false;
} ++ [ scrubbedPkgsModule ];
class = "homeManager";
};
in builtins.toJSON result.config.meta.maintainers);
}
45 changes: 45 additions & 0 deletions docs/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d62174f

Please sign in to comment.