feat\!: major cleanup

This commit is contained in:
Jacob Bachmann 2025-08-19 00:49:40 +02:00
parent b971a645e3
commit 210c463d79
93 changed files with 34 additions and 4340 deletions

22
flake.lock generated
View file

@ -86,27 +86,6 @@
"type": "github" "type": "github"
} }
}, },
"home-manager_2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1753592768,
"narHash": "sha256-oV695RvbAE4+R9pcsT9shmp6zE/+IZe6evHWX63f2Qg=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "fc3add429f21450359369af74c2375cb34a2d204",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-25.05",
"repo": "home-manager",
"type": "github"
}
},
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1755330281, "lastModified": 1755330281,
@ -159,7 +138,6 @@
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"disko": "disko", "disko": "disko",
"home-manager": "home-manager_2",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable" "nixpkgs-unstable": "nixpkgs-unstable"

View file

@ -4,10 +4,6 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
url = "github:nix-community/home-manager/release-25.05";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = { agenix = {
url = "github:ryantm/agenix"; url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -42,10 +38,8 @@
nixosConfigurations = nixpkgs.lib.mergeAttrsList ( nixosConfigurations = nixpkgs.lib.mergeAttrsList (
nixpkgs.lib.forEach [ nixpkgs.lib.forEach [
"APPA" "APPA"
"IROH"
"MOMO" "MOMO"
"PABU" "PABU"
"T430"
] mkSystem ] mkSystem
); );
}; };

View file

@ -12,12 +12,6 @@
]; ];
bchmnn = { bchmnn = {
git = {
signing = {
key = "0x7753026D577922A6";
};
};
collections = { collections = {
cli-utils.enable = true; cli-utils.enable = true;
}; };
@ -38,4 +32,6 @@
}; };
}; };
}; };
documentation.nixos.enable = false;
} }

View file

@ -1,45 +0,0 @@
{ ... }@inputs:
{
imports = [
inputs.nixos-hardware.nixosModules.common-cpu-intel
inputs.nixos-hardware.nixosModules.common-pc
inputs.nixos-hardware.nixosModules.common-pc-ssd
inputs.nixos-hardware.nixosModules.common-gpu-nvidia-nonprime
./hardware.nix
../../modules
];
networking.hostName = "IROH";
bchmnn = {
gui = {
enable = true;
greeter.enable = false;
flavour = [ "i3" ];
};
nvidia.enable = true;
audio = {
enable = true;
pipewire-wine-fix.enable = true;
};
bluetooth.enable = false;
printing.enable = true;
collections = {
cli-utils.enable = true;
profiling.enable = true;
development.enable = true;
vpn.enable = true;
virtualisation.enable = true;
games.enable = true;
};
services = {
flare-solvarr.enable = true;
jackett.enable = true;
syncthing.enable = true;
};
};
}

View file

@ -1,75 +0,0 @@
{ config
, lib
, modulesPath
, ...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.kernelModules = [
"kvm-intel"
"nvidia"
"nvidia_modeset"
"nvidia_uvm"
"nvidia_drm"
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.extraModprobeConfig = ''
options nvidia NVreg_RegistryDwords="PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerLevel=0x3; PowerMizerDefault=0x3; PowerMizerDefaultAC=0x3"
'';
boot.kernelParams = [
"resume_offset=533760"
"nvidia_drm.modeset=1"
"nvidia.NVreg_PreserveVideoMemoryAllocations=1"
];
boot.resumeDevice = "/dev/disk/by-label/ROOT";
# hardware.nvidia.package = pkgs.unstable.linuxPackages.nvidiaPackages.stable;
fileSystems."/" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "subvol=@" ];
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "subvol=@nix" ];
};
fileSystems."/swap" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "subvol=@swap" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/EFI";
fsType = "vfat";
};
fileSystems."/home" = {
device = "/dev/disk/by-label/HOME";
fsType = "btrfs";
options = [ "subvol=@" ];
};
swapDevices = [{ device = "/swap/swapfile"; }];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,4 +1,4 @@
{ lib, pkgs, modulesPath, ... }: { { lib, pkgs, modulesPath, ... }@inputs: {
imports = [ (modulesPath + "/profiles/minimal.nix") ]; imports = [ (modulesPath + "/profiles/minimal.nix") ];
# Installing a new system within the nspawn means that the /sbin/init script # Installing a new system within the nspawn means that the /sbin/init script
@ -63,6 +63,8 @@
# stuff # stuff
nixfmt-rfc-style nixfmt-rfc-style
inputs.agenix.packages.x86_64-linux.default
]; ];
system.stateVersion = "24.05"; system.stateVersion = "24.05";

View file

@ -1,50 +0,0 @@
{ ... }@inputs:
{
imports = [
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t430
inputs.nixos-hardware.nixosModules.common-pc-laptop
inputs.nixos-hardware.nixosModules.common-pc-laptop-acpi_call
inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd
./hardware.nix
../../modules
];
networking.hostName = "T430";
bchmnn = {
gui = {
enable = true;
greeter.enable = false;
flavour = [ "sway" ];
};
nvidia.enable = false;
audio = {
enable = true;
pipewire-wine-fix.enable = false;
};
bluetooth.enable = true;
printing.enable = true;
collections = {
cli-utils.enable = true;
profiling.enable = true;
development.enable = true;
vpn = {
enable = true;
dryborg.enable = true;
};
virtualisation.enable = true;
games.enable = true;
};
services = {
flare-solvarr.enable = true;
jackett.enable = true;
syncthing.enable = true;
};
bsprak.enable = true;
};
}

View file

@ -1,75 +0,0 @@
{
config,
lib,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ehci_pci"
"ahci"
"usb_storage"
"sd_mod"
"sr_mod"
"sdhci_pci"
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelParams = [ "resume_offset=18883840" ];
boot.resumeDevice = "/dev/disk/by-label/ROOT";
boot.initrd.luks.devices."cryptlvm".device = "/dev/disk/by-uuid/b7a904b2-cceb-47fc-832a-701e386a95db";
fileSystems."/" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [
"subvol=@"
"compress=zstd"
"noatime"
];
};
fileSystems."/home" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [
"subvol=@home"
"compress=zstd"
"noatime"
];
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [
"subvol=@nix"
"compress=zstd"
"noatime"
];
};
fileSystems."/swap" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [
"subvol=@swap"
"noatime"
];
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/EFI";
fsType = "vfat";
};
swapDevices = [ { device = "/swap/swapfile"; } ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -15,57 +15,17 @@
pkgs.git # distributed version control system pkgs.git # distributed version control system
pkgs.gnumake # a tool to control the generation of non-source files from sources pkgs.gnumake # a tool to control the generation of non-source files from sources
pkgs.parallel # shell tool for executing jobs in parallel pkgs.parallel # shell tool for executing jobs in parallel
pkgs.mercurial # a fast, lightweight scm system for very large distributed projects pkgs.neovim # vim text editor fork focused on extensibility and agility
pkgs.wget # tool for retrieving files using http, https, and ftp
pkgs.unstable.neovim-unwrapped # vim text editor fork focused on extensibility and agility
pkgs.neofetch # a fast, highly customizable system info script
pkgs.eza # a modern, maintained replacement for ls pkgs.eza # a modern, maintained replacement for ls
pkgs.ripgrep # a utility that combines the usability of the silver searcher with the raw speed of grep pkgs.ripgrep # a utility that combines the usability of the silver searcher with the raw speed of grep
pkgs.ripgrep-all # ripgrep, but also search in pdfs, e-books, office documents, zip, tar.gz, and more pkgs.ripgrep-all # ripgrep, but also search in pdfs, e-books, office documents, zip, tar.gz, and more
pkgs.expect # a tool for automating interactive applications
pkgs.jq # a lightweight and flexible command-line json processor pkgs.jq # a lightweight and flexible command-line json processor
pkgs.unzip # an extraction utility for archives compressed in .zip format pkgs.unzip # an extraction utility for archives compressed in .zip format
pkgs.unrar # utility for rar archives pkgs.unrar # utility for rar archives
pkgs.libsecret # a library for storing and retrieving passwords and other secrets pkgs.libsecret # a library for storing and retrieving passwords and other secrets
pkgs.xidel # command line tool to download and extract data from html/xml pages as well as json apis
pkgs.nvd # nix/nixos package version diff tool
pkgs.inotify-tools # a c library and a set of command-line programs providing a simple interface to inotify
pkgs.mkcert # a simple tool for making locally-trusted development certificates pkgs.mkcert # a simple tool for making locally-trusted development certificates
pkgs.hexedit pkgs.hexedit
pkgs.gdu # fast disk usage analyzer with console interface written in go pkgs.gdu # fast disk usage analyzer with console interface written in go
pkgs.duf # disk usage/free utility - a better 'df' alternative pkgs.duf # disk usage/free utility - a better 'df' alternative
]
++ lib.optionals (config.bchmnn.collections.cli-utils.enable && config.bchmnn.nvidia.enable) [
pkgs.nvtopPackages.full
]
++ lib.optionals config.bchmnn.collections.development.enable [
pkgs.gcc13
pkgs.clang
pkgs.cmake
pkgs.universal-ctags # a maintained ctags implementation
pkgs.unifdef # selectively remove c preprocessor conditionals
pkgs.doxygen # source code documentation generator tool
pkgs.rustc
pkgs.cargo # downloads your rust project's dependencies and builds your project
pkgs.go # go programming language
(pkgs.python312.withPackages (
p: with p; [
ptpython # an advanced python repl
ipython # ipython: productive interactive computing
pycryptodome # self-contained cryptographic library
gmpy2 # interface to gmp, mpfr, and mpc for python 3.7+
]
))
pkgs.lua
pkgs.nixpkgs-fmt
pkgs.openjdk17
pkgs.javaPackages.openjfx17
pkgs.gradle_7
pkgs.maven
pkgs.ant
pkgs.nodejs_20
pkgs.nodenv
pkgs.nodePackages.yarn
pkgs.nodePackages.pnpm
]; ];
} }

View file

@ -1,57 +0,0 @@
{
pkgs,
config,
lib,
...
}:
{
options.bchmnn = {
audio = {
enable = lib.mkEnableOption "audio";
pipewire-wine-fix = {
enable = lib.mkEnableOption "pipewire-wine-fix";
};
};
};
config = {
services.pipewire =
lib.mkIf (config.bchmnn.audio.enable && (!builtins.elem "gnome" config.bchmnn.gui.flavour))
{
enable = true;
audio.enable = true;
pulse.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
jack.enable = true;
wireplumber.enable = true;
extraConfig.pipewire = lib.mkIf config.bchmnn.audio.pipewire-wine-fix.enable {
"90-wine-config" = {
"context.properties" = {
# "default.clock.rate" = 48000;
"default.clock.allowed-rates" = [
44100
48000
];
# "default.clock.quantum" = 2048;
# "default.clock.min-quantum" = 1024;
};
};
};
extraConfig.pipewire-pulse = lib.mkIf config.bchmnn.audio.pipewire-wine-fix.enable {
"90-wine-config" = {
"pulse.properties" = {
"pulse.min.req" = "1024/48000";
# "pulse.min.frag" = "1024/48000";
# "pulse.min.quantum" = "1024/48000";
};
};
};
};
environment.systemPackages = lib.optionals config.bchmnn.audio.enable [
pkgs.alsa-utils
pkgs.pulseaudio
];
};
}

View file

@ -1,17 +0,0 @@
{ config, lib, ... }:
{
options.bchmnn = {
bluetooth = {
enable = lib.mkEnableOption "bluetooth";
};
};
config = lib.mkIf config.bchmnn.bluetooth.enable {
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
services.blueman.enable = true;
};
}

View file

@ -1,51 +0,0 @@
{ lib, pkgs, ... }:
{
options.bchmnn = {
bsprak = {
enable = lib.mkEnableOption "bsprak";
};
};
config = {
environment = {
# Tell nix to link header files of all installed packages
# in /run/current-system/sw/include
pathsToLink = [ "/include" ];
variables = {
# Tell compilers where to find the header files
CPATH = "/run/current-system/sw/include";
# Tell linker where to find shared objects
LIBRARY_PATH = "/run/current-system/sw/lib";
};
systemPackages = with pkgs; [
git
gcc
gnumake
cmake
python3
ninja
texinfo
pkg-config
bison
flex
curl
# the `.dev` syntax tells nix to also provide header files
gmp
gmp.dev
mpfr
mpfr.dev
libmpc
glib
glib.dev
pixman
expat
expat.dev
ncurses5
ncurses5.dev
];
};
};
}

View file

@ -4,31 +4,5 @@
la = "eza --group-directories-first --hyperlink --icons -la"; la = "eza --group-directories-first --hyperlink --icons -la";
lt = "eza --group-directories-first --hyperlink --icons -la --tree"; lt = "eza --group-directories-first --hyperlink --icons -la --tree";
llt = "unbuffer eza --group-directories-first --hyperlink --icons -la --tree | less -r"; llt = "unbuffer eza --group-directories-first --hyperlink --icons -la --tree | less -r";
gg = "cd ~/code";
# gs = "git status";
gl = "git log --oneline";
glg = "git log --oneline --graph --decorate --all";
gaa = "git add --all";
gc = "git commit -m";
gp = "git push";
ta = "tmux attach";
nec = "nvim --cmd \"cd $(readlink -f /etc/nixos)\"";
ncc = "sudo nixos-rebuild switch --upgrade-all --flake \"$(readlink -f /etc/nixos)\"";
nup = "sudo nix-channel --update";
ngc = "sudo nix-collect-garbage -d";
nda = "nixos-rebuild --flake path:\"$(readlink -f /etc/nixos)\"#APPA --build-host root@dryb.org --target-host root@dryb.org switch";
dcup = "docker-compose up --detach --remove-orphans";
dka = "docker kill $(docker ps -q)";
drmc = "docker container rm $(docker container ls -aq)";
drmi = "docker image rm $(docker image ls -aq)";
drmv = "docker volume rm $(docker volume ls -q)";
lsip = "curl -s 'https://nordvpn.com/wp-admin/admin-ajax.php?action=get_user_info_data' | jq";
xo = "xdg-open";
y = "yazi";
}; };
} }

View file

@ -2,14 +2,8 @@
{ {
imports = [ imports = [
./applications.nix ./applications.nix
./audio.nix
./bluetooth.nix
./bsprak.nix
./keyd.nix
./network.nix ./network.nix
./nvidia.nix
./power.nix ./power.nix
./printing.nix
./profiling.nix ./profiling.nix
./security.nix ./security.nix
./shell.nix ./shell.nix
@ -36,10 +30,6 @@
allowUnfreePredicate = (_: true); allowUnfreePredicate = (_: true);
}; };
}; };
mfcl3750cdwlpr = (super.callPackage ../../overlays/mfcl3750cdw.nix { }).driver;
mfcl3750cdwcupswrapper = (super.callPackage ../../overlays/mfcl3750cdw.nix { }).cupswrapper;
pppdf = (super.python3Packages.callPackage ../../overlays/pppdf { });
iglesia-light = (super.callPackage ../../overlays/fonts/iglesia-light.nix { });
}) })
]; ];
config = { config = {
@ -48,17 +38,6 @@
}; };
}; };
# provide libraries for non-nix binaries
# programs.nix-ld = {
# enable = true;
# libraries = [
# # glibc
# # libcxx
# # libllvm
# # ncurses
# ];
# };
system.stateVersion = "23.05"; system.stateVersion = "23.05";
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
@ -80,7 +59,6 @@
services.dbus = { services.dbus = {
enable = true; enable = true;
packages = with pkgs; [ packages = with pkgs; [
gcr # gnome crypto services (daemon and tools)
dconf dconf
]; ];
}; };

View file

