2018-09-25 23:09:53 +02:00
|
|
|
|
# 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
|
2020-01-24 20:09:14 +01:00
|
|
|
|
unstable = import <nixos-unstable> {};
|
2018-09-25 23:09:53 +02:00
|
|
|
|
|
2020-02-16 21:58:51 +01:00
|
|
|
|
in
|
|
|
|
|
{
|
2018-09-25 23:09:53 +02:00
|
|
|
|
imports =
|
2020-02-16 21:58:51 +01:00
|
|
|
|
[
|
|
|
|
|
# Include the results of the hardware scan.
|
2018-09-25 23:09:53 +02:00
|
|
|
|
./hardware-configuration.nix
|
|
|
|
|
./packages.nix
|
2019-10-10 01:05:02 +02:00
|
|
|
|
# home manager integration
|
|
|
|
|
<home-manager/nixos>
|
2018-09-25 23:09:53 +02:00
|
|
|
|
];
|
|
|
|
|
|
2019-11-22 20:01:11 +01:00
|
|
|
|
services.davfs2.enable = true;
|
|
|
|
|
|
2019-01-09 12:16:33 +01:00
|
|
|
|
# try newer kernels
|
2020-03-08 02:10:28 +01:00
|
|
|
|
#boot.kernelPackages = pkgs.linuxPackages_latest;
|
2019-01-09 12:16:33 +01:00
|
|
|
|
|
2018-09-25 23:09:53 +02:00
|
|
|
|
services.fstrim.enable = true;
|
2018-10-25 01:30:53 +02:00
|
|
|
|
services.btrfs.autoScrub =
|
2020-02-16 21:58:51 +01:00
|
|
|
|
{
|
|
|
|
|
enable = true;
|
2019-01-14 13:24:34 +01:00
|
|
|
|
fileSystems = [ "/" "/home" ];
|
|
|
|
|
};
|
2018-10-25 01:30:53 +02:00
|
|
|
|
|
2018-10-13 19:58:56 +02:00
|
|
|
|
# exfat support
|
2019-01-09 12:16:33 +01:00
|
|
|
|
#boot.extraModulePackages = [ config.boot.kernelPackages.exfat-nofuse ];
|
2018-09-25 23:09:53 +02:00
|
|
|
|
|
2020-02-16 21:58:51 +01:00
|
|
|
|
zramSwap =
|
|
|
|
|
{
|
|
|
|
|
enable = true;
|
2019-01-14 13:24:34 +01:00
|
|
|
|
memoryPercent = 20;
|
|
|
|
|
};
|
2018-10-22 23:49:39 +02:00
|
|
|
|
boot.kernel.sysctl."vm.swappiness" = 9;
|
|
|
|
|
|
2018-09-26 14:03:53 +02:00
|
|
|
|
# powermanagement
|
2020-02-16 21:58:51 +01:00
|
|
|
|
services.tlp =
|
|
|
|
|
{
|
|
|
|
|
enable = true;
|
2018-10-11 15:44:44 +02:00
|
|
|
|
extraConfig = ''
|
2020-02-16 21:58:51 +01:00
|
|
|
|
SATA_LINKPWR_ON_BAT=medium_power
|
|
|
|
|
SATA_LINKPWR_ON_AC=max_performance
|
2018-10-11 15:44:44 +02:00
|
|
|
|
'';
|
|
|
|
|
};
|
2018-09-25 23:09:53 +02:00
|
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
|
2020-03-08 02:10:28 +01:00
|
|
|
|
# configure console
|
|
|
|
|
console = {
|
|
|
|
|
font = "Lat2-Terminus16";
|
|
|
|
|
keyMap = "de";
|
|
|
|
|
};
|
|
|
|
|
|
2018-09-25 23:09:53 +02:00
|
|
|
|
# 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;
|
2020-04-10 14:53:21 +02:00
|
|
|
|
programs.wireshark =
|
|
|
|
|
{
|
|
|
|
|
enable = true;
|
2020-07-01 20:05:50 +02:00
|
|
|
|
package = pkgs.wireshark-qt.overrideAttrs (oldAttrs: rec { patches = oldAttrs.patches ++ [ ./133dbc2.diff ];});
|
2020-04-10 14:53:21 +02:00
|
|
|
|
};
|
2020-06-09 22:26:02 +02:00
|
|
|
|
|
|
|
|
|
programs.adb.enable = true;
|
|
|
|
|
|
2018-09-25 23:09:53 +02:00
|
|
|
|
# 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;
|
2020-02-16 21:58:51 +01:00
|
|
|
|
|
2020-04-10 14:53:21 +02:00
|
|
|
|
#programs.ssh.startAgent = true;
|
2018-09-25 23:09:53 +02:00
|
|
|
|
|
|
|
|
|
# Open ports in the firewall.
|
|
|
|
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
|
|
|
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
2019-01-09 12:16:29 +01:00
|
|
|
|
networking.firewall.allowedTCPPortRanges = [ { from = 1714; to = 1764; } ];
|
|
|
|
|
networking.firewall.allowedUDPPortRanges = [ { from = 1714; to = 1764; } ]; # for KDE connect
|
2018-09-25 23:09:53 +02:00
|
|
|
|
# Or disable the firewall altogether.
|
|
|
|
|
# networking.firewall.enable = false;
|
2020-02-16 21:58:51 +01:00
|
|
|
|
|
2018-09-25 23:09:53 +02:00
|
|
|
|
networking.networkmanager.enable = true;
|
|
|
|
|
|
2018-10-03 23:48:19 +02:00
|
|
|
|
services.avahi.enable = true;
|
|
|
|
|
|
2018-09-25 23:09:53 +02:00
|
|
|
|
# Enable CUPS to print documents.
|
2020-02-16 21:58:51 +01:00
|
|
|
|
services.printing =
|
|
|
|
|
{
|
|
|
|
|
enable = true;
|
2018-09-26 15:20:59 +02:00
|
|
|
|
drivers = [ pkgs.hplip ];
|
|
|
|
|
};
|
|
|
|
|
# scanners
|
2020-02-16 21:53:40 +01:00
|
|
|
|
hardware.sane =
|
|
|
|
|
{
|
|
|
|
|
enable = true;
|
|
|
|
|
extraBackends = [ pkgs.hplip ];
|
2018-09-26 15:20:59 +02:00
|
|
|
|
};
|
2018-09-25 23:09:53 +02:00
|
|
|
|
|
|
|
|
|
# Enable sound.
|
|
|
|
|
sound.enable = true;
|
|
|
|
|
hardware.pulseaudio.enable = true;
|
2019-10-02 22:26:15 +02:00
|
|
|
|
# decouple pulseaudio application and sink volumes
|
2020-02-16 21:58:51 +01:00
|
|
|
|
hardware.pulseaudio.daemon.config = { flat-volumes = "no"; };
|
2018-09-25 23:09:53 +02:00
|
|
|
|
|
2018-09-26 15:24:25 +02:00
|
|
|
|
# Bluetooth
|
2020-02-16 21:54:37 +01:00
|
|
|
|
hardware.bluetooth = {
|
|
|
|
|
enable = true;
|
2020-03-10 10:56:09 +01:00
|
|
|
|
config.General.Disable = "Headset"; # disable headset profile
|
2020-02-16 21:54:37 +01:00
|
|
|
|
};
|
2018-09-26 15:24:25 +02:00
|
|
|
|
hardware.pulseaudio.package = pkgs.pulseaudioFull;
|
|
|
|
|
|
2018-09-25 23:09:53 +02:00
|
|
|
|
# Enable the X11 windowing system.
|
|
|
|
|
services.xserver.enable = true;
|
|
|
|
|
services.xserver.layout = "de";
|
|
|
|
|
services.xserver.xkbOptions = "eurosign:e";
|
|
|
|
|
|
2018-09-26 02:07:43 +02:00
|
|
|
|
services.xserver.videoDrivers = [ "modesetting" "intel" ];
|
2018-09-25 23:09:53 +02:00
|
|
|
|
|
|
|
|
|
# Enable touchpad support.
|
|
|
|
|
services.xserver.libinput.enable = true;
|
|
|
|
|
|
2020-10-14 01:38:48 +02:00
|
|
|
|
# while libinput also supports graphic tablets, enable more-specific wacom driver
|
|
|
|
|
services.xserver.wacom.enable = true;
|
|
|
|
|
|
2018-09-25 23:09:53 +02:00
|
|
|
|
# Enable the KDE Desktop Environment.
|
|
|
|
|
services.xserver.displayManager.sddm.enable = true;
|
|
|
|
|
services.xserver.desktopManager.plasma5.enable = true;
|
|
|
|
|
|
2020-01-24 20:09:14 +01:00
|
|
|
|
# Flatpak support
|
|
|
|
|
services.flatpak.enable = true;
|
|
|
|
|
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ];
|
|
|
|
|
|
2018-09-25 23:09:53 +02:00
|
|
|
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
2020-04-10 14:53:21 +02:00
|
|
|
|
users.users.spiollinux = {
|
2018-09-25 23:09:53 +02:00
|
|
|
|
isNormalUser = true;
|
|
|
|
|
uid = 1000;
|
2020-06-09 22:26:02 +02:00
|
|
|
|
extraGroups = [ "vboxusers" "wheel" "networkmanager" "scanner" "lp" "wireshark" "dialout" "cdrom" "input" "adbusers" ];
|
2018-09-25 23:09:53 +02:00
|
|
|
|
shell = pkgs.zsh;
|
|
|
|
|
};
|
2019-10-10 01:05:02 +02:00
|
|
|
|
#home-manager.users.spiollinux = import "${users.users.spiollinux.home}/nixconfigs/home/home.nix" { pkgs, ...};
|
2018-09-25 23:09:53 +02:00
|
|
|
|
|
2019-12-16 23:08:33 +01:00
|
|
|
|
# enable virtualbox support
|
|
|
|
|
virtualisation.virtualbox.host.enable = true;
|
|
|
|
|
users.extraGroups.vboxusers.members = [ "spiollinux" ];
|
|
|
|
|
|
2020-02-16 21:58:51 +01:00
|
|
|
|
programs.zsh =
|
|
|
|
|
{
|
|
|
|
|
enable = true;
|
2018-10-07 16:49:34 +02:00
|
|
|
|
autosuggestions.enable = true;
|
2018-09-26 02:07:43 +02:00
|
|
|
|
};
|
2018-09-25 23:09:53 +02:00
|
|
|
|
|
2020-04-10 14:53:21 +02:00
|
|
|
|
# profile sync daemon
|
2019-04-12 11:44:49 +02:00
|
|
|
|
services.psd.enable = true;
|
2018-10-13 22:11:30 +02:00
|
|
|
|
|
2018-09-26 15:16:04 +02:00
|
|
|
|
services.smartd =
|
2020-02-16 21:58:51 +01:00
|
|
|
|
{
|
|
|
|
|
enable = true;
|
|
|
|
|
devices = [ { device = "/dev/sda"; } { device = "/dev/sdb"; } ];
|
2018-09-26 15:16:04 +02:00
|
|
|
|
};
|
|
|
|
|
|
2018-10-31 00:20:14 +01:00
|
|
|
|
|
2020-02-16 21:58:51 +01:00
|
|
|
|
fonts = {
|
|
|
|
|
enableFontDir = true;
|
|
|
|
|
fontconfig.enable = true;
|
|
|
|
|
};
|
2018-10-31 00:20:14 +01:00
|
|
|
|
|
2018-10-13 19:56:31 +02:00
|
|
|
|
# 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
|
2019-10-12 21:53:16 +02:00
|
|
|
|
trusted-users = spiollinux
|
2018-10-13 19:56:31 +02:00
|
|
|
|
'';
|
2018-10-22 23:49:39 +02:00
|
|
|
|
# use all cores for building
|
|
|
|
|
nix.buildCores = 0;
|
2018-09-25 23:09:53 +02:00
|
|
|
|
|
2019-10-02 22:26:15 +02:00
|
|
|
|
# package debugging
|
2019-11-22 20:04:10 +01:00
|
|
|
|
# programs.sysdig.enable = true;
|
2019-10-02 22:26:15 +02:00
|
|
|
|
|
2020-07-26 00:34:08 +02:00
|
|
|
|
# declarative containers
|
|
|
|
|
containers = {
|
2020-10-09 01:20:40 +02:00
|
|
|
|
hash2PubSim = import ./Hash2PubTestbed.nix
|
|
|
|
|
{
|
|
|
|
|
inherit pkgs config;
|
|
|
|
|
experimentUid = config.users.users.spiollinux.uid;
|
|
|
|
|
projectDir = "/home/spiollinux/Seafile/Studium/Semester11/INF-PM-FP-ANW";
|
|
|
|
|
};
|
2020-07-26 00:34:08 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# stop NetworkManager from managing virtual interfaces
|
|
|
|
|
networking.networkmanager.unmanaged = [ "interface-name:ve-*" ];
|
|
|
|
|
|
2018-09-25 23:09:53 +02:00
|
|
|
|
# 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.
|
2018-10-12 11:08:52 +02:00
|
|
|
|
system.stateVersion = "18.09"; # Did you read the comment?
|
2018-09-25 23:09:53 +02:00
|
|
|
|
|
|
|
|
|
}
|