Adding Parents Device

This commit is contained in:
Annika Merris 2024-09-04 10:09:19 -04:00
parent f11ae539c1
commit 56278c47b5
8 changed files with 203 additions and 11 deletions

48
hosts/parents/default.nix Normal file
View file

@ -0,0 +1,48 @@
# parents
# System configuration for the Chromebox I am leaving at my parent's
{ inputs, globals, ... }:
with inputs;
inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
globals
lix-module.nixosModules.default
home-manager.nixosModules.home-manager
sops-nix.nixosModules.sops
disko.nixosModules.disko
./hardware-configuration.nix
./disk-config.nix
./netbird.nix
./nixos-anywhere.nix
../../modules/common
../../modules/nixos
] {
home-manager.useGlobalPkgs = true;
physical = true;
networking.hostName = "parents";
networking.useDHCP = nixpkgs.lib.mkDefault true;
sops = {
defaultSopsFile = ../../secrets/secrets.yaml;
defaultSopsFormat = "yaml";
age.keyFile = "/home/annika/.config/sops/age/keys.txt";
age.sshKeyPaths = [ "/home/annika/.ssh/id_ed25519" ];
};
time.timeZone = "America/New_York";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nixpkgs.config.allowUnfree = true;
system.stateVersion = "23.11";
home-manager.backupFileExtension = "backup";
audio.enable = false;
gui.enable = false;
services.openssh.enable = true;
services.flatpak.enable = false;
docker.enable = true;
};
}

View file

@ -0,0 +1,60 @@
{ lib, ... }:
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/disk/by-diskseq/1";
content = {
type = "gpc";
partitions = {
ESP = {
priority = 1;
name = "ESP";
start = "1M";
end = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
};
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-L" "nixos" "-f" ];
subvolumes = {
"/rootfs" = {
mountpoint = "/";
};
"/home" = {
mountOptions = [ "compress=zstd" ];
mountpoint = "/home";
};
"/home/annika" = { };
"/nix" = {
mountOptions = [ "compress=zstd" "noatime" ];
mountpoint = "/nix";
};
"/swap" = {
mountpoint = "/swap";
swap = {
swapfile.size = "8G";
};
};
};
};
};
};
};
};
};
};
fileSystems."/var/log".neededForBoot = true;
}

View file

@ -0,0 +1,26 @@
# 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 = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
# 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.eno0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

14
hosts/parents/netbird.nix Normal file
View file

@ -0,0 +1,14 @@
{ config, lib, pkgs, ... }: {
sops.secrets."netbird/setup_keys/parents" = {
owner = config.users.users.annika.name;
group = config.users.users.annika.group;
};
netbird = {
enable = true;
opts = {
management_url = "https://netbird.moosenet.work:443";
admin_url = "https://netbird.moosenet.work";
setup_key_file = config.sops.secrets."netbird/setup_keys/parents".path;
};
};
}

View file

@ -0,0 +1,14 @@
{ config, lib, pkgs, ... }: {
# Stuff for nixos-anywhere
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
};
environment.systemPackages = map lib.lowPrio [ pkgs.curl pkgs.gitMinimal ];
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG9NhsAOBwWBdBeenfaPoRtqQrAIgg7E5m4sKYQU9cFx annika@kim"
];
}