@ -1,73 +0,0 @@
{ pkgs, ... }:
let
nav = {
h = "left";
j = "down";
k = "up";
l = "right";
"0" = "home";
"4" = "end";
u = "pageup";
d = "pagedown";
q = "previoussong";
w = "playpause";
e = "nextsong";
};
alt = {
a = "ä";
o = "ö";
u = "ü";
s = "ß";
e = "";
};
altShift = {
a = "Ä";
o = "Ö";
u = "Ü";
};
in
{
environment.systemPackages = with pkgs; [ keyd ];
# Enable keyd and remap keys
services.keyd = {
enable = true;
keyboards.default = {
ids = [
"*"
"-04fe:0020" # HHKB
"-046d:102a" # Logitech G700s
"-046d:c07c" # Logitech G700s Rechargeable Gaming Mouse
];
settings = {
main = {
leftalt = "layer(meta)";
leftmeta = "layer(alt)";
altgr = "layer(control)";
rightalt = "layer(control)";
capslock = "layer(nav)";
};
alt = alt;
"alt+shift" = altShift;
meta = {
capslock = "overload(nav, capslock)";
};
nav = nav;
};
};
keyboards.hhkb = {
ids = [ "04fe:0020" ];
settings = {
main = {
rightmeta = "layer(control)";
leftcontrol = "layer(nav)";
};
alt = alt;
"alt+shift" = altShift;
meta = {
leftcontrol = "overload(nav, capslock)";
};
nav = nav;
};
};
};
}

View file

@ -17,13 +17,6 @@
enable = lib.mkEnableOption "networkd"; enable = lib.mkEnableOption "networkd";
}; };
}; };
collections = {
vpn = {
dryborg = {
enable = lib.mkEnableOption "dryborg";
};
};
};
}; };
config = { config = {
networking = { networking = {
@ -34,46 +27,6 @@
NetworkManager-wait-online.enable = false; NetworkManager-wait-online.enable = false;
}; };
services.resolved.enable = ( services.resolved.enable = config.bchmnn.network.nm.enable;
config.bchmnn.network.nm.enable || config.bchmnn.collections.vpn.enable
);
environment.systemPackages = lib.optionals (config.bchmnn.collections.vpn.enable) [
pkgs.openvpn3
pkgs.mullvad-vpn
pkgs.wireguard-tools # tools for the wireguard secure network tunnel
];
services.mullvad-vpn.enable = config.bchmnn.collections.vpn.enable;
age.secrets =
lib.mkIf (config.bchmnn.collections.vpn.enable && config.bchmnn.collections.vpn.dryborg.enable)
{
keys-wireguard-dryborg-privatekey = {
file = ../../secrets/keys/wireguard/dryborg/privatekey.age;
};
keys-wireguard-dryborg-presharedkey = {
file = ../../secrets/keys/wireguard/dryborg/presharedkey.age;
};
};
networking.wg-quick.interfaces =
lib.mkIf (config.bchmnn.collections.vpn.enable && config.bchmnn.collections.vpn.dryborg.enable)
{
"vpn.dryb.org" = {
autostart = false;
privateKeyFile = config.age.secrets.keys-wireguard-dryborg-privatekey.path;
address = [ "10.200.200.1/24" ];
dns = [ "192.168.2.1" ];
peers = [
{
publicKey = "JY5fb0RS7C8WyPPEeymzuMSUeIhDtICGk1FYJgTRnTs=";
presharedKeyFile = config.age.secrets.keys-wireguard-dryborg-presharedkey.path;
allowedIPs = [ "0.0.0.0/0" ];
endpoint = "vpn.dryb.org:53280";
persistentKeepalive = 21;
}
];
};
};
}; };
} }

View file

@ -1,17 +0,0 @@
{ config, lib, ... }:
{
options.bchmnn = {
nvidia = {
enable = lib.mkEnableOption "nvidia";
};
};
config = lib.mkIf config.bchmnn.nvidia.enable {
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
nvidiaSettings = true;
};
};
}

View file

@ -46,7 +46,7 @@
}; };
services.tlp = { services.tlp = {
enable = !builtins.elem "gnome" config.bchmnn.gui.flavour; enable = true;
settings = config.bchmnn.power.tlp.settings; settings = config.bchmnn.power.tlp.settings;
}; };

View file

@ -1,38 +0,0 @@
{
pkgs,
lib,
config,
...
}:
{
options.bchmnn = {
printing = {
enable = lib.mkEnableOption "printing";
};
};
config = lib.mkIf config.bchmnn.printing.enable {
services.printing = {
enable = true;
drivers = [ pkgs.mfcl3750cdwcupswrapper ];
};
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
hardware.printers = {
ensurePrinters = [
{
name = "Brother-MFC-L3750CDW-series";
location = "Home";
deviceUri = "dnssd://Brother%20MFC-L3750CDW%20series._ipp._tcp.local/?uuid=e3248000-80ce-11db-8000-b4220094c09b";
model = "brother_mfcl3750cdw_printer_en.ppd";
}
];
ensureDefaultPrinter = "Brother-MFC-L3750CDW-series";
};
};
}

View file

@ -1,6 +1,4 @@
{ {
lib,
config,
pkgs, pkgs,
... ...
}: }:
@ -12,12 +10,6 @@ in
enable = true; enable = true;
}; };
users.users = lib.mkIf (config.bchmnn.home.enable) {
gandalf = {
shell = pkgs.zsh;
};
};
environment = { environment = {
shellAliases = common.aliases; shellAliases = common.aliases;
}; };

View file

@ -7,26 +7,15 @@
lib.mkIf config.bchmnn.collections.virtualisation.enable { lib.mkIf config.bchmnn.collections.virtualisation.enable {
virtualisation = { virtualisation = {
libvirtd.enable = true; libvirtd.enable = true;
/*
podman = {
enable = true;
# create a `docker` alias for podman, to use it as a drop-in replacement
dockerCompat = true;
# required for containers under podman-compose to be able to talk to each other.
defaultNetwork.settings.dns_enabled = true;
};
*/
docker = { docker = {
enable = true; enable = true;
}; };
oci-containers = { oci-containers = {
backend = "docker"; backend = "docker";
# backend = "podman";
}; };
containers = { containers = {
enable = true; enable = true;
}; };
}; };
hardware.nvidia-container-toolkit.enable = config.bchmnn.nvidia.enable;
environment.systemPackages = with pkgs; [ virtiofsd ]; environment.systemPackages = with pkgs; [ virtiofsd ];
} }

View file

