Add 'vixen' host

This commit is contained in:
Sridhar Ratnakumar 2024-10-22 15:31:17 -04:00
parent 21e7ca1641
commit 4543ab7555
4 changed files with 161 additions and 55 deletions

View file

@ -1,55 +0,0 @@
# Hetzner dedicated: AX41-NVMe
{ flake, ... }:
let
inherit (flake) inputs;
inherit (inputs) self;
in
{
imports = [
inputs.disko.nixosModules.disko
self.nixosModules.default
"${self}/modules/nixos/linux/disko/trivial.nix"
"${self}/modules/nixos/linux/docker.nix"
"${self}/modules/nixos/linux/lxd.nix"
"${self}/modules/nixos/linux/hedgedoc.nix"
"${self}/modules/nixos/linux/server/harden/basics.nix"
"${self}/modules/nixos/shared/github-runner.nix"
];
nixos-unified.sshTarget = "srid@immediacy";
system.stateVersion = "23.11";
networking.hostName = "immediacy";
nixpkgs.hostPlatform = "x86_64-linux";
boot.loader.grub = {
devices = [ "/dev/nvme0n1" ];
efiSupport = true;
efiInstallAsRemovable = true;
};
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "sd_mod" ];
hardware.cpu.intel.updateMicrocode = true;
hardware.enableRedistributableFirmware = true;
# Hetzner networking
networking.useDHCP = false;
networking.interfaces."eth0".ipv4.addresses = [
{
address = "65.109.84.215"; # your IPv4 here
prefixLength = 24;
}
];
networking.interfaces."eth0".ipv6.addresses = [
{
address = "2a01:4f9:3051:52d3::2"; # Your IPv6 here
prefixLength = 64;
}
];
networking.defaultGateway = "65.109.84.193";
networking.nameservers = [ "8.8.8.8" ];
services.openssh.enable = true;
services.tailscale.enable = true;
programs.nix-ld.enable = true; # for vscode server
}

View file

@ -0,0 +1,98 @@
{ pkgs, ... }:
{
imports =
[
# Include the results of the hardware scan.
./hardware-configuration.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "vixen"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "America/New_York";
# 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";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.srid = {
isNormalUser = true;
description = "Sridhar Ratnakumar";
extraGroups = [ "networkmanager" "wheel" ];
};
# Install firefox.
programs.firefox.enable = true;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
brave
gnome.gnome-tweaks
vscode
];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
}

View file

@ -0,0 +1,18 @@
# Hetzner dedicated: AX41-NVMe
{ flake, ... }:
let
inherit (flake) inputs;
inherit (inputs) self;
in
{
imports = [
self.nixosModules.default
./configuration.nix
];
services.openssh.enable = true;
services.tailscale.enable = true;
programs.nix-ld.enable = true; # for vscode server
}

View file

@ -0,0 +1,45 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/5d20a7d3-e7b5-4554-ab7e-078c154545f9";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-7cbdd6ee-fae2-4696-afc9-d7b7bae8246f".device = "/dev/disk/by-uuid/7cbdd6ee-fae2-4696-afc9-d7b7bae8246f";
fileSystems."/boot" =
{
device = "/dev/disk/by-uuid/665D-E58F";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp102s0u1u3c2.useDHCP = lib.mkDefault true;
# networking.interfaces.enp1s0f0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}