initial nixos-config
This commit is contained in:
93
hosts/merkur/configuration.nix
Normal file
93
hosts/merkur/configuration.nix
Normal file
@ -0,0 +1,93 @@
|
||||
{ inputs, lib, config, pkgs, ... }: {
|
||||
imports = [
|
||||
./hardware-configuration.nix # Current system hardware config
|
||||
|
||||
../common/stefan.nix
|
||||
# ../modules/gnome.nix
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true; # Allow proprietary packages
|
||||
|
||||
nix = { # Nix package manager settings
|
||||
registry = lib.mapAttrs (_: value: { flake = value; }) inputs; # Adds each flake input to make nix3 commands consistent to flake
|
||||
|
||||
# This will additionally add your inputs to the system's legacy channels
|
||||
# Making legacy nix commands consistent as well, awesome!
|
||||
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
|
||||
|
||||
settings = {
|
||||
experimental-features = "nix-command flakes"; # Enable flake support
|
||||
auto-optimise-store = true; # Duplicate and optimize nix store
|
||||
};
|
||||
gc = { # Automatic garbage collection
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 2d";
|
||||
};
|
||||
};
|
||||
|
||||
boot = {
|
||||
#kernelPackages = pkgs.linuxPackages_latest; # Latest stable kernel
|
||||
loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
configurationLimit = 5; # Limit the amount of configuration
|
||||
};
|
||||
efi.canTouchEfiVariables = true;
|
||||
timeout = 1; # Grub autoselect time
|
||||
};
|
||||
};
|
||||
|
||||
networking = { # Network settings
|
||||
hostName = "merkur";
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
|
||||
security = {
|
||||
rtkit.enable = true; # RealTimeKit ex. PulseAudio
|
||||
polkit.enable = true;
|
||||
};
|
||||
|
||||
i18n = { # internationalisation properties
|
||||
defaultLocale = "de_DE.UTF-8";
|
||||
extraLocaleSettings = {
|
||||
LC_ADDRESS = "de_DE.UTF-8";
|
||||
LC_IDENTIFICATION = "de_DE.UTF-8";
|
||||
LC_MEASUREMENT = "de_DE.UTF-8";
|
||||
LC_MONETARY = "de_DE.UTF-8";
|
||||
LC_NAME = "de_DE.UTF-8";
|
||||
LC_NUMERIC = "de_DE.UTF-8";
|
||||
LC_PAPER = "de_DE.UTF-8";
|
||||
LC_TELEPHONE = "de_DE.UTF-8";
|
||||
LC_TIME = "de_DE.UTF-8";
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
xserver = {
|
||||
layout = "de"; # X11 keymap
|
||||
xkbVariant = "";
|
||||
};
|
||||
pipewire = { # Sound
|
||||
enable = true;
|
||||
alsa = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
};
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
wget
|
||||
tree
|
||||
];
|
||||
};
|
||||
|
||||
# Configure console keymap
|
||||
console.keyMap = "de"; # Console keymap settings
|
||||
|
||||
system.stateVersion = "23.05"; # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||
}
|
38
hosts/merkur/hardware-configuration.nix
Normal file
38
hosts/merkur/hardware-configuration.nix
Normal file
@ -0,0 +1,38 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "sd_mod" "sr_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/2ffd7af0-882b-4f88-9cf9-02d9abd555b4";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/7C6D-739B";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
Reference in New Issue
Block a user