222 lines
5.8 KiB
Nix
222 lines
5.8 KiB
Nix
# Edit this configuration file to define what should be installed on
|
||
# your system. Help is available in the configuration.nix(5) man page
|
||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||
|
||
{ config, pkgs, ... }:
|
||
|
||
let
|
||
unstable = import <nixos-unstable> {};
|
||
|
||
in
|
||
{
|
||
imports =
|
||
[
|
||
# Include the results of the hardware scan.
|
||
./hardware-configuration.nix
|
||
./packages.nix
|
||
# home manager integration
|
||
<home-manager/nixos>
|
||
];
|
||
|
||
services.davfs2.enable = true;
|
||
|
||
# try newer kernels
|
||
#boot.kernelPackages = pkgs.linuxPackages_latest;
|
||
|
||
services.fstrim.enable = true;
|
||
services.btrfs.autoScrub =
|
||
{
|
||
enable = true;
|
||
fileSystems = [ "/" "/home" ];
|
||
};
|
||
|
||
# exfat support
|
||
#boot.extraModulePackages = [ config.boot.kernelPackages.exfat-nofuse ];
|
||
|
||
zramSwap =
|
||
{
|
||
enable = true;
|
||
memoryPercent = 20;
|
||
};
|
||
boot.kernel.sysctl."vm.swappiness" = 9;
|
||
|
||
# powermanagement
|
||
services.tlp =
|
||
{
|
||
enable = true;
|
||
settings = {
|
||
"SATA_LINKPWR_ON_BAT" = "medium_power";
|
||
"SATA_LINKPWR_ON_AC" = "max_performance";
|
||
};
|
||
};
|
||
|
||
# Use the systemd-boot EFI boot loader.
|
||
boot.loader.systemd-boot.enable = true;
|
||
boot.loader.efi.canTouchEfiVariables = true;
|
||
|
||
networking.hostName = "thinknix";
|
||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||
|
||
# configure console
|
||
console = {
|
||
font = "Lat2-Terminus16";
|
||
keyMap = "de";
|
||
};
|
||
|
||
# Select internationalisation properties.
|
||
i18n = {
|
||
defaultLocale = "de_DE.UTF-8";
|
||
};
|
||
|
||
# Set your time zone.
|
||
time.timeZone = "Europe/Berlin";
|
||
|
||
# Some programs need SUID wrappers, can be configured further or are
|
||
# started in user sessions.
|
||
programs.bash.enableCompletion = true;
|
||
programs.wireshark =
|
||
{
|
||
enable = true;
|
||
package = pkgs.wireshark-qt.overrideAttrs (oldAttrs: rec { patches = oldAttrs.patches ++ [ ./133dbc2.diff ];});
|
||
};
|
||
|
||
programs.adb.enable = true;
|
||
|
||
# programs.mtr.enable = true;
|
||
# programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
|
||
|
||
# List services that you want to enable:
|
||
|
||
# Enable the OpenSSH daemon.
|
||
# services.openssh.enable = true;
|
||
|
||
#programs.ssh.startAgent = true;
|
||
|
||
# Open ports in the firewall.
|
||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||
networking.firewall.allowedTCPPortRanges = [ { from = 1714; to = 1764; } ];
|
||
networking.firewall.allowedUDPPortRanges = [ { from = 1714; to = 1764; } ]; # for KDE connect
|
||
# Or disable the firewall altogether.
|
||
# networking.firewall.enable = false;
|
||
|
||
networking.networkmanager.enable = true;
|
||
|
||
services.avahi.enable = true;
|
||
|
||
# Enable CUPS to print documents.
|
||
services.printing =
|
||
{
|
||
enable = true;
|
||
drivers = [ pkgs.hplip ];
|
||
};
|
||
# scanners
|
||
hardware.sane =
|
||
{
|
||
enable = true;
|
||
extraBackends = [ pkgs.hplip ];
|
||
};
|
||
|
||
# Enable sound.
|
||
sound.enable = true;
|
||
hardware.pulseaudio.enable = true;
|
||
# decouple pulseaudio application and sink volumes
|
||
hardware.pulseaudio.daemon.config = { flat-volumes = "no"; };
|
||
|
||
# Bluetooth
|
||
hardware.bluetooth = {
|
||
enable = true;
|
||
config.General.Disable = "Headset"; # disable headset profile
|
||
};
|
||
hardware.pulseaudio.package = pkgs.pulseaudioFull;
|
||
|
||
# Enable the X11 windowing system.
|
||
services.xserver.enable = true;
|
||
services.xserver.layout = "de";
|
||
services.xserver.xkbOptions = "eurosign:e";
|
||
|
||
services.xserver.videoDrivers = [ "modesetting" "intel" ];
|
||
|
||
# Enable touchpad support.
|
||
services.xserver.libinput.enable = true;
|
||
|
||
# while libinput also supports graphic tablets, enable more-specific wacom driver
|
||
services.xserver.wacom.enable = true;
|
||
|
||
# Enable the KDE Desktop Environment.
|
||
services.xserver.displayManager.sddm.enable = true;
|
||
services.xserver.desktopManager.plasma5.enable = true;
|
||
|
||
# Flatpak support
|
||
services.flatpak.enable = true;
|
||
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ];
|
||
|
||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||
users.users.spiollinux = {
|
||
isNormalUser = true;
|
||
uid = 1000;
|
||
extraGroups = [ "vboxusers" "wheel" "networkmanager" "scanner" "lp" "wireshark" "dialout" "cdrom" "input" "adbusers" ];
|
||
shell = pkgs.zsh;
|
||
};
|
||
#home-manager.users.spiollinux = import "${users.users.spiollinux.home}/nixconfigs/home/home.nix" { pkgs, ...};
|
||
|
||
# enable virtualbox support
|
||
virtualisation.virtualbox.host.enable = true;
|
||
users.extraGroups.vboxusers.members = [ "spiollinux" ];
|
||
|
||
programs.zsh =
|
||
{
|
||
enable = true;
|
||
autosuggestions.enable = true;
|
||
};
|
||
|
||
# profile sync daemon
|
||
services.psd.enable = true;
|
||
|
||
services.smartd =
|
||
{
|
||
enable = true;
|
||
devices = [ { device = "/dev/sda"; } { device = "/dev/sdb"; } ];
|
||
};
|
||
|
||
|
||
fonts = {
|
||
enableFontDir = true;
|
||
fontconfig.enable = true;
|
||
};
|
||
|
||
# fix nix-env memory issues
|
||
boot.kernel.sysctl."vm.overcommit_memory" = "1";
|
||
# keep build-time deps around for offline-rebuilding
|
||
nix.extraOptions = ''
|
||
gc-keep-outputs = true
|
||
gc-keep-derivations = true
|
||
trusted-users = spiollinux
|
||
'';
|
||
# use all cores for building
|
||
nix.buildCores = 0;
|
||
|
||
# package debugging
|
||
# programs.sysdig.enable = true;
|
||
|
||
# declarative containers
|
||
containers = {
|
||
hash2PubSim = import ./Hash2PubTestbed.nix
|
||
{
|
||
inherit pkgs config;
|
||
experimentUid = config.users.users.spiollinux.uid;
|
||
projectDir = "/home/spiollinux/Seafile/Studium/Semester11/INF-PM-FP-ANW";
|
||
};
|
||
};
|
||
|
||
# stop NetworkManager from managing virtual interfaces
|
||
networking.networkmanager.unmanaged = [ "interface-name:ve-*" ];
|
||
|
||
# This value determines the NixOS release with which your system is to be
|
||
# compatible, in order to avoid breaking some software such as database
|
||
# servers. You should change this only after NixOS release notes say you
|
||
# should.
|
||
system.stateVersion = "18.09"; # Did you read the comment?
|
||
|
||
}
|