2022-01-22 21:14:30 +00:00
|
|
|
|
# Edit this configuration file to define what should be installed on
|
|
|
|
|
# your system. Help is available in the configuration.nix(5) man page
|
|
|
|
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
|
|
|
|
|
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
imports =
|
|
|
|
|
[
|
|
|
|
|
# Include the results of the hardware scan.
|
|
|
|
|
./hardware-configuration.nix
|
2022-04-14 11:48:26 +00:00
|
|
|
|
./wireguard.nix
|
2022-01-22 21:14:30 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Set your time zone.
|
|
|
|
|
time.timeZone = "Europe/Berlin";
|
|
|
|
|
|
|
|
|
|
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
|
|
|
|
|
# Per-interface useDHCP will be mandatory in the future, so this generated config
|
|
|
|
|
# replicates the default behaviour.
|
|
|
|
|
networking.useDHCP = false;
|
|
|
|
|
networking.interfaces.wlp5s0.useDHCP = true;
|
2022-04-14 11:48:26 +00:00
|
|
|
|
networking.firewall = {
|
|
|
|
|
allowedUDPPorts = [
|
|
|
|
|
51820
|
|
|
|
|
51821
|
|
|
|
|
]; # Clients and peers can use the same port, see listenport
|
|
|
|
|
};
|
2022-01-22 21:14:30 +00:00
|
|
|
|
|
2022-05-06 16:36:35 +00:00
|
|
|
|
hardware.nitrokey.enable = true;
|
|
|
|
|
|
|
|
|
|
programs.gnupg.agent = {
|
|
|
|
|
enable = true;
|
|
|
|
|
enableSSHSupport = true;
|
|
|
|
|
};
|
|
|
|
|
|
2022-01-22 21:14:30 +00:00
|
|
|
|
services.tlp = {
|
|
|
|
|
enable = true;
|
|
|
|
|
settings = {
|
|
|
|
|
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
|
|
|
|
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
|
|
|
|
|
|
|
|
|
# The following prevents the battery from charging fully to
|
|
|
|
|
# preserve lifetime. Run `tlp fullcharge` to temporarily force
|
|
|
|
|
# full charge.
|
|
|
|
|
# https://linrunner.de/tlp/faq/battery.html#how-to-choose-good-battery-charge-thresholds
|
|
|
|
|
START_CHARGE_THRESH_BAT0 = 40;
|
|
|
|
|
STOP_CHARGE_THRESH_BAT0 = 80;
|
|
|
|
|
|
|
|
|
|
# 100 being the maximum, limit the speed of my CPU to reduce
|
|
|
|
|
# heat and increase battery usage:
|
|
|
|
|
CPU_MAX_PERF_ON_AC = 100;
|
|
|
|
|
CPU_MAX_PERF_ON_BAT = 30;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
|
|
|
system.stateVersion = "21.11"; # Did you read the comment?
|
|
|
|
|
}
|
|
|
|
|
|