Files
nix/modules/base.nix
2026-03-25 10:23:51 +01:00

143 lines
2.6 KiB
Nix

{
pkgs,
userName,
...
}:
{
nixpkgs.config.allowUnfree = true;
nix = {
settings = {
auto-optimise-store = true;
experimental-features = [
"nix-command"
"flakes"
];
trusted-users = [
"root"
"@wheel"
];
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
};
};
boot.loader.systemd-boot.enable = false;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub = {
enable = true;
configurationLimit = 10;
device = "nodev";
efiSupport = true;
enableCryptodisk = true;
useOSProber = true;
zfsSupport = true;
};
i18n = rec {
defaultLocale = "en_US.UTF-8";
extraLocales = [ "sv_SE.UTF-8/UTF-8" ];
extraLocaleSettings = {
LC_ADDRESS = defaultLocale;
LC_CTYPE = defaultLocale;
LC_COLLATE = defaultLocale;
LC_IDENTIFICATION = defaultLocale;
LC_MEASUREMENT = defaultLocale;
LC_MESSAGES = defaultLocale;
LC_MONETARY = defaultLocale;
LC_NAME = defaultLocale;
LC_NUMERIC = defaultLocale;
LC_PAPER = defaultLocale;
LC_TELEPHONE = defaultLocale;
LC_TIME = defaultLocale;
};
};
services.xserver.xkb.layout = "se";
time.timeZone = "Europe/Stockholm";
console = {
font = "ter-v16n";
keyMap = "sv-latin1";
packages = [ pkgs.terminus_font ];
};
networking.useNetworkd = true;
systemd.network.enable = true;
systemd.network.wait-online.enable = false;
services.resolved.enable = true;
services.openssh.enable = true;
systemd.network.networks."10-wired" = {
matchConfig.Name = [
"en*"
"eth*"
];
networkConfig = {
DHCP = "yes";
IPv6AcceptRA = true;
};
dhcpV4Config.RouteMetric = 100;
dhcpV6Config.RouteMetric = 100;
};
programs.zsh.enable = true;
programs.htop.enable = true;
programs.tmux.enable = true;
programs.git.enable = true;
programs.lazygit.enable = true;
programs.bat.enable = true;
programs.nix-ld.enable = true;
users.defaultUserShell = pkgs.zsh;
environment.sessionVariables = {
EDITOR = "nvim";
NIXOS_OZONE_WL = "1";
};
environment.systemPackages = with pkgs; [
cowsay
fortune
lolcat
bat
fastfetch
curl
eza
fzf
git
git-lfs
ripgrep
neovim
odt2txt
openssl
stow
tpm2-tools
unzip
wget
killall
nil
gcc
clang
gnumake
cmake
ninja
pkg-config
binutils
gdb
nodejs
rustup
];
security.sudo.wheelNeedsPassword = true;
users.users.${userName}.openssh.authorizedKeys.keys = [ ];
}