dotfiles/nixos/boxes/homescreen/default.nix

74 lines
1.9 KiB
Nix
Raw Normal View History

2023-04-29 12:59:16 +01:00
{ config, pkgs, inputs, lib, ... }: {
2023-04-30 10:45:33 +01:00
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-04-29 12:59:16 +01:00
networkmanager = { enable = true; };
2021-12-04 21:47:27 +00:00
};
2022-08-06 09:52:34 +01:00
hardware.enableRedistributableFirmware = true;
2021-12-04 21:47:27 +00:00
2023-04-29 12:59:16 +01:00
environment.systemPackages = with pkgs; [ neovim htop btop atop ];
2021-12-04 21:47:27 +00:00
services.fail2ban.enable = true;
services.openssh = {
enable = true;
permitRootLogin = "prohibit-password";
passwordAuthentication = false;
};
2022-08-05 20:56:58 +01:00
hardware.raspberry-pi."4".fkms-3d.enable = true;
2022-08-06 09:52:34 +01:00
hardware.deviceTree.filter = lib.mkForce "*rpi-*.dtb";
2022-08-04 09:55:56 +01:00
services.xserver = {
enable = true;
2022-08-05 20:56:58 +01:00
displayManager.lightdm.enable = true;
2022-08-05 21:50:01 +01:00
displayManager.autoLogin.enable = true;
displayManager.autoLogin.user = "kiosk";
2022-08-04 09:55:56 +01:00
desktopManager.gnome.enable = true;
2022-08-06 09:52:34 +01:00
libinput.enable = true;
2022-08-04 09:55:56 +01:00
};
2022-08-05 21:50:01 +01:00
users = {
mutableUsers = false;
2023-04-29 12:59:16 +01:00
users.kiosk = { isNormalUser = true; };
2022-08-05 21:50:01 +01:00
};
2021-12-04 21:47:27 +00:00
users.extraUsers.root.openssh.authorizedKeys.keys = [
2022-08-04 09:55:56 +01:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEo4R+6J3h6Ix3xWpOMdU7Es1/YxFchHw0c+kcCOJxFb cyryl@foureighty"
2021-12-04 21:47:27 +00:00
];
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
2023-04-29 12:59:16 +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-04-29 12:59:16 +01:00
options = [ "nofail" "noauto" ];
2022-08-06 09:52:34 +01:00
};
2021-12-04 21:47:27 +00:00
};
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
security.allowUserNamespaces = true;
time.timeZone = "Europe/London";
2023-04-29 12:59:16 +01:00
system.stateVersion = "22.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
}