Compare commits

..

No commits in common. "55ab5a06eb8efa114ac19b9a1b70d4ae10cef476" and "7e3dbe0a700bbe20c6ed68bb5523e5f8393bc0b0" have entirely different histories.

2 changed files with 249 additions and 274 deletions

96
flake.lock generated
View File

@ -35,11 +35,11 @@
"flake-compat_2": { "flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1747046372, "lastModified": 1696426674,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra", "owner": "edolstra",
"repo": "flake-compat", "repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -48,54 +48,6 @@
"type": "github" "type": "github"
} }
}, },
"git-hooks": {
"inputs": {
"flake-compat": [
"simple-nixos-mailserver",
"flake-compat"
],
"gitignore": "gitignore",
"nixpkgs": [
"simple-nixos-mailserver",
"nixpkgs"
]
},
"locked": {
"lastModified": 1742649964,
"narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"simple-nixos-mailserver",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -103,11 +55,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1748226808, "lastModified": 1747556831,
"narHash": "sha256-GaBRgxjWO1bAQa8P2+FDxG4ANBVhjnSjBms096qQdxo=", "narHash": "sha256-Qb84nbYFFk0DzFeqVoHltS2RodAYY5/HZQKE8WnBDsc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "83665c39fa688bd6a1f7c43cf7997a70f6a109f9", "rev": "d0bbd221482c2713cccb80220f3c9d16a6e20a33",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -140,11 +92,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1748162331, "lastModified": 1747953325,
"narHash": "sha256-rqc2RKYTxP3tbjA+PB3VMRQNnjesrT0pEofXQTrMsS8=", "narHash": "sha256-y2ZtlIlNTuVJUZCqzZAhIw5rrKP4DOSklev6c8PyCkQ=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "7c43f080a7f28b2774f3b3f43234ca11661bf334", "rev": "55d1f923c480dadce40f5231feb472e81b0bab48",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -154,20 +106,19 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-25_05": { "nixpkgs-24_11": {
"locked": { "locked": {
"lastModified": 1747610100, "lastModified": 1734083684,
"narHash": "sha256-rpR5ZPMkWzcnCcYYo3lScqfuzEw5Uyfh+R0EKZfroAc=", "narHash": "sha256-5fNndbndxSx5d+C/D0p/VF32xDiJCJzyOqorOYW4JEo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ca49c4304acf0973078db0a9d200fd2bae75676d", "rev": "314e12ba369ccdb9b352a4db26ff419f7c49fa84",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "id": "nixpkgs",
"ref": "nixos-25.05", "ref": "nixos-24.11",
"repo": "nixpkgs", "type": "indirect"
"type": "github"
} }
}, },
"nvim": { "nvim": {
@ -229,18 +180,17 @@
"inputs": { "inputs": {
"blobs": "blobs", "blobs": "blobs",
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
"git-hooks": "git-hooks",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"nixpkgs-25_05": "nixpkgs-25_05" "nixpkgs-24_11": "nixpkgs-24_11"
}, },
"locked": { "locked": {
"lastModified": 1747965231, "lastModified": 1746937334,
"narHash": "sha256-BW3ktviEhfCN/z3+kEyzpDKAI8qFTwO7+S0NVA0C90o=", "narHash": "sha256-7g2GSePdYbpD1v5BxEVSCJ2Ogf4K5rc9sBB81FervUY=",
"owner": "simple-nixos-mailserver", "owner": "simple-nixos-mailserver",
"repo": "nixos-mailserver", "repo": "nixos-mailserver",
"rev": "53007af63fade28853408370c4c600a63dd97f41", "rev": "da66510f688b7eac54e3cac7c75be4b8dd78ce8b",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -256,11 +206,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1747603214, "lastModified": 1746485181,
"narHash": "sha256-lAblXm0VwifYCJ/ILPXJwlz0qNY07DDYdLD+9H+Wc8o=", "narHash": "sha256-PxrrSFLaC7YuItShxmYbMgSuFFuwxBB+qsl9BZUnRvg=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "8d215e1c981be3aa37e47aeabd4e61bb069548fd", "rev": "e93ee1d900ad264d65e9701a5c6f895683433386",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -1,22 +1,19 @@
{ config # Edit this configuration file to define what should be installed on
, nvim # your system. Help is available in the configuration.nix(5) man page
, pkgs # and in the NixOS manual (accessible by running nixos-help).
, system {
, zremap config,
, ... pkgs,
zremap,
system,
nvim,
...
}: }:
let
USER = "akill";
in
{ {
imports = [ ]; imports = [ ];
system.stateVersion = "23.05"; system.stateVersion = "23.05";
system.autoUpgrade.enable = false; system.autoUpgrade.enable = false;
system.switch = {
enable = true;
enableNg = true;
};
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
sops.secrets."peerix/private" = { sops.secrets."peerix/private" = {
@ -77,35 +74,29 @@ in
readOnlyNixStore = true; readOnlyNixStore = true;
supportedFilesystems = [ "btrfs" ]; supportedFilesystems = [ "btrfs" ];
tmp.useTmpfs = true; tmp.useTmpfs = true;
tmp.tmpfsSize = "80%";
}; };
security = { security = {
rtkit.enable = true; rtkit.enable = true;
allowSimultaneousMultithreading = true; acme = {
sudo.enable = true; acceptTerms = true;
doas.enable = true; defaults.email = "aasmir@gmx.com";
doas.extraRules = [ };
{
users = [ USER ];
keepEnv = true;
persist = true;
}
];
}; };
powerManagement = { powerManagement = {
enable = true; enable = true;
cpuFreqGovernor = "ondemand";
}; };
networking = { networking = {
nftables.enable = true;
firewall = { firewall = {
enable = true; enable = true;
allowedTCPPorts = [ allowedTCPPorts = [
80 80
443 443
51820 51820
8020
]; ];
}; };
@ -120,16 +111,14 @@ in
"::1" "::1"
]; ];
dhcpcd.extraConfig = "nohook resolv.conf"; dhcpcd.extraConfig = "nohook resolv.conf";
networkmanager.dns = "none";
extraHosts = '' extraHosts = ''
192.168.1.173 nixy.lan 192.168.1.173 nixy.lan
192.168.88.171 jellyfin.mediabox.lan 192.168.88.171 jellyfin.mediabox.lan
192.168.88.171 jellyseerr.mediabox.lan
192.168.88.171 mediabox.lan 192.168.88.171 mediabox.lan
192.168.88.171 qbittorrent.mediabox.lan 192.168.88.171 qbittorrent.mediabox.lan
192.168.88.1 router.lan 192.168.88.1 router.lan
192.168.88.231 workstation.lan 192.168.88.231 workstation.lan
192.168.88.121 ender.lan
''; '';
wireguard.interfaces = { wireguard.interfaces = {
@ -160,47 +149,44 @@ in
}; };
}; };
programs = { programs.gnupg.agent = {
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = false;
localNetworkGameTransfers.openFirewall = true;
};
gnupg.agent = {
enable = true; enable = true;
enableSSHSupport = true; enableSSHSupport = true;
}; };
appimage = { programs.zsh.enable = true;
enable = true; programs.light.enable = true;
binfmt = true; programs.firejail.enable = true;
}; programs.adb.enable = false;
nix-ld = { programs.wireshark.enable = true;
enable = false; programs.sway.enable = true;
libraries = with pkgs; [
stdenv.cc.cc.lib
zlib
];
};
zsh.enable = true;
firejail.enable = true;
};
# List services that you want to enable: # List services that you want to enable:
systemd = { systemd = {
services = { services = {
"zremap@" = { "macchanger-wireless" = {
enable = true; after = [ "sys-subsystem-net-devices-wlp3s0.device" ];
restartIfChanged = true; before = [ "network-pre.target" ];
bindsTo = [ "sys-subsystem-net-devices-wlp3s0.device" ];
description = "Changes MAC of my wireless interface for privacy reasons";
stopIfChanged = false;
wantedBy = [ "multi-user.target" ];
wants = [ "network-pre.target" ];
script = ''
${pkgs.macchanger}/bin/macchanger -e wlp3s0 || true
'';
serviceConfig.Type = "oneshot";
};
"zremap" = {
description = "Intercepts keyboard udev events";
wants = [ "systemd-udevd.service" ];
wantedBy = [ "multi-user.target" ];
serviceConfig.Nice = -20; serviceConfig.Nice = -20;
unitConfig = { script = ''
Description = "zremap on %I"; sleep 1
ConditionPathExists = "%I"; ${zremap.defaultPackage.${system}}/bin/zremap \
}; /dev/input/by-path/platform-i8042-serio-0-event-kbd
serviceConfig = { '';
Type = "simple";
ExecStart = "${zremap.defaultPackage.${system}}/bin/zremap %I";
};
}; };
"wakeonlan" = { "wakeonlan" = {
@ -216,21 +202,27 @@ in
"shutdown.target" "shutdown.target"
]; ];
}; };
};
coredump.enable = false; /*
extraConfig = '' "cpu_setting" = {
DefaultTimeoutStartSec=30s description = "Enable turboot boost and undervolt cpu after suspend";
DefaultTimeoutStopSec=30s wantedBy = ["post-resume.target" "multi-user.target"];
after = ["post-resume.target"];
script = ''
echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo
${pkgs.undervolt}/bin/undervolt --core -105 --cache -105 --uncore -105 --gpu -15 -p1 47 28 -p2 57 0.0025
''; '';
serviceConfig.Type = "oneshot";
};
*/
};
}; };
services = { services = {
acpid.enable = true; acpid.enable = true;
btrfs.autoScrub.enable = true; btrfs.autoScrub.enable = true;
dbus.enable = true; dbus.enable = true;
dbus.implementation = "broker";
envfs.enable = true;
fstrim.enable = true; fstrim.enable = true;
fwupd.enable = true; fwupd.enable = true;
ntp.enable = true; ntp.enable = true;
@ -248,13 +240,13 @@ in
}; };
jellyfin = { jellyfin = {
enable = false; enable = true;
user = "akill"; user = "akill";
openFirewall = true; openFirewall = true;
}; };
jellyseerr = { jellyseerr = {
enable = false; enable = true;
openFirewall = true; openFirewall = true;
}; };
@ -265,105 +257,58 @@ in
pulse.enable = true; pulse.enable = true;
}; };
avahi = { deluge = {
enable = false; enable = false;
nssmdns4 = false; user = "akill";
openFirewall = true; openFirewall = true;
}; dataDir = "/home/akill/.config/deluge";
web = {
libinput.enable = true;
xserver = {
enable = true; enable = true;
dpi = 144; openFirewall = false;
desktopManager.xterm.enable = false; };
desktopManager.plasma5.bigscreen.enable = true; config = {
#desktopManager.plasma6.enable = true; download_location = "/media";
displayManager = { allow_remote = true;
lightdm.enable = false; daemon_port = 58846;
startx.enable = true;
sddm.enable = true;
sddm.wayland.enable = true;
}; };
windowManager.i3.enable = false;
}; };
udev = { transmission = {
packages = [ ];
extraRules = ''
#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"
'';
};
tlp = {
enable = false; enable = false;
}; openFirewall = true;
batteryNotifier = {
enable = false;
notifyCapacity = 20;
suspendCapacity = 10;
};
actkbd = {
enable = true;
bindings = [
{
keys = [ 115 ];
events = [ "key" ];
command = "XDG_RUNTIME_DIR=/run/user/$(id -u ${USER}) ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
}
{
keys = [ 114 ];
events = [
"key"
"rep"
];
command = "XDG_RUNTIME_DIR=/run/user/$(id -u ${USER}) ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
}
{
keys = [ 113 ];
events = [
"key"
"rep"
];
command = "XDG_RUNTIME_DIR=/run/user/$(id -u ${USER}) ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
}
{
keys = [ 224 ];
events = [ "key" ];
command = "${pkgs.light}/bin/light -U 5";
}
{
keys = [ 225 ];
events = [ "key" ];
command = "${pkgs.light}/bin/light -A 5";
}
];
};
dnscrypt-proxy2 = {
enable = true;
settings = { settings = {
ipv6_servers = true; rpc-whitelist = "192.168.88.*";
require_dnssec = true; download-dir = "/media";
require_nolog = true;
require_nofilter = true;
http3 = true;
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"
];
cache_file = "/var/lib/dnscrypt-proxy/public-resolvers.md";
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
}; };
}; };
qbittorrent = {
enable = true;
user = "akill";
openFirewall = true;
dataDir = "/home/akill/.config/qbittorrent";
port = 8081;
};
nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."deluge.mediabox.lan" = {
locations."/".proxyPass = "http://localhost:8112/";
};
virtualHosts."qbittorrent.mediabox.lan" = {
locations."/".proxyPass = "http://localhost:8081/";
};
virtualHosts."jellyfin.mediabox.lan" = {
locations."/".proxyPass = "http://localhost:8096/";
};
virtualHosts."jellyseerr.mediabox.lan" = {
locations."/".proxyPass = "http://localhost:5055/";
};
}; };
journald.extraConfig = '' journald.extraConfig = ''
@ -374,53 +319,120 @@ in
KillUserProcesses=yes KillUserProcesses=yes
''; '';
xserver = {
enable = true;
libinput.enable = true;
desktopManager.xterm.enable = false;
displayManager.lightdm.enable = false;
displayManager.defaultSession = "none+icewm";
windowManager.icewm.enable = true;
}; };
fonts = { udev.packages = [ ];
fontconfig = {
cache32Bit = true; tlp = {
allowBitmaps = true; enable = true;
useEmbeddedBitmaps = true; settings = { };
defaultFonts = {
monospace = [ "JetBrainsMono" ];
};
}; };
packages = with pkgs; [ actkbd = {
dejavu_fonts enable = true;
dina-font bindings = [
fira-code {
fira-code-symbols keys = [ 121 ];
font-awesome_6 events = [ "key" ];
inconsolata command = "${pkgs.alsaUtils}/bin/amixer -q set Master toggle";
iosevka }
jetbrains-mono {
liberation_ttf keys = [ 122 ];
libertine events = [
noto-fonts "key"
noto-fonts-cjk-sans "rep"
noto-fonts-color-emoji ];
noto-fonts-emoji command = "${pkgs.alsaUtils}/bin/amixer -q set Master ${config.sound.mediaKeys.volumeStep}- unmute";
proggyfonts }
siji {
terminus_font keys = [ 123 ];
terminus_font_ttf events = [
ubuntu_font_family "key"
vistafonts "rep"
];
command = "${pkgs.alsaUtils}/bin/amixer -q set Master ${config.sound.mediaKeys.volumeStep}+ unmute";
}
{
keys = [ 224 ];
events = [ "key" ];
command = "/run/current-system/sw/bin/light -U 5";
}
{
keys = [ 225 ];
events = [ "key" ];
command = "/run/current-system/sw/bin/light -A 5";
}
]; ];
}; };
mpd = {
musicDirectory = "/home/mpd/music";
enable = false;
extraConfig = ''
audio_output {
type "pulse"
name "pulsee srv"
server "127.0.0.1"
}
'';
};
batteryNotifier = {
enable = true;
notifyCapacity = 20;
suspendCapacity = 10;
};
dnscrypt-proxy2 = {
enable = true;
settings = {
ipv6_servers = true;
require_dnssec = true;
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"
];
cache_file = "/var/lib/dnscrypt-proxy/public-resolvers.md";
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
};
};
};
};
fonts.packages = with pkgs; [
dina-font
fira-code
fira-code-symbols
font-awesome
font-awesome_4
iosevka
jetbrains-mono
liberation_ttf
proggyfonts
siji
];
virtualisation = { virtualisation = {
podman = { podman = {
enable = false; enable = true;
autoPrune.enable = true;
dockerCompat = true; dockerCompat = true;
}; };
}; };
sound.enable = true;
hardware = { hardware = {
bluetooth = { bluetooth = {
enable = true; enable = false;
settings = { settings = {
General = { General = {
Enable = "Source,Sink,Media,Socket"; Enable = "Source,Sink,Media,Socket";
@ -428,9 +440,14 @@ in
}; };
}; };
graphics = { opengl = {
enable = true; enable = true;
extraPackages = [ ]; driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
intel-media-driver
vaapiIntel
];
}; };
}; };
@ -439,14 +456,18 @@ in
algorithm = "zstd"; algorithm = "zstd";
}; };
users.users.${USER} = { users.users.akill = {
isNormalUser = true; isNormalUser = true;
shell = pkgs.zsh; shell = pkgs.zsh;
extraGroups = [ extraGroups = [
"wireshark"
"wheel" "wheel"
"kvm"
"tty" "tty"
"audio" "audio"
"sound" "sound"
"adbusers"
"transmission"
]; ];
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
(builtins.readFile ../nixy/ssh_pubkey) (builtins.readFile ../nixy/ssh_pubkey)
@ -457,10 +478,14 @@ in
isNormalUser = true; isNormalUser = true;
shell = pkgs.zsh; shell = pkgs.zsh;
extraGroups = [ extraGroups = [
"wireshark"
"wheel" "wheel"
"kvm"
"tty" "tty"
"audio" "audio"
"sound" "sound"
"adbusers"
"transmission"
]; ];
}; };