@ -2,32 +2,6 @@
{ {
options.bchmnn = with lib; { options.bchmnn = with lib; {
home = {
enable = mkEnableOption "home";
};
user = {
extraGroups = mkOption {
type = types.listOf types.str;
default = [
"wheel"
"networkmanager"
"libvirtd"
"docker"
"wireshark"
];
};
};
git = {
signing = {
key = mkOption {
type = types.str;
default = "732A612DAD28067D";
};
};
};
collections = { collections = {
cli-utils = { cli-utils = {
enable = mkEnableOption "cli-utils"; enable = mkEnableOption "cli-utils";
@ -38,22 +12,13 @@
development = { development = {
enable = mkEnableOption "development"; enable = mkEnableOption "development";
}; };
vpn = {
enable = mkEnableOption "vpn";
};
virtualisation = { virtualisation = {
enable = mkEnableOption "virtualisation"; enable = mkEnableOption "virtualisation";
}; };
games = {
enable = mkEnableOption "games";
};
}; };
}; };
imports = [ imports = [
./core ./core
./desktop
./home-manager
./services
]; ];
} }

View file

@ -1,39 +0,0 @@
{ config
, lib
, pkgs
, ...
}:
lib.mkIf config.bchmnn.gui.enable {
environment.systemPackages =
lib.optionals (config.bchmnn.collections.cli-utils.enable) [
pkgs.libnotify # a library that sends desktop notifications to a notification daemon
pkgs.xdg-utils # a set of command line tools that assist applications with a variety of desktop integration tasks
]
++ lib.optionals (config.bchmnn.collections.development.enable) [
pkgs.ghidra-bin
pkgs.mongodb-compass
]
++ lib.optionals (lib.elem "sway" config.bchmnn.gui.flavour) [
pkgs.qt5.qtwayland
pkgs.qt6.qtwayland
pkgs.wineWowPackages.waylandFull
];
programs = {
ausweisapp = {
enable = true;
openFirewall = true;
};
evolution.enable = !(lib.elem "gnome" config.bchmnn.gui.flavour);
kdeconnect.enable = true;
virt-manager.enable = config.bchmnn.collections.virtualisation.enable;
wireshark.enable = config.bchmnn.collections.development.enable;
};
services.ratbagd.enable = true;
# needed for udiskie
services.udisks2.enable = true;
# enable gvfs to mount android devices
services.gvfs.enable = true;
}

View file

@ -1,132 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [
./applications.nix
./fonts.nix
./games.nix
./nautilus.nix
];
options.bchmnn = {
gui = {
enable = lib.mkEnableOption "gui";
greeter = {
enable = lib.mkEnableOption "greeter";
};
flavour = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ "sway" ];
example = [
"sway"
"i3"
];
description = ''
The flavour (WM) for your system to use
'';
};
};
};
config = lib.mkIf (config.bchmnn.gui.enable && config.bchmnn.gui.flavour != [ ]) {
environment.pathsToLink = [ "/libexec" ]; # links /libexec from derivations to /run/current-system/sw
programs.sway.enable = builtins.elem "sway" config.bchmnn.gui.flavour;
services.xserver.windowManager.i3.enable = builtins.elem "i3" config.bchmnn.gui.flavour;
services.libinput.enable = true;
services.xserver = {
enable = (
builtins.elem "i3" config.bchmnn.gui.flavour || builtins.elem "gnome" config.bchmnn.gui.flavour
);
desktopManager.gnome.enable = builtins.elem "gnome" config.bchmnn.gui.flavour;
displayManager = {
gdm.enable = builtins.elem "gnome" config.bchmnn.gui.flavour;
startx.enable = builtins.elem "i3" config.bchmnn.gui.flavour;
};
};
environment.systemPackages = [
(pkgs.writeShellScriptBin "sway-run" ''
export WLR_NO_HARDWARE_CURSORS=1
exec ${pkgs.sway}/bin/sway "$@"
'')
];
environment = {
etc = {
"greetd/environments".text = (lib.strings.concatLines config.bchmnn.gui.flavour);
"greetd/kanshi-config".text = ''
profile nomad {
output "LVDS-1" enable
}
profile iroh {
output "DP-3" enable mode 2560x1440 position 0,0
output "DP-2" enable mode 2560x1440 position 2560,0
output "DP-1" enable mode 2560x1440 position 5120,0
}
profile station {
output "LVDS-1" disable
output "Dell Inc. DELL U2515H 9X2VY5490XUL" enable mode 1920x1080 position 0,0
output "Dell Inc. DELL U2515H 9X2VY5C7138L" enable mode 1920x1080 position 1920,0
output "HJW VGA TO HDMI 0x00000100" enable mode 1920x1080 position 3840,0
}
'';
"greetd/sway-config".text = ''
exec "${pkgs.kanshi}/bin/kanshi --config /etc/greetd/kanshi-config"
exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l; swaymsg exit"
bindsym Mod4+shift+e exec swaynag \
-t warning \
-m 'What do you want to do?' \
-b 'Poweroff' 'systemctl poweroff' \
-b 'Reboot' 'systemctl reboot'
include /etc/sway/config.d/*
'';
};
};
services.greetd = {
enable = config.bchmnn.gui.greeter.enable;
settings = {
default_session = {
command =
"sway-run --config /etc/greetd/sway-config"
+ lib.optionalString config.bchmnn.nvidia.enable " --unsupported-gpu";
};
};
};
# TODO workaround to get swaylock accepting pw
# https://github.com/NixOS/nixpkgs/issues/158025
security.pam.services = lib.mkIf (lib.elem "sway" config.bchmnn.gui.flavour) { swaylock = { }; };
xdg.portal = {
enable = true;
wlr.enable = true;
config.common.default = "*";
extraPortals = lib.optionals (lib.elem "sway" config.bchmnn.gui.flavour) [
pkgs.xdg-desktop-portal-wlr
];
};
environment.sessionVariables.GST_PLUGIN_SYSTEM_PATH_1_0 =
lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0"
(
with pkgs.gst_all_1;
[
gst-plugins-base
gst-plugins-good
gst-plugins-bad
gst-plugins-ugly
]
);
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
environment.variables =
lib.mkIf (builtins.elem pkgs.intel-media-driver config.hardware.opengl.extraPackages)
{ LIBVA_DRIVER_NAME = "iHD"; };
};
}

View file

@ -1,17 +0,0 @@
{
pkgs,
lib,
config,
...
}:
lib.mkIf (config.bchmnn.gui.enable) {
# Add fonts
fonts = {
enableDefaultPackages = true;
packages = with pkgs; [
(nerdfonts.override { fonts = [ "DejaVuSansMono" ]; })
comic-relief
iglesia-light
];
};
}

View file

@ -1,16 +0,0 @@
{
pkgs,
config,
lib,
...
}:
lib.mkIf config.bchmnn.collections.games.enable {
programs.steam = {
enable = true;
};
environment.systemPackages = [
pkgs.mangohud
pkgs.gamemode
];
}

View file

@ -1,21 +0,0 @@
{ pkgs
, lib
, config
, ...
}:
lib.mkIf (config.bchmnn.gui.enable && config.bchmnn.gui.flavour != [ ]) {
programs.nautilus-open-any-terminal = {
enable = true;
terminal = "kitty";
};
environment = lib.mkIf (!builtins.elem "gnome" config.bchmnn.gui.flavour) {
sessionVariables.NAUTILUS_4_EXTENSION_DIR = "${pkgs.gnome.nautilus-python}/lib/nautilus/extensions-4";
pathsToLink = [ "/share/nautilus-python/extensions" ];
systemPackages = with pkgs; [
gnome.nautilus
gnome.nautilus-python
];
};
}

View file

@ -1,22 +0,0 @@
{ pkgs, ... }:
{
home.packages = [
pkgs.gopass # slightly more awesome standard unix password manager for teams. written in go
pkgs.gopass-jsonapi # enables communication with gopass via json messages
pkgs.bitwarden-cli # secure and free password manager for all of your devices
pkgs.yt-dlp # command-line tool to download videos from youtube.com and other sites (youtube-dl fork)
pkgs.stress # simple workload generator for posix systems. it imposes a configurable amount of cpu, memory, i/o, and disk stress on the system
pkgs.s-tui # stress-terminal ui monitoring tool
pkgs.fio # flexible io tester - an io benchmark tool
pkgs.ffmpeg # complete, cross-platform solution to record, convert and stream audio and video
pkgs.texliveFull # tex live environment
pkgs.imagemagick # software suite to create, edit, compose, or convert bitmap images
pkgs.ghostscript # postscript interpreter (mainline version)
pkgs.pdftk # command-line tool for working with pdfs
# pkgs.ventoy-full # bootable usb solution
pkgs.unstable.isisdl # downloader for isis of tu-berlin
pkgs.sage # open source mathematics software, free alternative to magma, maple, mathematica, and matlab
pkgs.filebrowser # filebrowser is a web application for managing files and directories
pkgs.apktool # tool for reverse engineering android apk files
];
}

View file

@ -1,28 +0,0 @@
{ lib, nixosConfig, ... }:
lib.mkIf nixosConfig.bchmnn.audio.enable {
xdg.configFile."wireplumber/wireplumber.conf.d/51-scarlett-samplerate.conf" = {
text = ''
monitor.alsa.rules = [
{
matches = [
{
node.name = "~alsa_input.pci.*"
cpu.vm.name = "~.*"
}
{
node.name = "~alsa_output.pci.*"
cpu.vm.name = "~.*"
}
]
actions = {
update-props = {
api.alsa.period-size = 2048
api.alsa.headroom = 2048
session.suspend-timeout-seconds = 0
}
}
}
]
'';
};
}

View file

@ -1,16 +0,0 @@
{ lib, nixosConfig, ... }:
{
dconf.settings = {
"org/virt-manager/virt-manager/connections" =
lib.mkIf nixosConfig.bchmnn.collections.virtualisation.enable
{
autoconnect = [ "qemu:///system" ];
uris = [ "qemu:///system" ];
};
"org/gnome/desktop/interface" = {
"color-scheme" = "prefer-light";
};
};
}

View file

@ -1,65 +0,0 @@
{ lib, config, ... }@inputs:
let
common = import ../core/common.nix;
in
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
config = lib.mkIf (config.bchmnn.home.enable) {
users.users.gandalf = {
isNormalUser = true;
extraGroups = config.bchmnn.user.extraGroups;
openssh = {
authorizedKeys = {
keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAOG8Sja2i6nepkEkuxYdu86XbT9vS5uniBmZifSMZ0t jacob.bachmann@posteo.de"
];
};
};
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit inputs;
};
home-manager.users.gandalf = rec {
imports = [
./gui
./scripts
./applications.nix
./audio.nix
./dconf.nix
./git.nix
./gnupg.nix
./keyd.nix
./neovim.nix
./shell.nix
./zsh.nix
];
config = {
home = {
username = "gandalf";
homeDirectory = "/home/gandalf";
shellAliases = common.aliases;
stateVersion = "23.05";
};
xdg.userDirs = {
enable = true;
createDirectories = true;
desktop = "${config.home.homeDirectory}/tmp";
documents = "${config.home.homeDirectory}/docs";
download = "${config.home.homeDirectory}/dl";
music = "${config.home.homeDirectory}/music";
pictures = "${config.home.homeDirectory}/pics";
publicShare = "${config.home.homeDirectory}/public";
templates = "${config.home.homeDirectory}/templates";
videos = "${config.home.homeDirectory}/vids";
};
};
};
};
}

View file

@ -1,21 +0,0 @@
{ nixosConfig, ... }:
{
programs.git = {
enable = true;
lfs.enable = true;
signing = {
signByDefault = true;
key = nixosConfig.bchmnn.git.signing.key;
};
userEmail = "jacob.bachmann@posteo.de";
userName = "Jacob Bachmann";
extraConfig = {
init = {
defaultBranch = "main";
};
core.editor = "nvim";
pull.rebase = false;
push.autoSetupRemote = true;
};
};
}

View file

@ -1,13 +0,0 @@
{ pkgs, ... }:
{
programs.gpg = {
enable = true;
};
services.gpg-agent = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
pinentry.package = pkgs.pinentry-gnome3;
};
}

View file

@ -1,47 +0,0 @@
{ pkgs, lib, ... }:
{
colorschemes = rec {
custom = {
black = "#000000";
_black = "000000";
white = "#ffffff";
_white = "ffffff";
# https://yeun.github.io/open-color/
active = "#ffffff"; # white
activeDark = "#4276b9"; # blue
_activeDark = "4276b9"; # blue
inactive = "#495057"; # gray7
inactiveDark = "#212529"; # gray9
alert = "#c92a2a"; # red9
# active = "#ffdeeb"; # pink1
# activeDark = "#f783ac"; # pink4
# _activeDark = "f783ac"; # pink4
# inactive = "#495057"; # gray7
# inactiveDark = "#212529"; # gray9
# alert = "#c92a2a"; # red9
};
default = custom;
};
font = "DejaVuSansM Nerd Font";
font-size = "14";
gtk = "Adwaita";
wallpaper = rec {
neptun = pkgs.fetchurl {
url = "https://live.staticflickr.com/65535/52797919139_2444712a38_o_d.png";
sha256 = "1a9148d8911fa25afa82d3b843ee620173955a7ca705d525f3e9d00e00696308";
meta.licenses = lib.licenses.cc0;
};
everest = pkgs.fetchurl {
url = "https://images7.alphacoders.com/546/546508.jpg";
sha256 = "90774d977a5f9cde2264fc1c46417b34046f491b5caca7805c9cd17e3463777b";
meta.licenses = lib.licenses.cc0;
};
default = everest;
};
}

View file

@ -1,10 +0,0 @@
{ pkgs, ... }:
{
home.pointerCursor = {
name = "macOS-Monterey";
package = pkgs.apple-cursor;
size = 32;
gtk.enable = true;
x11.enable = true;
};
}

View file

@ -1,13 +0,0 @@
{ lib, nixosConfig, ... }:
{
imports =
with lib;
with nixosConfig.bchmnn;
optionals gui.enable [
./cursor.nix
./gtk.nix
./programs
]
++ optionals (gui.enable && elem "sway" gui.flavour) [ ./sway ]
++ optionals (gui.enable && elem "i3" gui.flavour) [ ./i3 ];
}

View file

@ -1,12 +0,0 @@
{ ... }:
{
gtk = {
enable = true;
gtk3.extraConfig = {
gtk-application-prefer-dark-theme = 0;
};
gtk4.extraConfig = {
gtk-application-prefer-dark-theme = 0;
};
};
}

View file

@ -1,55 +0,0 @@
{ ... }:
{
programs.autorandr = {
enable = true;
profiles = {
nomad = {
config = {
"LVDS-1" = {
enable = false;
};
};
};
samsung = {
fingerprint = {
"HDMI-0" = "00ffffffffffff004c2d830e000e0001011c0103806b3c780a23ada4544d99260f474abdef80714f81c0810081809500a9c0b300010104740030f2705a80b0588a00501d7400001e023a801871382d40582c4500501d7400001e000000fd00184b0f511e000a202020202020000000fc0053414d53554e470a202020202001b902034cf0535f101f041305142021225d5e626364071603122909070715075057070183010000e2004fe30503016e030c001000b83c20008001020304e3060d01e50e60616566e5018b849001011d80d0721c1620102c2580501d7400009e662156aa51001e30468f3300501d7400001e000000000000000000000000000000a3";
};
config = {
"HDMI-0" = {
enable = true;
primary = true;
mode = "3840x2160";
rate = "59.94";
position = "0x0";
};
};
};
station = {
config = {
"LVDS-1" = {
enable = false;
};
"DP-1-3" = {
enable = false;
mode = "1920x1080";
position = "0x0";
};
"DP-1-2" = {
enable = false;
mode = "1920x1080";
position = "1920x0";
};
"VGA-1-2" = {
enable = false;
mode = "1920x1080";
position = "3840x0";
};
};
};
};
};
}

View file

@ -1,257 +0,0 @@
{
pkgs,
lib,
config,
...
}:
let
cfg = config.xsession.windowManager.i3.config;
# common = (import ../common.nix) { pkgs = pkgs; lib = lib; };
common = (import ../common.nix) {
inherit pkgs;
inherit lib;
};
start-polybar = pkgs.writeShellScript "start-polybar" ''
${pkgs.polybarFull}/bin/polybar-msg cmd quit
echo "---" | tee -a /tmp/polybar.log
${pkgs.polybarFull}/bin/polybar 2>&1 | tee -a /tmp/polybar.log & disown
'';
in
{
imports = [
./autorandr.nix
./polybar.nix
./rofi.nix
];
home.packages = with pkgs; [
dmenu
xclip # tool to access the x clipboard from a console application
wireplumber
feh # lightweight image viewer (also sets wallpaper)
brightnessctl # control screen brightness
pavucontrol # control audio
playerctl # control player
networkmanagerapplet # control network
udiskie # automount usb
blueman # control bluetooth
nextcloud-client # nextcloud client to connect to any instance
libsForQt5.kdeconnect-kde # sync phone and pc
system-config-printer # printer manager
gnome3.adwaita-icon-theme
maim
];
xsession = {
initExtra = "xset s off";
windowManager.i3 = {
enable = true;
config = {
modifier = "Mod4";
bars = [ ];
terminal = "${config.programs.kitty.package}/bin/kitty";
menu = "${config.programs.rofi.package}/bin/rofi -show drun";
startup = with pkgs; [
{ command = "${start-polybar}"; }
{
command = "${gnome.gnome-keyring}/bin/gnome-keyring-daemon --start --components=ssh,secrets,pkcs11";
}
{ command = "${autorandr}/bin/autorandr -c"; }
{ command = "${feh}/bin/feh --bg-fill ${common.wallpaper.default}"; }
{ command = "${networkmanagerapplet}/bin/nm-applet"; }
{ command = "${blueman}/bin/blueman-applet"; }
{ command = "${udiskie}/bin/udiskie --tray"; }
{ command = "${nextcloud-client}/bin/nextcloud"; }
{ command = "${plasma5Packages.kdeconnect-kde}/bin/kdeconnect-indicator"; }
{ command = "${system-config-printer}/bin/system-config-printer-applet"; }
{
command = "${config.programs.kitty.package}/bin/kitty --class dropdown --title dropdown";
always = true;
}
];
fonts = {
names = [ common.font ];
style = "Bold";
size = 12.0;
};
window = {
titlebar = false;
border = 4;
commands = [
{
command = "floating enable";
criteria = {
instance = "dropdown";
};
}
{
command = "resize set 1400 800";
criteria = {
instance = "dropdown";
};
}
{
command = "move scratchpad";
criteria = {
instance = "dropdown";
};
}
];
};
gaps = {
inner = 5;
};
colors = {
focused = {
border = common.colorschemes.default.active;
background = common.colorschemes.default.active;
text = common.colorschemes.default.black;
indicator = common.colorschemes.default.activeDark;
childBorder = common.colorschemes.default.active;
};
focusedInactive = {
border = common.colorschemes.default.inactive;
background = common.colorschemes.default.inactive;
text = common.colorschemes.default.white;
indicator = common.colorschemes.default.inactive;
childBorder = common.colorschemes.default.inactive;
};
unfocused = {
border = common.colorschemes.default.inactiveDark;
background = common.colorschemes.default.inactiveDark;
text = common.colorschemes.default.white;
indicator = common.colorschemes.default.inactiveDark;
childBorder = common.colorschemes.default.inactiveDark;
};
urgent = {
border = common.colorschemes.default.alert;
background = common.colorschemes.default.alert;
text = common.colorschemes.default.white;
indicator = common.colorschemes.default.black;
childBorder = common.colorschemes.default.alert;
};
placeholder = {
border = common.colorschemes.default.active;
background = common.colorschemes.default.active;
text = common.colorschemes.default.black;
indicator = common.colorschemes.default.activeDark;
childBorder = common.colorschemes.default.active;
};
};
keybindings = {
# Basics
"${cfg.modifier}+Return" = "exec ${cfg.terminal}";
"${cfg.modifier}+q" = "kill";
"${cfg.modifier}+i" = "exec ${cfg.menu}";
"${cfg.modifier}+space" = "exec ${cfg.menu}";
"${cfg.modifier}+Shift+c" = "reload";
"${cfg.modifier}+Shift+q" = "exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
"${cfg.modifier}+Shift+r" = "restart";
# Focus
"${cfg.modifier}+h" = "focus left";
"${cfg.modifier}+j" = "focus down";
"${cfg.modifier}+k" = "focus up";
"${cfg.modifier}+l" = "focus right";
"${cfg.modifier}+p" = "focus output left";
"${cfg.modifier}+n" = "focus output right";
# Moving
"${cfg.modifier}+Shift+h" = "move left";
"${cfg.modifier}+Shift+j" = "move down";
"${cfg.modifier}+Shift+k" = "move up";
"${cfg.modifier}+Shift+l" = "move right";
# Workspaces
"${cfg.modifier}+1" = "workspace number 1";
"${cfg.modifier}+2" = "workspace number 2";
"${cfg.modifier}+3" = "workspace number 3";
"${cfg.modifier}+4" = "workspace number 4";
"${cfg.modifier}+5" = "workspace number 5";
"${cfg.modifier}+6" = "workspace number 6";
"${cfg.modifier}+7" = "workspace number 7";
"${cfg.modifier}+8" = "workspace number 8";
"${cfg.modifier}+9" = "workspace number 9";
"${cfg.modifier}+0" = "workspace number 10";
"${cfg.modifier}+Shift+1" = "move container to workspace number 1";
"${cfg.modifier}+Shift+2" = "move container to workspace number 2";
"${cfg.modifier}+Shift+3" = "move container to workspace number 3";
"${cfg.modifier}+Shift+4" = "move container to workspace number 4";
"${cfg.modifier}+Shift+5" = "move container to workspace number 5";
"${cfg.modifier}+Shift+6" = "move container to workspace number 6";
"${cfg.modifier}+Shift+7" = "move container to workspace number 7";
"${cfg.modifier}+Shift+8" = "move container to workspace number 8";
"${cfg.modifier}+Shift+9" = "move container to workspace number 9";
"${cfg.modifier}+Shift+0" = "move container to workspace number 10";
"${cfg.modifier}+Control+j" = "workspace prev";
"${cfg.modifier}+Control+k" = "workspace next";
"${cfg.modifier}+Control+Shift+j" = "move workspace to output left";
"${cfg.modifier}+Control+Shift+k" = "move workspace to output right";
# Splits
"${cfg.modifier}+b" = "split h";
"${cfg.modifier}+v" = "split v";
# Layouts
"${cfg.modifier}+s" = "layout stacking";
"${cfg.modifier}+w" = "layout tabbed";
"${cfg.modifier}+e" = "layout toggle split";
"${cfg.modifier}+f" = "fullscreen toggle";
"${cfg.modifier}+a" = "focus parent";
"${cfg.modifier}+d" = "floating toggle";
"${cfg.modifier}+Shift+d" = "focus mode_toggle";
# Scratchpad
# "${cfg.modifier}+Shift+minus" = "move scratchpad";
# "${cfg.modifier}+minus" = "scratchpad show";
# Resize mode
"${cfg.modifier}+r" = "mode resize";
# Outer gaps
"${cfg.modifier}+equal" = "gaps horizontal current minus 200; gaps vertical current minus 100";
"${cfg.modifier}+minus" = "gaps horizontal current plus 200; gaps vertical current plus 100";
"${cfg.modifier}+bracketright" = "gaps outer current set 5";
"${cfg.modifier}+bracketleft" = "gaps horizontal current set 800; gaps vertical current set 400";
# Dropdown term
"${cfg.modifier}+grave" = "[instance=\"dropdown\"] scratchpad show; [instance=\"dropdown\"] move position center";
"${cfg.modifier}+Escape" = "[instance=\"dropdown\"] scratchpad show; [instance=\"dropdown\"] move position center";
# Multimedia Keys
"XF86AudioRaiseVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+";
"XF86AudioLowerVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-";
"XF86AudioMute" = "exec ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
"XF86AudioMicMute" = "exec ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -q set 5%-";
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -q set 5%+";
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
# Screenshot
"Print" = "exec ${pkgs.maim}/bin/maim --select | xclip -selection clipboard -t image/png";
# Programs
"${cfg.modifier}+Shift+v" = "exec ${pkgs.pavucontrol}/bin/pavucontrol";
"${cfg.modifier}+Shift+b" = "exec ${pkgs.blueman}/bin/blueman-manager";
"${cfg.modifier}+Shift+n" = "exec ${pkgs.networkmanagerapplet}/bin/nm-connection-editor";
"${cfg.modifier}+Shift+a" = "exec ${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw";
};
};
extraConfig = ''
exec --no-startup-id ${pkgs.i3}/bin/i3-msg 'workspace 1'
'';
};
};
}

View file

@ -1,176 +0,0 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
polybarFull
];
xdg.configFile."polybar/config.ini" = {
text = ''
[colors]
background = #FFFFFF
background-alt = #D3D3D3
foreground = #000000
primary = #F0C674
secondary = #8ABEB7
blue = #4276b9
alert = #A54242
disabled = #707880
[bar/main]
width = 100%
height = 24pt
radius = 10
background = ''${colors.background}
foreground = ''${colors.foreground}
line-size = 3pt
border-size = 4pt
border-color = #00000000
padding-left = 0
padding-right = 1
module-margin = 1
separator =
separator-foreground = ''${colors.disabled}
font-0 = DejaVuSansM Nerd Font:pixelsize=12;3
modules-left = xworkspaces xwindow
modules-right = systray wlan eth pulseaudio filesystem cpu temperature memory date
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true
[module/systray]
type = internal/tray
format-margin = 8pt
tray-spacing = 4pt
tray-size = 55%
tray-background = ''${colors.blue}
format-background = ''${colors.blue}
format-padding = 10px
format-radius = 5.0
[module/xworkspaces]
type = internal/xworkspaces
label-active = %name%
label-active-background = ''${colors.background-alt}
label-active-padding = 1
label-occupied = %name%
label-occupied-padding = 1
label-urgent = %name%
label-urgent-background = ''${colors.alert}
label-urgent-padding = 1
label-empty = %name%
label-empty-foreground = ''${colors.disabled}
label-empty-padding = 1
[module/xwindow]
type = internal/xwindow
label = %title:0:60:...%
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /home
label-mounted = %free%
format-mounted = <label-mounted>
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <label-volume> <ramp-volume>
label-volume = %percentage%%
label-muted = 󰖁
ramp-volume-0 = 󰕿
ramp-volume-1 = 󰖀
ramp-volume-2 = 󰕾
click-right = pavucontrol
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
label-layout = %layout%
label-layout-foreground = ''${colors.primary}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-foreground = ''${colors.background}
label-indicator-background = ''${colors.secondary}
[module/memory]
type = internal/memory
interval = 2
label = %gb_used:2%
format = <label>
format-margin = 5px
[module/temperature]
type = internal/temperature
internal = 1
warn-temperature = 80
format-warn-padding = 10px
format = <label> <ramp>
format-warn = <label-warn> <ramp>
format-warn-background = #eb4d4b
format-warn-foreground = #ffffff
ramp-0 =
ramp-1 =
ramp-2 =
[module/cpu]
type = internal/cpu
interval = 2
label = %percentage:2%%
format = <label>
[network-base]
type = internal/network
interval = 5
format-connected = <label-connected>
format-disconnected = <label-disconnected>
[module/wlan]
inherit = network-base
interface-type = wireless
label-connected = %signal%
label-disconnected = 󰖪
[module/eth]
inherit = network-base
interface-type = wired
label-connected = eth 󰈁
label-disconnected = 󰈂
[module/date]
type = internal/date
interval = 1
date = %a %b %d %H:%M
label = %date%
[settings]
screenchange-reload = true
pseudo-transparency = true
; vim:ft=dosini
'';
};
}

View file

@ -1,50 +0,0 @@
{ config, pkgs, lib, ... }:
let
common = (import ../common.nix) { pkgs = pkgs; lib = lib; };
inherit (config.lib.formats.rasi) mkLiteral;
in
{
programs.rofi = {
enable = true;
font = common.font + " " + common.font-size;
location = "center";
extraConfig = {
show-icons = mkLiteral "true";
};
theme = {
"prompt" = {
"text-color" = mkLiteral common.colorschemes.default.inactive;
};
"textbox-prompt-colon" = {
expand = false;
str = ":";
margin = mkLiteral "0px 0.3em 0em 0em";
"text-color" = mkLiteral common.colorschemes.default.inactive;
};
"inputbar" = {
"padding" = mkLiteral "10px 20px 10px 20px";
"border" = mkLiteral "0px 0px 1px dash 0px";
"border-color" = mkLiteral common.colorschemes.default.activeDark;
"children" = map mkLiteral [ "prompt" "textbox-prompt-colon" "entry" ];
};
"listview" = {
"padding" = mkLiteral "10px";
};
"element" = {
"padding" = mkLiteral "10px";
};
"element-text" = {
"margin" = mkLiteral "0px 0px 0px 20px";
};
} // lib.foldl'
(acc: elem: acc // {
${elem} = { "background-color" = mkLiteral common.colorschemes.default.activeDark; };
})
{ }
(lib.mapCartesianProduct ({ a, b, c }: lib.concatStringsSep "." [ a b c ]) {
a = [ "element" "element-text" "element-icon" ];
b = [ "selected" ];
c = [ "normal" "urgent" "active" ];
});
};
}

View file

@ -1,57 +0,0 @@
{ pkgs, lib, ... }:
let
common = (import ../common.nix) {
pkgs = pkgs;
lib = lib;
};
alabaster-theme-patch = builtins.toFile "alabaster.patch" ''
diff --git a/alabaster.toml b/alabaster.toml
index df312d3..f5e5499 100644
--- a/alabaster.toml
+++ b/alabaster.toml
@@ -2,11 +2,11 @@
# author tonsky
[colors.primary]
-background = '#F7F7F7'
+background = '#FFFFFF'
foreground = '#434343'
[colors.cursor]
-text = '#F7F7F7'
+text = '#FFFFFF'
cursor = '#434343'
[colors.normal]
'';
alacritty-theme-patched = pkgs.alacritty-theme.overrideAttrs (
final: previous: { patches = [ alabaster-theme-patch ]; }
);
in
{
programs.alacritty = {
enable = true;
settings = {
import = [
# Available themes:
# https://github.com/alacritty/alacritty-theme
"${alacritty-theme-patched}/alabaster.toml"
];
env.TERM = "xterm-256color";
font = {
size = 12;
normal = {
family = common.font;
};
};
scrolling.multiplier = 5;
selection.save_to_clipboard = true;
window = {
padding = {
x = 5;
y = 5;
};
};
};
};
}

View file

@ -1,64 +0,0 @@
{ config, pkgs, ... }:
let
icons = {
chromium = ./icons/chromium.png;
spotify = ./icons/spotify.png;
teams = ./icons/teams.png;
outlook = ./icons/outlook.png;
whatsapp = ./icons/whatsapp.png;
};
in
{
programs.chromium = {
enable = true;
package = (pkgs.chromium.override { enableWideVine = true; });
extensions = [
{ id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; } # ublock origin
{ id = "dbepggeogbaibhgnhhndojpepiihcmeb"; } # vimium
];
};
xdg.dataFile = {
"applications/chromium-development.desktop".text = ''
[Desktop Entry]
Type=Application
Name=Chromium (Development Modus)
Exec=${pkgs.chromium}/bin/chromium --allow-file-access-from-files --disable-site-isolation-trials --allow-running-insecure-content --no-referrers --unlimited-storage --user-data-dir=${config.xdg.dataHome}/chromium-development/data --disable-web-security
Terminal=false
Icon=${icons.chromium}
'';
"applications/spotify.desktop".text = ''
[Desktop Entry]
Type=Application
Name=Spotify
Exec=${pkgs.chromium}/bin/chromium --app=https://spotify.com
Terminal=false
Icon=${icons.spotify}
'';
"applications/teams.desktop".text = ''
[Desktop Entry]
Type=Application
Name=Microsoft Teams
Exec=${pkgs.chromium}/bin/chromium --app=https://teams.microsoft.com
Terminal=false
Icon=${icons.teams}
'';
"applications/outlook.desktop".text = ''
[Desktop Entry]
Type=Application
Name=Microsoft Outlook
Exec=${pkgs.chromium}/bin/chromium --app=https://outlook.office365.com/mail
Terminal=false
Icon=${icons.outlook}
'';
"applications/whatsapp.desktop".text = ''
[Desktop Entry]
Type=Application
Name=WhatsApp
Exec=${pkgs.chromium}/bin/chromium --app=https://web.whatsapp.com
Terminal=false
Icon=${icons.whatsapp}
'';
};
}

View file

@ -1,21 +0,0 @@
### `chromium.png`
- Source: [https://commons.wikimedia.org/wiki/File:Chromium_Logo.svg](https://commons.wikimedia.org/wiki/File:Chromium_Logo.svg)
- Licensing
> The Chromium project is published under Creative Commons attribution 2.5 and BSD. The logo is in the public domain, as it does not meet the threshold of originality.
### `outlook.png`
- Source: [https://developer.microsoft.com/en-us/fluentui#/styles/web/m365-product-icons](https://developer.microsoft.com/en-us/fluentui#/styles/web/m365-product-icons)
- Microsoft Fabric Assets License Agreement: [https://aka.ms/fluentui-assets-license](https://aka.ms/fluentui-assets-license)
### `spotify.png`
- Source: [https://commons.wikimedia.org/wiki/File:Spotify_icon.svg](https://commons.wikimedia.org/wiki/File:Spotify_icon.svg)
- Attribution: [https://developer.spotify.com/documentation/design#attribution](https://developer.spotify.com/documentation/design#attribution)
### `teams.png`
- Source: [https://developer.microsoft.com/en-us/fluentui#/styles/web/m365-product-icons](https://developer.microsoft.com/en-us/fluentui#/styles/web/m365-product-icons)
- Attribution: [https://developer.spotify.com/documentation/design#attribution](https://developer.spotify.com/documentation/design#attribution)
### `whatsapp.png`
- Source: [https://commons.wikimedia.org/wiki/File:WhatsApp_logo.svg](https://commons.wikimedia.org/wiki/File:WhatsApp_logo.svg)
- WhatsApp brand assets and guidelines: [https://about.meta.com/brand/resources/whatsapp/whatsapp-brand/](https://about.meta.com/brand/resources/whatsapp/whatsapp-brand/)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View file

@ -1,70 +0,0 @@
{ pkgs
, lib
, nixosConfig
, ...
}:
{
imports = [
./alacritty.nix
./chromium
./discord.nix
./games.nix
./keyring.nix
./kitty.nix
./obs.nix
./vscode.nix
./zathura.nix
];
home.packages =
with pkgs;
[
firefox # a web browser built from firefox source tree
thunderbird # a full-featured e-mail client
gnome.gnome-calendar # simple and beautiful calendar application for gnome
speechd # common interface to speech synthesis - https://support.mozilla.org/en-us/kb/speechd-setup
tor-browser # privacy-focused browser routing traffic through the tor network
qbittorrent # featureful free software bittorrent client
element-desktop # a feature-rich client for matrix.org
bitwarden-desktop # secure and free password manager for all of your devices
telegram-desktop # telegram desktop messaging app
signal-desktop # private, simple, and secure messenger
unstable.zoom-us # zoom.us video conferencing application
gnome.simple-scan # simple scanning utility
gnome.gnome-font-viewer # program that can preview fonts and create thumbnails for fonts
pppdf
feh # a light-weight image viewer
mpv
vlc # cross-platform media player and streaming server
zathura # a highly customizable and functional pdf viewer
neovide # a simple graphical user interface for neovim
gimp # the gnu image manipulation program
(calibre.override { unrarSupport = true; })
libreoffice # comprehensive, professional-quality productivity suite, a variant of openoffice.org
xournalpp # a handwriting notetaking software with pdf annotation support
libsForQt5.okular # kde document viewer
carla # audio plugin host
picard # musicbrainz picard audio file tagger
anki # spaced repetition flashcard program
obsidian # powerful knowledge base that works on top of a local folder of plain text markdown files
]
++ lib.optionals nixosConfig.bchmnn.printing.enable [
system-config-printer # graphical user interface for cups administration
]
++ lib.optionals nixosConfig.services.ratbagd.enable [
piper # gtk frontend for ratbagd mouse config daemon
]
++ lib.optionals nixosConfig.bchmnn.collections.development.enable [
wireshark # powerful network protocol analyzer
jadx # dex to java decompiler
unstable.httptoolkit # http(s) debugging, development & testing tool
android-studio # the official ide for android (stable channel)
];
}

View file

@ -1,6 +0,0 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
vesktop # alternate client for discord with vencord built-in
];
}

View file

@ -1,15 +0,0 @@
{
nixosConfig,
lib,
pkgs,
...
}:
lib.mkIf nixosConfig.bchmnn.collections.games.enable {
home.packages = with pkgs; [
openjdk17 # the open-source java development kit
prismlauncher # a free, open source launcher for minecraft
# retroarchFull # multi-platform emulator frontend for libretro cores
celestia # real-time 3d simulation of space
extremetuxracer # high speed arctic racing game based on tux racer
];
}

View file

@ -1,13 +0,0 @@
{ pkgs, ... }:
{
services.gnome-keyring = {
enable = true;
components = [
"pkcs11"
"secrets"
"ssh"
];
};
home.packages = with pkgs; [ gnome.seahorse ];
}

View file

@ -1,65 +0,0 @@
{ pkgs, lib, ... }:
let
common = (import ../common.nix) {
pkgs = pkgs;
lib = lib;
};
kitty-alabaster-theme-patch = builtins.toFile "kitty-theme-alabaster.patch" ''
diff --git a/themes/Alabaster.conf b/themes/Alabaster.conf
index 7989049..b0c180e 100644
--- a/themes/Alabaster.conf
+++ b/themes/Alabaster.conf
@@ -6,17 +6,17 @@
#: The basic colors
-foreground #000000
-background #f7f7f7
+foreground #434343
+background #ffffff
-selection_foreground #000000
+selection_foreground #434343
selection_background #bfdbfe
#: Cursor colors
-cursor #007acc
-cursor_text_color #bfdbfe
+cursor #434343
+cursor_text_color #ffffff
#: URL underline color when hovering with mouse
@@ -55,8 +55,8 @@ color6 #0083b2
color14 #00aacb
#: white
-color7 #f7f7f7
-color15 #f7f7f7
+color7 #bbbbbb
+color15 #ffffff
#: kitty window border colors and terminal bell colors
'';
kitty-theme-patched = pkgs.kitty-themes.overrideAttrs (
final: previous: { patches = [ kitty-alabaster-theme-patch ]; }
);
in
{
programs.kitty = {
enable = true;
font.name = common.font;
font.size = 12;
shellIntegration = {
enableBashIntegration = true;
enableZshIntegration = true;
};
extraConfig = ''
include ${kitty-theme-patched}/share/kitty-themes/themes/Alabaster.conf
text_composition_strategy legacy
'';
};
}

View file

@ -1,7 +0,0 @@
{ pkgs, ... }:
{
programs.obs-studio = {
enable = true;
plugins = [ pkgs.obs-studio-plugins.wlrobs ];
};
}

View file

@ -1,174 +0,0 @@
{ pkgs, lib, ... }:
let
common = (import ../common.nix) {
pkgs = pkgs;
lib = lib;
};
in
{
programs.vscode = {
enable = true;
enableExtensionUpdateCheck = true;
enableUpdateCheck = false;
extensions = with pkgs.vscode-extensions; [
vscodevim.vim
editorconfig.editorconfig
dbaeumer.vscode-eslint
waderyan.gitblame
bierner.markdown-mermaid
pkief.material-icon-theme
christian-kohler.path-intellisense
johnpapa.vscode-peacock
esbenp.prettier-vscode
bradlc.vscode-tailwindcss
jnoortheen.nix-ide
ms-vscode.cpptools
ms-vscode.cmake-tools
james-yu.latex-workshop
];
userSettings = {
"window.titleBarStyle" = "custom";
"window.menuBarVisibility" = "toggle";
"workbench.colorTheme" = "Default Light Modern";
"workbench.iconTheme" = "material-icon-theme";
"extensions.ignoreRecommendations" = true;
"explorer.confirmDragAndDrop" = false;
"explorer.confirmDelete" = false;
"editor.renderControlCharacters" = true;
"editor.renderWhitespace" = "all";
"editor.renderFinalNewline" = "on";
"editor.tabSize" = 4;
"editor.cursorStyle" = "line";
"editor.insertSpaces" = false;
"editor.lineNumbers" = "on";
"editor.wordSeparators" = "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-";
"editor.wordWrap" = "on";
"editor.suggestSelection" = "first";
"editor.fontFamily" = common.font;
"editor.fontSize" = 16;
"editor.bracketPairColorization.enabled" = true;
"editor.guides.bracketPairs" = "active";
"editor.quickSuggestions" = {
strings = "on";
};
"editor.codeActionsOnSave" = {
".source.organizeImports" = "explicit";
};
"terminal.integrated.fontFamily" = common.font;
"files.exclude" = {
"**/.classpath" = true;
"**/.project" = true;
"**/.settings" = true;
"**/.factorypath" = true;
"**/__pycache__" = true;
};
"vim.normalModeKeyBindingsNonRecursive" = [
{
"before" = [ "<C-p>" ];
"commands" = [ "workbench.action.quickOpen" ];
}
{
"before" = [ "<C-b>" ];
"commands" = [
"workbench.view.explorer"
"workbench.action.toggleSidebarVisibility"
];
}
];
"[html]" = {
"editor.tabSize" = 2;
"editor.insertSpaces" = true;
"editor.defaultFormatter" = "esbenp.prettier-vscode";
};
"[javascript]" = {
"editor.tabSize" = 2;
"editor.insertSpaces" = true;
"editor.defaultFormatter" = "esbenp.prettier-vscode";
};
"[typescript]" = {
"editor.tabSize" = 2;
"editor.insertSpaces" = true;
"editor.defaultFormatter" = "esbenp.prettier-vscode";
};
"[typescriptreact]" = {
"editor.tabSize" = 2;
"editor.insertSpaces" = true;
"editor.defaultFormatter" = "esbenp.prettier-vscode";
};
"[python]" = {
"editor.tabSize" = 4;
"editor.insertSpaces" = true;
"editor.formatOnType" = true;
};
"[yaml]" = {
"editor.insertSpaces" = true;
"editor.tabSize" = 2;
"editor.autoIndent" = "advanced";
};
"[json]" = {
"editor.defaultFormatter" = "vscode.json-language-features";
};
"[jsonc]" = {
"editor.defaultFormatter" = "esbenp.prettier-vscode";
};
"[java]" = {
"editor.defaultFormatter" = "redhat.java";
};
"[markdown]" = {
"editor.defaultFormatter" = "esbenp.prettier-vscode";
};
"[css]" = {
"editor.defaultFormatter" = "esbenp.prettier-vscode";
};
"[nix]" = {
"editor.defaultFormatter" = "jnoortheen.nix-ide";
};
"git.autofetch" = true;
"json.schemaDownload.enable" = true;
"javascript.updateImportsOnFileMove.enabled" = "always";
"typescript.updateImportsOnFileMove.enabled" = "always";
"nix.enableLanguageServer" = true;
"nix.serverPath" = "${pkgs.nil}/bin/nil";
"nix.formatterPath" = "${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt";
};
keybindings = [
{
key = "ctrl+tab";
command = "workbench.action.nextEditor";
}
{
key = "ctrl+shift+tab";
command = "workbench.action.previousEditor";
}
{
key = "alt+left";
command = "workbench.action.navigateBack";
}
{
key = "alt+right";
command = "workbench.action.navigateForward";
}
{
key = "ctrl+escape";
command = "workbench.action.terminal.toggleTerminal";
when = "terminal.active";
}
{
key = "ctrl+f";
command = "editor.action.formatDocument";
when = "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor";
}
];
};
}

