nixos-configs/nixos/default.nix

177 lines
3.5 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-11-17 20:04:03 +00:00
inputs.sops-nix.nixosModules.sops
2024-10-26 18:24:13 +00:00
./lanzaboote.nix
./tidal.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
];
options.pim.inWheel = lib.mkOption {
type = lib.types.bool;
default = true;
};
2024-10-26 18:24:13 +00:00
config = {
time.timeZone = "Europe/Amsterdam";
i18n.defaultLocale = "en_US.UTF-8";
programs.ssh.startAgent = true;
hardware.pulseaudio.enable = false;
systemd = {
services.NetworkManager-wait-online.enable = lib.mkForce false;
network.wait-online.enable = lib.mkForce false;
};
services = {
2024-11-16 23:16:55 +00:00
xserver = {
enable = true;
excludePackages = [pkgs.xterm];
};
tailscale = {
useRoutingFeatures = "client";
extraSetFlags = ["--accept-routes"];
};
printing = {
enable = true;
drivers = [pkgs.hplip pkgs.gutenprint];
};
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
2024-11-11 20:00:51 +00:00
};
users.users.pim = {
isNormalUser = true;
extraGroups =
["docker" "input" "wireshark" "dialout"]
++ lib.optional config.pim.inWheel "wheel";
2024-10-26 18:24:13 +00:00
};
environment = {
systemPackages = with pkgs; [
age
btop
btrfs-progs
curl
dig
exfat
f3
fastfetch
file
git
jq
ripgrep
sbctl
tree
vim
wget
yq
ncdu
lshw
sops
];
2024-10-26 18:24:13 +00:00
};
system = {
stateVersion = "23.05";
2024-10-26 18:24:13 +00:00
activationScripts.diff = ''
if [[ -e /run/current-system ]]; then
${pkgs.nix}/bin/nix store diff-closures /run/current-system "$systemConfig"
fi
'';
};
2024-10-26 18:24:13 +00:00
security = {
rtkit.enable = true;
2024-10-26 18:24:13 +00:00
sudo.extraConfig = ''
Defaults timestamp_timeout=30
'';
2024-10-26 18:24:13 +00:00
};
nix = {
package = pkgs.nixFlakes;
settings.trusted-users = ["root" "pim"];
2024-10-26 18:24:13 +00:00
extraOptions = ''
experimental-features = nix-command flakes
'';
2024-10-26 18:24:13 +00:00
gc = {
automatic = true;
persistent = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
2024-10-26 18:24:13 +00:00
};
networking = {
useDHCP = lib.mkDefault true;
networkmanager.unmanaged = lib.mkIf config.services.tailscale.enable ["tailscale0"];
wireless.extraConfig = ''
p2p_disabled=1
'';
};
2024-10-26 18:24:13 +00:00
nixpkgs = {
hostPlatform = lib.mkDefault "x86_64-linux";
config = {
allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"libfprint-2-tod1-goodix"
"steam"
"steam-original"
"steam-run"
];
};
overlays = [
inputs.nur.overlay
(final: _prev: {
unstable = import inputs.nixpkgs-unstable {
inherit (pkgs) system;
config.allowUnfree = true;
};
})
];
2024-10-26 18:24:13 +00:00
};
boot.kernel.sysctl = {
2024-10-26 18:24:13 +00:00
"net.core.default_qdisc" = "fq";
"net.ipv4.tcp_congestion_control" = "bbr";
};
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {inherit self inputs;};
2024-10-26 18:24:13 +00:00
users.pim.imports = ["${self}/home-manager"];
};
2024-10-26 18:24:13 +00:00
};
}