treewide: fix syntax errors in nix code blocks
Fixes all code blocks with "nix" language in markdown files for syntax errors to be able to run nixfmt in the next step.
This commit is contained in:
parent
52ee822768
commit
6c47e7d5da
@ -126,6 +126,7 @@ in turn will not make the service / timer start on login.
|
|||||||
You can define services by adding them to `systemd.services`:
|
You can define services by adding them to `systemd.services`:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
systemd.services.myservice = {
|
systemd.services.myservice = {
|
||||||
after = [ "network-online.target" ];
|
after = [ "network-online.target" ];
|
||||||
requires = [ "network-online.target" ];
|
requires = [ "network-online.target" ];
|
||||||
@ -137,6 +138,7 @@ systemd.services.myservice = {
|
|||||||
ExecStart = "...";
|
ExecStart = "...";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to specify a multi-line script for `ExecStart`,
|
If you want to specify a multi-line script for `ExecStart`,
|
||||||
|
@ -111,7 +111,7 @@ If there are shared libraries missing add them with
|
|||||||
extraPkgs = pkgs: [
|
extraPkgs = pkgs: [
|
||||||
# missing libraries here, e.g.: `pkgs.libepoxy`
|
# missing libraries here, e.g.: `pkgs.libepoxy`
|
||||||
];
|
];
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ To enable Mattermost using Postgres, use a config like this:
|
|||||||
|
|
||||||
# For example, to disable auto-installation of prepackaged plugins.
|
# For example, to disable auto-installation of prepackaged plugins.
|
||||||
settings.PluginSettings.AutomaticPrepackagedPlugins = false;
|
settings.PluginSettings.AutomaticPrepackagedPlugins = false;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -137,7 +137,9 @@ the Perl script. It aims to eventually replace the Perl script by default.
|
|||||||
You can enable Userborn via:
|
You can enable Userborn via:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
services.userborn.enable = true;
|
services.userborn.enable = true;
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
You can configure Userborn to store the password files
|
You can configure Userborn to store the password files
|
||||||
@ -145,7 +147,9 @@ You can configure Userborn to store the password files
|
|||||||
location to `/etc`:
|
location to `/etc`:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
services.userborn.passwordFilesLocation = "/persistent/etc";
|
services.userborn.passwordFilesLocation = "/persistent/etc";
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
This is useful when you store `/etc` on a `tmpfs` or if `/etc` is immutable
|
This is useful when you store `/etc` on a `tmpfs` or if `/etc` is immutable
|
||||||
|
@ -22,6 +22,7 @@ You can run `vwifi-ctrl` on this node to control characteristics of the simulate
|
|||||||
physical layer.
|
physical layer.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
airgap =
|
airgap =
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
@ -41,6 +42,7 @@ airgap =
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### AP {#sec-nixos-test-wifi-ap}
|
### AP {#sec-nixos-test-wifi-ap}
|
||||||
@ -48,6 +50,7 @@ airgap =
|
|||||||
A node like this will act as a wireless access point in infrastructure mode.
|
A node like this will act as a wireless access point in infrastructure mode.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
ap =
|
ap =
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
@ -82,6 +85,7 @@ ap =
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Station {#sec-nixos-test-wifi-station}
|
### Station {#sec-nixos-test-wifi-station}
|
||||||
@ -89,6 +93,7 @@ ap =
|
|||||||
A node like this acts as a wireless client.
|
A node like this acts as a wireless client.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
station =
|
station =
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
@ -120,6 +125,7 @@ station =
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Monitor {#sec-nixos-test-wifi-monitor}
|
### Monitor {#sec-nixos-test-wifi-monitor}
|
||||||
@ -128,6 +134,7 @@ When the monitor mode interface is enabled, this node will receive
|
|||||||
all packets broadcast by all other nodes through the spy interface.
|
all packets broadcast by all other nodes through the spy interface.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
monitor =
|
monitor =
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
@ -149,4 +156,6 @@ monitor =
|
|||||||
serverAddress = "192.168.1.2";
|
serverAddress = "192.168.1.2";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
@ -25,7 +25,9 @@ The `image.modules` option can be used to set specific options per image variant
|
|||||||
E.g. images for the cloud provider Linode use `grub2` as a bootloader by default. If you are using `systemd-boot` on other platforms and want to disable it for Linode only, you could use the following options:
|
E.g. images for the cloud provider Linode use `grub2` as a bootloader by default. If you are using `systemd-boot` on other platforms and want to disable it for Linode only, you could use the following options:
|
||||||
|
|
||||||
``` nix
|
``` nix
|
||||||
|
{
|
||||||
image.modules.linode = {
|
image.modules.linode = {
|
||||||
boot.loader.systemd-boot.enable = lib.mkForce false;
|
boot.loader.systemd-boot.enable = lib.mkForce false;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
@ -243,9 +243,11 @@ The pre-existing `services.ankisyncd` has been marked deprecated and will be dro
|
|||||||
- `azure-cli` now has extension support. For example, to install the `aks-preview` extension, use
|
- `azure-cli` now has extension support. For example, to install the `aks-preview` extension, use
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
(azure-cli.withExtensions [ azure-cli.extensions.aks-preview ])
|
(azure-cli.withExtensions [ azure-cli.extensions.aks-preview ])
|
||||||
];
|
];
|
||||||
|
}
|
||||||
```
|
```
|
||||||
To make the `azure-cli` immutable and prevent clashes in case `azure-cli` is also installed via other package managers, some configuration files were moved into the derivation.
|
To make the `azure-cli` immutable and prevent clashes in case `azure-cli` is also installed via other package managers, some configuration files were moved into the derivation.
|
||||||
This can be disabled by overriding `withImmutableConfig = false` when building `azure-cli`.
|
This can be disabled by overriding `withImmutableConfig = false` when building `azure-cli`.
|
||||||
|
@ -615,8 +615,10 @@
|
|||||||
Then, follow the instructions on the [upstream release notes](https://github.com/majewsky/portunus/releases/tag/v2.0.0) to upgrade all existing user accounts to strong password hashes.
|
Then, follow the instructions on the [upstream release notes](https://github.com/majewsky/portunus/releases/tag/v2.0.0) to upgrade all existing user accounts to strong password hashes.
|
||||||
If you need to upgrade to 24.11 without having completed the migration, consider the security implications of weak password hashes on your user accounts, and add the following to your configuration:
|
If you need to upgrade to 24.11 without having completed the migration, consider the security implications of weak password hashes on your user accounts, and add the following to your configuration:
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
services.portunus.package = pkgs.portunus.override { libxcrypt = pkgs.libxcrypt-legacy; };
|
services.portunus.package = pkgs.portunus.override { libxcrypt = pkgs.libxcrypt-legacy; };
|
||||||
services.portunus.ldap.package = pkgs.openldap.override { libxcrypt = pkgs.libxcrypt-legacy; };
|
services.portunus.ldap.package = pkgs.openldap.override { libxcrypt = pkgs.libxcrypt-legacy; };
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- The default value of `services.kubernetes.kubelet.hostname` is now lowercased.
|
- The default value of `services.kubernetes.kubelet.hostname` is now lowercased.
|
||||||
@ -956,6 +958,7 @@ If you set `sound.mediaKeys` in your configuration:
|
|||||||
- If you want to maintain the exact behavior of the option, use the following snippet
|
- If you want to maintain the exact behavior of the option, use the following snippet
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
services.actkbd = let
|
services.actkbd = let
|
||||||
volumeStep = "1%";
|
volumeStep = "1%";
|
||||||
in {
|
in {
|
||||||
@ -974,6 +977,7 @@ in {
|
|||||||
{ keys = [ 190 ]; events = [ "key" ]; command = "${alsa-utils}/bin/amixer -q set Capture toggle"; }
|
{ keys = [ 190 ]; events = [ "key" ]; command = "${alsa-utils}/bin/amixer -q set Capture toggle"; }
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### `hardware.deviceTree.overlays` compatible string matching {#sec-release-24.11-migration-dto-compatible}
|
### `hardware.deviceTree.overlays` compatible string matching {#sec-release-24.11-migration-dto-compatible}
|
||||||
|
@ -355,10 +355,12 @@ Alongside many enhancements to NixOS modules and general system improvements, th
|
|||||||
- To avoid delaying user logins unnecessarily the `multi-user.target` is no longer ordered after `network-online.target`.
|
- To avoid delaying user logins unnecessarily the `multi-user.target` is no longer ordered after `network-online.target`.
|
||||||
System services requiring a connection to start correctly must explicitly state so, i.e.
|
System services requiring a connection to start correctly must explicitly state so, i.e.
|
||||||
```nix
|
```nix
|
||||||
systemd.services.<name> = {
|
{
|
||||||
|
systemd.services."<name>" = {
|
||||||
wants = [ "network-online.target" ];
|
wants = [ "network-online.target" ];
|
||||||
after = [ "network-online.target" ];
|
after = [ "network-online.target" ];
|
||||||
};
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
This changed follows a deprecation period of one year started in NixOS 24.05 (see [PR #283818](https://github.com/NixOS/nixpkgs/pull/283818)).
|
This changed follows a deprecation period of one year started in NixOS 24.05 (see [PR #283818](https://github.com/NixOS/nixpkgs/pull/283818)).
|
||||||
|
|
||||||
@ -457,6 +459,7 @@ Alongside many enhancements to NixOS modules and general system improvements, th
|
|||||||
Example:
|
Example:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
services.mysql = {
|
services.mysql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
galeraCluster = {
|
galeraCluster = {
|
||||||
@ -466,6 +469,7 @@ Alongside many enhancements to NixOS modules and general system improvements, th
|
|||||||
nodeAddresses = [ "galera_01" "galera_02" "galera_03"];
|
nodeAddresses = [ "galera_01" "galera_02" "galera_03"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- systemd's {manpage}`systemd-ssh-generator(8)` now works out of the box on NixOS.
|
- systemd's {manpage}`systemd-ssh-generator(8)` now works out of the box on NixOS.
|
||||||
|
@ -147,6 +147,7 @@ Assume that your app creates a role `admin` and you want the `root` user to be a
|
|||||||
You can then use [](#opt-services.postgresql.identMap) to define the map and [](#opt-services.postgresql.authentication) to enable it:
|
You can then use [](#opt-services.postgresql.identMap) to define the map and [](#opt-services.postgresql.authentication) to enable it:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
identMap = ''
|
identMap = ''
|
||||||
admin root admin
|
admin root admin
|
||||||
@ -154,6 +155,7 @@ services.postgresql = {
|
|||||||
authentication = ''
|
authentication = ''
|
||||||
local all admin peer map=admin
|
local all admin peer map=admin
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -21,7 +21,9 @@ configure this in the module, but you can e.g. use systemd to give the unit
|
|||||||
access to the command at runtime.
|
access to the command at runtime.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
systemd.services.paisa.path = [ pkgs.hledger ];
|
systemd.services.paisa.path = [ pkgs.hledger ];
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
::: {.note}
|
::: {.note}
|
||||||
|
@ -16,5 +16,5 @@ Use the following configuration to start a public instance of Glances locally:
|
|||||||
enable = true;
|
enable = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
```
|
```
|
||||||
|
@ -103,7 +103,7 @@ Additionally you can set an optional timeout value.
|
|||||||
certificate = ./dns.example.com.crt;
|
certificate = ./dns.example.com.crt;
|
||||||
key = "/dns.example.com.key";
|
key = "/dns.example.com.key";
|
||||||
# optional (default = 3000)
|
# optional (default = 3000)
|
||||||
timeout_ms = 3000
|
timeout_ms = 3000;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -15,11 +15,13 @@ This adds `jotta-cli` to `environment.systemPackages` and starts a user service
|
|||||||
## Example Configuration {#module-services-jotta-cli-example-configuration}
|
## Example Configuration {#module-services-jotta-cli-example-configuration}
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
services.jotta-cli = {
|
services.jotta-cli = {
|
||||||
enable = true;
|
enable = true;
|
||||||
options = [ "slow" ];
|
options = [ "slow" ];
|
||||||
package = pkgs.jotta-cli;
|
package = pkgs.jotta-cli;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
This uses `jotta-cli` and `jottad` from the `pkgs.jotta-cli` package and starts `jottad` in low memory mode.
|
This uses `jotta-cli` and `jottad` from the `pkgs.jotta-cli` package and starts `jottad` in low memory mode.
|
||||||
|
@ -9,6 +9,7 @@ To fully setup Netbird as a self-hosted server, we need both a Coturn server and
|
|||||||
There are quite a few settings that need to be passed to Netbird for it to function, and a minimal config looks like :
|
There are quite a few settings that need to be passed to Netbird for it to function, and a minimal config looks like :
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
services.netbird.server = {
|
services.netbird.server = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
@ -39,4 +40,5 @@ services.netbird.server = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
@ -110,7 +110,6 @@ to configure additional interfaces with different configuration, use
|
|||||||
"dhcp-range=::f,::ff,constructor:enp1s0,ra-names,ra-stateless"
|
"dhcp-range=::f,::ff,constructor:enp1s0,ra-names,ra-stateless"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ To enable a Kerberos server:
|
|||||||
admin_server = "kerberos.example.com";
|
admin_server = "kerberos.example.com";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
services.kerberos-server = {
|
services.kerberos-server = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -208,7 +208,9 @@ release notes when upgrading.
|
|||||||
the cache size to zero:
|
the cache size to zero:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
services.nextcloud.phpOptions."realpath_cache_size" = "0";
|
services.nextcloud.phpOptions."realpath_cache_size" = "0";
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- **Empty Files on chunked uploads**
|
- **Empty Files on chunked uploads**
|
||||||
@ -286,9 +288,9 @@ that are managed by Nix:
|
|||||||
|
|
||||||
```nix
|
```nix
|
||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, ... }: {
|
||||||
services.nextcloud.extraApps = with config.services.nextcloud.package.packages.apps; [
|
services.nextcloud.extraApps = with config.services.nextcloud.package.packages.apps; {
|
||||||
inherit user_oidc calendar contacts;
|
inherit user_oidc calendar contacts;
|
||||||
];
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -40,10 +40,10 @@ The prefered method to run this service is behind a reverse proxy not to expose
|
|||||||
|
|
||||||
server = {
|
server = {
|
||||||
port = 8080;
|
port = 8080;
|
||||||
...
|
# ...
|
||||||
};
|
};
|
||||||
|
|
||||||
...
|
# ...
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."szurubooru.domain.tld" = {
|
services.nginx.virtualHosts."szurubooru.domain.tld" = {
|
||||||
|
@ -6,6 +6,7 @@ containerd. This can be done in a few lines of configuration.
|
|||||||
## Configure Containerd
|
## Configure Containerd
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
virtualisation.containerd = {
|
virtualisation.containerd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.plugins."io.containerd.grpc.v1.cri".cni = {
|
settings.plugins."io.containerd.grpc.v1.cri".cni = {
|
||||||
@ -17,15 +18,18 @@ virtualisation.containerd = {
|
|||||||
sandbox_image = "docker.io/rancher/mirrored-pause:3.6";
|
sandbox_image = "docker.io/rancher/mirrored-pause:3.6";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configure k3s
|
## Configure k3s
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
services.k3s = {
|
services.k3s = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraFlags = [ "--container-runtime-endpoint unix:///run/containerd/containerd.sock" ];
|
extraFlags = [ "--container-runtime-endpoint unix:///run/containerd/containerd.sock" ];
|
||||||
};
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Importing Container Images
|
## Importing Container Images
|
||||||
|
@ -99,9 +99,14 @@ Definitions like the following however, _can_ be transitioned:
|
|||||||
|
|
||||||
```nix
|
```nix
|
||||||
# all-packages.nix
|
# all-packages.nix
|
||||||
|
{
|
||||||
fooWithBaz = foo.override {
|
fooWithBaz = foo.override {
|
||||||
bar = baz;
|
bar = baz;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```nix
|
||||||
# turned into pkgs/by-name/fo/fooWithBaz/package.nix with:
|
# turned into pkgs/by-name/fo/fooWithBaz/package.nix with:
|
||||||
{
|
{
|
||||||
foo,
|
foo,
|
||||||
|
@ -56,6 +56,7 @@ The output should look something like this:
|
|||||||
Based on this, you can add an attribute to `extensions-manual.nix`:
|
Based on this, you can add an attribute to `extensions-manual.nix`:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
azure-devops = mkAzExtension {
|
azure-devops = mkAzExtension {
|
||||||
pname = "azure-devops";
|
pname = "azure-devops";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
@ -67,6 +68,7 @@ Based on this, you can add an attribute to `extensions-manual.nix`:
|
|||||||
];
|
];
|
||||||
meta.maintainers = with lib.maintainers; [ katexochen ];
|
meta.maintainers = with lib.maintainers; [ katexochen ];
|
||||||
};
|
};
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
* The attribute name should be the same as `pname`.
|
* The attribute name should be the same as `pname`.
|
||||||
@ -113,5 +115,7 @@ If extensions are removed upstream, an alias is added to the end of `extensions-
|
|||||||
this example:
|
this example:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
blockchain = throw "The 'blockchain' extension for azure-cli was deprecated upstream"; # Added 2024-04-26
|
blockchain = throw "The 'blockchain' extension for azure-cli was deprecated upstream"; # Added 2024-04-26
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
@ -80,6 +80,7 @@ needs to be. Instead of applying brittle substitutions the version constraint
|
|||||||
can be ignored on a per requirement basis.
|
can be ignored on a per requirement basis.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
|
{
|
||||||
dependencies = [
|
dependencies = [
|
||||||
pyemvue
|
pyemvue
|
||||||
];
|
];
|
||||||
@ -88,5 +89,5 @@ can be ignored on a per requirement basis.
|
|||||||
ignoreVersionRequirement = [
|
ignoreVersionRequirement = [
|
||||||
"pyemvue"
|
"pyemvue"
|
||||||
];
|
];
|
||||||
|
}
|
||||||
```
|
```
|
||||||
`
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user