View file

@ -1,10 +0,0 @@
{ ... }:
{
# a highly customizable and functional pdf viewer
programs.zathura = {
enable = true;
options = {
selection-clipboard = "clipboard";
};
};
}

View file

@ -1,355 +0,0 @@
{
pkgs,
lib,
config,
nixosConfig,
...
}:
let
cfg = config.wayland.windowManager.sway.config;
common = (import ../common.nix) {
pkgs = pkgs;
lib = lib;
};
in
{
imports = [
./kanshi.nix
./swaync
./wofi.nix
../waybar.nix
];
home.packages = with pkgs; [
brightnessctl # this program allows you read and control device brightness
pavucontrol # pulseaudio volume control
playerctl # command-line utility and library for controlling media players that implement mpris
networkmanagerapplet # networkmanager control applet for gnome
udiskie # removable disk automounter for udisks
dracula-theme # dracula variant of the ant theme
gnome3.adwaita-icon-theme
wl-clipboard # command-line copy/paste utilities for wayland
sway-contrib.grimshot # a helper for screenshots within sway
wdisplays # a graphical application for configuring displays in wayland compositors
wlr-randr # an xrandr clone for wlroots compositors
kanshi # dynamic display configuration tool
nextcloud-client # nextcloud themed desktop client
libsForQt5.kdeconnect-kde # kde connect provides several features to integrate your phone and your computer
system-config-printer # graphical user interface for cups administration
emote # modern emoji picker for linux
];
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;
};
wayland.windowManager.sway = {
enable = true;
wrapperFeatures = {
base = true;
gtk = true;
};
xwayland = true;
extraSessionCommands =
with lib;
with nixosConfig.bchmnn;
''
export CLUTTER_BACKEND=wayland;
export GDK_BACKEND=wayland;
export GDK_DPI_SCALE=1;
export NIXOS_OZONE_WL=1;
export MOZ_ENABLE_WAYLAND=1;
export MOZ_USE_XINPUT2=1;
export XDG_SESSION_TYPE=wayland;
export XDG_CURRENT_DESKTOP=sway;
# sdl
export SDL_VIDEODRIVER=wayland
# qt
export QT_QPA_PLATFORM=wayland-egl
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
# java
export _JAVA_AWT_WM_NONREPARENTING=1
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on";
''
+ optionalString nvidia.enable ''
# nvidia
export WLR_RENDERER=vulkan;
# export LIBVA_DRIVER_NAME,nvidia;
# export GBM_BACKEND=nvidia-drm;
export __GL_GSYNC_ALLOWED=0;
export __GL_VRR_ALLOWED=0;
export __GLX_VENDOR_LIBRARY_NAME=nvidia;
export WLR_NO_HARDWARE_CURSORS=1;
# xwayland compat
export XWAYLAND_NO_GLAMOR=1;
'';
config = {
modifier = "Mod4";
terminal = "${config.programs.kitty.package}/bin/kitty";
menu = "${pkgs.wofi}/bin/wofi";
# TODO for some reason bar only works when used with exec
bars = [ ];
startup = with pkgs; [
# TODO activate with systemd prbly requires a graphical.target?
# { command = "${nixosConfig.systemd.package}/bin/systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP"; }
# { command = "${dbus}/bin/dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway"; }
# { command = "${nixosConfig.systemd.package}/bin/systemctl --user stop xdg-desktop-portal xdg-desktop-portal-wlr"; }
# { command = "${nixosConfig.systemd.package}/bin/systemctl --user start xdg-desktop-portal xdg-desktop-portal-wlr"; }
# { command = "${dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK"; }
{
command = "${config.programs.waybar.package}/bin/waybar -c ${config.xdg.configHome}/waybar/swaybar.json -s ${config.xdg.configHome}/waybar/swaybar.css";
}
{ command = "${dbus}/bin/dbus-update-activation-environment --all"; }
{ command = "${kanshi}/bin/kanshi"; }
{ command = "${networkmanagerapplet}/bin/nm-applet"; }
{ command = "${blueman}/bin/blueman-applet"; }
{ command = "${udiskie}/bin/udiskie --tray"; }
{ command = "${swaynotificationcenter}/bin/swaync"; }
{ command = "${nextcloud-client}/bin/nextcloud"; }
{ command = "${plasma5Packages.kdeconnect-kde}/bin/kdeconnect-indicator"; }
{ command = "${system-config-printer}/bin/system-config-printer-applet"; }
{ command = "${emote}/bin/emote"; }
{ command = "${polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; }
];
input = {
"2:7:SynPS/2_Synaptics_TouchPad" = {
accel_profile = "flat";
dwt = "enabled";
dwtp = "enabled";
tap = "enabled";
natural_scroll = "enabled";
middle_emulation = "enabled";
scroll_factor = "0.3";
};
"2:10:TPPS/2_IBM_TrackPoint" = {
accel_profile = "flat";
scroll_factor = "0.5";
};
};
output = {
"*".bg = "${common.wallpaper.default} fill";
};
left = "h";
down = "j";
up = "k";
right = "l";
keybindings = {
"${cfg.modifier}+Ctrl+Shift+l" = "exec ${pkgs.swaylock-effects}/bin/swaylock --screenshots --clock --indicator --indicator-radius 100 --indicator-thickness 7 --effect-blur 7x5 --effect-vignette 0.5:0.5 --ring-color ffffff --key-hl-color ${common.colorschemes.default._black} --line-color 00000000 --inside-color 00000088 --inside-ver-color ${common.colorschemes.default._white} --separator-color 00000000 --text-color ${common.colorschemes.default._white} --fade-in 0.1";
# Basics
"${cfg.modifier}+Return" = "exec ${cfg.terminal}";
"${cfg.modifier}+q" = "kill";
"${cfg.modifier}+Space" = "exec ${cfg.menu}";
"${cfg.modifier}+Shift+c" = "reload";
"${cfg.modifier}+Shift+q" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
# Focus
"${cfg.modifier}+${cfg.left}" = "focus left";
"${cfg.modifier}+${cfg.down}" = "focus down";
"${cfg.modifier}+${cfg.up}" = "focus up";
"${cfg.modifier}+${cfg.right}" = "focus right";
"${cfg.modifier}+p" = "focus output left";
"${cfg.modifier}+n" = "focus output right";
# Moving
"${cfg.modifier}+Shift+${cfg.left}" = "move left";
"${cfg.modifier}+Shift+${cfg.down}" = "move down";
"${cfg.modifier}+Shift+${cfg.up}" = "move up";
"${cfg.modifier}+Shift+${cfg.right}" = "move right";
# Workspaces
"${cfg.modifier}+1" = "workspace number 1";
"${cfg.modifier}+2" = "workspace number 2";
"${cfg.modifier}+3" = "workspace number 3";
"${cfg.modifier}+4" = "workspace number 4";
"${cfg.modifier}+5" = "workspace number 5";
"${cfg.modifier}+6" = "workspace number 6";
"${cfg.modifier}+7" = "workspace number 7";
"${cfg.modifier}+8" = "workspace number 8";
"${cfg.modifier}+9" = "workspace number 9";
"${cfg.modifier}+0" = "workspace number 10";
"${cfg.modifier}+Shift+1" = "move container to workspace number 1";
"${cfg.modifier}+Shift+2" = "move container to workspace number 2";
"${cfg.modifier}+Shift+3" = "move container to workspace number 3";
"${cfg.modifier}+Shift+4" = "move container to workspace number 4";
"${cfg.modifier}+Shift+5" = "move container to workspace number 5";
"${cfg.modifier}+Shift+6" = "move container to workspace number 6";
"${cfg.modifier}+Shift+7" = "move container to workspace number 7";
"${cfg.modifier}+Shift+8" = "move container to workspace number 8";
"${cfg.modifier}+Shift+9" = "move container to workspace number 9";
"${cfg.modifier}+Shift+0" = "move container to workspace number 10";
"${cfg.modifier}+Control+${cfg.down}" = "workspace prev";
"${cfg.modifier}+Control+${cfg.up}" = "workspace next";
"${cfg.modifier}+Control+Shift+${cfg.down}" = "move workspace to output left";
"${cfg.modifier}+Control+Shift+${cfg.up}" = "move workspace to output right";
# Splits
"${cfg.modifier}+b" = "splith";
"${cfg.modifier}+v" = "splitv";
# Layouts
"${cfg.modifier}+s" = "layout stacking";
"${cfg.modifier}+w" = "layout tabbed";
"${cfg.modifier}+e" = "layout toggle split";
"${cfg.modifier}+f" = "fullscreen toggle";
"${cfg.modifier}+a" = "focus parent";
"${cfg.modifier}+d" = "floating toggle";
"${cfg.modifier}+Shift+d" = "focus mode_toggle";
# Scratchpad
"${cfg.modifier}+Shift+minus" = "move scratchpad";
"${cfg.modifier}+minus" = "scratchpad show";
# Resize mode
"${cfg.modifier}+r" = "mode resize";
# Multimedia Keys
"XF86AudioRaiseVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+";
"XF86AudioLowerVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-";
"XF86AudioMute" = "exec ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
"XF86AudioMicMute" = "exec ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -q set 5%-";
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl -q set 5%+";
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
# Screenshot
"Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
# Programs
"${cfg.modifier}+Shift+v" = "exec ${pkgs.pavucontrol}/bin/pavucontrol";
"${cfg.modifier}+Shift+b" = "exec ${pkgs.blueman}/bin/blueman-manager";
"${cfg.modifier}+Shift+n" = "exec ${pkgs.networkmanagerapplet}/bin/nm-connection-editor";
"${cfg.modifier}+Shift+a" = "exec ${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw";
"${cfg.modifier}+period" = "exec ${pkgs.emote}/bin/emote";
};
fonts = {
names = [ common.font ];
style = "Bold";
size = 12.0;
};
seat = {
"*" = {
xcursor_theme = "macOS-Monterey 32";
};
};
window = {
titlebar = false;
border = 4;
};
colors = {
focused = {
border = common.colorschemes.default.active;
background = common.colorschemes.default.active;
text = common.colorschemes.default.black;
indicator = common.colorschemes.default.activeDark;
childBorder = common.colorschemes.default.active;
};
focusedInactive = {
border = common.colorschemes.default.inactive;
background = common.colorschemes.default.inactive;
text = common.colorschemes.default.white;
indicator = common.colorschemes.default.inactive;
childBorder = common.colorschemes.default.inactive;
};
unfocused = {
border = common.colorschemes.default.inactiveDark;
background = common.colorschemes.default.inactiveDark;
text = common.colorschemes.default.white;
indicator = common.colorschemes.default.inactiveDark;
childBorder = common.colorschemes.default.inactiveDark;
};
urgent = {
border = common.colorschemes.default.alert;
background = common.colorschemes.default.alert;
text = common.colorschemes.default.white;
indicator = common.colorschemes.default.black;
childBorder = common.colorschemes.default.alert;
};
placeholder = {
border = common.colorschemes.default.active;
background = common.colorschemes.default.active;
text = common.colorschemes.default.black;
indicator = common.colorschemes.default.activeDark;
childBorder = common.colorschemes.default.active;
};
};
};
extraConfig = ''
for_window [title="Firefox Sharing Indicator"] {
floating enable
}
for_window [title="Bluetooth Devices"] {
floating enable
resize set 700px 450px
move position 100ppt 0
move left 700px
}
for_window [title="Volume Control"] {
floating enable
resize set 700px 450px
move position 100ppt 0
move left 700px
}
for_window [app_id="nm-connection-editor" title="Network Connections"] {
floating enable
resize set 700px 450px
move position 100ppt 0
move left 700px
}
for_window [app_id="thunderbird" title="Reminder"] {
floating enable
resize set 700px 450px
move position 100ppt 0
move left 700px
}
for_window [app_id="com.nextcloud.desktopclient.nextcloud" title="Nextcloud"] {
floating enable
resize set 700px 450px
move position 100ppt 0
move left 700px
}
for_window [title="Extension: \(Gopass Bridge\) - gopass bridge Mozilla Firefox"] {
floating enable
resize set 700px 450px
move position 100ppt 0
move left 700px
}
set $ddterm-id dropdown-terminal
set $ddterm ${cfg.terminal} --class $ddterm-id
set $ddterm-resize resize set 100ppt 40ppt, move position 0 0
# resize/move new dropdown terminal windows
for_window [app_id="$ddterm-id"] {
floating enable
$ddterm-resize
move to scratchpad
scratchpad show
}
# show existing or start new dropdown terminal
bindsym ${cfg.modifier}+grave exec swaymsg '[app_id="$ddterm-id"] scratchpad show' || $ddterm && sleep .1 && swaymsg '[app_id="$ddterm-id"] $ddterm-resize'
bindsym ${cfg.modifier}+Escape exec swaymsg '[app_id="$ddterm-id"] scratchpad show' || $ddterm && sleep .1 && swaymsg '[app_id="$ddterm-id"] $ddterm-resize'
# ^-- resize again, case moving to different output
workspace 1
'';
};
}

