nixos-config/common/default.nix
2024-04-22 04:57:27 +02:00

94 lines
1.9 KiB
Nix

{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
imports = [
./packages/neovim.nix
./packages/zsh.nix
./packages/git.nix
./locales/paris.nix
];
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;
};
# systemd-boot
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
networking = {
networkmanager.enable = true;
firewall = {
enable = true;
trustedInterfaces = ["tailscale0"];
};
};
# sudo and nix can only be used by the wheel group
nix.settings.allowed-users = ["@wheel"];
security.sudo.execWheelOnly = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
environment.systemPackages = with pkgs; [
wget
dig
nmap
btop
gitFull
smartmontools
lm_sensors
pciutils
gcc
gnumake
sysstat
file
ffmpeg
];
services = {
fwupd.enable = true;
tailscale.enable = true;
};
}