diff --git a/flake.lock b/flake.lock index b828a1c..9cb91d8 100644 --- a/flake.lock +++ b/flake.lock @@ -86,27 +86,6 @@ "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": { "locked": { "lastModified": 1755330281, @@ -159,7 +138,6 @@ "inputs": { "agenix": "agenix", "disko": "disko", - "home-manager": "home-manager_2", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable" diff --git a/flake.nix b/flake.nix index 79aa79d..bc50437 100644 --- a/flake.nix +++ b/flake.nix @@ -4,10 +4,6 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; - home-manager = { - url = "github:nix-community/home-manager/release-25.05"; - inputs.nixpkgs.follows = "nixpkgs"; - }; agenix = { url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -42,10 +38,8 @@ nixosConfigurations = nixpkgs.lib.mergeAttrsList ( nixpkgs.lib.forEach [ "APPA" - "IROH" "MOMO" "PABU" - "T430" ] mkSystem ); }; diff --git a/hosts/APPA/default.nix b/hosts/APPA/default.nix index 951489c..bf5bd98 100644 --- a/hosts/APPA/default.nix +++ b/hosts/APPA/default.nix @@ -12,12 +12,6 @@ ]; bchmnn = { - git = { - signing = { - key = "0x7753026D577922A6"; - }; - }; - collections = { cli-utils.enable = true; }; @@ -38,4 +32,6 @@ }; }; }; + + documentation.nixos.enable = false; } diff --git a/hosts/IROH/default.nix b/hosts/IROH/default.nix deleted file mode 100644 index 6ee3d31..0000000 --- a/hosts/IROH/default.nix +++ /dev/null @@ -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; - }; - }; - -} diff --git a/hosts/IROH/hardware.nix b/hosts/IROH/hardware.nix deleted file mode 100644 index d95d906..0000000 --- a/hosts/IROH/hardware.nix +++ /dev/null @@ -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; -} diff --git a/hosts/PABU/default.nix b/hosts/PABU/default.nix index a792173..f31015d 100644 --- a/hosts/PABU/default.nix +++ b/hosts/PABU/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, modulesPath, ... }: { +{ lib, pkgs, modulesPath, ... }@inputs: { imports = [ (modulesPath + "/profiles/minimal.nix") ]; # Installing a new system within the nspawn means that the /sbin/init script @@ -63,6 +63,8 @@ # stuff nixfmt-rfc-style + inputs.agenix.packages.x86_64-linux.default + ]; system.stateVersion = "24.05"; diff --git a/hosts/T430/default.nix b/hosts/T430/default.nix deleted file mode 100644 index 3a2ef89..0000000 --- a/hosts/T430/default.nix +++ /dev/null @@ -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; - }; - -} diff --git a/hosts/T430/hardware.nix b/hosts/T430/hardware.nix deleted file mode 100644 index 625e0ed..0000000 --- a/hosts/T430/hardware.nix +++ /dev/null @@ -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; -} diff --git a/modules/core/applications.nix b/modules/core/applications.nix index 6206881..08aa333 100644 --- a/modules/core/applications.nix +++ b/modules/core/applications.nix @@ -15,57 +15,17 @@ pkgs.git # distributed version control system pkgs.gnumake # a tool to control the generation of non-source files from sources pkgs.parallel # shell tool for executing jobs in parallel - pkgs.mercurial # a fast, lightweight scm system for very large distributed projects - 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.neovim # vim text editor fork focused on extensibility and agility 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-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.unzip # an extraction utility for archives compressed in .zip format pkgs.unrar # utility for rar archives 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.hexedit pkgs.gdu # fast disk usage analyzer with console interface written in go 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 ]; } diff --git a/modules/core/audio.nix b/modules/core/audio.nix deleted file mode 100644 index 4f0c948..0000000 --- a/modules/core/audio.nix +++ /dev/null @@ -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 - ]; - }; -} diff --git a/modules/core/bluetooth.nix b/modules/core/bluetooth.nix deleted file mode 100644 index e2ab57a..0000000 --- a/modules/core/bluetooth.nix +++ /dev/null @@ -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; - }; -} diff --git a/modules/core/bsprak.nix b/modules/core/bsprak.nix deleted file mode 100644 index faf32d3..0000000 --- a/modules/core/bsprak.nix +++ /dev/null @@ -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 - ]; - }; - }; - -} diff --git a/modules/core/common.nix b/modules/core/common.nix index 3658978..60f16e1 100644 --- a/modules/core/common.nix +++ b/modules/core/common.nix @@ -4,31 +4,5 @@ la = "eza --group-directories-first --hyperlink --icons -la"; lt = "eza --group-directories-first --hyperlink --icons -la --tree"; 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"; }; } diff --git a/modules/core/default.nix b/modules/core/default.nix index d35fcb6..f44272b 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -2,14 +2,8 @@ { imports = [ ./applications.nix - ./audio.nix - ./bluetooth.nix - ./bsprak.nix - ./keyd.nix ./network.nix - ./nvidia.nix ./power.nix - ./printing.nix ./profiling.nix ./security.nix ./shell.nix @@ -36,10 +30,6 @@ 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 = { @@ -48,17 +38,6 @@ }; }; - # provide libraries for non-nix binaries - # programs.nix-ld = { - # enable = true; - # libraries = [ - # # glibc - # # libcxx - # # libllvm - # # ncurses - # ]; - # }; - system.stateVersion = "23.05"; time.timeZone = "Europe/Berlin"; @@ -80,7 +59,6 @@ services.dbus = { enable = true; packages = with pkgs; [ - gcr # gnome crypto services (daemon and tools) dconf ]; }; diff --git a/modules/core/keyd.nix b/modules/core/keyd.nix deleted file mode 100644 index 9625d6d..0000000 --- a/modules/core/keyd.nix +++ /dev/null @@ -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; - }; - }; - }; -} diff --git a/modules/core/network.nix b/modules/core/network.nix index f5376d1..fbe7417 100644 --- a/modules/core/network.nix +++ b/modules/core/network.nix @@ -17,13 +17,6 @@ enable = lib.mkEnableOption "networkd"; }; }; - collections = { - vpn = { - dryborg = { - enable = lib.mkEnableOption "dryborg"; - }; - }; - }; }; config = { networking = { @@ -34,46 +27,6 @@ NetworkManager-wait-online.enable = false; }; - services.resolved.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; - } - ]; - }; - }; + services.resolved.enable = config.bchmnn.network.nm.enable; }; } diff --git a/modules/core/nvidia.nix b/modules/core/nvidia.nix deleted file mode 100644 index aadadfe..0000000 --- a/modules/core/nvidia.nix +++ /dev/null @@ -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; - }; - }; -} diff --git a/modules/core/power.nix b/modules/core/power.nix index 3d4ea8a..869eef0 100644 --- a/modules/core/power.nix +++ b/modules/core/power.nix @@ -46,7 +46,7 @@ }; services.tlp = { - enable = !builtins.elem "gnome" config.bchmnn.gui.flavour; + enable = true; settings = config.bchmnn.power.tlp.settings; }; diff --git a/modules/core/printing.nix b/modules/core/printing.nix deleted file mode 100644 index d3d1bf7..0000000 --- a/modules/core/printing.nix +++ /dev/null @@ -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"; - }; - }; -} diff --git a/modules/core/shell.nix b/modules/core/shell.nix index b5b9073..ef8b4bf 100644 --- a/modules/core/shell.nix +++ b/modules/core/shell.nix @@ -1,6 +1,4 @@ { - lib, - config, pkgs, ... }: @@ -12,12 +10,6 @@ in enable = true; }; - users.users = lib.mkIf (config.bchmnn.home.enable) { - gandalf = { - shell = pkgs.zsh; - }; - }; - environment = { shellAliases = common.aliases; }; diff --git a/modules/core/virtualisation.nix b/modules/core/virtualisation.nix index 3c8ee10..1af5bc7 100644 --- a/modules/core/virtualisation.nix +++ b/modules/core/virtualisation.nix @@ -7,26 +7,15 @@ lib.mkIf config.bchmnn.collections.virtualisation.enable { virtualisation = { 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 = { enable = true; }; oci-containers = { backend = "docker"; - # backend = "podman"; }; containers = { enable = true; }; }; - hardware.nvidia-container-toolkit.enable = config.bchmnn.nvidia.enable; environment.systemPackages = with pkgs; [ virtiofsd ]; } diff --git a/modules/default.nix b/modules/default.nix index d9872c0..887efc8 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -2,32 +2,6 @@ { 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 = { cli-utils = { enable = mkEnableOption "cli-utils"; @@ -38,22 +12,13 @@ development = { enable = mkEnableOption "development"; }; - vpn = { - enable = mkEnableOption "vpn"; - }; virtualisation = { enable = mkEnableOption "virtualisation"; }; - games = { - enable = mkEnableOption "games"; - }; }; }; imports = [ ./core - ./desktop - ./home-manager - ./services ]; } diff --git a/modules/desktop/applications.nix b/modules/desktop/applications.nix deleted file mode 100644 index 30598eb..0000000 --- a/modules/desktop/applications.nix +++ /dev/null @@ -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; -} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix deleted file mode 100644 index 380d7b5..0000000 --- a/modules/desktop/default.nix +++ /dev/null @@ -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"; }; - }; -} diff --git a/modules/desktop/fonts.nix b/modules/desktop/fonts.nix deleted file mode 100644 index b3ebb16..0000000 --- a/modules/desktop/fonts.nix +++ /dev/null @@ -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 - ]; - }; -} diff --git a/modules/desktop/games.nix b/modules/desktop/games.nix deleted file mode 100644 index 89fb3d0..0000000 --- a/modules/desktop/games.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - pkgs, - config, - lib, - ... -}: -lib.mkIf config.bchmnn.collections.games.enable { - programs.steam = { - enable = true; - }; - - environment.systemPackages = [ - pkgs.mangohud - pkgs.gamemode - ]; -} diff --git a/modules/desktop/nautilus.nix b/modules/desktop/nautilus.nix deleted file mode 100644 index e1ec9ee..0000000 --- a/modules/desktop/nautilus.nix +++ /dev/null @@ -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 - ]; - }; -} diff --git a/modules/home-manager/applications.nix b/modules/home-manager/applications.nix deleted file mode 100644 index 2a5c2d9..0000000 --- a/modules/home-manager/applications.nix +++ /dev/null @@ -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 - ]; -} diff --git a/modules/home-manager/audio.nix b/modules/home-manager/audio.nix deleted file mode 100644 index 9eec7d4..0000000 --- a/modules/home-manager/audio.nix +++ /dev/null @@ -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 - } - } - } - ] - ''; - }; -} diff --git a/modules/home-manager/dconf.nix b/modules/home-manager/dconf.nix deleted file mode 100644 index fd15a37..0000000 --- a/modules/home-manager/dconf.nix +++ /dev/null @@ -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"; - }; - }; - -} diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix deleted file mode 100644 index c0a6786..0000000 --- a/modules/home-manager/default.nix +++ /dev/null @@ -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"; - }; - }; - }; - }; -} diff --git a/modules/home-manager/git.nix b/modules/home-manager/git.nix deleted file mode 100644 index 56c9bb3..0000000 --- a/modules/home-manager/git.nix +++ /dev/null @@ -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; - }; - }; -} diff --git a/modules/home-manager/gnupg.nix b/modules/home-manager/gnupg.nix deleted file mode 100644 index b7bc64f..0000000 --- a/modules/home-manager/gnupg.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs, ... }: -{ - programs.gpg = { - enable = true; - }; - - services.gpg-agent = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - pinentry.package = pkgs.pinentry-gnome3; - }; -} diff --git a/modules/home-manager/gui/common.nix b/modules/home-manager/gui/common.nix deleted file mode 100644 index 6f7d0d1..0000000 --- a/modules/home-manager/gui/common.nix +++ /dev/null @@ -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; - }; -} diff --git a/modules/home-manager/gui/cursor.nix b/modules/home-manager/gui/cursor.nix deleted file mode 100644 index 8442b1a..0000000 --- a/modules/home-manager/gui/cursor.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, ... }: -{ - home.pointerCursor = { - name = "macOS-Monterey"; - package = pkgs.apple-cursor; - size = 32; - gtk.enable = true; - x11.enable = true; - }; -} diff --git a/modules/home-manager/gui/default.nix b/modules/home-manager/gui/default.nix deleted file mode 100644 index 5689edf..0000000 --- a/modules/home-manager/gui/default.nix +++ /dev/null @@ -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 ]; -} diff --git a/modules/home-manager/gui/gtk.nix b/modules/home-manager/gui/gtk.nix deleted file mode 100644 index 655836a..0000000 --- a/modules/home-manager/gui/gtk.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: -{ - gtk = { - enable = true; - gtk3.extraConfig = { - gtk-application-prefer-dark-theme = 0; - }; - gtk4.extraConfig = { - gtk-application-prefer-dark-theme = 0; - }; - }; -} diff --git a/modules/home-manager/gui/i3/autorandr.nix b/modules/home-manager/gui/i3/autorandr.nix deleted file mode 100644 index 8ee920e..0000000 --- a/modules/home-manager/gui/i3/autorandr.nix +++ /dev/null @@ -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"; - }; - }; - }; - }; - }; -} diff --git a/modules/home-manager/gui/i3/default.nix b/modules/home-manager/gui/i3/default.nix deleted file mode 100644 index 7437dc5..0000000 --- a/modules/home-manager/gui/i3/default.nix +++ /dev/null @@ -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' - ''; - }; - }; -} diff --git a/modules/home-manager/gui/i3/polybar.nix b/modules/home-manager/gui/i3/polybar.nix deleted file mode 100644 index b6ed38c..0000000 --- a/modules/home-manager/gui/i3/polybar.nix +++ /dev/null @@ -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 =  - - [module/pulseaudio] - type = internal/pulseaudio - - format-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 =