View file

@ -1,72 +0,0 @@
{ ... }:
{
services.kanshi = {
enable = true;
# TODO: profiles is deprecated
profiles = {
nomad = {
outputs = [
{
criteria = "LVDS-1";
status = "enable";
}
];
};
iroh = {
outputs = [
{
criteria = "DP-3";
status = "enable";
mode = "2560x1440";
position = "0,0";
}
{
criteria = "DP-2";
status = "enable";
mode = "2560x1440";
position = "2560,0";
}
{
criteria = "DP-1";
status = "enable";
mode = "2560x1440";
position = "5120,0";
}
];
};
station = {
outputs = [
{
criteria = "LVDS-1";
status = "disable";
}
{
criteria = "DP-3";
# criteria = "Dell Inc. DELL U2515H 9X2VY5490XUL";
status = "enable";
mode = "1920x1080";
position = "0,0";
}
{
criteria = "DP-2";
# criteria = "Dell Inc. DELL U2515H 9X2VY5C7138L";
status = "enable";
mode = "1920x1080";
position = "1920,0";
}
{
criteria = "VGA-1";
# criteria = "HJW VGA TO HDMI 0x00000100";
status = "enable";
mode = "1920x1080";
position = "3840,0";
}
];
};
};
};
}

View file

@ -1,94 +0,0 @@
{
"positionX": "right",
"positionY": "top",
"notification-icon-size": 64,
"notification-body-image-height": 100,
"notification-body-image-width": 200,
"timeout": 10,
"timeout-low": 5,
"timeout-critical": 0,
"fit-to-screen": true,
"keyboard-shortcuts": true,
"image-visibility": "when-available",
"transition-time": 200,
"hide-on-clear": false,
"hide-on-action": true,
"script-fail-notify": true,
"widgets": [
"mpris",
"volume",
"backlight",
"title",
"dnd",
"notifications"
],
"widget-config": {
"title": {
"text": "Notifications",
"clear-all-button": true,
"button-text": "Clear All"
},
"dnd": {
"text": "Do Not Disturb"
},
"label": {
"max-lines": 1,
"text": "Notification Center"
},
"mpris": {
"image-size": 96,
"image-radius": 12
},
"volume": {
"label": "󰕾 "
},
"backlight": {
"label": "󰃟 "
},
"buttons-grid": {
"actions": [
{
"label": "󰐥",
"command": "systemctl poweroff"
},
{
"label": "󰜉",
"command": "systemctl reboot"
},
{
"label": "󰌾",
"command": "swaylock"
},
{
"label": "󰍃",
"command": "swaymsg exit"
},
{
"label": "󰏥",
"command": "systemctl suspend"
},
{
"label": "󰕾",
"command": "pactl set-sink-mute @DEFAULT_SINK@ toggle"
},
{
"label": "󰍬",
"command": "pactl set-source-mute @DEFAULT_SOURCE@ toggle"
},
{
"label": "󰖩",
"command": "iwgtk"
},
{
"label": "󰂯",
"command": "blueman-manager"
},
{
"label": "",
"command": "kooha"
}
]
}
}
}

