Compare commits

...

2 commits

Author SHA1 Message Date
♥ Minnie ♥ 65764d76ff
Migrate to nix-minecraft 2024-06-03 20:55:53 +08:00
♥ Minnie ♥ 354d4ffbe5
Migrate to nixos 24.05 2024-06-03 20:51:33 +08:00
7 changed files with 213 additions and 42 deletions

View file

@ -8,11 +8,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1714136352, "lastModified": 1716561646,
"narHash": "sha256-BtWQ2Th/jamO1SlD+2ASSW5Jaf7JhA/JLpQHk0Goqpg=", "narHash": "sha256-UIGtLO89RxKt7RF2iEgPikSdU53r6v/6WYB0RW3k89I=",
"owner": "ryantm", "owner": "ryantm",
"repo": "agenix", "repo": "agenix",
"rev": "24a7ea390564ccd5b39b7884f597cfc8d7f6f44e", "rev": "c2fc0762bbe8feb06a2e59a364fa81b3a57671c9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -31,11 +31,11 @@
"pre-commit-hooks": "pre-commit-hooks" "pre-commit-hooks": "pre-commit-hooks"
}, },
"locked": { "locked": {
"lastModified": 1713903302, "lastModified": 1717022817,
"narHash": "sha256-qPy0BYFTenmyG4EU+oXej0V/i4jSsVvWbGGrv9Sb0kQ=", "narHash": "sha256-PHyHgQL5/b0+A/kmNCHVOM/WSJSGe1jZ+LFWfYNx31E=",
"owner": "oddlama", "owner": "oddlama",
"repo": "agenix-rekey", "repo": "agenix-rekey",
"rev": "8da0392e75373711604a07907de25ec9d5277384", "rev": "c6c1ca5b9ceaaa40fd979fb25bb7043adf4554ad",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -104,6 +104,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems_3" "systems": "systems_3"
@ -122,6 +138,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": { "gitignore": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -172,16 +206,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1714043624, "lastModified": 1716736833,
"narHash": "sha256-Xn2r0Jv95TswvPlvamCC46wwNo8ALjRCMBJbGykdhcM=", "narHash": "sha256-rNObca6dm7Qs524O4st8VJH6pZ/Xe1gxl+Rx6mcWYo0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "86853e31dc1b62c6eeed11c667e8cdd0285d4411", "rev": "a631666f5ec18271e86a5cde998cba68c33d9ac6",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-23.11", "ref": "release-24.05",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@ -201,6 +235,26 @@
"type": "github" "type": "github"
} }
}, },
"nix-minecraft": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1717291958,
"narHash": "sha256-v8YSFLbnGoh8cW2SHfZqmQRmaeN60HVSMuHNeyCeWvw=",
"owner": "Infinidoge",
"repo": "nix-minecraft",
"rev": "756825ee4ac068fa3316c7cd58a364342012693b",
"type": "github"
},
"original": {
"owner": "Infinidoge",
"repo": "nix-minecraft",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1703013332, "lastModified": 1703013332,
@ -217,6 +271,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-master": {
"locked": {
"lastModified": 1717372969,
"narHash": "sha256-cyFuF5+g59NjOAkx7+oUrQfzzvWwzJvZTMTsl85JgJk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0fc0a545f5efbc7dbc3bbd6a2ec8280bff01d73e",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1685801374, "lastModified": 1685801374,
@ -235,11 +305,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1714076141, "lastModified": 1716948383,
"narHash": "sha256-Drmja/f5MRHZCskS6mvzFqxEaZMeciScCTFxWVLqWEY=", "narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "7bb2ccd8cdc44c91edba16c48d2c8f331fb3d856", "rev": "ad57eef4ef0659193044870c731987a6df5cf56b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -251,16 +321,32 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1714272655, "lastModified": 1715266358,
"narHash": "sha256-3/ghIWCve93ngkx5eNPdHIKJP/pMzSr5Wc4rNKE1wOc=", "narHash": "sha256-doPgfj+7FFe9rfzWo1siAV2mVCasW+Bh8I1cToAXEE4=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "12430e43bd9b81a6b4e79e64f87c624ade701eaf", "rev": "f1010e0469db743d14519a1efd37e23f8513d714",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-23.11", "ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1717144377,
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "805a384895c696f802a9bf5bf4720f37385df547",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -299,7 +385,9 @@
"agenix-rekey": "agenix-rekey", "agenix-rekey": "agenix-rekey",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"impermanence": "impermanence", "impermanence": "impermanence",
"nixpkgs": "nixpkgs_2", "nix-minecraft": "nix-minecraft",
"nixpkgs": "nixpkgs_3",
"nixpkgs-master": "nixpkgs-master",
"nixpkgs-unstable": "nixpkgs-unstable" "nixpkgs-unstable": "nixpkgs-unstable"
} }
}, },
@ -347,6 +435,21 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -3,22 +3,25 @@
inputs = { inputs = {
# Nixpkgs # Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Home manager # Home manager
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-23.11"; url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# Add any other flake you might need # Flakes our configuration is dependent on.
agenix.url = "github:ryantm/agenix"; agenix.url = "github:ryantm/agenix";
agenix-rekey = { agenix-rekey = {
url = "github:oddlama/agenix-rekey"; url = "github:oddlama/agenix-rekey";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
impermanence.url = "github:nix-community/impermanence"; impermanence.url = "github:nix-community/impermanence";
# Add any other flake you might need.
nix-minecraft.url = "github:Infinidoge/nix-minecraft";
}; };
outputs = { self, nixpkgs, home-manager, ... }@inputs: outputs = { self, nixpkgs, home-manager, ... }@inputs:

View file

@ -6,14 +6,12 @@
./homarr.nix ./homarr.nix
./jellyfin.nix ./jellyfin.nix
./jellyseerr.nix ./jellyseerr.nix
./minecraft.nix
./lidarr.nix ./lidarr.nix
./prowlarr.nix ./prowlarr.nix
./qbittorrent.nix ./qbittorrent.nix
./radarr.nix ./radarr.nix
./recyclarr.nix ./recyclarr.nix
./sonarr.nix ./sonarr.nix
./microbin ./microbin
]; ];
virtualisation.oci-containers.backend = "docker"; virtualisation.oci-containers.backend = "docker";

