nixos/hosts/sparky/default.nix

96 lines
2.1 KiB
Nix
Raw Normal View History

2024-05-16 11:55:24 +01:00
{ inputs, config, lib, pkgs, outputs,... }:
2024-05-22 21:10:41 +01:00
let
sopsHashedPasswordFile = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."passwords/root".path;
2024-05-23 10:48:00 +01:00
secretsDirectory = builtins.toString inputs.nix-secrets;
secretsFile = "${secretsDirectory}/secrets.yaml";
2024-05-22 21:10:41 +01:00
in
2024-05-16 11:55:24 +01:00
{
imports =
[
2024-05-16 20:19:01 +01:00
# Disk configuration
2024-05-17 20:17:53 +01:00
inputs.disko.nixosModules.disko
(import ../common/disks/std-disk-config.nix { device = "/dev/vda"; })
../common/optional/btrfs-impermanence.nix
2024-05-17 01:07:42 +01:00
inputs.impermanence.nixosModules.impermanence
2024-05-16 20:19:01 +01:00
2024-05-23 00:10:58 +01:00
# Create users for this host
../common/users/media
2024-05-16 11:55:24 +01:00
# Import core options
./hardware-configuration.nix
../common/core
# Import optional options
../common/optional/openssh.nix
2024-05-16 11:55:24 +01:00
];
2024-05-18 14:51:03 +01:00
nixpkgs = {
overlays = [
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
];
config = {
allowUnfree = true;
};
};
2024-05-17 10:54:53 +01:00
fileSystems."/persist".neededForBoot = true;
environment.persistence."/persist" = {
hideMounts = true;
directories = [
"/etc/nixos"
"/var/log"
"/var/lib/nixos"
2024-05-24 14:32:18 +01:00
"/var/lib/flatpak"
2024-05-17 10:54:53 +01:00
"/var/lib/systemd/coredump"
"/etc/NetworkManager/system-connections"
];
2024-05-22 17:23:17 +01:00
files = [
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
];
2024-05-17 10:54:53 +01:00
};
2024-05-22 21:10:41 +01:00
users = {
mutableUsers = true;
extraUsers = {
root = {
hashedPasswordFile = sopsHashedPasswordFile;
};
};
};
2024-05-16 20:19:01 +01:00
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
timeout = 3;
};
};
networking = {
2024-05-17 20:17:53 +01:00
hostName = "sparky";
2024-05-16 20:19:01 +01:00
networkmanager.enable = true;
enableIPv6 = false;
};
services = {
qemuGuest.enable = true;
};
2024-05-23 19:41:54 +01:00
services.libinput.enable = true;
services.displayManager.defaultSession = "cinnamon";
2024-05-24 14:32:18 +01:00
services.xserver = {
enable = true;
displayManager.lightdm.enable = true;
desktopManager = {
cinnamon.enable = true;
};
};
2024-05-16 20:19:01 +01:00
2024-05-16 11:55:24 +01:00
nix.settings.experimental-features = [ "nix-command" "flakes" ];
2024-05-16 20:19:01 +01:00
system.stateVersion = "23.11";
}