Compare commits

..

1 Commits

Author SHA1 Message Date
f601854156
magpie/gitea: add typst syntax higlight 2024-12-05 11:06:43 +01:00
23 changed files with 714 additions and 994 deletions

View File

@ -2,8 +2,7 @@
config,
pkgs,
...
}:
{
}: {
imports = [
];
@ -15,10 +14,7 @@
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 = {
@ -57,16 +53,15 @@
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";
*/
};
};
@ -157,10 +152,7 @@
windowManager.i3.enable = true;
};
udev.packages = [
pkgs.rtl-sdr
pkgs.openhantek6022
];
udev.packages = [pkgs.rtl-sdr pkgs.openhantek6022];
tlp = {
enable = true;
@ -177,19 +169,13 @@
{
keys = [114];
events = [
"key"
"rep"
];
events = ["key" "rep"];
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master 5%- unmute'";
}
{
keys = [115];
events = [
"key"
"rep"
];
events = ["key" "rep"];
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master 5%+ unmute'";
}
@ -320,14 +306,6 @@
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,21 +6,12 @@
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.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
@ -28,55 +19,34 @@
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" = {

View File

@ -3,13 +3,10 @@
nix-xilinx,
system,
...
}:
{
environment.systemPackages =
with pkgs;
}: {
environment.systemPackages = with pkgs;
[
acpi
aria2
binutils
binwalk
bluez
@ -24,7 +21,6 @@
dnsmasq
dnsutils
dtach
ethtool
f2fs-tools
fd
file
@ -95,11 +91,5 @@
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,11 +4,9 @@
pkgs,
...
}:
with lib;
let
with lib; let
cfg = config.services.batteryNotifier;
in
{
in {
options = {
services.batteryNotifier = {
enable = mkOption {

148
flake.lock generated
View File

@ -33,6 +33,22 @@
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@ -48,6 +64,24 @@
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -55,16 +89,15 @@
]
},
"locked": {
"lastModified": 1747556831,
"narHash": "sha256-Qb84nbYFFk0DzFeqVoHltS2RodAYY5/HZQKE8WnBDsc=",
"lastModified": 1730016908,
"narHash": "sha256-bFCxJco7d8IgmjfNExNz9knP8wvwbXU4s/d53KOK6U0=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "d0bbd221482c2713cccb80220f3c9d16a6e20a33",
"rev": "e83414058edd339148dc142a8437edb9450574c8",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-25.05",
"repo": "home-manager",
"type": "github"
}
@ -92,35 +125,51 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1747953325,
"narHash": "sha256-y2ZtlIlNTuVJUZCqzZAhIw5rrKP4DOSklev6c8PyCkQ=",
"lastModified": 1732981179,
"narHash": "sha256-F7thesZPvAMSwjRu0K8uFshTk3ZZSNAsXTIFvXBT+34=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "55d1f923c480dadce40f5231feb472e81b0bab48",
"rev": "62c435d93bf046a5396f3016472e8f7c8e2aed65",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-25.05",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-24_11": {
"nixpkgs-24_05": {
"locked": {
"lastModified": 1734083684,
"narHash": "sha256-5fNndbndxSx5d+C/D0p/VF32xDiJCJzyOqorOYW4JEo=",
"lastModified": 1717144377,
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "314e12ba369ccdb9b352a4db26ff419f7c49fa84",
"rev": "805a384895c696f802a9bf5bf4720f37385df547",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-24.11",
"ref": "nixos-24.05",
"type": "indirect"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1729973466,
"narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "cd3e8833d70618c4eea8df06f95b364b016d4950",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nvim": {
"inputs": {
"nixpkgs": [
@ -128,11 +177,11 @@
]
},
"locked": {
"lastModified": 1748077877,
"narHash": "sha256-sxWrjcRygvs7Fz9gxjSm54ul8+NtU29V+PLAPR6ZfY0=",
"lastModified": 1733261583,
"narHash": "sha256-HOVUtrhtJ16umPuEODuVE9fx+JmDCRp7wIxnEART0Eg=",
"ref": "refs/heads/master",
"rev": "b23265403c87af272c74cda484a840b0f22306f5",
"revCount": 43,
"rev": "a09a34997ce692c7a2e8e434b44433156a73088c",
"revCount": 38,
"type": "git",
"url": "https://git.project-cloud.net/asmir/nvim_flake"
},
@ -141,6 +190,28 @@
"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": [
@ -169,6 +240,7 @@
"nix-xilinx": "nix-xilinx",
"nixpkgs": "nixpkgs",
"nvim": "nvim",
"peerix": "peerix",
"project-cloud": "project-cloud",
"simple-nixos-mailserver": "simple-nixos-mailserver",
"sops-nix": "sops-nix",
@ -179,18 +251,18 @@
"simple-nixos-mailserver": {
"inputs": {
"blobs": "blobs",
"flake-compat": "flake-compat_2",
"flake-compat": "flake-compat_3",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-24_11": "nixpkgs-24_11"
"nixpkgs-24_05": "nixpkgs-24_05"
},
"locked": {
"lastModified": 1746937334,
"narHash": "sha256-7g2GSePdYbpD1v5BxEVSCJ2Ogf4K5rc9sBB81FervUY=",
"lastModified": 1722877200,
"narHash": "sha256-qgKDNJXs+od+1UbRy62uk7dYal3h98I4WojfIqMoGcg=",
"owner": "simple-nixos-mailserver",
"repo": "nixos-mailserver",
"rev": "da66510f688b7eac54e3cac7c75be4b8dd78ce8b",
"rev": "af7d3bf5daeba3fc28089b015c0dd43f06b176f2",
"type": "gitlab"
},
"original": {
@ -203,14 +275,15 @@
"inputs": {
"nixpkgs": [
"nixpkgs"
]
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1746485181,
"narHash": "sha256-PxrrSFLaC7YuItShxmYbMgSuFFuwxBB+qsl9BZUnRvg=",
"lastModified": 1729999681,
"narHash": "sha256-qm0uCtM9bg97LeJTKQ8dqV/FvqRN+ompyW4GIJruLuw=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "e93ee1d900ad264d65e9701a5c6f895683433386",
"rev": "1666d16426abe79af5c47b7c0efa82fd31bf4c56",
"type": "github"
},
"original": {
@ -239,6 +312,21 @@
"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": {
@ -278,11 +366,11 @@
]
},
"locked": {
"lastModified": 1737802495,
"narHash": "sha256-Q+bZnH7uQM5T/G+xCGSRU3bTJqD70NeE4vLXLXLCm7k=",
"lastModified": 1721120316,
"narHash": "sha256-CaAMnU6LKqJrsZmR9k0/2brpULnAekpgG5S0BjtFhaQ=",
"ref": "refs/heads/master",
"rev": "4962f12867b0b6c4c4d39b98e6016e7f925a802c",
"revCount": 23,
"rev": "8a7923bd4e5d36b186408d5432568a91ac67b695",
"revCount": 21,
"type": "git",
"url": "https://git.project-cloud.net/asmir/zremap"
},

View File

@ -2,13 +2,18 @@
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
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";
@ -30,7 +35,7 @@
};
home-manager = {
url = "github:nix-community/home-manager/release-25.05";
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
@ -45,23 +50,21 @@
};
};
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";
@ -82,6 +85,18 @@
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=";
};
}
];
};
@ -104,6 +119,18 @@
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=";
};
}
];
};
@ -125,7 +152,6 @@
}
];
};
magpie = nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux";
modules = [
@ -142,11 +168,7 @@
};
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,21 +2,12 @@
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";
@ -50,9 +41,7 @@ in
WLR_RENDERER = "vulkan";
};
wayland.windowManager.sway = {
enable = true;
};
wayland.windowManager.sway = {enable = true;};
programs = {
home-manager.enable = true;
@ -71,11 +60,7 @@ 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 = {
@ -86,9 +71,7 @@ in
hwdec = "auto";
vo = "gpu-next";
ao = "pipewire";
osd-bar = "no";
border = "no";
script-opts-set = "";
script-opts-set = "ytdl_hook-ytdl_path=yt-dlp,sponsorblock-local_database=no,sponsorblock-skip_categories=[sponsor,intro,selfpromo]";
ytdl-format = "bestvideo[height<=?1080]+bestaudio/best";
};
@ -154,14 +137,13 @@ 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";
@ -201,12 +183,8 @@ 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;
@ -214,14 +192,7 @@ 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;
@ -249,30 +220,14 @@ 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 -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
${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"
'';
in
/*
refresh_i3status = pkgs.writeShellScriptBin "refresh_i3status" ''
${pkgs.coreutils}/bin/sleep 1 && ${pkgs.procps}/bin/pkill -USR1 i3status-rs
'';
*/
{
in {
enable = true;
events = [
{
@ -283,12 +238,10 @@ in
event = "lock";
command = "${locker}/bin/swaylock_fancy";
}
/*
{
event = "after-resume";
command = "${refresh_i3status}/bin/refresh_i3status";
command = "${pkgs.procps}/bin/pkill -USR1 i3status-rs";
}
*/
];
timeouts = [
{
@ -315,17 +268,14 @@ 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";
}
];
}
@ -335,17 +285,19 @@ in
systemd.user = {
services = {
wayland-pipewire-idle-inhibit = {
Unit.Description = "inhibit sleep while audio output is active";
/*
himalaya = {
Unit.Description = "Himalaya new messages notifier";
Service = {
ExecStart = "${lib.getExe pkgs.wayland-pipewire-idle-inhibit}";
ExecStart = "himalaya notify";
Restart = "always";
RestartSec = 10;
};
Install = {
WantedBy = [ "graphical-session.target" ];
WantedBy = [ "multi-user.target" ];
};
};
*/
};
};
}

View File

@ -4,8 +4,7 @@
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/
'';
@ -15,11 +14,6 @@ let
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} $@
'';
@ -31,8 +25,7 @@ let
PROXY_PORT="1337"
${lib.getExe pkgs.openssh} -D "$PROXY_PORT" -q -N "$@"
'';
wrap_sh =
let
wrap_sh = let
bubblewrap = pkgs.callPackage ../packages/bubblewrap/default.nix {};
in
pkgs.writeShellScriptBin "wrap.sh" ''
@ -48,10 +41,8 @@ let
--tmp-overlay "$FULL_PATH" \
"$SHELL"
'';
in
{
home.packages =
with pkgs;
in {
home.packages = with pkgs;
[
anydesk
appimage-run
@ -63,11 +54,10 @@ in
cached-nix-shell
caddy
cargo
ungoogled-chromium
cmake
compsize
kdePackages.ark
ungoogled-chromium
# cura
/*cura*/
deluge
dfu-util
discord
@ -92,7 +82,7 @@ in
imv
inkscape
jellyfin-media-player
kdePackages.kdenlive
kdenlive
kicad
kodi-wayland
krita
@ -130,12 +120,12 @@ in
python3Packages.west
remmina
river
rizin
rtorrent
sbcl
screen
seer
sioyek
skypeforlinux
slurp
steam-run
stm32cubemx
@ -148,7 +138,6 @@ in
thunderbird
typst
upx
viber
waybar
wdisplays
weechat
@ -164,20 +153,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 {})
];
}

View File

@ -2,11 +2,9 @@
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;
@ -55,28 +53,24 @@ 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;
@ -87,9 +81,7 @@ in
}
{
command = "focus child, layout tabbed, focus";
criteria = {
class = "qutebrowser";
};
criteria = {class = "qutebrowser";};
}
];
};
@ -98,10 +90,7 @@ in
{
position = "top";
fonts = {
names = [
"DejaVu Sans Mono"
"FontAwesome5Free"
];
names = ["DejaVu Sans Mono" "FontAwesome5Free"];
style = "Fixed Bold SemiCondensed";
size = 7.0;
};

View File

@ -1,15 +1,4 @@
{ 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";
@ -22,16 +11,6 @@ in
};
blocks = [
{
block = "keyboard_layout";
driver = "sway";
click = [
{
cmd = "${kbd_switch}/bin/kbd_switch";
button = "left";
}
];
}
{
block = "battery";
interval = 10;
@ -56,30 +35,20 @@ in
{
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 @@ let
${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 = "";
@ -35,21 +35,15 @@ 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";};
}
];
@ -68,25 +62,16 @@ 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;
};
@ -140,14 +125,12 @@ 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+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+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+p" = "exec ${lib.getExe pkgs.tessen} -a copy";
};
};

