2023-07-03 22:35:58 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
nix-xilinx,
|
2024-03-16 11:22:01 +01:00
|
|
|
nvim,
|
2024-05-07 16:35:10 +02:00
|
|
|
pkgs,
|
|
|
|
system,
|
2023-09-20 19:43:01 +02:00
|
|
|
zremap,
|
2023-07-03 22:35:58 +02:00
|
|
|
...
|
2025-01-10 18:11:42 +01:00
|
|
|
}:
|
|
|
|
{
|
|
|
|
imports = [ ];
|
2023-07-03 22:35:58 +02:00
|
|
|
|
|
|
|
system.stateVersion = "23.05";
|
|
|
|
system.autoUpgrade.enable = false;
|
2024-08-25 10:50:34 +02:00
|
|
|
system.switch = {
|
|
|
|
enable = false;
|
|
|
|
enableNg = true;
|
|
|
|
};
|
2023-07-03 22:35:58 +02:00
|
|
|
|
2024-05-11 09:26:49 +02:00
|
|
|
sops = {
|
2025-01-10 18:11:42 +01:00
|
|
|
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
2024-05-11 09:26:49 +02:00
|
|
|
secrets = {
|
|
|
|
"peerix/private" = {
|
|
|
|
sopsFile = ./secrets/peerix.yaml;
|
|
|
|
mode = "0400";
|
|
|
|
owner = config.users.users.nobody.name;
|
|
|
|
group = config.users.users.nobody.group;
|
|
|
|
};
|
2023-07-03 22:35:58 +02:00
|
|
|
|
2024-05-11 09:26:49 +02:00
|
|
|
"wg_privkey" = {
|
|
|
|
sopsFile = ./secrets/wg_privkey.yaml;
|
|
|
|
};
|
2024-04-04 21:31:53 +02:00
|
|
|
|
2024-05-11 09:26:49 +02:00
|
|
|
"wg_preshared/nixy" = {
|
|
|
|
sopsFile = ../common/secrets/wg_preshared.yaml;
|
|
|
|
};
|
2024-04-20 20:13:27 +02:00
|
|
|
|
2024-05-06 10:26:51 +02:00
|
|
|
"wg_privkey_proton" = {
|
|
|
|
sopsFile = ./secrets/wg_privkey_proton.yaml;
|
|
|
|
};
|
|
|
|
|
2024-05-12 15:43:03 +02:00
|
|
|
"wg_endpoint_proton" = {
|
|
|
|
sopsFile = ./secrets/wg_privkey_proton.yaml;
|
|
|
|
};
|
|
|
|
|
2024-05-11 09:26:49 +02:00
|
|
|
"borgbase_enc_key" = {
|
|
|
|
sopsFile = ./secrets/borgbase_enc_key.yaml;
|
|
|
|
owner = config.users.users.akill.name;
|
|
|
|
};
|
2024-04-06 23:07:41 +02:00
|
|
|
|
2024-05-11 09:26:49 +02:00
|
|
|
"borgbase_ssh_key" = {
|
|
|
|
sopsFile = ./secrets/borgbase_ssh_key.yaml;
|
|
|
|
owner = config.users.users.akill.name;
|
|
|
|
};
|
|
|
|
};
|
2024-04-06 23:07:41 +02:00
|
|
|
};
|
|
|
|
|
2023-07-03 22:35:58 +02:00
|
|
|
nix = {
|
|
|
|
optimise.automatic = true;
|
|
|
|
gc.automatic = true;
|
|
|
|
gc.options = "--delete-older-than 7d";
|
2024-05-07 11:30:55 +02:00
|
|
|
package = pkgs.nixVersions.latest;
|
2023-07-03 22:35:58 +02:00
|
|
|
settings = {
|
2023-10-30 23:58:49 +01:00
|
|
|
sandbox = true;
|
2025-01-10 18:11:42 +01:00
|
|
|
experimental-features = [
|
|
|
|
"nix-command"
|
|
|
|
"flakes"
|
|
|
|
];
|
2023-07-03 22:35:58 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
boot = {
|
2025-01-10 18:11:42 +01:00
|
|
|
extraModulePackages = with config.boot.kernelPackages; [
|
|
|
|
usbip
|
|
|
|
v4l2loopback
|
|
|
|
];
|
2023-07-03 22:35:58 +02:00
|
|
|
initrd.compressor = "zstd";
|
2025-01-10 18:11:42 +01:00
|
|
|
initrd.kernelModules = [ ];
|
2024-08-25 10:56:41 +02:00
|
|
|
initrd.systemd.enable = true;
|
2025-01-10 18:11:42 +01:00
|
|
|
binfmt.emulatedSystems = [
|
|
|
|
"wasm32-wasi"
|
|
|
|
"x86_64-windows"
|
|
|
|
];
|
|
|
|
kernelParams = [
|
|
|
|
"psmouse.synaptics_intertouch=0"
|
|
|
|
"mem_sleep_default=deep"
|
|
|
|
];
|
2023-11-06 22:30:39 +01:00
|
|
|
kernel.sysctl = {
|
|
|
|
"net.core.default_qdisc" = "fq";
|
|
|
|
"net.ipv4.tcp_congestion_control" = "bbr";
|
|
|
|
};
|
2023-07-03 22:35:58 +02:00
|
|
|
loader.efi.canTouchEfiVariables = true;
|
2023-10-01 21:14:30 +02:00
|
|
|
loader.systemd-boot = {
|
|
|
|
editor = false;
|
|
|
|
enable = true;
|
|
|
|
memtest86.enable = true;
|
|
|
|
};
|
2023-07-03 22:35:58 +02:00
|
|
|
readOnlyNixStore = true;
|
2025-01-10 18:11:42 +01:00
|
|
|
supportedFilesystems = [
|
|
|
|
"f2fs"
|
|
|
|
"xfs"
|
|
|
|
];
|
2023-07-03 22:35:58 +02:00
|
|
|
tmp.useTmpfs = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
security = {
|
|
|
|
rtkit.enable = true;
|
|
|
|
allowSimultaneousMultithreading = true;
|
|
|
|
sudo.enable = true;
|
|
|
|
doas.enable = true;
|
|
|
|
doas.extraRules = [
|
|
|
|
{
|
2025-01-10 18:11:42 +01:00
|
|
|
users = [ "akill" ];
|
2023-07-03 22:35:58 +02:00
|
|
|
keepEnv = true;
|
|
|
|
persist = true;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
powerManagement = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
networking = {
|
2024-12-26 13:24:20 +01:00
|
|
|
nftables.enable = true;
|
2023-07-03 22:35:58 +02:00
|
|
|
firewall = {
|
|
|
|
enable = true;
|
2025-01-10 18:11:42 +01:00
|
|
|
allowedTCPPorts = [
|
|
|
|
80
|
|
|
|
443
|
|
|
|
51820
|
|
|
|
8020
|
|
|
|
];
|
2023-07-03 22:35:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
hostName = "nixy";
|
2025-01-10 18:11:42 +01:00
|
|
|
nameservers = [
|
|
|
|
"127.0.0.1"
|
|
|
|
"::1"
|
|
|
|
];
|
2023-07-03 22:35:58 +02:00
|
|
|
dhcpcd.extraConfig = "nohook resolv.conf";
|
|
|
|
|
|
|
|
extraHosts = ''
|
2023-09-20 19:43:01 +02:00
|
|
|
192.168.88.171 jellyfin.mediabox.lan
|
2023-10-05 22:53:56 +02:00
|
|
|
192.168.88.171 jellyseerr.mediabox.lan
|
2023-09-20 19:43:01 +02:00
|
|
|
192.168.88.171 mediabox.lan
|
|
|
|
192.168.88.171 qbittorrent.mediabox.lan
|
2023-07-03 22:35:58 +02:00
|
|
|
192.168.88.1 router.lan
|
2023-09-20 19:43:01 +02:00
|
|
|
192.168.88.231 workstation.lan
|
2024-01-19 20:03:33 +01:00
|
|
|
192.168.88.121 ender.lan
|
2023-07-03 22:35:58 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
networkmanager = {
|
|
|
|
enable = true;
|
|
|
|
dns = "none";
|
|
|
|
wifi.backend = "iwd";
|
|
|
|
};
|
|
|
|
|
|
|
|
wireless.iwd = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
General = {
|
|
|
|
AddressRandomization = "network";
|
|
|
|
#EnableNetworkConfiguration = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-04-04 21:31:53 +02:00
|
|
|
|
|
|
|
wireguard.interfaces = {
|
|
|
|
wg0 = {
|
2025-01-10 18:11:42 +01:00
|
|
|
ips = [ "10.100.0.6/24" ];
|
2024-04-04 21:31:53 +02:00
|
|
|
privateKeyFile = config.sops.secrets."wg_privkey".path;
|
|
|
|
peers = [
|
|
|
|
{
|
|
|
|
publicKey = builtins.readFile ../magpie/wg_pubkey;
|
2024-04-20 20:44:36 +02:00
|
|
|
presharedKeyFile = config.sops.secrets."wg_preshared/nixy".path;
|
2025-01-10 18:11:42 +01:00
|
|
|
allowedIPs = [ "10.100.0.0/24" ];
|
2024-04-04 21:31:53 +02:00
|
|
|
endpoint = "5.75.229.224:51820";
|
|
|
|
persistentKeepalive = 25;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2024-08-15 17:36:00 +02:00
|
|
|
|
|
|
|
neox_wg = {
|
2025-01-10 18:11:42 +01:00
|
|
|
ips = [ "192.168.51.2/32" ];
|
2024-08-15 17:36:00 +02:00
|
|
|
privateKeyFile = config.sops.secrets."wg_privkey".path;
|
|
|
|
peers = [
|
|
|
|
{
|
|
|
|
publicKey = builtins.readFile ../nixy/wg_pubkey_nx;
|
2025-01-10 18:11:42 +01:00
|
|
|
allowedIPs = [ "192.168.2.0/24" ];
|
2024-08-15 17:36:00 +02:00
|
|
|
endpoint = "185.194.64.26:51820";
|
|
|
|
persistentKeepalive = 25;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2024-04-04 21:31:53 +02:00
|
|
|
};
|
2023-07-03 22:35:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
time.timeZone = "Europe/Sarajevo";
|
|
|
|
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
2025-01-10 18:11:42 +01:00
|
|
|
nixpkgs.overlays = [
|
|
|
|
nix-xilinx.overlay
|
|
|
|
nvim.overlays.${system}.overlay
|
|
|
|
];
|
2023-07-03 22:35:58 +02:00
|
|
|
environment = {
|
2024-10-15 04:20:40 +02:00
|
|
|
etc = {
|
|
|
|
"firejail/qutebrowser.local".text = ''
|
|
|
|
whitelist ''${RUNUSER}/qutebrowser
|
|
|
|
'';
|
|
|
|
};
|
2023-10-31 21:23:16 +01:00
|
|
|
extraInit = ''
|
|
|
|
unset -v SSH_ASKPASS
|
|
|
|
'';
|
2023-07-03 22:35:58 +02:00
|
|
|
homeBinInPath = true;
|
|
|
|
variables = {
|
|
|
|
PATH = "$HOME/.cargo/bin";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
programs = {
|
2024-08-14 17:13:09 +02:00
|
|
|
steam = {
|
|
|
|
enable = true;
|
|
|
|
remotePlay.openFirewall = true;
|
|
|
|
dedicatedServer.openFirewall = false;
|
|
|
|
localNetworkGameTransfers.openFirewall = true;
|
|
|
|
};
|
2023-07-03 22:35:58 +02:00
|
|
|
gnupg.agent = {
|
|
|
|
enable = true;
|
|
|
|
enableSSHSupport = true;
|
|
|
|
};
|
2024-06-01 13:32:50 +02:00
|
|
|
appimage = {
|
|
|
|
enable = true;
|
|
|
|
binfmt = true;
|
|
|
|
};
|
2023-07-03 22:35:58 +02:00
|
|
|
zsh.enable = true;
|
|
|
|
firejail.enable = true;
|
|
|
|
adb.enable = true;
|
|
|
|
wireshark.enable = true;
|
|
|
|
sway.enable = true;
|
|
|
|
};
|
|
|
|
|
2024-05-09 22:47:10 +02:00
|
|
|
documentation.dev.enable = true;
|
|
|
|
|
2023-07-03 22:35:58 +02:00
|
|
|
# List services that you want to enable:
|
|
|
|
systemd = {
|
|
|
|
services = {
|
2024-05-10 23:50:54 +02:00
|
|
|
"zremap@" = {
|
|
|
|
enable = true;
|
|
|
|
restartIfChanged = true;
|
2023-07-03 22:35:58 +02:00
|
|
|
serviceConfig.Nice = -20;
|
2024-05-10 23:50:54 +02:00
|
|
|
unitConfig = {
|
|
|
|
Description = "zremap on %I";
|
|
|
|
ConditionPathExists = "%I";
|
|
|
|
};
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "simple";
|
|
|
|
ExecStart = "${zremap.defaultPackage.${system}}/bin/zremap %I";
|
|
|
|
};
|
2023-07-03 22:35:58 +02:00
|
|
|
};
|
2024-05-12 15:43:03 +02:00
|
|
|
|
|
|
|
"netns@" = {
|
|
|
|
description = "%I network namespace";
|
2025-01-10 18:11:42 +01:00
|
|
|
before = [ "network.target" ];
|
2024-05-12 15:43:03 +02:00
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
RemainAfterExit = true;
|
2024-11-05 17:19:40 +01:00
|
|
|
ExecStart = "${pkgs.iproute2}/bin/ip netns add %I";
|
|
|
|
ExecStop = "${pkgs.iproute2}/bin/ip netns del %I";
|
2024-05-12 15:43:03 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
"wg_proton" = {
|
|
|
|
description = "wg network interface";
|
2025-01-10 18:11:42 +01:00
|
|
|
bindsTo = [ "netns@wg.service" ];
|
|
|
|
requires = [ "network-online.target" ];
|
|
|
|
wants = [ "dnscrypt-proxy2_proton.service" ];
|
|
|
|
after = [ "netns@wg.service" ];
|
|
|
|
before = [ "dnscrypt-proxy2_proton.service" ];
|
2024-05-12 15:43:03 +02:00
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
RemainAfterExit = true;
|
|
|
|
ExecStart = pkgs.writers.writeBash "wg-up" ''
|
|
|
|
set -e
|
|
|
|
ENDPOINT_IP=$(${pkgs.coreutils-full}/bin/cat "${config.sops.secrets."wg_endpoint_proton".path}")
|
2024-11-05 17:19:40 +01:00
|
|
|
${pkgs.iproute2}/bin/ip link add proton_wg type wireguard
|
|
|
|
${pkgs.iproute2}/bin/ip link set proton_wg netns wg
|
|
|
|
${pkgs.iproute2}/bin/ip -n wg address add 10.2.0.2/32 dev proton_wg
|
|
|
|
${pkgs.iproute2}/bin/ip netns exec wg \
|
2025-01-10 18:11:42 +01:00
|
|
|
${pkgs.wireguard-tools}/bin/wg set "proton_wg" private-key "${
|
|
|
|
config.sops.secrets."wg_privkey_proton".path
|
|
|
|
}"
|
2024-11-05 17:19:40 +01:00
|
|
|
${pkgs.iproute2}/bin/ip netns exec wg \
|
2024-05-12 15:43:03 +02:00
|
|
|
${pkgs.wireguard-tools}/bin/wg set "proton_wg" peer "g6DkXWKI/68RsLjROIwCEcyB/ZhyK5Q7OWcz1TtqER0=" \
|
|
|
|
endpoint "$ENDPOINT_IP:51820" \
|
|
|
|
persistent-keepalive "25" \
|
|
|
|
allowed-ips "0.0.0.0/0"
|
2024-11-05 17:19:40 +01:00
|
|
|
${pkgs.iproute2}/bin/ip -n wg link set lo up
|
|
|
|
${pkgs.iproute2}/bin/ip -n wg link set proton_wg up
|
|
|
|
${pkgs.iproute2}/bin/ip -n wg route add default dev proton_wg
|
2024-05-12 15:43:03 +02:00
|
|
|
'';
|
|
|
|
ExecStop = pkgs.writers.writeBash "wg-down" ''
|
2024-11-05 17:19:40 +01:00
|
|
|
${pkgs.iproute2}/bin/ip -n wg route del default dev proton_wg
|
|
|
|
${pkgs.iproute2}/bin/ip -n wg link del proton_wg
|
2024-05-12 15:43:03 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-05-12 15:44:59 +02:00
|
|
|
"dnscrypt-proxy2_proton" = {
|
|
|
|
description = "DNSCrypt-proxy client proton";
|
|
|
|
wants = [
|
|
|
|
"network-online.target"
|
|
|
|
"nss-lookup.target"
|
|
|
|
];
|
2025-01-10 18:11:42 +01:00
|
|
|
before = [ "nss-lookup.target" ];
|
|
|
|
after = [ "wg_proton.service" ];
|
|
|
|
partOf = [ "wg_proton.service" ];
|
2024-05-12 15:44:59 +02:00
|
|
|
serviceConfig = {
|
|
|
|
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
|
|
|
|
CacheDirectory = "dnscrypt-proxy";
|
|
|
|
DynamicUser = true;
|
|
|
|
ExecStart = "${pkgs.dnscrypt-proxy}/bin/dnscrypt-proxy -config ${config.services.dnscrypt-proxy2.configFile}";
|
|
|
|
LockPersonality = true;
|
|
|
|
LogsDirectory = "dnscrypt-proxy";
|
|
|
|
MemoryDenyWriteExecute = true;
|
|
|
|
NetworkNamespacePath = "/var/run/netns/wg";
|
|
|
|
NonBlocking = true;
|
|
|
|
NoNewPrivileges = true;
|
|
|
|
PrivateDevices = true;
|
|
|
|
ProtectClock = true;
|
|
|
|
ProtectControlGroups = true;
|
|
|
|
ProtectHome = true;
|
|
|
|
ProtectHostname = true;
|
|
|
|
ProtectKernelLogs = true;
|
|
|
|
ProtectKernelModules = true;
|
|
|
|
ProtectKernelTunables = true;
|
|
|
|
ProtectSystem = "strict";
|
|
|
|
Restart = "always";
|
|
|
|
RestrictAddressFamilies = [
|
|
|
|
"AF_INET"
|
|
|
|
"AF_INET6"
|
|
|
|
];
|
|
|
|
RestrictNamespaces = true;
|
|
|
|
RestrictRealtime = true;
|
|
|
|
RuntimeDirectory = "dnscrypt-proxy";
|
|
|
|
StateDirectory = "dnscrypt-proxy";
|
|
|
|
SystemCallArchitectures = "native";
|
|
|
|
SystemCallFilter = [
|
|
|
|
"@system-service"
|
|
|
|
"@chown"
|
|
|
|
"~@aio"
|
|
|
|
"~@keyring"
|
|
|
|
"~@memlock"
|
|
|
|
"~@setuid"
|
|
|
|
"~@timer"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2023-07-03 22:35:58 +02:00
|
|
|
};
|
|
|
|
|
2024-12-31 15:03:26 +01:00
|
|
|
coredump.enable = false;
|
2023-07-03 22:35:58 +02:00
|
|
|
extraConfig = ''
|
|
|
|
DefaultTimeoutStartSec=30s
|
|
|
|
DefaultTimeoutStopSec=30s
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
services = {
|
|
|
|
acpid.enable = true;
|
|
|
|
dbus.enable = true;
|
2024-08-26 13:06:15 +02:00
|
|
|
dbus.implementation = "broker";
|
2023-07-03 22:35:58 +02:00
|
|
|
fstrim.enable = true;
|
|
|
|
fwupd.enable = true;
|
|
|
|
ntp.enable = true;
|
|
|
|
openssh.enable = true;
|
|
|
|
printing.enable = true;
|
|
|
|
|
|
|
|
pipewire = {
|
|
|
|
enable = true;
|
|
|
|
alsa.enable = true;
|
|
|
|
alsa.support32Bit = true;
|
|
|
|
pulse.enable = true;
|
|
|
|
};
|
|
|
|
|
2024-12-03 16:01:05 +01:00
|
|
|
avahi = {
|
|
|
|
enable = true;
|
|
|
|
nssmdns4 = true;
|
|
|
|
openFirewall = true;
|
|
|
|
};
|
|
|
|
|
2024-05-10 22:51:29 +02:00
|
|
|
libinput.enable = true;
|
2023-07-03 22:35:58 +02:00
|
|
|
xserver = {
|
2023-12-25 18:46:11 +01:00
|
|
|
enable = true;
|
2023-07-03 22:35:58 +02:00
|
|
|
dpi = 144;
|
|
|
|
desktopManager.xterm.enable = false;
|
|
|
|
displayManager = {
|
|
|
|
lightdm.enable = false;
|
|
|
|
startx.enable = true;
|
|
|
|
};
|
2023-11-12 13:47:36 +01:00
|
|
|
windowManager.i3.enable = false;
|
2023-07-03 22:35:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
udev = {
|
2025-01-10 18:11:42 +01:00
|
|
|
packages = [
|
|
|
|
pkgs.openhantek6022
|
|
|
|
pkgs.openocd
|
|
|
|
];
|
2023-07-03 22:35:58 +02:00
|
|
|
extraRules = ''
|
2024-04-04 21:31:53 +02:00
|
|
|
#Xilinx FTDI
|
|
|
|
ACTION=="add", ATTR{idVendor}=="0403", ATTR{manufacturer}=="Xilinx", MODE:="666"
|
2023-07-03 22:35:58 +02:00
|
|
|
|
2024-04-04 21:31:53 +02:00
|
|
|
#Xilinx Digilent
|
|
|
|
ATTR{idVendor}=="1443", MODE:="666"
|
|
|
|
ACTION=="add", ATTR{idVendor}=="0403", ATTR{manufacturer}=="Digilent", MODE:="666"
|
2023-11-16 19:44:37 +01:00
|
|
|
|
2024-04-04 21:31:53 +02:00
|
|
|
#Arduino UNO r4
|
|
|
|
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", MODE:="0666"
|
2024-05-10 23:50:54 +02:00
|
|
|
|
|
|
|
#zremap on new keyboard
|
|
|
|
ACTION=="add", SUBSYSTEM=="input", ATTRS{phys}!="", KERNEL=="event[0-9]*", ENV{ID_INPUT_KEY}=="1", ENV{ID_INPUT_KEYBOARD}=="1", TAG+="systemd", ENV{SYSTEMD_WANTS}+="zremap@$env{DEVNAME}.service"
|
2023-07-03 22:35:58 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
tlp = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
|
2023-11-12 13:47:10 +01:00
|
|
|
batteryNotifier = {
|
|
|
|
enable = true;
|
|
|
|
notifyCapacity = 20;
|
|
|
|
suspendCapacity = 10;
|
|
|
|
};
|
|
|
|
|
2023-07-03 22:35:58 +02:00
|
|
|
actkbd = {
|
|
|
|
enable = true;
|
|
|
|
bindings = [
|
|
|
|
{
|
2025-01-10 18:11:42 +01:00
|
|
|
keys = [ 113 ];
|
|
|
|
events = [ "key" ];
|
2023-07-03 22:35:58 +02:00
|
|
|
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master toggle'";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2025-01-10 18:11:42 +01:00
|
|
|
keys = [ 114 ];
|
|
|
|
events = [
|
|
|
|
"key"
|
|
|
|
"rep"
|
|
|
|
];
|
2023-07-03 22:35:58 +02:00
|
|
|
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master 5%- unmute'";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2025-01-10 18:11:42 +01:00
|
|
|
keys = [ 115 ];
|
|
|
|
events = [
|
|
|
|
"key"
|
|
|
|
"rep"
|
|
|
|
];
|
2023-07-03 22:35:58 +02:00
|
|
|
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master 5%+ unmute'";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2025-01-10 18:11:42 +01:00
|
|
|
keys = [ 224 ];
|
|
|
|
events = [ "key" ];
|
2023-07-03 22:35:58 +02:00
|
|
|
command = "${pkgs.light}/bin/light -U 5";
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2025-01-10 18:11:42 +01:00
|
|
|
keys = [ 225 ];
|
|
|
|
events = [ "key" ];
|
2023-07-03 22:35:58 +02:00
|
|
|
command = "${pkgs.light}/bin/light -A 5";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
dnscrypt-proxy2 = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
ipv6_servers = true;
|
|
|
|
require_dnssec = true;
|
2024-05-10 22:34:10 +02:00
|
|
|
require_nolog = true;
|
|
|
|
require_nofilter = true;
|
|
|
|
http3 = true;
|
2023-07-03 22:35:58 +02:00
|
|
|
|
|
|
|
sources.public-resolvers = {
|
|
|
|
urls = [
|
|
|
|
"https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
|
|
|
|
"https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md"
|
|
|
|
];
|
2024-05-10 22:34:10 +02:00
|
|
|
cache_file = "public-resolvers.md";
|
2023-07-03 22:35:58 +02:00
|
|
|
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2025-01-10 18:11:42 +01:00
|
|
|
borgbackup.jobs."borgbase" =
|
|
|
|
let
|
|
|
|
user = config.users.users.akill;
|
|
|
|
home = user.home;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
user = user.name;
|
|
|
|
paths = [
|
|
|
|
(home + "/pic/priv")
|
|
|
|
(home + "/pproj")
|
|
|
|
(home + "/videos/priv")
|
|
|
|
];
|
|
|
|
exclude = [
|
|
|
|
"**/.ccls_cache"
|
|
|
|
"**/*.d"
|
|
|
|
"**/*.map"
|
|
|
|
"**/*.o"
|
|
|
|
"**/zig-cache"
|
|
|
|
"**/zig-out"
|
|
|
|
];
|
|
|
|
repo = "ssh://oda929rv@oda929rv.repo.borgbase.com/./repo";
|
|
|
|
encryption = {
|
|
|
|
mode = "repokey-blake2";
|
|
|
|
passCommand = "${pkgs.coreutils-full}/bin/cat ${config.sops.secrets."borgbase_enc_key".path}";
|
|
|
|
};
|
|
|
|
environment.BORG_RSH = "${pkgs.openssh}/bin/ssh -i ${config.sops.secrets."borgbase_ssh_key".path}";
|
|
|
|
compression = "auto,zstd";
|
|
|
|
startAt = "daily";
|
2024-04-06 23:07:41 +02:00
|
|
|
};
|
|
|
|
|
2023-07-03 22:35:58 +02:00
|
|
|
nix-serve = {
|
|
|
|
enable = false;
|
|
|
|
secretKeyFile = "/var/cache-priv-key.pem";
|
|
|
|
};
|
|
|
|
|
|
|
|
journald.extraConfig = ''
|
|
|
|
SystemMaxUse=50M
|
|
|
|
'';
|
|
|
|
|
|
|
|
logind.extraConfig = ''
|
|
|
|
KillUserProcesses=yes
|
|
|
|
'';
|
2024-05-17 16:14:52 +02:00
|
|
|
|
|
|
|
seafile = {
|
2024-05-31 18:32:38 +02:00
|
|
|
enable = false;
|
2024-05-17 16:14:52 +02:00
|
|
|
initialAdminPassword = "admin";
|
|
|
|
adminEmail = "asmir.abdulahovic@gmail.com";
|
|
|
|
ccnetSettings = {
|
|
|
|
General = {
|
|
|
|
SERVICE_URL = "http://127.0.0.1:8020";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
seafileSettings = {
|
|
|
|
fileserver = {
|
|
|
|
host = "0.0.0.0";
|
|
|
|
port = 8082;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-07-03 22:35:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
fonts = {
|
|
|
|
fontconfig = {
|
|
|
|
cache32Bit = true;
|
|
|
|
allowBitmaps = true;
|
|
|
|
useEmbeddedBitmaps = true;
|
|
|
|
defaultFonts = {
|
2025-01-10 18:11:42 +01:00
|
|
|
monospace = [ "JetBrainsMono" ];
|
2023-07-03 22:35:58 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-08-08 16:07:01 +02:00
|
|
|
packages = with pkgs; [
|
2023-07-03 22:35:58 +02:00
|
|
|
dejavu_fonts
|
|
|
|
dina-font
|
|
|
|
fira-code
|
|
|
|
fira-code-symbols
|
2024-12-03 16:01:21 +01:00
|
|
|
font-awesome_6
|
2023-07-03 22:35:58 +02:00
|
|
|
inconsolata
|
|
|
|
iosevka
|
|
|
|
jetbrains-mono
|
|
|
|
liberation_ttf
|
2024-12-03 16:01:21 +01:00
|
|
|
libertine
|
2023-07-03 22:35:58 +02:00
|
|
|
noto-fonts
|
2024-11-07 12:33:55 +01:00
|
|
|
noto-fonts-cjk-sans
|
2024-12-03 16:01:21 +01:00
|
|
|
noto-fonts-color-emoji
|
2023-07-03 22:35:58 +02:00
|
|
|
noto-fonts-emoji
|
|
|
|
proggyfonts
|
|
|
|
siji
|
|
|
|
terminus_font
|
|
|
|
terminus_font_ttf
|
|
|
|
ubuntu_font_family
|
2024-12-03 16:01:21 +01:00
|
|
|
vistafonts
|
2023-07-03 22:35:58 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
virtualisation = {
|
2025-01-10 18:11:42 +01:00
|
|
|
libvirtd = {
|
|
|
|
enable = true;
|
|
|
|
allowedBridges = [
|
|
|
|
"virbr0"
|
|
|
|
"br0"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
spiceUSBRedirection.enable = true;
|
2023-07-03 22:35:58 +02:00
|
|
|
containers.storage.settings = {
|
|
|
|
storage = {
|
|
|
|
graphroot = "/var/lib/containers/storage";
|
|
|
|
runroot = "/run/containers/storage";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
podman = {
|
|
|
|
enable = true;
|
|
|
|
autoPrune.enable = true;
|
|
|
|
dockerCompat = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
hardware = {
|
|
|
|
bluetooth = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
General = {
|
|
|
|
Enable = "Source,Sink,Media,Socket";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-07-20 12:09:04 +02:00
|
|
|
graphics = {
|
2023-07-03 22:35:58 +02:00
|
|
|
enable = true;
|
2025-01-10 18:11:42 +01:00
|
|
|
extraPackages = [ ];
|
2023-07-03 22:35:58 +02:00
|
|
|
};
|
2024-05-10 22:52:39 +02:00
|
|
|
rtl-sdr.enable = true;
|
2023-07-03 22:35:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
zramSwap = {
|
|
|
|
enable = false;
|
|
|
|
algorithm = "zstd";
|
|
|
|
};
|
|
|
|
|
|
|
|
users.users.akill = {
|
|
|
|
isNormalUser = true;
|
|
|
|
shell = pkgs.zsh;
|
2025-01-10 18:11:42 +01:00
|
|
|
extraGroups = [
|
|
|
|
"wireshark"
|
|
|
|
"kvm"
|
|
|
|
"tty"
|
|
|
|
"audio"
|
|
|
|
"sound"
|
|
|
|
"adbusers"
|
|
|
|
"dialout"
|
|
|
|
"wheel"
|
|
|
|
];
|
2023-07-03 22:35:58 +02:00
|
|
|
};
|
|
|
|
}
|