Skip to content

Commit

Permalink
thatcher wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ifd3f committed Apr 27, 2024
1 parent 7481bf4 commit e1cf211
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ matrix.json
result
result-*
.direnv
*.raw
*.iso
*.tar
*.tar.gz
Expand Down
5 changes: 5 additions & 0 deletions machines/thatcher/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# `thatcher`

This is a VPS with glauca.digital.

Since it is a networking device, and networking devices are named after demons, and it is in Britain, it is therefore named after the well-known British demon, Margaret Thatcher.
52 changes: 52 additions & 0 deletions machines/thatcher/configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
inputs:
{ config, pkgs, lib, modulesPath, ... }:
let
rootGPUID = "fce194cc-1e7e-40e6-9164-41f7ffdaddad";
rootFSUID = "5a713012-c18f-4b4f-b900-137c5739c854";
in with lib; {
imports = [ inputs.self.nixosModules.server ];

astral = {
tailscale.enable = mkForce false;
monitoring-node.scrapeTransport = "https";
};

networking = {
hostName = "thatcher";
domain = "h.astrid.tech";
};

fileSystems."/" = mkForce {
device = "/dev/disk/by-uuid/${rootFSUID}";
fsType = "xfs";
autoResize = true;
};

boot = {
growPartition = true;
kernelParams = [ "console=tty0" ];
loader.grub.device = lib.mkDefault "/dev/vda";
loader.timeout = lib.mkDefault 0;
initrd.availableKernelModules = [ "uas" ];
};

system.build.raw = mkForce
(import "${toString modulesPath}/../lib/make-disk-image.nix" {
inherit lib config pkgs rootFSUID rootGPUID;
diskSize = "auto";
format = "raw";
});

system.build.test-simple-vm = pkgs.writeShellScriptBin "test-simple-vm" ''
cat ${config.system.build.raw} > test.raw
truncate -s 4G test.raw
${pkgs.qemu}/bin/qemu-kvm \
-smp 2 \
-m 2G \
-drive if=virtio,format=raw,file=test.raw \
-netdev user,id=mynet0,net=192.168.76.0/24,dhcpstart=192.168.76.9,hostfwd=tcp::2222-:22 \
-net nic,model=e1000,macaddr=00:20:91:84:25:7f,netdev=mynet0
'';

time.timeZone = "US/Pacific";
}
1 change: 1 addition & 0 deletions machines/thatcher/machine-info.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ arch = "x86_64-linux"; }

0 comments on commit e1cf211

Please sign in to comment.