55 Commits

Author SHA1 Message Date
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
09bf9a3b17 flake: update nvim 2024-12-04 16:36:26 +01:00
0b069d7277 home/git: set defaultbranch to master 2024-12-04 15:22:01 +01:00
e3673902e2 home_packages: add typst 2024-12-03 23:13:07 +01:00
a9f02a8462 magpie/gitea: use unix socket for local connection 2024-12-03 16:02:53 +01:00
3f5747d8e0 nixy/fonts: update and add more fonts 2024-12-03 16:01:21 +01:00
da2c2dcd8c nixy/avahi: enable service 2024-12-03 16:01:05 +01:00
fca1cd048e home/zsh: add pay-respects alias; remove fast_syntax_highlight plugin 2024-12-03 15:59:57 +01:00
d1f26e838d home_packages: add sbcl, pay-respects; libreoffice -> libreoffice-qt6-fresh 2024-12-02 22:20:12 +01:00
5440679d16 switch nixpkgs to 24.11 2024-12-02 22:16:51 +01:00
fa1392dce8 home_packages: add weechat 2024-11-11 16:20:56 +01:00
0751e0ac30 nixy/fonts: noto-fonts-cjk -> noto-fonts-cjk-sans 2024-11-07 12:33:55 +01:00
a2cf986bc4 nixy/virtualisation: enable spice usb redirection 2024-11-07 12:33:17 +01:00
0a95372a68 nixy: iproute -> iproute2 2024-11-05 17:19:40 +01:00
ecf5065588 home_packages: add tectonic 2024-10-29 17:40:27 +01:00
bb6f0ab772 env/firejail: add qutebrowser.local profile 2024-10-15 04:20:40 +02:00
90f939e056 home/sway: bin/<name> -> lib.getExe 2024-10-15 04:16:58 +02:00
8740cc57fe home/sway: add tessen shortcut 2024-10-15 04:03:50 +02:00
f7eda08683 home_packages: add wrapper to qcad to use xcb as QT_QPA_PLATFORM 2024-10-08 11:56:47 +02:00
15e60767b6 flake: update 2024-10-07 16:07:09 +02:00
d9d0ccaed5 home_packages: add fpga, cad related and other utils 2024-10-07 16:05:28 +02:00
2818f61e28 all: pkgs.chromium -> pkgs.ungoogled-chromium 2024-09-14 16:29:56 +02:00
b1d4994f92 home/sway: format 2024-09-09 00:35:59 +02:00
4b6e99130b home/env: set NIXOS_OZONE_WL to 1 2024-09-03 11:48:53 +02:00
a2458211e3 magpie/nextcloud: disable 2024-09-02 22:59:14 +02:00
1f15bf221b magpie/initrd: fix networking with systemd-enabled initrd 2024-09-02 22:59:00 +02:00
908c352932 magpie/goatcounter: move to builting nixos module 2024-09-02 22:57:53 +02:00
db9139a08c flake: update 2024-09-02 21:50:43 +02:00
54e4e82dc7 magpie: use systemd in initrd, enable switchNg for nix 2024-09-02 21:50:34 +02:00
23 changed files with 1036 additions and 791 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";

215
flake.lock generated
View File

