Add a new host, WIP

This commit is contained in:
Sridhar Ratnakumar 2024-03-26 13:16:53 -04:00
parent bdf0ad9619
commit 654a1c9cf5
6 changed files with 69 additions and 33 deletions

6
flake.lock generated
View file

@ -172,11 +172,11 @@
]
},
"locked": {
"lastModified": 1707524024,
"narHash": "sha256-HmumZ8FuWAAYZrWUKm3N4G4h8nmZ5VUVX+vXLmCJNKM=",
"lastModified": 1711462743,
"narHash": "sha256-3wKGpHy9Kyh98DrziqC/s//60Q0pE17NgbY93L0uWng=",
"owner": "nix-community",
"repo": "disko",
"rev": "d07de570ba05cec2807d058daaa044f6955720c7",
"rev": "a6717b1afee7ae955c61eefdf0ce8f864ef78115",
"type": "github"
},
"original": {

View file

@ -72,9 +72,13 @@
./systems/darwin.nix;
# Configuration for a NixOS VM (running on my Mac)
nixosConfigurations.parallels-linux-builder =
self.nixos-flake.lib.mkLinuxSystem
./systems/parallels-vm/linux-builder;
nixosConfigurations = {
parallels-linux-builder =
self.nixos-flake.lib.mkLinuxSystem
./systems/parallels-vm/linux-builder;
github-runner = self.nixos-flake.lib.mkLinuxSystem
./systems/github-runner.nix;
};
};
perSystem = { self', system, pkgs, lib, config, inputs', ... }: {

View file

@ -1,33 +1,35 @@
# A trivial disk configuration with single root partition taking whole disk
# space.
{ device, ... }:
{
disk = {
main = {
inherit device;
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
};
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
disko.devices = {
disk = {
main = {
# When using disko-install, we will overwrite this value from the commandline
device = "/dev/disk/by-id/some-disk-id";
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};

30
systems/github-runner.nix Normal file
View file

@ -0,0 +1,30 @@
# TODO: WIP
{ flake, pkgs, lib, ... }:
let
inherit (flake) inputs;
inherit (inputs) self;
in
{
imports = [
inputs.disko.nixosModules.disko
"${self}/nixos/disko/trivial.nix"
"${self}/nixos/parallels-vm.nix"
"${self}/nixos/self/primary-as-admin.nix"
"${self}/nixos/server/harden/basics.nix"
];
system.stateVersion = "23.11";
networking.hostName = "github-runner";
nixpkgs.hostPlatform = "aarch64-linux";
boot = {
binfmt.emulatedSystems = [ "x86_64-linux" ];
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
};
services.openssh.enable = true;
}

View file

@ -14,7 +14,7 @@
../../../nixos/self/primary-as-admin.nix
../../../nixos/server/harden/basics.nix
../../../nixos/current-location.nix
./parallels-vm.nix
../../../nixos/parallels-vm.nix
# Dev
./dev.nix
];