From 011bda8d02d19a7ba781fa0ac6fa23f844196469 Mon Sep 17 00:00:00 2001 From: Lucas Sta Maria Date: Tue, 12 Aug 2025 13:01:24 +0000 Subject: [PATCH] feat(nix): add new server --- flake.nix | 10 +++++ nix/hosts/chaewon/home.nix | 18 +++++++++ nix/hosts/chaewon/hw.nix | 11 ++++++ nix/hosts/chaewon/sys.nix | 81 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 120 insertions(+) create mode 100644 nix/hosts/chaewon/home.nix create mode 100644 nix/hosts/chaewon/hw.nix create mode 100644 nix/hosts/chaewon/sys.nix diff --git a/flake.nix b/flake.nix index efc330a..a168203 100644 --- a/flake.nix +++ b/flake.nix @@ -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 + ]; + }; }; } diff --git a/nix/hosts/chaewon/home.nix b/nix/hosts/chaewon/home.nix new file mode 100644 index 0000000..1584655 --- /dev/null +++ b/nix/hosts/chaewon/home.nix @@ -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; +} diff --git a/nix/hosts/chaewon/hw.nix b/nix/hosts/chaewon/hw.nix new file mode 100644 index 0000000..7902335 --- /dev/null +++ b/nix/hosts/chaewon/hw.nix @@ -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"; + }; +} diff --git a/nix/hosts/chaewon/sys.nix b/nix/hosts/chaewon/sys.nix new file mode 100644 index 0000000..ae93434 --- /dev/null +++ b/nix/hosts/chaewon/sys.nix @@ -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 ]; }; +}