From ff2317bf3eb3b322d2c65b4ab5bfc8ffb5393c4b Mon Sep 17 00:00:00 2001 From: willifan Date: Sun, 4 Aug 2024 11:55:07 +0200 Subject: [PATCH 1/3] added invidious --- hosts/Anton/default.nix | 1 + hosts/Anton/firewall.nix | 2 +- hosts/Anton/invidious.nix | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 hosts/Anton/invidious.nix diff --git a/hosts/Anton/default.nix b/hosts/Anton/default.nix index 1a0d437..a566158 100644 --- a/hosts/Anton/default.nix +++ b/hosts/Anton/default.nix @@ -9,6 +9,7 @@ ./firewall.nix ./gitea.nix ./hardware-configuration.nix + ./invidious.nix ./radicale.nix ./syncthing.nix diff --git a/hosts/Anton/firewall.nix b/hosts/Anton/firewall.nix index d5b7378..8067bfc 100644 --- a/hosts/Anton/firewall.nix +++ b/hosts/Anton/firewall.nix @@ -2,7 +2,7 @@ { networking.firewall = { enable = true; - allowedTCPPorts = [ 22 80 443 3000 8384 ]; + allowedTCPPorts = [ 22 80 443 3000 3001 8384 ]; allowedUDPPorts = [ 22 80 443 ]; }; } diff --git a/hosts/Anton/invidious.nix b/hosts/Anton/invidious.nix new file mode 100644 index 0000000..30ec387 --- /dev/null +++ b/hosts/Anton/invidious.nix @@ -0,0 +1,23 @@ +{ pkgs, lib, ... }: +{ + services.invidious = { + enable = true; + port = 3001; + settings = { + db = { + user = lib.mkForce "invidious"; + password = lib.mkForce "invidious"; +# host = lib.mkDefault "localhost"; +# port = 5432; +# dbname = lib.mkForce "kemal"; + }; + popular_enabled = false; + + quality = "dash"; + volume = 10; + save_player_pos = true; + unseen_only = true; + local = true; + }; + }; +} From 44e603d23c1f30ed27c664dabcaefcddc81fdf4c Mon Sep 17 00:00:00 2001 From: willifan Date: Wed, 7 Aug 2024 21:28:46 +0200 Subject: [PATCH 2/3] added minecraft server --- flake.nix | 4 ++-- hosts/Anton/default.nix | 1 + hosts/Anton/minecraft.nix | 11 +++++++++++ hosts/common/default.nix | 3 +-- 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 hosts/Anton/minecraft.nix diff --git a/flake.nix b/flake.nix index e12f9a9..bc6339c 100644 --- a/flake.nix +++ b/flake.nix @@ -32,8 +32,8 @@ let system = "x86_64-linux"; lib = nixpkgs.lib; - pkgs = nixpkgs.legacyPackages.${system}; - pkgs-unstable = nixpkgs-unstable.legacyPackages.${system}; + pkgs = import nixpkgs { system = "x86_64-linux"; config = { allowUnfree = true; }; }; + pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; config = { allowUnfree = true; }; }; in { nixosConfigurations = { diff --git a/hosts/Anton/default.nix b/hosts/Anton/default.nix index a566158..8a1c65f 100644 --- a/hosts/Anton/default.nix +++ b/hosts/Anton/default.nix @@ -10,6 +10,7 @@ ./gitea.nix ./hardware-configuration.nix ./invidious.nix + ./minecraft.nix ./radicale.nix ./syncthing.nix diff --git a/hosts/Anton/minecraft.nix b/hosts/Anton/minecraft.nix new file mode 100644 index 0000000..3213cc8 --- /dev/null +++ b/hosts/Anton/minecraft.nix @@ -0,0 +1,11 @@ +{ pkgs, pkgs-unstable, ...}: +{ + services.minecraft-server = { + eula = true; + enable = true; + package = pkgs-unstable.minecraft-server; + jvmOpts = "-Xms4096M -Xmx8192M"; + dataDir = "/mnt/data/services/minecraft"; + openFirewall = true; + }; +} diff --git a/hosts/common/default.nix b/hosts/common/default.nix index d717b42..ff43091 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -1,4 +1,4 @@ -{ pkgs, hostname, ... }: +{ pkgs, pkgs-unstable, hostname, ... }: { imports = [ ./autoupdate.nix @@ -11,7 +11,6 @@ hostName = "${hostname}"; }; console.keyMap = "de"; - nixpkgs.config.allowUnfree = true; nix.settings.experimental-features = [ "nix-command" "flakes" ]; system.stateVersion = "23.11"; } From 8a861f04238f06eb48eae650faa9e4f1fb8a0704 Mon Sep 17 00:00:00 2001 From: willifan Date: Sun, 11 Aug 2024 09:34:01 +0200 Subject: [PATCH 3/3] fix invidious database issue --- hosts/Anton/invidious.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hosts/Anton/invidious.nix b/hosts/Anton/invidious.nix index 30ec387..b09d59c 100644 --- a/hosts/Anton/invidious.nix +++ b/hosts/Anton/invidious.nix @@ -6,10 +6,10 @@ settings = { db = { user = lib.mkForce "invidious"; - password = lib.mkForce "invidious"; -# host = lib.mkDefault "localhost"; +# password = lib.mkForce "invidious"; +# host = lib.mkForce "localhost"; # port = 5432; -# dbname = lib.mkForce "kemal"; +# dbname = lib.mkForce "invidious"; }; popular_enabled = false;