View file

@ -1,5 +0,0 @@
{
imports = [
./swaync.nix
];
}

View file

@ -1,340 +0,0 @@
@define-color cc-bg rgba(0, 0, 0, 1);
@define-color noti-border-color rgba(255, 255, 255, 0.15);
@define-color noti-bg rgb(17, 17, 27);
@define-color noti-bg-darker rgb(43, 43, 57);
@define-color noti-bg-hover rgb(27, 27, 43);
@define-color noti-bg-focus rgba(27, 27, 27, 0.6);
@define-color noti-close-bg rgba(255, 255, 255, 0.1);
@define-color noti-close-bg-hover rgba(255, 255, 255, 0.15);
@define-color text-color rgba(169, 177, 214, 1);
@define-color text-color-disabled rgb(150, 150, 150);
@define-color bg-selected rgb(0, 128, 255);
* {
font-family: DejaVuSansM Nerd Font;
font-weight: bolder;
}
.control-center .notification-row:focus,
.control-center .notification-row:hover {
opacity: 1;
background: @noti-bg-darker
}
.notification-row {
outline: none;
}
.notification {
border-radius: 12px;
margin: 10px;
padding: 0;
border: 2px solid #7aa2f7
}
.notification-content {
background: transparent;
padding: 10px;
border-radius: 12px
}
.close-button {
background: @noti-close-bg;
color: @text-color;
text-shadow: none;
padding: 0;
border-radius: 100%;
margin-top: 10px;
margin-right: 16px;
box-shadow: none;
border: none;
min-width: 24px;
min-height: 24px
}
.close-button:hover {
box-shadow: none;
background: @noti-close-bg-hover;
transition: all .15s ease-in-out;
border: none
}
.notification-default-action,
.notification-action {
padding: 4px;
margin: 0;
box-shadow: none;
background: @noti-bg;
border: none;
color: @text-color;
transition: all .15s ease-in-out
}
.notification-default-action:hover,
.notification-action:hover {
-gtk-icon-effect: none;
background: @noti-bg-hover
}
.notification-default-action {
border-radius: 12px
}
.notification-default-action:not(:only-child) {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0
}
.notification-action {
border-radius: 0;
border-top: none;
border-right: none
}
.notification-action:first-child {
border-bottom-left-radius: 10px;
background: #1b1b2b
}
.notification-action:last-child {
border-bottom-right-radius: 10px;
background: #1b1b2b
}
.inline-reply {
margin-top: 8px
}
.inline-reply-entry {
background: @noti-bg-darker;
color: @text-color;
caret-color: @text-color;
border: 1px solid @noti-border-color;
border-radius: 12px
}
.inline-reply-button {
margin-left: 4px;
background: @noti-bg;
border: 1px solid @noti-border-color;
border-radius: 12px;
color: @text-color
}
.inline-reply-button:disabled {
background: initial;
color: @text-color-disabled;
border: 1px solid transparent
}
.inline-reply-button:hover {
background: @noti-bg-hover
}
.body-image {
margin-top: 6px;
background-color: #fff;
border-radius: 12px
}
.summary {
font-size: 16px;
font-weight: 700;
background: transparent;
color: rgba(158, 206, 106, 1);
text-shadow: none
}
.time {
font-size: 16px;
font-weight: 700;
background: transparent;
color: @text-color;
text-shadow: none;
margin-right: 18px
}
.body {
font-size: 15px;
font-weight: 400;
background: transparent;
color: @text-color;
text-shadow: none
}
.control-center {
background: @cc-bg;
border: 1px solid #7aa2f7;
border-radius: 10px;
}
.control-center-list {
background: transparent
}
.control-center-list-placeholder {
opacity: .5
}
.floating-notifications {
background: transparent
}
.blank-window {
background: alpha(black, 0.25)
}
.widget-title {
color: @text-color;
margin: 10px;
font-size: 1.5rem
}
.widget-title>button {
font-size: initial;
color: @text-color;
text-shadow: none;
background: @noti-bg;
border: 1px solid @noti-border-color;
box-shadow: none;
border-radius: 12px
}
.widget-title>button:hover {
background: @noti-bg-hover
}
.widget-dnd {
color: @text-color;
margin: 10px;
font-size: 1.1rem
}
.widget-dnd>switch {
font-size: initial;
border-radius: 12px;
background: @noti-bg;
border: 1px solid @noti-border-color;
box-shadow: none
}
.widget-dnd>switch:checked {
background: @bg-selected
}
.widget-dnd>switch slider {
background: @noti-bg-hover;
border-radius: 12px
}
.widget-label {
margin: 10px;
}
.widget-label>label {
font-size: 1.5rem;
color: @text-color;
}
.widget-mpris {
color: @text-color;
background: @noti-bg-darker;
padding: 10px;
margin: 10px;
border-radius: 10px;
}
.widget-mpris-player {
padding: 8px;
margin: 8px
}
.widget-mpris-title {
font-weight: 700;
font-size: 1.25rem
}
.widget-mpris-subtitle {
font-size: 1.1rem
}
.widget-buttons-grid {
font-size: x-large;
padding: 8px;
margin: 20px 10px 10px;
border-radius: 12px;
background: @noti-bg-darker;
}
.widget-buttons-grid>flowbox>flowboxchild>button {
margin: 3px;
background: #343b58;
border-radius: 12px;
color: @text-color
}
.widget-buttons-grid>flowbox>flowboxchild>button:hover {
/* background: @noti-bg-hover; */
color: rgba(158, 206, 106, 1)
}
.widget-menubar>box>.menu-button-bar>button {
border: none;
background: transparent
}
.topbar-buttons>button {
border: none;
background: transparent
}
.widget-volume {
background: @noti-bg-darker;
padding: 8px;
margin: 10px;
border-radius: 12px;
font-size: x-large;
color: @text-color
}
.widget-volume>box>button {
background: transparent;
border: none
}
.per-app-volume {
background-color: @noti-bg;
padding: 4px 8px 8px;
margin: 0 8px 8px;
border-radius: 12px
}
.widget-backlight {
background: @noti-bg-darker;
padding: 8px;
margin: 10px;
border-radius: 12px;
font-size: x-large;
color: @text-color
}
.widget-inhibitors {
margin: 8px;
font-size: 1.5rem
}
.widget-inhibitors>button {
font-size: initial;
color: @text-color;
text-shadow: none;
background: @noti-bg;
border: 1px solid @noti-border-color;
box-shadow: none;
border-radius: 12px
}
.widget-inhibitors>button:hover {
background: @noti-bg-hover
}

View file

@ -1,13 +0,0 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
swaynotificationcenter
libnotify
];
xdg.configFile = {
"swaync/config.json".source = ./config.json;
"swaync/style.css".source = ./style.css;
};
}

View file

@ -1,69 +0,0 @@
{ pkgs, lib, ... }:
let
common = (import ../common.nix) {
pkgs = pkgs;
lib = lib;
};
in
{
programs.wofi = {
enable = true;
settings = {
show = "drun";
allow_images = true;
image_size = 24;
no_actions = true;
};
style = ''
* {
font-family: '${common.font}', monospace;
font-size: ${common.font-size}px;
color: ${common.colorschemes.default.black};
}
window {
background-color: transparent;
}
#input {
background-color: ${common.colorschemes.default.active};
border: 5px;
border-color: ${common.colorschemes.default.activeDark};
border-radius: 0px;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 20px;
padding-right: 20px;
margin-bottom: 10px;
}
#scroll {
background-color: ${common.colorschemes.default.active};
border: 5px;
border-color: ${common.colorschemes.default.activeDark};
border-radius: 0px;
padding: 10px;
}
#entry {
padding: 10px;
}
#entry #text {
margin-left: 20px;
}
#entry:selected {
background-color: ${common.colorschemes.default.activeDark};
}
#entry:selected #img {
background-color: ${common.colorschemes.default.activeDark};
}
#entry:selected #text {
background-color: ${common.colorschemes.default.activeDark};
}
'';
};
}

View file

@ -1,396 +0,0 @@
{ pkgs, nixosConfig, lib, ... }:
let
check-battery = pkgs.writeShellScript "check-battery" ''
bat=/sys/class/power_supply/BAT0
CRIT=''${1:-15}
FILE=~/.config/waybar/.notified.target
stat=$(cat $bat/status)
perc=$(cat $bat/capacity)
if [[ $perc -le $CRIT ]] && [[ $stat == "Discharging" ]]; then
if [[ ! -f "$FILE" ]]; then
notify-send --urgency=critical --icon=dialog-warning "Battery Low" "Current charge: $perc%"
touch $FILE
fi
elif [[ -f "$FILE" ]]; then
rm $FILE
fi
'';
vpn-dryb-org-status = pkgs.writeShellScript "vpn-dryb-org-status" ''
if ${nixosConfig.systemd.package}/bin/systemctl is-active wg-quick-vpn.dryb.org > /dev/null 2>&1; then
echo " "
else
echo " "
fi
'';
vpn-dryb-org-toggle = pkgs.writeShellScript "vpn-dryb-org-toggle" ''
if ${nixosConfig.systemd.package}/bin/systemctl is-active wg-quick-vpn.dryb.org > /dev/null 2>&1; then
pkexec ${nixosConfig.systemd.package}/bin/systemctl stop wg-quick-vpn.dryb.org
else
pkexec ${nixosConfig.systemd.package}/bin/systemctl start wg-quick-vpn.dryb.org
fi
'';
in
{
xdg.configFile = {
"waybar/swaybar.json".text = ''
[
{
"backlight": {
"device": "intel_backlight",
"format": "{percent}% {icon} ",
"format-icons": [
"󰌶",
"󱩎",
"󱩏",
"󱩐",
"󱩑",
"󱩒",
"󱩓",
"󱩔",
"󱩕",
"󱩖",
"󰛨"
]
},
"battery": {
"format": "{capacity}% {icon} ",
"format-alt": "{time} {icon} ",
"format-charging": "{capacity}% 󰂄 ",
"format-icons": [
"󰂃",
"󰁺",
"󰁻",
"󰁼",
"󰁽",
"󰁾",
"󰁿",
"󰂀",
"󰂁",
"󰂂",
"󰁹"
],
"format-plugged": "{capacity}% ",
"on-update": "${check-battery}",
"states": {
"critical": 15,
"warning": 30
}
},
"clock": {
"format": "{:%a %b %d %H:%M}",
"timezones": [
"Europe/Berlin"
],
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
},
"custom/mem": {
"exec": "free -h | awk '/Mem:/{printf $3}'",
"format": "{} 󰍛 ",
"interval": 3,
"tooltip": false
},
"custom/separator": {
"format": "|",
"interval": "once",
"tooltip": false
},
"disk": {
"format": "{specific_free:0.0f}GB ",
"unit": "GB"
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"sway/window": {
"format": "{title}",
},
"sway/workspaces": {
"disable-scroll": true,
"persistent-workspaces": {
"1": [],
"2": [],
"3": [],
"4": [],
"5": [],
"6": [],
"7": [],
"8": [],
"9": [],
"10": [],
}
},
"layer": "top",
"modules-center": [
],
"modules-left": [
"sway/workspaces",
"sway/window",
"sway/mode"
],
"modules-right": [
"tray",
"network",
${lib.optionalString (nixosConfig.bchmnn.collections.vpn.enable && nixosConfig.bchmnn.collections.vpn.dryborg.enable) "\"custom/vpndryborg\","}
"custom/separator",
"pulseaudio",
"custom/separator",
"disk",
"custom/separator",
"custom/mem",
"custom/separator",
"temperature",
"custom/separator",
"backlight",
"custom/separator",
"battery",
"custom/separator",
"clock"
],
"name": "swaybar",
"network": {
"format": "{ifname}",
"format-disconnected": "󰈂",
"format-ethernet": "eth 󰈁",
"format-wifi": "{signalStrength}% ",
"interval": 1,
"tooltip-format": "{ifname} via {gwaddr} 󰈁",
"tooltip-format-disconnected": "Disconnected",
"tooltip-format-ethernet": "{ifname} ",
"tooltip-format-wifi": "{essid} ({signalStrength}%) "
},
"custom/vpndryborg": {
"exec": "${vpn-dryb-org-status}",
"interval": 10,
"on-click": "${vpn-dryb-org-toggle}",
},
"pulseaudio": {
"format": "{volume}% {icon} {format_source}",
"format-bluetooth": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": "󰖁 {icon} {format_source}",
"format-icons": {
"car": "",
"default": [
"󰕿",
"󰖀",
"󰕾"
],
"hands-free": "󰋎",
"headphone": "",
"headset": "󰋎",
"phone": "",
"portable": ""
},
"format-muted": "󰖁 {format_source}",
"format-source": "{volume}% ",
"format-source-muted": " ",
"on-click": "${pkgs.pavucontrol}/bin/pavucontrol",
"reverse-scrolling": 1
},
"temperature": {
"critical-threshold": 80,
"format": "{temperatureC}°C {icon} ",
"format-icons": [
"",
"",
"",
"",
""
],
"tooltip": false
},
"tray": {
"icon-size": 16,
"show-passive-items": true,
"spacing": 4
}
}
]
'';
"waybar/swaybar.css".text = ''
window.swaybar,
window.swaybar * {
border: none;
font-family: DejaVuSansM Nerd Font;
font-size: 13px;
}
window.swaybar #custom-separator {
padding-right: 6px;
color: #d3d3d3;
}
window.swaybar#waybar {
background: linear-gradient(to bottom, #ffffff, #f9f9f9);
}
window.swaybar#waybar.hidden {
opacity: 0.2;
}
window.swaybar #workspaces {
padding-left: 8px;
padding-right: 8px;
margin-right: 8px;
transition: none;
}
window.swaybar #workspaces button {
transition: none;
color: black;
background: transparent;
padding: 2px;
/* font-size: 18px; */
border-radius: 0px;
}
window.swaybar #workspaces button.empty {
color: #7c818c;
}
window.swaybar #workspaces button.persistent {
/* font-size: 12px; */
}
window.swaybar #workspaces button.visible {
color: black;
/* font-size: 18px; */
}
window.swaybar #workspaces button.focused {
background: lightgray;
}
window.swaybar #workspaces button:hover {
color: white;
background: black;
}
window.swaybar #window {
padding-left: 8px;
padding-right: 8px;
transition: none;
color: black;
background: transparent;
}
window.swaybar #mode {
padding-left: 16px;
padding-right: 16px;
transition: none;
color: black;
background: transparent;
}
window.swaybar #tray {
margin-right: 10px;
padding-left: 10px;
padding-right: 10px;
border-radius: 10px;
transition: none;
color: white;
background: rgb(66, 118, 185);
}
window.swaybar #network {
padding-left: 6px;
transition: none;
color: black;
background: transparent;
}
window.swaybar #custom-vpndryborg {
padding-right: 6px;
transition: none;
color: black;
background: transparent;
}
window.swaybar #pulseaudio {
transition: none;
color: black;
background: transparent;
}
window.swaybar #pulseaudio.muted {
color: gray;
}
window.swaybar #disk {
transition: none;
color: black;
background: transparent;
}
window.swaybar #custom-mem {
transition: none;
color: black;
background: transparent;
}
window.swaybar #temperature {
transition: none;
color: black;
background: transparent;
}
window.swaybar #temperature.critical {
color: #eb4d4b;
}
window.swaybar #backlight {
transition: none;
color: black;
background: transparent;
}
window.swaybar #battery {
transition: none;
color: black;
background: transparent;
}
window.swaybar #battery.charging {
color: #ffffff;
background-color: #26A65B;
}
window.swaybar #battery.warning:not(.charging) {
background-color: #ffbe61;
color: black;
}
window.swaybar #battery.critical:not(.charging) {
background-color: #f53c3c;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
window.swaybar #clock {
padding-right: 6px;
margin-right: 8px;
transition: none;
color: black;
background: transparent;
}
@keyframes blink {
to {
background-color: #ffffff;
color: #000000;
}
}
'';
};
programs.waybar = {
enable = true;
};
}

