nixos-config/hosts/thinkpad/default.nix

79 lines
1.7 KiB
Nix
Raw Normal View History

2023-11-24 09:57:15 +01:00
{ config, pkgs, ... }:
2022-12-18 17:01:34 +01:00
{
2022-12-29 20:48:40 +01:00
2022-12-18 17:07:40 +01:00
imports =
[
./hardware-configuration.nix
./modules/backup
2023-11-24 09:57:15 +01:00
./modules/graphics
2023-04-06 11:00:53 +02:00
./modules/greetd
2023-11-24 09:57:15 +01:00
./modules/networks
./modules/security
./modules/sound
2023-07-03 10:19:14 +02:00
./modules/virtualisation
2022-12-18 17:07:40 +01:00
];
# Use the systemd-boot EFI boot loader.
2023-01-28 14:53:23 +01:00
boot = {
2023-08-02 18:04:26 +02:00
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
2023-04-16 13:43:30 +02:00
tmp.useTmpfs = true;
2023-01-28 14:53:23 +01:00
};
systemd.package = pkgs.systemd.override { withHomed = false; };
2022-12-18 17:07:40 +01:00
environment.persistence."/nix/persist/system" = {
directories = [
"/etc/nixos" # bind mounted from /nix/persist/system/etc/nixos to /etc/nixos
"/etc/ssh"
"/etc/secureboot"
"/root/.ssh"
2023-08-06 22:24:01 +02:00
"/root/.borgmatic"
"/root/.local/share/zsh"
];
files = [
"/etc/machine-id"
];
};
2023-05-20 16:21:20 +02:00
2022-12-18 17:07:40 +01:00
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
2023-01-21 14:44:23 +01:00
2023-11-24 09:57:15 +01:00
console.keyMap = "dvorak";
2022-12-31 12:28:53 +01:00
2022-12-19 19:30:32 +01:00
services = {
2022-12-27 18:21:33 +01:00
blueman.enable = true; # bluetooth
devmon.enable = true; # automount stuff
2023-04-06 11:00:53 +02:00
avahi = {
2023-03-06 18:07:49 +01:00
enable = true;
nssmdns = true;
};
2023-03-04 19:56:45 +01:00
fwupd.enable = true; # firmware updates
zfs.autoScrub.enable = true;
2022-12-19 19:30:32 +01:00
};
2023-11-24 09:57:15 +01:00
hardware.bluetooth.enable = true;
2023-02-14 21:50:36 +01:00
2023-04-06 11:00:53 +02:00
systemd.sleep.extraConfig = ''
HibernateDelaySec=2h
'';
2023-11-24 09:57:15 +01:00
2023-02-28 20:48:06 +01:00
services.logind = {
2023-03-06 15:05:35 +01:00
lidSwitch = "suspend-then-hibernate";
lidSwitchDocked = "suspend-then-hibernate";
lidSwitchExternalPower = "suspend";
extraConfig = ''
HandlePowerKey = ignore
'';
};
2023-11-24 09:57:15 +01:00
2023-03-06 15:05:35 +01:00
services.tlp = {
enable = true;
settings = {
START_CHARGE_THRESH_BAT0 = 70;
2023-04-24 15:15:01 +02:00
STOP_CHARGE_THRESH_BAT0 = 90;
2023-03-06 15:05:35 +01:00
};
2023-02-28 20:48:06 +01:00
};
2023-01-10 11:31:33 +01:00
documentation.dev.enable = true;
2022-12-27 18:21:33 +01:00
system.stateVersion = "22.11";
2022-12-18 17:01:34 +01:00
}