2025.04.30-20:50
This commit is contained in:
202
nixos_24.11_cinnamon/configuration.nix
Normal file
202
nixos_24.11_cinnamon/configuration.nix
Normal file
@ -0,0 +1,202 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./config
|
||||
];
|
||||
|
||||
# Bootloader
|
||||
boot = {
|
||||
loader.systemd-boot.enable = true;
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
#loader.systemd-boot.consoleMode = "2";
|
||||
loader.systemd-boot.editor = false;
|
||||
loader.systemd-boot.memtest86.enable = true;
|
||||
|
||||
consoleLogLevel = 3; # silence ACPI "errors" (default is 4)
|
||||
plymouth.enable = true;
|
||||
tmp.useTmpfs = true;
|
||||
tmp.tmpfsSize = "50%"; # set to auto to dynamically grow
|
||||
tmp.cleanOnBoot = true;
|
||||
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
#kernelPackages = pkgs.linuxKernel.kernels.linux_xanmod;
|
||||
# initrd.network.openvpn.enable = true;
|
||||
};
|
||||
|
||||
# Enable Kernel same-page merging
|
||||
hardware.ksm.enable = true;
|
||||
|
||||
# Enable networking
|
||||
networking ={
|
||||
networkmanager.enable = true;
|
||||
networkmanager.plugins = with pkgs; [ networkmanager-openvpn ];
|
||||
usePredictableInterfaceNames = false;
|
||||
hostName = "wlin002-nixos";
|
||||
};
|
||||
|
||||
# Set your time zone
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "de_DE.UTF-8";
|
||||
i18n.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";
|
||||
};
|
||||
|
||||
# Configure console keymap
|
||||
console.keyMap = "de";
|
||||
|
||||
# Define a user account. Dont forget to set a password with passwd.
|
||||
users.users.zulumann = {
|
||||
isNormalUser = true;
|
||||
description = "Henrik Lutzmann";
|
||||
extraGroups = [ "networkmanager" "wheel" "audio" "video" ];
|
||||
openssh.authorizedKeys.keyFiles = [ /etc/nixos/config/home/ssh/authorized_keys ];
|
||||
packages = with pkgs; [ ];
|
||||
};
|
||||
|
||||
# Enable Firmware
|
||||
hardware = {
|
||||
#enableAllFirmware = true;
|
||||
enableRedistributableFirmware = true;
|
||||
cpu.amd.updateMicrocode = true;
|
||||
#cpu.intel.updateMicrocode = true;
|
||||
};
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
programs.mtr.enable = true;
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
|
||||
# Enable ZramSwap
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
priority = 100;
|
||||
memoryPercent = 25;
|
||||
algorithm = "zstd";
|
||||
};
|
||||
|
||||
# Automatic Upgrades
|
||||
system.autoUpgrade = {
|
||||
enable = false;
|
||||
allowReboot = false;
|
||||
channel = "https://channels.nixos.org/nixos-24.11";
|
||||
};
|
||||
|
||||
# NixOS Settings
|
||||
documentation.nixos.enable = true;
|
||||
nix = {
|
||||
gc.automatic = true;
|
||||
gc.options = "--delete-older-than 7d";
|
||||
optimise.automatic = true;
|
||||
optimise.dates = [ "weekly" ];
|
||||
settings.auto-optimise-store = true;
|
||||
settings.cores = 4; # maximum number of concurrent tasks during one build
|
||||
settings.max-jobs = 4; # maximum number of jobs that Nix will try to build in parallel
|
||||
settings.sandbox = true; # perform builds in a sandboxed environment
|
||||
};
|
||||
|
||||
# Filesystems
|
||||
fileSystems."/run" = {
|
||||
device = "tmpfs";
|
||||
fsType = "tmpfs";
|
||||
options = [ "size=6G" ]; # Adjust based on your preferences and needs
|
||||
};
|
||||
|
||||
# Fixed : better to use Dynamic
|
||||
fileSystems."/tmp" = {
|
||||
device = "tmpfs";
|
||||
fsType = "tmpfs";
|
||||
options = [ "size=7G" ]; # Adjust based on your preferences and needs
|
||||
};
|
||||
|
||||
# No access time and continuous TRIM for SSD
|
||||
fileSystems."/".options = [ "noatime" "discard" ];
|
||||
fileSystems."/home".options = [ "noatime" "discard" ];
|
||||
|
||||
fileSystems."/home/zulumann/VM-Image" = {
|
||||
device = "/dev/disk/by-uuid/3b47d34d-618a-4a33-9f65-cde6e0d6467e";
|
||||
fsType = "ext4";
|
||||
options = [ "discard" "noatime" "nofail" "x-systemd.device-timeout=3" ];
|
||||
};
|
||||
|
||||
# List services that you want to enable:
|
||||
services = {
|
||||
acpid.enable = true;
|
||||
ananicy.enable = true;
|
||||
#fwupd.enable = true;
|
||||
gvfs.enable = true;
|
||||
haveged.enable = true;
|
||||
preload.enable = true;
|
||||
udisks2.enable = true;
|
||||
#tumbler.enable = true;
|
||||
};
|
||||
|
||||
# Enable OpenSSH
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
settings.PermitRootLogin = "no";
|
||||
settings.PasswordAuthentication = false;
|
||||
};
|
||||
|
||||
# Enable sound with pipewire
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
#media-session.enable = true;
|
||||
};
|
||||
|
||||
# Enable Avahi
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
nssmdns4 = true;
|
||||
publish = {
|
||||
enable = true;
|
||||
addresses = true;
|
||||
domain = true;
|
||||
hinfo = true;
|
||||
userServices = true;
|
||||
workstation = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Open ports in the firewall
|
||||
# netstat -ntulp
|
||||
networking.firewall = {
|
||||
enable = false;
|
||||
allowPing = true;
|
||||
logRefusedConnections = true;
|
||||
allowedTCPPorts = [ ];
|
||||
allowedUDPPorts = [ ];
|
||||
allowedTCPPortRanges = [ ];
|
||||
allowedUDPPortRanges = [ ];
|
||||
};
|
||||
|
||||
# Copy the NixOS configuration file and link it from the resulting system
|
||||
# (/run/current-system/configuration.nix). This is useful in case you
|
||||
# accidentally delete configuration.nix.
|
||||
system.copySystemConfiguration = true;
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
}
|
Reference in New Issue
Block a user