2022-01-18 09:32:55 +01:00
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
2022-02-23 12:40:21 +01:00
|
|
|
|
{
|
2022-01-18 09:32:55 +01:00
|
|
|
|
# boot.binfmt.emulatedSystems = [ "aarch64-linux" "qemu-aarch64" ];
|
|
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
|
networkmanager = {
|
|
|
|
|
enable = true;
|
|
|
|
|
wifi = { scanRandMacAddress = false; };
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
useDHCP = false;
|
|
|
|
|
interfaces = { };
|
|
|
|
|
|
|
|
|
|
firewall = {
|
2022-01-31 13:06:18 +01:00
|
|
|
|
|
|
|
|
|
# 51820 is used by wireguard
|
2022-01-18 09:32:55 +01:00
|
|
|
|
allowedUDPPorts = [ 51820 ];
|
|
|
|
|
|
2022-01-31 13:06:18 +01:00
|
|
|
|
# 1714 - 1764 is used by kdeconnect
|
|
|
|
|
allowedTCPPortRanges = [{
|
|
|
|
|
from = 1714;
|
|
|
|
|
to = 1764;
|
|
|
|
|
}];
|
|
|
|
|
allowedUDPPortRanges = [{
|
|
|
|
|
from = 1714;
|
|
|
|
|
to = 1764;
|
|
|
|
|
}];
|
|
|
|
|
|
2022-01-18 09:32:55 +01:00
|
|
|
|
# if packets are still dropped, they will show up in dmesg
|
|
|
|
|
logReversePathDrops = true;
|
2022-11-08 13:55:27 +01:00
|
|
|
|
# # wireguard trips rpfilter up
|
|
|
|
|
# extraCommands = ''
|
|
|
|
|
# ip46tables -t raw -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN
|
|
|
|
|
# ip46tables -t raw -I nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN
|
|
|
|
|
# '';
|
|
|
|
|
# extraStopCommands = ''
|
|
|
|
|
# ip46tables -t raw -D nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN || true
|
|
|
|
|
# ip46tables -t raw -D nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN || true
|
|
|
|
|
# '';
|
2022-01-18 09:32:55 +01:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Configure network proxy if necessary
|
|
|
|
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
|
|
|
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
|
|
|
|
|
|
|
|
|
services.dbus.enable = true;
|
|
|
|
|
services.tor.enable = true;
|
|
|
|
|
services.udev = { packages = [ pkgs.android-udev-rules ]; };
|
|
|
|
|
services.avahi.enable = true;
|
2023-08-01 12:09:11 +02:00
|
|
|
|
services.rpcbind.enable = true;
|
|
|
|
|
services.nfs.server.enable = true;
|
2022-01-18 09:32:55 +01:00
|
|
|
|
|
|
|
|
|
# Enable CUPS to print documents.
|
|
|
|
|
# services.printing.enable = true;
|
|
|
|
|
|
|
|
|
|
# Enable sound.
|
|
|
|
|
# sound.enable = true;
|
|
|
|
|
# hardware.pulseaudio.enable = true;
|
|
|
|
|
security.rtkit.enable = true;
|
|
|
|
|
services.pipewire = {
|
|
|
|
|
enable = true;
|
|
|
|
|
alsa = {
|
|
|
|
|
enable = true;
|
|
|
|
|
support32Bit = true;
|
|
|
|
|
};
|
|
|
|
|
pulse.enable = true;
|
|
|
|
|
jack.enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
security.pam.services = {
|
|
|
|
|
swaylock.text = ''
|
|
|
|
|
auth include login
|
|
|
|
|
'';
|
2023-01-07 20:28:54 +01:00
|
|
|
|
waylock.text = ''
|
|
|
|
|
auth include system-auth
|
|
|
|
|
'';
|
2022-01-18 09:32:55 +01:00
|
|
|
|
login = {
|
|
|
|
|
allowNullPassword = true;
|
|
|
|
|
setEnvironment = true;
|
|
|
|
|
setLoginUid = true;
|
|
|
|
|
startSession = true;
|
|
|
|
|
unixAuth = true;
|
|
|
|
|
updateWtmp = true;
|
|
|
|
|
|
2023-01-07 20:28:54 +01:00
|
|
|
|
# Unlock keyring on login.
|
|
|
|
|
enableGnomeKeyring = true;
|
|
|
|
|
};
|
|
|
|
|
system-auth = {
|
|
|
|
|
allowNullPassword = true;
|
|
|
|
|
setEnvironment = true;
|
|
|
|
|
setLoginUid = true;
|
|
|
|
|
startSession = true;
|
|
|
|
|
unixAuth = true;
|
|
|
|
|
updateWtmp = true;
|
|
|
|
|
|
2022-01-18 09:32:55 +01:00
|
|
|
|
# Unlock keyring on login.
|
|
|
|
|
enableGnomeKeyring = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2023-01-07 20:28:54 +01:00
|
|
|
|
security.polkit.enable = true;
|
|
|
|
|
|
2022-01-18 09:32:55 +01:00
|
|
|
|
# List packages installed in system profile. To search, run:
|
|
|
|
|
# $ nix search wget
|
|
|
|
|
# environment.systemPackages = with pkgs; [
|
|
|
|
|
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
|
|
|
|
# wget
|
|
|
|
|
# firefox
|
|
|
|
|
# ];
|
2023-07-30 16:06:59 +02:00
|
|
|
|
environment.systemPackages = with pkgs; [ dmidecode flashrom mbuffer ];
|
2022-01-18 09:32:55 +01:00
|
|
|
|
|
|
|
|
|
# Enable touchpad support (enabled default in most desktopManager).
|
|
|
|
|
|
|
|
|
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
|
|
|
|
users = {
|
|
|
|
|
groups = { plugdev = { }; };
|
|
|
|
|
users = {
|
|
|
|
|
rilla = {
|
|
|
|
|
shell = pkgs.zsh;
|
|
|
|
|
extraGroups = [
|
|
|
|
|
"wheel"
|
|
|
|
|
"docker"
|
|
|
|
|
"libvirtd"
|
|
|
|
|
"dialout"
|
|
|
|
|
"plugdev"
|
|
|
|
|
"adbusers"
|
2022-03-05 19:10:35 +01:00
|
|
|
|
"video"
|
2023-06-25 11:26:04 +02:00
|
|
|
|
"vboxusers"
|
2022-01-18 09:32:55 +01:00
|
|
|
|
];
|
2023-01-21 16:01:59 +01:00
|
|
|
|
subUidRanges = [{
|
|
|
|
|
startUid = 100000;
|
|
|
|
|
count = 65536;
|
|
|
|
|
}];
|
|
|
|
|
subGidRanges = [{
|
|
|
|
|
startGid = 100000;
|
|
|
|
|
count = 65536;
|
|
|
|
|
}];
|
2022-01-18 09:32:55 +01:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
programs.mosh.enable = true;
|
|
|
|
|
programs.zsh.enable = true;
|
2022-04-17 19:14:56 +02:00
|
|
|
|
programs.slock.enable = true;
|
2022-01-18 09:32:55 +01:00
|
|
|
|
|
|
|
|
|
programs.fuse.userAllowOther = true;
|
2023-06-30 12:23:02 +02:00
|
|
|
|
programs.nix-ld.enable = true;
|
2022-01-18 09:32:55 +01:00
|
|
|
|
|
|
|
|
|
services.pcscd.enable = true;
|
|
|
|
|
|
|
|
|
|
virtualisation = {
|
|
|
|
|
docker.enable = true;
|
2023-01-07 20:31:26 +01:00
|
|
|
|
podman = {
|
2023-01-21 16:01:59 +01:00
|
|
|
|
enable = true;
|
2023-01-21 17:01:08 +01:00
|
|
|
|
defaultNetwork.settings.dns_enabled = true;
|
2023-01-07 20:31:26 +01:00
|
|
|
|
};
|
2023-06-25 11:26:04 +02:00
|
|
|
|
libvirtd = {
|
|
|
|
|
enable = true;
|
|
|
|
|
allowedBridges = [ "virbr0" "virbr1" "virbr2" ];
|
|
|
|
|
};
|
2022-04-10 20:22:09 +02:00
|
|
|
|
spiceUSBRedirection.enable = true;
|
2023-06-25 11:26:04 +02:00
|
|
|
|
virtualbox.host.enable = true;
|
2022-01-18 09:32:55 +01:00
|
|
|
|
};
|
2022-07-11 17:28:16 +02:00
|
|
|
|
services.spice-vdagentd.enable = true;
|
2022-01-18 09:32:55 +01:00
|
|
|
|
programs.dconf.enable = true;
|
|
|
|
|
|
2022-01-25 12:27:52 +01:00
|
|
|
|
services.udev.extraRules = ''
|
|
|
|
|
# UDEV rules for Teensy USB devices
|
|
|
|
|
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", ENV{ID_MM_DEVICE_IGNORE}="1"
|
|
|
|
|
ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789A]?", ENV{MTP_NO_PROBE}="1"
|
|
|
|
|
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789ABCD]?", MODE:="0666"
|
|
|
|
|
KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", MODE:="0666"
|
|
|
|
|
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="664", GROUP="plugdev"
|
2022-03-05 19:10:35 +01:00
|
|
|
|
|
|
|
|
|
# acpi brightness rulres
|
|
|
|
|
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", GROUP="video", MODE="0664"
|
|
|
|
|
RUN+="${pkgs.coreutils-full}/bin/chgrp video /sys/class/backlight/intel_backlight/brightness"
|
|
|
|
|
RUN+="${pkgs.coreutils-full}/bin/chmod g+w /sys/class/backlight/intel_backlight/brightness"
|
2022-01-25 12:27:52 +01:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
hardware.opengl.enable = true;
|
|
|
|
|
hardware.bluetooth.enable = true;
|
|
|
|
|
services.blueman.enable = true;
|
|
|
|
|
|
2022-05-25 09:58:20 +02:00
|
|
|
|
environment.persistence = {
|
2023-06-25 11:26:04 +02:00
|
|
|
|
|
2022-11-13 15:59:57 +01:00
|
|
|
|
"/mnt/persist" = {
|
2022-05-25 09:58:20 +02:00
|
|
|
|
directories = [
|
|
|
|
|
"/etc/NetworkManager/system-connections"
|
|
|
|
|
"/etc/nixos"
|
|
|
|
|
"/etc/wireguard"
|
|
|
|
|
"/var/lib/bluetooth"
|
|
|
|
|
"/var/lib/docker"
|
|
|
|
|
"/var/lib/libvirt"
|
|
|
|
|
"/var/lib/systemd/coredump"
|
2023-06-25 11:26:04 +02:00
|
|
|
|
|
|
|
|
|
"/home/rilla/.Slic3r"
|
|
|
|
|
"/home/rilla/.abook"
|
|
|
|
|
"/home/rilla/.bitmonero"
|
|
|
|
|
"/home/rilla/.config/Element"
|
|
|
|
|
"/home/rilla/.config/Nextcloud"
|
|
|
|
|
"/home/rilla/.config/Signal"
|
2023-08-01 12:09:11 +02:00
|
|
|
|
"/home/rilla/.config/Slack"
|
2023-06-25 11:26:04 +02:00
|
|
|
|
"/home/rilla/.config/SuperCollider"
|
|
|
|
|
"/home/rilla/.config/VirtualBox"
|
|
|
|
|
"/home/rilla/.config/ardour6"
|
|
|
|
|
"/home/rilla/.config/chromium"
|
|
|
|
|
"/home/rilla/.config/kdeconnect"
|
|
|
|
|
"/home/rilla/.config/kicad"
|
|
|
|
|
"/home/rilla/.config/nvim/plugin"
|
|
|
|
|
"/home/rilla/.config/syncthing"
|
|
|
|
|
"/home/rilla/.config/tea"
|
|
|
|
|
"/home/rilla/.config/whatsapp-for-linux"
|
|
|
|
|
"/home/rilla/.electrum"
|
|
|
|
|
"/home/rilla/.gnupg"
|
|
|
|
|
"/home/rilla/.hydrogen"
|
|
|
|
|
"/home/rilla/.john"
|
|
|
|
|
"/home/rilla/.kube"
|
|
|
|
|
"/home/rilla/.librewolf"
|
|
|
|
|
"/home/rilla/.local/share/Bisq"
|
|
|
|
|
"/home/rilla/.local/share/Nextcloud"
|
|
|
|
|
"/home/rilla/.local/share/Steam"
|
|
|
|
|
"/home/rilla/.local/share/SuperCollider"
|
|
|
|
|
"/home/rilla/.local/share/TelegramDesktop"
|
|
|
|
|
"/home/rilla/.local/share/containers"
|
|
|
|
|
"/home/rilla/.local/share/dino"
|
|
|
|
|
"/home/rilla/.local/share/direnv"
|
|
|
|
|
"/home/rilla/.local/share/gopass/stores"
|
|
|
|
|
"/home/rilla/.local/share/keyrings"
|
|
|
|
|
"/home/rilla/.local/share/mpd"
|
|
|
|
|
"/home/rilla/.local/share/nvim"
|
|
|
|
|
"/home/rilla/.local/share/tor-browser"
|
|
|
|
|
"/home/rilla/.local/share/webkitgtk"
|
|
|
|
|
"/home/rilla/.local/state/wireplumber"
|
|
|
|
|
"/home/rilla/.local/state/zsh"
|
|
|
|
|
"/home/rilla/.mozilla"
|
|
|
|
|
"/home/rilla/.newsboat"
|
|
|
|
|
"/home/rilla/.password-store"
|
|
|
|
|
"/home/rilla/.platformio"
|
|
|
|
|
"/home/rilla/.vagrant.d"
|
|
|
|
|
"/home/rilla/.vdirsyncer"
|
|
|
|
|
"/home/rilla/.virtualenvs"
|
|
|
|
|
"/home/rilla/.wine"
|
|
|
|
|
"/home/rilla/Nextcloud"
|
|
|
|
|
"/home/rilla/VirtualBox VMs"
|
|
|
|
|
"/home/rilla/configs"
|
|
|
|
|
# "/home/rilla/.cache"
|
|
|
|
|
|
2022-05-25 09:58:20 +02:00
|
|
|
|
];
|
|
|
|
|
files = [
|
|
|
|
|
"/etc/machine-id"
|
|
|
|
|
"/etc/ssh/ssh_host_ed25519_key"
|
|
|
|
|
"/etc/ssh/ssh_host_ed25519_key.pub"
|
2022-09-05 11:52:28 +02:00
|
|
|
|
"/etc/ssh/ssh_host_ed25519_key-cert.pub"
|
|
|
|
|
"/etc/ssh/user_ca.pub"
|
2023-06-25 11:26:04 +02:00
|
|
|
|
|
|
|
|
|
"/home/rilla/.lmmsrc.xml"
|
|
|
|
|
"/home/rilla/.mailsynclastrun"
|
|
|
|
|
"/home/rilla/.ssh/known_hosts"
|
|
|
|
|
|
2022-05-25 09:58:20 +02:00
|
|
|
|
];
|
|
|
|
|
};
|
2023-03-26 17:00:32 +02:00
|
|
|
|
"/mnt/data" = {
|
2023-06-25 11:26:04 +02:00
|
|
|
|
directories = [
|
|
|
|
|
"/etc/luks-keys"
|
|
|
|
|
|
|
|
|
|
"/home/rilla/Audio"
|
|
|
|
|
"/home/rilla/Calendars"
|
|
|
|
|
"/home/rilla/Contacts"
|
|
|
|
|
"/home/rilla/Documents"
|
|
|
|
|
"/home/rilla/Downloads"
|
|
|
|
|
"/home/rilla/Images"
|
|
|
|
|
"/home/rilla/Maildir"
|
|
|
|
|
"/home/rilla/Monero"
|
|
|
|
|
"/home/rilla/code"
|
|
|
|
|
"/home/rilla/misc"
|
|
|
|
|
"/home/rilla/workspace"
|
|
|
|
|
|
|
|
|
|
];
|
2023-04-10 18:12:13 +02:00
|
|
|
|
files = [
|
|
|
|
|
"/etc/btrbk/id_ed25519"
|
|
|
|
|
"/etc/btrbk/id_ed25519.pub"
|
|
|
|
|
"/etc/btrbk/id_ed25519-cert.pub"
|
|
|
|
|
];
|
2023-03-26 17:00:32 +02:00
|
|
|
|
};
|
2022-11-13 15:59:57 +01:00
|
|
|
|
"/mnt/logs" = { directories = [ "/var/log" ]; };
|
2023-06-30 12:23:02 +02:00
|
|
|
|
"/mnt/vfs_share" = { directories = [ "/home/rilla/vfs_share" ]; };
|
2022-01-28 15:11:30 +01:00
|
|
|
|
};
|
|
|
|
|
|
2022-01-18 09:32:55 +01:00
|
|
|
|
# Open ports in the firewall.
|
|
|
|
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
|
|
|
|
#
|
|
|
|
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
|
|
|
|
# Or disable the firewall altogether.
|
|
|
|
|
# networking.firewall.enable = false;
|
|
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
2023-01-07 20:28:54 +01:00
|
|
|
|
system.stateVersion = "22.11"; # Did you read the comment?
|
2022-01-18 09:32:55 +01:00
|
|
|
|
}
|