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’).
|
|
|
|
|
|
2023-04-13 19:57:56 +02:00
|
|
|
|
{ config, pkgs, lib, inputs, ... }:
|
2018-09-25 23:09:53 +02:00
|
|
|
|
|
|
|
|
|
let
|
2023-04-13 19:57:56 +02:00
|
|
|
|
unstable = inputs.nixos-unstable;
|
2022-03-27 11:43:54 +02:00
|
|
|
|
localfork = import /home/spiollinux/src/nixpkgs { };
|
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-11-22 20:01:11 +01:00
|
|
|
|
services.davfs2.enable = true;
|
|
|
|
|
|
2019-01-09 12:16:33 +01:00
|
|
|
|
# try newer kernels
|
2023-05-11 22:22:03 +02:00
|
|
|
|
#boot.kernelPackages = pkgs.linuxPackages_latest;
|
2021-05-28 21:09:32 +02: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-25 23:09:53 +02:00
|
|
|
|
# Use the systemd-boot EFI boot loader.
|
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
|
2021-10-19 00:17:26 +02:00
|
|
|
|
# make the boot look good
|
|
|
|
|
boot.plymouth.enable = true;
|
|
|
|
|
|
2018-09-25 23:09:53 +02:00
|
|
|
|
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;
|
2021-06-09 10:06:20 +02:00
|
|
|
|
package = pkgs.wireshark;
|
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
|
|
|
|
|
2023-05-11 22:22:03 +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 = [ ... ];
|
2021-06-09 10:05:51 +02: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;
|
2021-10-03 20:46:32 +02:00
|
|
|
|
hardware.pulseaudio = {
|
|
|
|
|
enable = true;
|
|
|
|
|
# decouple pulseaudio application and sink volumes
|
|
|
|
|
daemon.config = { flat-volumes = "no"; };
|
|
|
|
|
# C3D2 hq music
|
|
|
|
|
zeroconf.discovery.enable = true;
|
|
|
|
|
zeroconf.publish.enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
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;
|
2021-06-03 13:28:46 +02:00
|
|
|
|
settings.General.Disable = "Headset"; # disable headset profile
|
2020-02-16 21:54:37 +01:00
|
|
|
|
};
|
2022-03-21 00:57:45 +01:00
|
|
|
|
hardware.pulseaudio = {
|
2022-04-01 16:14:59 +02:00
|
|
|
|
package = pkgs.pulseaudioFull;
|
2022-03-21 00:57:45 +01:00
|
|
|
|
};
|
2018-09-26 15:24:25 +02:00
|
|
|
|
|
2022-05-01 16:25:15 +02:00
|
|
|
|
# Nitrokey support
|
|
|
|
|
services.udev.packages = [ pkgs.nitrokey-udev-rules ];
|
|
|
|
|
|
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";
|
|
|
|
|
|
|
|
|
|
# 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;
|
|
|
|
|
|
2021-10-19 00:17:26 +02:00
|
|
|
|
# dconf required for several Gnome applications like Cawbird
|
|
|
|
|
programs.dconf.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-12-16 23:08:33 +01:00
|
|
|
|
# enable virtualbox support
|
2021-03-25 18:32:07 +01:00
|
|
|
|
virtualisation.virtualbox.host = {
|
|
|
|
|
enable = true;
|
|
|
|
|
#enableExtensionPack = true;
|
|
|
|
|
};
|
|
|
|
|
# allow PUEL license
|
|
|
|
|
nixpkgs.config.whitelistedLicenses = [ pkgs.lib.licenses.virtualbox-puel ];
|
2019-12-16 23:08:33 +01:00
|
|
|
|
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;
|
2021-06-09 10:07:03 +02:00
|
|
|
|
devices = [{ device = "/dev/sda"; } { device = "/dev/sdb"; }];
|
2018-09-26 15:16:04 +02:00
|
|
|
|
};
|
|
|
|
|
|
2021-06-09 10:07:03 +02:00
|
|
|
|
# block certain sites to prevent procrastination
|
|
|
|
|
systemd.services.procrastinationstop = {
|
|
|
|
|
serviceConfig.Type = "oneshot";
|
|
|
|
|
wantedBy = [ ];
|
|
|
|
|
script = ''
|
|
|
|
|
ln -sf ${pkgs.writeText "blockedHosts" ''
|
2021-06-09 12:06:56 +02:00
|
|
|
|
127.0.0.1 localhost
|
|
|
|
|
::1 localhost
|
|
|
|
|
127.0.0.2 ${config.networking.hostName}
|
|
|
|
|
::1 ${config.networking.hostName}
|
|
|
|
|
|
2021-06-09 10:07:03 +02:00
|
|
|
|
::1 twitter.com
|
|
|
|
|
127.0.0.1 twitter.com
|
|
|
|
|
::1 api.twitter.com
|
|
|
|
|
127.0.0.1 api.twitter.com
|
|
|
|
|
::1 toot.matereal.eu
|
|
|
|
|
127.0.0.1 toot.matereal.eu
|
|
|
|
|
::1 tagesschau.de
|
|
|
|
|
127.0.0.1 tagesschau.de
|
|
|
|
|
::1 dnn.de
|
2021-08-15 13:03:41 +02:00
|
|
|
|
127.0.0.1 www.dnn.de
|
|
|
|
|
::1 www.dnn.de
|
2021-06-09 10:07:03 +02:00
|
|
|
|
127.0.0.1 dnn.de
|
|
|
|
|
''} /etc/hosts
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
systemd.services.procrastinationstart = {
|
|
|
|
|
serviceConfig.Type = "oneshot";
|
|
|
|
|
wantedBy = [ ];
|
|
|
|
|
script = ''
|
|
|
|
|
ln -sf /etc/static/hosts /etc/hosts
|
|
|
|
|
'';
|
|
|
|
|
};
|
2018-10-31 00:20:14 +01:00
|
|
|
|
|
2020-02-16 21:58:51 +01:00
|
|
|
|
fonts = {
|
2021-06-03 13:28:46 +02:00
|
|
|
|
fontDir.enable = true;
|
2020-02-16 21:58:51 +01:00
|
|
|
|
fontconfig.enable = true;
|
2021-02-02 17:03:04 +01:00
|
|
|
|
fontconfig.includeUserConf = true;
|
2020-02-16 21:58:51 +01:00
|
|
|
|
};
|
2018-10-31 00:20:14 +01:00
|
|
|
|
|
2021-04-16 17:27:07 +02:00
|
|
|
|
# Enable all sysrq functions (useful to recover from some issues):
|
|
|
|
|
boot.kernel.sysctl."kernel.sysrq" = 1; # NixOS default: 16 (only the sync command)
|
|
|
|
|
|
2023-04-13 19:57:56 +02:00
|
|
|
|
nix = {
|
|
|
|
|
# expose all flake inputs through nix Path and registry
|
|
|
|
|
registry = (lib.mapAttrs (_: value: { flake = value; }) inputs) // {
|
|
|
|
|
nixpkgs.flake = inputs.nixpkgs;
|
|
|
|
|
};
|
|
|
|
|
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
|
2021-12-02 02:44:17 +01:00
|
|
|
|
# keep build-time deps around for offline-rebuilding
|
2023-04-13 19:57:56 +02:00
|
|
|
|
settings = {
|
|
|
|
|
# keep around all inputs necessary for offline-rebuilding the system
|
|
|
|
|
keep-outputs = true;
|
|
|
|
|
keep-derivations = true;
|
|
|
|
|
trusted-users = [ "spiollinux" ];
|
2023-05-08 00:58:33 +02:00
|
|
|
|
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
|
2023-04-13 19:57:56 +02:00
|
|
|
|
# use all cores for building
|
|
|
|
|
cores = 0;
|
|
|
|
|
};
|
2022-12-02 20:00:39 +01:00
|
|
|
|
};
|
2022-04-29 00:40:57 +02:00
|
|
|
|
# override tmpdir for daemon
|
|
|
|
|
#systemd.services.nix-daemon.environment.TMPDIR = "/var/tmp";
|
2018-09-25 23:09:53 +02:00
|
|
|
|
|
2023-01-03 18:49:13 +01:00
|
|
|
|
# remote builders
|
|
|
|
|
#nix.buildMachines = [
|
|
|
|
|
# {
|
|
|
|
|
# hostName = "build01.nix-community.org";
|
|
|
|
|
# sshUser = "ssh-ng://schmittlauch";
|
|
|
|
|
# sshKey = "/root/.ssh/remote_builder_key";
|
|
|
|
|
# system = "x86_64-linux";
|
|
|
|
|
# maxJobs = 64;
|
|
|
|
|
# supportedFeatures = [
|
|
|
|
|
# "big-parallel"
|
|
|
|
|
# "kvm"
|
|
|
|
|
# "nixos-test"
|
|
|
|
|
# ];
|
|
|
|
|
# }
|
|
|
|
|
#];
|
|
|
|
|
programs.ssh.knownHosts."build01.nix-community.org".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIElIQ54qAy7Dh63rBudYKdbzJHrrbrrMXLYl7Pkmk88H";
|
|
|
|
|
|
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 = {
|
2021-06-09 10:05:51 +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
|
|
|
|
|
|
|
|
|
}
|