Files
nixos/hosts/hosea/default.nix
T

128 lines
2.8 KiB
Nix
Raw Normal View History

2023-05-05 11:29:38 -05:00
# Edit this configuration file to define what should be installed on
2023-05-05 15:59:59 -05:00
# your system. Help is available in the configuration.nix(5) man page
2023-05-05 11:29:38 -05:00
# and in the NixOS manual (accessible by running nixos-help).
2024-04-02 11:55:07 -05:00
{ config, pkgs, lib, inputs, overlays, ... }:
2023-05-05 15:59:59 -05:00
let
wanInterface = "enp2s0";
lanInterface = "enp1s0";
2024-04-01 12:23:05 -05:00
lanIpAddress = "10.42.1.7";
2023-05-05 15:59:59 -05:00
in
2023-05-05 11:29:38 -05:00
{
2023-05-05 15:59:59 -05:00
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
2023-05-05 11:29:38 -05:00
2023-05-05 12:49:17 -05:00
2024-04-02 14:07:13 -05:00
# Bootloader
boot = {
loader = {
systemd-boot.enable = true;
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/";
};
};
extraModprobeConfig = "vboxdrv";
};
users.users.greg.extraGroups = [ "vboxusers" ];
2023-09-01 23:42:22 -05:00
2023-05-05 15:59:59 -05:00
networking = {
2024-04-01 12:23:05 -05:00
hostName = "hosea";
2023-05-05 15:59:59 -05:00
interfaces = {
"${wanInterface}".useDHCP = true;
"${lanInterface}" = {
useDHCP = false;
ipv4.addresses = [{
address = lanIpAddress;
prefixLength = 24;
}];
};
};
};
2023-05-05 11:29:38 -05:00
2023-05-05 15:59:59 -05:00
# Serves as the router, DHCP, and DNS for the site
greg = {
tailscale.enable = true;
2024-04-01 12:23:05 -05:00
home = true;
2023-05-05 15:59:59 -05:00
};
services = {
2024-04-01 12:23:05 -05:00
# Configure keymap
2024-03-04 23:03:47 -06:00
xserver.xkb = {
2023-05-05 15:59:59 -05:00
layout = "us";
2024-03-04 23:03:47 -06:00
variant = "";
2023-05-05 15:59:59 -05:00
};
2024-04-02 14:07:13 -05:00
gitlab-runner = {
enable = true;
2024-04-02 14:08:05 -05:00
settings.concurrent = 2;
2024-04-02 14:07:13 -05:00
services = {
shell = {
executor = "shell";
limit = 5;
registrationConfigFile = config.age.secrets.runner-reg.path;
environmentVariables = {
EFI_DIR = "${pkgs.OVMF.fd}/FV/";
};
};
};
};
2023-05-05 15:59:59 -05:00
};
2024-04-02 11:55:07 -05:00
#####################################################################################
#################### Virtualbox Runner ##############################################
#####################################################################################
2024-04-02 14:07:13 -05:00
age.secrets.runner-reg.file = ../../secrets/gitlab/myself-vbox-runner-reg.age;
virtualisation.virtualbox.host = {
enable = true;
enableExtensionPack = true;
enableHardening = false;
headless = true;
};
systemd.services."gitlab-runner" = {
after = [
"network.target"
"network-online.target"
"systemd-resolved.service"
];
2024-04-02 11:55:07 -05:00
# Moved here from myself/Isaiah, so technically unnecessary now
conflicts = [
"container@gitlab-runner-qemu.service"
];
2024-04-02 14:07:13 -05:00
wants = [
"network-online.target"
"systemd-resolved.service"
];
path = with pkgs; [
curl
gawk
git
p7zip
packer
pup
gregpy
shellcheck
unzip
xonsh
xorriso
vagrant
wget
];
preStart = builtins.concatStringsSep "\n" [
"${pkgs.kmod}/bin/modprobe vboxdrv"
"${pkgs.kmod}/bin/modprobe vboxnetadp"
"${pkgs.kmod}/bin/modprobe vboxnetflt"
];
postStop = "${pkgs.kmod}/bin/rmmod vboxnetadp vboxnetflt vboxdrv";
2024-04-02 11:55:07 -05:00
serviceConfig = {
DevicePolicy = lib.mkForce "auto";
2024-04-02 14:07:13 -05:00
User = "root";
DynamicUser = lib.mkForce false;
2024-04-02 11:55:07 -05:00
};
};
2024-04-02 14:07:13 -05:00
networking.firewall.allowedTCPPorts = [ 18083 ]; # Should be interface for vboxweb
2023-05-05 11:29:38 -05:00
}