dotfiles/nixos/boxes/homescreen/default.nix

85 lines
1.9 KiB
Nix
Raw Normal View History

2023-08-13 17:00:41 +01:00
{
config,
pkgs,
inputs,
lib,
...
}: {
imports = [inputs.nixos-hardware.nixosModules.raspberry-pi-4 ../../tailscale];
2022-08-04 09:55:56 +01:00
2021-12-04 21:47:27 +00:00
networking = {
2022-08-04 09:55:56 +01:00
hostName = "homescreen";
2023-08-13 17:00:41 +01:00
networkmanager = {enable = true;};
2021-12-04 21:47:27 +00:00
};
2023-08-13 17:00:41 +01:00
environment.systemPackages = with pkgs; [neovim htop btop atop];
2021-12-04 21:47:27 +00:00
2024-04-27 11:33:38 +01:00
hardware = {
raspberry-pi."4".fkms-3d.enable = true;
2021-12-04 21:47:27 +00:00
2024-04-27 11:33:38 +01:00
enableRedistributableFirmware = true;
deviceTree.filter = lib.mkForce "*rpi-*.dtb";
2021-12-04 21:47:27 +00:00
};
2024-04-27 11:33:38 +01:00
services = {
fail2ban.enable = true;
2021-12-04 21:47:27 +00:00
2024-04-27 11:33:38 +01:00
openssh = {
enable = true;
permitRootLogin = "prohibit-password";
passwordAuthentication = false;
};
xserver = {
enable = true;
displayManager = {
lightdm.enable = true;
autoLogin.enable = true;
autoLogin.user = "kiosk";
};
desktopManager.gnome.enable = true;
libinput.enable = true;
2024-04-21 19:16:41 +01:00
};
2022-08-04 09:55:56 +01:00
};
2022-08-05 21:50:01 +01:00
users = {
mutableUsers = false;
2023-08-13 17:00:41 +01:00
users.kiosk = {isNormalUser = true;};
2024-04-27 11:33:38 +01:00
extraUsers.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEo4R+6J3h6Ix3xWpOMdU7Es1/YxFchHw0c+kcCOJxFb cyryl@foureighty"
];
2022-08-05 21:50:01 +01:00
};
2024-04-27 11:33:38 +01:00
2021-12-04 21:47:27 +00:00
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
2023-08-13 17:00:41 +01:00
options = ["noatime"];
2021-12-04 21:47:27 +00:00
};
2022-08-06 09:52:34 +01:00
"/boot/firmware" = {
device = "/dev/disk/by-label/FIRMWARE";
fsType = "vfat";
2023-08-13 17:00:41 +01:00
options = ["nofail" "noauto"];
2022-08-06 09:52:34 +01:00
};
2021-12-04 21:47:27 +00:00
};
2024-04-27 11:33:38 +01:00
2021-12-04 21:47:27 +00:00
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
security.allowUserNamespaces = true;
time.timeZone = "Europe/London";
2023-12-18 10:28:15 +00:00
system.stateVersion = "23.11";
2021-12-04 21:47:27 +00:00
2022-08-06 09:52:34 +01:00
nix = {
2022-12-04 12:33:54 +00:00
settings.auto-optimise-store = true;
2022-08-06 09:52:34 +01:00
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
# Free up to 1GiB whenever there is less than 100MiB left.
extraOptions = ''
min-free = ${toString (100 * 1024 * 1024)}
max-free = ${toString (1024 * 1024 * 1024)}
'';
};
2021-12-04 21:47:27 +00:00
}