run nix fmt

This commit is contained in:
jopejoe1 2024-07-10 23:02:54 +02:00
parent eab8e4b1d8
commit d5cbe31c02
61 changed files with 1299 additions and 830 deletions

View file

@ -1,4 +1,9 @@
{ pkgs, config, nixos-hardware, ... }:
{
pkgs,
config,
nixos-hardware,
...
}:
{
imports = [
@ -10,7 +15,9 @@
];
jopejoe1 = {
audio = { enable = true; };
audio = {
enable = true;
};
bluetooth.enable = true;
local.enable = true;
nix.enable = true;
@ -60,9 +67,7 @@
settings = {
server = {
systemTrayEnabled = true;
extensionRepos = [
"https://raw.githubusercontent.com/keiyoushi/extensions/repo/index.min.json"
];
extensionRepos = [ "https://raw.githubusercontent.com/keiyoushi/extensions/repo/index.min.json" ];
webUIEnabled = true;
initialOpenInBrowserEnabled = true;
webUIInterface = "browser";
@ -103,6 +108,10 @@
networking.hosts = {
"192.168.88.251" = [ "wiki.it3" ];
"192.168.88.252" = [ "pi400" ];
"127.0.0.1" = [ "local" "rss.local" "manga.local" ];
"127.0.0.1" = [
"local"
"rss.local"
"manga.local"
];
};
}

View file

@ -1,4 +1,9 @@
{ config, lib, modulesPath, ... }:
{
config,
lib,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
@ -22,11 +27,9 @@
fsType = "ext4";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/8569ee66-b939-4ce8-a94a-dca7df5e301b"; }];
swapDevices = [ { device = "/dev/disk/by-uuid/8569ee66-b939-4ce8-a94a-dca7df5e301b"; } ];
networking.useDHCP = lib.mkDefault true;
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,22 +1,38 @@
{ self, nixpkgs, inputs }:
{
self,
nixpkgs,
inputs,
}:
let
mkSystem = systemConfig: name: nixpkgs.lib.nixosSystem rec {
system = builtins.replaceStrings [ "-unknown-" "-gnu" ] [ "-" "" ] systemConfig;
specialArgs = inputs;
modules = [
./${name}
self.outputs.nixosModules.default
{
system.stateVersion = "24.05";
nixpkgs.hostPlatform = {
system = system;
config = systemConfig;
};
networking.hostName = name;
}
];
};
mkSystem =
systemConfig: name:
nixpkgs.lib.nixosSystem rec {
system =
builtins.replaceStrings
[
"-unknown-"
"-gnu"
]
[
"-"
""
]
systemConfig;
specialArgs = inputs;
modules = [
./${name}
self.outputs.nixosModules.default
{
system.stateVersion = "24.05";
nixpkgs.hostPlatform = {
system = system;
config = systemConfig;
};
networking.hostName = name;
}
];
};
in
{
kuraokami = mkSystem "x86_64-unknown-linux-gnu" "kuraokami";

View file

@ -3,7 +3,9 @@
{
jopejoe1 = {
audio = { enable = true; };
audio = {
enable = true;
};
bluetooth.enable = true;
local.enable = true;
nix.enable = true;
@ -14,7 +16,6 @@
boot.systemd.enable = true;
};
environment.systemPackages = with pkgs; [ moonlight-qt ];
time.timeZone = "Europe/Berlin";

View file

@ -1,4 +1,9 @@
{ config, lib, modulesPath, ... }:
{
config,
lib,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
@ -22,11 +27,9 @@
fsType = "ext4";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/8569ee66-b939-4ce8-a94a-dca7df5e301b"; }];
swapDevices = [ { device = "/dev/disk/by-uuid/8569ee66-b939-4ce8-a94a-dca7df5e301b"; } ];
networking.useDHCP = lib.mkDefault true;
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -28,14 +28,20 @@
};
systemd.services.dns-rfc2136-conf = {
requiredBy = [ "acme-net0loggy.net.service" "bind.service" ];
before = [ "acme-net0loggy.net.service" "bind.service" ];
requiredBy = [
"acme-net0loggy.net.service"
"bind.service"
];
before = [
"acme-net0loggy.net.service"
"bind.service"
];
unitConfig = {
ConditionPathExists = "!/var/lib/secrets/dnskeys.conf";
};
serviceConfig = {
Type = "oneshot";
UMask = 0077;
UMask = 77;
};
path = [ pkgs.bind ];
script = ''

View file

@ -1,4 +1,10 @@
{ config, pkgs, lib, self, ... }:
{
config,
pkgs,
lib,
self,
...
}:
{
@ -24,7 +30,10 @@
ssh.enable = true;
};
boot.initrd.availableKernelModules = [ "ahci" "nvme" ];
boot.initrd.availableKernelModules = [
"ahci"
"nvme"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];

View file

@ -1,17 +1,54 @@
{ config, pkgs, lib, ...}:
{
config,
pkgs,
lib,
...
}:
{
mailserver = {
enable = true;
fqdn = "mail.missing.ninja";
domains = [ "missing.ninja" "joens.zone" "joens.website" "joens.site" "joens.online" "joens.link" "joens.international" "joens.family" "joens.digital" "joens.blog" "net0loggy.net" "clan-war.net" "net0loggy.de" "dtg-c.de" "joens.email" ];
domains = [
"missing.ninja"
"joens.zone"
"joens.website"
"joens.site"
"joens.online"
"joens.link"
"joens.international"
"joens.family"
"joens.digital"
"joens.blog"
"net0loggy.net"
"clan-war.net"
"net0loggy.de"
"dtg-c.de"
"joens.email"
];
# A list of all login accounts. To create the password hashes, use
# nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt'
loginAccounts = {
"jopejoe1@missing.ninja" = {
hashedPassword = "$2b$05$ZZk/X.gQqjRc08ej9XTuaO0aVnWjPGWUqo/xYGxHGsMEyDL.Hr8AS";
aliases = [ "@missing.ninja" "@joens.zone" "@joens.website" "@joens.site" "@joens.online" "@joens.link" "@joens.international" "@joens.family" "@joens.digital" "@joens.blog" "@net0loggy.net" "@clan-war.net" "@net0loggy.de" "@dtg-c.de" "@joens.email" ];
aliases = [
"@missing.ninja"
"@joens.zone"
"@joens.website"
"@joens.site"
"@joens.online"
"@joens.link"
"@joens.international"
"@joens.family"
"@joens.digital"
"@joens.blog"
"@net0loggy.net"
"@clan-war.net"
"@net0loggy.de"
"@dtg-c.de"
"@joens.email"
];
};
};
@ -30,18 +67,21 @@
};
services.roundcube = {
enable = true;
# this is the url of the vhost, not necessarily the same as the fqdn of
# the mailserver
hostName = "webmail.missing.ninja";
extraConfig = ''
# starttls needed for authentication, so the fqdn required to match
# the certificate
$config['smtp_server'] = "tls://${config.mailserver.fqdn}";
$config['smtp_user'] = "%u";
$config['smtp_pass'] = "%p";
'';
enable = true;
# this is the url of the vhost, not necessarily the same as the fqdn of
# the mailserver
hostName = "webmail.missing.ninja";
extraConfig = ''
# starttls needed for authentication, so the fqdn required to match
# the certificate
$config['smtp_server'] = "tls://${config.mailserver.fqdn}";
$config['smtp_user'] = "%u";
$config['smtp_pass'] = "%p";
'';
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowedTCPPorts = [
80
443
];
}

View file

@ -1,4 +1,4 @@
{ config, pkgs, ...}:
{ config, pkgs, ... }:
let
fqdn = "matrix.missing.ninja";
@ -54,9 +54,7 @@ in
server_name = "missing.ninja";
registration_shared_secret = "";
public_baseurl = baseUrl;
app_service_config_files = [
"/var/lib/matrix-synapse/whatsapp-registration.yaml"
];
app_service_config_files = [ "/var/lib/matrix-synapse/whatsapp-registration.yaml" ];
listeners = [
{
port = 8448;
@ -66,7 +64,10 @@ in
x_forwarded = true;
resources = [
{
names = [ "client" "federation" ];
names = [
"client"
"federation"
];
compress = true;
}
];

View file

@ -1,4 +1,9 @@
{config, pkgs, self, ...}:
{
config,
pkgs,
self,
...
}:
{
services.nginx = {
@ -9,7 +14,21 @@
recommendedProxySettings = true;
virtualHosts = {
"missing.ninja" = {
serverAliases = [ "joens.zone" "joens.website" "joens.site" "joens.online" "joens.link" "joens.international" "joens.family" "joens.digital" "joens.blog" "net0loggy.net" "clan-war.net" "net0loggy.de" "dtg-c.de" ];
serverAliases = [
"joens.zone"
"joens.website"
"joens.site"
"joens.online"
"joens.link"
"joens.international"
"joens.family"
"joens.digital"
"joens.blog"
"net0loggy.net"
"clan-war.net"
"net0loggy.de"
"dtg-c.de"
];
enableACME = true;
forceSSL = true;
};
@ -23,9 +42,7 @@
locations."/socket.io/" = {
proxyPass = "http://localhost:3333";
proxyWebsockets = true;
extraConfig =
"proxy_ssl_server_name on;"
;
extraConfig = "proxy_ssl_server_name on;";
};
};
"test.missing.ninja" = {
@ -57,24 +74,25 @@
max_input_time = 300
'';
services.wordpress.sites."test.missing.ninja" = with self.packages.${config.nixpkgs.hostPlatform.system}; {
themes = [
madara
madara-child
pkgs.wordpressPackages.themes.twentytwentythree
];
plugins = [
madara-core
madara-shortcodes
option-tree
option-tree-lean
widget-logic
];
settings = {
FORCE_SSL_ADMIN = true;
services.wordpress.sites."test.missing.ninja" =
with self.packages.${config.nixpkgs.hostPlatform.system}; {
themes = [
madara
madara-child
pkgs.wordpressPackages.themes.twentytwentythree
];
plugins = [
madara-core
madara-shortcodes
option-tree
option-tree-lean
widget-logic
];
settings = {
FORCE_SSL_ADMIN = true;
};
extraConfig = ''
$_SERVER['HTTPS']='on';
'';
};
extraConfig = ''
$_SERVER['HTTPS']='on';
'';
};
}

View file

@ -1,16 +1,22 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
with lib;
let
mailAccounts = config.mailserver.loginAccounts;
htpasswd = pkgs.writeText "radicale.users" (concatStrings
(flip mapAttrsToList mailAccounts (mail: user:
mail + ":" + user.hashedPassword + "\n"
))
htpasswd = pkgs.writeText "radicale.users" (
concatStrings (
flip mapAttrsToList mailAccounts (mail: user: mail + ":" + user.hashedPassword + "\n")
)
);
in {
in
{
services.radicale = {
enable = true;
settings = {

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
jopejoe1 = {
@ -10,11 +15,10 @@
ssh.enable = true;
};
time.timeZone = "Europe/Berlin";
services.openssh.settings.PermitRootLogin = lib.mkForce "yes";
boot.loader = {
efi = {
canTouchEfiVariables = false;

View file

@ -1,4 +1,11 @@
{ config, pkgs, lib, nixos-hardware, self, ... }:
{
config,
pkgs,
lib,
nixos-hardware,
self,
...
}:
{
imports = [
@ -105,25 +112,25 @@
environment.systemPackages = with pkgs; [
localPkgs.prismlauncher-withExtraStuff
mixxx
(picard.overrideAttrs{
dontUseSetuptoolsCheck = true;
})
(picard.overrideAttrs { dontUseSetuptoolsCheck = true; })
goverlay
(strawberry-qt6.overrideAttrs (finalAttrs: previousAttrs: {
version = "1.1.0-rc3";
src = fetchFromGitHub {
owner = "strawberrymusicplayer";
repo = "strawberry";
rev = "1.1.0-rc3";
hash = "sha256-4LhFxCi0ixMAjVaNVrQrLc0Vf1Z2dhnw6DTfTqtpiC4=";
};
buildInputs = previousAttrs.buildInputs ++ [
kdsingleapplication
gst_all_1.gst-plugins-rs
kdePackages.qtsvg
kdePackages.qtimageformats
];
}))
(strawberry-qt6.overrideAttrs (
finalAttrs: previousAttrs: {
version = "1.1.0-rc3";
src = fetchFromGitHub {
owner = "strawberrymusicplayer";
repo = "strawberry";
rev = "1.1.0-rc3";
hash = "sha256-4LhFxCi0ixMAjVaNVrQrLc0Vf1Z2dhnw6DTfTqtpiC4=";
};
buildInputs = previousAttrs.buildInputs ++ [
kdsingleapplication
gst_all_1.gst-plugins-rs
kdePackages.qtsvg
kdePackages.qtimageformats
];
}
))
libreoffice-qt
jitsi-meet-electron
thunderbird
@ -139,9 +146,7 @@
gamemode.enable = true;
appimage = {
enable = true;
package = pkgs.appimage-run.override {
extraPkgs = pkgs: [ pkgs.brotli ];
};
package = pkgs.appimage-run.override { extraPkgs = pkgs: [ pkgs.brotli ]; };
};
gnupg.agent = {
enable = true;
@ -150,13 +155,28 @@
};
};
nix.settings.system-features = [ "gccarch-alderlake" "benchmark" "big-parallel" "kvm" "nixos-test" ]
++ map (x: "gccarch-${x}") (lib.systems.architectures.inferiors.alderlake or [ ]);
nix.settings.system-features = [
"gccarch-alderlake"
"benchmark"
"big-parallel"
"kvm"
"nixos-test"
] ++ map (x: "gccarch-${x}") (lib.systems.architectures.inferiors.alderlake or [ ]);
boot.binfmt.emulatedSystems = [ "riscv64-linux" "aarch64-linux" ];
boot.binfmt.emulatedSystems = [
"riscv64-linux"
"aarch64-linux"
];
programs.nix-ld = {
enable = true;
libraries = with pkgs; [ libz xz xorg.libX11 freetype zstd dbus ];
libraries = with pkgs; [
libz
xz
xorg.libX11
freetype
zstd
dbus
];
};
}

View file

@ -1,7 +1,12 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }:
{
config,
lib,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
@ -20,9 +25,20 @@
};
};
boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" "sr_mod" ];
boot.initrd.availableKernelModules = [
"vmd"
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"sd_mod"
"sr_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" "nouveau" ];
boot.kernelModules = [
"kvm-intel"
"nouveau"
];
boot.extraModulePackages = [ ];
fileSystems = {
@ -38,7 +54,10 @@
"/media/gaming" = {
device = "/dev/disk/by-uuid/4038F97238F966F6";
fsType = "ntfs";
options = [ "rw" "uid=1000" ];
options = [
"rw"
"uid=1000"
];
};
};

View file

@ -1,4 +1,11 @@
{ config, pkgs, lib, nixos-hardware, self, ... }:
{
config,
pkgs,
lib,
nixos-hardware,
self,
...
}:
{
imports = [
@ -73,9 +80,17 @@
};
};
nix.settings.system-features = [ "benchmark" "big-parallel" "kvm" "nixos-test" ];
nix.settings.system-features = [
"benchmark"
"big-parallel"
"kvm"
"nixos-test"
];
boot.binfmt.emulatedSystems = [ "riscv64-linux" "aarch64-linux" ];
boot.binfmt.emulatedSystems = [
"riscv64-linux"
"aarch64-linux"
];
boot.plymouth = {
enable = true;
};

View file

@ -1,34 +1,49 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }:
{
config,
lib,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"thunderbolt"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/6842a9de-c5fd-4648-b3b8-f76e56633825";
fsType = "ext4";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/6842a9de-c5fd-4648-b3b8-f76e56633825";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-eaed8652-a306-4434-a187-71e6fcb13e71".device = "/dev/disk/by-uuid/eaed8652-a306-4434-a187-71e6fcb13e71";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/7C5A-EE45";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/7C5A-EE45";
fsType = "vfat";
options = [
"fmask=0022"
"dmask=0022"
];
};
fileSystems."/home/jopejoe1/Public/games" =
{ device = "/dev/sda";
fsType = "bcachefs";
options = [ "compression=zstd" ];
};
fileSystems."/home/jopejoe1/Public/games" = {
device = "/dev/sda";
fsType = "bcachefs";
options = [ "compression=zstd" ];
};
swapDevices = [ ];

View file

@ -1,4 +1,9 @@
{ modulesPath, lib, nixos-hardware, ... }:
{
modulesPath,
lib,
nixos-hardware,
...
}:
{
imports = [
@ -7,8 +12,12 @@
];
boot = {
initrd = { availableKernelModules = [ "xhci_pci" ]; };
loader = { generic-extlinux-compatible.enable = true; };
initrd = {
availableKernelModules = [ "xhci_pci" ];
};
loader = {
generic-extlinux-compatible.enable = true;
};
};
hardware.raspberry-pi."4".fkms-3d.enable = true;

View file

@ -1,4 +1,10 @@
{ modulesPath, lib, nixos-hardware, pkgs, ... }:
{
modulesPath,
lib,
nixos-hardware,
pkgs,
...
}:
{
imports = [
@ -7,11 +13,23 @@
];
boot = {
initrd = { availableKernelModules = [ "xhci_pci" ]; };
initrd = {
availableKernelModules = [ "xhci_pci" ];
};
kernelPackages = pkgs.linuxPackages_latest;
};
boot.supportedFilesystems = lib.mkForce [ "btrfs" "cifs" "f2fs" "jfs" "ntfs" "reiserfs" "vfat" "xfs" "bchachefs" ];
boot.supportedFilesystems = lib.mkForce [
"btrfs"
"cifs"
"f2fs"
"jfs"
"ntfs"
"reiserfs"
"vfat"
"xfs"
"bchachefs"
];
#hardware.raspberry-pi."4".fkms-3d.enable = true;

View file

@ -1,4 +1,9 @@
{ modulesPath, lib, nixos-hardware, ... }:
{
modulesPath,
lib,
nixos-hardware,
...
}:
{
imports = [
@ -7,8 +12,12 @@
];
boot = {
initrd = { availableKernelModules = [ "xhci_pci" ]; };
loader = { generic-extlinux-compatible.enable = true; };
initrd = {
availableKernelModules = [ "xhci_pci" ];
};
loader = {
generic-extlinux-compatible.enable = true;
};
};
fileSystems."/" = {

View file

@ -1,4 +1,9 @@
{ config, pkgs, nixos-hardware, ... }:
{
config,
pkgs,
nixos-hardware,
...
}:
{
imports = [
@ -43,14 +48,18 @@
enable = true;
keyMap = "us";
};
services.xserver = { layout = "us"; };
services.xserver = {
layout = "us";
};
boot = {
supportedFilesystems = [ "ntfs" "btrfs" ];
supportedFilesystems = [
"ntfs"
"btrfs"
];
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
};
}

View file

@ -19,10 +19,12 @@
fsType = "vfat";
};
swapDevices = [{
device = "/var/lib/swapfile";
size = (4 * 1024) + (2 * 1024);
}];
swapDevices = [
{
device = "/var/lib/swapfile";
size = (4 * 1024) + (2 * 1024);
}
];
networking.wireless.enable = true;
@ -37,4 +39,3 @@
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.enableRedistributableFirmware = true;
}

View file

@ -1,4 +1,11 @@
{ config, pkgs, lib, modulesPath, self, ... }:
{
config,
pkgs,
lib,
modulesPath,
self,
...
}:
{
jopejoe1 = {
@ -13,16 +20,22 @@
gui.enable = false;
};
imports =
[
(modulesPath + "/profiles/qemu-guest.nix")
self.inputs.srvos.nixosModules.server
self.inputs.srvos.nixosModules.mixins-cloud-init
self.inputs.srvos.nixosModules.mixins-nginx
./wp-test.nix
];
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
self.inputs.srvos.nixosModules.server
self.inputs.srvos.nixosModules.mixins-cloud-init
self.inputs.srvos.nixosModules.mixins-nginx
./wp-test.nix
];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"virtio_scsi"
"sd_mod"
"sr_mod"
];
networking.useDHCP = false;
@ -44,10 +57,10 @@
#"db.missing.ninja" = {
# enableACME = true;
# forceSSL = true;
# locations."/" = {
# locations."/" = {
# proxyPass = "http://134.255.219.135:8000/";
# };
# };
# };
# };
};
services.nginx.enable = true;
@ -70,8 +83,16 @@
networking.firewall = {
enable = true;
allowedTCPPorts = [ 80 443 8000 ];
allowedUDPPorts = [ 80 443 8000 ];
allowedTCPPorts = [
80
443
8000
];
allowedUDPPorts = [
80
443
8000
];
};
users.users.fp = {
@ -88,7 +109,10 @@
services.openssh.settings.PermitRootLogin = lib.mkForce "yes";
services.openssh.ports = [ 8081 22 ];
services.openssh.ports = [
8081
22
];
services.surrealdb.enable = false;
services.surrealdb.host = "134.255.219.135";

View file

@ -1,4 +1,9 @@
{pkgs, config, lib, ...}:
{
pkgs,
config,
lib,
...
}:
{
services.nginx = {
@ -58,7 +63,7 @@
};
};
users.users.www-wordpress= {
users.users.www-wordpress = {
isNormalUser = true;
group = "www-wordpress";
packages = with pkgs; [
@ -96,37 +101,48 @@
# ensurePermissions = { "www-wordpress.*" = "ALL PRIVILEGES"; };
# }
#];
};
};
systemd.services =
let
secretsVars = [ "AUTH_KEY" "SECURE_AUTH_KEY" "LOGGED_IN_KEY" "NONCE_KEY" "AUTH_SALT" "SECURE_AUTH_SALT" "LOGGED_IN_SALT" "NONCE_SALT" ];
secretsScript = hostStateDir: ''
# The match in this line is not a typo, see https://github.com/NixOS/nixpkgs/pull/124839
grep -q "LOOGGED_IN_KEY" "${hostStateDir}/secret-keys.php" && rm "${hostStateDir}/secret-keys.php"
if ! test -e "${hostStateDir}/secret-keys.php"; then
umask 0177
echo "<?php" >> "${hostStateDir}/secret-keys.php"
${lib.concatMapStringsSep "\n" (var: ''
echo "define('${var}', '`tr -dc a-zA-Z0-9 </dev/urandom | head -c 64`');" >> "${hostStateDir}/secret-keys.php"
'') secretsVars}
echo "?>" >> "${hostStateDir}/secret-keys.php"
chmod 440 "${hostStateDir}/secret-keys.php"
fi
'';
in
{
"wordpress-init" = {
wantedBy = [ "multi-user.target" ];
before = [ "phpfpm-wordpress.service" ];
after = [ "mysql.service" ];
script = secretsScript "/var/www/wordpress/";
systemd.services =
let
secretsVars = [
"AUTH_KEY"
"SECURE_AUTH_KEY"
"LOGGED_IN_KEY"
"NONCE_KEY"
"AUTH_SALT"
"SECURE_AUTH_SALT"
"LOGGED_IN_SALT"
"NONCE_SALT"
];
secretsScript = hostStateDir: ''
# The match in this line is not a typo, see https://github.com/NixOS/nixpkgs/pull/124839
grep -q "LOOGGED_IN_KEY" "${hostStateDir}/secret-keys.php" && rm "${hostStateDir}/secret-keys.php"
if ! test -e "${hostStateDir}/secret-keys.php"; then
umask 0177
echo "<?php" >> "${hostStateDir}/secret-keys.php"
${
lib.concatMapStringsSep "\n" (var: ''
echo "define('${var}', '`tr -dc a-zA-Z0-9 </dev/urandom | head -c 64`');" >> "${hostStateDir}/secret-keys.php"
'') secretsVars
}
echo "?>" >> "${hostStateDir}/secret-keys.php"
chmod 440 "${hostStateDir}/secret-keys.php"
fi
'';
in
{
"wordpress-init" = {
wantedBy = [ "multi-user.target" ];
before = [ "phpfpm-wordpress.service" ];
after = [ "mysql.service" ];
script = secretsScript "/var/www/wordpress/";
serviceConfig = {
Type = "oneshot";
User = "www-wordpress";
Group = "nginx";
serviceConfig = {
Type = "oneshot";
User = "www-wordpress";
Group = "nginx";
};
};
};
};
}