View file

@ -1,4 +0,0 @@
{ pkgs, ... }:
{
home.file.".XCompose".source = "${pkgs.keyd}/share/keyd/keyd.compose";
}

View file

@ -1,38 +0,0 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
gcc
nodejs_20
tree-sitter # parser generator tool and an incremental parsing library
lua-language-server # language server that offers lua language support
clang-tools # standalone command line tools for c++ development
rust-analyzer # modular compiler frontend for the rust language
rustfmt # tool for formatting rust code according to style guidelines
gopls # official language server for the go language
nixd # nix language server
nil # yet another language server for nix
nixfmt-rfc-style # official formatter for nix code
pyright # type checker for the python language
ruff # an extremely fast python linter
black # uncompromising python code formatter
isort # python utility / library to sort python imports
vscode-langservers-extracted # html/css/json/eslint language servers extracted from vscode
nodePackages.typescript-language-server
tailwindcss-language-server
nodePackages.prettier # prettier is an opinionated code formatter
prettierd # prettier, as a daemon, for improved formatting speed
texlab # implementation of the language server protocol for latex
yamlfmt # extensible command line tool or library to format yaml files
yamlfix # python yaml formatter that keeps your comments
marksman # language server for markdown
markdownlint-cli2 # fast, flexible, configuration-based command-line interface for linting markdown/commonmark files with the markdownlint library
mdformat # commonmark compliant markdown formatter
jdt-language-server # java language server
];
programs.neovim = {
enable = true;
package = pkgs.unstable.neovim-unwrapped;
defaultEditor = true;
vimAlias = true;
};
}

View file

@ -1,8 +0,0 @@
{ pkgs, nixosConfig, ... }:
{
imports = [ ./pomodoro.nix ];
home.packages = [
(import ./git-clone-list.nix { inherit pkgs; })
(import ./nix-update.nix { inherit pkgs nixosConfig; })
];
}

View file

@ -1,63 +0,0 @@
{ pkgs }:
pkgs.writeShellScriptBin "git-clone-list" ''
reset="\e[0m"
bold="\e[1m"
underline="\e[4m"
red="\e[31m"
green="\e[32m"
XPATH='//*[@id="user-list-repositories"]//a[not(@class)]/@href'
function help_screen {
echo
echo -e "''${bold}''${underline}Usage:''${reset} ''${bold}$0''${reset} <USER> <LIST>"
echo
echo -e "''${bold}''${underline}Arguments''${reset}:"
echo -e " ''${bold}USER''${reset} Github username of target user"
echo -e " ''${bold}LIST''${reset} List name of target list"
echo
}
function error {
echo
echo -e "''${red}>>> ''${bold}Error''${reset}''${red}: $1''${reset}"
if [ "$2" == "help" ]; then
help_screen
fi
exit 1
}
if [ $# -ne 2 ]; then
error "Expected 2 arguments, got $#" help
fi
USER=$1
LIST=$2
NOT_VISITED=("/stars/$USER/lists/$LIST?page=1")
VISITED=()
REPOS=()
while [[ "''${#NOT_VISITED[@]}" != 0 ]]; do
echo -e "''${green}>>> Fetching https://github.com''${NOT_VISITED[0]} ...''${reset}"
while IFS= read -r line; do
VISITED+=("''${NOT_VISITED[0]}")
unset NOT_VISITED[0]
if [[ "$line" == "/stars/$USER/lists/$LIST"* ]]; then
if [[ ! "''${VISITED[@]}" =~ "''${line}" ]]; then
NOT_VISITED+=("$line")
fi
else
REPOS+=("$line")
fi
done < <(${pkgs.xidel}/bin/xidel "https://github.com''${NOT_VISITED[0]}" --xpath $XPATH)
done
IT=1
for repo in "''${REPOS[@]}"; do
echo -e "''${green}>>> [$IT/''${#REPOS[@]}] Cloning https://github.com$repo.git ...''${reset}"
${pkgs.git}/bin/git clone "https://github.com$repo.git" "''${repo:1}"
IT=$((IT + 1))
done
''

View file

@ -1,37 +0,0 @@
{ pkgs, nixosConfig }:
pkgs.writeShellScriptBin "nuf" ''
reset="\e[0m"
red="\e[31m"
green="\e[32m"
yellow="\e[33m"
white_bold="\e[1;37m"
tmp=$(mktemp -d)
function error {
rm -rf tmp
echo ""
echo -e "''${red}>>> ''${bold}Error''${reset}''${red}: $1''${reset}"
exit 1
}
FLAKE=$(readlink -f /etc/nixos)
echo -e "''${green}>>> Updating flake $FLAKE ...''${reset}"
${nixosConfig.nix.package}/bin/nix flake update --flake "$FLAKE" || error "Updating failed"
cd $tmp
echo ""
echo -e "''${green}>>> Building configuration ...''${reset}"
nixos-rebuild build --flake "$FLAKE" || error "Building failed"
echo ""
echo -e "''${green}>>> Running diff ...''${reset}";
${pkgs.nvd}/bin/nvd diff /run/current-system result || error "Diff failed"
cd - > /dev/null
rm -rf $tmp
echo ""
echo -e "''${yellow}>>> The new configuration has not been activated.''${reset}"
echo -e "''${yellow}>>> Use ''${white_bold}nixos-rebuild switch''${reset}''${yellow} to activate.''${reset}"
''

View file

@ -1,19 +0,0 @@
{ pkgs, ... }:
let
pootis = ./pootis.m4a;
in
{
home.packages = [
pkgs.openpomodoro-cli
(pkgs.writeShellScriptBin "pomostart" ''
clear
${pkgs.openpomodoro-cli}/bin/openpomodoro-cli start --wait $@
while ${pkgs.mpv}/bin/mpv ${pootis} > /dev/null 2>&1; do :; done
'')
(pkgs.writeShellScriptBin "pomobreak" ''
clear
${pkgs.openpomodoro-cli}/bin/openpomodoro-cli break --wait $@
while ${pkgs.mpv}/bin/mpv ${pootis} > /dev/null 2>&1; do :; done
'')
];
}

View file

@ -1,61 +0,0 @@
{
nixosConfig,
lib,
pkgs,
...
}:
{
home.file.".XCompose".source = "${pkgs.keyd}/share/keyd/keyd.compose";
programs.ssh = {
enable = true;
addKeysToAgent = "yes";
includes = [ "config.d/*" ];
matchBlocks.momo = {
host = "momo";
hostname = "momo.dryb.org";
user = "root";
};
};
home.file.".ssh/config.d/.keep".source = builtins.toFile "keep" "";
services.ssh-agent = {
enable = true;
};
programs.tmux = {
enable = true;
newSession = true;
terminal = "screen-256color";
clock24 = true;
escapeTime = 0;
historyLimit = 10000;
mouse = true;
keyMode = "vi";
};
programs.eza = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
programs.fzf = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
programs.yazi = {
enable = true;
};
home.packages = [
pkgs.exiftool
pkgs.mediainfo
] ++ lib.optionals nixosConfig.bchmnn.gui.enable [ pkgs.ueberzugpp ];
}

View file

@ -1,42 +0,0 @@
{ config, ... }:
{
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
oh-my-zsh = {
enable = true;
theme = "terminalparty";
plugins = [
"git"
"z"
];
};
history = {
path = "${config.xdg.dataHome}/zsh/histfile";
size = 10000;
save = 10000;
};
initContent = ''
nix_dev_env() {
FLAKE="$PWD/flake.nix"
[[ -z "$CURRENT_FLAKE_ENV" ]] && \
[[ -f $FLAKE ]] && \
echo -n "Enter nix develop? (Y/N): " && \
read confirm && \
[[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] && \
ZSH_PREFIX="$ZSH_PREFIX(flake)" \
CURRENT_FLAKE_ENV=$FLAKE \
nix develop -c $SHELL
}
autoload -U add-zsh-hook
add-zsh-hook chpwd nix_dev_env
export PS1="$ZSH_PREFIX$PS1"
'';
};
}

View file

@ -1,7 +0,0 @@
{
imports = [
./flare-solvarr.nix
./jackett.nix
./syncthing.nix
];
}

View file

@ -1,26 +0,0 @@
{ config, lib, ... }:
{
options.bchmnn.services.flare-solvarr = {
enable = lib.mkEnableOption "flare-solvarr";
};
config = lib.mkIf (config.bchmnn.services.flare-solvarr.enable) {
virtualisation = {
oci-containers = {
containers = {
flare-solvarr = {
image = "ghcr.io/flaresolverr/flaresolverr:latest";
autoStart = true;
ports = [ "127.0.0.1:8191:8191" ];
environment = {
LOG_LEVEL = "info";
LOG_HTML = "false";
CAPTCHA_SOLVER = "hcaptcha-solver";
TZ = "Europe/Berlin";
};
};
};
};
};
};
}

View file

@ -1,12 +0,0 @@
{ config, lib, ... }:
{
options.bchmnn.services.jackett = {
enable = lib.mkEnableOption "jackett";
};
config = {
services.jackett = {
enable = config.bchmnn.services.jackett.enable;
};
};
}

View file

@ -1,89 +0,0 @@
{ lib, config, ... }: {
options.bchmnn.services.syncthing = {
enable = lib.mkEnableOption "syncthing";
};
config = lib.mkIf (config.bchmnn.services.syncthing.enable) {
services.syncthing = {
enable = true;
openDefaultPorts = true;
settings = {
devices = {
T430 = {
id = "UGQINNI-SC6F24X-5JE7YTP-LZLORTX-7GQ5NKK-YMRDRPK-JHRTWUV-4ILUJQQ";
};
IROH = {
id = "PJA2MBA-66PQQEO-5KICONS-FGHDH46-YRV2X5Y-47UUP77-QXI2WNS-R33FPAK";
};
};
folders = {
"dl" = {
path = "~/dl";
id = "z97eb-myxtp";
devices = [
"IROH"
"T430"
];
};
"docs" = {
path = "~/docs";
id = "rhh6x-dmymv";
devices = [
"IROH"
"T430"
];
};
"music" = {
path = "~/music";
id = "umzur-ncrf6";
devices = [
"IROH"
"T430"
];
};
"orgfiles" = {
path = "~/orgfiles";
id = "0f5t9-dl5l5";
devices = [ ];
versioning = {
type = "simple";
params.keep = "5";
};
};
"pics" = {
path = "~/pics";
id = "cuejs-esf7u";
devices = [
"IROH"
"T430"
];
};
"tmp" = {
path = "~/tmp";
id = "d6k5d-hdxyh";
devices = [
"IROH"
"T430"
];
};
"vids" = {
path = "~/vids";
id = "bjx9u-ujjwi";
devices = [
"IROH"
"T430"
];
};
};
};
user = "gandalf";
group = "users";
dataDir = "/home/gandalf";
};
};
}

View file

@ -1,19 +0,0 @@
{ pkgs }:
pkgs.stdenv.mkDerivation {
pname = "iglesia-light-typeface";
version = "1.009";
src = ./iglesia-light.zip;
unpackPhase = ''
runHook preUnpack
${pkgs.unzip}/bin/unzip $src
runHook postUnpack
'';
installPhase = ''
runHook preInstall
install -Dm644 Iglesia\ Light.ttf -t $out/share/fonts/truetype
runHook postInstall
'';
}

Binary file not shown.

View file

@ -1,121 +0,0 @@
{
pkgsi686Linux,
stdenv,
fetchurl,
dpkg,
makeWrapper,
coreutils,
ghostscript,
gnugrep,
gnused,
which,
perl,
lib,
}:
let
model = "mfcl3750cdw";
version = "1.0.2-0";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf103934/${model}pdrv-${version}.i386.deb";
sha256 = "3a0d5f09a265208fdd1b8266ef36286ec294c7a4befa327be81141efabe8590b";
};
reldir = "opt/brother/Printers/${model}/";
in
rec {
driver = pkgsi686Linux.stdenv.mkDerivation rec {
inherit src version;
name = "${model}drv-${version}";
nativeBuildInputs = [
dpkg
makeWrapper
];
unpackPhase = "dpkg-deb -x $src $out";
installPhase = ''
dir="$out/${reldir}"
substituteInPlace $dir/lpd/filter_${model} \
--replace /usr/bin/perl ${perl}/bin/perl \
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \
--replace "PRINTER =~" "PRINTER = \"${model}\"; #"
wrapProgram $dir/lpd/filter_${model} \
--prefix PATH : ${
lib.makeBinPath [
coreutils
ghostscript
gnugrep
gnused
which
]
}
# need to use i686 glibc here, these are 32bit proprietary binaries
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
$dir/lpd/brmfcl3750cdwfilter
'';
meta = {
description = "Brother ${lib.strings.toUpper model} driver";
homepage = "http://www.brother.com/";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
platforms = [
"x86_64-linux"
"i686-linux"
];
maintainers = [ lib.maintainers.bchmnn ];
};
};
cupswrapper = stdenv.mkDerivation rec {
inherit version src;
name = "${model}cupswrapper-${version}";
nativeBuildInputs = [
dpkg
makeWrapper
];
unpackPhase = "dpkg-deb -x $src $out";
installPhase = ''
basedir=${driver}/${reldir}
dir=$out/${reldir}
substituteInPlace $dir/cupswrapper/brother_lpdwrapper_${model} \
--replace /usr/bin/perl ${perl}/bin/perl \
--replace "basedir =~" "basedir = \"$basedir\"; #" \
--replace "PRINTER =~" "PRINTER = \"${model}\"; #"
wrapProgram $dir/cupswrapper/brother_lpdwrapper_${model} \
--prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
gnused
]
}
mkdir -p $out/lib/cups/filter
mkdir -p $out/share/cups/model
ln $dir/cupswrapper/brother_lpdwrapper_${model} $out/lib/cups/filter
chmod 755 $out/lib/cups/filter/brother_lpdwrapper_${model}
ln $dir/cupswrapper/brother_${model}_printer_en.ppd $out/share/cups/model
chmod 644 $dir/cupswrapper/brother_${model}_printer_en.ppd
'';
meta = {
description = "Brother ${lib.strings.toUpper model} CUPS wrapper driver";
homepage = "http://www.brother.com/";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.gpl2;
platforms = [
"x86_64-linux"
"i686-linux"
];
maintainers = [ lib.maintainers.bchmnn ];
};
};
}

