add dn-server

This commit is contained in:
DACHXY 2025-03-15 20:07:06 +08:00
parent a304926231
commit 735228acb6
17 changed files with 485 additions and 2 deletions

View file

@ -0,0 +1,4 @@
{
boot.swraid.enable = true;
boot.swraid.mdadmConf = "\n MAILADDR smitty\n ARRAY /dev/md126 metadata=1.2 name=stuff:0\n UUID=f3c41e6f:7e27b57f:8b44503a:42538a51\n ";
}

View file

@ -0,0 +1,48 @@
{
modulesPath,
lib,
pkgs,
nix-version,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
(modulesPath + "/profiles/qemu-guest.nix")
./disk.nix
./boot.nix
];
# boot.loader.systemd-boot.enable = true;
boot.loader.grub = {
enable = true;
efiSupport = true;
efiInstallAsRemovable = true;
devices = [ "/dev/md126" ];
};
boot.kernelPackages = pkgs.linuxPackages_latest;
services.openssh = {
enable = true;
ports = [
22
30072
];
settings = {
PasswordAuthentication = true;
PermitRootLogin = "yes";
};
};
environment.systemPackages = map lib.lowPrio [
pkgs.curl
pkgs.gitMinimal
];
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBzLpMKn0Q24ACC6k/7lOX0FIdcFhq15NY6849yROeUK danny@dn-pre7780"
];
system.stateVersion = nix-version;
}

View file

@ -0,0 +1,34 @@
{ lib, ... }:
{
disko.devices = {
disk = {
main = {
device = "/dev/disk/by-id/md-uuid-f3c41e6f:7e27b57f:8b44503a:42538a51";
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
type = "EF00";
size = "500M";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
}