nixos-laptop/nixos/default.nix

185 lines
3.4 KiB
Nix
Raw Normal View History

2024-10-26 18:33:47 +00:00
{
pkgs,
config,
lib,
inputs,
2024-11-11 19:43:36 +00:00
self,
2024-10-26 18:33:47 +00:00
...
}: {
2024-10-26 18:24:13 +00:00
imports = [
inputs.home-manager.nixosModules.home-manager
inputs.nixos-facter-modules.nixosModules.facter
2024-11-07 19:47:40 +00:00
inputs.disko.nixosModules.disko
2024-10-26 18:24:13 +00:00
./lanzaboote.nix
./tidal.nix
./sops.nix
./stylix.nix
./wireguard.nix
./gnome.nix
./compliance.nix
2024-11-07 19:47:40 +00:00
./cinnamon.nix
2024-11-09 15:54:33 +00:00
./ssh.nix
2024-10-26 18:24:13 +00:00
];
time.timeZone = "Europe/Amsterdam";
i18n.defaultLocale = "en_US.UTF-8";
programs.ssh.startAgent = true;
2024-11-12 20:57:40 +00:00
systemd.services.NetworkManager-wait-online.enable = lib.mkForce false;
2024-10-26 18:24:13 +00:00
services = {
2024-11-07 19:47:40 +00:00
xserver.enable = true;
2024-10-26 18:24:13 +00:00
2024-11-11 20:00:51 +00:00
tailscale = {
useRoutingFeatures = "client";
extraSetFlags = ["--accept-routes"];
};
2024-10-26 18:24:13 +00:00
printing = {
enable = true;
2024-10-26 18:33:47 +00:00
drivers = [pkgs.hplip pkgs.gutenprint];
2024-10-26 18:24:13 +00:00
};
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
};
users.users.pim = {
isNormalUser = true;
extraGroups = ["wheel" "docker" "input" "wireshark" "dialout"];
2024-10-26 18:24:13 +00:00
};
environment = {
systemPackages = with pkgs; [
age
borgbackup
btop
btrfs-progs
curl
dig
exfat
f3
fastfetch
file
git
jq
kubectl
nmap
poppler_utils # For pdfunite
ripgrep
sbctl
silicon
tree
units
vim
wget
yq
ncdu
lshw
];
};
system = {
stateVersion = "23.05";
activationScripts.diff = ''
if [[ -e /run/current-system ]]; then
${pkgs.nix}/bin/nix store diff-closures /run/current-system "$systemConfig"
fi
'';
};
security = {
rtkit.enable = true;
sudo.extraConfig = ''
Defaults timestamp_timeout=30
'';
};
nix = {
package = pkgs.nixFlakes;
2024-10-26 18:33:47 +00:00
settings.trusted-users = ["root" "pim"];
2024-10-26 18:24:13 +00:00
extraOptions = ''
experimental-features = nix-command flakes
'';
gc = {
automatic = true;
persistent = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
};
2024-11-10 11:16:05 +00:00
networking = {
useDHCP = lib.mkDefault true;
networkmanager.unmanaged = lib.mkIf config.services.tailscale.enable ["tailscale0"];
wireless.extraConfig = ''
p2p_disabled=1
'';
2024-11-10 11:16:05 +00:00
};
2024-10-26 18:24:13 +00:00
virtualisation.docker = {
enable = true;
rootless = {
enable = true;
setSocketVariable = true;
};
};
nixpkgs = {
hostPlatform = lib.mkDefault "x86_64-linux";
config = {
2024-10-26 18:33:47 +00:00
allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"libfprint-2-tod1-goodix"
];
2024-10-26 18:24:13 +00:00
};
overlays = [
inputs.nur.overlay
(final: _prev: {
unstable = import inputs.nixpkgs-unstable {
2024-11-11 19:43:36 +00:00
inherit (pkgs) system;
2024-10-26 18:24:13 +00:00
config.allowUnfree = true;
};
})
];
};
boot = {
2024-10-26 18:33:47 +00:00
kernelModules = ["kvm-intel" "cdrom"];
extraModulePackages = [];
2024-10-26 18:24:13 +00:00
initrd = {
2024-10-26 18:33:47 +00:00
availableKernelModules = ["sd_mod"];
kernelModules = [];
2024-10-26 18:24:13 +00:00
};
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;
};
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
2024-11-11 19:43:36 +00:00
extraSpecialArgs = {inherit self inputs;};
2024-10-26 18:24:13 +00:00
2024-11-11 19:43:36 +00:00
users.pim.imports = ["${self}/home-manager"];
2024-10-26 18:24:13 +00:00
};
}