add rackserv vps configuration

This commit is contained in:
xunuwu 2025-06-01 12:03:22 +02:00
parent 9b237ce9b3
commit a1dc18d3c8
Signed by: xun
SSH key fingerprint: SHA256:Uot/1WoAjWAeqLOHA5vYy4phhVydsH7jCPmBjaPZfgI
6 changed files with 120 additions and 0 deletions

21
flake.lock generated
View file

@ -121,6 +121,26 @@
"type": "github" "type": "github"
} }
}, },
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1748225455,
"narHash": "sha256-AzlJCKaM4wbEyEpV3I/PUq5mHnib2ryEy32c+qfj6xk=",
"owner": "nix-community",
"repo": "disko",
"rev": "a894f2811e1ee8d10c50560551e50d6ab3c392ba",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"firefox-addons": { "firefox-addons": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -826,6 +846,7 @@
"inputs": { "inputs": {
"cloudflare-ipv4": "cloudflare-ipv4", "cloudflare-ipv4": "cloudflare-ipv4",
"cloudflare-ipv6": "cloudflare-ipv6", "cloudflare-ipv6": "cloudflare-ipv6",
"disko": "disko",
"firefox-addons": "firefox-addons", "firefox-addons": "firefox-addons",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"hardware": "hardware", "hardware": "hardware",

View file

@ -77,6 +77,9 @@
impermanence.url = "github:nix-community/impermanence"; impermanence.url = "github:nix-community/impermanence";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
own-website.url = "github:xunuwu/xunuwu.xyz"; own-website.url = "github:xunuwu/xunuwu.xyz";
own-website.inputs.nixpkgs.follows = "nixpkgs"; own-website.inputs.nixpkgs.follows = "nixpkgs";

View file

@ -2,3 +2,4 @@ config files for my puters
nixdesk - main desktop nixdesk - main desktop
hopper - server hopper - server
rackserv - cheap 2gb racknerd vps

View file

@ -0,0 +1,42 @@
{
lib,
pkgs,
inputs,
systemProfiles,
specialArgs,
self,
...
}: {
imports =
[
"${inputs.nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
inputs.impermanence.nixosModules.impermanence
inputs.disko.nixosModules.disko
./disk-config.nix
]
++ (map (x: systemProfiles + x) [
/core/security.nix
/core/tools.nix
/core/ssh.nix
/core/deploy.nix
/nix/default.nix
/network/tailscale.nix
/network/networkd.nix
]);
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
};
hardware.enableRedistributableFirmware = true;
environment.persistence."/persist".enable = false;
networking.hostName = "rackserv";
nixpkgs.hostPlatform.system = "x86_64-linux";
system.stateVersion = "25.05";
}

View file

@ -0,0 +1,52 @@
{lib, ...}: {
disko.devices = {
disk.disk1 = {
device = lib.mkDefault "/dev/vda";
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "1M";
type = "EF02";
};
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
name = "root";
size = "100%";
content = {
type = "lvm_pv";
vg = "pool";
};
};
};
};
};
lvm_vg = {
pool = {
type = "lvm_vg";
lvs = {
root = {
size = "100%FREE";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = ["defaults"];
};
};
};
};
};
};
}

View file

@ -3,6 +3,7 @@
tailnet = { tailnet = {
hopper = "100.99.196.113"; hopper = "100.99.196.113";
nixdesk = "100.104.163.5"; nixdesk = "100.104.163.5";
rackserv = "100.83.27.16";
}; };
sshKeys = { sshKeys = {
xun_nixdesk = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqW5ZkBV2XCdF/ZhwC1DOfrgiLxCC2ym6BO7miHi05M xun@nixdesk"; xun_nixdesk = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqW5ZkBV2XCdF/ZhwC1DOfrgiLxCC2ym6BO7miHi05M xun@nixdesk";