nixos-laptop/nixos/default.nix

169 lines
3.4 KiB
Nix
Raw Permalink 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
];
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;
systemd.services.NetworkManager-wait-online.enable = lib.mkForce false;
hardware.pulseaudio.enable = false;
services = {
xserver.enable = true;
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
];
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
};
}