diff options
author | Janne Heß <janne@hess.ooo> | 2024-03-27 19:10:27 +0100 |
---|---|---|
committer | Valentin Gagarin <valentin.gagarin@tweag.io> | 2024-03-28 09:28:12 +0100 |
commit | fcc95ff8172cc68a0d2d52aa1e8ef2120d2904ec (patch) | |
tree | 8de1a02f7d1624c97562c7736896a6c95c74ec04 /nixos | |
parent | bc77c7a9730833c7668c92288c6af950e7270cb5 (diff) |
treewide: Fix all Nix ASTs in all markdown files
This allows for correct highlighting and maybe future automatic
formatting. The AST was verified to work with nixfmt only.
Diffstat (limited to 'nixos')
93 files changed, 2009 insertions, 1508 deletions
diff --git a/nixos/doc/manual/administration/cleaning-store.chapter.md b/nixos/doc/manual/administration/cleaning-store.chapter.md index c9140d0869c7..4f404882055a 100644 --- a/nixos/doc/manual/administration/cleaning-store.chapter.md +++ b/nixos/doc/manual/administration/cleaning-store.chapter.md @@ -21,8 +21,10 @@ You can tell NixOS in `configuration.nix` to run this unit automatically at certain points in time, for instance, every night at 03:15: ```nix -nix.gc.automatic = true; -nix.gc.dates = "03:15"; +{ + nix.gc.automatic = true; + nix.gc.dates = "03:15"; +} ``` The commands above do not remove garbage collector roots, such as old diff --git a/nixos/doc/manual/administration/container-networking.section.md b/nixos/doc/manual/administration/container-networking.section.md index 0873768376cc..723cf211d872 100644 --- a/nixos/doc/manual/administration/container-networking.section.md +++ b/nixos/doc/manual/administration/container-networking.section.md @@ -26,9 +26,11 @@ host to rewrite container traffic to use your external IP address. This can be accomplished using the following configuration on the host: ```nix -networking.nat.enable = true; -networking.nat.internalInterfaces = ["ve-+"]; -networking.nat.externalInterface = "eth0"; +{ + networking.nat.enable = true; + networking.nat.internalInterfaces = ["ve-+"]; + networking.nat.externalInterface = "eth0"; +} ``` where `eth0` should be replaced with the desired external interface. @@ -38,7 +40,9 @@ If you are using Network Manager, you need to explicitly prevent it from managing container interfaces: ```nix -networking.networkmanager.unmanaged = [ "interface-name:ve-*" ]; +{ + networking.networkmanager.unmanaged = [ "interface-name:ve-*" ]; +} ``` You may need to restart your system for the changes to take effect. diff --git a/nixos/doc/manual/administration/control-groups.chapter.md b/nixos/doc/manual/administration/control-groups.chapter.md index abe8dd80b5ab..8682236ca1a9 100644 --- a/nixos/doc/manual/administration/control-groups.chapter.md +++ b/nixos/doc/manual/administration/control-groups.chapter.md @@ -39,7 +39,9 @@ they were in the same cgroup, then the PostgreSQL process would get `configuration.nix`: ```nix -systemd.services.httpd.serviceConfig.CPUShares = 512; +{ + systemd.services.httpd.serviceConfig.CPUShares = 512; +} ``` By default, every cgroup has 1024 CPU shares, so this will halve the CPU @@ -52,7 +54,9 @@ limits can be specified in `configuration.nix`; for instance, to limit `httpd.service` to 512 MiB of RAM (excluding swap): ```nix -systemd.services.httpd.serviceConfig.MemoryLimit = "512M"; +{ + systemd.services.httpd.serviceConfig.MemoryLimit = "512M"; +} ``` The command `systemd-cgtop` shows a continuously updated list of all diff --git a/nixos/doc/manual/administration/declarative-containers.section.md b/nixos/doc/manual/administration/declarative-containers.section.md index eaa50d3c663d..f16fa8332b51 100644 --- a/nixos/doc/manual/administration/declarative-containers.section.md +++ b/nixos/doc/manual/administration/declarative-containers.section.md @@ -5,13 +5,15 @@ You can also specify containers and their configuration in the host's shall be a container named `database` running PostgreSQL: ```nix -containers.database = - { config = - { config, pkgs, ... }: - { services.postgresql.enable = true; - services.postgresql.package = pkgs.postgresql_14; - }; - }; +{ + containers.database = + { config = + { config, pkgs, ... }: + { services.postgresql.enable = true; + services.postgresql.package = pkgs.postgresql_14; + }; + }; +} ``` If you run `nixos-rebuild switch`, the container will be built. If the @@ -25,11 +27,13 @@ cannot change the network configuration. You can give a container its own network as follows: ```nix -containers.database = { - privateNetwork = true; - hostAddress = "192.168.100.10"; - localAddress = "192.168.100.11"; -}; +{ + containers.database = { + privateNetwork = true; + hostAddress = "192.168.100.10"; + localAddress = "192.168.100.11"; + }; +} ``` This gives the container a private virtual Ethernet interface with IP diff --git a/nixos/doc/manual/administration/service-mgmt.chapter.md b/nixos/doc/manual/administration/service-mgmt.chapter.md index bc9bdbe3708b..49e8d801fb80 100644 --- a/nixos/doc/manual/administration/service-mgmt.chapter.md +++ b/nixos/doc/manual/administration/service-mgmt.chapter.md @@ -82,7 +82,9 @@ In order to enable a systemd *system* service with provided upstream package, use (e.g): ```nix -systemd.packages = [ pkgs.packagekit ]; +{ + systemd.packages = [ pkgs.packagekit ]; +} ``` Usually NixOS modules written by the community do the above, plus take diff --git a/nixos/doc/manual/configuration/abstractions.section.md b/nixos/doc/manual/configuration/abstractions.section.md index bf26e4c51ed3..5bc44aa72245 100644 --- a/nixos/doc/manual/configuration/abstractions.section.md +++ b/nixos/doc/manual/configuration/abstractions.section.md @@ -47,9 +47,9 @@ You can write a `let` wherever an expression is allowed. Thus, you also could ha ```nix { services.httpd.virtualHosts = - let commonConfig = ...; in - { "blog.example.org" = (commonConfig // { ... }) - "wiki.example.org" = (commonConfig // { ... }) + let commonConfig = { /* ... */ }; in + { "blog.example.org" = (commonConfig // { /* ... */ }); + "wiki.example.org" = (commonConfig // { /* ... */ }); }; } ``` diff --git a/nixos/doc/manual/configuration/ad-hoc-network-config.section.md b/nixos/doc/manual/configuration/ad-hoc-network-config.section.md index 4478d77f361d..ecb06ad984a3 100644 --- a/nixos/doc/manual/configuration/ad-hoc-network-config.section.md +++ b/nixos/doc/manual/configuration/ad-hoc-network-config.section.md @@ -6,8 +6,10 @@ is useful for doing network configuration not covered by the existing NixOS modules. For instance, to statically configure an IPv6 address: ```nix -networking.localCommands = - '' - ip -6 addr add 2001:610:685:1::1/64 dev eth0 - ''; +{ + networking.localCommands = + '' + ip -6 addr add 2001:610:685:1::1/64 dev eth0 + ''; +} ``` diff --git a/nixos/doc/manual/configuration/adding-custom-packages.section.md b/nixos/doc/manual/configuration/adding-custom-packages.section.md index 2340723e07c6..f9a5221d6c93 100644 --- a/nixos/doc/manual/configuration/adding-custom-packages.section.md +++ b/nixos/doc/manual/configuration/adding-custom-packages.section.md @@ -23,7 +23,9 @@ Then you write and test the package as described in the Nixpkgs manual. Finally, you add it to [](#opt-environment.systemPackages), e.g. ```nix -environment.systemPackages = [ pkgs.my-package ]; +{ + environment.systemPackages = [ pkgs.my-package ]; +} ``` and you run `nixos-rebuild`, specifying your own Nixpkgs tree: @@ -38,24 +40,28 @@ tree. For instance, here is how you specify a build of the `configuration.nix`: ```nix -environment.systemPackages = - let - my-hello = with pkgs; stdenv.mkDerivation rec { - name = "hello-2.8"; - src = fetchurl { - url = "mirror://gnu/hello/${name}.tar.gz"; - hash = "sha256-5rd/gffPfa761Kn1tl3myunD8TuM+66oy1O7XqVGDXM="; +{ + environment.systemPackages = + let + my-hello = with pkgs; stdenv.mkDerivation rec { + name = "hello-2.8"; + src = fetchurl { + url = "mirror://gnu/hello/${name}.tar.gz"; + hash = "sha256-5rd/gffPfa761Kn1tl3myunD8TuM+66oy1O7XqVGDXM="; + }; }; - }; - in - [ my-hello ]; + in + [ my-hello ]; +} ``` |