#
# Main system configuration. More information available in configuration.nix(5) man page.
#
# flake.nix
# ├─ ./hosts
# │ └─ configuration.nix *
# └─ ./modules
# ├─ ./editors
# │ └─ default.nix
# └─ ./shell
# └─ default.nix
#
{ stable, pkgs, inputs, config, ... }:
{
imports = [
../modules/desktop
../modules/services
./nixos-config-options.nix
inputs.home-manager.nixosModules.home-manager
];
boot.tmp = {
cleanOnBoot = true;
useTmpfs = true;
};
home-manager.useUserPackages = true;
home-manager.useGlobalPkgs = true;
home-manager.extraSpecialArgs = {
inherit inputs stable;
};
home-manager.users.${config.nixos-config.defaultUser} = {
imports = [
inputs.nix-index-database.hmModules.nix-index
./home.nix
./${config.networking.hostName}/home.nix
./nixos-config-options.nix
{
nixos-config = {
inherit (config.nixos-config) defaultUser location;
};
}
];
};
hardware.pulseaudio.enable = false;
users.users.${config.nixos-config.defaultUser} = {
isNormalUser = true;
extraGroups = [
"wheel" "video" "audio" "camera"
"networkmanager" "lp" "scanner"
"plex" ];
shell = pkgs.zsh;
};
programs.zsh.enable = true;
networking.networkmanager.enable = true;
programs.command-not-found.enable = false;
security.sudo.wheelNeedsPassword = true;
programs.dconf.enable = true;
services.udisks2.enable = true;
time.timeZone = "Europe/Prague"; # Time zone and internationalisation
i18n = {
defaultLocale = "en_US.UTF-8";
};
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
security.rtkit.enable = true;
systemd.services.rtkit-daemon = {
serviceConfig = {
LogLevelMax = 4;
ExecStart = [
""
"${pkgs.rtkit}/libexec/rtkit-daemon --processes-per-user-max=1000 --processes-per-user-max=10000 --actions-per-burst-max=1000 --actions-burst-sec=10 --canary-cheep-msec=30000 --canary-watchdog-msec=60000"
];
};
};
security.polkit.enable = true;
fonts.packages = with pkgs; [ # Fonts
inter
ubuntu_font_family
fira-code
roboto
carlito # NixOS
vegur # NixOS
source-code-pro
jetbrains-mono
font-awesome # Icons
corefonts # MS
vistafonts
(nerdfonts.override { # Nerdfont Icons override
fonts = [
"FiraCode"
"Ubuntu"
];
})
];
fonts.fontconfig = {
defaultFonts = {
serif = [ "Ubuntu" ];
sansSerif = [ "Ubuntu" ];
monospace = [ "Ubuntu Mono" ];
};
};
environment = {
variables = {
TERMINAL = "kitty";
EDITOR = "emacsclient";
VISUAL = "emacsclient";
};
pathsToLink = [ "/share/zsh" ];
systemPackages = with pkgs; [ # Default packages installed system-wide
alsa-utils
jq
killall
nano
pciutils
ripgrep
bat
socat
usbutils
wget
];
};
services = {
tumbler.enable = true;
pipewire = { # Sound
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
jack.enable = true;
};
};
systemd.network = {
wait-online.enable = false;
};
nix = { # Nix Package Manager settings
registry.nixpkgs.flake = inputs.nixpkgs;
registry.nixpkgs-stable.flake = inputs.nixpkgs-stable;
nixPath = [
"nixpkgs=flake:nixpkgs"
"nixpkgs-stable=flake:nixpkgs-stable"
];
settings = {
connect-timeout = 5;
flake-registry = ""; # Do not pollute with external flake registry
auto-optimise-store = true; # Optimise syslinks
substituters = [
"https://cache.nixos.org"
];
keep-outputs = true;
keep-derivations = true;
experimental-features = [ "nix-command" "flakes" ];
};
gc = { # Automatic garbage collection
automatic = true;
dates = "weekly";
options = "--delete-older-than 2d";
};
};
nixpkgs.config.allowUnfree = true;
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
system = {
stateVersion = "23.05";
};
}