Files
sydnix/hosts/nixos-testbed/configuration.nix
2025-03-27 13:54:44 -06:00

116 lines
3.3 KiB
Nix

{ config, pkgs, lib, disko, sydnix-cli, ... }:
{
imports = [
./hardware.nix
./disks.nix
];
sydnix = {
filesystemType = "btrfs";
users.users = [
"lain"
];
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/sda2";
# subvolume = "rootfs";
# };
};
};
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = false;
};
fileSystems."/persist/dots" = {
device = "mount-dots";
fsType = "virtiofs";
mountPoint = "/persist/dots";
};
networking.hostId = "238e9b1e"; # head -c 8 /etc/machine-id
time.timeZone = "America/Denver";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
useXkbConfig = true; # Use xkb.options in TTY.
};
services.xserver.enable = true;
services.xserver.xkb.layout = "us";
services.xserver.xkb.options = "ctrl:swapcaps";
environment.systemPackages = [
pkgs.neovim
pkgs.git
pkgs.waypipe
sydnix-cli.packages.x86_64-linux.default
(import ../../scripts/port-tools { inherit pkgs; })
];
services.openssh = {
enable = true;
settings.PermitRootLogin = "yes";
settings.X11Forwarding = true;
};
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?
}