nixos-config/modules/base.nix

86 lines
2 KiB
Nix
Raw Normal View History

2020-08-22 17:44:39 +02:00
{ config, lib, pkgs, ... }:
{
2020-12-05 13:48:06 +01:00
imports = [
./options.nix
./tools.nix
./communication.nix
./creative.nix
./cups.nix
./fonts.nix
./tools.nix
./media.nix
./network-manager.nix
./office.nix
./pulseaudio.nix
./sway.nix
./web.nix
];
2020-08-22 17:44:39 +02:00
# Essential system tools
environment.systemPackages = with pkgs; [
git
git-crypt # used to store secrets in configuration
git-lfs # not so essential, but required to clone config
htop
tmux
2020-11-07 19:14:21 +01:00
vim
2020-08-22 17:44:39 +02:00
];
# Clean temporary files on boot
boot.cleanTmpDir = true;
# Disable firewall
networking.firewall.enable = lib.mkDefault false;
# Set zsh as default shell
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
# Sane swapping
boot.kernel.sysctl."vm.swapiness" = 10;
# Store logs persistently
services.journald.extraConfig = "Storage = persistent";
# Hard drive monitoring
services.smartd.enable = true;
# Network monitoring
services.vnstat.enable = true;
# Authentication/Encryption agents
programs.gnupg.agent.enable = true;
programs.ssh.startAgent = true;
2020-11-02 13:47:31 +01:00
# NixOS state version (see https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion)
2020-08-22 17:44:39 +02:00
system.stateVersion = "20.03";
2020-12-02 22:17:50 +01:00
nix = {
# Make sudoers trusted nix users
trustedUsers = [ "@wheel" ];
# On-the-fly optimisation of nix store
autoOptimiseStore = true;
2020-12-02 22:18:27 +01:00
# Make nix build in background less noticeable
daemonIONiceLevel = 5; # 0-7
2020-12-02 22:17:50 +01:00
};
2020-12-02 22:18:27 +01:00
systemd.services.nix-daemon.serviceConfig.CPUSchedulingPolicy = "batch";
2020-10-30 17:12:56 +01:00
2020-08-22 17:44:39 +02:00
nixpkgs.config = {
# Explicitly allow unfree packages (rule of thumb: assets ok, code not ok)
allowUnfreePredicate = (
pkg: builtins.elem (lib.getName pkg) [
"corefonts"
"vista-fonts"
]
);
# Add unstable channel
packageOverrides = pkgs: {
unstable = import (builtins.fetchTarball "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz") {
2020-08-22 17:44:39 +02:00
config = config.nixpkgs.config;
};
};
};
}