Compare commits

..

1 Commits

Author SHA1 Message Date
Alexander Bantyev
ff8fd21304 nixos-rebuild: use sudo when whoami != root
Currently, executing `nixos-rebuild switch` as a non-root user will
result in a somewhat confusing error about being unable to link a
profile to a nix store path. This is not ideal, especially as we already
have most of the code to handle this properly and use `sudo` to elevate
permissions to install.

This is preferrable for flakes (better eval caching), and also more
intuitive for new users.
2023-02-17 19:14:51 +04:00
387 changed files with 4029 additions and 8018 deletions

View File

@@ -75,7 +75,7 @@ in pkgs.runCommand "doc-support" {}
ln -s ${epub-xsl} ./epub.xsl
ln -s ${xhtml-xsl} ./xhtml.xsl
ln -s ${./xmlformat.conf} ./xmlformat.conf
ln -s ${../../nixos/doc/xmlformat.conf} ./xmlformat.conf
ln -s ${pkgs.documentation-highlighter} ./highlightjs
echo -n "${version}" > ./version

View File

@@ -137,12 +137,7 @@ set the default version to a version older than the newest on Hackage. We do
this to get them or their reverse dependencies to compile in our package set.
4. For all packages, for which the newest Hackage version is not the default
version, there will also be a `haskellPackages.foo_x_y_z` package with the
newest version. The `x_y_z` part encodes the version with dots replaced by
underscores. When the newest version changes by a new release to Hackage the
old package will disappear under that name and be replaced by a newer one under
the name with the new version. The package name including the version will
also disappear when the default version e.g. from Stackage catches up with the
newest version from Hackage.
newest version.
5. For some packages, we also manually add other `haskellPackages.foo_x_y_z`
versions, if they are required for a certain build.
@@ -166,14 +161,12 @@ given in the `.cabal` file of your package and all its dependencies.
The [Haskell builder in nixpkgs](#haskell-mkderivation) does no such thing.
It will simply take as input packages with names off the desired dependencies
and just check whether they fulfill the version bounds and fail if they dont
(by default, see `jailbreak` to circumvent this).
and just check whether they fulfill the version bounds and (by default, see
`jailbreak`) fail if they dont.
The `haskellPackages.callPackage` function does the package resolution.
It will, e.g., use `haskellPackages.aeson`which has the default version as
described above for a package input of name `aeson`. (More general:
`<packages>.callPackage f` will call `f` with named inputs provided from the
package set `<packages>`.)
The package resolution is done by the `haskellPackages.callPackage` function
which will, e.g., use `haskellPackages.aeson` for a package input of name
`aeson`.
While this is the default behavior, it is possible to override the dependencies
for a specific package, see
[`override` and `overrideScope`](#haskell-overriding-haskell-packages).

View File

@@ -1417,12 +1417,6 @@
githubId = 12958979;
name = "Mika Naylor";
};
avakhrenev = {
email = "avakhrenev@gmail.com";
github = "avakhrenev";
githubId = 1060224;
name = "Alexey Vakhrenev";
};
avaq = {
email = "nixpkgs@account.avaq.it";
github = "Avaq";
@@ -3762,6 +3756,12 @@
githubId = 14034137;
name = "Mostly Void";
};
dizfer = {
email = "david@izquierdofernandez.com";
github = "DIzFer";
githubId = 8852888;
name = "David Izquierdo";
};
djacu = {
email = "daniel.n.baker@gmail.com";
github = "djacu";
@@ -7293,12 +7293,6 @@
github = "jorsn";
githubId = 4646725;
};
joshniemela = {
name = "Joshua Niemelä";
email = "josh@jniemela.dk";
github = "joshniemela";
githubId = 88747315;
};
joshuafern = {
name = "Joshua Fern";
email = "joshuafern@protonmail.com";

View File

@@ -66,28 +66,6 @@ let
if !builtins.isList files then [ files ] else files
);
packageSetsWithVersionedHead = pkgs.haskell.packages // (
let
headSet = pkgs.haskell.packages.ghcHEAD;
# Determine the next GHC release version following GHC HEAD.
# GHC HEAD always has an uneven, tentative version number, e.g. 9.7.
# GHC releases always have even numbers, i.e. GHC 9.8 is branched off from
# GHC HEAD 9.7. Since we use the to be release number for GHC HEAD's
# configuration file, we need to calculate this here.
headVersion = lib.pipe headSet.ghc.version [
lib.versions.splitVersion
(lib.take 2)
lib.concatStrings
lib.strings.toInt
(builtins.add 1)
toString
];
in
{
"ghc${headVersion}" = headSet;
}
);
setsForFile = fileName:
let
# extract the unique part of the config's file name
@@ -99,12 +77,12 @@ let
builtins.match "ghc-([0-9]+).([0-9]+).x" configName
);
# return all package sets under haskell.packages matching the version components
setsForVersion = builtins.map (name: packageSetsWithVersionedHead.${name}) (
setsForVersion = builtins.map (name: pkgs.haskell.packages.${name}) (
builtins.filter (setName:
lib.hasPrefix "ghc${configVersion}" setName
&& (skipBinaryGHCs -> !(lib.hasInfix "Binary" setName))
) (
builtins.attrNames packageSetsWithVersionedHead
builtins.attrNames pkgs.haskell.packages
)
);

View File

@@ -63,13 +63,11 @@ sed -r \
-e '/ lsp-test /d' \
-e '/ hie-bios /d' \
-e '/ ShellCheck /d' \
-e '/ Agda /d' \
< "${tmpfile_new}" >> $stackage_config
# Explanations:
# cabal2nix, distribution-nixpkgs, jailbreak-cabal, language-nix: These are our packages and we know what we are doing.
# lsp, lsp-types, lsp-test, hie-bios: These are tightly coupled to hls which is not in stackage. They have no rdeps in stackage.
# ShellCheck: latest version of command-line dev tool.
# Agda: The Agda community is fast-moving; we strive to always include the newest versions of Agda and the Agda packages in nixpkgs.
if [[ "${1:-}" == "--do-commit" ]]; then
git add $stackage_config

2
nixos/doc/manual/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
generated
manual-combined.xml

30
nixos/doc/manual/Makefile Normal file
View File

@@ -0,0 +1,30 @@
.PHONY: all
all: manual-combined.xml
.PHONY: debug
debug: generated manual-combined.xml
manual-combined.xml: generated *.xml **/*.xml
rm -f ./manual-combined.xml
nix-shell --pure -Q --packages xmloscopy \
--run "xmloscopy --docbook5 ./manual.xml ./manual-combined.xml"
.PHONY: format
format:
nix-shell --pure -Q --packages xmlformat \
--run "find ../../ -iname '*.xml' -type f -print0 | xargs -0 -I{} -n1 \
xmlformat --config-file '../xmlformat.conf' -i {}"
.PHONY: fix-misc-xml
fix-misc-xml:
find . -iname '*.xml' -type f \
-exec ../varlistentry-fixer.rb {} ';'
.PHONY: clean
clean:
rm -f manual-combined.xml generated
generated:
nix-build ../../release.nix \
--attr manualGeneratedSources.x86_64-linux \
--out-link ./generated

View File

@@ -21,8 +21,8 @@ which is often not what you want. By contrast, in the imperative
approach, containers are configured and updated independently from the
host system.
```{=include=} sections
imperative-containers.section.md
declarative-containers.section.md
container-networking.section.md
```{=docbook}
<xi:include href="imperative-containers.section.xml" />
<xi:include href="declarative-containers.section.xml" />
<xi:include href="container-networking.section.xml" />
```

View File

@@ -1,14 +0,0 @@
# Administration {#ch-running}
This chapter describes various aspects of managing a running NixOS system, such as how to use the {command}`systemd` service manager.
```{=include=} chapters
service-mgmt.chapter.md
rebooting.chapter.md
user-sessions.chapter.md
control-groups.chapter.md
logging.chapter.md
cleaning-store.chapter.md
containers.chapter.md
troubleshooting.chapter.md
```

View File

@@ -0,0 +1,21 @@
<part xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="ch-running">
<title>Administration</title>
<partintro xml:id="ch-running-intro">
<para>
This chapter describes various aspects of managing a running NixOS system,
such as how to use the <command>systemd</command> service manager.
</para>
</partintro>
<xi:include href="../from_md/administration/service-mgmt.chapter.xml" />
<xi:include href="../from_md/administration/rebooting.chapter.xml" />
<xi:include href="../from_md/administration/user-sessions.chapter.xml" />
<xi:include href="../from_md/administration/control-groups.chapter.xml" />
<xi:include href="../from_md/administration/logging.chapter.xml" />
<xi:include href="../from_md/administration/cleaning-store.chapter.xml" />
<xi:include href="../from_md/administration/containers.chapter.xml" />
<xi:include href="../from_md/administration/troubleshooting.chapter.xml" />
</part>

View File

@@ -3,10 +3,10 @@
This chapter describes solutions to common problems you might encounter
when you manage your NixOS system.
```{=include=} sections
boot-problems.section.md
maintenance-mode.section.md
rollback.section.md
store-corruption.section.md
network-problems.section.md
```{=docbook}
<xi:include href="boot-problems.section.xml" />
<xi:include href="maintenance-mode.section.xml" />
<xi:include href="rollback.section.xml" />
<xi:include href="store-corruption.section.xml" />
<xi:include href="network-problems.section.xml" />
```

View File

@@ -11,8 +11,8 @@ manual](https://nixos.org/nix/manual/#chap-writing-nix-expressions), but
here we give a short overview of the most important constructs useful in
NixOS configuration files.
```{=include=} sections
config-file.section.md
abstractions.section.md
modularity.section.md
```{=docbook}
<xi:include href="config-file.section.xml" />
<xi:include href="abstractions.section.xml" />
<xi:include href="modularity.section.xml" />
```

View File

@@ -1,27 +0,0 @@
# Configuration {#ch-configuration}
This chapter describes how to configure various aspects of a NixOS machine through the configuration file {file}`/etc/nixos/configuration.nix`. As described in [](#sec-changing-config), changes to this file only take effect after you run {command}`nixos-rebuild`.
```{=include=} chapters
config-syntax.chapter.md
package-mgmt.chapter.md
user-mgmt.chapter.md
file-systems.chapter.md
x-windows.chapter.md
wayland.chapter.md
gpu-accel.chapter.md
xfce.chapter.md
networking.chapter.md
linux-kernel.chapter.md
subversion.chapter.md
```
```{=include=} chapters
@MODULE_CHAPTERS@
```
```{=include=} chapters
profiles.chapter.md
kubernetes.chapter.md
```
<!-- Apache; libvirtd virtualisation -->

View File

@@ -0,0 +1,31 @@
<part xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="ch-configuration">
<title>Configuration</title>
<partintro xml:id="ch-configuration-intro">
<para>
This chapter describes how to configure various aspects of a NixOS machine
through the configuration file
<filename>/etc/nixos/configuration.nix</filename>. As described in
<xref linkend="sec-changing-config" />, changes to this file only take
effect after you run <command>nixos-rebuild</command>.
</para>
</partintro>
<xi:include href="../from_md/configuration/config-syntax.chapter.xml" />
<xi:include href="../from_md/configuration/package-mgmt.chapter.xml" />
<xi:include href="../from_md/configuration/user-mgmt.chapter.xml" />
<xi:include href="../from_md/configuration/file-systems.chapter.xml" />
<xi:include href="../from_md/configuration/x-windows.chapter.xml" />
<xi:include href="../from_md/configuration/wayland.chapter.xml" />
<xi:include href="../from_md/configuration/gpu-accel.chapter.xml" />
<xi:include href="../from_md/configuration/xfce.chapter.xml" />
<xi:include href="../from_md/configuration/networking.chapter.xml" />
<xi:include href="../from_md/configuration/linux-kernel.chapter.xml" />
<xi:include href="../from_md/configuration/subversion.chapter.xml" />
<xi:include href="../generated/modules.xml" xpointer="xpointer(//section[@id='modules']/*)" />
<xi:include href="../from_md/configuration/profiles.chapter.xml" />
<xi:include href="../from_md/configuration/kubernetes.chapter.xml" />
<!-- Apache; libvirtd virtualisation -->
</part>

View File

@@ -40,7 +40,7 @@ configuration use `pkgs` prefix (variable).
To "uninstall" a package, simply remove it from
[](#opt-environment.systemPackages) and run `nixos-rebuild switch`.
```{=include=} sections
customizing-packages.section.md
adding-custom-packages.section.md
```{=docbook}
<xi:include href="customizing-packages.section.xml" />
<xi:include href="adding-custom-packages.section.xml" />
```

View File

@@ -36,7 +36,7 @@ dropping you to the emergency shell. You can make a mount asynchronous
and non-critical by adding `options = [ "nofail" ];`.
:::
```{=include=} sections
luks-file-systems.section.md
sshfs-file-systems.section.md
```{=docbook}
<xi:include href="luks-file-systems.section.xml" />
<xi:include href="sshfs-file-systems.section.xml" />
```

View File

@@ -3,14 +3,14 @@
This section describes how to configure networking components
on your NixOS machine.
```{=include=} sections
network-manager.section.md
ssh.section.md
ipv4-config.section.md
ipv6-config.section.md
firewall.section.md
wireless.section.md
ad-hoc-network-config.section.md
renaming-interfaces.section.md
```{=docbook}
<xi:include href="network-manager.section.xml" />
<xi:include href="ssh.section.xml" />
<xi:include href="ipv4-config.section.xml" />
<xi:include href="ipv6-config.section.xml" />
<xi:include href="firewall.section.xml" />
<xi:include href="wireless.section.xml" />
<xi:include href="ad-hoc-network-config.section.xml" />
<xi:include href="renaming-interfaces.section.xml" />
```
<!-- TODO: OpenVPN, NAT -->

View File

@@ -12,7 +12,7 @@ NixOS has two distinct styles of package management:
`nix-env` command. This style allows mixing packages from different
Nixpkgs versions. It's the only choice for non-root users.
```{=include=} sections
declarative-packages.section.md
ad-hoc-packages.section.md
```{=docbook}
<xi:include href="declarative-packages.section.xml" />
<xi:include href="ad-hoc-packages.section.xml" />
```

View File

@@ -19,16 +19,16 @@ install media, many are actually intended to be used in real installs.
What follows is a brief explanation on the purpose and use-case for each
profile. Detailing each option configured by each one is out of scope.
```{=include=} sections
profiles/all-hardware.section.md
profiles/base.section.md
profiles/clone-config.section.md
profiles/demo.section.md
profiles/docker-container.section.md
profiles/graphical.section.md
profiles/hardened.section.md
profiles/headless.section.md
profiles/installation-device.section.md
profiles/minimal.section.md
profiles/qemu-guest.section.md
```{=docbook}
<xi:include href="profiles/all-hardware.section.xml" />
<xi:include href="profiles/base.section.xml" />
<xi:include href="profiles/clone-config.section.xml" />
<xi:include href="profiles/demo.section.xml" />
<xi:include href="profiles/docker-container.section.xml" />
<xi:include href="profiles/graphical.section.xml" />
<xi:include href="profiles/hardened.section.xml" />
<xi:include href="profiles/headless.section.xml" />
<xi:include href="profiles/installation-device.section.xml" />
<xi:include href="profiles/minimal.section.xml" />
<xi:include href="profiles/qemu-guest.section.xml" />
```

View File

@@ -68,6 +68,56 @@ let
optionIdPrefix = "test-opt-";
};
sources = runCommand "manual-sources" {
inputs = lib.sourceFilesBySuffices ./. [ ".xml" ".md" ];
nativeBuildInputs = [ pkgs.nixos-render-docs ];
} ''
mkdir $out
cd $out
cp -r --no-preserve=all $inputs/* .
declare -a convert_args
while read -r mf; do
if [[ "$mf" = *.chapter.md ]]; then
convert_args+=("--chapter")
else
convert_args+=("--section")
fi
convert_args+=("from_md/''${mf%.md}.xml" "$mf")
done < <(find . -type f -name '*.md')
nixos-render-docs manual docbook-fragment \
--manpage-urls ${manpageUrls} \
"''${convert_args[@]}"
'';
modulesDoc = runCommand "modules.xml" {
nativeBuildInputs = [ pkgs.nixos-render-docs ];
} ''
nixos-render-docs manual docbook-section \
--manpage-urls ${manpageUrls} \
"$out" \
--section \
--section-id modules \
--chapters ${lib.concatMapStrings (p: "${p.value} ") config.meta.doc}
'';
generatedSources = runCommand "generated-docbook" {} ''
mkdir $out
ln -s ${modulesDoc} $out/modules.xml
ln -s ${optionsDoc.optionsDocBook} $out/options-db.xml
ln -s ${testOptionsDoc.optionsDocBook} $out/test-options-db.xml
printf "%s" "${version}" > $out/version
'';
copySources =
''
cp -prd $sources/* . # */
ln -s ${generatedSources} ./generated
chmod -R u+w .
'';
toc = builtins.toFile "toc.xml"
''
<toc role="chunk-toc">
@@ -98,102 +148,70 @@ let
"--stringparam chunk.toc ${toc}"
];
linterFunctions = ''
# outputs the context of an xmllint error output
# LEN lines around the failing line are printed
function context {
# length of context
local LEN=6
# lines to print before error line
local BEFORE=4
# xmllint output lines are:
# file.xml:1234: there was an error on line 1234
while IFS=':' read -r file line rest; do
echo
if [[ -n "$rest" ]]; then
echo "$file:$line:$rest"
local FROM=$(($line>$BEFORE ? $line - $BEFORE : 1))
# number lines & filter context
nl --body-numbering=a "$file" | sed -n "$FROM,+$LEN p"
else
if [[ -n "$line" ]]; then
echo "$file:$line"
else
echo "$file"
fi
fi
done
}
function lintrng {
xmllint --debug --noout --nonet \
--relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
"$1" \
2>&1 | context 1>&2
# ^ redirect assumes xmllint doesnt print to stdout
}
'';
manual-combined = runCommand "nixos-manual-combined"
{ inputs = lib.sourceFilesBySuffices ./. [ ".xml" ".md" ];
nativeBuildInputs = [ pkgs.nixos-render-docs pkgs.libxml2.bin pkgs.libxslt.bin ];
{ inherit sources;
nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
meta.description = "The NixOS manual as plain docbook XML";
}
''
cp -r --no-preserve=all $inputs/* .
${copySources}
substituteInPlace ./manual.md \
--replace '@NIXOS_VERSION@' "${version}"
substituteInPlace ./configuration/configuration.md \
--replace \
'@MODULE_CHAPTERS@' \
${lib.escapeShellArg (lib.concatMapStringsSep "\n" (p: "${p.value}") config.meta.doc)}
substituteInPlace ./nixos-options.md \
--replace \
'@NIXOS_OPTIONS_JSON@' \
${optionsDoc.optionsJSON}/share/doc/nixos/options.json
substituteInPlace ./development/writing-nixos-tests.section.md \
--replace \
'@NIXOS_TEST_OPTIONS_JSON@' \
${testOptionsDoc.optionsJSON}/share/doc/nixos/options.json
xmllint --xinclude --output ./manual-combined.xml ./manual.xml
xmllint --xinclude --noxincludenode \
--output ./man-pages-combined.xml ./man-pages.xml
nixos-render-docs -j $NIX_BUILD_CORES manual docbook \
--manpage-urls ${manpageUrls} \
--revision ${lib.escapeShellArg revision} \
./manual.md \
./manual-combined.xml
# outputs the context of an xmllint error output
# LEN lines around the failing line are printed
function context {
# length of context
local LEN=6
# lines to print before error line
local BEFORE=4
${linterFunctions}
# xmllint output lines are:
# file.xml:1234: there was an error on line 1234
while IFS=':' read -r file line rest; do
echo
if [[ -n "$rest" ]]; then
echo "$file:$line:$rest"
local FROM=$(($line>$BEFORE ? $line - $BEFORE : 1))
# number lines & filter context
nl --body-numbering=a "$file" | sed -n "$FROM,+$LEN p"
else
if [[ -n "$line" ]]; then
echo "$file:$line"
else
echo "$file"
fi
fi
done
}
function lintrng {
xmllint --debug --noout --nonet \
--relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
"$1" \
2>&1 | context 1>&2
# ^ redirect assumes xmllint doesnt print to stdout
}
mkdir $out
cp manual-combined.xml $out/
cp man-pages-combined.xml $out/
lintrng $out/manual-combined.xml
'';
manpages-combined = runCommand "nixos-manpages-combined.xml"
{ nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
meta.description = "The NixOS manpages as plain docbook XML";
}
''
mkdir generated
cp -prd ${./man-pages.xml} man-pages.xml
ln -s ${optionsDoc.optionsDocBook} generated/options-db.xml
xmllint --xinclude --noxincludenode --output $out ./man-pages.xml
${linterFunctions}
lintrng $out
lintrng $out/man-pages-combined.xml
'';
in rec {
inherit generatedSources;
inherit (optionsDoc) optionsJSON optionsNix optionsDocBook optionsUsedDocbook;
# Generate the NixOS manual.
manualHTML = runCommand "nixos-manual-html"
{ nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
{ inherit sources;
nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
meta.description = "The NixOS manual in HTML format";
allowedReferences = ["out"];
}
@@ -230,7 +248,8 @@ in rec {
manualHTMLIndex = "${manualHTML}/share/doc/nixos/index.html";
manualEpub = runCommand "nixos-manual-epub"
{ nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin buildPackages.zip ];
{ inherit sources;
nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin buildPackages.zip ];
}
''
# Generate the epub manual.
@@ -281,11 +300,11 @@ in rec {
--param man.endnotes.are.numbered 0 \
--param man.break.after.slash 1 \
${docbook_xsl_ns}/xml/xsl/docbook/manpages/docbook.xsl \
${manpages-combined}
${manual-combined}/man-pages-combined.xml
''
else ''
mkdir -p $out/share/man/man5
nixos-render-docs -j $NIX_BUILD_CORES options manpage \
nixos-render-docs options manpage \
--revision ${lib.escapeShellArg revision} \
${optionsJSON}/share/doc/nixos/options.json \
$out/share/man/man5/configuration.nix.5

View File

@@ -1,43 +0,0 @@
# Developing the NixOS Test Driver {#chap-developing-the-test-driver}
The NixOS test framework is a project of its own.
It consists of roughly the following components:
- `nixos/lib/test-driver`: The Python framework that sets up the test and runs the [`testScript`](#test-opt-testScript)
- `nixos/lib/testing`: The Nix code responsible for the wiring, written using the (NixOS) Module System.
These components are exposed publicly through:
- `nixos/lib/default.nix`: The public interface that exposes the `nixos/lib/testing` entrypoint.
- `flake.nix`: Exposes the `lib.nixos`, including the public test interface.
Beyond the test driver itself, its integration into NixOS and Nixpkgs is important.
- `pkgs/top-level/all-packages.nix`: Defines the `nixosTests` attribute, used
by the package `tests` attributes and OfBorg.
- `nixos/release.nix`: Defines the `tests` attribute built by Hydra, independently, but analogous to `nixosTests`
- `nixos/release-combined.nix`: Defines which tests are channel blockers.
Finally, we have legacy entrypoints that users should move away from, but are cared for on a best effort basis.
These include `pkgs.nixosTest`, `testing-python.nix` and `make-test-python.nix`.
## Testing changes to the test framework {#sec-test-the-test-framework}
When making significant changes to the test framework, we run the tests on Hydra, to avoid disrupting the larger NixOS project.
For this, we use the `python-test-refactoring` branch in the `NixOS/nixpkgs` repository, and its [corresponding Hydra jobset](https://hydra.nixos.org/jobset/nixos/python-test-refactoring).
This branch is used as a pointer, and not as a feature branch.
1. Rebase the PR onto a recent, good evaluation of `nixos-unstable`
2. Create a baseline evaluation by force-pushing this revision of `nixos-unstable` to `python-test-refactoring`.
3. Note the evaluation number (we'll call it `<previous>`)
4. Push the PR to `python-test-refactoring` and evaluate the PR on Hydra
5. Create a comparison URL by navigating to the latest build of the PR and adding to the URL `?compare=<previous>`. This is not necessary for the evaluation that comes right after the baseline.
Review the removed tests and newly failed tests using the constructed URL; otherwise you will accidentally compare iterations of the PR instead of changes to the PR base.
As we currently have some flaky tests, newly failing tests are expected, but should be reviewed to make sure that
- The number of failures did not increase significantly.
- All failures that do occur can reasonably be assumed to fail for a different reason than the changes.

View File

@@ -1,15 +0,0 @@
# Development {#ch-development}
This chapter describes how you can modify and extend NixOS.
```{=include=} chapters
sources.chapter.md
writing-modules.chapter.md
building-parts.chapter.md
bootspec.chapter.md
what-happens-during-a-system-switch.chapter.md
writing-documentation.chapter.md
nixos-tests.chapter.md
developing-the-test-driver.chapter.md
testing-installer.chapter.md
```

View File

@@ -0,0 +1,20 @@
<part xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="ch-development">
<title>Development</title>
<partintro xml:id="ch-development-intro">
<para>
This chapter describes how you can modify and extend NixOS.
</para>
</partintro>
<xi:include href="../from_md/development/sources.chapter.xml" />
<xi:include href="../from_md/development/writing-modules.chapter.xml" />
<xi:include href="../from_md/development/building-parts.chapter.xml" />
<xi:include href="../from_md/development/bootspec.chapter.xml" />
<xi:include href="../from_md/development/what-happens-during-a-system-switch.chapter.xml" />
<xi:include href="../from_md/development/writing-documentation.chapter.xml" />
<xi:include href="../from_md/development/nixos-tests.chapter.xml" />
<xi:include href="../from_md/development/testing-installer.chapter.xml" />
</part>

View File

@@ -5,9 +5,9 @@ NixOS tests are kept in the directory `nixos/tests`, and are executed
(using Nix) by a testing framework that automatically starts one or more
virtual machines containing the NixOS system(s) required for the test.
```{=include=} sections
writing-nixos-tests.section.md
running-nixos-tests.section.md
running-nixos-tests-interactively.section.md
linking-nixos-tests-to-packages.section.md
```{=docbook}
<xi:include href="writing-nixos-tests.section.xml" />
<xi:include href="running-nixos-tests.section.xml" />
<xi:include href="running-nixos-tests-interactively.section.xml" />
<xi:include href="linking-nixos-tests-to-packages.section.xml" />
```

View File

@@ -47,7 +47,7 @@ Most of these actions are either self-explaining but some of them have to do
with our units or the activation script. For this reason, these topics are
explained in the next sections.
```{=include=} sections
unit-handling.section.md
activation-script.section.md
```{=docbook}
<xi:include href="unit-handling.section.xml" />
<xi:include href="activation-script.section.xml" />
```

View File

@@ -83,7 +83,7 @@ Keep the following guidelines in mind when you create and add a topic:
## Adding a Topic to the Book {#sec-writing-docs-adding-a-topic}
Open the parent CommonMark file and add a line to the list of
Open the parent XML file and add an `xi:include` element to the list of
chapters with the file name of the topic that you created. If you
created a `section`, you add the file to the `chapter` file. If you created
a `chapter`, you add the file to the `part` file.

View File

@@ -189,14 +189,14 @@ in {
```
:::
```{=include=} sections
option-declarations.section.md
option-types.section.md
option-def.section.md
assertions.section.md
meta-attributes.section.md
importing-modules.section.md
replace-modules.section.md
freeform-modules.section.md
settings-options.section.md
```{=docbook}
<xi:include href="option-declarations.section.xml" />
<xi:include href="option-types.section.xml" />
<xi:include href="option-def.section.xml" />
<xi:include href="assertions.section.xml" />
<xi:include href="meta-attributes.section.xml" />
<xi:include href="importing-modules.section.xml" />
<xi:include href="replace-modules.section.xml" />
<xi:include href="freeform-modules.section.xml" />
<xi:include href="settings-options.section.xml" />
```

View File

@@ -470,8 +470,6 @@ In that case, `numpy` is chosen from the generic `python3Packages`.
The following options can be used when writing tests.
```{=include=} options
id-prefix: test-opt-
list-id: test-options-list
source: @NIXOS_TEST_OPTIONS_JSON@
```{=docbook}
<xi:include href="../../generated/test-options-db.xml" xpointer="test-options-list"/>
```

View File

@@ -1,11 +0,0 @@
# Installation {#ch-installation}
This section describes how to obtain, install, and configure NixOS for first-time use.
```{=include=} chapters
obtaining.chapter.md
installing.chapter.md
changing-config.chapter.md
upgrading.chapter.md
building-nixos.chapter.md
```

View File

@@ -0,0 +1,18 @@
<part xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="ch-installation">
<title>Installation</title>
<partintro xml:id="ch-installation-intro">
<para>
This section describes how to obtain, install, and configure NixOS for
first-time use.
</para>
</partintro>
<xi:include href="../from_md/installation/obtaining.chapter.xml" />
<xi:include href="../from_md/installation/installing.chapter.xml" />
<xi:include href="../from_md/installation/changing-config.chapter.xml" />
<xi:include href="../from_md/installation/upgrading.chapter.xml" />
<xi:include href="../from_md/installation/building-nixos.chapter.xml" />
</part>

View File

@@ -602,11 +602,11 @@ With a partitioned disk.
## Additional installation notes {#sec-installation-additional-notes}
```{=include=} sections
installing-usb.section.md
installing-pxe.section.md
installing-kexec.section.md
installing-virtualbox-guest.section.md
installing-from-other-distro.section.md
installing-behind-a-proxy.section.md
```{=docbook}
<xi:include href="installing-usb.section.xml" />
<xi:include href="installing-pxe.section.xml" />
<xi:include href="installing-kexec.section.xml" />
<xi:include href="installing-virtualbox-guest.section.xml" />
<xi:include href="installing-from-other-distro.section.xml" />
<xi:include href="installing-behind-a-proxy.section.xml" />
```

View File

@@ -0,0 +1,31 @@
<refentry xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refmeta>
<refentrytitle><filename>configuration.nix</filename>
</refentrytitle><manvolnum>5</manvolnum>
<refmiscinfo class="source">NixOS</refmiscinfo>
<!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo> -->
</refmeta>
<refnamediv>
<refname><filename>configuration.nix</filename></refname>
<refpurpose>NixOS system configuration specification</refpurpose>
</refnamediv>
<refsection>
<title>Description</title>
<para>
The file <filename>/etc/nixos/configuration.nix</filename> contains the
declarative specification of your NixOS system configuration. The command
<command>nixos-rebuild</command> takes this file and realises the system
configuration specified therein.
</para>
</refsection>
<refsection>
<title>Options</title>
<para>
You can use the following options in <filename>configuration.nix</filename>.
</para>
<xi:include href="./generated/options-db.xml"
xpointer="configuration-variable-list" />
</refsection>
</refentry>

View File

@@ -14,33 +14,5 @@
<copyright><year>2007-2022</year><holder>Eelco Dolstra and the Nixpkgs/NixOS contributors</holder>
</copyright>
</info>
<refentry>
<refmeta>
<refentrytitle><filename>configuration.nix</filename>
</refentrytitle><manvolnum>5</manvolnum>
<refmiscinfo class="source">NixOS</refmiscinfo>
<!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo> -->
</refmeta>
<refnamediv>
<refname><filename>configuration.nix</filename></refname>
<refpurpose>NixOS system configuration specification</refpurpose>
</refnamediv>
<refsection>
<title>Description</title>
<para>
The file <filename>/etc/nixos/configuration.nix</filename> contains the
declarative specification of your NixOS system configuration. The command
<command>nixos-rebuild</command> takes this file and realises the system
configuration specified therein.
</para>
</refsection>
<refsection>
<title>Options</title>
<para>
You can use the following options in <filename>configuration.nix</filename>.
</para>
<xi:include href="./generated/options-db.xml"
xpointer="configuration-variable-list" />
</refsection>
</refentry>
<xi:include href="man-configuration.xml" />
</reference>

View File

@@ -56,7 +56,9 @@ must run
.Nm
to make the changes take effect. It builds the new system in
.Pa /nix/store Ns
, runs its activation script, and stop and (re)starts any system services if
, runs its activation script (invoking
.Ic sudo Ns
\& if required), and stop and (re)starts any system services if
needed. Please note that user services need to be started manually as they
aren't detected by the activation script at the moment.
.
@@ -355,6 +357,11 @@ or
is also set. This is useful when the target-host connection to cache.nixos.org
is faster than the connection between hosts.
.
.It Fl -no-auto-sudo
When set, disables automatic use of
.Ic sudo Ns
\& when deploying to localhost as a non-root user.
.
.It Fl -use-remote-sudo
When set, nixos-rebuild prefixes remote commands that run on the
.Fl -build-host

View File

@@ -1,53 +0,0 @@
# NixOS Manual {#book-nixos-manual}
## Version @NIXOS_VERSION@
<!--
this is the top-level structure file for the nixos manual.
the manual structure extends the nixpkgs commonmark further with include
blocks to allow better organization of input text. there are six types of
include blocks: preface, parts, chapters, sections, appendix, and options.
each type except `options`` corresponds to the docbook elements of (roughly)
the same name, and can itself can further include blocks to denote its
substructure.
non-`options`` include blocks are fenced code blocks that list a number of
files to include, in the form
```{=include=} <type>
<file-name-1>
<file-name-2>
<...>
```
`options` include blocks do not list file names but contain a list of key-value
pairs that describe the options to be included and how to convert them into
elements of the manual output type:
```{=include=} options
id-prefix: <options id prefix>
list-id: <variable list element id>
source: <path to options.json>
```
-->
```{=include=} preface
preface.md
```
```{=include=} parts
installation/installation.md
configuration/configuration.md
administration/running.md
development/development.md
```
```{=include=} chapters
contributing-to-this-manual.chapter.md
```
```{=include=} appendix
nixos-options.md
release-notes/release-notes.md
```

View File

@@ -0,0 +1,23 @@
<book xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="book-nixos-manual">
<info>
<title>NixOS Manual</title>
<subtitle>Version <xi:include href="./generated/version" parse="text" />
</subtitle>
</info>
<xi:include href="preface.xml" />
<xi:include href="installation/installation.xml" />
<xi:include href="configuration/configuration.xml" />
<xi:include href="administration/running.xml" />
<xi:include href="development/development.xml" />
<xi:include href="./from_md/contributing-to-this-manual.chapter.xml" />
<appendix xml:id="ch-options">
<title>Configuration Options</title>
<xi:include href="./generated/options-db.xml"
xpointer="configuration-variable-list" />
</appendix>
<xi:include href="release-notes/release-notes.xml" />
</book>

View File

@@ -1,7 +0,0 @@
# Configuration Options {#ch-options}
```{=include=} options
id-prefix: opt-
list-id: configuration-variable-list
source: @NIXOS_OPTIONS_JSON@
```

View File

@@ -1,11 +0,0 @@
# Preface {#preface}
This manual describes how to install, use and extend NixOS, a Linux distribution based on the purely functional package management system [Nix](https://nixos.org/nix), that is composed using modules and packages defined in the [Nixpkgs](https://nixos.org/nixpkgs) project.
Additional information regarding the Nix package manager and the Nixpkgs project can be found in respectively the [Nix manual](https://nixos.org/nix/manual) and the [Nixpkgs manual](https://nixos.org/nixpkgs/manual).
If you encounter problems, please report them on the [`Discourse`](https://discourse.nixos.org), the [Matrix room](https://matrix.to/#nix:nixos.org), or on the [`#nixos` channel on Libera.Chat](irc://irc.libera.chat/#nixos). Alternatively, consider [contributing to this manual](#chap-contributing). Bugs should be reported in [NixOS GitHub issue tracker](https://github.com/NixOS/nixpkgs/issues).
::: {.note}
Commands prefixed with `#` have to be run as root, either requiring to login as root user or temporarily switching to it using `sudo` for example.
:::

View File

@@ -0,0 +1,42 @@
<preface xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="preface">
<title>Preface</title>
<para>
This manual describes how to install, use and extend NixOS, a Linux
distribution based on the purely functional package management system
<link xlink:href="https://nixos.org/nix">Nix</link>, that is composed
using modules and packages defined in the
<link xlink:href="https://nixos.org/nixpkgs">Nixpkgs</link> project.
</para>
<para>
Additional information regarding the Nix package manager and the Nixpkgs
project can be found in respectively the
<link xlink:href="https://nixos.org/nix/manual">Nix manual</link> and the
<link xlink:href="https://nixos.org/nixpkgs/manual">Nixpkgs manual</link>.
</para>
<para>
If you encounter problems, please report them on the
<literal
xlink:href="https://discourse.nixos.org">Discourse</literal>,
the <link
xlink:href="https://matrix.to/#nix:nixos.org">Matrix room</link>,
or on the <link
xlink:href="irc://irc.libera.chat/#nixos">
<literal>#nixos</literal> channel on Libera.Chat</link>.
Alternatively, consider <link
xlink:href="#chap-contributing">
contributing to this manual</link>. Bugs should be
reported in
<link
xlink:href="https://github.com/NixOS/nixpkgs/issues">NixOS
GitHub issue tracker</link>.
</para>
<note>
<para>
Commands prefixed with <literal>#</literal> have to be run as root, either
requiring to login as root user or temporarily switching to it using
<literal>sudo</literal> for example.
</para>
</note>
</preface>

View File

@@ -1,25 +0,0 @@
# Release Notes {#ch-release-notes}
This section lists the release notes for each stable version of NixOS and current unstable revision.
```{=include=} sections
rl-2305.section.md
rl-2211.section.md
rl-2205.section.md
rl-2111.section.md
rl-2105.section.md
rl-2009.section.md
rl-2003.section.md
rl-1909.section.md
rl-1903.section.md
rl-1809.section.md
rl-1803.section.md
rl-1709.section.md
rl-1703.section.md
rl-1609.section.md
rl-1603.section.md
rl-1509.section.md
rl-1412.section.md
rl-1404.section.md
rl-1310.section.md
```

View File

@@ -0,0 +1,30 @@
<appendix xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="ch-release-notes">
<title>Release Notes</title>
<para>
This section lists the release notes for each stable version of NixOS and
current unstable revision.
</para>
<xi:include href="../from_md/release-notes/rl-2305.section.xml" />
<xi:include href="../from_md/release-notes/rl-2211.section.xml" />
<xi:include href="../from_md/release-notes/rl-2205.section.xml" />
<xi:include href="../from_md/release-notes/rl-2111.section.xml" />
<xi:include href="../from_md/release-notes/rl-2105.section.xml" />
<xi:include href="../from_md/release-notes/rl-2009.section.xml" />
<xi:include href="../from_md/release-notes/rl-2003.section.xml" />
<xi:include href="../from_md/release-notes/rl-1909.section.xml" />
<xi:include href="../from_md/release-notes/rl-1903.section.xml" />
<xi:include href="../from_md/release-notes/rl-1809.section.xml" />
<xi:include href="../from_md/release-notes/rl-1803.section.xml" />
<xi:include href="../from_md/release-notes/rl-1709.section.xml" />
<xi:include href="../from_md/release-notes/rl-1703.section.xml" />
<xi:include href="../from_md/release-notes/rl-1609.section.xml" />
<xi:include href="../from_md/release-notes/rl-1603.section.xml" />
<xi:include href="../from_md/release-notes/rl-1509.section.xml" />
<xi:include href="../from_md/release-notes/rl-1412.section.xml" />
<xi:include href="../from_md/release-notes/rl-1404.section.xml" />
<xi:include href="../from_md/release-notes/rl-1310.section.xml" />
</appendix>

View File

@@ -42,8 +42,6 @@ In addition to numerous new and upgraded packages, this release has the followin
- [atuin](https://github.com/ellie/atuin), a sync server for shell history. Available as [services.atuin](#opt-services.atuin.enable).
- [networkd-dispatcher](https://gitlab.com/craftyguy/networkd-dispatcher), a dispatcher service for systemd-networkd connection status changes. Available as [services.networkd-dispatcher](#opt-services.networkd-dispatcher.enable).
- [mmsd](https://gitlab.com/kop316/mmsd), a lower level daemon that transmits and recieves MMSes. Available as [services.mmsd](#opt-services.mmsd.enable).
- [QDMR](https://dm3mat.darc.de/qdmr/), a GUI application and command line tool for programming DMR radios [programs.qdmr](#opt-programs.qdmr.enable)
@@ -207,6 +205,8 @@ In addition to numerous new and upgraded packages, this release has the followin
- A new `virtualisation.rosetta` module was added to allow running `x86_64` binaries through [Rosetta](https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment) inside virtualised NixOS guests on Apple silicon. This feature works by default with the [UTM](https://docs.getutm.app/) virtualisation [package](https://search.nixos.org/packages?channel=unstable&show=utm&from=0&size=1&sort=relevance&type=packages&query=utm).
- `nixos-rebuild` now uses `sudo` when deploying to localhost as a non-root user. This behaviour can be disabled with `--no-auto-sudo`.
- The new option `users.motdFile` allows configuring a Message Of The Day that can be updated dynamically.
- The `root` package is now built with the `"-Dgnuinstall=ON"` CMake flag, making the output conform the `bin` `lib` `share` layout. In this layout, `tutorials` is under `share/doc/ROOT/`; `cmake`, `font`, `icons`, `js` and `macro` under `share/root`; `Makefile.comp` and `Makefile.config` under `etc/root`.

View File

@@ -0,0 +1,8 @@
let
pkgs = import ../../.. { };
in
pkgs.mkShell {
name = "nixos-manual";
packages = with pkgs; [ xmlformat jing xmloscopy ruby ];
}

124
nixos/doc/varlistentry-fixer.rb Executable file
View File

@@ -0,0 +1,124 @@
#!/usr/bin/env ruby
# This script is written intended as a living, evolving tooling
# to fix oopsies within the docbook documentation.
#
# This is *not* a formatter. It, instead, handles some known cases
# where something bad happened, and fixing it manually is tedious.
#
# Read the code to see the different cases it handles.
#
# ALWAYS `make format` after fixing with this!
# ALWAYS read the changes, this tool isn't yet proven to be always right.
require "rexml/document"
include REXML
if ARGV.length < 1 then
$stderr.puts "Needs a filename."
exit 1
end
filename = ARGV.shift
doc = Document.new(File.open(filename))
$touched = false
# Fixing varnames having a sibling element without spacing.
# This is to fix an initial `xmlformat` issue where `term`
# would mangle as spaces.
#
# <varlistentry>
# <term><varname>types.separatedString</varname><replaceable>sep</replaceable> <----
# </term>
# ...
#
# Generates: types.separatedStringsep
# ^^^^
#
# <varlistentry xml:id='fun-makeWrapper'>
# <term>
# <function>makeWrapper</function><replaceable>executable</replaceable><replaceable>wrapperfile</replaceable><replaceable>args</replaceable> <----
# </term>
#
# Generates: makeWrapperexecutablewrapperfileargs
# ^^^^ ^^^^ ^^ ^^
#
# <term>
# <option>--option</option><replaceable>name</replaceable><replaceable>value</replaceable> <-----
# </term>
#
# Generates: --optionnamevalue
# ^^ ^^
doc.elements.each("//varlistentry/term") do |term|
["varname", "function", "option", "replaceable"].each do |prev_name|
term.elements.each(prev_name) do |el|
if el.next_element and
el.next_element.name == "replaceable" and
el.next_sibling_node.class == Element
then
$touched = true
term.insert_after(el, Text.new(" "))
end
end
end
end
# <cmdsynopsis>
# <command>nixos-option</command>
# <arg>
# <option>-I</option><replaceable>path</replaceable> <------
# </arg>
#
# Generates: -Ipath
# ^^
doc.elements.each("//cmdsynopsis/arg") do |term|
["option", "replaceable"].each do |prev_name|
term.elements.each(prev_name) do |el|
if el.next_element and
el.next_element.name == "replaceable" and
el.next_sibling_node.class == Element
then
$touched = true
term.insert_after(el, Text.new(" "))
end
end
end
end
# <cmdsynopsis>
# <arg>
# <group choice='req'>
# <arg choice='plain'>
# <option>--profile-name</option>
# </arg>
#
# <arg choice='plain'>
# <option>-p</option>
# </arg>
# </group><replaceable>name</replaceable> <----
# </arg>
#
# Generates: [{--profile-name | -p }name]
# ^^^^
doc.elements.each("//cmdsynopsis/arg") do |term|
["group"].each do |prev_name|
term.elements.each(prev_name) do |el|
if el.next_element and
el.next_element.name == "replaceable" and
el.next_sibling_node.class == Element
then
$touched = true
term.insert_after(el, Text.new(" "))
end
end
end
end
if $touched then
doc.context[:attribute_quote] = :quote
doc.write(output: File.open(filename, "w"))
end

View File

@@ -152,7 +152,7 @@ in rec {
pkgs.nixos-render-docs
];
} ''
nixos-render-docs -j $NIX_BUILD_CORES options docbook \
nixos-render-docs options docbook \
--manpage-urls ${pkgs.path + "/doc/manpage-urls.json"} \
--revision ${lib.escapeShellArg revision} \
--document-type ${lib.escapeShellArg documentType} \

View File

@@ -22,7 +22,7 @@ in
};
timeout = lib.mkOption {
type = types.nullOr types.int;
default = 3600; # 1 hour
default = null; # NOTE: null values are filtered out by `meta`.
description = mdDoc ''
The [{option}`test`](#test-opt-test)'s [`meta.timeout`](https://nixos.org/manual/nixpkgs/stable/#var-meta-timeout) in seconds.
'';

View File

@@ -67,7 +67,6 @@ with lib;
stoken = super.stoken.override { withGTK3 = false; };
# translateManpages -> perlPackages.po4a -> texlive-combined-basic -> texlive-core-big -> libX11
util-linux = super.util-linux.override { translateManpages = false; };
vim-full = super.vim-full.override { guiSupport = false; };
zbar = super.zbar.override { enableVideo = false; withXorg = false; };
}));
};

View File

@@ -912,7 +912,6 @@
./services/networking/ndppd.nix
./services/networking/nebula.nix
./services/networking/netbird.nix
./services/networking/networkd-dispatcher.nix
./services/networking/networkmanager.nix
./services/networking/nextdns.nix
./services/networking/nftables.nix

View File

@@ -34,7 +34,7 @@ let
text = if (cfg.configFile != null) then ''
cp ${cfg.configFile} ${configPath}
# make config file readable by service
chown -R --reference="$HOME" "$(dirname ${configPath})"
chown -R --reference=$HOME $(dirname ${configPath})
'' else ''
export CONFIG_FILE=${configPath}

View File

@@ -8,9 +8,19 @@ let
keyboard = {
options = {
devices = mkOption {
type = types.listOf types.str;
type = types.addCheck (types.listOf types.str)
(devices: (length devices) > 0);
example = [ "/dev/input/by-id/usb-0000_0000-event-kbd" ];
description = mdDoc "Paths to keyboard devices.";
# TODO replace note with tip, which has not been implemented yet in
# nixos/lib/make-options-doc/mergeJSON.py
description = mdDoc ''
Paths to keyboard devices.
::: {.note}
To avoid unnecessary triggers of the service unit, unplug devices in
the order of the list.
:::
'';
};
config = mkOption {
type = types.lines;
@@ -34,10 +44,8 @@ let
cap (tap-hold 100 100 caps lctl))
'';
description = mdDoc ''
Configuration other than `defcfg`.
See [example config files](https://github.com/jtroo/kanata)
for more information.
Configuration other than `defcfg`. See [example config
files](https://github.com/jtroo/kanata) for more information.
'';
};
extraDefCfg = mkOption {
@@ -45,12 +53,8 @@ let
default = "";
example = "danger-enable-cmd yes";
description = mdDoc ''
Configuration of `defcfg` other than `linux-dev` (generated
from the devices option) and
`linux-continue-if-no-devs-found` (hardcoded to be yes).
See [example config files](https://github.com/jtroo/kanata)
for more information.
Configuration of `defcfg` other than `linux-dev`. See [example
config files](https://github.com/jtroo/kanata) for more information.
'';
};
extraArgs = mkOption {
@@ -63,7 +67,8 @@ let
default = null;
example = 6666;
description = mdDoc ''
Port to run the TCP server on. `null` will not run the server.
Port to run the notification server on. `null` will not run the
server.
'';
};
};
@@ -71,23 +76,28 @@ let
mkName = name: "kanata-${name}";
mkDevices = devices:
optionalString ((length devices) > 0) "linux-dev ${concatStringsSep ":" devices}";
mkDevices = devices: concatStringsSep ":" devices;
mkConfig = name: keyboard: pkgs.writeText "${mkName name}-config.kdb" ''
(defcfg
${keyboard.extraDefCfg}
${mkDevices keyboard.devices}
linux-continue-if-no-devs-found yes)
linux-dev ${mkDevices keyboard.devices})
${keyboard.config}
'';
mkService = name: keyboard: nameValuePair (mkName name) {
wantedBy = [ "multi-user.target" ];
description = "kanata for ${mkDevices keyboard.devices}";
# Because path units are used to activate service units, which
# will start the old stopped services during "nixos-rebuild
# switch", stopIfChanged here is a workaround to make sure new
# services are running after "nixos-rebuild switch".
stopIfChanged = false;
serviceConfig = {
ExecStart = ''
${getExe cfg.package} \
${cfg.package}/bin/kanata \
--cfg ${mkConfig name keyboard} \
--symlink-path ''${RUNTIME_DIRECTORY}/${name} \
${optionalString (keyboard.port != null) "--port ${toString keyboard.port}"} \
@@ -136,10 +146,37 @@ let
UMask = "0077";
};
};
mkPathName = i: name: "${mkName name}-${toString i}";
mkPath = name: n: i: device:
nameValuePair (mkPathName i name) {
description =
"${toString (i+1)}/${toString n} kanata trigger for ${name}, watching ${device}";
wantedBy = optional (i == 0) "multi-user.target";
pathConfig = {
PathExists = device;
# (ab)use systemd.path to construct a trigger chain so that the
# service unit is only started when all paths exist
# however, manual of systemd.path says Unit's suffix is not ".path"
Unit =
if (i + 1) == n
then "${mkName name}.service"
else "${mkPathName (i + 1) name}.path";
};
unitConfig.StopPropagatedFrom = optional (i > 0) "${mkName name}.service";
};
mkPaths = name: keyboard:
let
n = length keyboard.devices;
in
imap0 (mkPath name n) keyboard.devices
;
in
{
options.services.kanata = {
enable = mkEnableOption (mdDoc "kanata");
enable = mkEnableOption (lib.mdDoc "kanata");
package = mkOption {
type = types.package;
default = pkgs.kanata;
@@ -164,7 +201,14 @@ in
config = mkIf cfg.enable {
hardware.uinput.enable = true;
systemd.services = mapAttrs' mkService cfg.keyboards;
systemd = {
paths = trivial.pipe cfg.keyboards [
(mapAttrsToList mkPaths)
concatLists
listToAttrs
];
services = mapAttrs' mkService cfg.keyboards;
};
};
meta.maintainers = with maintainers; [ linj ];

View File

@@ -223,59 +223,22 @@ in {
'';
};
ensureAccounts = mkOption {
type = types.listOf types.str;
default = [];
description = lib.mdDoc ''
List of IMAP accounts which get automatically created. Note that for
a complete setup, user credentials for these accounts are required too
and can be created using the command `maddyctl creds`.
This option does not delete accounts which are not (anymore) listed.
'';
example = [
"user1@localhost"
"user2@localhost"
];
};
};
};
config = mkIf cfg.enable {
systemd = {
packages = [ pkgs.maddy ];
services = {
maddy = {
serviceConfig = {
User = cfg.user;
Group = cfg.group;
StateDirectory = [ "maddy" ];
};
restartTriggers = [ config.environment.etc."maddy/maddy.conf".source ];
wantedBy = [ "multi-user.target" ];
services.maddy = {
serviceConfig = {
User = cfg.user;
Group = cfg.group;
StateDirectory = [ "maddy" ];
};
maddy-ensure-accounts = {
script = ''
${optionalString (cfg.ensureAccounts != []) ''
${concatMapStrings (account: ''
if ! ${pkgs.maddy}/bin/maddyctl imap-acct list | grep "${account}"; then
${pkgs.maddy}/bin/maddyctl imap-acct create ${account}
fi
'') cfg.ensureAccounts}
''}
'';
serviceConfig = {
Type = "oneshot";
User= "maddy";
};
after = [ "maddy.service" ];
wantedBy = [ "multi-user.target" ];
};
restartTriggers = [ config.environment.etc."maddy/maddy.conf".source ];
wantedBy = [ "multi-user.target" ];
};
};
environment.etc."maddy/maddy.conf" = {

View File

@@ -409,7 +409,7 @@ in
provision = {
enable = cfg.provision.grafana.datasource || cfg.provision.grafana.dashboard;
datasources.settings.datasources =
datasources =
let
esVersion = lib.getVersion config.services.elasticsearch.package;
in
@@ -435,7 +435,7 @@ in
};
}
];
dashboards.settings.providers = lib.mkIf cfg.provision.grafana.dashboard [{
dashboards = lib.mkIf cfg.provision.grafana.dashboard [{
name = "parsedmarc";
options.path = "${pkgs.python3Packages.parsedmarc.dashboard}";
}];

View File

@@ -1,63 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.networkd-dispatcher;
in {
options = {
services.networkd-dispatcher = {
enable = mkEnableOption (mdDoc ''
Networkd-dispatcher service for systemd-networkd connection status
change. See [https://gitlab.com/craftyguy/networkd-dispatcher](upstream instructions)
for usage.
'');
scriptDir = mkOption {
type = types.path;
default = "/var/lib/networkd-dispatcher";
description = mdDoc ''
This directory is used for keeping various scripts read and run by
networkd-dispatcher. See [https://gitlab.com/craftyguy/networkd-dispatcher](upstream instructions)
for directory structure and script usage.
'';
};
};
};
config = mkIf cfg.enable {
systemd = {
packages = [ pkgs.networkd-dispatcher ];
services.networkd-dispatcher = {
wantedBy = [ "multi-user.target" ];
# Override existing ExecStart definition
serviceConfig.ExecStart = [
""
"${pkgs.networkd-dispatcher}/bin/networkd-dispatcher -v --script-dir ${cfg.scriptDir} $networkd_dispatcher_args"
];
};
# Directory structure required according to upstream instructions
# https://gitlab.com/craftyguy/networkd-dispatcher
tmpfiles.rules = [
"d '${cfg.scriptDir}' 0750 root root - -"
"d '${cfg.scriptDir}/routable.d' 0750 root root - -"
"d '${cfg.scriptDir}/dormant.d' 0750 root root - -"
"d '${cfg.scriptDir}/no-carrier.d' 0750 root root - -"
"d '${cfg.scriptDir}/off.d' 0750 root root - -"
"d '${cfg.scriptDir}/carrier.d' 0750 root root - -"
"d '${cfg.scriptDir}/degraded.d' 0750 root root - -"
"d '${cfg.scriptDir}/configuring.d' 0750 root root - -"
"d '${cfg.scriptDir}/configured.d' 0750 root root - -"
];
};
};
}

View File

@@ -12,38 +12,27 @@ with lib;
config = mkIf config.services.v2raya.enable {
environment.systemPackages = [ pkgs.v2raya ];
systemd.services.v2raya =
let
nftablesEnabled = config.networking.nftables.enable;
iptablesServices = [
"iptables.service"
] ++ optional config.networking.enableIPv6 "ip6tables.service";
tableServices = if nftablesEnabled then [ "nftables.service" ] else iptablesServices;
in
{
unitConfig = {
Description = "v2rayA service";
Documentation = "https://github.com/v2rayA/v2rayA/wiki";
After = [
"network.target"
"nss-lookup.target"
] ++ tableServices;
Wants = [ "network.target" ];
};
serviceConfig = {
User = "root";
ExecStart = "${getExe pkgs.v2raya} --log-disable-timestamp";
Environment = [ "V2RAYA_LOG_FILE=/var/log/v2raya/v2raya.log" ];
LimitNPROC = 500;
LimitNOFILE = 1000000;
Restart = "on-failure";
Type = "simple";
};
wantedBy = [ "multi-user.target" ];
path = with pkgs; [ iptables bash iproute2 ]; # required by v2rayA TProxy functionality
systemd.services.v2raya = {
unitConfig = {
Description = "v2rayA service";
Documentation = "https://github.com/v2rayA/v2rayA/wiki";
After = [ "network.target" "nss-lookup.target" "iptables.service" "ip6tables.service" ];
Wants = [ "network.target" ];
};
serviceConfig = {
User = "root";
ExecStart = "${getExe pkgs.v2raya} --log-disable-timestamp";
Environment = [ "V2RAYA_LOG_FILE=/var/log/v2raya/v2raya.log" ];
LimitNPROC = 500;
LimitNOFILE = 1000000;
Restart = "on-failure";
Type = "simple";
};
wantedBy = [ "multi-user.target" ];
path = with pkgs; [ iptables bash iproute2 ]; # required by v2rayA TProxy functionality
};
};
meta.maintainers = with maintainers; [ elliot ];

View File

@@ -270,7 +270,7 @@ in
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${cfg.package.fhs}/bin/onlyoffice-wrapper DocService/docservice /run/onlyoffice/config";
ExecStartPre = [ onlyoffice-prestart ];
ExecStartPre = onlyoffice-prestart;
Group = "onlyoffice";
Restart = "always";
RuntimeDirectory = "onlyoffice";

View File

@@ -316,13 +316,11 @@ in {
mkdir -p -m 0755 /run/binfmt
${lib.concatStringsSep "\n" (lib.mapAttrsToList activationSnippet config.boot.binfmt.registrations)}
'';
systemd = lib.mkIf (config.boot.binfmt.registrations != {}) {
additionalUpstreamSystemUnits = [
"proc-sys-fs-binfmt_misc.automount"
"proc-sys-fs-binfmt_misc.mount"
"systemd-binfmt.service"
];
services.systemd-binfmt.restartTriggers = [ (builtins.toJSON config.boot.binfmt.registrations) ];
};
systemd.additionalUpstreamSystemUnits = lib.mkIf (config.boot.binfmt.registrations != {}) [
"proc-sys-fs-binfmt_misc.automount"
"proc-sys-fs-binfmt_misc.mount"
"systemd-binfmt.service"
];
systemd.services.systemd-binfmt.restartTriggers = [ (builtins.toJSON config.boot.binfmt.registrations) ];
};
}

View File

@@ -1,8 +1,7 @@
{ config, pkgs, lib, ... }:
let
cfg = config.systemd.repart;
initrdCfg = config.boot.initrd.systemd.repart;
cfg = config.boot.initrd.systemd.repart;
writeDefinition = name: partitionConfig: pkgs.writeText
"${name}.conf"
@@ -25,59 +24,45 @@ let
'';
in
{
options = {
boot.initrd.systemd.repart.enable = lib.mkEnableOption (lib.mdDoc "systemd-repart") // {
options.boot.initrd.systemd.repart = {
enable = lib.mkEnableOption (lib.mdDoc "systemd-repart") // {
description = lib.mdDoc ''
Grow and add partitions to a partition table at boot time in the initrd.
Grow and add partitions to a partition table a boot time in the initrd.
systemd-repart only works with GPT partition tables.
To run systemd-repart after the initrd, see
`options.systemd.repart.enable`.
'';
};
systemd.repart = {
enable = lib.mkEnableOption (lib.mdDoc "systemd-repart") // {
description = lib.mdDoc ''
Grow and add partitions to a partition table.
systemd-repart only works with GPT partition tables.
To run systemd-repart while in the initrd, see
`options.boot.initrd.systemd.repart.enable`.
'';
};
partitions = lib.mkOption {
type = with lib.types; attrsOf (attrsOf (oneOf [ str int bool ]));
default = { };
example = {
"10-root" = {
Type = "root";
};
"20-home" = {
Type = "home";
SizeMinBytes = "512M";
SizeMaxBytes = "2G";
};
partitions = lib.mkOption {
type = with lib.types; attrsOf (attrsOf (oneOf [ str int bool ]));
default = { };
example = {
"10-root" = {
Type = "root";
};
"20-home" = {
Type = "home";
SizeMinBytes = "512M";
SizeMaxBytes = "2G";
};
description = lib.mdDoc ''
Specify partitions as a set of the names of the definition files as the
key and the partition configuration as its value. The partition
configuration can use all upstream options. See <link
xlink:href="https://www.freedesktop.org/software/systemd/man/repart.d.html"/>
for all available options.
'';
};
description = lib.mdDoc ''
Specify partitions as a set of the names of the definition files as the
key and the partition configuration as its value. The partition
configuration can use all upstream options. See <link
xlink:href="https://www.freedesktop.org/software/systemd/man/repart.d.html"/>
for all available options.
'';
};
};
config = lib.mkIf (cfg.enable || initrdCfg.enable) {
# Always link the definitions into /etc so that they are also included in
# the /nix/store of the sysroot during early userspace (i.e. while in the
# initrd).
config = lib.mkIf cfg.enable {
# Link the definitions into /etc so that they are included in the
# /nix/store of the sysroot. This also allows the user to run the
# systemd-repart binary after activation manually while automatically
# picking up the definition files.
environment.etc."repart.d".source = definitionsDirectory;
boot.initrd.systemd = lib.mkIf initrdCfg.enable {
boot.initrd.systemd = {
additionalUpstreamUnits = [
"systemd-repart.service"
];
@@ -88,7 +73,7 @@ in
# Override defaults in upstream unit.
services.systemd-repart = {
# Unset the conditions as they cannot be met before activation because
# Unset the coniditions as they cannot be met before activation because
# the definition files are not stored in the expected locations.
unitConfig.ConditionDirectoryNotEmpty = [
" " # required to unset the previous value.
@@ -112,12 +97,5 @@ in
after = [ "sysroot.mount" ];
};
};
systemd = lib.mkIf cfg.enable {
additionalUpstreamSystemUnits = [
"systemd-repart.service"
];
};
};
}

View File

@@ -163,7 +163,7 @@ in
###### implementation
config = mkIf cfg.enable (mkMerge [{
boot.kernelModules = [ "bridge" "veth" "br_netfilter" "xt_nat" ];
boot.kernelModules = [ "bridge" "veth" ];
boot.kernel.sysctl = {
"net.ipv4.conf.all.forwarding" = mkOverride 98 true;
"net.ipv4.conf.default.forwarding" = mkOverride 98 true;

View File

@@ -9,7 +9,8 @@ let
extraPackages = cfg.extraPackages
# setuid shadow
++ [ "/run/wrappers" ]
++ lib.optional (builtins.elem "zfs" config.boot.supportedFilesystems) config.boot.zfs.package;
# include pkgs.zfs by default in the wrapped podman used by the module so it is cached
++ (if (builtins.elem "zfs" config.boot.supportedFilesystems) then [ config.boot.zfs.package ] else [ pkgs.zfs ]);
});
# Provides a fake "docker" binary mapping to podman
@@ -183,10 +184,6 @@ in
systemd.packages = [ cfg.package ];
systemd.services.podman.serviceConfig = {
ExecStart = [ "" "${cfg.package}/bin/podman $LOGGING system service" ];
};
systemd.services.podman-prune = {
description = "Prune podman resources";
@@ -207,10 +204,6 @@ in
systemd.sockets.podman.wantedBy = [ "sockets.target" ];
systemd.sockets.podman.socketConfig.SocketGroup = "podman";
systemd.user.services.podman.serviceConfig = {
ExecStart = [ "" "${cfg.package}/bin/podman $LOGGING system service" ];
};
systemd.user.sockets.podman.wantedBy = [ "sockets.target" ];
systemd.tmpfiles.packages = [

View File

@@ -144,6 +144,7 @@ in rec {
manual = manualHTML; # TODO(@oxij): remove eventually
manualEpub = (buildFromConfig ({ ... }: { }) (config: config.system.build.manual.manualEpub));
manpages = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.manpages);
manualGeneratedSources = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.generatedSources);
options = (buildFromConfig ({ ... }: { }) (config: config.system.build.manual.optionsJSON)).x86_64-linux;

View File

@@ -291,7 +291,7 @@ in {
hledger-web = handleTest ./hledger-web.nix {};
hocker-fetchdocker = handleTest ./hocker-fetchdocker {};
hockeypuck = handleTest ./hockeypuck.nix { };
home-assistant = handleTest ./home-assistant {};
home-assistant = handleTest ./home-assistant.nix {};
hostname = handleTest ./hostname.nix {};
hound = handleTest ./hound.nix {};
hub = handleTest ./git/hub.nix {};

View File

@@ -1,16 +1,12 @@
import ../make-test-python.nix ({ pkgs, lib, ... }:
import ./make-test-python.nix ({ pkgs, lib, ... }:
let
configDir = "/var/lib/foobar";
userName = "admin";
password = "secret";
in {
name = "home-assistant";
meta.maintainers = lib.teams.home-assistant.members;
nodes.hass = { pkgs, ... }: {
virtualisation.memorySize = 1024;
services.postgresql = {
enable = true;
ensureDatabases = [ "hass" ];
@@ -31,10 +27,7 @@ in {
extraPackages = ps: with ps; [
colorama
];
extraComponents = [
"met"
"radio_browser"
];
extraComponents = [ "zha" ];
}).overrideAttrs (oldAttrs: {
doInstallCheck = false;
});
@@ -86,7 +79,6 @@ in {
# https://www.home-assistant.io/integrations/logger/
logger = {
default = "info";
logs."homeassistant.components.http" = "debug";
};
};
@@ -116,22 +108,6 @@ in {
inheritParentConfig = true;
configuration.services.home-assistant.config.esphome = {};
};
environment.systemPackages = let
testRunner = pkgs.writers.writePython3Bin "test-runner" {
libraries = with pkgs.python3Packages; [
selenium
structlog
];
flakeIgnore = [
"E501" # line too long
];
} (builtins.readFile ./webdriver.py);
in with pkgs; [
chromium
chromedriver
testRunner
];
};
testScript = { nodes, ... }: let
@@ -174,7 +150,7 @@ in {
with subtest("Check extraComponents and extraPackages are considered from the package"):
hass.succeed(f"grep -q 'colorama' {package}/extra_packages")
hass.succeed(f"grep -q 'radio_browser' {package}/extra_components")
hass.succeed(f"grep -q 'zha' {package}/extra_components")
with subtest("Check extraComponents and extraPackages are considered from the module"):
hass.succeed(f"grep -q 'psycopg2' {package}/extra_packages")
@@ -216,11 +192,5 @@ in {
with subtest("Check systemd unit hardening"):
hass.log(hass.succeed("systemctl cat home-assistant.service"))
hass.log(hass.succeed("systemd-analyze security home-assistant.service"))
with subtest("Test onboarding"):
hass.execute(
"systemd-run --wait --unit hass-onboarding -E PATH=${pkgs.geckodriver}/bin:$PATH -E PYTHONUNBUFFERED=1 test-runner"
)
hass.copy_from_vm("/run/artifacts")
'';
})

View File

@@ -1,252 +0,0 @@
from dataclasses import dataclass
from os import mkdir
import os.path
import time
from typing import Set
import structlog
from structlog.contextvars import bind_contextvars, reset_contextvars
# shadow root support only in chromium based browsers as of selenium 4.8.0
# https://github.com/SeleniumHQ/selenium/blob/selenium-4.8.0/py/selenium/webdriver/remote/webelement.py#L245-L248
from selenium.webdriver import Chrome
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.alert import Alert
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
log = structlog.get_logger()
# encapsulate selectors to find html elements
@dataclass
class S:
by: By
value: str
# retrieve the shadow dom of the tag
shadow_root: bool = False
# retrieve all matching tags
multiple: bool = False
# helper function to navigate through nested shadow roots
def select(*selectors: S, origin):
doc = origin
for sel in selectors:
if sel.multiple:
if isinstance(doc, list):
raise RuntimeError(
"The multiple qualifier can only appear once in a selection group"
)
else:
doc = doc.find_elements(sel.by, sel.value)
if sel.shadow_root:
doc = [x.shadow_root for x in doc]
else:
if isinstance(doc, list):
doc = [x.find_element(sel.by, sel.value) for x in doc]
if sel.shadow_root:
doc = [x.shadow_root for x in doc]
else:
doc = doc.find_element(sel.by, sel.value)
if sel.shadow_root:
doc = doc.shadow_root
return doc
# Custom wait implementation for nested elements
class NestedElementPresent:
def __init__(self, *selectors: S):
self.selectors = selectors
def __call__(self, driver):
result = select(*self.selectors, origin=driver)
return result
def write(input, value: str, field_name: str):
input.click()
# input.clear() does not work properly :(
for _ in range(16):
input.send_keys(Keys.BACKSPACE)
input.send_keys(value)
log.info(f"Set {field_name}", value=value)
ARTIFACT_PATH = "/run/artifacts"
mkdir(ARTIFACT_PATH)
options = Options()
options.add_argument("--headless")
options.add_argument("--no-sandbox") # run as root
options.binary_location = "/run/current-system/sw/bin/chromium"
driver = Chrome(
options=options,
)
wait = WebDriverWait(driver, 10)
# increase viewport, so everything becomes visible w/o scrolling
driver.set_window_size(720, 1280)
def onboarding():
# wait for the site to load
url = "http://localhost:8123/onboarding.html"
log.info("Loading", url=url)
driver.get(url)
wait.until(EC.title_contains("Home Assistant"))
log.info("Ready", url=url)
# move the viewport around to trigger a redraw
body = driver.find_element(By.TAG_NAME, "body")
body.send_keys(Keys.SPACE)
body.send_keys(Keys.SHIFT + Keys.SPACE)
onboarding_step_user()
onboarding_step_core_config()
onboarding_step_analytics()
@dataclass
class Credentials:
username: str
password: str
def onboarding_step_user() -> Credentials:
ctx = bind_contextvars(step="user")
# wait until the page is rendered
log.info("Waiting for onboarding-create-user")
onboarding_create_user = wait.until(
NestedElementPresent(
S(By.CSS_SELECTOR, "ha-onboarding", shadow_root=True),
S(By.CSS_SELECTOR, "onboarding-create-user", shadow_root=True),
)
)
log.info("Found onboarding-create-user", tag=onboarding_create_user)
driver.save_screenshot(os.path.join(ARTIFACT_PATH, "onboarding_step1.png"))
name, username, password, confirm = select(
S(By.CSS_SELECTOR, "ha-form", shadow_root=True),
S(By.CSS_SELECTOR, "ha-selector", shadow_root=True, multiple=True),
S(By.CSS_SELECTOR, "ha-selector-text", shadow_root=True),
S(By.CSS_SELECTOR, "ha-textfield", shadow_root=True),
S(By.CSS_SELECTOR, "input.mdc-text-field__input"),
origin=onboarding_create_user,
)
creds = Credentials("nixos", "test")
write(name, creds.username, "Name")
write(username, "NixOS Testuser", "Username")
write(password, creds.password, "Password")
write(confirm, creds.password, "Confirm password")
driver.save_screenshot(
os.path.join(ARTIFACT_PATH, "onboarding_step1_logindata.png")
)
log.info("Submit")
select(
S(By.CSS_SELECTOR, "mwc-button"), origin=onboarding_create_user
).click()
reset_contextvars(**ctx)
return creds
def onboarding_step_core_config():
ctx = bind_contextvars(step="core_config")
# wait until the page is rendered
log.info("Waiting for onboarding-create-user")
onboarding_core_config = wait.until(
NestedElementPresent(
S(By.CSS_SELECTOR, "ha-onboarding", shadow_root=True),
S(By.CSS_SELECTOR, "onboarding-core-config", shadow_root=True),
)
)
log.info("Found onboarding-core-config")
driver.save_screenshot(os.path.join(ARTIFACT_PATH, "onboarding_step2.png"))
# set home name
home = select(
S(By.CSS_SELECTOR, "ha-textfield", shadow_root=True),
S(By.CSS_SELECTOR, "input"),
origin=onboarding_core_config,
)
write(home, "NixOS Testdriver", "Installation name")
# try environment detection, will fail and only set language to "en"
select(
S(By.CSS_SELECTOR, "div.middle-text mwc-button"), origin=onboarding_core_config
).click()
log.info("Detect environment")
driver.save_screenshot(os.path.join(ARTIFACT_PATH, "onboarding_step2_detect.png"))
map_marker = select(
S(By.CSS_SELECTOR, "ha-locations-editor", shadow_root=True),
S(By.CSS_SELECTOR, "ha-map", shadow_root=True),
S(By.CSS_SELECTOR, "div.leaflet-marker-pane img"),
origin=onboarding_core_config
)
log.info("Found leaflet-marker-pane", tag=map_marker)
ActionChains(driver).click().click_and_hold().move_by_offset(100, 100).release().perform()
log.info("Moved location marker")
country, lang, tz, elevation, currency = select(
S(By.CSS_SELECTOR, "div.row ha-textfield", shadow_root=True, multiple=True),
S(By.CSS_SELECTOR, "input"),
origin=onboarding_core_config,
)
write(country, "DE", "Country")
print(tz.tag_name)
write(tz, "UTC", "Time Zone")
write(elevation, "123", "Elevation")
write(currency, "EUR", "Currency")
driver.save_screenshot(os.path.join(ARTIFACT_PATH, "onboarding_step2_inputs.png"))
log.info("Submit")
select(
S(By.CSS_SELECTOR, "div.footer mwc-button"), origin=onboarding_core_config
).click()
Alert(driver).accept()
driver.save_screenshot(os.path.join(ARTIFACT_PATH, "onboarding_step2_submit.png"))
reset_contextvars(**ctx)
def onboarding_step_analytics():
ctx = bind_contextvars(step="analytics")
# wait until the page is rendered
log.info("Waiting for onboarding-analytics")
onboarding_analytics = wait.until(
NestedElementPresent(
S(By.CSS_SELECTOR, "ha-onboarding", shadow_root=True),
S(By.CSS_SELECTOR, "onboarding-analytics", shadow_root=True),
)
)
log.info("Found onboarding-analytics", tag=onboarding_analytics)
driver.save_screenshot(os.path.join(ARTIFACT_PATH, "onboarding_step3.png"))
onboarding()
driver.close()
print("close")

View File

@@ -9,7 +9,6 @@ import ./make-test-python.nix ({ pkgs, ... }: {
hostname = "server";
primaryDomain = "server";
openFirewall = true;
ensureAccounts = [ "postmaster@server" ];
};
};
@@ -51,6 +50,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
server.wait_for_open_port(587)
server.succeed("maddyctl creds create --password test postmaster@server")
server.succeed("maddyctl imap-acct create postmaster@server")
client.succeed("send-testmail")
client.succeed("test-imap")

View File

@@ -1,6 +1,6 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "pass-secret-service";
meta.maintainers = [ lib.maintainers.aidalgol ];
meta.maintainers = with lib; [ aidalgol ];
nodes.machine = { nodes, pkgs, ... }:
{

View File

@@ -1,4 +1,4 @@
import ./make-test-python.nix ({ pkgs, lib, ...} :
import ./make-test-python.nix ({ pkgs, ...} :
let
@@ -11,9 +11,9 @@ let
};
# Only allow the demo data to be used (only if it's unfreeRedistributable).
unfreePredicate = pkg: with lib; let
unfreePredicate = pkg: with pkgs.lib; let
allowPackageNames = [ "quake3-demodata" "quake3-pointrelease" ];
allowLicenses = [ lib.licenses.unfreeRedistributable ];
allowLicenses = [ pkgs.lib.licenses.unfreeRedistributable ];
in elem pkg.pname allowPackageNames &&
elem (pkg.meta.license or null) allowLicenses;
@@ -31,7 +31,7 @@ in
rec {
name = "quake3";
meta = with lib.maintainers; {
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ domenkozar eelco ];
};

View File

@@ -52,6 +52,9 @@ let
};
};
boot.initrd.systemd.enable = true;
boot.initrd.systemd.repart.enable = true;
# systemd-repart operates on disks with a partition table. The qemu module,
# however, creates separate filesystem images without a partition table, so
# we have to create a disk image manually.
@@ -85,10 +88,7 @@ in
nodes.machine = { config, pkgs, ... }: {
imports = [ common ];
boot.initrd.systemd.enable = true;
boot.initrd.systemd.repart.enable = true;
systemd.repart.partitions = {
boot.initrd.systemd.repart.partitions = {
"10-root" = {
Type = "linux-generic";
};
@@ -105,30 +105,4 @@ in
assert "Growing existing partition 1." in systemd_repart_logs
'';
};
after-initrd = makeTest {
name = "systemd-repart-after-initrd";
meta.maintainers = with maintainers; [ nikstur ];
nodes.machine = { config, pkgs, ... }: {
imports = [ common ];
systemd.repart.enable = true;
systemd.repart.partitions = {
"10-root" = {
Type = "linux-generic";
};
};
};
testScript = { nodes, ... }: ''
${useDiskImage nodes.machine}
machine.start()
machine.wait_for_unit("multi-user.target")
systemd_repart_logs = machine.succeed("journalctl --unit systemd-repart.service")
assert "Growing existing partition 1." in systemd_repart_logs
'';
};
}

View File

@@ -19,20 +19,20 @@
stdenv.mkDerivation rec {
pname = "amberol";
version = "unstable-2023-01-12";
version = "0.9.2";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "World";
repo = pname;
rev = "0623386c813d0d68564002324958cef7217cec7f";
hash = "sha256-nVL4ydTg4ncDCA9J9qWv+RPDC0Txr/qpo5XxIUiV0zQ=";
rev = version;
hash = "sha256-L8yHKwtCAZC1myIouL0Oq3lj0QPWn5dVe0g3nkyAKI8=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-E0ivUWD3jP/T1GOJ11grDwcF+m92I+W2a2HhZX1bCso=";
hash = "sha256-0XuWBUG37GNHRXgjz0/Vv6VSqaPG36xTj7oN0ukFIJY=";
};
postPatch = ''

View File

@@ -1,6 +1,6 @@
{ stdenv
, lib
, fetchFromGitLab
, fetchFromGitHub
, meson
, ninja
, pkg-config
@@ -18,15 +18,14 @@
python3Packages.buildPythonApplication rec {
pname = "eartag";
version = "0.3.2";
version = "0.3.1";
format = "other";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
src = fetchFromGitHub {
owner = "knuxify";
repo = pname;
rev = version;
sha256 = "sha256-XvbfQtE8LsztQ2VByG2jLYND3qVpH6owdAgh3b//lI4=";
rev = "refs/tags/${version}";
sha256 = "sha256-gN3V5ZHlhHp52Jg/i+hDLEDpSvP8yFngujyw5ZncQQg=";
};
postPatch = ''
@@ -68,7 +67,7 @@ python3Packages.buildPythonApplication rec {
'';
meta = with lib; {
homepage = "https://gitlab.gnome.org/knuxify/eartag";
homepage = "https://github.com/knuxify/eartag";
description = "Simple music tag editor";
# This seems to be using ICU license but we're flagging it to MIT license
# since ICU license is a modified version of MIT and to prevent it from

View File

@@ -12,13 +12,13 @@
stdenv.mkDerivation rec {
pname = "gwc";
version = "0.22-06";
version = "0.22-05";
src = fetchFromGitHub {
owner = "AlisterH";
repo = pname;
rev = version;
sha256 = "sha256-hRwy++gZiW/olIIeiVTpdIjPLIHgvgVUGEaUX9tpFbY=";
sha256 = "sha256-FHKu5qAyRyMxXdWYTCeAc6Q4J+NOaU1SGgoTbe0PiFE=";
};
nativeBuildInputs = [
@@ -40,7 +40,6 @@ stdenv.mkDerivation rec {
meta = with lib; {
description = "GUI application for removing noise (hiss, pops and clicks) from audio files";
homepage = "https://github.com/AlisterH/gwc/";
changelog = "https://github.com/AlisterH/gwc/blob/${version}/Changelog";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ magnetophon ];
platforms = platforms.linux;

View File

@@ -6,14 +6,14 @@
python3.pkgs.buildPythonApplication rec {
pname = "pianotrans";
version = "1.0.1";
version = "1.0";
format = "setuptools";
src = fetchFromGitHub {
owner = "azuwis";
repo = pname;
rev = "v${version}";
hash = "sha256-gRbyUQmPtGvx5QKAyrmeJl0stp7hwLBWwjSbJajihdE=";
hash = "sha256-6Otup1Yat1dBZdSoR4lDfpytUQ2RbDXC6ieo835Nw+U=";
};
propagatedBuildInputs = with python3.pkgs; [

View File

@@ -25,13 +25,13 @@
stdenv.mkDerivation rec {
pname = "tauon";
version = "7.5.0";
version = "7.4.7";
src = fetchFromGitHub {
owner = "Taiko2k";
repo = "TauonMusicBox";
rev = "v${version}";
hash = "sha256-9/mzh8lRBjd7d9oEyG1XGWmOdgPEFCVjHZxDnAhYDwc=";
sha256 = "sha256-WUHMXsbnNaDlV/5bCOPMadJKWoF5i2UlFf9fcX6GCZ0=";
};
postUnpack = ''

View File

@@ -6,13 +6,13 @@
buildDotnetModule rec {
pname = "btcpayserver";
version = "1.7.12";
version = "1.7.7";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "sha256-NRmpKr0lqe2NUlpyzkdtn7nN0rFrZakryNR1WAOzx9Q=";
sha256 = "sha256-bflQsVaCwV5zaU5k46wFQ45dIOg3dHmYfBVQHyw+EpM=";
};
projectFile = "BTCPayServer/BTCPayServer.csproj";

View File

@@ -2,11 +2,11 @@
let
pname = "ledger-live-desktop";
version = "2.53.2";
version = "2.51.0";
src = fetchurl {
url = "https://download.live.ledger.com/${pname}-${version}-linux-x86_64.AppImage";
hash = "sha256-RGeJWUMZagXM/8SHHOpTpcnsz+BShnGp2yvt31qo5lI=";
hash = "sha256-qpgzGJsj7hrrK2i+xP0T+hcw7WMlGBILbHVJBHD5duo=";
};
appimageContents = appimageTools.extractType2 {

View File

@@ -6,13 +6,13 @@
buildDotnetModule rec {
pname = "nbxplorer";
version = "2.3.62";
version = "2.3.60";
src = fetchFromGitHub {
owner = "dgarage";
repo = "NBXplorer";
rev = "v${version}";
sha256 = "sha256-FpAMkVgvl0SxJ59FjL4H3Fvqb1LKsET2I+A01TQlvFA=";
sha256 = "sha256-YUZvTs77dGhG7dpxbQyGhrOMMx+8LotdMJflPflMDAE=";
};
projectFile = "NBXplorer/NBXplorer.csproj";

File diff suppressed because it is too large Load Diff

View File

@@ -115,12 +115,12 @@
};
c_sharp = buildGrammar {
language = "c_sharp";
version = "5b6c4d0";
version = "18e4343";
src = fetchFromGitHub {
owner = "tree-sitter";
repo = "tree-sitter-c-sharp";
rev = "5b6c4d0d19d79b05c69ad752e11829910e3b4610";
hash = "sha256-Ax9AuxqQK9gSlkxM2k6E32CskudUmduWm0luC031P5U=";
rev = "18e434383a4582b4fd183a30e55022c2923764e1";
hash = "sha256-ggvCj2yGDINuGr8Jb+aOoRxlKa5LaXCoiQC/Y5Hrcn0=";
};
meta.homepage = "https://github.com/tree-sitter/tree-sitter-c-sharp";
};
@@ -426,12 +426,12 @@
};
fortran = buildGrammar {
language = "fortran";
version = "dd35c67";
version = "069bd7c";
src = fetchFromGitHub {
owner = "stadelmanma";
repo = "tree-sitter-fortran";
rev = "dd35c67b1653963d3b4cca7bfbceb6ec2e6f006f";
hash = "sha256-AVImNPg2d/vavpg+IBholzKiH8Hod4m7V3aJxWTnMKk=";
rev = "069bd7c864fe2dee1115140cc2621d140b16a643";
hash = "sha256-edvAcXKoVHIpOpVPROA9l97B4tFfuJYbjcSy9oE/dzw=";
};
meta.homepage = "https://github.com/stadelmanma/tree-sitter-fortran";
};
@@ -481,12 +481,12 @@
};
git_rebase = buildGrammar {
language = "git_rebase";
version = "d8a4207";
version = "127f5b5";
src = fetchFromGitHub {
owner = "the-mikedavis";
repo = "tree-sitter-git-rebase";
rev = "d8a4207ebbc47bd78bacdf48f883db58283f9fd8";
hash = "sha256-mbRu2+wZVf5Nk3XlFvLSBOUg2QqmCR2tqO7gLpOJ45k=";
rev = "127f5b56c1ad3e8a449a7d6e0c7412ead7f7724c";
hash = "sha256-4XGQTrflV+txVjXbgaQSd6rFES8TkuiXEurJLBdg59E=";
};
meta.homepage = "https://github.com/the-mikedavis/tree-sitter-git-rebase";
};
@@ -593,12 +593,12 @@
};
gosum = buildGrammar {
language = "gosum";
version = "bd0ec1f";
version = "68974b6";
src = fetchFromGitHub {
owner = "amaanq";
repo = "tree-sitter-go-sum";
rev = "bd0ec1fe9d68a5d4713d907417a43d489fa1b62a";
hash = "sha256-BFwYKVbCBCC2ZvockKqiVFHOlTc3/YFIaZ2OqkO52yY=";
rev = "68974b63c19dc6e27214a5c76b6e26c0c40fe5b7";
hash = "sha256-Avk9nAICwy59VYIlLhp9FkozAna9kMwY60pAqKyJsK4=";
};
meta.homepage = "https://github.com/amaanq/tree-sitter-go-sum";
};
@@ -901,12 +901,12 @@
};
ledger = buildGrammar {
language = "ledger";
version = "f787ae6";
version = "47b8971";
src = fetchFromGitHub {
owner = "cbarrete";
repo = "tree-sitter-ledger";
rev = "f787ae635ca79589faa25477b94291a87e2d3e23";
hash = "sha256-9Sc22IYWhUUzCslna3mzePd7bRbtWDwiWKvAzLYubOQ=";
rev = "47b8971448ce5e9abac865f450c1b14fb3b6eee9";
hash = "sha256-Doz561oVrWkmUAL3VUTjraO+F0aDuahhBB+xXevTrkg=";
};
meta.homepage = "https://github.com/cbarrete/tree-sitter-ledger";
};
@@ -1445,12 +1445,12 @@
};
sql = buildGrammar {
language = "sql";
version = "0d7a121";
version = "7be06f4";
src = fetchFromGitHub {
owner = "derekstride";
repo = "tree-sitter-sql";
rev = "0d7a121b2a08fb37109f7be1cc6654443cad661f";
hash = "sha256-b3HtiAoknPgmivnN/GVHcFHbAgl1an41iSS13wTFyGA=";
rev = "7be06f4d5eabace883dd45959c13dc740f1f1b98";
hash = "sha256-Hi/4/Aou85MYCMMFqf5xqAyKECTzfeiaksJxdv9MVCU=";
};
generate = true;
meta.homepage = "https://github.com/derekstride/tree-sitter-sql";
@@ -1549,12 +1549,12 @@
};
thrift = buildGrammar {
language = "thrift";
version = "c5a9454";
version = "d1f350b";
src = fetchFromGitHub {
owner = "duskmoon314";
repo = "tree-sitter-thrift";
rev = "c5a94547f01eb51b26446f9b94ee8644fa791223";
hash = "sha256-2RNS0raJ0sEbBECwtI8hMG4Dir8KAx9PENwlRb7lY8o=";
rev = "d1f350b19dd70ccdbd6d565dbea4879e4cef03da";
hash = "sha256-RxrusaDiDjs25EcyrcnnjJIaeZaZhQdcxOWwtZ8Xe0U=";
};
meta.homepage = "https://github.com/duskmoon314/tree-sitter-thrift";
};

View File

@@ -531,7 +531,6 @@ https://github.com/smiteshp/nvim-navic/,HEAD,
https://github.com/AckslD/nvim-neoclip.lua/,,
https://github.com/yamatsum/nvim-nonicons/,,
https://github.com/rcarriga/nvim-notify/,,
https://github.com/LhKipp/nvim-nu/,HEAD,
https://github.com/ojroques/nvim-osc52/,,
https://github.com/gennaro-tedesco/nvim-peekup/,,
https://github.com/olrtg/nvim-rename-state/,HEAD,
@@ -581,7 +580,6 @@ https://github.com/NLKNguyen/papercolor-theme/,,
https://github.com/tmsvg/pear-tree/,,
https://github.com/steelsojka/pears.nvim/,,
https://github.com/andsild/peskcolor.vim/,,
https://github.com/pest-parser/pest.vim/,HEAD,
https://github.com/lifepillar/pgsql.vim/,,
https://github.com/motus/pig.vim/,,
https://github.com/aklt/plantuml-syntax/,,

View File

@@ -31,13 +31,13 @@
stdenv.mkDerivation rec {
pname = "cemu";
version = "2.0-26";
version = "2.0-22";
src = fetchFromGitHub {
owner = "cemu-project";
repo = "Cemu";
rev = "v${version}";
hash = "sha256-+y+PJE2biRvuxIwrFVMjmkZyD8/zhHVMw6vzNKlsOZE=";
hash = "sha256-ZQfJHQnT5mV6GC3dO6QV1fGsnyZMYqXiVdBSsimL5yU=";
};
patches = [

View File

@@ -5,36 +5,25 @@
, pkg-config
, makeWrapper
, alsa-lib
, curl
, egl-wayland
, libao
, libdecor
, libevdev
, libffi
, libGL
, libpulseaudio
, libX11
, libXext
, libxkbcommon
, libzip
, mesa
, miniupnpc
, libevdev
, udev
, vulkan-headers
, libpulseaudio
, SDL2
, libzip
, miniupnpc
, vulkan-loader
, wayland
, zlib
}:
stdenv.mkDerivation rec {
pname = "flycast";
version = "2.1";
version = "2.0";
src = fetchFromGitHub {
owner = "flyinghead";
repo = "flycast";
rev = "V${version}";
sha256 = "sha256-PRInOqg9OpaUVLwSj1lOxDtjpVaYehkRsp0jLrVKPyY=";
rev = "v${version}";
sha256 = "sha256-vSyLg2lAJBV7crKVbGRbi1PUuCwHF9GB/8pjMTlaigA=";
fetchSubmodules = true;
};
@@ -46,24 +35,13 @@ stdenv.mkDerivation rec {
buildInputs = [
alsa-lib
curl
egl-wayland
libao
libdecor
libevdev
libffi
libGL
libpulseaudio
libX11
libXext
libxkbcommon
libzip
mesa # for libgbm
miniupnpc
libevdev
udev
vulkan-headers
wayland
zlib
libpulseaudio
SDL2
libzip
miniupnpc
];
postFixup = ''

View File

@@ -1,131 +0,0 @@
{ stdenv
, fetchFromGitHub
, lib
, makeDesktopItem
, copyDesktopItems
, pkg-config
, python3
, ninja
, meson
, which
, perl
, wrapGAppsHook
, glib
, gtk3
, libpcap
, openssl
, libepoxy
, libsamplerate
, SDL2
, SDL2_image
, mesa
, libdrm
, libGLU
, gettext
, vte
}:
stdenv.mkDerivation rec {
pname = "xemu";
version = "0.7.84";
src = fetchFromGitHub {
owner = "xemu-project";
repo = "xemu";
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-pEXjwoQKbMmVNYCnh5nqP7k0acYOAp8SqxYZwPzVwDY=";
};
nativeBuildInputs = [
pkg-config
python3
python3.pkgs.pyyaml
ninja
which
meson
perl
wrapGAppsHook
copyDesktopItems
];
buildInputs = [
glib
gtk3
openssl
mesa
libepoxy
libdrm
libpcap
libsamplerate
SDL2
libGLU
SDL2_image
gettext
vte
];
separateDebugInfo = true;
dontUseMesonConfigure = true;
setOutputFlags = false;
configureFlags = [
"--disable-strip"
"--meson=meson"
"--target-list=i386-softmmu"
"--disable-werror"
];
buildFlags = [ "qemu-system-i386" ];
desktopItems = [(makeDesktopItem {
name = "xemu";
desktopName = "xemu";
exec = "xemu";
icon = "xemu";
})] ;
preConfigure = let
branch = "master";
commit = "d8fa50e524c22f85ecb2e43108fd6a5501744351";
in ''
patchShebangs .
configureFlagsArray+=("--extra-cflags=-DXBOX=1 -Wno-error=redundant-decls")
substituteInPlace ./scripts/xemu-version.sh \
--replace 'date -u' "date -d @$SOURCE_DATE_EPOCH '+%Y-%m-%d %H:%M:%S'"
# If the versions can't be obtained through git, the build process tries
# to run `XEMU_COMMIT=$(cat XEMU_COMMIT)` (and similar)
echo '${commit}' > XEMU_COMMIT
echo '${branch}' > XEMU_BRANCH
echo '${version}' > XEMU_VERSION
'';
preBuild = ''
cd build
substituteInPlace ./build.ninja --replace /usr/bin/env $(which env)
'';
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,share}
cp qemu-system-i386 $out/bin/xemu
for RES in 16x16 24x24 32x32 48x48 128x128 256x256 512x512
do
mkdir -p $out/share/icons/hicolor/$RES/apps/
cp ../ui/icons/xemu_$RES.png $out/share/icons/hicolor/$RES/apps/xemu.png
done
runHook postInstall
'';
meta = with lib; {
homepage = "https://xemu.app/";
description = "Original Xbox emulator";
maintainers = with maintainers; [ ];
license = licenses.gpl2Plus;
};
}

View File

@@ -95,8 +95,6 @@ stdenv.mkDerivation rec {
runHook postInstall
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
homepage = "https://hexler.net/kodelife";
description = "Real-time GPU shader editor";

View File

@@ -1,54 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix curl libxml2 jq
set -euo pipefail
nixpkgs="$(git rev-parse --show-toplevel || (printf 'Could not find root of nixpkgs repo\nAre we running from within the nixpkgs git repo?\n' >&2; exit 1))"
attr="${UPDATE_NIX_ATTR_PATH:-kodelife}"
version="$(curl -sSL https://hexler.net/kodelife/appcast/linux | xmllint --xpath '/rss/channel/item/enclosure/@*[local-name()="version"]' - | cut -d= -f2- | tr -d '"' | head -n1)"
narhash() {
nix --extra-experimental-features nix-command store prefetch-file --json "$url" | jq -r .hash
}
nixeval() {
if [ "$#" -ge 2 ]; then
systemargs=(--argstr system "$2")
else
systemargs=()
fi
nix --extra-experimental-features nix-command eval --json --impure "${systemargs[@]}" -f "$nixpkgs" "$1" | jq -r .
}
findpath() {
path="$(nix --extra-experimental-features nix-command eval --json --impure -f "$nixpkgs" "$1.meta.position" | jq -r . | cut -d: -f1)"
outpath="$(nix --extra-experimental-features nix-command eval --json --impure --expr "builtins.fetchGit \"$nixpkgs\"")"
if [ -n "$outpath" ]; then
path="${path/$(echo "$outpath" | jq -r .)/$nixpkgs}"
fi
echo "$path"
}
oldversion="${UPDATE_NIX_OLD_VERSION:-$(nixeval "$attr".version)}"
pkgpath="$(findpath "$attr")"
if [ "$version" = "$oldversion" ]; then
echo 'update.sh: New version same as old version, nothing to do.'
exit 0
fi
sed -i -e "/version\s*=/ s|\"$oldversion\"|\"$version\"|" "$pkgpath"
for system in aarch64-linux armv7l-linux x86_64-linux; do
url="$(nixeval "$attr".src.url "$system")"
curhash="$(nixeval "$attr".src.outputHash "$system")"
newhash="$(narhash "$url")"
sed -i -e "s|\"$curhash\"|\"$newhash\"|" "$pkgpath"
done

View File

@@ -1,104 +0,0 @@
{ stdenv
, lib
, fetchFromGitHub
, jdk11
, makeDesktopItem
, makeWrapper
, copyDesktopItems
}:
stdenv.mkDerivation rec {
pname = "structorizer";
version = "3.32-11";
desktopItems = [
(makeDesktopItem {
type = "Application";
name = "Structorizer";
desktopName = "Structorizer";
genericName = "Diagram creator";
comment = meta.description;
icon = pname;
exec = pname;
terminal = false;
mimeTypes = [ "application/nsd" ];
categories = [
"Development"
"Graphics"
"VectorGraphics"
"RasterGraphics"
"ComputerScience"
];
keywords = [ "nsd" "diagrams" ];
})
];
src = fetchFromGitHub {
owner = "fesch";
repo = "Structorizer.Desktop";
rev = version;
hash = "sha256-rGyeOcGm6uBplgTjMIOy/xRekfHacwDy9kkMigmRSdk=";
};
patches = [ ./makeStructorizer.patch ./makeBigJar.patch ];
strictDeps = true;
nativeBuildInputs = [ jdk11 makeWrapper copyDesktopItems ];
buildInputs = [ jdk11 ];
postPatch = ''
chmod +x makeStructorizer
chmod +x makeBigJar
patchShebangs --build makeStructorizer
patchShebangs --build makeBigJar
'';
buildPhase = ''
runHook preBuild
./makeStructorizer
./makeBigJar
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -d $out/bin $out/share/mime/packages
install -D ${pname}.jar -t $out/share/java/
makeWrapper ${jdk11}/bin/java $out/bin/${pname} \
--add-flags "-jar $out/share/java/${pname}.jar"
cat << EOF > $out/share/mime/packages/structorizer.xml
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/nsd">
<comment xml:lang="en">Nassi-Shneiderman diagram</comment>
<comment xml:lang="de">Nassi-Shneiderman-Diagramm</comment>
<glob pattern="*.nsd"/>
</mime-type>
</mime-info>
EOF
cd src/lu/fisch/${pname}/gui
install -vD icons/000_${pname}.png $out/share/icons/hicolor/16x16/apps/${pname}.png
for icon_width in 24 32 48 64 128 256; do
install -vD icons_"$icon_width"/000_${pname}.png $out/share/icons/hicolor/"$icon_width"x"$icon_width"/apps/${pname}.png
done
runHook postInstall
'';
meta = with lib; {
description = "Create Nassi-Shneiderman diagrams (NSD)";
homepage = "https://structorizer.fisch.lu";
license = licenses.gpl3Plus;
platforms = platforms.all;
maintainers = with maintainers; [ annaaurora ];
};
}

View File

@@ -1,31 +0,0 @@
Reason: Running the program in a headless environment fails. Besides, tests should be conducted in passthru.tests anyway. There is also no AppleStructorizerApplication.class, only the jar.
diff --git a/makeBigJar b/makeBigJar
index 25547020..c34d0d9c 100644
--- a/makeBigJar
+++ b/makeBigJar
@@ -75,9 +75,8 @@ jars="bsh-2.1.0 \
freehep-xml-2.1.1 \
freehep"
-# Apple specific stuff is only used if it exists and the compiled class is available
-if test -f ../bin/lu/fisch/structorizer/application/AppleStructorizerApplication.class -a \
- -f AppleJavaExtensions.jar; then
+# Apple specific stuff is only used if the jar is available
+if test -f lib/AppleJavaExtensions.jar; then
jars="$jars AppleJavaExtensions"
fi
@@ -114,12 +113,3 @@ echo "Done"
# remove the jar-directory
rm -R jar/
-if test -n "$start_compiled"; then
- # execute the archive
- echo; echo "Running Structorizer from all-in-one jar"
- if test "$start_compiled" = "s"; then
- java -jar structorizer.jar
- else
- java -jar structorizer.jar &
- fi
-fi # start block end

View File

@@ -1,54 +0,0 @@
Reason: There is no StructorizerApplet.java anywhere in the source, no .cgt files and running the program in a headless environment fails. Besides, tests should be conducted in passthru.tests anyway. There is also no AppleStructorizerApplication.java, only the jar.
diff --git a/makeStructorizer b/makeStructorizer
index 99a5e8d3..e954be13 100644
--- a/makeStructorizer
+++ b/makeStructorizer
@@ -117,18 +117,6 @@ echo "Done"
echo; echo "Compiling Structorizer..."
javac $str_javac_opts -classpath "$str_classpath" Structorizer.java
echo "Done"
-echo; echo "Compiling Structorizer Applet..."
-javac $str_javac_opts -classpath "$str_classpath" StructorizerApplet.java
-echo "Done"
-
-# OS specific classes
-if test -n "$do_apple"; then
- echo; echo "Compiling Apple specific code..."
- javac $str_javac_opts -classpath "$str_classpath" lu/fisch/structorizer/application/AppleStructorizerApplication.java
- echo "Done"
-else
- echo; echo "Apple specific code skipped"
-fi
# copying some other files to binary tree
echo; echo "Copying resources..."
@@ -147,7 +135,6 @@ cp lu/fisch/structorizer/gui/*.txt ../bin/lu/fisch/structorizer/gui/
cp lu/fisch/structorizer/gui/*.xml ../bin/lu/fisch/structorizer/gui/
cp lu/fisch/structorizer/locales/*.txt ../bin/lu/fisch/structorizer/locales/
cp lu/fisch/structorizer/generators/*.txt ../bin/lu/fisch/structorizer/generators/
-cp lu/fisch/structorizer/parsers/*.cgt ../bin/lu/fisch/structorizer/parsers/
cp lu/fisch/structorizer/parsers/*.egt ../bin/lu/fisch/structorizer/parsers/
cp lu/fisch/structorizer/parsers/*.grm ../bin/lu/fisch/structorizer/parsers/
cp lu/fisch/structorizer/parsers/*.xsd ../bin/lu/fisch/structorizer/parsers/
@@ -155,20 +142,5 @@ cp lu/fisch/structorizer/parsers/*.nsd ../bin/lu/fisch/structorizer/parsers/
cp lu/fisch/structorizer/*.properties ../bin/lu/fisch/structorizer/
echo "Done"
-if test -n "$start_compiled"; then
-
- # changing into binary directory
- cd ../bin/
-
- # run the application
- echo; echo "Running Structorizer from compiled class files"
- if test "$start_compiled" = "s"; then
- java -cp $str_classpath Structorizer
- else
- java -cp $str_classpath Structorizer &
- fi
-
-fi # start block end
-
# move back into the folder where we started
popd >/dev/null

View File

@@ -15,13 +15,13 @@
stdenv.mkDerivation rec {
pname = "iptsd";
version = "1.1.0";
version = "1.0.1";
src = fetchFromGitHub {
owner = "linux-surface";
repo = pname;
rev = "v${version}";
hash = "sha256-PpnMslZ1AKT1OEWXh23uH83FnZGLTrgIc2jZspJa8sk=";
hash = "sha256-B5d1OjrRB164BYtFzZoZ3I4elZSKpHg0PCBiwXPnqLs=";
};
nativeBuildInputs = [

View File

@@ -1,59 +0,0 @@
{ lib
, stdenv
, fetchFromGitLab
, fetchpatch
, qtbase
, openrgb
, glib
, openal
, qmake
, pkg-config
, wrapQtAppsHook
}:
stdenv.mkDerivation rec {
pname = "openrgb-plugin-effects";
version = "0.8";
src = fetchFromGitLab {
owner = "OpenRGBDevelopers";
repo = "OpenRGBEffectsPlugin";
rev = "release_${version}";
hash = "sha256-2F6yeLWgR0wCwIj75+d1Vdk45osqYwRdenK21lcRoOg=";
fetchSubmodules = true;
};
patches = [
# Add install rule
(fetchpatch {
url = "https://gitlab.com/OpenRGBDevelopers/OpenRGBEffectsPlugin/-/commit/75f1b3617d9cabfb3b04a7afc75ce0c1b8514bc0.patch";
hash = "sha256-X+zMNE3OCZNmUb68S4683r/RbE+CDrI/Jv4BMWPI47E=";
})
];
postPatch = ''
# Use the source of openrgb from nixpkgs instead of the submodule
rm -r OpenRGB
ln -s ${openrgb.src} OpenRGB
'';
nativeBuildInputs = [
qmake
pkg-config
wrapQtAppsHook
];
buildInputs = [
qtbase
glib
openal
];
meta = with lib; {
homepage = "https://gitlab.com/OpenRGBDevelopers/OpenRGBEffectsPlugin";
description = "An effects plugin for OpenRGB";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ fgaz ];
platforms = platforms.linux;
};
}

View File

@@ -1,67 +0,0 @@
{ lib
, stdenv
, fetchFromGitLab
, fetchpatch
, qtbase
, openrgb
, glib
, libgtop
, lm_sensors
, qmake
, pkg-config
, wrapQtAppsHook
}:
stdenv.mkDerivation rec {
pname = "openrgb-plugin-hardwaresync";
version = "0.8";
src = fetchFromGitLab {
owner = "OpenRGBDevelopers";
repo = "OpenRGBHardwareSyncPlugin";
rev = "release_${version}";
hash = "sha256-P+IitP8pQLUkBdMfcNw4fOggqyFfg6lNlnSfUGjddzo=";
};
patches = [
(fetchpatch {
name = "use-pkgconfig";
url = "https://gitlab.com/OpenRGBDevelopers/OpenRGBHardwareSyncPlugin/-/commit/df2869d679ea43119fb9b174cd0b2cb152022685.patch";
hash = "sha256-oBtrHwpvB8Z3xYi4ucDSuw+5WijPEbgBW7vLGELFjfw=";
})
(fetchpatch {
name = "add-install-rule";
url = "https://gitlab.com/OpenRGBDevelopers/OpenRGBHardwareSyncPlugin/-/commit/bfbaa0a32ed05112e0cc8b6b2a8229945596e522.patch";
hash = "sha256-76UMMzeXnyQRCEE1tGPNR5XSHTT480rQDnJ9hWhfIqY=";
})
];
postPatch = ''
# Use the source of openrgb from nixpkgs instead of the submodule
rmdir OpenRGB
ln -s ${openrgb.src} OpenRGB
# Remove prebuilt stuff
rm -r dependencies/lhwm-cpp-wrapper
'';
buildInputs = [
qtbase
glib
libgtop
lm_sensors
];
nativeBuildInputs = [
qmake
pkg-config
wrapQtAppsHook
];
meta = with lib; {
homepage = "https://gitlab.com/OpenRGBDevelopers/OpenRGBHardwareSyncPlugin";
description = "Sync your ARGB devices colors with hardware measures (CPU, GPU, fan speed, etc...)";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ fgaz ];
platforms = platforms.linux;
};
}

View File

@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitLab, qmake, wrapQtAppsHook, libusb1, hidapi, pkg-config, coreutils, mbedtls_2, qtbase, qttools, symlinkJoin, openrgb }:
{ lib, stdenv, fetchFromGitLab, qmake, wrapQtAppsHook, libusb1, hidapi, pkg-config, coreutils, mbedtls_2, qtbase, qttools }:
stdenv.mkDerivation rec {
pname = "openrgb";
@@ -25,29 +25,6 @@ stdenv.mkDerivation rec {
HOME=$TMPDIR $out/bin/openrgb --help > /dev/null
'';
passthru.withPlugins = plugins:
let pluginsDir = symlinkJoin {
name = "openrgb-plugins";
paths = plugins;
# Remove all library version symlinks except one,
# or they will result in duplicates in the UI.
# We leave the one pointing to the actual library, usually the most
# qualified one (eg. libOpenRGBHardwareSyncPlugin.so.1.0.0).
postBuild = ''
for f in $out/lib/*; do
if [ "$(dirname $(readlink "$f"))" == "." ]; then
rm "$f"
fi
done
'';
};
in openrgb.overrideAttrs (old: {
qmakeFlags = old.qmakeFlags or [] ++ [
# Welcome to Escape Hell, we have backslashes
''DEFINES+=OPENRGB_EXTRA_PLUGIN_DIRECTORY=\\\""${lib.escape ["\\" "\"" " "] (toString pluginsDir)}/lib\\\""''
];
});
meta = with lib; {
description = "Open source RGB lighting control";
homepage = "https://gitlab.com/CalcProgrammer1/OpenRGB";

View File

@@ -11,13 +11,13 @@
stdenv.mkDerivation rec {
pname = "pgmodeler";
version = "1.0.1";
version = "1.0.0";
src = fetchFromGitHub {
owner = "pgmodeler";
repo = "pgmodeler";
rev = "v${version}";
sha256 = "sha256-SlAYl2x1qdBBwLboO59h1uifF7Q71oX3JyhWwUogdb0=";
sha256 = "sha256-aDmaKf3iLBFD28n2u/QOf/GkgE64Birn0x3Kj5Qx2sg=";
};
nativeBuildInputs = [ pkg-config qmake wrapQtAppsHook ];

View File

@@ -1,33 +0,0 @@
{ appimageTools, fetchurl, lib }:
let
pname = "protonup-qt";
version = "2.7.4";
src = fetchurl {
url = "https://github.com/DavidoTek/ProtonUp-Qt/releases/download/v${version}/ProtonUp-Qt-${version}-x86_64.AppImage";
sha256 = "yKc+KOQfqciqULnChVLf6y9npoSYM6Fmu7mYGEKmpkA=";
};
appimageContents = appimageTools.extractType2 { inherit pname version src; };
in
appimageTools.wrapType2 rec {
inherit pname version src;
extraInstallCommands = ''
mv $out/bin/{${pname}-${version},${pname}}
mkdir -p $out/share/{applications,pixmaps}
cp ${appimageContents}/net.davidotek.pupgui2.desktop $out/share/applications/${pname}.desktop
cp ${appimageContents}/net.davidotek.pupgui2.png $out/share/pixmaps/${pname}.png
substituteInPlace $out/share/applications/${pname}.desktop \
--replace 'Exec=net.davidotek.pupgui2' 'Exec=${pname}' \
--replace 'Icon=net.davidotek.pupgui2' 'Icon=${pname}'
'';
meta = with lib; {
homepage = "https://davidotek.github.io/protonup-qt/";
description = "Install and manage Proton-GE and Luxtorpeda for Steam and Wine-GE for Lutris with this graphical user interface.";
license = licenses.gpl3;
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
mainProgram = "protonup-qt";
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ michaelBelsanti ];
};
}

View File

@@ -10,18 +10,18 @@
buildGoModule rec {
pname = "usql";
version = "0.13.9";
version = "0.13.8";
src = fetchFromGitHub {
owner = "xo";
repo = "usql";
rev = "v${version}";
hash = "sha256-hcAwwu1bp7QJLt+mrUZYK6YeX/uRmfRa8JnUfrTzf3k=";
hash = "sha256-oNsA9VM6MN2czeZSTFGvmCWX0T3iVaAhQk1mVRyKgWw=";
};
buildInputs = [ unixODBC icu ];
vendorHash = "sha256-BehI6O+WpCcgMGabTFMCpYHN3CIo3Zb5rBQuGLsWRc0=";
vendorHash = "sha256-LG5gTHXB1ItDZFbTBHyZGHZLaSYb8wekIHkahTMXzkk=";
proxyVendor = true;
# Exclude broken impala & hive driver

View File

@@ -1,8 +1,8 @@
{
"stable": {
"version": "110.0.5481.100",
"sha256": "0czn47gbyp91z6jfgssr2izhg096fm4h26q1i2i42b0z1ilhv1vd",
"sha256bin64": "11g71rr7fcp2bybd9z19lb8pb29yqscffkzn4ybjbhbvd74s4pjr",
"version": "110.0.5481.77",
"sha256": "1kl1k29sr5qw8pg7shvizw4b37fxjlgah56p57kq641iqhnsnj73",
"sha256bin64": "0jjdgfps6siy9hk2r553vvh0jmkn987ad77sv2zqs9gvx0vsrwgp",
"deps": {
"gn": {
"version": "2022-12-12",
@@ -12,10 +12,10 @@
}
},
"chromedriver": {
"version": "110.0.5481.77",
"sha256_linux": "1bdc4n9nz3m6vv0p4qr9v65zarbnkrbh21ivpvl7y7c25m7fxl20",
"sha256_darwin": "1scv9vvy5ybgbgycyz2wrymjhdqnvz0m6lxkax107437anxixs00",
"sha256_darwin_aarch64": "0gqayzhlif6hvsmpx04mxr1bld6kirv5q1n5dg42rc16gv954dkn"
"version": "110.0.5481.30",
"sha256_linux": "08j28ahyahlgmy67hcm8b1vd4kilvf2yvc25746a46gdf8zz0nmw",
"sha256_darwin": "0xlq0fi9g15yvd6ysqcfkxpbr37av32h0f3af9vxl8vbywjfsxn4",
"sha256_darwin_aarch64": "03j47ha9janbawbjxy9n84sx70iisk6qr0bvb218cq5j1d5x058b"
}
},
"beta": {
@@ -45,9 +45,9 @@
}
},
"ungoogled-chromium": {
"version": "110.0.5481.100",
"sha256": "0czn47gbyp91z6jfgssr2izhg096fm4h26q1i2i42b0z1ilhv1vd",
"sha256bin64": "11g71rr7fcp2bybd9z19lb8pb29yqscffkzn4ybjbhbvd74s4pjr",
"version": "110.0.5481.78",
"sha256": "1m67xfdgggaan09xsbppna209b8sm882xq587i0hsnnnzb3fdxdj",
"sha256bin64": null,
"deps": {
"gn": {
"version": "2022-12-12",
@@ -56,8 +56,8 @@
"sha256": "1b5fwldfmkkbpp5x63n1dxv0nc965hphc8rm8ah7zg44zscm9z30"
},
"ungoogled-patches": {
"rev": "110.0.5481.100-1",
"sha256": "02bmlx2wk9jiqm4az7g8r5ycmpgm5pkb7nivpx2jbmrb0g3qcx9q"
"rev": "110.0.5481.78-1",
"sha256": "1ffb2wf1bdmzlxk4ih8qq439jzqz17f8nchvx7na52y48am1qr3c"
}
}
}

View File

@@ -197,7 +197,7 @@ stdenv.mkDerivation {
# update with:
# $ nix-shell maintainers/scripts/update.nix --argstr package firefox-bin-unwrapped
passthru.updateScript = import ./update.nix {
inherit pname channel lib writeScript xidel coreutils gnused gnugrep gnupg curl runtimeShell;
inherit pname channel writeScript xidel coreutils gnused gnugrep gnupg curl runtimeShell;
baseUrl =
if channel == "devedition"
then "https://archive.mozilla.org/pub/devedition/releases/"

View File

@@ -1,6 +1,5 @@
{ pname
, channel
, lib
, writeScript
, xidel
, coreutils
@@ -47,7 +46,7 @@ in writeScript "update-${pname}" ''
grep "^[0-9]" | \
sort --version-sort | \
grep -v "funnelcake" | \
grep -e "${lib.optionalString isBeta "b"}\([[:digit:]]\|[[:digit:]][[:digit:]]\)$" | ${lib.optionalString (!isBeta) "grep -v \"b\" |"} \
grep -e "${lib.optionalString isBeta "b"}\([[:digit:]]\|[[:digit:]][[:digit:]]\)$" | ${lib.optionalString (not isBeta) "grep -v \"b\" |"} \
tail -1`
curl --silent -o $HOME/shasums "$url$version/SHA256SUMS"

View File

@@ -2,18 +2,16 @@
buildGoModule rec {
pname = "helm-diff";
version = "3.6.0";
version = "3.5.0";
src = fetchFromGitHub {
owner = "databus23";
repo = pname;
rev = "v${version}";
sha256 = "sha256-JeQP2KXoLxkyRZVFcd6Rrz5xyJd+F3plzznAVP3Um8g=";
sha256 = "sha256-evFdMM2AilKQPdSCUzKo6RuC4OC4zfjj+JzFvtkSrdk=";
};
vendorSha256 = "sha256-d5NSqCJrk9QhV5gVOKUG/uJxuvt8X8hiQd8yJEoXPL0=";
ldflags = [ "-s" "-w" "-X github.com/databus23/helm-diff/v3/cmd.Version=${version}" ];
vendorSha256 = "sha256-9i4ryBpaK7mMbsOpIaaZWBRjewD1MtTpf4zJ0yU0KMg=";
# NOTE: Remove the install and upgrade hooks.
postPatch = ''

View File

@@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "helm-secrets";
version = "4.2.2";
version = "3.8.3";
src = fetchFromGitHub {
owner = "jkroepke";
repo = pname;
rev = "v${version}";
hash = "sha256-aqRgny1vU+dxpZpzwL4aSbYfTGrZbRffQy81mMBvnJk=";
hash = "sha256-FpF/d+e5T6nb0OENaYLY+3ATZ+qcAeih5/yKI+AtfKA=";
};
nativeBuildInputs = [ makeWrapper ];
@@ -17,9 +17,9 @@ stdenv.mkDerivation rec {
# NOTE: helm-secrets is comprised of shell scripts.
dontBuild = true;
# NOTE: Fix version string
# NOTE: Remove the install and upgrade hooks.
postPatch = ''
sed -i 's/^version:.*/version: "${version}"/' plugin.yaml
sed -i '/^hooks:/,+2 d' plugin.yaml
'';
installPhase = ''

View File

@@ -2,13 +2,13 @@
buildGoModule rec {
pname = "kube-capacity";
version = "0.7.4";
version = "0.7.3";
src = fetchFromGitHub {
rev = "v${version}";
owner = "robscott";
repo = pname;
sha256 = "sha256-zf6e8+jkgJns1c71QLL1gd0zK34X7gJo1gS38A1DPJo=";
sha256 = "sha256-lNpUOA6O9sOBugYp9fDklKo6U2E0nKz1ORr3qO2tibg=";
};
vendorHash = "sha256-qfSya42wZEmJCC7o8zJQEv0BWrxTuBT2Jzcq/AfI+OE=";

Some files were not shown because too many files have changed in this diff Show More