nixos-laptop/configuration.nix

175 lines
3.9 KiB
Nix
Raw Permalink Normal View History

{ pkgs, config, lib, ... }: {
2023-10-08 14:57:57 +00:00
time.timeZone = "Europe/Amsterdam";
i18n.defaultLocale = "en_US.UTF-8";
2023-10-22 20:30:51 +00:00
services = {
gnome.gnome-keyring.enable = lib.mkForce false;
2023-10-22 20:30:51 +00:00
xserver = {
enable = true;
displayManager.gdm = { enable = true; };
2023-10-22 20:30:51 +00:00
desktopManager.gnome.enable = true;
excludePackages = with pkgs; [ xterm ];
2023-10-22 20:30:51 +00:00
};
printing = {
2023-10-08 14:57:57 +00:00
enable = true;
drivers = [ pkgs.hplip pkgs.gutenprint ];
2023-10-08 14:57:57 +00:00
};
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
2023-10-08 14:57:57 +00:00
};
users = {
users.pim = {
isNormalUser = true;
extraGroups = [ "wheel" "docker" "input" "wireshark" "dialout" ];
};
2023-10-08 14:57:57 +00:00
};
environment = {
systemPackages = with pkgs; [
wget
curl
git
btop
ripgrep
vim
dogdns
tree
dig
];
2024-05-16 16:48:46 +00:00
gnome.excludePackages = with pkgs; with pkgs.gnome; [
totem
2023-10-16 09:30:17 +00:00
gnome-tour
2024-05-16 16:48:46 +00:00
epiphany
geary
2023-10-16 09:30:17 +00:00
gnome-console
2024-05-16 16:48:46 +00:00
gnome-music
gnome-calendar
2023-10-16 09:30:17 +00:00
];
2023-10-08 14:57:57 +00:00
};
system = {
stateVersion = "23.05";
activationScripts.diff = ''
if [[ -e /run/current-system ]]; then
${pkgs.nix}/bin/nix store diff-closures /run/current-system "$systemConfig"
fi
'';
};
2023-10-08 14:57:57 +00:00
programs.ssh.startAgent = true;
2023-10-08 14:57:57 +00:00
security = {
rtkit.enable = true;
sudo.extraConfig = ''
Defaults timestamp_timeout=30
'';
};
2023-10-08 14:57:57 +00:00
nix = {
package = pkgs.nixFlakes;
settings.trusted-users = [ "root" "pim" ];
2023-10-08 14:57:57 +00:00
extraOptions = ''
experimental-features = nix-command flakes
'';
gc = {
automatic = true;
persistent = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
2023-10-08 14:57:57 +00:00
};
2023-10-14 17:08:02 +00:00
2023-10-22 20:30:51 +00:00
age = {
identityPaths = [ "/home/pim/.ssh/age_ed25519" ];
2023-10-14 17:08:02 +00:00
2023-10-22 20:30:51 +00:00
secrets = {
wg-quick-home-privkey.file = ./secrets/wg-quick-home-privkey.age;
wg-quick-home-preshared-key.file =
./secrets/wg-quick-home-preshared-key.age;
2023-10-22 20:30:51 +00:00
};
};
networking = {
useDHCP = lib.mkDefault true;
wg-quick.interfaces = {
home = {
privateKeyFile = config.age.secrets.wg-quick-home-privkey.path;
address = [ "10.225.191.4/24" "fd11:5ee:bad:c0de::4/128" ];
dns = [ "192.168.30.131" ];
autostart = false;
mtu = 1412;
peers = [{
presharedKeyFile = config.age.secrets.wg-quick-home-preshared-key.path;
2024-01-21 11:11:52 +00:00
endpoint = "wg.kun.is:51820";
publicKey = "fa3mQ7ximJbH7cu2ZbWidto5xBGxEEfWvCCiUDk00Hg=";
allowedIPs = [ "0.0.0.0/0" "::/0" ];
}];
};
home-no-pihole = {
privateKeyFile = config.age.secrets.wg-quick-home-privkey.path;
address = [ "10.225.191.4/24" "fd11:5ee:bad:c0de::4/128" ];
dns = [ "192.168.10.1" ];
autostart = false;
mtu = 1412;
peers = [{
presharedKeyFile = config.age.secrets.wg-quick-home-preshared-key.path;
2024-01-21 11:11:52 +00:00
endpoint = "wg.kun.is:51820";
publicKey = "fa3mQ7ximJbH7cu2ZbWidto5xBGxEEfWvCCiUDk00Hg=";
allowedIPs = [ "0.0.0.0/0" "::/0" ];
}];
};
2023-10-14 17:08:02 +00:00
};
};
virtualisation.docker = {
enable = true;
rootless = {
enable = true;
setSocketVariable = true;
};
};
nixpkgs = {
hostPlatform = lib.mkDefault "x86_64-linux";
config = {
permittedInsecurePackages = [ "electron-25.9.0" ];
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "vmware-horizon-client" "libfprint-2-tod1-goodix" "vmware-workstation" ];
};
};
boot = {
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
initrd = {
availableKernelModules = [ "sd_mod" ];
kernelModules = [ ];
};
kernel.sysctl = {
"net.core.default_qdisc" = "fq";
"net.ipv4.tcp_congestion_control" = "bbr";
};
};
hardware = {
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
pulseaudio.enable = false;
2024-01-28 13:31:45 +00:00
};
2023-10-08 14:57:57 +00:00
}