2024-11-11 23:02:38 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
modulesPath,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
(modulesPath + "/profiles/image-based-appliance.nix")
|
|
|
|
(modulesPath + "/profiles/perlless.nix")
|
|
|
|
(modulesPath + "/profiles/qemu-guest.nix")
|
|
|
|
];
|
|
|
|
|
|
|
|
# system.forbiddenDependenciesRegexes = lib.mkForce [ ];
|
|
|
|
|
|
|
|
nixpkgs.flake.setNixPath = false;
|
|
|
|
nixpkgs.flake.setFlakeRegistry = false;
|
2024-11-15 21:09:57 +01:00
|
|
|
boot.enableContainers = false;
|
2024-11-11 23:02:38 +01:00
|
|
|
|
|
|
|
boot.kernelModules = [
|
|
|
|
"zram"
|
|
|
|
"usb_storage"
|
|
|
|
"uas"
|
|
|
|
"sd_mod"
|
|
|
|
"r8169"
|
|
|
|
"ehci-hcd"
|
|
|
|
"ehci-pci"
|
|
|
|
"xhci-hcd"
|
|
|
|
"xhci-pci"
|
|
|
|
"xhci-pci-renesas"
|
|
|
|
"nvme"
|
|
|
|
"virtio_net"
|
|
|
|
];
|
|
|
|
|
|
|
|
system.etc.overlay.mutable = lib.mkDefault false;
|
|
|
|
|
|
|
|
systemd.watchdog = lib.mkDefault {
|
|
|
|
runtimeTime = "10s";
|
|
|
|
rebootTime = "30s";
|
|
|
|
};
|
|
|
|
|
|
|
|
zramSwap.enable = true;
|
|
|
|
|
2024-11-15 21:09:57 +01:00
|
|
|
# FIXME: fstrim should only be enabled for virtual machine images?
|
|
|
|
services.fstrim.enable = true;
|
|
|
|
|
2024-11-11 23:02:38 +01:00
|
|
|
users.allowNoPasswordLogin = true;
|
2024-11-16 22:11:35 +01:00
|
|
|
users.users.root.home = lib.mkForce "/";
|
|
|
|
|
2024-11-11 23:02:38 +01:00
|
|
|
security.sudo.enable = lib.mkDefault false;
|
|
|
|
|
|
|
|
security.polkit = {
|
|
|
|
enable = true;
|
2024-11-15 21:09:57 +01:00
|
|
|
extraConfig = ''
|
2024-11-11 23:02:38 +01:00
|
|
|
polkit.addRule(function(action, subject) {
|
|
|
|
if (subject.isInGroup("wheel")) {
|
|
|
|
return polkit.Result.YES;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
i18n.supportedLocales = [ "en_US.UTF-8/UTF-8" ];
|
|
|
|
|
2024-11-15 21:09:57 +01:00
|
|
|
# Console
|
2024-11-11 23:02:38 +01:00
|
|
|
|
2024-11-15 21:09:57 +01:00
|
|
|
systemd.enableEmergencyMode = false;
|
2024-11-11 23:02:38 +01:00
|
|
|
boot.consoleLogLevel = lib.mkDefault 1;
|
|
|
|
boot.kernelParams = [
|
|
|
|
"panic=1"
|
|
|
|
"boot.panic_on_fail"
|
2024-11-16 22:11:35 +01:00
|
|
|
# "nomodeset"
|
|
|
|
"console=ttyS0,115200n8"
|
|
|
|
"earlyprintk=ttyS0,115200n8"
|
|
|
|
"systemd.mask=systemd-vconsole-setup.service" # FIXME: Figure out why vconsole-setup fails when loading keymap
|
2024-11-11 23:02:38 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
# This is vi country
|
|
|
|
programs.nano.enable = false;
|
|
|
|
programs.vim.enable = true;
|
|
|
|
programs.vim.defaultEditor = lib.mkDefault true;
|
|
|
|
|
2024-11-15 21:09:57 +01:00
|
|
|
# Temporary file
|
|
|
|
boot.tmp.useTmpfs = true;
|
|
|
|
|
2024-11-11 23:02:38 +01:00
|
|
|
# Logging
|
2024-11-15 21:09:57 +01:00
|
|
|
services.journald = {
|
|
|
|
storage = "volatile";
|
|
|
|
extraConfig = ''
|
|
|
|
SystemMaxUse=10M
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-11-11 23:02:38 +01:00
|
|
|
}
|