@@ -19,11 +19,11 @@
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"lastModified": 1732722421,
"narHash": "sha256-HRJ/18p+WoXpWJkcdsk9St5ZiukCqSDgbOGFa8Okehg=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"rev": "9ed2ac151eada2306ca8c418ebd97807bb08f6ac",
"type": "github"
},
"original": {
@@ -33,22 +33,6 @@
}
},
"flake-compat_2": {
"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-compat_3": {
"flake": false,
"locked": {
"lastModified": 1673956053,
@@ -64,7 +48,7 @@
"type": "github"
}
},
"flake-compat_4": {
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@@ -80,39 +64,6 @@
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1701473968,
"narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-root": {
"locked": {
"lastModified": 1692742795,
"narHash": "sha256-f+Y0YhVCIJ06LemO+3Xx00lIcqQxSKJHXT/yk1RTKxw=",
"owner": "srid",
"repo": "flake-root",
"rev": "d9a70d9c7a5fd7f3258ccf48da9335e9b47c3937",
"type": "github"
},
"original": {
"owner": "srid",
"repo": "flake-root",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@@ -131,30 +82,6 @@
"type": "github"
}
},
"goatcounter": {
"inputs": {
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"flake-root": "flake-root",
"nixpkgs": [
"nixpkgs"
],
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1705880453,
"narHash": "sha256-Y1O6tia2Pc1MA5ZoFH3B2y7FwjZuIDiNT4C9+bBawrY=",
"owner": "asmir-abdulahovic",
"repo": "goatcounter-flake",
"rev": "f912ab7024cbc47d5fa80a416b643707a9b50b06",
"type": "github"
},
"original": {
"owner": "asmir-abdulahovic",
"repo": "goatcounter-flake",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -162,32 +89,33 @@
]
},
"locked": {
"lastModified": 1722630065,
"narHash": "sha256-QfM/9BMRkCmgWzrPDK+KbgJOUlSJnfX4OvsUupEUZvA=",
"lastModified": 1736373539,
"narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "afc892db74d65042031a093adb6010c4c3378422",
"rev": "bd65bc3cde04c16755955630b344bc9e35272c56",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.11",
"repo": "home-manager",
"type": "github"
}
},
"nix-xilinx": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1699035130,
"narHash": "sha256-emK4aJCC2gW94b2P3N2LjkQ6PEMLUcDduVWwYQ7aq+o=",
"lastModified": 1732892167,
"narHash": "sha256-AZ0rgM9xj+Bf2C8RfGMUvuVdcqkvQU5/Wm8u6A5xYJg=",
"owner": "asmir.abdulahovic",
"repo": "nix-xilinx",
"rev": "0323990db46c32e361e4fd70600d859eb90862af",
"rev": "3071f40914fe2db3837a40a72a97af6f0a442f16",
"type": "gitlab"
},
"original": {
@@ -198,69 +126,35 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1722630782,
"narHash": "sha256-hMyG9/WlUi0Ho9VkRrrez7SeNlDzLxalm9FwY7n/Noo=",
"lastModified": 1738574474,
"narHash": "sha256-rvyfF49e/k6vkrRTV4ILrWd92W+nmBDfRYZgctOyolQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d04953086551086b44b6f3c6b7eeb26294f207da",
"rev": "fecfeb86328381268e29e998ddd3ebc70bbd7f7c",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-24_05": {
"nixpkgs-24_11": {
"locked": {
"lastModified": 1717144377,
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=",
"lastModified": 1734083684,
"narHash": "sha256-5fNndbndxSx5d+C/D0p/VF32xDiJCJzyOqorOYW4JEo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "805a384895c696f802a9bf5bf4720f37385df547",
"rev": "314e12ba369ccdb9b352a4db26ff419f7c49fa84",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-24.05",
"ref": "nixos-24.11",
"type": "indirect"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1701253981,
"narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1721524707,
"narHash": "sha256-5NctRsoE54N86nWd0psae70YSLfrOek3Kv1e8KoXe/0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "556533a23879fc7e5f98dd2e0b31a6911a213171",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nvim": {
"inputs": {
"nixpkgs": [
@@ -268,11 +162,11 @@
]
},
"locked": {
"lastModified": 1718784775,
"narHash": "sha256-tKanhhqgHdMBWS8KZ+ZYsefrQ8ipVn8NbXlSciaNc+c=",
"lastModified": 1736528609,
"narHash": "sha256-p0tYmTVnnFghamXEXD4w/lldCi604zIWDV4Ol9ubQ5g=",
"ref": "refs/heads/master",
"rev": "e3c064d3a995fe81731c8df7664d48b1106a707b",
"revCount": 33,
"rev": "8245a48cc75cc74dea1b3ca89cb58f24f8e14f85",
"revCount": 42,
"type": "git",
"url": "https://git.project-cloud.net/asmir/nvim_flake"
},
@@ -283,7 +177,7 @@
},
"peerix": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
@@ -312,11 +206,11 @@
"theme_deepthought": "theme_deepthought"
},
"locked": {
"lastModified": 1705870326,
"narHash": "sha256-ojdGSeqztnnGMyLKjnSCGq0muGh3U+Zb9iwzaaDsaF4=",
"lastModified": 1729077289,
"narHash": "sha256-z5LEPxOJq2LjhPhY4QE1IOt0lBD39cipR6Lw8vRTNlI=",
"ref": "refs/heads/master",
"rev": "ad6af66a6142279789db8967b285eb04c6d18c02",
"revCount": 26,
"rev": "eab712e42139d33911ba767c2ff1bfbdf05c254d",
"revCount": 27,
"type": "git",
"url": "https://git.project-cloud.net/asmir/project-cloud"
},
@@ -327,7 +221,6 @@
},
"root": {
"inputs": {
"goatcounter": "goatcounter",
"home-manager": "home-manager",
"nix-xilinx": "nix-xilinx",
"nixpkgs": "nixpkgs",
@@ -343,18 +236,18 @@
"simple-nixos-mailserver": {
"inputs": {
"blobs": "blobs",
"flake-compat": "flake-compat_4",
"flake-compat": "flake-compat_3",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-24_05": "nixpkgs-24_05"
"nixpkgs-24_11": "nixpkgs-24_11"
},
"locked": {
"lastModified": 1721121314,
"narHash": "sha256-zwc7YXga/1ppaZMWFreZykXtFwBgXodxUZiUx969r+g=",
"lastModified": 1737736848,
"narHash": "sha256-VrUfCXBXYV+YmQ2OvVTeML9EnmaPRtH+POrNIcJp6yo=",
"owner": "simple-nixos-mailserver",
"repo": "nixos-mailserver",
"rev": "059b50b2e729729ea00c6831124d3837c494f3d5",
"rev": "6b425d13f5a9d73cb63973d3609acacef4d1e261",
"type": "gitlab"
},
"original": {
@@ -367,15 +260,14 @@
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
]
},
"locked": {
"lastModified": 1722114803,
"narHash": "sha256-s6YhI8UHwQvO4cIFLwl1wZ1eS5Cuuw7ld2VzUchdFP0=",
"lastModified": 1738291974,
"narHash": "sha256-wkwYJc8cKmmQWUloyS9KwttBnja2ONRuJQDEsmef320=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "eb34eb588132d653e4c4925d862f1e5a227cc2ab",
"rev": "4c1251904d8a08c86ac6bc0d72cc09975e89aef7",
"type": "github"
},
"original": {
@@ -451,27 +343,6 @@
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"goatcounter",
"nixpkgs"
]
},
"locked": {
"lastModified": 1702461037,
"narHash": "sha256-ssyGxfGHRuuLHuMex+vV6RMOt7nAo07nwufg9L5GkLg=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "d06b70e5163a903f19009c3f97770014787a080f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"zremap": {
"inputs": {
"nixpkgs": [
@@ -479,11 +350,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"
},

259
flake.nix
View File

@@ -2,7 +2,7 @@
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nix-xilinx = {
url = "gitlab:asmir.abdulahovic/nix-xilinx";
@@ -34,13 +34,8 @@
inputs.nixpkgs.follows = "nixpkgs";
};
goatcounter = {
url = "github:asmir-abdulahovic/goatcounter-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
@@ -55,132 +50,138 @@
};
};
outputs = inputs @ {
goatcounter,
home-manager,
nixpkgs,
nix-xilinx,
nvim,
peerix,
project-cloud,
simple-nixos-mailserver,
sops-nix,
swaysw,
zremap,
...
}: let
pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgs;
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;}
./common/packages.nix
./common/suspend.nix
./nixy/configuration.nix
./nixy/hardware-configuration.nix
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.akill = import ./home/home.nix;
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=";
};
}
];
outputs =
inputs@{
home-manager,
nixpkgs,
nix-xilinx,
nvim,
peerix,
project-cloud,
simple-nixos-mailserver,
sops-nix,
swaysw,
zremap,
...
}:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgs;
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; }
./common/packages.nix
./common/suspend.nix
./nixy/configuration.nix
./nixy/hardware-configuration.nix
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.akill = import ./home/home.nix;
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; }
./common/packages.nix
./common/suspend.nix
./mediabox/configuration.nix
./mediabox/hardware-configuration.nix
./modules/qbittorrent.nix
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
{
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=";
};
}
];
};
blue = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
{ _module.args = inputs; }
{ _module.args.system = system; }
{ nix.registry.nixpkgs.flake = nixpkgs; }
./blue/configuration.nix
./blue/hardware-configuration.nix
./common/packages.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.akill = import ./home/home.nix;
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; }
./magpie/configuration.nix
./magpie/hardware-configuration.nix
simple-nixos-mailserver.nixosModule
sops-nix.nixosModules.sops
(builtins.toPath "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix")
];
};
};
mediabox = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
{_module.args = inputs;}
{_module.args.system = system;}
{nix.registry.nixpkgs.flake = nixpkgs;}
./common/packages.nix
./common/suspend.nix
./mediabox/configuration.nix
./mediabox/hardware-configuration.nix
./modules/qbittorrent.nix
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
{
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=";
};
}
devShell.x86_64-linux = pkgs.mkShell {
buildInputs = with pkgs; [
sops
ssh-to-age
age
];
shellHook = ''
echo "Configuring NixOS!"
'';
};
blue = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
{_module.args = inputs;}
{_module.args.system = system;}
{nix.registry.nixpkgs.flake = nixpkgs;}
./blue/configuration.nix
./blue/hardware-configuration.nix
./common/packages.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.akill = import ./home/home.nix;
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;}
./magpie/configuration.nix
./magpie/hardware-configuration.nix
goatcounter.nixosModules.goatcounter
simple-nixos-mailserver.nixosModule
sops-nix.nixosModules.sops
(builtins.toPath "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix")
];
};
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
};
devShell.x86_64-linux = pkgs.mkShell {
buildInputs = with pkgs; [sops ssh-to-age age];
shellHook = ''
echo "Configuring NixOS!"
'';
};
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
};
}

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";
@@ -35,12 +44,15 @@ in {
EDITOR = "nvim";
_JAVA_AWT_WM_NONREPARENTING = "1";
MOZ_ENABLE_WAYLAND = "1";
NIXOS_OZONE_WL = "1";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
SUDO_EDITOR = "nvim";
WLR_RENDERER = "vulkan";
};
wayland.windowManager.sway = {enable = true;};
wayland.windowManager.sway = {
enable = true;
};
programs = {
home-manager.enable = true;
@@ -59,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 = {
@@ -136,7 +152,9 @@ in {
font = "JetBrainsMono:size=10";
dpi-aware = "yes";
};
mouse = {hide-when-typing = "yes";};
mouse = {
hide-when-typing = "yes";
};
};
};
@@ -181,8 +199,13 @@ in {
userName = "Asmir A";
userEmail = "asmir.abdulahovic@gmail.com";
extraConfig = {
pull = {rebase = true;};
credential = {helper = "store";};
init.defaultBranch = "master";
pull = {
rebase = true;
};
credential = {
helper = "store";
};
};
signing.key = "020C42B7A9ABA3E2";
signing.signByDefault = true;
@@ -190,7 +213,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;
@@ -218,36 +248,39 @@ in {
enableSshSupport = true;
};
swayidle = let
locker = pkgs.writeShellScriptBin "swaylock_fancy" ''
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"
'';
in {
enable = true;
events = [
{
event = "before-sleep";
command = "${locker}/bin/swaylock_fancy";
}
{
event = "lock";
command = "${locker}/bin/swaylock_fancy";
}
{
event = "after-resume";
command = "${pkgs.procps}/bin/pkill -USR1 i3status-rs";
}
];
timeouts = [
{
timeout = 15 * 60;
command = "${locker}/bin/swaylock_fancy";
}
];
};
swayidle =
let
locker = pkgs.writeShellScriptBin "swaylock_fancy" ''
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/shred "$TMP_FILE"
${pkgs.coreutils}/bin/rm "$TMP_FILE"
'';
in
{
enable = true;
events = [
{
event = "before-sleep";
command = "${locker}/bin/swaylock_fancy";
}
{
event = "lock";
command = "${locker}/bin/swaylock_fancy";
}
{
event = "after-resume";
command = "${pkgs.procps}/bin/pkill -USR1 i3status-rs";
}
];
timeouts = [
{
timeout = 15 * 60;
command = "${locker}/bin/swaylock_fancy";
}
];
};
kanshi = {
enable = true;
@@ -266,14 +299,17 @@ in {
profile.outputs = [
{
criteria = "eDP-1";
position = "3840,0";
}
{
criteria = "Philips Consumer Electronics Company PHL 272S1 UHB2347026536";
mode = "1920x1080@74.973Hz";
position = "5760,0";
}
{
criteria = "Philips Consumer Electronics Company PHL 272S1 UHB2347026535";
mode = "1920x1080@74.973Hz";
position = "7680,0";
}
];
}
@@ -283,19 +319,17 @@ in {
systemd.user = {
services = {
/*
himalaya = {
Unit.Description = "Himalaya new messages notifier";
Service = {
ExecStart = "himalaya notify";
Restart = "always";
RestartSec = 10;
wayland-pipewire-idle-inhibit = {
Unit.Description = "inhibit sleep while audio output is active";
Service = {
ExecStart = "${lib.getExe pkgs.wayland-pipewire-idle-inhibit}";
Restart = "always";
RestartSec = 10;
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
Install = {
WantedBy = [ "multi-user.target" ];
};
};
*/
};
};
}

View File

@@ -4,15 +4,19 @@
inputs,
system,
...
}: let
}:
let
chromium_teams = pkgs.writeShellScriptBin "chromium_teams" ''
${lib.getExe pkgs.chromium} --socket=wayland org.chromium.Chromium --app=https://teams.microsoft.com/
${lib.getExe pkgs.ungoogled-chromium} --socket=wayland org.chromium.Chromium --app=https://teams.microsoft.com/
'';
chromium_discord = pkgs.writeShellScriptBin "chromium_discord" ''
${lib.getExe pkgs.chromium} --socket=wayland org.chromium.Chromium --app=https://discordapp.com/channels/@me
${lib.getExe pkgs.ungoogled-chromium} --socket=wayland org.chromium.Chromium --app=https://discordapp.com/channels/@me
'';
chromium_stackfield = pkgs.writeShellScriptBin "chromium_stackfield" ''
${lib.getExe pkgs.chromium} --socket=wayland org.chromium.Chromium --app=https://stackfield.com/
${lib.getExe pkgs.ungoogled-chromium} --socket=wayland org.chromium.Chromium --app=https://stackfield.com/
'';
qcad = pkgs.writeShellScriptBin "qcad" ''
QT_QPA_PLATFORM=xcb ${lib.getExe pkgs.qcad} $@
'';
ssh_proxy = pkgs.writeShellScriptBin "ssh_proxy" ''
if ${pkgs.coreutils}/bin/test $# -ne 1; then
@@ -22,9 +26,10 @@
PROXY_PORT="1337"
${lib.getExe pkgs.openssh} -D "$PROXY_PORT" -q -N "$@"
'';
wrap_sh = let
bubblewrap = pkgs.callPackage ../packages/bubblewrap/default.nix {};
in
wrap_sh =
let
bubblewrap = pkgs.callPackage ../packages/bubblewrap/default.nix { };
in
pkgs.writeShellScriptBin "wrap.sh" ''
if ${pkgs.coreutils-full}/bin/test $# -ne 1; then
echo "Usage: $0 <directory>"
@@ -38,8 +43,10 @@
--tmp-overlay "$FULL_PATH" \
"$SHELL"
'';
in {
home.packages = with pkgs;
in
{
home.packages =
with pkgs;
[
anydesk
appimage-run
@@ -51,13 +58,15 @@ in {
cached-nix-shell
caddy
cargo
chromium
ungoogled-chromium
cmake
compsize
/*cura*/
# cura
deluge
dfu-util
discord
dmenu-wayland
drawio
dualsensectl
ffmpeg-full
firefox
@@ -70,7 +79,9 @@ in {
gnumake
go
grim
heimdall
hyperfine
icestorm
imagemagick
imv
inkscape
@@ -80,35 +91,42 @@ in {
kodi-wayland
krita
libnotify
libreoffice
libreoffice-qt6-fresh
libva-utils
linuxPackages_latest.perf
lsix
lsix
mediainfo
ncdu
neovide
nextpnr
ngspice
nix-init
nixpkgs-fmt
nix-prefetch-git
nodePackages.peerflix
nom
openems
openocd
openscad
pandoc
paraview
pass-wayland
patchelf
pavucontrol
pwvucontrol
pay-respects
pirate-get
poppler_utils
powertop
pulsemixer
pwvucontrol
python3
python3Packages.west
remmina
river
rizin
rtorrent
sbcl
screen
seer
sioyek
@@ -119,12 +137,15 @@ in {
swayimg
tea
teams-for-linux
tectonic
tessen
texlive.combined.scheme-full
thunderbird
typst
upx
waybar
wdisplays
weechat
whatsapp-for-linux
wine
wireshark
@@ -133,10 +154,11 @@ in {
wofi
x2goclient
yewtube
yosys
yt-dlp
zapzap
zathura
/*zeal-qt6*/
# zeal-qt6
zig
]
++ [
@@ -145,10 +167,11 @@ in {
chromium_teams
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/viber/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,5 @@
{...}: {
{ ... }:
{
programs.i3status-rust = {
bars.top = {
icons = "awesome5";

View File

@@ -1,31 +1,34 @@
{
config,
pkgs,
inputs,
system,
lib,
...
}: let
}:
let
cliphist_sway = pkgs.writeShellScriptBin "cliphist_sway" ''
${pkgs.cliphist}/bin/cliphist list | \
${pkgs.wofi}/bin/wofi --dmenu --insensitive | \
${pkgs.cliphist}/bin/cliphist decode | \
${lib.getExe pkgs.cliphist} list | \
${lib.getExe pkgs.wofi} --dmenu --insensitive | \
${lib.getExe pkgs.cliphist} decode | \
${pkgs.wl-clipboard}/bin/wl-copy
'';
screenshot_clip = pkgs.writeShellScriptBin "screenshot_clip" ''
GEOM="$(${pkgs.slurp}/bin/slurp -d)"
${pkgs.grim}/bin/grim -g "$GEOM" - | ${pkgs.wl-clipboard}/bin/wl-copy
GEOM="$(${lib.getExe pkgs.slurp} -d)"
${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 {};
viber = pkgs.callPackage ../packages/viber/default.nix { };
term = "${pkgs.foot}/bin/footclient";
in {
in
{
wayland.windowManager.sway = {
enable = true;
extraSessionCommands = "";
extraConfigEarly = '''';
config = {
fonts = {
names = ["JetBrainsMono"];
names = [ "JetBrainsMono" ];
style = "Bold Semi-Condensed";
size = 11.0;
};
@@ -33,15 +36,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";
};
}
];
@@ -49,8 +58,8 @@ in {
output = {
eDP-1 = {
/*
bg = "~/pic/wallpaper stretch";
scale = "1.4";
bg = "~/pic/wallpaper stretch";
scale = "1.4";
*/
};
@@ -60,20 +69,29 @@ 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;
};
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ~/.config/i3status-rust/config-top.toml";
statusCommand = "${lib.getExe pkgs.i3status-rust} ~/.config/i3status-rust/config-top.toml";
}
];
@@ -120,15 +138,18 @@ in {
"Alt+slash" = "exec ${pkgs.moreutils}/bin/lckdo swaysw ${swaysw}/bin/swaysw";
"Alt+Escape" = "workspace back_and_forth";
"Alt+f" = "fullscreen enable";
"Alt+bracketright" = "focus output right";
"Alt+bracketleft" = "focus output left";
"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 ${pkgs.python3}/bin/python3'';
"Mod4+h" = "exec ${pkgs.sway}/bin/swaymsg [app_id=com.rtosta.zapzap] scratchpad show || exec ${pkgs.zapzap}/bin/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 ${pkgs.pulsemixer}/bin/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 ${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,16 +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 = "''$(${lib.getExe pkgs.pay-respects} zsh)";
};
history = {
@@ -37,18 +38,13 @@
src = pkgs.nix-zsh-completions;
file = "share/zsh/plugins/nix/nix-zsh-completions.plugin.zsh";
}
{
name = "fast_syntax_highlight";
src = pkgs.zsh-fast-syntax-highlighting;
file = "share/zsh/site-functions/fast-syntax-highlighting.plugin.zsh";
}
{
name = "pure_prompt";
src = pkgs.fetchFromGitHub {
owner = "sindresorhus";
repo = "pure";
rev = "a02209d36c8509c0e62f44324127632999c9c0cf";
hash = "sha256-BmQO4xqd/3QnpLUitD2obVxL0UulpboT8jGNEh4ri8k=";
rev = "92b8e9057988566b37ff695e70e2e9bbeb7196c8";
hash = "sha256-TbOrnhLHgOvcfsgmL0l3bWY33yLIhG1KSi4ITIPq1+A=";
};
file = "pure.plugin.zsh";
}
@@ -67,41 +63,58 @@
};
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 = ''
# binds
bindkey '^K' fzf-file-widget
# binds
bindkey '^K' fzf-file-widget
# options
setopt nobeep
setopt nopromptcr
setopt c_bases
setopt completeinword
setopt completealiases
setopt notify
# options
setopt nobeep
setopt nopromptcr
setopt c_bases
setopt completeinword
setopt completealiases
setopt notify
#
RPS1=""
#
RPS1=""
#
function chpwd() {
ls;
}
#
function chpwd() {
ls;
}
eval "$(direnv hook zsh)"
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
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))}}
}
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
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
function chpwd-osc7-pwd() {
(( ZSH_SUBSHELL )) || osc7-pwd
}
add-zsh-hook -Uz chpwd chpwd-osc7-pwd
if [[ -n "$BUBBLEWRAP_DIR" ]]; then
RPS1="{{$BUBBLEWRAP_DIR}}"
fi
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}"
systemd-run --scope --user $TMUX_EXE attach-session -t $USER || systemd-run --scope --user $TMUX_EXE new-session -s $USER
fi
if [[ -n "$BUBBLEWRAP_DIR" ]]; then
RPS1="{{$BUBBLEWRAP_DIR}}"
fi
'';
};
}

View File

@@ -3,21 +3,32 @@
pkgs,
lib,
project-cloud,
goatcounter,
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;
};
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.systemd-boot.configurationLimit = 2;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = [
"ip=dhcp"
"console=tty"
];
boot.kernel.sysctl = {
"net.core.default_qdisc" = "fq";
"net.ipv4.tcp_congestion_control" = "bbr";
@@ -25,14 +36,17 @@
boot.initrd = {
compressor = "zstd";
availableKernelModules = ["virtio-pci"];
availableKernelModules = [
"virtio-pci"
"virtio-gpu"
];
systemd.enable = true;
network = {
enable = true;
udhcpc.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 ];
};
};
};
@@ -52,7 +66,6 @@
fzf
fzy
git
goatcounter.packages.${system}.goatcounter
nvim.packages.${system}.nvim
htop-vim
nvim
@@ -71,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;
@@ -81,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";
@@ -114,14 +127,9 @@
services.goatcounter = {
enable = true;
environmentFile = "/var/lib/goatcounter.env";
extraArgs = ["-listen='*:8002'" "-tls=proxy"];
database = {
backend = "sqlite";
name = "goatcounter";
user = "goatcounter";
automigrate = true;
};
port = 8002;
proxy = true;
address = "127.0.0.1";
};
services.nextcloud = {
@@ -171,12 +179,14 @@
root = "${project-cloud.packages.${system}.default}/public";
};
virtualHosts.${config.services.nextcloud.hostName} = {
quic = true;
http3 = true;
forceSSL = true;
enableACME = true;
};
/*
virtualHosts.${config.services.nextcloud.hostName} = {
quic = true;
http3 = true;
forceSSL = true;
enableACME = true;
};
*/
virtualHosts."miniflux.project-cloud.net" = {
quic = true;
@@ -194,7 +204,7 @@
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${toString config.services.gitea.settings.server.HTTP_PORT}";
proxyPass = "http://unix:${toString config.services.gitea.settings.server.HTTP_ADDR}";
};
};
@@ -222,6 +232,7 @@
DISABLE_SSH = true;
HTTP_PORT = 3001;
LANDING_PAGE = "explore";
PROTOCOL = "http+unix";
};
settings.mailer = {
ENABLED = true;
@@ -235,15 +246,21 @@
REGISTER_EMAIL_CONFIRM = true;
};
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.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;
};
};
services.nfs.server.enable = false;
@@ -261,7 +278,7 @@
paths = [
"/var/lib/gitea"
];
exclude = [];
exclude = [ ];
repo = "ssh://na9fqv67@na9fqv67.repo.borgbase.com/./repo";
encryption = {
mode = "repokey-blake2";
@@ -278,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;
};
@@ -293,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;
@@ -308,41 +323,55 @@
sopsFile = ./secrets/gitea_db.yaml;
owner = config.users.users.gitea.name;
};
"nextcloud_admin" = {
sopsFile = ./secrets/nextcloud_admin.yaml;
owner = config.users.users.nextcloud.name;
};
/*
"nextcloud_admin" = {
sopsFile = ./secrets/nextcloud_admin.yaml;
owner = config.users.users.nextcloud.name;
};
*/
};
};
networking.hostName = "magpie";
networking.firewall = {
nftables.enable = true;
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
${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
# This undoes the above command, TODO fix command below to be more specific
postShutdown = ''
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -o eth0 -j MASQUERADE
${pkgs.nftables}/bin/nft flush table ip nat
'';
privateKeyFile = config.sops.secrets."wg_privkey".path;
@@ -350,17 +379,17 @@
{
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

@@ -8,13 +8,14 @@
system,
nvim,
...
}: {
imports = [];
}:
{
imports = [ ];
system.stateVersion = "23.05";
system.autoUpgrade.enable = false;
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 +37,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,7 +72,7 @@
memtest86.enable = true;
};
readOnlyNixStore = true;
supportedFilesystems = ["btrfs"];
supportedFilesystems = [ "btrfs" ];
tmp.useTmpfs = true;
tmp.tmpfsSize = "80%";
};
@@ -89,7 +93,11 @@
networking = {
firewall = {
enable = true;
allowedTCPPorts = [80 443 51820];
allowedTCPPorts = [
80
443
51820
];
};
hostName = "mediabox";
@@ -97,8 +105,11 @@
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 = ''
@@ -112,13 +123,13 @@
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 +141,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 = {
@@ -153,13 +164,13 @@
systemd = {
services = {
"macchanger-wireless" = {
after = ["sys-subsystem-net-devices-wlp3s0.device"];
before = ["network-pre.target"];
bindsTo = ["sys-subsystem-net-devices-wlp3s0.device"];
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"];
wantedBy = [ "multi-user.target" ];
wants = [ "network-pre.target" ];
script = ''
${pkgs.macchanger}/bin/macchanger -e wlp3s0 || true
'';
@@ -168,8 +179,8 @@
"zremap" = {
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 = ''
sleep 1
@@ -180,26 +191,30 @@
"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
'';
serviceConfig.Type = "oneshot";
};
"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
'';
serviceConfig.Type = "oneshot";
};
*/
};
};
@@ -313,39 +328,45 @@
windowManager.icewm.enable = true;
};
udev.packages = [];
udev.packages = [ ];
tlp = {
enable = true;
settings = {};
settings = { };
};
actkbd = {
enable = true;
bindings = [
{
keys = [121];
events = ["key"];
keys = [ 121 ];
events = [ "key" ];
command = "${pkgs.alsaUtils}/bin/amixer -q set Master toggle";
}
{
keys = [122];
events = ["key" "rep"];
keys = [ 122 ];
events = [
"key"
"rep"
];
command = "${pkgs.alsaUtils}/bin/amixer -q set Master ${config.sound.mediaKeys.volumeStep}- unmute";
}
{
keys = [123];
events = ["key" "rep"];
keys = [ 123 ];
events = [
"key"
"rep"
];
command = "${pkgs.alsaUtils}/bin/amixer -q set Master ${config.sound.mediaKeys.volumeStep}+ unmute";
}
{
keys = [224];
events = ["key"];
keys = [ 224 ];
events = [ "key" ];
command = "/run/current-system/sw/bin/light -U 5";
}
{
keys = [225];
events = ["key"];
keys = [ 225 ];
events = [ "key" ];
command = "/run/current-system/sw/bin/light -A 5";
}
];
@@ -438,7 +459,16 @@
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)
];
@@ -447,12 +477,21 @@
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 = {
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

@@ -6,8 +6,12 @@
system,
zremap,
...
}: {
imports = [];
}:
let
USER = "akill";
in
{
imports = [ ];
system.stateVersion = "23.05";
system.autoUpgrade.enable = false;
@@ -17,7 +21,7 @@
};
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 +48,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 +65,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"];
binfmt.emulatedSystems = [
"wasm32-wasi"
"x86_64-windows"
];
kernelParams = [
"psmouse.synaptics_intertouch=0"
"mem_sleep_default=deep"
];
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";
@@ -84,7 +100,9 @@
memtest86.enable = true;
};
readOnlyNixStore = true;
supportedFilesystems = ["f2fs" "xfs"];
supportedFilesystems = [
"xfs"
];
tmp.useTmpfs = true;
};
@@ -95,7 +113,7 @@
doas.enable = true;
doas.extraRules = [
{
users = ["akill"];
users = [ USER ];
keepEnv = true;
persist = true;
}
@@ -107,13 +125,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 +171,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 +185,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,8 +202,16 @@
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 = ''
whitelist ''${RUNUSER}/qutebrowser
'';
};
extraInit = ''
unset -v SSH_ASKPASS
'';
@@ -229,45 +264,47 @@
"netns@" = {
description = "%I network namespace";
before = ["network.target"];
before = [ "network.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${pkgs.iproute}/bin/ip netns add %I";
ExecStop = "${pkgs.iproute}/bin/ip netns del %I";
ExecStart = "${pkgs.iproute2}/bin/ip netns add %I";
ExecStop = "${pkgs.iproute2}/bin/ip netns del %I";
};
};
"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;
ExecStart = pkgs.writers.writeBash "wg-up" ''
set -e
ENDPOINT_IP=$(${pkgs.coreutils-full}/bin/cat "${config.sops.secrets."wg_endpoint_proton".path}")
${pkgs.iproute}/bin/ip link add proton_wg type wireguard
${pkgs.iproute}/bin/ip link set proton_wg netns wg
${pkgs.iproute}/bin/ip -n wg address add 10.2.0.2/32 dev proton_wg
${pkgs.iproute}/bin/ip netns exec wg \
${pkgs.wireguard-tools}/bin/wg set "proton_wg" private-key "${config.sops.secrets."wg_privkey_proton".path}"
${pkgs.iproute}/bin/ip netns exec wg \
${pkgs.iproute2}/bin/ip link add proton_wg type wireguard
${pkgs.iproute2}/bin/ip link set proton_wg netns wg
${pkgs.iproute2}/bin/ip -n wg address add 10.2.0.2/32 dev proton_wg
${pkgs.iproute2}/bin/ip netns exec wg \
${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" \
persistent-keepalive "25" \
allowed-ips "0.0.0.0/0"
${pkgs.iproute}/bin/ip -n wg link set lo up
${pkgs.iproute}/bin/ip -n wg link set proton_wg up
${pkgs.iproute}/bin/ip -n wg route add default dev proton_wg
${pkgs.iproute2}/bin/ip -n wg link set lo up
${pkgs.iproute2}/bin/ip -n wg link set proton_wg up
${pkgs.iproute2}/bin/ip -n wg route add default dev proton_wg
'';
ExecStop = pkgs.writers.writeBash "wg-down" ''
${pkgs.iproute}/bin/ip -n wg route del default dev proton_wg
${pkgs.iproute}/bin/ip -n wg link del proton_wg
${pkgs.iproute2}/bin/ip -n wg route del default dev proton_wg
${pkgs.iproute2}/bin/ip -n wg link del proton_wg
'';
};
};
@@ -278,9 +315,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";
@@ -324,6 +361,7 @@
};
};
coredump.enable = false;
extraConfig = ''
DefaultTimeoutStartSec=30s
DefaultTimeoutStopSec=30s
@@ -347,6 +385,12 @@
pulse.enable = true;
};
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
libinput.enable = true;
xserver = {
enable = true;
@@ -360,7 +404,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"
@@ -391,32 +438,38 @@
enable = true;
bindings = [
{
keys = [113];
events = ["key"];
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master toggle'";
keys = [ 113 ];
events = [ "key" ];
command = "/run/current-system/sw/bin/runuser -l ${USER} -c 'amixer -q set Master toggle'";
}
{
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 = "/run/current-system/sw/bin/runuser -l ${USER} -c 'amixer -q set Master 5%- unmute'";
}
{
keys = [115];
events = ["key" "rep"];
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master 5%+ unmute'";
keys = [ 115 ];
events = [
"key"
"rep"
];
command = "/run/current-system/sw/bin/runuser -l ${USER} -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";
}
];
@@ -436,39 +489,41 @@
"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;
home = user.home;
in {
user = user.name;
paths = [
(home + "/pic/priv")
(home + "/pproj")
(home + "/videos/priv")
];
exclude = [
"**/.ccls_cache"
"**/*.d"
"**/*.map"
"**/*.o"
"**/zig-cache"
"**/zig-out"
];
repo = "ssh://oda929rv@oda929rv.repo.borgbase.com/./repo";
encryption = {
mode = "repokey-blake2";
passCommand = "${pkgs.coreutils-full}/bin/cat ${config.sops.secrets."borgbase_enc_key".path}";
borgbackup.jobs."borgbase" =
let
user = config.users.users.${USER};
home = user.home;
in
{
user = user.name;
paths = [
(home + "/pic/priv")
(home + "/pproj")
(home + "/videos/priv")
];
exclude = [
"**/.ccls_cache"
"**/*.d"
"**/*.map"
"**/*.o"
"**/zig-cache"
"**/zig-out"
];
repo = "ssh://oda929rv@oda929rv.repo.borgbase.com/./repo";
encryption = {
mode = "repokey-blake2";
passCommand = "${pkgs.coreutils-full}/bin/cat ${config.sops.secrets."borgbase_enc_key".path}";
};
environment.BORG_RSH = "${pkgs.openssh}/bin/ssh -i ${config.sops.secrets."borgbase_ssh_key".path}";
compression = "auto,zstd";
startAt = "daily";
};
environment.BORG_RSH = "${pkgs.openssh}/bin/ssh -i ${config.sops.secrets."borgbase_ssh_key".path}";
compression = "auto,zstd";
startAt = "daily";
};
nix-serve = {
enable = false;
@@ -507,7 +562,7 @@
allowBitmaps = true;
useEmbeddedBitmaps = true;
defaultFonts = {
monospace = ["JetBrainsMono"];
monospace = [ "JetBrainsMono" ];
};
};
@@ -516,24 +571,34 @@
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
noto-fonts-cjk-sans
noto-fonts-color-emoji
noto-fonts-emoji
proggyfonts
siji
terminus_font
terminus_font_ttf
ubuntu_font_family
vistafonts
];
};
virtualisation = {
libvirtd = {
enable = true;
allowedBridges = [
"virbr0"
"br0"
];
};
spiceUSBRedirection.enable = true;
containers.storage.settings = {
storage = {
graphroot = "/var/lib/containers/storage";
@@ -559,7 +624,7 @@
graphics = {
enable = true;
extraPackages = [];
extraPackages = [ ];
};
rtl-sdr.enable = true;
};
@@ -569,9 +634,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,40 +1,61 @@
# 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";
fsType = "xfs";
};
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";
fsType = "xfs";
};
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";
fsType = "xfs";
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/aeaa71ca-a439-4ef3-9ab8-db7ae8f59376";
fsType = "xfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/828E-F3C3";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/828E-F3C3";
fsType = "vfat";
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,55 +115,57 @@ stdenv.mkDerivation {
xorg.libxkbfile
];
installPhase = let
viberWrap = writeShellScriptBin "viberWrap" ''
${bubblewrap}/bin/bwrap --bind / / \
--dev /dev \
--tmpfs $HOME \
--bind $HOME/.ViberPC/ $HOME/.ViberPC \
--bind $HOME/Downloads/ $HOME/Downloads \
$@
installPhase =
let
viberWrap = writeShellScriptBin "viberWrap" ''
${bubblewrap}/bin/bwrap --bind / / \
--dev /dev \
--tmpfs $HOME \
--bind $HOME/.ViberPC/ $HOME/.ViberPC \
--bind $HOME/Downloads/ $HOME/Downloads \
$@
'';
in
''
dpkg-deb -x $src $out
mkdir -p $out/bin
# Soothe nix-build "suspicions"
chmod -R g-w $out
for file in $(find $out -type f \( -perm /0111 -o -name \*.so\* \) ); do
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$file" || true
patchelf --set-rpath $libPath:$out/opt/viber/lib $file || true
done
# qt.conf is not working, so override everything using environment variables
wrapProgram $out/opt/viber/Viber \
--set QT_PLUGIN_PATH "$out/opt/viber/plugins" \
--set QT_XKB_CONFIG_ROOT "${xorg.xkeyboardconfig}/share/X11/xkb" \
--set QTCOMPOSE "${xorg.libX11.out}/share/X11/locale" \
--set QML2_IMPORT_PATH "$out/opt/viber/qml"
echo "#!${bash}/bin/bash" > $out/bin/viber
echo "${viberWrap}/bin/viberWrap $out/opt/viber/Viber" >> $out/bin/viber
chmod +x $out/bin/viber
mv $out/usr/share $out/share
rm -rf $out/usr
# Fix the desktop link
substituteInPlace $out/share/applications/viber.desktop \
--replace /opt/viber/Viber $out/opt/viber/Viber \
--replace /usr/share/ $out/share/
'';
in ''
dpkg-deb -x $src $out
mkdir -p $out/bin
# Soothe nix-build "suspicions"
chmod -R g-w $out
for file in $(find $out -type f \( -perm /0111 -o -name \*.so\* \) ); do
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$file" || true
patchelf --set-rpath $libPath:$out/opt/viber/lib $file || true
done
# qt.conf is not working, so override everything using environment variables
wrapProgram $out/opt/viber/Viber \
--set QT_PLUGIN_PATH "$out/opt/viber/plugins" \
--set QT_XKB_CONFIG_ROOT "${xorg.xkeyboardconfig}/share/X11/xkb" \
--set QTCOMPOSE "${xorg.libX11.out}/share/X11/locale" \
--set QML2_IMPORT_PATH "$out/opt/viber/qml"
echo "#!${bash}/bin/bash" > $out/bin/viber
echo "${viberWrap}/bin/viberWrap $out/opt/viber/Viber" >> $out/bin/viber
chmod +x $out/bin/viber
mv $out/usr/share $out/share
rm -rf $out/usr
# Fix the desktop link
substituteInPlace $out/share/applications/viber.desktop \
--replace /opt/viber/Viber $out/opt/viber/Viber \
--replace /usr/share/ $out/share/
'';
dontStrip = true;
dontPatchELF = true;
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 ];
};
}