View file

@ -1,36 +0,0 @@
{
pkgs,
lib,
buildPythonApplication,
python3Packages,
}:
buildPythonApplication {
pname = "pppdf";
version = "1.0.0";
src = ./pppdf.py;
nativeBuildInputs = [
pkgs.wrapGAppsHook
pkgs.gobject-introspection
];
propagatedBuildInputs = with python3Packages; [
pkgs.gtk3
pygobject3
notify2
pikepdf
];
dontUnpack = true;
format = "other";
installPhase = ''
install -D $src $out/bin/pppdf
'';
meta = with lib; {
description = "PDF Postprocessor";
license = licenses.mit;
};
}

View file

@ -1,105 +0,0 @@
#!/usr/bin/env python
import sys
import math
try:
import notify2
except:
print('Missing library: notify2')
exit(1)
notify2.init('pppdf')
try:
import pikepdf
except:
notify2.Notification('pppdf', 'Missing library: pikepdf').show()
print('Missing library: pikepdf')
exit(1)
try:
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
except:
notify2.Notification('pppdf', 'Missing library: gi').show()
print('Missing library: gi')
exit(1)
if len(sys.argv) != 5:
notify2.Notification('pppdf', 'Error: invalid arguments.').show()
print('Error: invalid arguments.')
print(f'Usage: {sys.argv[0]} <mime> <keep_original=true|false> <file> <mode=zip|rzip>')
exit(1)
mime = sys.argv[1]
keep = sys.argv[2]
source = sys.argv[3]
mode = sys.argv[4]
if mime != 'application/pdf':
notify2.Notification('pppdf', 'Error: Only support for pdf.').show()
print('Error: Only support for pdf.')
exit(1)
def pppdf_zip():
try:
with pikepdf.open(source) as pdf:
target = pikepdf.Pdf.new()
n = len(pdf.pages)
if mode == "zip":
pattern = [i // 2 if i % 2 == 0 else math.ceil(n / 2) + i // 2 for i in range(n)]
else:
pattern = [i // 2 if i % 2 == 0 else n - (i // 2) - 1 for i in range(n)]
print(pattern)
for i in pattern:
target.pages.append(pdf.pages[i])
if keep != "false":
pdf.save(source + ".orig")
target.save(source)
notify2.Notification('pppdf', f'Success: {source}').show()
except Exception as error:
notify2.Notification('pppdf', f'Error: {error}').show()
class Dialog(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="pppdf")
self.set_border_width(6)
label = Gtk.Label(label=f"Do you want to zip {source}?")
btn_cancel = Gtk.Button(label="Cancel")
btn_ok = Gtk.Button(label="Ok")
btn_cancel.connect("clicked", self.on_btn_cancel_clicked)
btn_ok.connect("clicked", self.on_btn_ok_clicked)
buttons = Gtk.Box(spacing=6)
buttons.pack_start(btn_cancel, True, True, 0)
buttons.pack_start(btn_ok, True, True, 0)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
vbox.pack_start(label, True, True, 0)
vbox.pack_start(buttons, True, True, 0)
self.add(vbox)
def on_btn_cancel_clicked(self, widget):
Gtk.main_quit()
def on_btn_ok_clicked(self, widget):
pppdf_zip()
Gtk.main_quit()
win = Dialog()
win.connect("destroy", Gtk.main_quit)
win.show_all()
Gtk.main()

Binary file not shown.

Binary file not shown.

View file

@ -1,11 +0,0 @@
age-encryption.org/v1
-> ssh-ed25519 OFTJeQ 43xP1etGPRzdPx6rcyWVFCkCGXPzIrComUkCX/vWSyw
7tVn1PWYYEHlr5pRMHxGP22HD+qkFjYLSdhOMvl5Oi0
-> ssh-ed25519 lfMVeg W3Rg1jh2oQn4m1uYINIgDjckcqlAJR+IEVQui1W5lQI
OsjRimwMvNnZjNNP1wvch9OASv1J1tIZxKzX84qkWyM
-> ssh-ed25519 2ycGcg quNiWDcpbWVp+CMeYeKERxAg9ja3eJerVYAfe0UsekE
Ly4bO3+d3OPwp2+nwlUFV/GHCz4iFZ60gbG3wf7pWKY
-> ssh-ed25519 SiBV3Q Uy5VWXVnurVcNX3ViTEH5ZOgvgQ3/Cvhe6yheTFwMwg
8AAPcUlFgHoaO7p7B+KQGGwr8j2oS1iD8Q45yQ7iSiE
--- wAAzGaI6w5sx4T6zaQNjXayifi3aRy0R8Xf/0jbDlks
±n‡KxŽœ Ãxþì%ÉQ´ÀeÅ™ÜR%AŒ3ã[îë5MÌ/ùF]ø¨ ?è¦{þNת9߯¿MãÞ±[ãhç9Â

View file

@ -1,11 +0,0 @@
age-encryption.org/v1
-> ssh-ed25519 OFTJeQ GLjSObPnRwi54E90PLmN56+01/XWV4ncMb2hIQVAIRM
K5wnX6U4R7vWxJIAhR46Y93nYbfY8ywgCBTpl32h3Ok
-> ssh-ed25519 lfMVeg P/y5kw0684nepV8zw7AVrKJdVXp1m9QRB92emoZtgic
3jdvPwfHqNCipa4FZCheRyloGTpl+nWopB+VmYxmnEo
-> ssh-ed25519 2ycGcg i/V1Jxl9MZXbkFceyTx/jA5mgt55u6pXvyZMUnJKnSI
mzZDa0QvpixtEyk7kR98a2MBTHq3FXLIifQ/RH7WsIo
-> ssh-ed25519 SiBV3Q 3ihfgMuU8fsUkCHOjhg9+lZxK3hreLV+OD38nfJvNVQ
TzKuRHW2Za7NLK32MFzXlXlBJnyTvaL7907Fv42s2/k
--- fMhdIsuJ19h9GqERg+zyub8z2L46vIoIb/RF3NC3Izs
¨Qg¢yzË„×1„Ör¤…&ºÊ¿MÁÞV9*<2A>T#ÇýŸ`¦î:TÅQt™£„ ÓãÆ 92$vR_ ïQ„4såßÀçFfü4

Binary file not shown.

View file

@ -1,11 +1,9 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 OFTJeQ YV3PYBAAYyXqFKJZMzgWcvUiUMr0FXT1mIVu5c8ADi0 -> ssh-ed25519 lfMVeg KYxe9LfXHJdQ0bNc4jJzdw8GWt2No5SAD/EhCS4WizI
iYOSAD0fp2AQx2xYrwZVKz8jcxLI6dZaUYAEeRco6n0 FuOQwe2bsRDX2fMjGvMc6ohqo2bv27uN9JqElDH1vJg
-> ssh-ed25519 lfMVeg aTw9/kKTrhfe3wuJU61+4WWhu0boEmNQW4PH4WymfQc -> ssh-ed25519 ueRyzQ KgPSJHqqyNwHwXEKZMX07snnP1OfBnmXOzuX6y/82iE
pW37WMQO10S9gn4FPlNQ9I8SZiJ8zrN539WjZ5riG4U gut+JtZcJwhApWyMxgz2up09t17LYtvMkG6qlcoqa70
-> ssh-ed25519 ueRyzQ jduJfxSB+1+TXaoZQk8IC2OluzEhIf2PKLrqgZPgPgU -> ssh-ed25519 IYnDOQ gp1xljiJX0+XgEjLWN+/EYSnaoKPsu0cALIF8/xw7mQ
DFnKYH1DGcvdBblibUO+1apJ6658bUJOsb+ZCVPScy0 +l8Yq+MpYCVcgWaqImYfh8jlk75Dy2j2IIyPwZS1MtU
-> ssh-ed25519 IYnDOQ ccAK15UhEam0UtwKEPpjPdIOdOFmBRY6riNAaoUNfRE --- QY5mphM8NXs+DiQUxausWZu4jdzUmjZ3Lp0OmN+sTSU
RqOsV0RIp8kB+pDQeidONMviP4dKu1hiwTR73oa3Uxo âÕ¡&ù-®ÌÞŒò~œ™ Ì#[wà\ë@)ž~<°–Á¡Ï- ­ØR#Ò¯ŸÏªç;äå•5VÜ•Û]y‡ l$<1A>{
--- 67ZWOJB/9Zc7tUTHgVFFMWWeHOU6RzIf2HN2qXH05RQ
IÄ%8!Fê;ww¿ò¡kÌKÿ}¹¥äÇÚÿó?K ùÁõާdÊ ÈyÇþ.ù¼ÐN$»›£fçeŠðü‡?rÇò­

View file

@ -1,11 +1,11 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 OFTJeQ zu/Z3Jjsp9LUDluqsyFRfrtyx25CJfaB7YSiWeixaE8 -> ssh-ed25519 lfMVeg ejjgNEnMOnPNlvp6kHNN4+FTaURnw/khEyk71q4pmX4
B8R9N60TGdYFe9oXWX1GKRJBSpehsu70u4uuMWYCkmY GO80ST5fOV2OggwXXnRxahancZJnSOE6XhKIzanf6xM
-> ssh-ed25519 lfMVeg SktuSFyOhvs3Jep9d887h10G3apitW8GlgdRu0oU3ls -> ssh-ed25519 ueRyzQ 4Wl+WB42XSsp6vplm22uAEeWP9TqxMcdmjlFGr7dCAo
VANNJvU26oAObZg57h3Obv9yoIfbQ/DFFksbweBYRVI /IO0WGVrMQOaFq61E+xp9Lxdv2qRhvrabNV0UUqZ5QI
-> ssh-ed25519 ueRyzQ CzMPQtcTRuuobFUCcWFyEkrYSzkQjKVbCzaNxFPAGzI -> ssh-ed25519 IYnDOQ UM+pMKLlneDup00dYXRz3vIWY5LTbFRhpKE2KkT5RFM
dX42KzXBiOJtxeqpuCAau3BNO1E2jgZRrOOiRunaDTA 2/c1gonJkrk5Cwngks/Ib+IVNOWSuJmX4YymwvYv4x8
-> ssh-ed25519 IYnDOQ S0Egu7LuyglXA+OOKJg2deiJfDhSL68rCOikePhF+hg --- fUKSKeqg8Y9qCdKg0lZpL1OPZDkRgnmsHo16owGX1nM
PYQw7EQmZjrPaC0nFVBFlB8CKITs3Tvop9rxlOcwbAw ïÍn
--- 0SrXMJm5nglzTOGU/AFV20kCqjz2LW5/52t9AWqFmj0 š3dì„k²G4ÿóÊÉ@QñHá6?,4Td"P ˆÿ ß`º| ;`ÖRŸgt¯
©VC1<·y ñbE9%n»œxm}æûI·ñ vmÓ}Úó´âr#XFnw\Kèÿ±RQ=k![l×Gôã B>ð‡pg²Oüì7Ïo/¬“uéæD ]?‰M7Ó·úàÐþ<C390>Æ@•¢KäPÑt¶

View file

@ -1,11 +1,9 @@
age-encryption.org/v1 age-encryption.org/v1
-> ssh-ed25519 OFTJeQ Z0zahyJ9ZN+iPyEGZcdqkctRGtZHedg0n9hpw7yCr1w -> ssh-ed25519 lfMVeg LnoTe3EM6B9iXxL6z0BRFHpa7UzeEhNH6K9nGW2GAis
tTaDe8+Ki2S7v3F/+0KgJ6EyS89WETy3/pSWUf3qA2g C77evlxRiuTFAJndkDjL9f0QS6x3CkRx3GBPCeti8ww
-> ssh-ed25519 lfMVeg 7yJmsdpEXhgRekyoMU5Ut62hvo7sI+ZyLoasrzjtOmI -> ssh-ed25519 ueRyzQ xDzexTaFs/fUt3Chf1AIHB6KkN944nBeUJIIR4pvm3s
qpH5kucqYFin9PZw38am7WkJWH+Cp0C7em22QiQsQJ4 ScebFDfdumOMra06dZVmbyjYFixhe5u/DKg/wV2z4e0
-> ssh-ed25519 ueRyzQ WGMVo2WuCuHNTZ6/a+3cPOXU50EEK/yhnyX//IrtUx8 -> ssh-ed25519 IYnDOQ /pr2IGfP21ykKhbgLS2dp0rM7cvdrXIvgd4QQ9fpsC0
2t+CUgdBuivea8Ij4tavUQTX2mzTpIUz/8FuweVJ6uA bzC1mZLv4QBm9ZsrTHpTOeXULeHHFHIMXCDKkz/+L3I
-> ssh-ed25519 IYnDOQ P5amA/utlNaNK4/YP1L3RkL/k1N0MtucTobGZxeKqw8 --- kDGYqTWOOMZbuBZbTvogm2jlTyZEByPSYqzj7xnt8Uo
TBwo9Y/YTzJxw0rmzz6V1W8kmQYHw8YNt+/MLOQalyM ¦ÖLþ´x3îJfOŽUŸû0y†?e#3Þè&b]8qâá=ZïoßÝ+!MÉ~KàåS¦ðOÝи³!ˆ¯Ç¬@à
--- Ykljx1ff/c4OkoyHs4rzrKnfIEuAW3zM5MCk5p/UT1g
†„.˜ÁÙ gåã:Õ¸¾…ód–§«¾J·¿~ËxíYe߬<C39F>ù,”«@<¹CKk0†w`¼rÆ~} K

View file

@ -1,42 +1,22 @@
let let
APPA = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGvQbYHiB17BfsvHBgPYJN50Th+da+rtbsTIjOSaT+1Y root@APPA"; APPA = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGvQbYHiB17BfsvHBgPYJN50Th+da+rtbsTIjOSaT+1Y root@APPA";
gandalf_at_appa = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFrE1fMXjJXI8f1mKvhLquwSsb4tvLh5Tq0n+yOakQks gandalf@appa.dryb.com";
MOMO = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOQ8YOOaQj3NnMlTjlFX9iWDIpPMrO2W4EkL65GJP+y4 root@MOMO"; MOMO = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOQ8YOOaQj3NnMlTjlFX9iWDIpPMrO2W4EkL65GJP+y4 root@MOMO";
T430 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGPQKzUqdLY58tFTB5zOeiTjbbrDvHA1speD/Rg6oOfz root@T430";
IROH = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFYiK3Dl8QvAZfY7Cl1OlF9aXKa/an32mtrCNkavlSNG root@IROH";
gandalf = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAOG8Sja2i6nepkEkuxYdu86XbT9vS5uniBmZifSMZ0t jacob.bachmann@posteo.de"; gandalf = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAOG8Sja2i6nepkEkuxYdu86XbT9vS5uniBmZifSMZ0t jacob.bachmann@posteo.de";
users = [ users = [
gandalf_at_appa
gandalf gandalf
]; ];
systems = [
APPA
MOMO
T430
IROH
];
servers = [ servers = [
APPA APPA
MOMO MOMO
]; ];
clients = [
T430
IROH
];
in in
{ {
"environments/acme.age".publicKeys = users ++ servers; "environments/acme.age".publicKeys = users ++ servers;
"environments/vaultwarden.age".publicKeys = users ++ servers; "environments/vaultwarden.age".publicKeys = users ++ servers;
"keys/wireguard/dryborg/privatekey.age".publicKeys = users ++ clients;
"keys/wireguard/dryborg/presharedkey.age".publicKeys = users ++ clients;
"passwords/anki/admin.age".publicKeys = users ++ servers; "passwords/anki/admin.age".publicKeys = users ++ servers;
"passwords/ddclient/cloudflare.age".publicKeys = users ++ servers; "passwords/ddclient/cloudflare.age".publicKeys = users ++ servers;
"passwords/gitea/db.age".publicKeys = users ++ servers; "passwords/gitea/db.age".publicKeys = users ++ servers;