feat(nix): add new server

This commit is contained in:
Lucas Sta Maria 2025-08-12 13:01:24 +00:00
parent a40192bb99
commit 011bda8d02
No known key found for this signature in database
GPG key ID: F07FB16A826E3B47
4 changed files with 120 additions and 0 deletions

View file

@ -24,5 +24,15 @@
./nix/hosts/framework/sys.nix
];
};
nixosConfigurations.chaewon = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inputs = inputs; };
modules = [
home-manager.nixosModules.default
./nix/hosts/common/sys.nix
./nix/hosts/chaewon/sys.nix
];
};
};
}

View file

@ -0,0 +1,18 @@
{ inputs, configDir, config, pkgs, lib, ... }: {
home.stateVersion = "23.11";
home.packages = let
packages = with pkgs; [
fish
lsof
rsync
git
curl
wget
tailscale
nginx
];
in packages;
}

11
nix/hosts/chaewon/hw.nix Normal file
View file

@ -0,0 +1,11 @@
{ modulesPath, ... }: {
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.loader.grub.device = "/dev/sda";
boot.initrd.availableKernelModules =
[ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
boot.initrd.kernelModules = [ "nvme" ];
fileSystems."/" = {
device = "/dev/sda1";
fsType = "ext4";
};
}

81
nix/hosts/chaewon/sys.nix Normal file
View file

@ -0,0 +1,81 @@
{ inputs, config, pkgs, lib, ... }: {
imports = [ ./hw.nix ];
# Generated by nixos-infect
boot.tmp.cleanOnBoot = true;
zramSwap.enable = true;
networking.hostName = "chaewon-nixos-ash-1";
networking.domain = "";
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys = [''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBGpnPYxrYnmtFaf591Q80FQPb01dqTwlH58V6uRa7Fi'' ];
# Generated by nixos-infect
networking = {
nameservers = [ "8.8.8.8" ];
defaultGateway = "172.31.1.1";
defaultGateway6 = {
address = "fe80::1";
interface = "eth0";
};
dhcpcd.enable = false;
usePredictableInterfaceNames = lib.mkForce false;
interfaces = {
eth0 = {
ipv4.addresses = [{
address = "178.156.207.225";
prefixLength = 32;
}];
ipv6.addresses = [
{
address = "2a01:4ff:f0:7ccc::1";
prefixLength = 64;
}
{
address = "fe80::9000:6ff:fe59:7a8b";
prefixLength = 64;
}
];
ipv4.routes = [{
address = "172.31.1.1";
prefixLength = 32;
}];
ipv6.routes = [{
address = "fe80::1";
prefixLength = 128;
}];
};
};
};
services.udev.extraRules = ''
ATTR{address}=="92:00:06:59:7a:8b", NAME="eth0"
'';
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
users.users.priime = {
isNormalUser = true;
description = "Lucas";
extraGroups = [ "wheel" "docker" ];
packages = with pkgs; [ ];
shell = pkgs.fish;
openssh.authorizedKeys.keys = [''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBGpnPYxrYnmtFaf591Q80FQPb01dqTwlH58V6uRa7Fi''];
};
programs.fish.enable = true;
system.stateVersion = "23.11";
home-manager.users.priime = { pkgs, ... }: { imports = [ ./home.nix ]; };
}