View File

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

View File

@ -1,5 +1,4 @@
{ pkgs, lib, ... }:
{
{pkgs, ...}: {
programs.z-lua = {
enableAliases = true;
enableZshIntegration = true;
@ -8,16 +7,17 @@
programs.zsh = {
autocd = true;
enableCompletion = false;
syntaxHighlighting.enable = true;
defaultKeymap = "viins";
shellAliases = {
cfind = "${pkgs.cscope}/bin/cscope -C -R -L1";
cfind = "cscope -C -R -L1";
chmod = "chmod -v";
chown = "chown -v";
cp = "cp -v";
rm = "rm -v";
ip = "ip --color=auto";
f = "''$(${lib.getExe pkgs.pay-respects} zsh)";
f = "''$(pay-respects zsh)";
};
history = {
@ -43,8 +43,8 @@
src = pkgs.fetchFromGitHub {
owner = "sindresorhus";
repo = "pure";
rev = "92b8e9057988566b37ff695e70e2e9bbeb7196c8";
hash = "sha256-TbOrnhLHgOvcfsgmL0l3bWY33yLIhG1KSi4ITIPq1+A=";
rev = "a02209d36c8509c0e62f44324127632999c9c0cf";
hash = "sha256-BmQO4xqd/3QnpLUitD2obVxL0UulpboT8jGNEh4ri8k=";
};
file = "pure.plugin.zsh";
}
@ -63,16 +63,11 @@
};
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 = '''';
initContent = ''
initExtra = ''
# binds
bindkey '^K' fzf-file-widget
@ -92,23 +87,11 @@
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="${lib.getExe pkgs.tmux}"
TMUX_EXE="${pkgs.tmux}/bin/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,15 +6,11 @@
nvim,
system,
...
}:
{
}: {
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;
@ -25,10 +21,7 @@
boot.loader.systemd-boot.configurationLimit = 2;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = [
"ip=dhcp"
"console=tty"
];
boot.kernelParams = ["ip=dhcp"];
boot.kernel.sysctl = {
"net.core.default_qdisc" = "fq";
"net.ipv4.tcp_congestion_control" = "bbr";
@ -36,10 +29,7 @@
boot.initrd = {
compressor = "zstd";
availableKernelModules = [
"virtio-pci"
"virtio-gpu"
];
availableKernelModules = ["virtio-pci"];
systemd.enable = true;
network = {
enable = true;
@ -246,21 +236,22 @@
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";
IS_INPUT_FILE = false;
};
settings."markup.typst" = {
ENABLED = true;
FILE_EXTENSIONS = ".typ";
RENDER_COMMAND = "timeout 30s ${lib.getExe pkgs.python3Packages.pygments} -f html -O full";
IS_INPUT_FILE = false;
};
};
services.nfs.server.enable = false;
@ -295,7 +286,9 @@
adminEmail = "asmir.abdulahovic" + "@" + "gmail.com";
};
# needed for sendmail mail functionality
/*
needed for sendmail mail functionality
*/
users.users.gitea.extraGroups = ["postdrop"];
systemd.services.gitea.serviceConfig = {
RestrictAddressFamilies = ["AF_NETLINK"];
@ -333,28 +326,16 @@
};
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.nat = {
enable = true;
externalInterface = "enp1s0";
internalInterfaces = [ "wg0" ];
};
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.networkmanager.enable = true;
networking.wireless.enable = false;
@ -366,13 +347,13 @@
# 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.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
#'';
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
'';
privateKeyFile = config.sops.secrets."wg_privkey".path;
peers = [

View File

@ -5,18 +5,12 @@
lib,
modulesPath,
...
}:
{
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"xhci_pci"
"virtio_pci"
"usbhid"
"sr_mod"
];
boot.initrd.availableKernelModules = ["xhci_pci" "virtio_pci" "usbhid" "sr_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];

View File

@ -8,8 +8,7 @@
system,
nvim,
...
}:
{
}: {
imports = [];
system.stateVersion = "23.05";
@ -37,10 +36,7 @@
gc.options = "--delete-older-than 7d";
package = pkgs.nixVersions.latest;
settings = {
experimental-features = [
"nix-command"
"flakes"
];
experimental-features = ["nix-command" "flakes"];
};
};
@ -93,11 +89,7 @@
networking = {
firewall = {
enable = true;
allowedTCPPorts = [
80
443
51820
];
allowedTCPPorts = [80 443 51820];
};
hostName = "mediabox";
@ -106,10 +98,7 @@
useDHCP = false;
wireless.enable = false;
wireless.interfaces = ["wlp3s0"];
nameservers = [
"127.0.0.1"
"::1"
];
nameservers = ["127.0.0.1" "::1"];
dhcpcd.extraConfig = "nohook resolv.conf";
networkmanager.dns = "none";
extraHosts = ''
@ -196,11 +185,7 @@
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"];
};
/*
@ -345,18 +330,12 @@
}
{
keys = [122];
events = [
"key"
"rep"
];
events = ["key" "rep"];
command = "${pkgs.alsaUtils}/bin/amixer -q set Master ${config.sound.mediaKeys.volumeStep}- unmute";
}
{
keys = [123];
events = [
"key"
"rep"
];
events = ["key" "rep"];
command = "${pkgs.alsaUtils}/bin/amixer -q set Master ${config.sound.mediaKeys.volumeStep}+ unmute";
}
{
@ -459,16 +438,7 @@
users.users.akill = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [
"wireshark"
"wheel"
"kvm"
"tty"
"audio"
"sound"
"adbusers"
"transmission"
];
extraGroups = ["wireshark" "wheel" "kvm" "tty" "audio" "sound" "adbusers" "transmission"];
openssh.authorizedKeys.keys = [
(builtins.readFile ../nixy/ssh_pubkey)
];
@ -477,16 +447,7 @@
users.users.ado = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [
"wireshark"
"wheel"
"kvm"
"tty"
"audio"
"sound"
"adbusers"
"transmission"
];
extraGroups = ["wireshark" "wheel" "kvm" "tty" "audio" "sound" "adbusers" "transmission"];
};
users.users.mediauser = {

View File

@ -5,20 +5,12 @@
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.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
@ -26,11 +18,7 @@
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";
@ -38,41 +26,25 @@
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;
};

View File

@ -2,8 +2,7 @@
config,
pkgs,
...
}:
{
}: {
# Enable Nginx
services.nginx = {
enable = true;

View File

@ -4,13 +4,11 @@
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;
@ -112,10 +110,7 @@ in
};
};
users.groups = mkIf (cfg.group == "qbittorrent") {
qbittorrent = {
gid = null;
};
};
users.groups =
mkIf (cfg.group == "qbittorrent") {qbittorrent = {gid = null;};};
};
}

View File

@ -6,17 +6,13 @@
system,
zremap,
...
}:
let
USER = "akill";
in
{
}: {
imports = [];
system.stateVersion = "23.05";
system.autoUpgrade.enable = false;
system.switch = {
enable = true;
enable = false;
enableNg = true;
};
@ -48,12 +44,12 @@ in
"borgbase_enc_key" = {
sopsFile = ./secrets/borgbase_enc_key.yaml;
owner = config.users.users.${USER}.name;
owner = config.users.users.akill.name;
};
"borgbase_ssh_key" = {
sopsFile = ./secrets/borgbase_ssh_key.yaml;
owner = config.users.users.${USER}.name;
owner = config.users.users.akill.name;
};
};
};
@ -65,30 +61,18 @@ in
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.systemd.enable = true;
binfmt.emulatedSystems = [
"wasm32-wasi"
"x86_64-windows"
];
kernelParams = [
"psmouse.synaptics_intertouch=0"
"mem_sleep_default=deep"
];
#kernelPackages = pkgs.linuxPackages_latest;
binfmt.emulatedSystems = ["wasm32-wasi" "x86_64-windows"];
kernelPackages = pkgs.linuxPackages_latest;
kernelParams = ["psmouse.synaptics_intertouch=0" "mem_sleep_default=deep"];
kernel.sysctl = {
"net.core.default_qdisc" = "fq";
"net.ipv4.tcp_congestion_control" = "bbr";
@ -100,9 +84,7 @@ in
memtest86.enable = true;
};
readOnlyNixStore = true;
supportedFilesystems = [
"xfs"
];
supportedFilesystems = ["f2fs" "xfs"];
tmp.useTmpfs = true;
};
@ -113,7 +95,7 @@ in
doas.enable = true;
doas.extraRules = [
{
users = [ USER ];
users = ["akill"];
keepEnv = true;
persist = true;
}
@ -125,22 +107,13 @@ in
};
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 = ''
@ -202,10 +175,7 @@ in
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 = ''
@ -236,13 +206,6 @@ in
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;
@ -297,9 +260,7 @@ in
${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" \
@ -368,7 +329,6 @@ in
};
};
coredump.enable = false;
extraConfig = ''
DefaultTimeoutStartSec=30s
DefaultTimeoutStopSec=30s
@ -379,7 +339,6 @@ in
acpid.enable = true;
dbus.enable = true;
dbus.implementation = "broker";
envfs.enable = true;
fstrim.enable = true;
fwupd.enable = true;
ntp.enable = true;
@ -412,10 +371,7 @@ in
};
udev = {
packages = [
pkgs.openhantek6022
pkgs.openocd
];
packages = [pkgs.openhantek6022 pkgs.openocd];
extraRules = ''
#Xilinx FTDI
ACTION=="add", ATTR{idVendor}=="0403", ATTR{manufacturer}=="Xilinx", MODE:="666"
@ -446,27 +402,21 @@ in
enable = true;
bindings = [
{
keys = [ 115 ];
keys = [113];
events = ["key"];
command = "XDG_RUNTIME_DIR=/run/user/$(id -u ${USER}) ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master toggle'";
}
{
keys = [114];
events = [
"key"
"rep"
];
command = "XDG_RUNTIME_DIR=/run/user/$(id -u ${USER}) ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
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 = [115];
events = ["key" "rep"];
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master 5%+ unmute'";
}
{
@ -497,18 +447,16 @@ in
"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";
cache_file = "public-resolvers.md";
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
};
};
};
borgbackup.jobs."borgbase" =
let
user = config.users.users.${USER};
borgbackup.jobs."borgbase" = let
user = config.users.users.akill;
home = user.home;
in
{
in {
user = user.name;
paths = [
(home + "/pic/priv")
@ -599,14 +547,6 @@ in
};
virtualisation = {
waydroid.enable = false;
libvirtd = {
enable = true;
allowedBridges = [
"virbr0"
"br0"
];
};
spiceUSBRedirection.enable = true;
containers.storage.settings = {
storage = {
@ -643,18 +583,9 @@ in
algorithm = "zstd";
};
users.users.${USER} = {
users.users.akill = {
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,60 +1,39 @@
# 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

@ -115,8 +115,7 @@ stdenv.mkDerivation {
xorg.libxkbfile
];
installPhase =
let
installPhase = let
viberWrap = writeShellScriptBin "viberWrap" ''
${bubblewrap}/bin/bwrap --bind / / \
--dev /dev \
@ -125,8 +124,7 @@ stdenv.mkDerivation {
--bind $HOME/Downloads/ $HOME/Downloads \
$@
'';
in
''
in ''
dpkg-deb -x $src $out
mkdir -p $out/bin