nixos-config/hosts/thinkpad/default.nix

92 lines
2 KiB
Nix
Raw Normal View History

2023-12-29 19:47:57 +01:00
{ config, ... }:
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
2023-12-01 15:07:47 +01:00
./modules/printing
2023-11-24 09:57:15 +01:00
./modules/security
./modules/sound
2023-07-03 10:19:14 +02:00
./modules/virtualisation
2022-12-18 17:07:40 +01:00
];
# nixpkgs.hostPlatform = {
# gcc.arch = "tigerlake";
# gcc.tune = "tigerlake";
# system = "x86_64-linux";
# };
2024-01-04 00:13:46 +01:00
nix.settings.system-features = [ "gccarch-tigerlake" ];
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-12-01 15:07:47 +01:00
kernelModules = [ "v4l2loopback" ];
2023-08-02 18:04:26 +02:00
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
2023-12-01 15:07:47 +01:00
extraModulePackages = [
config.boot.kernelPackages.v4l2loopback
];
extraModprobeConfig = ''
options v4l2loopback exclusive_caps=1 card_label="Virtual Camera"
'';
2023-04-16 13:43:30 +02:00
tmp.useTmpfs = true;
2023-01-28 14:53:23 +01:00
};
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
upower.enable = true;
2023-04-06 11:00:53 +02:00
avahi = {
2023-03-06 18:07:49 +01:00
enable = true;
2023-12-17 17:27:20 +01:00
nssmdns4 = true;
2023-03-06 18:07:49 +01:00
};
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-02-28 20:48:06 +01:00
services.logind = {
2023-03-06 15:05:35 +01:00
lidSwitch = "suspend-then-hibernate";
2023-12-12 17:43:16 +01:00
lidSwitchDocked = "suspend";
2023-03-06 15:05:35 +01:00
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;
RESTORE_DEVICE_STATE_ON_STARTUP = 1;
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
}