feat: Add host sydpc

My, this is a lot TwT.  Much work was batched as part of the transition from
guix-rebound to nixos-testbed/sydpc.

- Discord/Vesktop module & config.
- Syncthing setup.
- Assorted Emacs changes.
- Waybar config.
- Niri config.
- Steam config.
- Some MPD.
- Stylix config.
- Files/Impermanence things.
- Enable Ghostty.
- God knows what else.
This commit is contained in:
Madeleine Sydney
2025-03-17 12:34:26 -06:00
parent 4464e7cec1
commit c48a93ad10
40 changed files with 2632 additions and 179 deletions

View File

@@ -0,0 +1,160 @@
{ config, pkgs, lib, disko, sydnix-cli, ... }:
{
imports = [
./hardware.nix
./disks.nix
];
sydnix = {
filesystemType = "btrfs";
steam.enable = true;
niri.enable = true;
stylix.enable = true;
users.users = [
"crumb"
];
impermanence = {
enable = true;
directories = [
# "Warning: Neither /var/lib/nixos nor any of its parents are persisted.
# This means all users/groups without specified uids/gids will have them
# reassigned on reboot."
"/var/lib/nixos"
# We don't want to have different ssh keys on reboot, because ssh keys
# are expected to consistently identify machines... I think. I mostly
# just think it's annoying to edit ~/.ssh/known_hosts all the time.
"/etc/ssh"
];
rollback = {
enable = true;
device = "/dev/disk/by-partlabel/disk-bootroot-root";
subvolume = "rootfs";
};
};
};
# Disable systemd-sleep. Let KDE or whatever dim the screen without
# suspending the computer.
systemd.sleep.extraConfig = ''
AllowSuspend=no
AllowHibernation=no
AllowHybridSleep=no
AllowSuspendThenHibernate=no
'';
boot.loader = {
grub.enable = false;
systemd-boot.enable = true;
efi.canTouchEfiVariables = false;
};
time.timeZone = "America/Denver";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
useXkbConfig = true; # Use xkb.options in tty.
};
hardware.nvidia.open = false;
services.xserver = {
enable = true;
videoDrivers = [ "nvidia" ];
xkb = {
layout = "us";
options = "ctrl:swapcaps";
};
};
services.displayManager.sddm.enable = true; # WAIT4NIRI
services.desktopManager.plasma6.enable = true; # WAIT4NIRI
services.libinput = {
enable = true;
# Disable mouse acceleration.
mouse.accelProfile = "flat";
# Sensitivity.
mouse.accelSpeed = "-0.5";
};
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
wireplumber.enable = true;
};
services.pulseaudio.package = pkgs.pulseaudioFull;
# Usually we try to delegate declarations of globally-available packages to
# separate modules. These are some exceptional essentials.
environment.systemPackages = [
pkgs.neovim
pkgs.git
sydnix-cli.packages.x86_64-linux.default
(import ../../scripts/port-tools { inherit pkgs; })
# Waypipe provides the equivalent of X11 forwarding for Wayland. When
# connecting to a remote, it is required that `waypipe` is on the remote's
# PATH, thus we include it globally here.
pkgs.waypipe
pkgs.cachix
];
programs.xwayland.enable = true;
services.openssh = {
enable = true;
settings.PermitRootLogin = "yes";
settings.X11Forwarding = true;
};
# TODO: Move to defaults.
users.mutableUsers = false;
nix = {
settings = {
trusted-users = [
"@wheel"
];
substituters = [
"https://cache.deertopia.net"
"https://nix-community.cachix.org"
"https://cache.nixos.org"
];
trusted-public-keys = [
(builtins.readFile ../../public-keys/deertopia-cache.pub.pem)
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
};
# This option defines the first version of NixOS you have installed on this
# particular machine, and is used to maintain compatibility with application
# data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any
# reason, even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are
# pulled from, so changing it will NOT upgrade your system - see
# https://nixos.org/manual/nixos/stable/#sec-upgrading for how to actually do
# that.
#
# This value being lower than the current NixOS release does NOT mean your
# system is out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes
# it would make to your configuration, and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or
# https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "24.05"; # Did you read the comment?
}

73
hosts/sydpc/disks.nix Executable file
View File

@@ -0,0 +1,73 @@
# sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --mode disko /persist/dots/hosts/nixos-testbed/disko-config.nix
# time sudo nixos-install --flake /persist/dots#nixos-testbed
{ lib, ... }:
{
# imports = [ disko.nixosModules.disko ];
boot.initrd.supportedFilesystems.btrfs = true;
boot.supportedFilesystems.btrfs = true;
# From Impermanence's README: "Important note: Make sure your persistent
# volumes are marked with neededForBoot, otherwise you will run into
# problems."
fileSystems."/persist".neededForBoot = true;
disko.devices = {
disk = {
bootroot = {
type = "disk";
device = "/dev/disk/by-id/ata-Samsung_SSD_870_EVO_1TB_S75BNL0WA33853H";
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
size = "100%";
content = {
type = "btrfs";
mountpoint = "/partition-root";
swap.swapfile.size = "4G";
# Override existing partitions.
extraArgs = [ "-f" ];
# Subvolumes must set a mountpoint in order to be mounted,
# *unless their parent is mounted*.
subvolumes = {
# Subvolume names do not necessarily correspond to
# mountpoints, despite the structural resemblance to a file
# path.
"/rootfs" = {
mountpoint = "/";
};
"/nix" = {
mountpoint = "/nix";
};
"/persist" = {
mountpoint = "/persist";
};
"/persist/home" = {
mountpoint = "/persist/home";
};
"/swap" = {
mountpoint = "/.swapvol";
swap.swapfile.size = "4G";
};
};
};
};
};
};
};
};
};
}

25
hosts/sydpc/hardware.nix Executable file
View File

@@ -0,0 +1,25 @@
# 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" ];
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.enp0s31f6.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

1
hosts/sydpc/system.nix Executable file
View File

@@ -0,0 +1 @@
"x86_64-linux"