2024-03-16 17:18:20 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2018-09-25 23:09:53 +02:00
|
|
|
|
|
|
|
let
|
2024-01-20 12:25:32 +01:00
|
|
|
inputs = config.inputInjection.flake-inputs;
|
2023-04-13 19:57:56 +02:00
|
|
|
unstable = inputs.nixos-unstable;
|
2020-02-16 21:58:51 +01:00
|
|
|
in
|
|
|
|
{
|
2024-03-16 17:18:20 +01:00
|
|
|
imports = [
|
|
|
|
./packages.nix
|
|
|
|
./nitrokey.nix
|
2024-04-07 02:09:46 +02:00
|
|
|
./nix-settings.nix
|
2024-07-13 01:12:43 +02:00
|
|
|
./upgrade-diff.nix
|
2024-03-16 17:18:20 +01:00
|
|
|
];
|
2018-09-25 23:09:53 +02:00
|
|
|
|
2019-11-22 20:01:11 +01:00
|
|
|
services.davfs2.enable = true;
|
|
|
|
|
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
|
|
|
|
2021-10-19 00:17:26 +02:00
|
|
|
# make the boot look good
|
|
|
|
boot.plymouth.enable = true;
|
|
|
|
|
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;
|
2024-03-16 17:18:20 +01:00
|
|
|
programs.wireshark = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.wireshark;
|
|
|
|
};
|
2020-06-09 22:26:02 +02:00
|
|
|
|
|
|
|
programs.adb.enable = true;
|
|
|
|
|
2024-01-11 01:13:42 +01:00
|
|
|
programs.mtr.enable = true;
|
2018-09-25 23:09:53 +02:00
|
|
|
# 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 = [ ... ];
|
2024-03-16 17:18:20 +01:00
|
|
|
networking.firewall.allowedTCPPortRanges = [
|
|
|
|
{
|
|
|
|
from = 1714;
|
|
|
|
to = 1764;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
networking.firewall.allowedUDPPortRanges = [
|
|
|
|
{
|
|
|
|
from = 1714;
|
|
|
|
to = 1764;
|
|
|
|
}
|
|
|
|
]; # for KDE connect
|
2024-01-09 23:48:38 +01:00
|
|
|
# FIXME: kdeconnect module
|
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
|
|
|
|
2024-03-16 17:18:20 +01:00
|
|
|
networking.networkmanager = {
|
2023-12-30 20:11:57 +01:00
|
|
|
enable = true;
|
|
|
|
# FIXME: move into own file, use SOPS for secrets
|
|
|
|
ensureProfiles.profiles = {
|
2024-03-16 17:18:20 +01:00
|
|
|
"37C3" = {
|
|
|
|
connection = {
|
|
|
|
id = "37C3";
|
|
|
|
type = "wifi";
|
|
|
|
interface-name = "wlan0";
|
|
|
|
};
|
|
|
|
wifi = {
|
|
|
|
mode = "infrastructure";
|
|
|
|
ssid = "37C3";
|
|
|
|
};
|
|
|
|
wifi-security = {
|
|
|
|
auth-alg = "open";
|
|
|
|
key-mgmt = "wpa-eap";
|
|
|
|
};
|
|
|
|
"802-1x" = {
|
|
|
|
anonymous-identity = "37C3";
|
|
|
|
eap = "ttls;";
|
|
|
|
identity = "37C3";
|
|
|
|
password = "37C3";
|
|
|
|
phase2-auth = "pap";
|
|
|
|
altsubject-matches = "DNS:radius.c3noc.net";
|
|
|
|
ca-cert = "${builtins.fetchurl {
|
|
|
|
url = "https://letsencrypt.org/certs/isrgrootx1.pem";
|
|
|
|
sha256 = "sha256:1la36n2f31j9s03v847ig6ny9lr875q3g7smnq33dcsmf2i5gd92";
|
|
|
|
}}";
|
|
|
|
};
|
|
|
|
ipv4 = {
|
|
|
|
method = "auto";
|
|
|
|
};
|
|
|
|
ipv6 = {
|
|
|
|
addr-gen-mode = "default";
|
|
|
|
method = "auto";
|
|
|
|
};
|
2023-12-30 20:11:57 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2018-09-25 23:09:53 +02:00
|
|
|
|
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.
|
2024-03-16 17:18:20 +01:00
|
|
|
services.printing = {
|
|
|
|
enable = true;
|
|
|
|
drivers = [ pkgs.hplip ];
|
|
|
|
};
|
2018-09-26 15:20:59 +02:00
|
|
|
# scanners
|
2024-03-16 17:18:20 +01:00
|
|
|
hardware.sane = {
|
|
|
|
enable = true;
|
|
|
|
extraBackends = [ pkgs.hplip ];
|
|
|
|
};
|
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
|
|
|
};
|
2018-09-26 15:24:25 +02:00
|
|
|
|
2024-01-09 23:48:38 +01:00
|
|
|
# FIXME: at some point, hide GUI and sound (desktop vs. server) behind an option
|
2018-09-25 23:09:53 +02:00
|
|
|
# Enable the X11 windowing system.
|
2024-06-11 07:36:07 +02:00
|
|
|
services.xserver = {
|
|
|
|
enable = true;
|
|
|
|
xkb.layout = "de";
|
|
|
|
xkb.options = "eurosign:e";
|
|
|
|
};
|
2018-09-25 23:09:53 +02:00
|
|
|
|
|
|
|
# Enable touchpad support.
|
2024-06-11 07:36:07 +02:00
|
|
|
services.libinput.enable = true;
|
2018-09-25 23:09:53 +02:00
|
|
|
|
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.
|
2024-07-02 23:43:46 +02:00
|
|
|
services.displayManager.sddm = {
|
|
|
|
enable = true;
|
|
|
|
wayland.enable = true;
|
|
|
|
};
|
|
|
|
services.desktopManager.plasma6.enable = true;
|
|
|
|
# enable wayland for Chromium and Electron
|
|
|
|
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
2018-09-25 23:09:53 +02:00
|
|
|
|
2024-01-09 23:48:38 +01:00
|
|
|
# dconf required for several Gnome applications
|
2021-10-19 00:17:26 +02:00
|
|
|
programs.dconf.enable = true;
|
2024-03-16 17:18:20 +01:00
|
|
|
|
|
|
|
programs.firefox.enable = true; # enables support for automatically setting additionsl nativeMessagingHosts
|
2021-10-19 00:17:26 +02:00
|
|
|
|
2020-01-24 20:09:14 +01:00
|
|
|
# Flatpak support
|
|
|
|
services.flatpak.enable = true;
|
|
|
|
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ];
|
|
|
|
|
2023-10-26 22:02:37 +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;
|
2024-03-16 17:18:20 +01: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" ];
|
|
|
|
|
2024-03-16 17:18:20 +01:00
|
|
|
programs.zsh = {
|
|
|
|
enable = true;
|
|
|
|
autosuggestions.enable = true;
|
|
|
|
};
|
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
|
|
|
|
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)
|
|
|
|
|
2024-04-07 02:09:46 +02:00
|
|
|
nix.settings.trusted-users = [ "spiollinux" ];
|
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
|
|
|
}
|