Configuration for alo-cloud-1

This commit is contained in:
2024-01-03 19:11:59 +00:00
parent b69598465a
commit d4319ff7b6
5 changed files with 85 additions and 7 deletions

10
common/cloud-node.nix Normal file
View File

@@ -0,0 +1,10 @@
{ pkgs, ... }:
{
imports = [
./consul.nix
./impermanence.nix
./sshd.nix
./user-ppetru.nix
./systemd-boot.nix
];
}

View File

@@ -37,7 +37,7 @@
# We first mount the btrfs root to /mnt # We first mount the btrfs root to /mnt
# so we can manipulate btrfs subvolumes. # so we can manipulate btrfs subvolumes.
mount -o subvol=/ /dev/mapper/luksroot /mnt mount -o subvol=/ /dev/disk/by-label/btrfs /mnt
# While we're tempted to just delete /root and create # While we're tempted to just delete /root and create
# a new snapshot from /root-blank, /root is already # a new snapshot from /root-blank, /root is already

View File

@@ -12,13 +12,13 @@
outputs = { self, nixpkgs, nixpkgs-unstable, deploy-rs, ... }@inputs: outputs = { self, nixpkgs, nixpkgs-unstable, deploy-rs, ... }@inputs:
let let
inherit (self); inherit (self);
system = "x86_64-linux";
overlay-unstable = final: prev: { overlay-unstable = final: prev: {
unstable = nixpkgs-unstable.legacyPackages.${prev.system}; unstable = nixpkgs-unstable.legacyPackages.${prev.system};
}; };
mkNixos = modules: nixpkgs.lib.nixosSystem { mkNixos = system: modules: nixpkgs.lib.nixosSystem {
system = system;
modules = [ modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
] ++ modules; ] ++ modules;
@@ -26,10 +26,11 @@
}; };
in { in {
nixosConfigurations = { nixosConfigurations = {
c1 = mkNixos [ ./hosts/c1 ]; c1 = mkNixos "x86_64-linux" [ ./hosts/c1 ];
c2 = mkNixos [ ./hosts/c2 ]; c2 = mkNixos "x86_64-linux" [ ./hosts/c2 ];
c3 = mkNixos [ ./hosts/c3 ]; c3 = mkNixos "x86_64-linux" [ ./hosts/c3 ];
nix-dev = mkNixos [ ./hosts/nix-dev ]; nix-dev = mkNixos "x86_64-linux" [ ./hosts/nix-dev ];
alo-cloud-1 = mkNixos "aarch64-linux" [./hosts/alo-cloud-1 ];
}; };
deploy = { deploy = {
@@ -62,6 +63,13 @@
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.nix-dev; path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.nix-dev;
}; };
}; };
alo-cloud-1 = {
hostname = "49.13.163.72";
profiles.system = {
user = "root";
path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.alo-cloud-1;
};
};
}; };
}; };

View File

@@ -0,0 +1,14 @@
{ pkgs, inputs, ... }:
{
imports = [
../../common/global
../../common/cloud-node.nix
./hardware.nix
];
boot.initrd.kernelModules = [ "virtio_gpu" ];
boot.kernelParams = [ "console=tty" ];
networking.hostName = "alo-cloud-1";
services.tailscaleAutoconnect.authkey = "tskey-auth-kbdARC7CNTRL-pNQddmWV9q5C2sRV3WGep5ehjJ1qvcfD";
}

View File

@@ -0,0 +1,46 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "virtio_scsi" "usbhid" "sr_mod" ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/4275af2a-648c-4778-8090-7e5ef5c2846b";
fsType = "btrfs";
options = [ "subvol=root" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/4275af2a-648c-4778-8090-7e5ef5c2846b";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/persist" =
{ device = "/dev/disk/by-uuid/4275af2a-648c-4778-8090-7e5ef5c2846b";
fsType = "btrfs";
options = [ "subvol=persist" ];
};
fileSystems."/var/log" =
{ device = "/dev/disk/by-uuid/4275af2a-648c-4778-8090-7e5ef5c2846b";
fsType = "btrfs";
options = [ "subvol=log" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/FF9C-DC81";
fsType = "vfat";
};
swapDevices = [ {
device = "/dev/disk/by-label/swap";
}];
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}