nixos-config/hosts/thinkpad/default.nix

98 lines
2.1 KiB
Nix
Raw Normal View History

2024-03-13 16:22:01 +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
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
];
2024-01-04 00:13:46 +01:00
nix.settings.system-features = [ "gccarch-tigerlake" ];
2024-01-29 23:50:34 +01:00
systemd.additionalUpstreamSystemUnits = [
"soft-reboot.target"
"systemd-soft-reboot.service"
];
2024-01-04 00:13:46 +01:00
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" ];
kernelPackages = pkgs.linuxPackages_latest;
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-03-04 19:56:45 +01:00
fwupd.enable = true; # firmware updates
btrfs.autoScrub.enable = true;
2022-12-19 19:30:32 +01:00
};
2024-01-22 01:07:30 +01:00
hardware.bluetooth = {
enable = true;
settings = {
General = {
Experimental = 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;
man.generateCaches = true;
};
2024-03-13 16:22:01 +01:00
environment.systemPackages = [ pkgs.man-pages ];
2022-12-27 18:21:33 +01:00
system.stateVersion = "22.11";
2022-12-18 17:01:34 +01:00
}