aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorspl3g <spleefer6@yandex.ru>2025-04-28 06:25:20 +0300
committerspl3g <spleefer6@yandex.ru>2025-05-01 14:59:18 +0300
commita4f185292f9d040fb7a9100ea206233e6f61f9ac (patch)
tree442c07f70a9c7138dd5b0511dc78c1787a7bbf42 /nixos
parentaf2d338cc6d2631f128d5e978702b4ab26ff7407 (diff)
feat: add cloud configuration
Diffstat (limited to 'nixos')
-rw-r--r--nixos/server/configuration.nix71
1 files changed, 71 insertions, 0 deletions
diff --git a/nixos/server/configuration.nix b/nixos/server/configuration.nix
new file mode 100644
index 0000000..6e14300
--- /dev/null
+++ b/nixos/server/configuration.nix
@@ -0,0 +1,71 @@
+{ pkgs, inputs, outputs, lib, config, ... }:
+
+{
+ nixpkgs = {
+ overlays = [
+ outputs.overlays.additions
+ outputs.overlays.modifications
+ outputs.overlays.unstable-packages
+ ];
+ config = {
+ allowUnfree = true;
+ };
+ };
+
+ nix = {
+ # This will add each flake input as a registry
+ # To make nix3 commands consistent with your flake
+ registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
+
+ # This will additionally add your inputs to the system's legacy channels
+ # Making legacy nix commands consistent as well, awesome!
+ nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
+
+ gc = {
+ automatic = true;
+ dates = "weekly";
+ };
+
+ settings = {
+ # Enable flakes and new 'nix' command
+ experimental-features = "nix-command flakes";
+ # Deduplicate and optimize nix store
+ auto-optimise-store = true;
+
+ trusted-users = [ "root" "@wheel" ];
+ };
+ };
+
+ virtualisation.docker.enable = true;
+
+ # services.nginx = {
+ # enable = true;
+ # virtualHosts."kcu.su" = {
+ # forceSSL = true;
+ # enableACME = true;
+ # locations."/xray" = {
+ # proxyPass = "http://127.0.0.1:42069";
+ # extraConfig = "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ # proxy_set_header X-Forwarded-Proto $scheme;
+ # proxy_set_header Host $http_host;
+ # proxy_set_header X-Real-IP $remote_addr;
+ # proxy_set_header Range $http_range;
+ # proxy_set_header If-Range $http_if_range;
+ # proxy_redirect off;";
+ # };
+ # };
+ # };
+
+ services.k3s = {
+ enable = true;
+ role = "server";
+ };
+
+ security.acme = {
+ acceptTerms = true;
+ defaults.email = "notspl3g@duck.com";
+ };
+
+ # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
+ system.stateVersion = "24.04";
+}