diff --git a/nixos/modules/services/backup/borgbackup.xml b/nixos/modules/services/backup/borgbackup.xml index f38064f86775..5d7ff21587ff 100644 --- a/nixos/modules/services/backup/borgbackup.xml +++ b/nixos/modules/services/backup/borgbackup.xml @@ -53,7 +53,8 @@ }; } }; -} +} + @@ -86,7 +87,8 @@ ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID78zmOyA+5uPG4Ot0hfAy+sLDPU1L4AiIoRYEIVbbQ/ path = "/var/lib/my_borg_repo" ; }; }; -} +} + @@ -115,7 +117,8 @@ ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID78zmOyA+5uPG4Ot0hfAy+sLDPU1L4AiIoRYEIVbbQ/ startAt = "hourly"; }; }; -}; +}; + The following few commands (run as root) let you test your backup. @@ -127,7 +130,8 @@ ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID78zmOyA+5uPG4Ot0hfAy+sLDPU1L4AiIoRYEIVbbQ/ > export BORG_PASSPHRASE=topSecrect > borg list --rsh='ssh -i /run/keys/id_ed25519_my_borg_repo' borg@nixos:. nixos-backupToLocalServer-2020-03-30T21:46:17 Mon, 2020-03-30 21:46:19 [84feb97710954931ca384182f5f3cb90665f35cef214760abd7350fb064786ac] -nixos-backupToLocalServer-2020-03-30T21:46:30 Mon, 2020-03-30 21:46:32 [e77321694ecd160ca2228611747c6ad1be177d6e0d894538898de7a2621b6e68] +nixos-backupToLocalServer-2020-03-30T21:46:30 Mon, 2020-03-30 21:46:32 [e77321694ecd160ca2228611747c6ad1be177d6e0d894538898de7a2621b6e68] + @@ -148,7 +152,9 @@ nixos-backupToLocalServer-2020-03-30T21:46:30 Mon, 2020-03-30 21:46:32 [e7732169 Generate a SSH key without a password, to access the remote server. E.g. - sudo ssh-keygen -N '' -t ed25519 -f /run/keys/id_ed25519_borgbase + +sudo ssh-keygen -N '' -t ed25519 -f /run/keys/id_ed25519_borgbase + @@ -163,7 +169,8 @@ nixos-backupToLocalServer-2020-03-30T21:46:30 Mon, 2020-03-30 21:46:32 [e7732169 sudo borg init --encryption=repokey-blake2 \ -rsh "ssh -i /run/keys/id_ed25519_borgbase" \ - zzz2aaaaa@zzz2aaaaa.repo.borgbase.com:repo + zzz2aaaaa@zzz2aaaaa.repo.borgbase.com:repo + @@ -184,7 +191,8 @@ sudo borg init --encryption=repokey-blake2 \ startAt = "daily"; }; }; -}} +}} + diff --git a/nixos/modules/services/development/blackfire.xml b/nixos/modules/services/development/blackfire.xml index cecd249dda48..1df6441f66fc 100644 --- a/nixos/modules/services/development/blackfire.xml +++ b/nixos/modules/services/development/blackfire.xml @@ -13,7 +13,8 @@ To use it, you will need to enable the agent and the probe on your server. The exact method will depend on the way you use PHP but here is an example of NixOS configuration for PHP-FPM: -let + +let php = pkgs.php.withExtensions ({ enabled, all }: enabled ++ (with all; [ blackfire ])); @@ -38,7 +39,8 @@ in { # (WantedBy= from the upstream unit not respected: https://github.com/NixOS/nixpkgs/issues/81138) # Alternately, you can start it manually with `systemctl start blackfire-agent`. systemd.services.blackfire-agent.wantedBy = [ "phpfpm-foo.service" ]; -} +} + On your developer machine, you will also want to install the client (see blackfire package) or the browser extension to actually trigger the profiling. diff --git a/nixos/modules/services/editors/emacs.xml b/nixos/modules/services/editors/emacs.xml index dfadf27d41dc..176766fdf411 100644 --- a/nixos/modules/services/editors/emacs.xml +++ b/nixos/modules/services/editors/emacs.xml @@ -446,7 +446,9 @@ emacsclient --create-frame --tty # opens a new frame on the current terminal If you have formed certain bad habits when editing files, these can be corrected with a shell alias to the wrapper script: -alias vi=$EDITOR + +alias vi=$EDITOR + @@ -467,7 +469,9 @@ services.emacs.install = true; To enable the systemd user service for just the currently logged in user, run: -systemctl --user enable emacs + +systemctl --user enable emacs + This will add the symlink ~/.config/systemd/user/emacs.service. diff --git a/nixos/modules/services/mail/mailman.xml b/nixos/modules/services/mail/mailman.xml index 9510cbe82c52..c1ad5d1a2851 100644 --- a/nixos/modules/services/mail/mailman.xml +++ b/nixos/modules/services/mail/mailman.xml @@ -16,7 +16,8 @@ Basic usage with Postfix For a basic configuration with Postfix as the MTA, the following settings are suggested: - { config, ... }: { + +{ config, ... }: { services.postfix = { enable = true; relayDomains = ["hash:/var/lib/mailman/data/postfix_domains"]; @@ -36,7 +37,8 @@ }; services.nginx.virtualHosts."lists.example.org".enableACME = true; networking.firewall.allowedTCPPorts = [ 25 80 443 ]; -} +} + DNS records will also be required: @@ -60,7 +62,8 @@ Using with other MTAs Mailman also supports other MTA, though with a little bit more configuration. For example, to use Mailman with Exim, you can use the following settings: - { config, ... }: { + +{ config, ... }: { services = { mailman = { enable = true; @@ -82,7 +85,8 @@ config = builtins.readFile ./exim.conf; }; }; -} +} + The exim config needs some special additions to work with Mailman. Currently diff --git a/nixos/modules/services/matrix/synapse.xml b/nixos/modules/services/matrix/synapse.xml index f834e54f3c8d..43ec42b3e748 100644 --- a/nixos/modules/services/matrix/synapse.xml +++ b/nixos/modules/services/matrix/synapse.xml @@ -185,7 +185,9 @@ Success! Create a file with the following contents: -registration_shared_secret: your-very-secret-secret + +registration_shared_secret: your-very-secret-secret + diff --git a/nixos/modules/services/networking/prosody.xml b/nixos/modules/services/networking/prosody.xml index e8f27d10e8c3..89b0377d97d9 100644 --- a/nixos/modules/services/networking/prosody.xml +++ b/nixos/modules/services/networking/prosody.xml @@ -54,7 +54,8 @@ services.prosody = { uploadHttp = { domain = "upload.example.org"; }; -}; +}; +
@@ -81,7 +82,8 @@ security.acme = { extraDomainNames = [ "conference.example.org" "upload.example.org" ]; }; }; -}; +}; +
diff --git a/nixos/modules/services/web-apps/grocy.xml b/nixos/modules/services/web-apps/grocy.xml index 46a49fe601ed..dc56f63f5de8 100644 --- a/nixos/modules/services/web-apps/grocy.xml +++ b/nixos/modules/services/web-apps/grocy.xml @@ -14,13 +14,15 @@ Basic usage A very basic configuration may look like this: -{ pkgs, ... }: + +{ pkgs, ... }: { services.grocy = { enable = true; hostName = "grocy.tld"; }; -} +} + This configures a simple vhost using nginx which listens to grocy.tld with fully configured ACME/LE (this can be disabled by setting services.grocy.nginx.enableSSL @@ -39,7 +41,8 @@ The configuration for grocy is located at /etc/grocy/config.php. By default, the following settings can be defined in the NixOS-configuration: -{ pkgs, ... }: + +{ pkgs, ... }: { services.grocy.settings = { # The default currency in the system for invoices etc. @@ -60,17 +63,20 @@ firstDayOfWeek = 2; }; }; -} +} + If you want to alter the configuration file on your own, you can do this manually with an expression like this: -{ lib, ... }: + +{ lib, ... }: { environment.etc."grocy/config.php".text = lib.mkAfter '' // Arbitrary PHP code in grocy's configuration file ''; -} +} + diff --git a/nixos/modules/services/web-apps/jitsi-meet.xml b/nixos/modules/services/web-apps/jitsi-meet.xml index 8909ac5b0d37..796105732c2e 100644 --- a/nixos/modules/services/web-apps/jitsi-meet.xml +++ b/nixos/modules/services/web-apps/jitsi-meet.xml @@ -13,7 +13,8 @@ Basic usage A minimal configuration using Let's Encrypt for TLS certificates looks like this: -{ + +{ services.jitsi-meet = { enable = true; hostName = "jitsi.example.com"; @@ -22,7 +23,8 @@ networking.firewall.allowedTCPPorts = [ 80 443 ]; security.acme.email = "me@example.com"; security.acme.acceptTerms = true; -} +} + @@ -30,7 +32,8 @@ Configuration Here is the minimal configuration with additional configurations: -{ + +{ services.jitsi-meet = { enable = true; hostName = "jitsi.example.com"; @@ -48,7 +51,8 @@ networking.firewall.allowedTCPPorts = [ 80 443 ]; security.acme.email = "me@example.com"; security.acme.acceptTerms = true; -} +} + diff --git a/nixos/modules/services/web-apps/nextcloud.xml b/nixos/modules/services/web-apps/nextcloud.xml index 02d7595ff179..8f75d2f7c5a8 100644 --- a/nixos/modules/services/web-apps/nextcloud.xml +++ b/nixos/modules/services/web-apps/nextcloud.xml @@ -28,7 +28,8 @@ A very basic configuration may look like this: -{ pkgs, ... }: + +{ pkgs, ... }: { services.nextcloud = { enable = true; @@ -60,7 +61,8 @@ }; networking.firewall.allowedTCPPorts = [ 80 443 ]; -} +} + @@ -198,7 +200,8 @@ An exemplary configuration may look like this: -{ config, lib, pkgs, ... }: { + +{ config, lib, pkgs, ... }: { services.nginx.enable = false; services.nextcloud = { enable = true; @@ -238,7 +241,8 @@ ''; }; }; -} +} + @@ -286,14 +290,16 @@ in NixOS for a safe upgrade-path before removing those. In that case we should keep those packages, but mark them as insecure in an expression like this (in <nixpkgs/pkgs/servers/nextcloud/default.nix>): -/* ... */ + +/* ... */ { nextcloud17 = generic { version = "17.0.x"; sha256 = "0000000000000000000000000000000000000000000000000000"; eol = true; }; -} +} + diff --git a/nixos/modules/services/web-apps/plausible.xml b/nixos/modules/services/web-apps/plausible.xml index 7824768f549e..4d162c3c9563 100644 --- a/nixos/modules/services/web-apps/plausible.xml +++ b/nixos/modules/services/web-apps/plausible.xml @@ -16,7 +16,8 @@ After that, plausible can be deployed like this: -{ + +{ services.plausible = { enable = true; adminUser = { @@ -29,7 +30,8 @@ secretKeybaseFile = "/run/secrets/plausible-secret-key-base"; }; }; -} +} + diff --git a/nixos/modules/services/web-servers/garage-doc.xml b/nixos/modules/services/web-servers/garage-doc.xml index 16f6fde94b5a..452b431a2cca 100644 --- a/nixos/modules/services/web-servers/garage-doc.xml +++ b/nixos/modules/services/web-servers/garage-doc.xml @@ -119,14 +119,16 @@ in NixOS for a safe upgrade-path before removing those. In that case we shold keep those packages, but mark them as insecure in an expression like this (in <nixpkgs/pkgs/tools/filesystem/garage/default.nix>): -/* ... */ + +/* ... */ { garage_0_7_3 = generic { version = "0.7.3"; sha256 = "0000000000000000000000000000000000000000000000000000"; eol = true; }; -} +} +