View file

@ -1,19 +0,0 @@
{ ... }:
{
virtualisation.oci-containers.containers = {
minecraft = {
autoStart = true;
image = "itzg/minecraft-server";
ports = [
"25565:25565"
];
volumes = [
"/srv/containers/minecraft:/data:rw"
];
environment = {
EULA = "true";
};
};
};
}

View file

@ -3,6 +3,7 @@
{ {
imports = [ imports = [
./traefik ./traefik
./minecraft
./borgbackup.nix ./borgbackup.nix
./mpd.nix ./mpd.nix
]; ];

View file

@ -0,0 +1,77 @@
{ inputs, pkgs, lib, ... }:
let
modpack = pkgs.fetchPackwizModpack rec {
version = "c9087bf";
url = "https://github.com/sajenim/minecraft-modpack/raw/${version}/pack.toml";
packHash = "sha256-F3moe9sxYSbJtPhkCRilqR91Ox+YlBrHN/dXykNajDs=";
};
mcVersion = modpack.manifest.versions.minecraft;
fabricVersion = modpack.manifest.versions.fabric;
serverVersion = lib.replaceStrings [ "." ] [ "_" ] "fabric-${mcVersion}";
in
{
imports = [
inputs.nix-minecraft.nixosModules.minecraft-servers
];
nixpkgs.overlays = [
inputs.nix-minecraft.overlay
];
services.minecraft-servers = {
# Enable all of our servers
enable = true;
# Our minecraft servers
servers = {
kanto = {
enable = true;
# The minecraft server package to use.
package = pkgs.fabricServers.${serverVersion}.override { loaderVersion = fabricVersion; }; # Specific fabric loader version.
# Allowed players
whitelist = {
jasmariiie = "82fc15bb-6839-4430-b5e9-39c5294ff32f";
Spectre_HWS = "491c085e-f0dc-44f1-9fdc-07c7cfcec8f2";
};
# JVM options for the minecraft server.
jvmOpts = "-Xmx8G";
# Minecraft server properties for the server.properties file.
serverProperties = {
gamemode = "survival";
difficulty = "normal";
motd = "\\u00A7aKanto Network \\u00A7e[1.19.2]\\u00A7r\\n\\u00A78I'll Use My Trusty Frying Pan As A Drying Pan!";
server-port = 25565;
white-list = true;
};
# Things to symlink into this server's data directory.
symlinks = {
"mods" = "${modpack}/mods";
};
# Things to copy into this server's data directory.
files = {
"ops.json" = ./ops.json;
# Youre in grave danger
"config/yigd.toml" = "${modpack}/config/yigd.toml";
};
# Value of systemd's `Restart=` service configuration option.
restart = "no";
};
};
# Each server will be under a subdirectory named after the server name.
dataDir = "/srv/services/minecraft";
# Open firewall for all servers.
openFirewall = true;
# https://account.mojang.com/documents/minecraft_eula
eula = true;
};
}

View file

@ -0,0 +1,8 @@
[
{
"uuid": "82fc15bb-6839-4430-b5e9-39c5294ff32f",
"name": "jasmariiie",
"level": 4
}
]