config/base.nix

72 lines
2.1 KiB
Nix
Raw Normal View History

{ config, pkgs, lib, inputs, ... }:
2023-02-25 04:39:30 +01:00
{
imports = [
2023-06-19 02:44:40 +02:00
./cachix.nix # update with `cachix use --mode nixos -d . FOOBAR`
./profiles/locale-no.nix
2023-03-12 05:14:28 +01:00
# results of 'nixos-generate-config'
# nice to have if i just dump this flake into /etc/nixos on a clean install
(if builtins.pathExists ./configuration.nix
then ./configuration.nix
else {}
)
2023-02-25 04:39:30 +01:00
(if builtins.pathExists ./hardware-configuration.nix
2023-03-12 05:14:28 +01:00
then ./hardware-configuration.nix
2023-02-25 04:39:30 +01:00
else {}
)
];
2023-06-29 02:16:16 +02:00
environment.systemPackages = with pkgs; [
ddrescue
gptfdisk
ms-sys
nvme-cli
parted
pciutils
smartmontools
testdisk
usbutils
];
2023-06-24 19:11:49 +02:00
# TODO: selectively whitelist?
2023-02-25 04:39:30 +01:00
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowUnfreePredicate = (pkg: true);
2023-03-03 02:24:07 +01:00
nixpkgs.config.nonfreeLicensing = true; # used by ffmpeg
2023-02-25 04:39:30 +01:00
2023-07-09 00:10:03 +02:00
# TODO: per host?
hardware.enableRedistributableFirmware = true;
2023-06-24 19:11:49 +02:00
nix.settings.experimental-features = [
"nix-command"
"flakes"
2023-02-26 21:15:08 +01:00
];
2023-03-11 00:30:24 +01:00
nix.settings.allowed-users = [ "*" ]; # default
#nix.settings.allowed-users = [ "@nixbld" "@builders" ]; # TODO: this
nix.settings.trusted-users = [ "root" "@wheel" ];
2023-02-25 04:39:30 +01:00
nix.settings.auto-optimise-store = true; # deduplicate with hardlinks, expensive. Alternative: nix-store --optimise
#nix.optimize.automatic = true; # periodic optimization
nix.gc.automatic = true;
nix.gc.dates = "weekly";
nix.gc.options = "--delete-older-than 30d";
2023-09-09 11:58:01 +02:00
nix.extraOptions = ''
min-free = ${toString (1 * 1024 * 1024 * 1024)}
max-free = ${toString (5 * 1024 * 1024 * 1024)}
'';
2023-02-25 04:39:30 +01:00
2023-06-24 19:11:49 +02:00
services.thermald.enable = lib.mkIf (config.nixpkgs.system == "x86_64-linux") true;
2023-02-25 04:39:30 +01:00
2023-10-14 18:23:24 +02:00
# System fonts
# Nice to have when X-forwading on headless machines
fonts.fontDir.enable = true; # creates /run/current-system/sw/share/X11/fonts
fonts.enableDefaultFonts = true; # dejavu, freefont, gyre, liberation, unifont, noto-fonts-emoji
fonts.fonts = with pkgs; [
noto-fonts # includes Cousine
noto-fonts-cjk
noto-fonts-emoji
noto-fonts-extra
];
2023-02-25 04:39:30 +01:00
# firewall
services.fail2ban.enable = config.services.openssh.enable;
networking.firewall.enable = true; # default
}