Compare commits

...

54 Commits

Author SHA1 Message Date
55ab5a06eb
flake: update 2025-06-08 17:37:58 +02:00
b453f835a2
Merge branch 'plasma_bigscreen' 2025-06-08 17:37:33 +02:00
59680e948c
Revert "enable plasma"
This reverts commit 8ef4d1145f.
2025-06-08 17:36:42 +02:00
f7f87e1951
mediabox: update, switch to plasma_bigscreen 2025-06-08 17:36:24 +02:00
7e3dbe0a70
nixy/systemd: fix vconsole setup service 2025-06-08 14:37:18 +02:00
8ef4d1145f
enable plasma 2025-06-06 20:25:31 +02:00
6e32ea5dee
nixos: 24.11 -> 25.05 2025-05-25 20:52:16 +02:00
e6e1ed7618
nixos: 24.11 -> 25.05 2025-05-25 20:51:54 +02:00
9b73aabd3c
nixy: enable switchNg; disable nix-ld 2025-05-25 20:50:57 +02:00
3380128587
magpie/wireguard: remove hooks with bad nft syntax 2025-05-25 20:50:30 +02:00
a64d8bfdc9
home/zsh: update for new 25.05 syntax 2025-05-25 20:49:47 +02:00
b86aa2cd0c
home/sway: switch to viber from nixpkgs 2025-05-25 20:49:20 +02:00
266a5ef3f2
home/packages: rename for 25.05; remove custom viber package 2025-05-25 20:48:30 +02:00
250eb6f2e2
home/qutebrowser: temporary disable firejail 2025-05-25 20:47:55 +02:00
bc722d1df4
home/mpv: remove yt-dlp args 2025-05-25 20:47:19 +02:00
431d1659a4
home/swaylock: update locker script 2025-05-24 11:02:50 +02:00
a50ae21c82
home/kanshi: fix monitor positions -- needed for wine bug 2025-05-11 18:33:49 +02:00
e0af8b8607
magpie/firewall: fix nftables flag 2025-05-08 12:03:39 +02:00
a9a8fd5554
home/packages: add script to update nixos with low cpu and disk prio 2025-03-31 11:32:55 +02:00
101f58720c
home/i3status-rust: add kbd cycle script on click 2025-03-26 17:02:54 +01:00
79289167b1
home/i3status-rs: update refresh script for swayidle 2025-03-24 10:30:36 +01:00
95da63a217
home/swayidle: send SIGUSR2 instead SIGUSR1 to i3status-rs on wakeup 2025-03-19 21:53:55 +01:00
460f49e4b3
home/i3status-rs: add net interface block 2025-03-19 14:50:44 +01:00
65911327f3
home/i3status-rs: add if_command to net blocks to chech for iface presence 2025-03-19 12:48:26 +01:00
edec22570d
home_packages: add ark 2025-03-19 12:47:55 +01:00
62e54fdadf
flake: update 2025-03-10 14:59:29 +01:00
f5a1f5d396
nixy: add pw keybindings, disable waydroid 2025-03-10 14:32:12 +01:00
a624cbcfd1
magpie/networking: iptables -> nftables 2025-02-10 15:15:44 +01:00
f7246dc661
home/kanshi: add display positions for docked profile 2025-02-05 11:56:19 +01:00
5fc1e89975
home/swayidle: update lock script 2025-02-05 11:55:41 +01:00
071ee11601
flake: update 2025-02-04 16:02:37 +01:00
e4b6972c36
home/zsh: add full /nix/store path to aliases and shell script executables 2025-02-04 15:19:12 +01:00
cc95668f6d
home/zsh: export pwd using osc7 2025-02-04 14:31:09 +01:00
9f1d4c2bfe
home: add wayland-pipewire-idle-inhibit service 2025-02-04 12:53:49 +01:00
466ab42ee8
common/packages: add aria2 2025-01-26 14:10:24 +01:00
fd7b458be1
flake: update 2025-01-25 14:44:02 +01:00
ac5ab2d85d
Revert "nixy: switch to default nixos kernel"
This reverts commit 350bcfed05.
2025-01-25 14:43:37 +01:00
650c50889e
nixy: remove f2fs from initramfs 2025-01-15 11:55:21 +01:00
9f78cde62f
nixy: add global USER variable 2025-01-15 11:41:32 +01:00
1240d5d3a2
nixy/dnscyrpt-proxy2: add full path for public-resolvers.md 2025-01-15 11:35:21 +01:00
9b8aa0c6b2
home_packages: add rizin 2025-01-15 11:33:53 +01:00
77e24e385a
all: format .nix filex with nixfmt-rfc 2025-01-10 18:11:42 +01:00
e571ae07c0
flake: update 2025-01-10 18:11:13 +01:00
89841d00aa
home/sway: replace viber and zapzap keybindings 2025-01-06 15:15:04 +01:00
9513508d3d
flake: update 2025-01-02 02:11:58 +01:00
f2015b81da
home/zsh: update pure prompt, format 2025-01-02 02:10:45 +01:00
8791c104e1
home/zsh: syntax-highlighting -> fast-syntax-highlighting 2025-01-02 02:09:53 +01:00
9fac7fdac3
nixy: disable coredump 2024-12-31 15:03:26 +01:00
1829280f14
magpie: add virtio-gpu as initrd module 2024-12-26 13:31:57 +01:00
6c3b0aa239
magpie: set console=tty as boot param 2024-12-26 13:31:10 +01:00
17da0a855c
home-manager: switch to 24.11 version 2024-12-26 13:25:01 +01:00
c75a967110
nixy: use nftables 2024-12-26 13:24:20 +01:00
350bcfed05
nixy: switch to default nixos kernel 2024-12-26 13:24:03 +01:00
378ff6c9fd
packages: add ethtool 2024-12-26 13:22:58 +01:00
23 changed files with 1180 additions and 861 deletions

View File

@ -2,7 +2,8 @@
config,
pkgs,
...
}: {
}:
{
imports = [
];
@ -14,13 +15,16 @@
gc.automatic = true;
gc.options = "--delete-older-than 7d";
package = pkgs.nixVersions.latest;
settings.experimental-features = ["nix-command" "flakes"];
settings.experimental-features = [
"nix-command"
"flakes"
];
};
boot = {
kernelPackages = pkgs.linuxPackages_latest;
kernelParams = ["msr.allow_writes=on"];
supportedFilesystems = ["btrfs"];
kernelParams = [ "msr.allow_writes=on" ];
supportedFilesystems = [ "btrfs" ];
tmpOnTmpfs = true;
initrd.compressor = "zstd";
loader.systemd-boot = {
@ -39,7 +43,7 @@
doas.enable = true;
doas.extraRules = [
{
users = ["akill"];
users = [ "akill" ];
keepEnv = true;
persist = true;
}
@ -53,15 +57,16 @@
networking = {
firewall.enable = true;
hostName = "blue";
nameservers = ["127.0.0.1" "::1"];
nameservers = [
"127.0.0.1"
"::1"
];
dhcpcd.extraConfig = "nohook resolv.conf";
networkmanager = {
enable = true;
dns = "none";
/*
wifi.backend = "iwd";
*/
# wifi.backend = "iwd";
};
};
@ -92,8 +97,8 @@
services = {
"caps2esc" = {
description = "Intercepts keyboard udev events";
wants = ["systemd-udevd.service"];
wantedBy = ["multi-user.target"];
wants = [ "systemd-udevd.service" ];
wantedBy = [ "multi-user.target" ];
serviceConfig.Nice = -20;
script = ''
${pkgs.interception-tools}/bin/intercept \
@ -152,7 +157,10 @@
windowManager.i3.enable = true;
};
udev.packages = [pkgs.rtl-sdr pkgs.openhantek6022];
udev.packages = [
pkgs.rtl-sdr
pkgs.openhantek6022
];
tlp = {
enable = true;
@ -162,32 +170,38 @@
enable = true;
bindings = [
{
keys = [113];
events = ["key"];
keys = [ 113 ];
events = [ "key" ];
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master toggle'";
}
{
keys = [114];
events = ["key" "rep"];
keys = [ 114 ];
events = [
"key"
"rep"
];
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master 5%- unmute'";
}
{
keys = [115];
events = ["key" "rep"];
keys = [ 115 ];
events = [
"key"
"rep"
];
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master 5%+ unmute'";
}
{
keys = [224];
events = ["key"];
keys = [ 224 ];
events = [ "key" ];
command = "${pkgs.light}/bin/light -U 5";
}
{
keys = [225];
events = ["key"];
keys = [ 225 ];
events = [ "key" ];
command = "${pkgs.light}/bin/light -A 5";
}
];
@ -237,7 +251,7 @@
allowBitmaps = true;
useEmbeddedBitmaps = true;
defaultFonts = {
monospace = ["JetBrainsMono"];
monospace = [ "JetBrainsMono" ];
};
};
@ -306,6 +320,14 @@
users.users.akill = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = ["wireshark" "kvm" "tty" "audio" "sound" "adbusers" "dialout"];
extraGroups = [
"wireshark"
"kvm"
"tty"
"audio"
"sound"
"adbusers"
"dialout"
];
};
}

View File

@ -6,47 +6,77 @@
lib,
modulesPath,
...
}: {
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
"sr_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/0af4dcb9-6e59-4946-87b2-0d2f14b808d4";
fsType = "btrfs";
options = ["subvol=root" "compress=zstd" "noatime"];
options = [
"subvol=root"
"compress=zstd"
"noatime"
];
};
boot.initrd.luks.devices."enc_root".device = "/dev/disk/by-uuid/8eb8ac22-d89d-4406-bfbd-ce43e283649f";
boot.initrd.luks.devices."enc_root".device =
"/dev/disk/by-uuid/8eb8ac22-d89d-4406-bfbd-ce43e283649f";
fileSystems."/home" = {
device = "/dev/disk/by-uuid/0af4dcb9-6e59-4946-87b2-0d2f14b808d4";
fsType = "btrfs";
options = ["subvol=home" "compress=zstd" "noatime"];
options = [
"subvol=home"
"compress=zstd"
"noatime"
];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/0af4dcb9-6e59-4946-87b2-0d2f14b808d4";
fsType = "btrfs";
options = ["subvol=nix" "compress=zstd" "noatime"];
options = [
"subvol=nix"
"compress=zstd"
"noatime"
];
};
fileSystems."/var/log" = {
device = "/dev/disk/by-uuid/0af4dcb9-6e59-4946-87b2-0d2f14b808d4";
fsType = "btrfs";
options = ["subvol=log" "compress=zstd" "noatime"];
options = [
"subvol=log"
"compress=zstd"
"noatime"
];
neededForBoot = true;
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/0af4dcb9-6e59-4946-87b2-0d2f14b808d4";
fsType = "btrfs";
options = ["subvol=persist" "compress=zstd" "noatime"];
options = [
"subvol=persist"
"compress=zstd"
"noatime"
];
};
fileSystems."/boot" = {
@ -54,7 +84,7 @@
fsType = "vfat";
};
swapDevices = [];
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

View File

@ -3,10 +3,13 @@
nix-xilinx,
system,
...
}: {
environment.systemPackages = with pkgs;
}:
{
environment.systemPackages =
with pkgs;
[
acpi
aria2
binutils
binwalk
bluez
@ -21,6 +24,7 @@
dnsmasq
dnsutils
dtach
ethtool
f2fs-tools
fd
file
@ -91,5 +95,11 @@
zip
z-lua
]
++ (with nix-xilinx.packages.${system}; [vivado vitis vitis_hls model_composer xilinx-shell]);
++ (with nix-xilinx.packages.${system}; [
vivado
vitis
vitis_hls
model_composer
xilinx-shell
]);
}

