diff --git a/README.md b/README.md new file mode 100644 index 0000000..1266c4c --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +## Unified nix configuration + +Switch server: `nixos-rebuild switch --target-host root@posixlycorrect.com --use-substitutes --show-trace --flake .\#vps` +Switch current machine: `sudo nixos-rebuild switch --flake . --show-trace` +Switch current home manager: `home-manager switch --flake . --show-trace` +Update homepage: `nix flake update --commit-lock-file --update-input homepage` +Update whole flake: `nix flake update --commit-lock-file` \ No newline at end of file diff --git a/sys/modules/steam.nix b/sys/modules/steam.nix index a6cd543..057d0d2 100644 --- a/sys/modules/steam.nix +++ b/sys/modules/steam.nix @@ -19,13 +19,12 @@ in { }; environment = { - systemPackages = with pkgs; - [ - protontricks - protonup - protonup-ng - winetricks - ]; + systemPackages = with pkgs; [ + protontricks + protonup + protonup-ng + winetricks + ]; }; }; } diff --git a/sys/platforms/vps/srv/default.nix b/sys/platforms/vps/srv/default.nix index d6affda..3060eab 100644 --- a/sys/platforms/vps/srv/default.nix +++ b/sys/platforms/vps/srv/default.nix @@ -18,5 +18,6 @@ with lib; { ./shiori.nix ./calibre-web.nix ./immich.nix + ./wiki-js.nix ]; } diff --git a/sys/platforms/vps/srv/net.nix b/sys/platforms/vps/srv/net.nix index fc97444..6a83997 100644 --- a/sys/platforms/vps/srv/net.nix +++ b/sys/platforms/vps/srv/net.nix @@ -1,4 +1,5 @@ { + config, lib, pkgs, ... diff --git a/sys/platforms/vps/srv/wiki-js.nix b/sys/platforms/vps/srv/wiki-js.nix new file mode 100644 index 0000000..f852db5 --- /dev/null +++ b/sys/platforms/vps/srv/wiki-js.nix @@ -0,0 +1,53 @@ +{ + lib, + pkgs, + ... +}: +with lib; { + systemd.services.wiki-js = { + requires = ["postgresql.service"]; + after = ["postgresql.service"]; + }; + + services = { + nginx = { + virtualHosts."wjs.posixlycorrect.com" = { + enableACME = true; + forceSSL = true; + extraConfig = '' + proxy_headers_hash_max_size 512; + proxy_headers_hash_bucket_size 128; + ''; + locations."/" = { + proxyPass = "http://127.0.0.1:3000"; + }; + }; + }; + + wiki-js = { + enable = true; + environmentFile = "/var/trust/wiki-js/env.txt"; + settings = { + bindIP = "127.0.0.1"; + port = 3000; + db = { + db = "wiki-js"; + user = "wiki-js"; + type = "postgres"; + host = "/run/postgresql"; + }; + }; + }; + + postgresql = { + enable = true; + ensureDatabases = ["wiki-js"]; + ensureUsers = [ + { + name = "wiki-js"; + ensureDBOwnership = true; + } + ]; + }; + }; +}