summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.lock4
-rw-r--r--flake.nix3
-rw-r--r--machines/doretta/default.nix66
-rw-r--r--modules/nixos/binary-cache.nix18
4 files changed, 57 insertions, 34 deletions
diff --git a/flake.lock b/flake.lock
index ca13027..ff40682 100644
--- a/flake.lock
+++ b/flake.lock
@@ -653,7 +653,7 @@
"type": "github"
}
},
- "mms": {
+ "modded-minecraft-servers": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_3",
@@ -897,7 +897,7 @@
"hyprland": "hyprland",
"lix-module": "lix-module",
"microvm": "microvm",
- "mms": "mms",
+ "modded-minecraft-servers": "modded-minecraft-servers",
"nix-colors": "nix-colors",
"nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs_3",
diff --git a/flake.nix b/flake.nix
index 8b5fed1..11789ab 100644
--- a/flake.nix
+++ b/flake.nix
@@ -58,7 +58,7 @@
inputs.nixpkgs.follows = "nixpkgs";
};
- mms.url = "github:mkaito/nixos-modded-minecraft-servers";
+ modded-minecraft-servers.url = "github:mkaito/nixos-modded-minecraft-servers";
#secrets management, lock with git commit at 20xx/x/xx
#.........
@@ -255,6 +255,7 @@
];
};
doretta = lib.nixosSystem { # build server
+ specialArgs = { inherit inputs; };
modules = minimalHomeManagerSettings ++ [ ./machines/doretta
lix-module.nixosModules.default
microvm.nixosModules.host
diff --git a/machines/doretta/default.nix b/machines/doretta/default.nix
index 2290868..dc3d4aa 100644
--- a/machines/doretta/default.nix
+++ b/machines/doretta/default.nix
@@ -8,7 +8,9 @@
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
- ./website.nix
+
+ # ./website.nix
+ ../../modules/nixos/binary-cache.nix
../../modules/nixos/nix-common.nix
../../modules/nixos/environment.nix
@@ -16,6 +18,8 @@
../../modules/nixos/system-packages.nix
# microvm.host
+ ../../modules/nixos/minecraft-server.nix
+
../../modules/users/defin.nix
../../modules/users/git.nix
../../modules/users/root.nix
@@ -54,35 +58,35 @@
# mac = "02:00:00:00:00:01";
# }];
};
- systemd.network = {
- enable = true;
-
- netdevs."10-microvm" = {
- netdevConfig = {
- Name = "microvm";
- Kind = "bridge";
- };
- };
- networks = {
- "10-microvm" = {
- matchConfig.Name = "microvm";
- networkConfig = {
- DHCPServer = true;
- # IPv6SendRA = true;
- };
- addresses = [ {
- Address = "10.0.0.1/24"; # } {
- # Address = "fd12:3456:789a::1/64";
- } ];
- # ipv6Prefixes = [{ Prefix = "fd12:3456:789a::/64"; }];
- # ipv6PREF64Prefixes = [{ Prefix = "fd12:3456:789a::/64"; }];
- };
- "11-microvm" = {
- matchConfig.Name = "vm-*";
- # Attach to the bridge that was configured above
- networkConfig.Bridge = "microvm";
- };
- };
+ # systemd.network = {
+ # enable = true;
+
+ # netdevs."10-microvm" = {
+ # netdevConfig = {
+ # Name = "microvm";
+ # Kind = "bridge";
+ # };
+ # };
+ # networks = {
+ # "10-microvm" = {
+ # matchConfig.Name = "microvm";
+ # networkConfig = {
+ # DHCPServer = true;
+ # # IPv6SendRA = true;
+ # };
+ # addresses = [ {
+ # Address = "10.0.0.1/24"; # } {
+ # # Address = "fd12:3456:789a::1/64";
+ # } ];
+ # # ipv6Prefixes = [{ Prefix = "fd12:3456:789a::/64"; }];
+ # # ipv6PREF64Prefixes = [{ Prefix = "fd12:3456:789a::/64"; }];
+ # };
+ # "11-microvm" = {
+ # matchConfig.Name = "vm-*";
+ # # Attach to the bridge that was configured above
+ # networkConfig.Bridge = "microvm";
+ # };
+ # };
# "20-lan" = {
# matchConfig.Type = "ether";
@@ -117,7 +121,7 @@
# Kind = "bridge";
# };
# };
- };
+ # };
# Set your time zone.
time.timeZone = "US/Mountain";
diff --git a/modules/nixos/binary-cache.nix b/modules/nixos/binary-cache.nix
new file mode 100644
index 0000000..609a5dc
--- /dev/null
+++ b/modules/nixos/binary-cache.nix
@@ -0,0 +1,18 @@
+{config, ... }: {
+ services.nix-serve = {
+ enable = true;
+ secretKeyFile = "/var/secrets/cache-private-key.pem";
+ };
+
+ services.nginx = {
+ enable = true;
+ recommendedProxySettings = true;
+ virtualHosts.cache = {
+ locations."/".proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}";
+ };
+ };
+
+ networking.firewall.allowedTCPPorts = [
+ config.services.nginx.defaultHTTPListenPort
+ ];
+}