View File

@ -4,9 +4,11 @@
pkgs,
...
}:
with lib; let
with lib;
let
cfg = config.services.batteryNotifier;
in {
in
{
options = {
services.batteryNotifier = {
enable = mkOption {
@ -42,7 +44,7 @@ in {
timerConfig.OnBootSec = "1m";
timerConfig.OnUnitInactiveSec = "1m";
timerConfig.Unit = "lowbatt.service";
wantedBy = ["timers.target"];
wantedBy = [ "timers.target" ];
};
systemd.user.services."lowbatt" = {
description = "battery level notifier";

184
flake.lock generated
View File

@ -35,11 +35,11 @@
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
@ -48,37 +48,51 @@
"type": "github"
}
},
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"git-hooks": {
"inputs": {
"systems": "systems"
"flake-compat": [
"simple-nixos-mailserver",
"flake-compat"
],
"gitignore": "gitignore",
"nixpkgs": [
"simple-nixos-mailserver",
"nixpkgs"
]
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"lastModified": 1742649964,
"narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"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"
}
},
@ -89,15 +103,16 @@
]
},
"locked": {
"lastModified": 1730016908,
"narHash": "sha256-bFCxJco7d8IgmjfNExNz9knP8wvwbXU4s/d53KOK6U0=",
"lastModified": 1748226808,
"narHash": "sha256-GaBRgxjWO1bAQa8P2+FDxG4ANBVhjnSjBms096qQdxo=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "e83414058edd339148dc142a8437edb9450574c8",
"rev": "83665c39fa688bd6a1f7c43cf7997a70f6a109f9",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-25.05",
"repo": "home-manager",
"type": "github"
}
@ -125,47 +140,32 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1732981179,
"narHash": "sha256-F7thesZPvAMSwjRu0K8uFshTk3ZZSNAsXTIFvXBT+34=",
"lastModified": 1748162331,
"narHash": "sha256-rqc2RKYTxP3tbjA+PB3VMRQNnjesrT0pEofXQTrMsS8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "62c435d93bf046a5396f3016472e8f7c8e2aed65",
"rev": "7c43f080a7f28b2774f3b3f43234ca11661bf334",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.11",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-24_05": {
"nixpkgs-25_05": {
"locked": {
"lastModified": 1717144377,
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=",
"lastModified": 1747610100,
"narHash": "sha256-rpR5ZPMkWzcnCcYYo3lScqfuzEw5Uyfh+R0EKZfroAc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "805a384895c696f802a9bf5bf4720f37385df547",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-24.05",
"type": "indirect"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1729973466,
"narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "cd3e8833d70618c4eea8df06f95b364b016d4950",
"rev": "ca49c4304acf0973078db0a9d200fd2bae75676d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.05",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
@ -177,11 +177,11 @@
]
},
"locked": {
"lastModified": 1733261583,
"narHash": "sha256-HOVUtrhtJ16umPuEODuVE9fx+JmDCRp7wIxnEART0Eg=",
"lastModified": 1748077877,
"narHash": "sha256-sxWrjcRygvs7Fz9gxjSm54ul8+NtU29V+PLAPR6ZfY0=",
"ref": "refs/heads/master",
"rev": "a09a34997ce692c7a2e8e434b44433156a73088c",
"revCount": 38,
"rev": "b23265403c87af272c74cda484a840b0f22306f5",
"revCount": 43,
"type": "git",
"url": "https://git.project-cloud.net/asmir/nvim_flake"
},
@ -190,28 +190,6 @@
"url": "https://git.project-cloud.net/asmir/nvim_flake"
}
},
"peerix": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1684706914,
"narHash": "sha256-pBlTtsC28e/5MUTe4NWeNNOc/4Kf6EzGQGppQEQ/ioo=",
"owner": "asmir.abdulahovic",
"repo": "peerix",
"rev": "8fdbbd0039240e05b4f93bbd5b454d5643e8a8d1",
"type": "gitlab"
},
"original": {
"owner": "asmir.abdulahovic",
"repo": "peerix",
"type": "gitlab"
}
},
"project-cloud": {
"inputs": {
"nixpkgs": [
@ -240,7 +218,6 @@
"nix-xilinx": "nix-xilinx",
"nixpkgs": "nixpkgs",
"nvim": "nvim",
"peerix": "peerix",
"project-cloud": "project-cloud",
"simple-nixos-mailserver": "simple-nixos-mailserver",
"sops-nix": "sops-nix",
@ -251,18 +228,19 @@
"simple-nixos-mailserver": {
"inputs": {
"blobs": "blobs",
"flake-compat": "flake-compat_3",
"flake-compat": "flake-compat_2",
"git-hooks": "git-hooks",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-24_05": "nixpkgs-24_05"
"nixpkgs-25_05": "nixpkgs-25_05"
},
"locked": {
"lastModified": 1722877200,
"narHash": "sha256-qgKDNJXs+od+1UbRy62uk7dYal3h98I4WojfIqMoGcg=",
"lastModified": 1747965231,
"narHash": "sha256-BW3ktviEhfCN/z3+kEyzpDKAI8qFTwO7+S0NVA0C90o=",
"owner": "simple-nixos-mailserver",
"repo": "nixos-mailserver",
"rev": "af7d3bf5daeba3fc28089b015c0dd43f06b176f2",
"rev": "53007af63fade28853408370c4c600a63dd97f41",
"type": "gitlab"
},
"original": {
@ -275,15 +253,14 @@
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
]
},
"locked": {
"lastModified": 1729999681,
"narHash": "sha256-qm0uCtM9bg97LeJTKQ8dqV/FvqRN+ompyW4GIJruLuw=",
"lastModified": 1747603214,
"narHash": "sha256-lAblXm0VwifYCJ/ILPXJwlz0qNY07DDYdLD+9H+Wc8o=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "1666d16426abe79af5c47b7c0efa82fd31bf4c56",
"rev": "8d215e1c981be3aa37e47aeabd4e61bb069548fd",
"type": "github"
},
"original": {
@ -312,21 +289,6 @@
"url": "https://git.project-cloud.net/asmir/swaysw"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"theme_anemone": {
"flake": false,
"locked": {
@ -366,11 +328,11 @@
]
},
"locked": {
"lastModified": 1721120316,
"narHash": "sha256-CaAMnU6LKqJrsZmR9k0/2brpULnAekpgG5S0BjtFhaQ=",
"lastModified": 1737802495,
"narHash": "sha256-Q+bZnH7uQM5T/G+xCGSRU3bTJqD70NeE4vLXLXLCm7k=",
"ref": "refs/heads/master",
"rev": "8a7923bd4e5d36b186408d5432568a91ac67b695",
"revCount": 21,
"rev": "4962f12867b0b6c4c4d39b98e6016e7f925a802c",
"revCount": 23,
"type": "git",
"url": "https://git.project-cloud.net/asmir/zremap"
},

View File

@ -2,18 +2,13 @@
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
nix-xilinx = {
url = "gitlab:asmir.abdulahovic/nix-xilinx";
inputs.nixpkgs.follows = "nixpkgs";
};
peerix = {
url = "gitlab:asmir.abdulahovic/peerix";
inputs.nixpkgs.follows = "nixpkgs";
};
zremap = {
url = "git+https://git.project-cloud.net/asmir/zremap";
inputs.nixpkgs.follows = "nixpkgs";
@ -35,7 +30,7 @@
};
home-manager = {
url = "github:nix-community/home-manager";
url = "github:nix-community/home-manager/release-25.05";
inputs.nixpkgs.follows = "nixpkgs";
};
@ -50,28 +45,30 @@
};
};
outputs = inputs @ {
outputs =
inputs@{
home-manager,
nixpkgs,
nix-xilinx,
nvim,
peerix,
project-cloud,
simple-nixos-mailserver,
sops-nix,
swaysw,
zremap,
...
}: let
}:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgs;
in {
in
{
nixosConfigurations = rec {
nixy = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
{_module.args = inputs;}
{_module.args.system = system;}
{nix.registry.nixpkgs.flake = nixpkgs;}
{ _module.args = inputs; }
{ _module.args.system = system; }
{ nix.registry.nixpkgs.flake = nixpkgs; }
./common/packages.nix
./common/suspend.nix
./nixy/configuration.nix
@ -82,30 +79,18 @@
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.akill = import ./home/home.nix;
home-manager.extraSpecialArgs = {inherit inputs system;};
home-manager.extraSpecialArgs = { inherit inputs system; };
home-manager.backupFileExtension = "home_backup";
}
peerix.nixosModules.peerix
{
services.peerix = {
enable = true;
globalCacheTTL = 10;
package = peerix.packages.x86_64-linux.peerix;
openFirewall = true; # UDP/12304
privateKeyFile = nixy.config.sops.secrets."peerix/private".path;
publicKeyFile = ./nixy/peerix-public;
publicKey = "peerix-mediabox:UDgG3xdQYv7bmx2l4ZPNRPJtp2zMmY++H/fnGeJ9BQw=";
};
}
];
};
mediabox = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
{_module.args = inputs;}
{_module.args.system = system;}
{nix.registry.nixpkgs.flake = nixpkgs;}
{ _module.args = inputs; }
{ _module.args.system = system; }
{ nix.registry.nixpkgs.flake = nixpkgs; }
./common/packages.nix
./common/suspend.nix
./mediabox/configuration.nix
@ -117,19 +102,7 @@
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.akill = import ./home/home.nix;
home-manager.extraSpecialArgs = {inherit inputs system;};
}
peerix.nixosModules.peerix
{
services.peerix = {
enable = true;
globalCacheTTL = 10;
package = peerix.packages.x86_64-linux.peerix;
openFirewall = true; # UDP/12304
privateKeyFile = mediabox.config.sops.secrets."peerix/private".path;
publicKeyFile = ./mediabox/peerix-public;
publicKey = "peerix-nixy:8THqS0R2zWF/47ai0RFmqJnieYTZ1jaWOD9tnzpvA6s=";
};
home-manager.extraSpecialArgs = { inherit inputs system; };
}
];
};
@ -137,9 +110,9 @@
blue = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
{_module.args = inputs;}
{_module.args.system = system;}
{nix.registry.nixpkgs.flake = nixpkgs;}
{ _module.args = inputs; }
{ _module.args.system = system; }
{ nix.registry.nixpkgs.flake = nixpkgs; }
./blue/configuration.nix
./blue/hardware-configuration.nix
./common/packages.nix
@ -148,16 +121,17 @@
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.akill = import ./home/home.nix;
home-manager.extraSpecialArgs = {inherit inputs system;};
home-manager.extraSpecialArgs = { inherit inputs system; };
}
];
};
magpie = nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux";
modules = [
{_module.args = inputs;}
{_module.args.system = system;}
{nix.registry.nixpkgs.flake = nixpkgs;}
{ _module.args = inputs; }
{ _module.args.system = system; }
{ nix.registry.nixpkgs.flake = nixpkgs; }
./magpie/configuration.nix
./magpie/hardware-configuration.nix
simple-nixos-mailserver.nixosModule
@ -168,7 +142,11 @@
};
devShell.x86_64-linux = pkgs.mkShell {
buildInputs = with pkgs; [sops ssh-to-age age];
buildInputs = with pkgs; [
sops
ssh-to-age
age
];
shellHook = ''
echo "Configuring NixOS!"
'';

View File

@ -2,12 +2,21 @@
lib,
pkgs,
...
}: let
}:
let
qutebrowser_firejail = pkgs.writeShellScriptBin "qutebrowser" ''
firejail -- ${lib.getExe pkgs.qutebrowser} "$@"
'';
in {
imports = [./zsh.nix ./i3status-rust.nix ./sway.nix ./i3.nix ./home_packages.nix ./whatsapp-for-linux.nix];
in
{
imports = [
./zsh.nix
./i3status-rust.nix
./sway.nix
./i3.nix
./home_packages.nix
./whatsapp-for-linux.nix
];
home.stateVersion = "22.11";
home.username = "akill";
@ -41,7 +50,9 @@ in {
WLR_RENDERER = "vulkan";
};
wayland.windowManager.sway = {enable = true;};
wayland.windowManager.sway = {
enable = true;
};
programs = {
home-manager.enable = true;
@ -60,7 +71,11 @@ in {
clock24 = true;
keyMode = "vi";
terminal = "screen-256color";
plugins = with pkgs.tmuxPlugins; [sysstat net-speed gruvbox];
plugins = with pkgs.tmuxPlugins; [
sysstat
net-speed
gruvbox
];
};
mpv = {
@ -71,7 +86,9 @@ in {
hwdec = "auto";
vo = "gpu-next";
ao = "pipewire";
script-opts-set = "ytdl_hook-ytdl_path=yt-dlp,sponsorblock-local_database=no,sponsorblock-skip_categories=[sponsor,intro,selfpromo]";
osd-bar = "no";
border = "no";
script-opts-set = "";
ytdl-format = "bestvideo[height<=?1080]+bestaudio/best";
};
@ -137,13 +154,14 @@ in {
font = "JetBrainsMono:size=10";
dpi-aware = "yes";
};
mouse = {hide-when-typing = "yes";};
mouse = {
hide-when-typing = "yes";
};
};
};
qutebrowser = {
enable = true;
package = qutebrowser_firejail;
keyBindings = {
normal = {
"j" = "scroll-px 0 25";
@ -183,8 +201,12 @@ in {
userEmail = "asmir.abdulahovic@gmail.com";
extraConfig = {
init.defaultBranch = "master";
pull = {rebase = true;};
credential = {helper = "store";};
pull = {
rebase = true;
};
credential = {
helper = "store";
};
};
signing.key = "020C42B7A9ABA3E2";
signing.signByDefault = true;
@ -192,7 +214,14 @@ in {
obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [obs-vkcapture input-overlay obs-multi-rtmp obs-pipewire-audio-capture wlrobs obs-vaapi];
plugins = with pkgs.obs-studio-plugins; [
obs-vkcapture
input-overlay
obs-multi-rtmp
obs-pipewire-audio-capture
wlrobs
obs-vaapi
];
};
i3status-rust.enable = true;
@ -220,14 +249,30 @@ in {
enableSshSupport = true;
};
swayidle = let
swayidle =
let
locker = pkgs.writeShellScriptBin "swaylock_fancy" ''
ALL_IMGS=""
LOCK_ARGS=""
for OUTPUT in $(${pkgs.sway}/bin/swaymsg -t get_outputs | ${lib.getExe pkgs.jq} -r '.[].name')
do
TMP_FILE=$(${pkgs.coreutils}/bin/mktemp /tmp/.swaylock_ss_XXXXXX.jpg)
${lib.getExe pkgs.grim} -t ppm - | ${pkgs.imagemagick}/bin/convert - -blur 0x12 "$TMP_FILE"
${lib.getExe pkgs.swaylock} -f -i "$TMP_FILE"
${pkgs.coreutils}/bin/rm "$TMP_FILE"
${lib.getExe pkgs.grim} -t ppm -o $OUTPUT - | \
${lib.getExe pkgs.ffmpeg} -y -loglevel 0 -i - -vframes 1 -vf "boxblur=10" "$TMP_FILE"
LOCK_ARGS="$LOCK_ARGS --image $OUTPUT:$TMP_FILE"
ALL_IMGS="$ALL_IMGS $TMP_FILE"
done
${lib.getExe pkgs.swaylock} -f $LOCK_ARGS
${pkgs.coreutils}/bin/shred $ALL_IMGS
${pkgs.coreutils}/bin/rm $ALL_IMGS
'';
in {
in
/*
refresh_i3status = pkgs.writeShellScriptBin "refresh_i3status" ''
${pkgs.coreutils}/bin/sleep 1 && ${pkgs.procps}/bin/pkill -USR1 i3status-rs
'';
*/
{
enable = true;
events = [
{
@ -238,10 +283,12 @@ in {
event = "lock";
command = "${locker}/bin/swaylock_fancy";
}
/*
{
event = "after-resume";
command = "${pkgs.procps}/bin/pkill -USR1 i3status-rs";
command = "${refresh_i3status}/bin/refresh_i3status";
}
*/
];
timeouts = [
{
@ -268,14 +315,17 @@ in {
profile.outputs = [
{
criteria = "eDP-1";
position = "0,0";
}
{
criteria = "Philips Consumer Electronics Company PHL 272S1 UHB2347026536";
mode = "1920x1080@74.973Hz";
position = "1920,0";
}
{
criteria = "Philips Consumer Electronics Company PHL 272S1 UHB2347026535";
mode = "1920x1080@74.973Hz";
position = "3840,0";
}
];
}
@ -285,19 +335,17 @@ in {
systemd.user = {
services = {
/*
himalaya = {
Unit.Description = "Himalaya new messages notifier";
wayland-pipewire-idle-inhibit = {
Unit.Description = "inhibit sleep while audio output is active";
Service = {
ExecStart = "himalaya notify";
ExecStart = "${lib.getExe pkgs.wayland-pipewire-idle-inhibit}";
Restart = "always";
RestartSec = 10;
};
Install = {
WantedBy = [ "multi-user.target" ];
WantedBy = [ "graphical-session.target" ];
};
};
*/
};
};
}

View File

@ -4,7 +4,8 @@
inputs,
system,
...
}: let
}:
let
chromium_teams = pkgs.writeShellScriptBin "chromium_teams" ''
${lib.getExe pkgs.ungoogled-chromium} --socket=wayland org.chromium.Chromium --app=https://teams.microsoft.com/
'';
@ -14,6 +15,11 @@
chromium_stackfield = pkgs.writeShellScriptBin "chromium_stackfield" ''
${lib.getExe pkgs.ungoogled-chromium} --socket=wayland org.chromium.Chromium --app=https://stackfield.com/
'';
nixy_switch = pkgs.writeShellScriptBin "nixy_switch" ''
${pkgs.util-linux}/bin/ionice -c 3 -- \
${pkgs.coreutils}/bin/nice -n 20 -- \
${lib.getExe pkgs.nixos-rebuild} --flake ./#nixy switch
'';
qcad = pkgs.writeShellScriptBin "qcad" ''
QT_QPA_PLATFORM=xcb ${lib.getExe pkgs.qcad} $@
'';
@ -25,8 +31,9 @@
PROXY_PORT="1337"
${lib.getExe pkgs.openssh} -D "$PROXY_PORT" -q -N "$@"
'';
wrap_sh = let
bubblewrap = pkgs.callPackage ../packages/bubblewrap/default.nix {};
wrap_sh =
let
bubblewrap = pkgs.callPackage ../packages/bubblewrap/default.nix { };
in
pkgs.writeShellScriptBin "wrap.sh" ''
if ${pkgs.coreutils-full}/bin/test $# -ne 1; then
@ -41,8 +48,10 @@
--tmp-overlay "$FULL_PATH" \
"$SHELL"
'';
in {
home.packages = with pkgs;
in
{
home.packages =
with pkgs;
[
anydesk
appimage-run
@ -54,10 +63,11 @@ in {
cached-nix-shell
caddy
cargo
ungoogled-chromium
cmake
compsize
/*cura*/
kdePackages.ark
ungoogled-chromium
# cura
deluge
dfu-util
discord
@ -82,7 +92,7 @@ in {
imv
inkscape
jellyfin-media-player
kdenlive
kdePackages.kdenlive
kicad
kodi-wayland
krita
@ -120,12 +130,12 @@ in {
python3Packages.west
remmina
river
rizin
rtorrent
sbcl
screen
seer
sioyek
skypeforlinux
slurp
steam-run
stm32cubemx
@ -138,6 +148,7 @@ in {
thunderbird
typst
upx
viber
waybar
wdisplays
weechat
@ -153,20 +164,20 @@ in {
yt-dlp
zapzap
zathura
/*zeal-qt6*/
# zeal-qt6
zig
]
++ [
chromium_discord
chromium_stackfield
chromium_teams
nixy_switch
qcad
ssh_proxy
wrap_sh
qcad
]
++ [
inputs.swaysw.packages.${system}.swaysw
(pkgs.callPackage ../packages/viber/default.nix {})
(pkgs.callPackage ../packages/bubblewrap/default.nix {})
(pkgs.callPackage ../packages/bubblewrap/default.nix { })
];
}

View File

@ -2,9 +2,11 @@
lib,
pkgs,
...
}: let
}:
let
scratchpad_cmd = "floating enable, resize set 1502 845, move position center, move scratchpad, scratchpad show";
in {
in
{
xsession.windowManager.i3 = {
enable = true;
package = pkgs.i3;
@ -53,24 +55,28 @@ in {
"${modifier}+Escape" = "workspace back_and_forth";
"${modifier}+p" = "exec ${pkgs.dmenu}/bin/dmenu_run";
"Mod4+l" = "exec i3-msg [instance=\"python3_scr\"] scratchpad show || exec alacritty --class python3_scr -e python3";
"Mod4+l" =
"exec i3-msg [instance=\"python3_scr\"] scratchpad show || exec alacritty --class python3_scr -e python3";
"Mod4+j" = "exec i3-msg [class=\"ViberPC\"] scratchpad show || exec viber";
"Mod4+m" = "exec i3-msg [class=\"Thunderbird\"] scratchpad show || exec thunderbird";
"Mod4+y" = "exec i3-msg [instance=\"pulsemixer_scr\"] scratchpad show || exec alacritty --class pulsemixer_scr -e pulsemixer";
"Mod4+y" =
"exec i3-msg [instance=\"pulsemixer_scr\"] scratchpad show || exec alacritty --class pulsemixer_scr -e pulsemixer";
};
window = {
/*
border = 4;
*/
# border = 4;
commands = [
{
command = scratchpad_cmd;
criteria = {instance = "pulsemixer_scr|python3_scr";};
criteria = {
instance = "pulsemixer_scr|python3_scr";
};
}
{
command = scratchpad_cmd;
criteria = {class = "Thunderbird";};
criteria = {
class = "Thunderbird";
};
}
{
command = scratchpad_cmd;
@ -81,7 +87,9 @@ in {
}
{
command = "focus child, layout tabbed, focus";
criteria = {class = "qutebrowser";};
criteria = {
class = "qutebrowser";
};
}
];
};
@ -90,7 +98,10 @@ in {
{
position = "top";
fonts = {
names = ["DejaVu Sans Mono" "FontAwesome5Free"];
names = [
"DejaVu Sans Mono"
"FontAwesome5Free"
];
style = "Fixed Bold SemiCondensed";
size = 7.0;
};

View File

@ -1,4 +1,15 @@
{...}: {
{ pkgs, ... }:
let
kbd_switch = pkgs.writeShellScriptBin "kbd_switch" ''
declare -A -r KBD_CYCLE_MAP=(
["English (US)"]="de"
["German"]="ba"
)
LAYOUT="$(${pkgs.sway}/bin/swaymsg -t get_inputs -r | ${pkgs.jq}/bin/jq -r 'map(select(.type == "keyboard")).[0].xkb_layout_names.[]')"
swaymsg input "*" xkb_layout ''${KBD_CYCLE_MAP["$LAYOUT"]:-"us"}
'';
in
{
programs.i3status-rust = {
bars.top = {
icons = "awesome5";
@ -11,6 +22,16 @@
};
blocks = [
{
block = "keyboard_layout";
driver = "sway";
click = [
{
cmd = "${kbd_switch}/bin/kbd_switch";
button = "left";
}
];
}
{
block = "battery";
interval = 10;
@ -35,20 +56,30 @@
{
block = "net";
device = "wlan0";
if_command = "ip link show wlan0";
interval = 2;
}
{
block = "net";
device = "enp5s0";
if_command = "ip link show enp5s0";
interval = 2;
}
{
block = "net";
device = "enp7s0f3u1u1";
if_command = "ip link show enp7s0f3u1u1";
interval = 2;
}
{
block = "net";
device = "enp7s0f4u1u1";
if_command = "ip link show enp7s0f4u1u1";
interval = 2;
}
{
block = "net";
if_command = "ip link show eno1";
device = "eno1";
interval = 2;
}

View File

@ -1,11 +1,11 @@
{
config,
pkgs,
inputs,
system,
lib,
...
}: let
}:
let
cliphist_sway = pkgs.writeShellScriptBin "cliphist_sway" ''
${lib.getExe pkgs.cliphist} list | \
${lib.getExe pkgs.wofi} --dmenu --insensitive | \
@ -17,9 +17,9 @@
${lib.getExe pkgs.grim} -g "$GEOM" - | ${pkgs.wl-clipboard}/bin/wl-copy
'';
swaysw = inputs.swaysw.packages.${system}.swaysw;
viber = pkgs.callPackage ../packages/viber/default.nix {};
term = "${pkgs.foot}/bin/footclient";
in {
in
{
wayland.windowManager.sway = {
enable = true;
extraSessionCommands = "";
@ -27,7 +27,7 @@ in {
config = {
fonts = {
names = ["JetBrainsMono"];
names = [ "JetBrainsMono" ];
style = "Bold Semi-Condensed";
size = 11.0;
};
@ -35,15 +35,21 @@ in {
window.commands = [
{
command = "move scratchpad, resize set 1152 648";
criteria = {app_id = "pulsemixer|python3|com.rtosta.zapzap|whatsapp-for-linux|com.viber";};
criteria = {
app_id = "pulsemixer|python3|com.rtosta.zapzap|whatsapp-for-linux|com.viber";
};
}
{
command = "move scratchpad, resize set 1502 845";
criteria = {app_id = "com.viber";};
criteria = {
app_id = "com.viber";
};
}
{
command = "floating enable";
criteria = {app_id = "sws_cli";};
criteria = {
app_id = "sws_cli";
};
}
];
@ -62,16 +68,25 @@ in {
};
input = {
"type:keyboard" = {repeat_delay = "150";};
"type:keyboard" = {repeat_rate = "70";};
"type:touchpad" = {tap = "enabled";};
"type:keyboard" = {
repeat_delay = "150";
};
"type:keyboard" = {
repeat_rate = "70";
};
"type:touchpad" = {
tap = "enabled";
};
};
bars = [
{
position = "top";
fonts = {
names = ["Iosevka" "FontAwesome"];
names = [
"Iosevka"
"FontAwesome"
];
style = "Bold Semi-Condensed";
size = 12.0;
};
@ -125,12 +140,14 @@ in {
"Alt+bracketright" = "focus output right";
"Alt+bracketleft" = "focus output left";
"Mod4+l" = ''
exec ${pkgs.sway}/bin/swaymsg [app_id="python3"] scratchpad show || exec ${term} -a python3 ${lib.getExe pkgs.python3}'';
"Mod4+h" = "exec ${pkgs.sway}/bin/swaymsg [app_id=com.rtosta.zapzap] scratchpad show || exec ${lib.getExe pkgs.zapzap}";
"Mod4+j" = "exec ${pkgs.sway}/bin/swaymsg [app_id=com.viber] scratchpad show || exec ${viber}/bin/viber";
"Mod4+y" = ''
exec ${pkgs.sway}/bin/swaymsg [app_id="pulsemixer"] scratchpad show || exec ${term} -a pulsemixer ${lib.getExe pkgs.pulsemixer}'';
"Mod4+l" =
''exec ${pkgs.sway}/bin/swaymsg [app_id="python3"] scratchpad show || exec ${term} -a python3 ${lib.getExe pkgs.python3}'';
"Mod4+j" =
"exec ${pkgs.sway}/bin/swaymsg [app_id=com.rtosta.zapzap] scratchpad show || exec ${lib.getExe pkgs.zapzap}";
"Mod4+h" =
"exec ${pkgs.sway}/bin/swaymsg [app_id=com.viber] scratchpad show || exec ${pkgs.viber}/bin/viber";
"Mod4+y" =
''exec ${pkgs.sway}/bin/swaymsg [app_id="pulsemixer"] scratchpad show || exec ${term} -a pulsemixer ${lib.getExe pkgs.pulsemixer}'';
"Mod4+p" = "exec ${lib.getExe pkgs.tessen} -a copy";
};
};

View File

@ -1,7 +1,8 @@
{lib, ...}:
with lib; {
{ lib, ... }:
with lib;
{
xdg.configFile."whatsapp-for-linux/settings.conf".source = builtins.toFile "settings.conf" (
generators.toINI {} {
generators.toINI { } {
General = {
zoom_level = 1;
close_to_tray = false;

View File

@ -1,4 +1,5 @@
{pkgs, ...}: {
{ pkgs, lib, ... }:
{
programs.z-lua = {
enableAliases = true;
enableZshIntegration = true;
@ -7,17 +8,16 @@
programs.zsh = {
autocd = true;
enableCompletion = false;
syntaxHighlighting.enable = true;
defaultKeymap = "viins";
shellAliases = {
cfind = "cscope -C -R -L1";
cfind = "${pkgs.cscope}/bin/cscope -C -R -L1";
chmod = "chmod -v";
chown = "chown -v";
cp = "cp -v";
rm = "rm -v";
ip = "ip --color=auto";
f = "''$(pay-respects zsh)";
f = "''$(${lib.getExe pkgs.pay-respects} zsh)";
};
history = {
@ -43,8 +43,8 @@
src = pkgs.fetchFromGitHub {
owner = "sindresorhus";
repo = "pure";
rev = "a02209d36c8509c0e62f44324127632999c9c0cf";
hash = "sha256-BmQO4xqd/3QnpLUitD2obVxL0UulpboT8jGNEh4ri8k=";
rev = "92b8e9057988566b37ff695e70e2e9bbeb7196c8";
hash = "sha256-TbOrnhLHgOvcfsgmL0l3bWY33yLIhG1KSi4ITIPq1+A=";
};
file = "pure.plugin.zsh";
}
@ -63,11 +63,16 @@
};
file = "sudo.plugin.zsh";
}
{
name = "zsh-fast-syntax-highlighting";
src = pkgs.zsh-fast-syntax-highlighting;
file = "share/zsh/site-functions/fast-syntax-highlighting.plugin.zsh";
}
];
envExtra = '''';
initExtra = ''
initContent = ''
# binds
bindkey '^K' fzf-file-widget
@ -87,11 +92,23 @@
ls;
}
function osc7-pwd() {
emulate -L zsh # also sets localoptions for us
setopt extendedglob
local LC_ALL=C
printf '\e]7;file://%s%s\e\' $HOST ''${PWD//(#m)([^@-Za-z&-;_~])/%''${(l:2::0:)''$(([##16]#MATCH))}}
}
function chpwd-osc7-pwd() {
(( ZSH_SUBSHELL )) || osc7-pwd
}
add-zsh-hook -Uz chpwd chpwd-osc7-pwd
eval "$(direnv hook zsh)"
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
TMUX_EXE="${pkgs.tmux}/bin/tmux"
TMUX_EXE="${lib.getExe pkgs.tmux}"
systemd-run --scope --user $TMUX_EXE attach-session -t $USER || systemd-run --scope --user $TMUX_EXE new-session -s $USER
fi

View File

@ -6,11 +6,15 @@
nvim,
system,
...
}: {
imports = [];
}:
{
imports = [ ];
nix.optimise.automatic = true;
nix.settings.experimental-features = ["nix-command" "flakes"];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
system.switch = {
enable = false;
enableNg = true;
@ -21,7 +25,10 @@
boot.loader.systemd-boot.configurationLimit = 2;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = ["ip=dhcp"];
boot.kernelParams = [
"ip=dhcp"
"console=tty"
];
boot.kernel.sysctl = {
"net.core.default_qdisc" = "fq";
"net.ipv4.tcp_congestion_control" = "bbr";
@ -29,14 +36,17 @@
boot.initrd = {
compressor = "zstd";
availableKernelModules = ["virtio-pci"];
availableKernelModules = [
"virtio-pci"
"virtio-gpu"
];
systemd.enable = true;
network = {
enable = true;
ssh = {
enable = true;
hostKeys = [/etc/ssh_dummy_ed25519_key];
authorizedKeyFiles = [../nixy/ssh_pubkey];
hostKeys = [ /etc/ssh_dummy_ed25519_key ];
authorizedKeyFiles = [ ../nixy/ssh_pubkey ];
};
};
};
@ -74,7 +84,7 @@
enable = true;
debug = false;
fqdn = "mail.project-cloud.net";
domains = ["project-cloud.net"];
domains = [ "project-cloud.net" ];
enableSubmissionSsl = true;
enableImap = false;
enableImapSsl = true;
@ -84,11 +94,11 @@
loginAccounts = {
"gitea@project-cloud.net" = {
hashedPasswordFile = config.sops.secrets."gitea_mail_pw_hash".path;
aliases = ["git@project-cloud.net"];
aliases = [ "git@project-cloud.net" ];
};
"asmir@project-cloud.net" = {
hashedPasswordFile = config.sops.secrets."asmir_mail_pw_hash".path;
aliases = ["asmir.abdulahovic@project-cloud.net"];
aliases = [ "asmir.abdulahovic@project-cloud.net" ];
};
};
certificateScheme = "acme-nginx";
@ -236,10 +246,16 @@
REGISTER_EMAIL_CONFIRM = true;
};
settings."markup.restructuredtext" = let
docutils =
pkgs.python3.withPackages (ps: with ps; [docutils pygments]);
in {
settings."markup.restructuredtext" =
let
docutils = pkgs.python3.withPackages (
ps: with ps; [
docutils
pygments
]
);
in
{
ENABLED = true;
FILE_EXTENSIONS = ".rst";
RENDER_COMMAND = "${docutils}/bin/rst2html.py";
@ -262,7 +278,7 @@
paths = [
"/var/lib/gitea"
];
exclude = [];
exclude = [ ];
repo = "ssh://na9fqv67@na9fqv67.repo.borgbase.com/./repo";
encryption = {
mode = "repokey-blake2";
@ -279,12 +295,10 @@
adminEmail = "asmir.abdulahovic" + "@" + "gmail.com";
};
/*
needed for sendmail mail functionality
*/
users.users.gitea.extraGroups = ["postdrop"];
# needed for sendmail mail functionality
users.users.gitea.extraGroups = [ "postdrop" ];
systemd.services.gitea.serviceConfig = {
RestrictAddressFamilies = ["AF_NETLINK"];
RestrictAddressFamilies = [ "AF_NETLINK" ];
ProtectSystem = lib.mkForce false;
};
@ -294,7 +308,7 @@
};
sops = {
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
secrets = {
"asmir_mail_pw_hash".sopsFile = ./secrets/asmir_mail_pw_hash.yaml;
"borgbase_enc_key".sopsFile = ./secrets/borgbase_enc_key.yaml;
@ -319,51 +333,63 @@
};
networking.hostName = "magpie";
networking.nftables.enable = true;
networking.firewall = {
enable = true;
allowedTCPPorts = [
80
443
587
2049
]; # http, mail, mail, nfs
allowedUDPPorts = [
443
51820
]; # mail, wireguard
allowPing = true;
logRefusedConnections = lib.mkDefault false;
};
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [80 443 587 2049]; # http, mail, mail, nfs
networking.firewall.allowedUDPPorts = [443 51820]; #mail, wireguard
networking.firewall.allowPing = true;
networking.firewall.logRefusedConnections = lib.mkDefault false;
networking.nat.enable = true;
networking.nat.externalInterface = "enp1s0";
networking.nat.internalInterfaces = ["wg0"];
networking.nat = {
enable = true;
externalInterface = "enp1s0";
internalInterfaces = [ "wg0" ];
};
networking.networkmanager.enable = true;
networking.wireless.enable = false;
networking.wireguard.interfaces = {
wg0 = {
ips = ["10.100.0.1/24"];
ips = [ "10.100.0.1/24" ];
listenPort = 51820;
# This allows the wireguard server to route your traffic to the internet and hence be like a VPN
# For this to work you have to set the dnsserver IP of your router (or dnsserver of choice) in your clients
postSetup = ''
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE
'';
# This undoes the above command
postShutdown = ''
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE
'';
#postSetup = ''
# ${pkgs.nftables}/bin/nft add rule ip nat POSTROUTING oifname "eth0" ip saddr 10.100.0.0/24 counter masquerade
#'';
# This undoes the above command, TODO fix command below to be more specific
#postShutdown = ''
# ${pkgs.nftables}/bin/nft flush table ip nat
#'';
privateKeyFile = config.sops.secrets."wg_privkey".path;
peers = [
{
publicKey = builtins.readFile ../nixy/wg_pubkey;
presharedKeyFile = config.sops.secrets."wg_preshared/nixy".path;
allowedIPs = ["10.100.0.6/32"];
allowedIPs = [ "10.100.0.6/32" ];
}
{
publicKey = builtins.readFile ../mediabox/wg_pubkey;
presharedKeyFile = config.sops.secrets."wg_preshared/mediabox".path;
allowedIPs = ["10.100.0.5/32"];
allowedIPs = [ "10.100.0.5/32" ];
}
{
publicKey = builtins.readFile ../common/wg_pubkey_workstation;
presharedKeyFile = config.sops.secrets."wg_preshared/workstation".path;
allowedIPs = ["10.100.0.4/32"];
allowedIPs = [ "10.100.0.4/32" ];
}
];
};

View File

@ -5,15 +5,21 @@
lib,
modulesPath,
...
}: {
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "virtio_pci" "usbhid" "sr_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];
boot.initrd.availableKernelModules = [
"xhci_pci"
"virtio_pci"
"usbhid"
"sr_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/118de1e5-f23e-4af3-a10a-054eded78152";
@ -25,7 +31,7 @@
fsType = "vfat";
};
swapDevices = [];
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

View File

@ -1,20 +1,24 @@
# 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).
{ config
, nvim
, pkgs
, system
, zremap
, ...
}:
let
USER = "akill";
in
{
config,
pkgs,
zremap,
system,
nvim,
...
}: {
imports = [];
imports = [ ];
system.stateVersion = "23.05";
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" = {
sopsFile = ./secrets/peerix.yaml;
mode = "0400";
@ -36,28 +40,31 @@
gc.options = "--delete-older-than 7d";
package = pkgs.nixVersions.latest;
settings = {
experimental-features = ["nix-command" "flakes"];
experimental-features = [
"nix-command"
"flakes"
];
};
};
boot = {
initrd = {
compressor = "zstd";
availableKernelModules = ["e1000e"];
availableKernelModules = [ "e1000e" ];
network = {
enable = true;
udhcpc.enable = true;
ssh = {
enable = true;
hostKeys = [/etc/ssh_dummy_ed25519_key];
authorizedKeys = [(builtins.readFile ../nixy/ssh_pubkey)];
hostKeys = [ /etc/ssh_dummy_ed25519_key ];
authorizedKeys = [ (builtins.readFile ../nixy/ssh_pubkey) ];
};
};
};
kernelModules = ["acpi_call"];
kernelModules = [ "acpi_call" ];
kernelPackages = pkgs.linuxPackages_latest;
kernelParams = ["msr.allow_writes=on"];
kernelParams = [ "msr.allow_writes=on" ];
kernel.sysctl = {
"net.core.default_qdisc" = "fq";
"net.ipv4.tcp_congestion_control" = "bbr";
@ -68,28 +75,38 @@
memtest86.enable = true;
};
readOnlyNixStore = true;
supportedFilesystems = ["btrfs"];
supportedFilesystems = [ "btrfs" ];
tmp.useTmpfs = true;
tmp.tmpfsSize = "80%";
};
security = {
rtkit.enable = true;
acme = {
acceptTerms = true;
defaults.email = "aasmir@gmx.com";
};
allowSimultaneousMultithreading = true;
sudo.enable = true;
doas.enable = true;
doas.extraRules = [
{
users = [ USER ];
keepEnv = true;
persist = true;
}
];
};
powerManagement = {
enable = true;
cpuFreqGovernor = "ondemand";
};
networking = {
nftables.enable = true;
firewall = {
enable = true;
allowedTCPPorts = [80 443 51820];
allowedTCPPorts = [
80
443
51820
8020
];
};
hostName = "mediabox";
@ -97,28 +114,33 @@
interfaces.wlp3s0.useDHCP = false;
useDHCP = false;
wireless.enable = false;
wireless.interfaces = ["wlp3s0"];
nameservers = ["127.0.0.1" "::1"];
wireless.interfaces = [ "wlp3s0" ];
nameservers = [
"127.0.0.1"
"::1"
];
dhcpcd.extraConfig = "nohook resolv.conf";
networkmanager.dns = "none";
extraHosts = ''
192.168.1.173 nixy.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 qbittorrent.mediabox.lan
192.168.88.1 router.lan
192.168.88.231 workstation.lan
192.168.88.121 ender.lan
'';
wireguard.interfaces = {
wg0 = {
ips = ["10.100.0.5/24"];
ips = [ "10.100.0.5/24" ];
privateKeyFile = config.sops.secrets."wg_privkey".path;
peers = [
{
publicKey = builtins.readFile ../magpie/wg_pubkey;
presharedKeyFile = config.sops.secrets."wg_preshared/mediabox".path;
allowedIPs = ["10.100.0.0/24"];
allowedIPs = [ "10.100.0.0/24" ];
endpoint = "5.75.229.224:51820";
persistentKeepalive = 25;
}
@ -130,7 +152,7 @@
time.timeZone = "Europe/Sarajevo";
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [nvim.overlays.${system}.overlay];
nixpkgs.overlays = [ nvim.overlays.${system}.overlay ];
environment = {
homeBinInPath = true;
variables = {
@ -138,76 +160,77 @@
};
};
programs.gnupg.agent = {
programs = {
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = false;
localNetworkGameTransfers.openFirewall = true;
};
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
programs.zsh.enable = true;
programs.light.enable = true;
programs.firejail.enable = true;
programs.adb.enable = false;
programs.wireshark.enable = true;
programs.sway.enable = true;
appimage = {
enable = true;
binfmt = true;
};
nix-ld = {
enable = false;
libraries = with pkgs; [
stdenv.cc.cc.lib
zlib
];
};
zsh.enable = true;
firejail.enable = true;
};
# List services that you want to enable:
systemd = {
services = {
"macchanger-wireless" = {
after = ["sys-subsystem-net-devices-wlp3s0.device"];
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"];
"zremap@" = {
enable = true;
restartIfChanged = true;
serviceConfig.Nice = -20;
script = ''
sleep 1
${zremap.defaultPackage.${system}}/bin/zremap \
/dev/input/by-path/platform-i8042-serio-0-event-kbd
'';
unitConfig = {
Description = "zremap on %I";
ConditionPathExists = "%I";
};
serviceConfig = {
Type = "simple";
ExecStart = "${zremap.defaultPackage.${system}}/bin/zremap %I";
};
};
"wakeonlan" = {
description = "Reenable wake on lan every boot";
after = ["network.target"];
after = [ "network.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.ethtool}/sbin/ethtool -s enp0s25 wol m";
};
wantedBy = ["default.target" "suspend.target" "shutdown.target"];
wantedBy = [
"default.target"
"suspend.target"
"shutdown.target"
];
};
};
/*
"cpu_setting" = {
description = "Enable turboot boost and undervolt cpu after suspend";
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
coredump.enable = false;
extraConfig = ''
DefaultTimeoutStartSec=30s
DefaultTimeoutStopSec=30s
'';
serviceConfig.Type = "oneshot";
};
*/
};
};
services = {
acpid.enable = true;
btrfs.autoScrub.enable = true;
dbus.enable = true;
dbus.implementation = "broker";
envfs.enable = true;
fstrim.enable = true;
fwupd.enable = true;
ntp.enable = true;
@ -225,13 +248,13 @@
};
jellyfin = {
enable = true;
enable = false;
user = "akill";
openFirewall = true;
};
jellyseerr = {
enable = true;
enable = false;
openFirewall = true;
};
@ -242,138 +265,95 @@
pulse.enable = true;
};
deluge = {
avahi = {
enable = false;
user = "akill";
nssmdns4 = false;
openFirewall = true;
dataDir = "/home/akill/.config/deluge";
web = {
enable = true;
openFirewall = false;
};
config = {
download_location = "/media";
allow_remote = true;
daemon_port = 58846;
};
};
transmission = {
enable = false;
openFirewall = true;
settings = {
rpc-whitelist = "192.168.88.*";
download-dir = "/media";
};
};
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 = ''
SystemMaxUse=50M
'';
logind.extraConfig = ''
KillUserProcesses=yes
'';
libinput.enable = true;
xserver = {
enable = true;
libinput.enable = true;
dpi = 144;
desktopManager.xterm.enable = false;
displayManager.lightdm.enable = false;
displayManager.defaultSession = "none+icewm";
windowManager.icewm.enable = true;
desktopManager.plasma5.bigscreen.enable = true;
#desktopManager.plasma6.enable = true;
displayManager = {
lightdm.enable = false;
startx.enable = true;
sddm.enable = true;
sddm.wayland.enable = true;
};
windowManager.i3.enable = false;
};
udev.packages = [];
udev = {
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 = true;
settings = {};
enable = false;
};
batteryNotifier = {
enable = false;
notifyCapacity = 20;
suspendCapacity = 10;
};
actkbd = {
enable = true;
bindings = [
{
keys = [121];
events = ["key"];
command = "${pkgs.alsaUtils}/bin/amixer -q set Master toggle";
keys = [ 115 ];
events = [ "key" ];
command = "XDG_RUNTIME_DIR=/run/user/$(id -u ${USER}) ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
}
{
keys = [122];
events = ["key" "rep"];
command = "${pkgs.alsaUtils}/bin/amixer -q set Master ${config.sound.mediaKeys.volumeStep}- unmute";
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 = [123];
events = ["key" "rep"];
command = "${pkgs.alsaUtils}/bin/amixer -q set Master ${config.sound.mediaKeys.volumeStep}+ unmute";
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 = "/run/current-system/sw/bin/light -U 5";
keys = [ 224 ];
events = [ "key" ];
command = "${pkgs.light}/bin/light -U 5";
}
{
keys = [225];
events = ["key"];
command = "/run/current-system/sw/bin/light -A 5";
keys = [ 225 ];
events = [ "key" ];
command = "${pkgs.light}/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;
require_nolog = true;
require_nofilter = true;
http3 = true;
sources.public-resolvers = {
urls = [
@ -385,33 +365,62 @@
};
};
};
journald.extraConfig = ''
SystemMaxUse=50M
'';
logind.extraConfig = ''
KillUserProcesses=yes
'';
};
fonts.packages = with pkgs; [
fonts = {
fontconfig = {
cache32Bit = true;
allowBitmaps = true;
useEmbeddedBitmaps = true;
defaultFonts = {
monospace = [ "JetBrainsMono" ];
};
};
packages = with pkgs; [
dejavu_fonts
dina-font
fira-code
fira-code-symbols
font-awesome
font-awesome_4
font-awesome_6
inconsolata
iosevka
jetbrains-mono
liberation_ttf
libertine
noto-fonts
noto-fonts-cjk-sans
noto-fonts-color-emoji
noto-fonts-emoji
proggyfonts
siji
terminus_font
terminus_font_ttf
ubuntu_font_family
vistafonts
];
};
virtualisation = {
podman = {
enable = true;
enable = false;
autoPrune.enable = true;
dockerCompat = true;
};
};
sound.enable = true;
hardware = {
bluetooth = {
enable = false;
enable = true;
settings = {
General = {
Enable = "Source,Sink,Media,Socket";
@ -419,14 +428,9 @@
};
};
opengl = {
graphics = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
intel-media-driver
vaapiIntel
];
extraPackages = [ ];
};
};
@ -435,10 +439,15 @@
algorithm = "zstd";
};
users.users.akill = {
users.users.${USER} = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = ["wireshark" "wheel" "kvm" "tty" "audio" "sound" "adbusers" "transmission"];
extraGroups = [
"wheel"
"tty"
"audio"
"sound"
];
openssh.authorizedKeys.keys = [
(builtins.readFile ../nixy/ssh_pubkey)
];
@ -447,12 +456,17 @@
users.users.ado = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = ["wireshark" "wheel" "kvm" "tty" "audio" "sound" "adbusers" "transmission"];
extraGroups = [
"wheel"
"tty"
"audio"
"sound"
];
};
users.users.mediauser = {
isNormalUser = true;
shell = pkgs.bash;
extraGroups = [];
extraGroups = [ ];
};
}

View File

@ -5,20 +5,32 @@
lib,
modulesPath,
...
}: {
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ehci_pci"
"ahci"
"usb_storage"
"sd_mod"
"rtsx_pci_sdmmc"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/ae774285-60dc-4b08-ab26-8208e8f4e81e";
fsType = "btrfs";
options = ["subvol=root" "compress=lzo" "noatime"];
options = [
"subvol=root"
"compress=lzo"
"noatime"
];
};
boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/60aa7671-bfee-451b-b871-ac7c5a4a9f3a";
@ -26,25 +38,41 @@
fileSystems."/home" = {
device = "/dev/disk/by-uuid/ae774285-60dc-4b08-ab26-8208e8f4e81e";
fsType = "btrfs";
options = ["subvol=home" "compress=lzo" "noatime"];
options = [
"subvol=home"
"compress=lzo"
"noatime"
];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/ae774285-60dc-4b08-ab26-8208e8f4e81e";
fsType = "btrfs";
options = ["subvol=nix" "compress=lzo" "noatime"];
options = [
"subvol=nix"
"compress=lzo"
"noatime"
];
};
fileSystems."/persist" = {
device = "/dev/disk/by-uuid/ae774285-60dc-4b08-ab26-8208e8f4e81e";
fsType = "btrfs";
options = ["subvol=persist" "compress=lzo" "noatime"];
options = [
"subvol=persist"
"compress=lzo"
"noatime"
];
};
fileSystems."/var/log" = {
device = "/dev/disk/by-uuid/ae774285-60dc-4b08-ab26-8208e8f4e81e";
fsType = "btrfs";
options = ["subvol=log" "compress=lzo" "noatime"];
options = [
"subvol=log"
"compress=lzo"
"noatime"
];
neededForBoot = true;
};
@ -54,7 +82,7 @@
};
swapDevices = [
{device = "/dev/disk/by-uuid/7b44ab02-84ff-4ffd-be26-58247cf5a982";}
{ device = "/dev/disk/by-uuid/7b44ab02-84ff-4ffd-be26-58247cf5a982"; }
];
hardware.cpu.intel.updateMicrocode = true;

View File

@ -2,7 +2,8 @@
config,
pkgs,
...
}: {
}:
{
# Enable Nginx
services.nginx = {
enable = true;
@ -61,7 +62,7 @@
enable = true;
# Ensure the database, user, and permissions always exist
ensureDatabases = ["nextcloud"];
ensureDatabases = [ "nextcloud" ];
ensureUsers = [
{
name = "nextcloud";
@ -72,7 +73,7 @@
# Ensure that postgres is running before running the setup
systemd.services."nextcloud-setup" = {
requires = ["postgresql.service"];
after = ["postgresql.service"];
requires = [ "postgresql.service" ];
after = [ "postgresql.service" ];
};
}

View File

@ -4,11 +4,13 @@
pkgs,
...
}:
with lib; let
with lib;
let
cfg = config.services.qbittorrent;
configDir = "${cfg.dataDir}/.config";
openFilesLimit = 4096;
in {
in
{
options.services.qbittorrent = {
enable = mkOption {
type = types.bool;
@ -67,24 +69,24 @@ in {
};
config = mkIf cfg.enable {
environment.systemPackages = [pkgs.qbittorrent];
environment.systemPackages = [ pkgs.qbittorrent ];
nixpkgs.overlays = [
(final: prev: {
qbittorrent = prev.qbittorrent.override {guiSupport = false;};
qbittorrent = prev.qbittorrent.override { guiSupport = false; };
})
];
networking.firewall = mkIf cfg.openFirewall {
allowedTCPPorts = [cfg.port];
allowedUDPPorts = [cfg.port];
allowedTCPPorts = [ cfg.port ];
allowedUDPPorts = [ cfg.port ];
};
systemd.services.qbittorrent = {
after = ["network.target"];
after = [ "network.target" ];
description = "qBittorrent Daemon";
wantedBy = ["multi-user.target"];
path = [pkgs.qbittorrent];
wantedBy = [ "multi-user.target" ];
path = [ pkgs.qbittorrent ];
serviceConfig = {
ExecStart = ''
${pkgs.qbittorrent}/bin/qbittorrent-nox \
@ -110,7 +112,10 @@ in {
};
};
users.groups =
mkIf (cfg.group == "qbittorrent") {qbittorrent = {gid = null;};};
users.groups = mkIf (cfg.group == "qbittorrent") {
qbittorrent = {
gid = null;
};
};
};
}

View File

@ -1,23 +1,26 @@
{ config
, nix-xilinx
, nvim
, pkgs
, system
, zremap
, ...
}:
let
USER = "akill";
in
{
config,
nix-xilinx,
nvim,
pkgs,
system,
zremap,
...
}: {
imports = [];
imports = [ ];
system.stateVersion = "23.05";
system.autoUpgrade.enable = false;
system.switch = {
enable = false;
enable = true;
enableNg = true;
};
sops = {
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
secrets = {
"peerix/private" = {
sopsFile = ./secrets/peerix.yaml;
@ -44,12 +47,12 @@
"borgbase_enc_key" = {
sopsFile = ./secrets/borgbase_enc_key.yaml;
owner = config.users.users.akill.name;
owner = config.users.users.${USER}.name;
};
"borgbase_ssh_key" = {
sopsFile = ./secrets/borgbase_ssh_key.yaml;
owner = config.users.users.akill.name;
owner = config.users.users.${USER}.name;
};
};
};
@ -61,18 +64,30 @@
package = pkgs.nixVersions.latest;
settings = {
sandbox = true;
experimental-features = ["nix-command" "flakes"];
experimental-features = [
"nix-command"
"flakes"
];
};
};
boot = {
extraModulePackages = with config.boot.kernelPackages; [usbip v4l2loopback];
extraModulePackages = with config.boot.kernelPackages; [
usbip
v4l2loopback
];
initrd.compressor = "zstd";
initrd.kernelModules = [];
initrd.kernelModules = [ ];
initrd.systemd.enable = true;
binfmt.emulatedSystems = ["wasm32-wasi" "x86_64-windows"];
kernelPackages = pkgs.linuxPackages_latest;
kernelParams = ["psmouse.synaptics_intertouch=0" "mem_sleep_default=deep"];
binfmt.emulatedSystems = [
"wasm32-wasi"
"x86_64-windows"
];
kernelParams = [
"psmouse.synaptics_intertouch=0"
"mem_sleep_default=deep"
];
#kernelPackages = pkgs.linuxPackages_latest;
kernel.sysctl = {
"net.core.default_qdisc" = "fq";
"net.ipv4.tcp_congestion_control" = "bbr";
@ -84,7 +99,9 @@
memtest86.enable = true;
};
readOnlyNixStore = true;
supportedFilesystems = ["f2fs" "xfs"];
supportedFilesystems = [
"xfs"
];
tmp.useTmpfs = true;
};
@ -95,7 +112,7 @@
doas.enable = true;
doas.extraRules = [
{
users = ["akill"];
users = [ USER ];
keepEnv = true;
persist = true;
}
@ -107,13 +124,22 @@
};
networking = {
nftables.enable = true;
firewall = {
enable = true;
allowedTCPPorts = [80 443 51820 8020];
allowedTCPPorts = [
80
443
51820
8020
];
};
hostName = "nixy";
nameservers = ["127.0.0.1" "::1"];
nameservers = [
"127.0.0.1"
"::1"
];
dhcpcd.extraConfig = "nohook resolv.conf";
extraHosts = ''
@ -144,13 +170,13 @@
wireguard.interfaces = {
wg0 = {
ips = ["10.100.0.6/24"];
ips = [ "10.100.0.6/24" ];
privateKeyFile = config.sops.secrets."wg_privkey".path;
peers = [
{
publicKey = builtins.readFile ../magpie/wg_pubkey;
presharedKeyFile = config.sops.secrets."wg_preshared/nixy".path;
allowedIPs = ["10.100.0.0/24"];
allowedIPs = [ "10.100.0.0/24" ];
endpoint = "5.75.229.224:51820";
persistentKeepalive = 25;
}
@ -158,12 +184,12 @@
};
neox_wg = {
ips = ["192.168.51.2/32"];
ips = [ "192.168.51.2/32" ];
privateKeyFile = config.sops.secrets."wg_privkey".path;
peers = [
{
publicKey = builtins.readFile ../nixy/wg_pubkey_nx;
allowedIPs = ["192.168.2.0/24"];
allowedIPs = [ "192.168.2.0/24" ];
endpoint = "185.194.64.26:51820";
persistentKeepalive = 25;
}
@ -175,7 +201,10 @@
time.timeZone = "Europe/Sarajevo";
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [nix-xilinx.overlay nvim.overlays.${system}.overlay];
nixpkgs.overlays = [
nix-xilinx.overlay
nvim.overlays.${system}.overlay
];
environment = {
etc = {
"firejail/qutebrowser.local".text = ''
@ -206,6 +235,13 @@
enable = true;
binfmt = true;
};
nix-ld = {
enable = false;
libraries = with pkgs; [
stdenv.cc.cc.lib
zlib
];
};
zsh.enable = true;
firejail.enable = true;
adb.enable = true;
@ -218,6 +254,14 @@
# List services that you want to enable:
systemd = {
services = {
# Fix issue where systemd-vconsole-setup failes to find keymap
systemd-vconsole-setup = {
unitConfig = {
After = "local-fs.target";
};
};
"zremap@" = {
enable = true;
restartIfChanged = true;
@ -234,7 +278,7 @@
"netns@" = {
description = "%I network namespace";
before = ["network.target"];
before = [ "network.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
@ -245,11 +289,11 @@
"wg_proton" = {
description = "wg network interface";
bindsTo = ["netns@wg.service"];
requires = ["network-online.target"];
wants = ["dnscrypt-proxy2_proton.service"];
after = ["netns@wg.service"];
before = ["dnscrypt-proxy2_proton.service"];
bindsTo = [ "netns@wg.service" ];
requires = [ "network-online.target" ];
wants = [ "dnscrypt-proxy2_proton.service" ];
after = [ "netns@wg.service" ];
before = [ "dnscrypt-proxy2_proton.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
@ -260,7 +304,9 @@
${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 \
${pkgs.wireguard-tools}/bin/wg set "proton_wg" private-key "${config.sops.secrets."wg_privkey_proton".path}"
${pkgs.wireguard-tools}/bin/wg set "proton_wg" private-key "${
config.sops.secrets."wg_privkey_proton".path
}"
${pkgs.iproute2}/bin/ip netns exec wg \
${pkgs.wireguard-tools}/bin/wg set "proton_wg" peer "g6DkXWKI/68RsLjROIwCEcyB/ZhyK5Q7OWcz1TtqER0=" \
endpoint "$ENDPOINT_IP:51820" \
@ -283,9 +329,9 @@
"network-online.target"
"nss-lookup.target"
];
before = ["nss-lookup.target"];
after = ["wg_proton.service"];
partOf = ["wg_proton.service"];
before = [ "nss-lookup.target" ];
after = [ "wg_proton.service" ];
partOf = [ "wg_proton.service" ];
serviceConfig = {
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
CacheDirectory = "dnscrypt-proxy";
@ -329,6 +375,7 @@
};
};
coredump.enable = false;
extraConfig = ''
DefaultTimeoutStartSec=30s
DefaultTimeoutStopSec=30s
@ -339,6 +386,7 @@
acpid.enable = true;
dbus.enable = true;
dbus.implementation = "broker";
envfs.enable = true;
fstrim.enable = true;
fwupd.enable = true;
ntp.enable = true;
@ -371,7 +419,10 @@
};
udev = {
packages = [pkgs.openhantek6022 pkgs.openocd];
packages = [
pkgs.openhantek6022
pkgs.openocd
];
extraRules = ''
#Xilinx FTDI
ACTION=="add", ATTR{idVendor}=="0403", ATTR{manufacturer}=="Xilinx", MODE:="666"
@ -402,32 +453,38 @@
enable = true;
bindings = [
{
keys = [113];
events = ["key"];
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master toggle'";
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 = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master 5%- unmute'";
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 = [115];
events = ["key" "rep"];
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master 5%+ unmute'";
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"];
keys = [ 224 ];
events = [ "key" ];
command = "${pkgs.light}/bin/light -U 5";
}
{
keys = [225];
events = ["key"];
keys = [ 225 ];
events = [ "key" ];
command = "${pkgs.light}/bin/light -A 5";
}
];
@ -447,16 +504,18 @@
"https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
"https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md"
];
cache_file = "public-resolvers.md";
cache_file = "/var/lib/dnscrypt-proxy/public-resolvers.md";
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
};
};
};
borgbackup.jobs."borgbase" = let
user = config.users.users.akill;
borgbackup.jobs."borgbase" =
let
user = config.users.users.${USER};
home = user.home;
in {
in
{
user = user.name;
paths = [
(home + "/pic/priv")
@ -518,7 +577,7 @@
allowBitmaps = true;
useEmbeddedBitmaps = true;
defaultFonts = {
monospace = ["JetBrainsMono"];
monospace = [ "JetBrainsMono" ];
};
};
@ -547,6 +606,14 @@
};
virtualisation = {
waydroid.enable = false;
libvirtd = {
enable = true;
allowedBridges = [
"virbr0"
"br0"
];
};
spiceUSBRedirection.enable = true;
containers.storage.settings = {
storage = {
@ -573,7 +640,7 @@
graphics = {
enable = true;
extraPackages = [];
extraPackages = [ ];
};
rtl-sdr.enable = true;
};
@ -583,9 +650,18 @@
algorithm = "zstd";
};
users.users.akill = {
users.users.${USER} = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = ["wireshark" "kvm" "tty" "audio" "sound" "adbusers" "dialout" "wheel"];
extraGroups = [
"wireshark"
"kvm"
"tty"
"audio"
"sound"
"adbusers"
"dialout"
"wheel"
];
};
}

View File

@ -1,39 +1,60 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.luks.devices."crypt_dev".device = "/dev/disk/by-uuid/e10821b9-5426-4f03-b716-1645a64fcd6a";
boot.initrd.luks.devices."crypt_dev".device =
"/dev/disk/by-uuid/e10821b9-5426-4f03-b716-1645a64fcd6a";
boot.initrd.luks.devices."crypt_dev".allowDiscards = true;
boot.initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "uas" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.availableKernelModules = [
"nvme"
"ehci_pci"
"xhci_pci"
"uas"
"usb_storage"
"sd_mod"
"rtsx_pci_sdmmc"
];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-amd" "amd-gpu" ];
boot.kernelModules = [
"kvm-amd"
"amd-gpu"
];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/c461c971-54ca-4fb7-91e8-6ac70de53ef2";
fileSystems."/" = {
device = "/dev/disk/by-uuid/c461c971-54ca-4fb7-91e8-6ac70de53ef2";
fsType = "xfs";
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/eeaa6fab-d67d-400f-b6d4-b1f44c2e0047";
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/eeaa6fab-d67d-400f-b6d4-b1f44c2e0047";
fsType = "xfs";
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/aeaa71ca-a439-4ef3-9ab8-db7ae8f59376";
fileSystems."/home" = {
device = "/dev/disk/by-uuid/aeaa71ca-a439-4ef3-9ab8-db7ae8f59376";
fsType = "xfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/828E-F3C3";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/828E-F3C3";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
options = [
"fmask=0022"
"dmask=0022"
];
};
swapDevices = [ ];

View File

@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
description = "Unprivileged sandboxing tool";
homepage = "https://github.com/containers/bubblewrap";
license = licenses.lgpl2Plus;
maintainers = with maintainers; [dotlambda];
maintainers = with maintainers; [ dotlambda ];
platforms = platforms.linux;
mainProgram = "bwrap";
};

View File

@ -52,8 +52,8 @@ stdenv.mkDerivation {
hash = "sha256-9WHiI2WlsgEhCPkrQoAunmF6lSb2n5RgQJ2+sdnSShM=";
};
nativeBuildInputs = [makeWrapper];
buildInputs = [dpkg];
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ dpkg ];
dontUnpack = true;
@ -115,7 +115,8 @@ stdenv.mkDerivation {
xorg.libxkbfile
];
installPhase = let
installPhase =
let
viberWrap = writeShellScriptBin "viberWrap" ''
${bubblewrap}/bin/bwrap --bind / / \
--dev /dev \
@ -124,7 +125,8 @@ stdenv.mkDerivation {
--bind $HOME/Downloads/ $HOME/Downloads \
$@
'';
in ''
in
''
dpkg-deb -x $src $out
mkdir -p $out/bin
@ -161,9 +163,9 @@ stdenv.mkDerivation {
meta = {
homepage = "https://www.viber.com";
description = "An instant messaging and Voice over IP (VoIP) app";
sourceProvenance = with lib.sourceTypes; [binaryNativeCode];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
platforms = ["x86_64-linux"];
maintainers = with lib.maintainers; [jagajaga];
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [ jagajaga ];
};
}