nixos-config/common/base.nix

150 lines
3.4 KiB
Nix
Raw Normal View History

2024-04-08 20:32:17 +02:00
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
imports = [
2024-04-22 06:39:13 +02:00
./locales/paris.nix
2024-04-22 20:48:35 +02:00
./services/sshd.nix
./programs/neovim.nix
./programs/zsh.nix
./programs/git.nix
2024-04-08 20:32:17 +02:00
];
nixpkgs = {
overlays = [
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
];
};
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
nix.nixPath = ["/etc/nix/path"];
environment.etc =
lib.mapAttrs'
(name: value: {
name = "nix/path/${name}";
value.source = value.flake;
})
config.nix.registry;
nix.settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Deduplicate and optimize nix store
auto-optimise-store = true;
};
2024-04-22 06:39:13 +02:00
# Unfree packages that can be installe even if "allow-unfree.nix" isn't imported
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
# Steam
"steam"
"steam-original"
"steam-run"
# Nvidia drivers
"nvidia-x11"
"nvidia-settings"
];
2024-04-08 21:28:07 +02:00
boot.loader = {
2024-04-22 20:48:35 +02:00
systemd-boot = {
enable = true;
editor = false;
};
2024-04-08 21:28:07 +02:00
efi.canTouchEfiVariables = true;
2024-04-08 20:32:17 +02:00
};
2024-04-22 20:48:35 +02:00
# boot.initrd.enable = true;
# boot.initrd.systemd.enable = true;
# boot.plymouth = {
# enable = true;
# font = "${pkgs.jetbrains-mono}/share/fonts/truetype/JetBrainsMono-Regular.ttf";
# themePackages = [ pkgs.catppuccin-plymouth ];
# theme = "catppuccin-macchiato";
# logo = pkgs.fetchurl {
# url = "https://nixos.org/logo/nixos-hires.png";
# sha256 = "1ivzgd7iz0i06y36p8m5w48fd8pjqwxhdaavc0pxs7w1g7mcy5si";
# };
# };
2024-04-08 20:32:17 +02:00
networking = {
2024-04-22 20:48:35 +02:00
networkmanager = {
enable = true;
wifi = {
powersave = true;
scanRandMacAddress = true;
# XXX https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1091
#backend = "iwd";
# Generate a random MAC for each WiFi and associate the two permanently.
macAddress = "stable";
};
# Randomize MAC for every ethernet connetion
ethernet.macAddress = "random";
connectionConfig = {
# IPv6 Privacy Extensions
"ipv6.ip6-privacy" = 2;
# unique DUID per connection
"ipv6.dhcp-duid" = "stable-uuid";
};
};
2024-04-08 20:32:17 +02:00
2024-04-22 04:21:07 +02:00
firewall = {
enable = true;
trustedInterfaces = ["tailscale0"];
};
2024-04-08 20:32:17 +02:00
};
2024-04-22 04:57:27 +02:00
# sudo and nix can only be used by the wheel group
2024-04-08 20:32:17 +02:00
nix.settings.allowed-users = ["@wheel"];
2024-04-08 21:28:07 +02:00
security.sudo.execWheelOnly = true;
2024-04-08 20:32:17 +02:00
2024-04-22 04:57:27 +02:00
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
programs.mtr.enable = true;
programs.gnupg.agent = {
2024-04-11 17:08:50 +02:00
enable = true;
2024-04-22 04:57:27 +02:00
enableSSHSupport = true;
2024-04-11 17:08:50 +02:00
};
2024-04-08 20:32:17 +02:00
environment.systemPackages = with pkgs; [
wget
dig
nmap
btop
2024-04-17 20:39:12 +02:00
gitFull
2024-04-08 20:32:17 +02:00
smartmontools
lm_sensors
pciutils
gcc
gnumake
sysstat
file
ffmpeg
2024-04-22 20:48:35 +02:00
usbutils
2024-04-08 20:32:17 +02:00
];
2024-04-22 04:57:27 +02:00
services = {
fwupd.enable = true;
tailscale.enable = true;
};
2024-04-22 20:48:35 +02:00
# console = {
# earlySetup = true;
# };
# boot.blacklistedKernelModules = [ "nvidia_drm" ];
2024-04-08 20:32:17 +02:00
}