nixos-configs/nixos/default.nix

175 lines
3.1 KiB
Nix
Raw Normal View History

2024-10-26 18:33:47 +00:00
{
pkgs,
config,
lib,
inputs,
flake,
system,
...
}: {
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
./tailscale.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;
services = {
2024-11-07 19:47:40 +00:00
xserver.enable = true;
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";
};
};
networking.useDHCP = lib.mkDefault true;
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 {
inherit system;
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-10-26 18:33:47 +00:00
extraSpecialArgs = {inherit flake inputs;};
2024-10-26 18:24:13 +00:00
2024-10-26 18:33:47 +00:00
users.pim.imports = ["${flake}/home-manager"];
2024-10-26 18:24:13 +00:00
};
}