nixconfigs/nixos/configuration.nix

214 lines
5.5 KiB
Nix
Raw Normal View History

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;
# try newer kernels
2020-03-08 02:10:28 +01:00
#boot.kernelPackages = pkgs.linuxPackages_latest;
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
#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;
};
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;
extraConfig = ''
2020-02-16 21:58:51 +01:00
SATA_LINKPWR_ON_BAT=medium_power
SATA_LINKPWR_ON_AC=max_performance
'';
};
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;
programs.wireshark =
{
enable = true;
package = pkgs.wireshark-qt.overrideAttrs (oldAttrs: rec { patches = oldAttrs.patches ++ [ ./133dbc2.diff ];});
};
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
#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;
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
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
hardware.bluetooth = {
enable = true;
config.General.Disable = "Headset"; # disable headset profile
};
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";
services.xserver.videoDrivers = [ "modesetting" "intel" ];
2018-09-25 23:09:53 +02:00
# Enable touchpad support.
services.xserver.libinput.enable = true;
# 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.
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
# 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-25 23:09:53 +02:00
# profile sync daemon
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
# 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;
2018-09-25 23:09:53 +02:00
2019-10-02 22:26:15 +02:00
# package debugging
# programs.sysdig.enable = true;
2019-10-02 22:26:15 +02:00
# declarative containers
containers = {
hash2PubSim = import ./Hash2PubTestbed.nix {inherit pkgs config;};
};
# 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.
system.stateVersion = "18.09"; # Did you read the comment?
2018-09-25 23:09:53 +02:00
}