├── .gitignore ├── hosts ├── default.nix ├── fatalis │ ├── configuration.nix │ └── default.nix ├── hermes │ ├── configuration.nix │ └── default.nix └── zorah │ ├── configuration.nix │ ├── default.nix │ ├── novidia.nix │ ├── nvidia.nix │ └── private.yaml ├── license ├── misc ├── distrobox │ ├── comfy.ini │ ├── hermes.ini │ ├── rocm.ini │ └── zorah.ini ├── git_template ├── gitconfig ├── img │ ├── 20210404.png │ ├── 20210408.jpg │ ├── 20210617.png │ ├── 20210727.png │ ├── 20211010.png │ ├── 20211118.png │ ├── 20211219.png │ ├── 20220222.png │ ├── 20220731.png │ ├── 20221016.png │ ├── 20230129.png │ ├── 20230809.png │ ├── 207px-Home-nixos-logo.webp │ ├── NixOS-smaller.png │ ├── NixOS.png │ ├── alpine.png │ ├── ansi.png │ ├── gentoo-signet-small.png │ ├── gentoo.png │ ├── nixos.ico │ └── void.png ├── lib │ └── default.nix ├── nix-conf-privileged.nix ├── nix-conf.nix ├── nix.conf ├── nixos │ ├── fcitx5.nix │ ├── greetd │ │ ├── .envrc │ │ ├── default.nix │ │ ├── run-desktop.pl │ │ └── shell.nix │ ├── hyprland.nix │ ├── sway.nix │ └── wayland-compositors.nix ├── private │ └── ssh.yaml └── starship.toml ├── modules ├── maid │ ├── containers │ │ ├── default.nix │ │ ├── policy.json │ │ └── registries.conf │ ├── default.nix │ └── gnome │ │ └── default.nix ├── nixos │ ├── _mkUser.nix │ ├── common.nix │ ├── consul.nix │ ├── ddc.nix │ ├── docker.nix │ ├── es.nix │ ├── gnome.nix │ ├── guix │ │ ├── default.nix │ │ └── guix.bordeaux.inria.fr.pub │ ├── hyprland.nix │ ├── incus.nix │ ├── plasma6.nix │ ├── podman.nix │ ├── printing.nix │ ├── silent-boot.nix │ ├── swap.nix │ ├── tailscale.nix │ ├── tmpfs.nix │ ├── tpm2 │ │ ├── default.nix │ │ └── git-key-command.sh │ ├── user-ayats.nix │ ├── user-soch.nix │ └── yubikey │ │ ├── default.nix │ │ └── setup-yubikey.sh └── wrapper-manager │ ├── alacritty │ ├── alacritty.toml │ ├── default.nix │ ├── macchiato.toml │ ├── mocha.toml │ └── theme.toml │ ├── chrome │ └── default.nix │ ├── fish │ ├── default.nix │ ├── fish-on-tmpfs.patch │ ├── interactive.fish │ └── pushd_mod.fish │ ├── foot │ ├── default.nix │ └── foot.ini │ ├── ghostty │ ├── config │ └── default.nix │ ├── git │ ├── default.nix │ ├── git-config-gmail │ └── gnome-accounts-oauth2 │ ├── helix │ ├── config.toml │ └── default.nix │ ├── kitty │ ├── default.nix │ └── kitty.conf │ ├── neofetch │ ├── config.sh │ ├── default.nix │ └── logo │ ├── nushell │ ├── config.nu │ ├── default.nix │ └── env.nu │ ├── nvfetcher │ └── default.nix │ ├── stylua │ ├── default.nix │ └── stylua.toml │ ├── tmux │ ├── default.nix │ └── tmux.conf │ ├── tym │ ├── config.lua │ └── default.nix │ ├── vscode │ └── default.nix │ ├── wezterm │ ├── default.nix │ ├── viper │ │ ├── init.lua │ │ ├── linux.lua │ │ └── windows.lua │ └── wezterm.lua │ └── zellij │ ├── _sources │ ├── generated.json │ └── generated.nix │ ├── config.kdl │ ├── default.nix │ ├── layouts │ └── default.kdl │ └── nvfetcher.toml ├── npins ├── default.nix └── sources.json ├── packages ├── default.nix ├── elfutils-cli │ └── default.nix ├── emacs │ ├── custom.el │ ├── default.nix │ └── init.el ├── env-viper │ └── default.nix ├── guix │ └── default.nix ├── hpc-env │ └── default.nix ├── iosevka-normal │ ├── default.nix │ ├── generated.json │ ├── generated.nix │ └── nvfetcher.toml ├── neovim │ ├── .envrc │ ├── .nvim.lua │ ├── module.nix │ ├── shell.nix │ └── viper-init-plugin │ │ ├── after │ │ ├── plugin │ │ │ └── init.lua │ │ └── queries │ │ │ └── markdown │ │ │ └── highlights.scm │ │ └── lua │ │ └── viper │ │ ├── ai.lua │ │ ├── base.lua │ │ ├── format.lua │ │ ├── health.lua │ │ ├── init.lua │ │ ├── lazy │ │ ├── init.lua │ │ └── specs.lua │ │ ├── lsp.lua │ │ ├── lsp_config.lua │ │ ├── org.lua │ │ ├── tree-sitter.lua │ │ ├── util.lua │ │ └── visual.lua ├── nix-index │ ├── command-not-found.fish │ ├── command-not-found.sh │ └── default.nix ├── overlay.nix ├── wl-clip-persist │ ├── default.nix │ ├── generated.json │ ├── generated.nix │ ├── nvfetcher.toml │ ├── wl-clip-persist-6ba11a2aa295d780f0b2e8f005cf176601d153b0 │ │ └── Cargo.lock │ └── wl-clip-persist-d9fc91734d482e95e80405df8da11547c41881d5 │ │ └── Cargo.lock ├── xdg-ninja │ ├── default.nix │ ├── generated.json │ ├── generated.nix │ └── nvfetcher.toml └── yazi │ ├── default.nix │ └── keymap.toml └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .directory 3 | # ./.vscode/** 4 | *result* 5 | .direnv 6 | *.qcow2 7 | source 8 | node_modules 9 | outputs 10 | build 11 | result* 12 | \#*\# 13 | .venv 14 | *~ 15 | drvPath 16 | .env 17 | __pycache__ 18 | history.txt 19 | *sqlite3* 20 | /*.patch 21 | 22 | flake.json 23 | 24 | .clj-kondo 25 | .lsp 26 | .calva 27 | target 28 | flake/generated.nix 29 | 30 | eln-cache 31 | elpa 32 | 33 | transient 34 | var 35 | .cache 36 | projectile-bookmarks.eld 37 | recentf 38 | *.tar 39 | *.sif 40 | *.elc 41 | -------------------------------------------------------------------------------- /hosts/default.nix: -------------------------------------------------------------------------------- 1 | let 2 | sources = import ../npins; 3 | pkgs = import ../packages; 4 | in 5 | ( 6 | { modules }: 7 | import "${sources.nixpkgs}/nixos/lib/eval-config.nix" { 8 | system = null; 9 | modules = [ 10 | { 11 | config.nixpkgs.pkgs = pkgs; 12 | } 13 | ../modules/nixos/common.nix 14 | "${sources.nix-common}/nixos" 15 | { 16 | disabledModules = [ 17 | "${sources.nix-common}/nixos/channels-to-flakes.nix" 18 | ]; 19 | } 20 | (import sources.lanzaboote).nixosModules.lanzaboote 21 | (import sources.nix-maid).nixosModules.default 22 | ] ++ modules; 23 | } 24 | ) 25 | -------------------------------------------------------------------------------- /hosts/fatalis/configuration.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | ... 6 | }: 7 | let 8 | luksDevice = "luksroot"; 9 | in 10 | { 11 | system.stateVersion = "24.05"; 12 | environment.sessionVariables = rec { 13 | D = "/var/home/ayats/Documents/dotfiles"; 14 | NH_OS_FILE = "${D}/hosts/fatalis"; 15 | }; 16 | 17 | environment.systemPackages = [ 18 | pkgs.sbctl 19 | pkgs.powertop 20 | pkgs.sysfsutils 21 | ]; 22 | 23 | # environment.sessionVariables = {NIXOS_OZONE_WL = "1";}; 24 | 25 | networking = { 26 | hostName = "fatalis"; 27 | networkmanager = { 28 | enable = true; 29 | # dns = "systemd-resolved"; 30 | }; 31 | nftables.enable = true; 32 | }; 33 | 34 | security.sudo.wheelNeedsPassword = false; 35 | 36 | # powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; 37 | 38 | hardware = { 39 | cpu.amd.updateMicrocode = true; 40 | enableRedistributableFirmware = true; 41 | bluetooth.enable = true; 42 | graphics = { 43 | enable = true; 44 | extraPackages = with pkgs.rocmPackages; [ 45 | clr 46 | clr.icd 47 | ]; 48 | }; 49 | }; 50 | 51 | # services.fwupd.enable = true; 52 | 53 | # services.cpupower-gui.enable = true; 54 | # services.flatpak.enable = true; 55 | 56 | boot = { 57 | lanzaboote = { 58 | enable = true; 59 | pkiBundle = "/var/lib/secrets/secureboot"; 60 | # pkiBundle = "/etc/secureboot"; 61 | }; 62 | 63 | plymouth = { 64 | enable = true; 65 | }; 66 | 67 | kernelPackages = pkgs.linuxPackages_latest; 68 | 69 | initrd = { 70 | # kernelModules = ["amdgpu"]; 71 | systemd.enable = true; 72 | availableKernelModules = [ ]; 73 | 74 | luks = { 75 | devices.${luksDevice} = { 76 | device = "/dev/disk/by-partlabel/LINUX_LUKS"; 77 | }; 78 | }; 79 | }; 80 | 81 | kernel.sysctl = { 82 | # "vm.swappiness" = 100; 83 | }; 84 | 85 | kernelParams = [ 86 | "quiet" 87 | # Send logs to tty2 88 | "fbcon=vc:2-6" 89 | "console=tty0" 90 | "plymouth.use-simpledrm" 91 | ]; 92 | 93 | loader = { 94 | systemd-boot = { 95 | enable = lib.mkForce false; 96 | # consoleMode = "auto"; 97 | editor = false; 98 | }; 99 | # systemd-boot.enable = true; 100 | grub.enable = lib.mkForce false; 101 | efi = { 102 | canTouchEfiVariables = true; 103 | efiSysMountPoint = "/boot"; 104 | }; 105 | timeout = 0; 106 | }; 107 | 108 | tmp.useTmpfs = true; 109 | 110 | # https://github.com/lwfinger/rtw89/blob/main/70-rtw89.conf 111 | # https://github.com/lwfinger/rtw89/tree/main?tab=readme-ov-file#option-configuration 112 | extraModprobeConfig = '' 113 | # set options for faulty HP and Lenovo BIOS code 114 | options rtw89_pci disable_aspm_l1=y disable_aspm_l1ss disable_clkreq=y 115 | options rtw89pci disable_aspm_l1=y disable_aspm_l1ss disable_clkreq=y 116 | options rtw89_core disable_ps_mode=y 117 | ''; 118 | 119 | binfmt.emulatedSystems = [ 120 | "aarch64-linux" 121 | ]; 122 | }; 123 | 124 | fileSystems = { 125 | "/" = { 126 | device = "/dev/mapper/${luksDevice}"; 127 | fsType = "btrfs"; 128 | options = [ "noatime" ]; 129 | }; 130 | 131 | ${config.boot.loader.efi.efiSysMountPoint} = { 132 | device = "/dev/disk/by-partlabel/EFI"; 133 | fsType = "vfat"; 134 | options = [ 135 | "x-systemd.automount" 136 | "x-systemd.mount-timeout=15min" 137 | "umask=077" 138 | ]; 139 | }; 140 | }; 141 | 142 | programs.kde-pim.enable = false; 143 | 144 | programs.steam = { 145 | enable = true; 146 | }; 147 | 148 | services.fwupd.enable = true; 149 | } 150 | -------------------------------------------------------------------------------- /hosts/fatalis/default.nix: -------------------------------------------------------------------------------- 1 | import ../. { 2 | modules = [ 3 | #-- Topology 4 | ./configuration.nix 5 | ../../modules/nixos/es.nix 6 | ../../modules/nixos/tmpfs.nix 7 | ../../modules/nixos/tpm2 8 | ../../modules/nixos/user-ayats.nix 9 | ../../modules/nixos/user-soch.nix 10 | ../../modules/nixos/yubikey 11 | 12 | #-- Environment 13 | { services.displayManager.autoLogin.user = "ayats"; } 14 | # nixosModules.plasma6 15 | ../../modules/nixos/gnome.nix 16 | 17 | #-- Other 18 | ../../modules/nixos/tailscale.nix 19 | ../../modules/nixos/guix 20 | ../../modules/nixos/printing.nix 21 | ../../modules/nixos/podman.nix 22 | ../../modules/nixos/silent-boot.nix 23 | ]; 24 | } 25 | -------------------------------------------------------------------------------- /hosts/hermes/configuration.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | # self', 6 | ... 7 | }: 8 | let 9 | luksDevice = "luksroot"; 10 | in 11 | { 12 | environment.sessionVariables = rec { 13 | D = "/var/home/ayats/Documents/dotfiles"; 14 | NH_FILE = "${D}/hosts/hermes"; 15 | }; 16 | 17 | networking = { 18 | hostName = "hermes"; 19 | networkmanager = { 20 | enable = true; 21 | dns = "systemd-resolved"; 22 | }; 23 | nftables.enable = true; 24 | }; 25 | 26 | services.resolved = { 27 | enable = true; 28 | }; 29 | 30 | users.mutableUsers = lib.mkForce true; 31 | 32 | security.sudo.wheelNeedsPassword = false; 33 | 34 | system.stateVersion = "23.11"; 35 | 36 | powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; 37 | 38 | hardware = { 39 | cpu.intel.updateMicrocode = true; 40 | enableRedistributableFirmware = true; 41 | bluetooth.enable = true; 42 | graphics = { 43 | enable = true; 44 | extraPackages = with pkgs.rocmPackages; [ 45 | clr 46 | clr.icd 47 | ]; 48 | }; 49 | }; 50 | 51 | services.fwupd.enable = true; 52 | 53 | security.pam.services = { 54 | login.u2fAuth = true; 55 | sudo.u2fAuth = true; 56 | }; 57 | 58 | services.thermald.enable = true; 59 | 60 | services.cpupower-gui.enable = true; 61 | 62 | boot = { 63 | kernelPackages = pkgs.linuxPackages_latest; 64 | 65 | initrd = { 66 | systemd.enable = true; 67 | availableKernelModules = [ 68 | "xhci_pci" 69 | "ahci" 70 | "nvme" 71 | "usbhid" 72 | "kvm-intel" 73 | ]; 74 | luks = { 75 | devices.${luksDevice} = { 76 | device = "/dev/disk/by-partlabel/LINUX_LUKS"; 77 | }; 78 | }; 79 | }; 80 | 81 | binfmt.emulatedSystems = [ 82 | "aarch64-linux" 83 | ]; 84 | 85 | kernel.sysctl = { 86 | "vm.swappiness" = 10; 87 | }; 88 | 89 | kernelParams = [ ]; 90 | 91 | loader = { 92 | systemd-boot = { 93 | enable = lib.mkForce false; 94 | # editor = false; 95 | # configurationLimit = 10; 96 | # consoleMode = "max"; 97 | }; 98 | efi = { 99 | canTouchEfiVariables = true; 100 | efiSysMountPoint = "/boot"; 101 | }; 102 | }; 103 | 104 | tmp.useTmpfs = true; 105 | 106 | lanzaboote = { 107 | enable = true; 108 | pkiBundle = "/var/lib/secrets/secureboot"; 109 | }; 110 | }; 111 | 112 | fileSystems = { 113 | "/" = { 114 | device = "/dev/mapper/${luksDevice}"; 115 | fsType = "xfs"; 116 | options = [ "noatime" ]; 117 | }; 118 | 119 | ${config.boot.loader.efi.efiSysMountPoint} = { 120 | device = "/dev/disk/by-partlabel/LINUX_ESP"; 121 | fsType = "vfat"; 122 | options = [ 123 | "x-systemd.automount" 124 | "x-systemd.mount-timeout=15min" 125 | "umask=077" 126 | ]; 127 | }; 128 | }; 129 | 130 | environment.systemPackages = [ 131 | pkgs.sbctl 132 | pkgs.distrobox 133 | pkgs.nvtopPackages.amd 134 | ]; 135 | } 136 | -------------------------------------------------------------------------------- /hosts/hermes/default.nix: -------------------------------------------------------------------------------- 1 | import ../. { 2 | modules = [ 3 | 4 | ./configuration.nix 5 | ../../modules/nixos/tmpfs.nix 6 | ../../modules/nixos/tpm2 7 | ../../modules/nixos/user-ayats.nix 8 | ../../modules/nixos/user-soch.nix 9 | ../../modules/nixos/yubikey 10 | 11 | { services.displayManager.autoLogin.user = "ayats"; } 12 | # ../../modules/nixos/hyprland.nix 13 | ../../modules/nixos/gnome.nix 14 | 15 | ../../modules/nixos/tailscale.nix 16 | 17 | ../../modules/nixos/podman.nix 18 | ../../modules/nixos/silent-boot.nix 19 | ]; 20 | } 21 | -------------------------------------------------------------------------------- /hosts/zorah/configuration.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | config, 5 | # self', 6 | ... 7 | }: 8 | let 9 | luksDevice = "luksroot"; 10 | in 11 | { 12 | environment.systemPackages = with pkgs; [ 13 | # global dev 14 | openconnect 15 | ltex-ls-plus 16 | neocmakelsp 17 | sshfs 18 | unzip 19 | gitlab-ci-local 20 | dockerfile-language-server-nodejs 21 | 22 | # GUI 23 | mattermost-desktop 24 | slack 25 | drawio 26 | thunderbird-latest 27 | # self'.packages.emacs 28 | zoom-us 29 | ungoogled-chromium 30 | distrobox 31 | ]; 32 | 33 | environment.sessionVariables = rec { 34 | D = "/var/home/ayats/Documents/dotfiles"; 35 | NH_FILE = "${D}/hosts/zorah"; 36 | }; 37 | 38 | networking = { 39 | hostName = "zorah"; 40 | networkmanager = { 41 | enable = true; 42 | dns = "systemd-resolved"; 43 | }; 44 | nftables.enable = true; 45 | firewall.enable = false; 46 | }; 47 | 48 | services.resolved = { 49 | enable = true; 50 | }; 51 | 52 | security.sudo.wheelNeedsPassword = false; 53 | 54 | system.stateVersion = "23.11"; 55 | 56 | # powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; 57 | 58 | hardware = { 59 | cpu.intel.updateMicrocode = true; 60 | # enableAllFirmware = true; 61 | enableRedistributableFirmware = true; 62 | bluetooth.enable = true; 63 | graphics = { 64 | enable = true; 65 | extraPackages = [ pkgs.intel-media-driver ]; 66 | }; 67 | }; 68 | 69 | services.fwupd.enable = true; 70 | 71 | # services.cpupower-gui.enable = true; 72 | # services.flatpak.enable = true; 73 | 74 | services.flatpak = { 75 | enable = true; 76 | }; 77 | 78 | services.printing = { 79 | enable = true; 80 | }; 81 | 82 | boot = { 83 | lanzaboote = { 84 | enable = true; 85 | pkiBundle = "/var/lib/secrets/secureboot"; 86 | }; 87 | 88 | kernelPackages = pkgs.linuxPackages_latest; 89 | 90 | initrd = { 91 | systemd.enable = true; 92 | availableKernelModules = [ 93 | "xhci_pci" 94 | "thunderbolt" 95 | "vmd" 96 | "nvme" 97 | "usb_storage" 98 | "sd_mod" 99 | "rtsx_pci_sdmmc" 100 | ]; 101 | 102 | luks = { 103 | devices.${luksDevice} = { 104 | device = "/dev/disk/by-partlabel/LINUX_LUKS"; 105 | }; 106 | }; 107 | }; 108 | 109 | kernel.sysctl = { 110 | # "vm.swappiness" = 100; 111 | "kernel.split_lock_mitigate" = "0"; 112 | }; 113 | 114 | kernelParams = [ ]; 115 | 116 | kernelModules = [ "kvm-intel" ]; 117 | 118 | loader = { 119 | systemd-boot.enable = lib.mkForce false; 120 | grub.enable = lib.mkForce false; 121 | efi = { 122 | canTouchEfiVariables = true; 123 | efiSysMountPoint = "/boot"; 124 | }; 125 | # timeout = 1; 126 | }; 127 | 128 | tmp.useTmpfs = true; 129 | }; 130 | 131 | fileSystems = { 132 | "/" = { 133 | device = "/dev/mapper/${luksDevice}"; 134 | fsType = "xfs"; 135 | options = [ "noatime" ]; 136 | }; 137 | 138 | ${config.boot.loader.efi.efiSysMountPoint} = { 139 | device = "/dev/disk/by-partlabel/ESP"; 140 | fsType = "vfat"; 141 | options = [ 142 | "x-systemd.automount" 143 | "x-systemd.mount-timeout=15min" 144 | "umask=077" 145 | ]; 146 | }; 147 | }; 148 | # specialisation."nvidia" = { 149 | # configuration = { 150 | # environment.etc."specialisation".text = "nvidia"; 151 | # imports = [./nvidia.nix]; 152 | # }; 153 | # }; 154 | 155 | # systemd.services."openconnect-inria" = { 156 | # # enable = false; 157 | # # after = ["NetworkManager.service"]; 158 | # path = [ pkgs.openconnect ]; 159 | # script = '' 160 | # exec openconnect vpn.inria.fr -u fayatsll --passwd-on-stdin < /var/lib/secrets/vpn-pw 161 | # ''; 162 | # serviceConfig = { 163 | # Restart = "always"; 164 | # }; 165 | # unitConfig = { 166 | # StartLimitIntervalSec = 10; 167 | # StartLimitBurst = 30; 168 | # }; 169 | # }; 170 | 171 | programs.singularity = { 172 | enable = true; 173 | enableSuid = true; 174 | }; 175 | 176 | programs.msmtp = { 177 | enable = true; 178 | }; 179 | 180 | services.xserver.wacom.enable = true; 181 | } 182 | -------------------------------------------------------------------------------- /hosts/zorah/default.nix: -------------------------------------------------------------------------------- 1 | import ../. { 2 | modules = [ 3 | #-- Topology 4 | ./configuration.nix 5 | ./novidia.nix 6 | ../../modules/nixos/printing.nix 7 | ../../modules/nixos/tmpfs.nix 8 | ../../modules/nixos/tpm2 9 | ../../modules/nixos/user-ayats.nix 10 | ../../modules/nixos/user-soch.nix 11 | ../../modules/nixos/yubikey 12 | ../../modules/nixos/silent-boot.nix 13 | 14 | #-- Environment 15 | ../../modules/nixos/gnome.nix 16 | 17 | #-- Other 18 | ../../modules/nixos/tailscale.nix 19 | ../../modules/nixos/guix 20 | ../../modules/nixos/podman.nix 21 | ../../modules/nixos/ddc.nix 22 | ]; 23 | } 24 | -------------------------------------------------------------------------------- /hosts/zorah/novidia.nix: -------------------------------------------------------------------------------- 1 | { 2 | # boot.blacklistedKernelModules = [ 3 | # "nouveau" 4 | # ]; 5 | } 6 | -------------------------------------------------------------------------------- /hosts/zorah/nvidia.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | { 3 | services.xserver.videoDrivers = [ "nvidia" ]; 4 | 5 | hardware.nvidia = { 6 | open = false; 7 | powerManagement.enable = true; 8 | modesetting.enable = true; 9 | package = config.boot.kernelPackages.nvidiaPackages.beta; 10 | gsp.enable = true; 11 | }; 12 | 13 | boot = { 14 | kernelParams = [ 15 | "nvidia.NVreg_UsePageAttributeTable=1" 16 | ]; 17 | 18 | blacklistedKernelModules = [ 19 | "amdgpu" 20 | "nouveau" 21 | "ee1004" 22 | ]; 23 | 24 | extraModulePackages = with config.boot.kernelPackages; [ 25 | acpi_call 26 | ]; 27 | }; 28 | 29 | # https://discourse.nixos.org/t/suspend-resume-cycling-on-system-resume/32322/11 30 | systemd = { 31 | services."gnome-suspend" = { 32 | description = "suspend gnome shell"; 33 | before = [ 34 | "systemd-suspend.service" 35 | "systemd-hibernate.service" 36 | "nvidia-suspend.service" 37 | "nvidia-hibernate.service" 38 | ]; 39 | wantedBy = [ 40 | "systemd-suspend.service" 41 | "systemd-hibernate.service" 42 | ]; 43 | serviceConfig = { 44 | Type = "oneshot"; 45 | ExecStart = ''${pkgs.procps}/bin/pkill -f -STOP ${pkgs.gnome-shell}/bin/gnome-shell''; 46 | }; 47 | }; 48 | services."gnome-resume" = { 49 | description = "resume gnome shell"; 50 | after = [ 51 | "systemd-suspend.service" 52 | "systemd-hibernate.service" 53 | "nvidia-resume.service" 54 | ]; 55 | wantedBy = [ 56 | "systemd-suspend.service" 57 | "systemd-hibernate.service" 58 | ]; 59 | serviceConfig = { 60 | Type = "oneshot"; 61 | ExecStart = ''${pkgs.procps}/bin/pkill -f -CONT ${pkgs.gnome-shell}/bin/gnome-shell''; 62 | }; 63 | }; 64 | }; 65 | 66 | programs.steam = { 67 | enable = true; 68 | }; 69 | 70 | programs.gamemode = { 71 | enable = true; 72 | }; 73 | } 74 | -------------------------------------------------------------------------------- /hosts/zorah/private.yaml: -------------------------------------------------------------------------------- 1 | #ENC[AES256_GCM,data:Kj23fcCbOpXEvWu90yQWl8OVFpBS1LSzQjD3HzRlU1xN/w==,iv:UGNCf/jT5u2hw7nRb9JCiKCStuwiBuS55nmuiY47r4E=,tag:u9hFivRXIFNoepgD5O5T1w==,type:comment] 2 | git_config: ENC[AES256_GCM,data:EzeUARHE/tbDhV4jpU24563+e7rICml3xYB/Yc1ZP/fxlnuQ67okOQXBepmvNTnCK/bdvcd83RrM2YswHSn4RJt7WUB+vVpuq8O7Y9LHvNySaaAexsC7mh0/laPszqhRgkIIU53BN8RnpIEfzQPJBu0LmKTv1ulHMqSILu/f+lCB1hYxoZTgkW7XUDjKo4wH1HEG51bxO9oqgD6wV14=,iv:igxWh56jxCy4qwjk0miaV5KmWivYOlDDqm1vMr8cTwE=,tag:0GGwViGqCNMw4/yWM5KBeg==,type:str] 3 | ssh_config: ENC[AES256_GCM,data:j5YqRof5/9Mh2u2gfz65dI64GF5AZ+0+usNdZdEN28QqNasvcL7ykh/IY4i0Poexf1hCr5C8Epk8uBPu7r3I7gEj8OAd74Ud09gqGQO47gNLFaHc6/dFSlqAA+fDDAAmgl1Rbw3BaXIX1Rz7IcX2/1KCpiw4bR+38TETRqEX+pXo+tWkI2XTBmBixD4rBCf9ddZKDjaOI8Vlu5S+7mY0XuachZWeGVx2l8WsP4uqFzpB2U6JWzC6W9HK1PnhDapD2YdhPeufDEXkF5QWVfL2huNdQRz0UwbB/vDUizJ9X9b2Sv2oE4P7Luk+gpBd+rUyzEtAoqo3w4Slx2AYJkA9pO04pHeTaZN0xZERVebKBI6OWB/S39ZvmsZsuQak5OHG50XhOdOpe1ulTuPyD8Arqims/HKo5WLBYtu2Uy/22zMbvnnxRg4kkKSR1mxwoimgAAysvYWL2GpQM9EN/7bwzOS8uRxSkOE360L4xyU+FvViwCP672GQEl0mTZOph+pftQcmDJ6JQlR931bMIlJSbI4wUtTBfEAuDVvUqTDpPBSclEiQGiX1MyF97xuaH4FiRKu4VBZmAazsLXKtsJ7jwxldfs5Fp73Ufh6772/P+e9Mhu8GHMRiYl2F5D4ycCs61CRSScY866VZob17vxjPasgFA1zNFGBGwu4yVbi2nb/c7pSz3zcf1/OrGE/e9gqLGCKJSGMu2No35NVQeTFB4WZAPcPOgMe/eB39kEZmWpQM1NuHpN4O8ql8fgknJZ9BXiZCE1O+E9OUycVagwc1JFT8H3iBBCBtdRVTAmgKzklrF4ZWiiRdnyFzNfDoHGti6GlMSNKn4ZNT/wWKwU1UzGwAGQ4i7JqrY4e9/rKdXqdTrLFhAiIJJLITgdeI4isUj0MkyjhfNgUDRLjPI1BCPwaWgcp9bIrOBxiFPVz715+6UDDjRItfSjbvjkJ41n+M5jxKQ6yOXMOAXytvwh/5zVn7wkGbmTWHzuqPuKIt1VswXN5WakRCWVjroNeKDW+N3GboAaHq29hKekw6AdTclbritzXpFrEqvrqNvbYpdEA4k4gJOCANtAWEdWXRBCM6PDPELa7rPm6z3cKfghyZ0n5bvn8ANxKgePeDVnkXG82vyu6VYzciZU8VQUy6wUj9NPk8xEnyfd2v9E7c9lrVpKWS1Xx7vBQj0KsP6wkHKi7tyLmd2zDFYIpKZuZlisL2kicfBt/0yu04RVxz5JWHCFupmlXvWvvTLlxblldN3wzl/oN4Sg9dCFnHhrELYIDEMGMNOagHJxWsuQ8wp2/HhmXoq6IDBZcvDMdbF5TlbR+WG1XoTAqdrLBzvvNnMiWJsoRjL5obPnG+sbet8v47YanXa0jt6HiqEuDfvzp8g76u3E5+LjNDWZMr1gyG/R0YW0seYb3p3+ykKWgfw4CMScfdOscxZtjfegLIfnKewF3ixxPm2MAGwQOa7+NDNdfJISd5KBRprV5pyIoTvUUVhPAtfKOKv97IpUOcJAuuGRVAQt0x8fm0xlw9ojLBLKU8x/6mxFCiRKOJqxDtRLUg89lhWBmJdJhfRRd5qQaOQftwbytr01XF7BbVx5mqYbwQY+lHrBx2O/o4Xh4uknljMQfsl0FzoCAtNo5BVqAN3AjE2t1Jr/0V9RuFJ7LdYIwq+mPEvVlByWOUxURB8IPOj79wRTP5Uyv4wi2sXAfmqemI6pWPR6L65w3KLtUpSCk0N7z7sbCTSGI3a6dTkcYj2tGpqHgqLGiLqXM91SsFiUmOMOQHcIrNzYHSBinkp6vv+JrTkBL4mNC+YTDJUUGnxQRfmagWT5MvU3zDYIvV5OjtjqamblgUlx94xLzPobt/Oa4IhohLPPzrm7VPb+mJrlXrRAPtkGSdbdMI6ku4ChGEKdYxH/bF2kub+bERn3+3sFDVzMEIeNL1wZe/tbaeNcj1vjt029s1msOkfIk/mfYG5kcSOqnYDZcAqd3lqGTEz5aDwxSgVmFIGlGSqAyXouJR+wejnyiivSXegfbHJcBLgDO5AtJdYTW6g6u142SRhJf8iufb0vuVT/ZdjzW3ZmePmkI9r3HW0AZAHa39+eFGbYsqxuB7Kp8BqrtfcDbCkV5YZfBQ9Q2L4GceySFn0rD0sJrn25q5Wonb2YXTXhsXWADC4F7a2UTN9SOuZgZzsmPN0uWTa3KgwAGTo6tSVc4yPczwRJgs3RTheUxmII+glkd+UZtmuL5mV+E0ZT308aChWmYvc068dojDjsXEue9g1vfjUMb+Jxj5NyeUm7fddrAdUmcPgdyhB8ySkDRKyPd+RXF/b0eAzmml3h7ni9iZHG31/6hZ23y5i+Y6VIs1mOxMeyWZrSAurMsc/t6csgjwgGVu2pwxio7o5U6afgAnDinW8IaDjphEAOPE/KCd4NPaGIn1swoVAg1/3K0atVMHc7E98sNRVEBg7PQGhk3XHK05bqYQ94QVrdkN+OQ5azCIUz9F4TclM+MtTIhckooDUQy8Rwwhe3HRCPBDHBhKOgYOYUeq/cwaZqxRqcSge9guIwn2Wl8AR3boZ3JnpiwwSoLhUBsE0uxG41WYUNy/tWCrIqlB41FVZuLV7Ug++u1wfNV4/5bygiFKcrqAscRqZFD0QVGduqeIJKiNXjYMXaIwV1n0ycECSWDvxHKIU3SEi0uJKyioqbH+KfgAUoXiy1HC4S62fj+OUn7/aiXlHV8Gk7Ik9gwYS+glV8KGMLosnwJ+RDRo/gm8z8um7G237w==,iv:ull98Dlq20YH14pRCzo/InNdzDIJoIM4ZeMSL3rSll0=,tag:HYXLbImkLCgsFoJK1QKUiQ==,type:str] 4 | sops: 5 | kms: [] 6 | gcp_kms: [] 7 | azure_kv: [] 8 | hc_vault: [] 9 | age: 10 | - recipient: age15qe0fp9ys9qhmwypznwcl0sw946wkqsd60wlepw5jsfcwq7rl37q7m9g7v 11 | enc: | 12 | -----BEGIN AGE ENCRYPTED FILE----- 13 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBCLzB4MjdicjVlMi95S2Nv 14 | QUFQTXVaYWNTaVNGL3dtb1ZLajVnL3I5dWdJCnZ1RW8wZFhxMFNqN1RBZTVzOUlV 15 | MU5FNkVHajlJS2xSZjRHY20vZFRQVnMKLS0tIDdHbzRaV25UdnVWWThnZ25KZGd1 16 | dWxuRDNRbW1NVU5Lckw3UjdqcWQ0bkUKLhv3BPIwjQU2yd21eTEyQbqPVCulgxqD 17 | wl5hx2bxtPuQd4qi6F0wnd4TkEYYvWKWtr2+ZZeZ7wECJ1AwAsItwg== 18 | -----END AGE ENCRYPTED FILE----- 19 | - recipient: age1u8wy6s9tnz9e8se9e05gmqnwzhg4yy8crujvh8t00kxk3020dqdsq0974j 20 | enc: | 21 | -----BEGIN AGE ENCRYPTED FILE----- 22 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAvT3MxNTJzSmJwK3pxYnYx 23 | RFZLc3pNRVlMYUJYblVNUFREdU1vY1hteFUwCkNkZ0JRcCtxRDF6WlEzSkVLU0xD 24 | QVROV1VNbzdNRkhaLzc4R25hTjAyM2cKLS0tIHhoeS9pd3lNZ042b3FVNVY5dUE0 25 | aUNQSEhPamJDRVBOZmI4b2ROKzZudW8KDLxOkdjhHC+Tkl/Kb3uq36Pl9Nt/PcqQ 26 | khRN2+AjITQg61MsJTykR3Fu1quMhouzALwbAfay7QMKEMTgq9AduQ== 27 | -----END AGE ENCRYPTED FILE----- 28 | lastmodified: "2024-07-11T07:02:28Z" 29 | mac: ENC[AES256_GCM,data:cLRk2pGPV2eoq+e/NmKwYUg6UFQO3E+U69c7jmzjYPSoFzDKwcDqEqFLorQ+N7s8l37Nesn0qkSiHMQctZM7E0DDGWmCyXDR2qXnuwfKnB9PJuJdzgBwXm4c28wgpRDO8DBf1cfyEkKJ4qYOimlVbRaXombSZtkiaD8cHhHUmvU=,iv:Hzw12NwN3flCKo0OYZi/ltQkL/4e2QOXVEx9pr28pjA=,tag:LSCfw0iy/PeFpSFragSlIA==,type:str] 30 | pgp: [] 31 | unencrypted_suffix: _unencrypted 32 | version: 3.8.1 33 | -------------------------------------------------------------------------------- /misc/distrobox/comfy.ini: -------------------------------------------------------------------------------- 1 | [comfy] 2 | additional_packages="python3-venv python3-dev python3-setuptools" 3 | # Pillow things 4 | additional_packages="libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk libharfbuzz-dev libfribidi-dev libxcb1-dev" 5 | additional_packages="cmake ninja-build nasm" 6 | image=rocm/dev-ubuntu-24.04 7 | replace=true 8 | start_now=false 9 | additional_flags="--device /dev/kfd" 10 | additional_flags="--device /dev/dri" 11 | 12 | # NixOS specific 13 | volume="/run/current-system:/run/current-system:ro" 14 | volume="/etc/static:/etc/static:ro" 15 | volume="/etc/profiles:/etc/profiles:ro" 16 | -------------------------------------------------------------------------------- /misc/distrobox/hermes.ini: -------------------------------------------------------------------------------- 1 | [sd-webui] 2 | additional_packages="python3-venv python3-dev python3-setuptools" 3 | # Pillow things 4 | additional_packages="libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk libharfbuzz-dev libfribidi-dev libxcb1-dev" 5 | additional_packages="cmake ninja-build nasm" 6 | image=rocm/dev-ubuntu-24.04 7 | replace=true 8 | start_now=true 9 | additional_flags="--device /dev/kfd" 10 | additional_flags="--device /dev/dri" 11 | 12 | # NixOS specific 13 | volume="/run/current-system:/run/current-system:ro /etc:/nixos/etc:ro /etc/static:/etc/static:ro" 14 | init_hooks="touch /etc/bashrc" 15 | init_hooks="ln -sf /nixos/etc/profile /etc/profile.d/zzz-nixos.sh" 16 | -------------------------------------------------------------------------------- /misc/distrobox/rocm.ini: -------------------------------------------------------------------------------- 1 | [rocm] 2 | additional_packages="python3-venv python3-dev python3-setuptools git" 3 | additional_packages="libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev" 4 | additional_packages="python3-tk libharfbuzz-dev libfribidi-dev libxcb1-dev" 5 | additional_packages="cmake ninja-build nasm libvips-dev direnv" 6 | image=rocm/dev-ubuntu-24.04 7 | replace=true 8 | start_now=false 9 | additional_flags="--device /dev/kfd" 10 | additional_flags="--device /dev/dri" 11 | 12 | # NixOS specific 13 | volume="/run/current-system:/run/current-system:ro" 14 | volume="/etc/static:/etc/static:ro" 15 | volume="/etc/profiles:/etc/profiles:ro" 16 | -------------------------------------------------------------------------------- /misc/distrobox/zorah.ini: -------------------------------------------------------------------------------- 1 | [ubuntu] 2 | additional_packages="build-essential ca-certificates curl file g++ gcc gfortran gnupg2 iproute2 locales make" 3 | additional_packages="mercurial subversion python3 python3-boto3 unzip zstd python3-venv" 4 | image=ubuntu:24.04 5 | replace=true 6 | start_now=false 7 | # NixOS specific 8 | volume="/run/current-system:/run/current-system:ro" 9 | volume="/etc/static:/etc/static:ro" 10 | volume="/etc/profiles:/etc/profiles:ro" 11 | volume="/var/home/ayats/.local/state/spack-ubuntu:/var/home/ayats/.spack:rw" 12 | 13 | [rhel8] 14 | additional_packages="bzip2 curl file findutils gcc-c++ gcc gcc-gfortran git gnupg2 hostname iproute make patch python3 python3-pip python3-setuptools svn unzip zstd diffutils xz" 15 | image=redhat/ubi8 16 | replace=true 17 | start_now=false 18 | # NixOS specific 19 | volume="/run/current-system:/run/current-system:ro" 20 | volume="/etc/static:/etc/static:ro" 21 | volume="/etc/profiles:/etc/profiles:ro" 22 | volume="/var/home/ayats/.local/state/spack-rhel8:/var/home/ayats/.spack:rw" 23 | -------------------------------------------------------------------------------- /misc/git_template: -------------------------------------------------------------------------------- 1 | 2 | 3 | # fix: 4 | # feat: 5 | # build: 6 | # chore: 7 | # ci: 8 | # docs: 9 | # style: 10 | # refactor: 11 | # perf: 12 | # test: 13 | -------------------------------------------------------------------------------- /misc/gitconfig: -------------------------------------------------------------------------------- 1 | # vim ft=gitconfig 2 | [core] 3 | eol=lf 4 | autocrlf=input 5 | untrackedcache = true 6 | fsmonitor = true 7 | [advice] 8 | addEmptyPathspec = false 9 | [credential] 10 | helper = libsecret 11 | [credential "https://github.com"] 12 | helper= 13 | helper=!gh auth git-credential 14 | [credential "https://gist.github.com"] 15 | helper= 16 | helper=!gh auth git-credential 17 | [init] 18 | defaultbranch=master 19 | [pull] 20 | ff=only 21 | rebase=false 22 | [push] 23 | default = current 24 | autoSetupRemote = true 25 | [user] 26 | email=ayatsfer@gmail.com 27 | name=Fernando Ayats 28 | [merge] 29 | conflictstyle = diff3 30 | [diff] 31 | colorMoved = default 32 | tool = difftastic 33 | [difftool] 34 | prompt = false 35 | [difftool "difftastic"] 36 | cmd = difft "$LOCAL" "$REMOTE" 37 | [pager] 38 | diff = false 39 | difftool = false 40 | [include] 41 | path = ~/.config/git/local 42 | [rerere] 43 | enabled = true 44 | [fetch] 45 | writeCommitGraph = true 46 | showForcedUpdates = true 47 | parallel = 0 48 | [rebase] 49 | updateRegs = true 50 | [safe] 51 | directory=* 52 | [alias] 53 | logs = !git --no-pager log --pretty=format:'%Cgreen%h%Creset - %Cblue%an%Creset @ %ar : %s' --reverse -n 40 54 | logtags = !git --no-pager log --tags --simplify-by-decoration --pretty=format:'%Cgreen%h%Creset -%d - %Cblue%an%Creset @ %ar : %s' --reverse 55 | rewind = !git restore --staged `git-root` && git restore `git-root` && git clean -df 56 | forgor = !git commit --amend --date=now --no-edit 57 | pul = !git merge --ff-only 58 | [feature] 59 | manyFiles = true 60 | [submodule] 61 | recurse = true 62 | fetchJobs = 0 63 | [clone] 64 | filterSubmodules = true 65 | [checkout] 66 | workers = 0 67 | [url "git@github.com:"] 68 | insteadOf = "github:" 69 | [commit] 70 | verbose = true 71 | -------------------------------------------------------------------------------- /misc/img/20210404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/20210404.png -------------------------------------------------------------------------------- /misc/img/20210408.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/20210408.jpg -------------------------------------------------------------------------------- /misc/img/20210617.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/20210617.png -------------------------------------------------------------------------------- /misc/img/20210727.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/20210727.png -------------------------------------------------------------------------------- /misc/img/20211010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/20211010.png -------------------------------------------------------------------------------- /misc/img/20211118.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/20211118.png -------------------------------------------------------------------------------- /misc/img/20211219.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/20211219.png -------------------------------------------------------------------------------- /misc/img/20220222.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/20220222.png -------------------------------------------------------------------------------- /misc/img/20220731.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/20220731.png -------------------------------------------------------------------------------- /misc/img/20221016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/20221016.png -------------------------------------------------------------------------------- /misc/img/20230129.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/20230129.png -------------------------------------------------------------------------------- /misc/img/20230809.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/20230809.png -------------------------------------------------------------------------------- /misc/img/207px-Home-nixos-logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/207px-Home-nixos-logo.webp -------------------------------------------------------------------------------- /misc/img/NixOS-smaller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/NixOS-smaller.png -------------------------------------------------------------------------------- /misc/img/NixOS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/NixOS.png -------------------------------------------------------------------------------- /misc/img/alpine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/alpine.png -------------------------------------------------------------------------------- /misc/img/ansi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/ansi.png -------------------------------------------------------------------------------- /misc/img/gentoo-signet-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/gentoo-signet-small.png -------------------------------------------------------------------------------- /misc/img/gentoo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/gentoo.png -------------------------------------------------------------------------------- /misc/img/nixos.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/nixos.ico -------------------------------------------------------------------------------- /misc/img/void.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/misc/img/void.png -------------------------------------------------------------------------------- /misc/lib/default.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | { 3 | flake.lib = { 4 | mkDate = 5 | longDate: 6 | (lib.concatStringsSep "-" [ 7 | (builtins.substring 0 4 longDate) 8 | (builtins.substring 4 2 longDate) 9 | (builtins.substring 6 2 longDate) 10 | ]); 11 | 12 | # versionGate = pkg: newAttrs: let 13 | # newVersion = newAttrs.version; 14 | # oldVersion = pkg.version; 15 | # newPkg = pkg.overrideAttrs (_: newAttrs); 16 | # result = 17 | # if lib.versionOlder oldVersion newVersion 18 | # then newPkg 19 | # else throw "Package ${pkg.name} has reached the desired version"; 20 | # in 21 | # result; 22 | 23 | versionGate = 24 | newPkg: stablePkg: 25 | let 26 | newVersion = lib.getVersion newPkg; 27 | stableVersion = lib.getVersion stablePkg; 28 | in 29 | if builtins.compareVersions newVersion stableVersion >= 0 then 30 | newPkg 31 | else 32 | lib.warn "Package ${lib.getName newPkg} reached version ${newVersion} at stable" stablePkg; 33 | 34 | importFilesToAttrs = 35 | basePath: files: 36 | builtins.listToAttrs ( 37 | map ( 38 | name: 39 | lib.nameValuePair name ( 40 | let 41 | file = basePath + "/${name}.nix"; 42 | folder = basePath + "/${name}"; 43 | in 44 | if builtins.pathExists file then file else folder 45 | ) 46 | ) files 47 | ); 48 | 49 | dirToAttrs = 50 | dir: 51 | lib.mapAttrs' (name: value: lib.nameValuePair (lib.removeSuffix ".nix" name) (dir + "/${name}")) ( 52 | builtins.readDir dir 53 | ); 54 | }; 55 | } 56 | -------------------------------------------------------------------------------- /misc/nix-conf-privileged.nix: -------------------------------------------------------------------------------- 1 | { 2 | extra-substituters = [ 3 | "https://nix-community.cachix.org" 4 | "https://viperml.cachix.org" 5 | # "https://nixpkgs-unfree.cachix.org" 6 | # "https://cuda-maintainers.cachix.org" 7 | ]; 8 | 9 | extra-trusted-public-keys = [ 10 | "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" 11 | "viperml.cachix.org-1:qZhKBMTfmcLL+OG6fj/hzsMEedgKvZVFRRAhq7j8Vh8=" 12 | # "nixpkgs-unfree.cachix.org-1:hqvoInulhbV4nJ9yJOEr+4wxhDV4xq2d1DK7S6Nj6rs=" 13 | # "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" 14 | ]; 15 | } 16 | -------------------------------------------------------------------------------- /misc/nix-conf.nix: -------------------------------------------------------------------------------- 1 | { 2 | extra-experimental-features = [ 3 | "pipe-operators" 4 | ]; 5 | } 6 | -------------------------------------------------------------------------------- /misc/nix.conf: -------------------------------------------------------------------------------- 1 | extra-substituters = https://viperml.cachix.org 2 | extra-trusted-public-keys = viperml.cachix.org-1:qZhKBMTfmcLL+OG6fj/hzsMEedgKvZVFRRAhq7j8Vh8= 3 | -------------------------------------------------------------------------------- /misc/nixos/fcitx5.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: let 2 | cfg.package = pkgs.fcitx5-with-addons.override { 3 | addons = with pkgs; [fcitx5-gtk fcitx5-mozc]; 4 | }; 5 | 6 | gtk2_cache = 7 | pkgs.runCommand "gtk2-immodule.cache" { 8 | preferLocalBuild = true; 9 | allowSubstitutes = false; 10 | buildInputs = [pkgs.gtk2 cfg.package]; 11 | } '' 12 | mkdir -p $out/etc/gtk-2.0/ 13 | GTK_PATH=${cfg.package}/lib/gtk-2.0/ gtk-query-immodules-2.0 > $out/etc/gtk-2.0/immodules.cache 14 | ''; 15 | 16 | gtk3_cache = 17 | pkgs.runCommand "gtk3-immodule.cache" { 18 | preferLocalBuild = true; 19 | allowSubstitutes = false; 20 | buildInputs = [pkgs.gtk3 cfg.package]; 21 | } '' 22 | mkdir -p $out/etc/gtk-3.0/ 23 | GTK_PATH=${cfg.package}/lib/gtk-3.0/ gtk-query-immodules-3.0 > $out/etc/gtk-3.0/immodules.cache 24 | ''; 25 | in { 26 | environment.systemPackages = [cfg.package gtk2_cache gtk3_cache]; 27 | 28 | environment.variables = { 29 | GTK_IM_MODULE = "fcitx"; 30 | QT_IM_MODULE = "fcitx"; 31 | XMODIFIERS = "@im=fcitx"; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /misc/nixos/greetd/.envrc: -------------------------------------------------------------------------------- 1 | use nix 2 | -------------------------------------------------------------------------------- /misc/nixos/greetd/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: let 7 | run-desktop = pkgs.writers.writePerlBin "run-desktop" { 8 | libraries = with pkgs.perlPackages; [ConfigINI]; 9 | } (lib.fileContents ./run-desktop.pl); 10 | inherit (config.services.displayManager) defaultSession; 11 | in { 12 | environment.systemPackages = [run-desktop]; 13 | 14 | services.greetd = { 15 | enable = true; 16 | settings = { 17 | terminal = {vt = "1";}; 18 | 19 | default_session = let 20 | base = config.services.xserver.displayManager.sessionData.desktops; 21 | in { 22 | command = "${ 23 | lib.getExe pkgs.greetd.tuigreet 24 | } --sessions ${base}/share/wayland-sessions:${base}/share/xsessions --remember --remember-user-session --issue"; 25 | }; 26 | 27 | initial_session = lib.mkIf (defaultSession != null) { 28 | user = config.services.xserver.displayManager.autoLogin.user; 29 | command = "${lib.getExe run-desktop} ${defaultSession}"; 30 | }; 31 | }; 32 | }; 33 | 34 | services.xserver.displayManager.sddm.enable = false; 35 | services.xserver.displayManager.gdm.enable = false; 36 | services.xserver.displayManager.lightdm.enable = false; 37 | } 38 | -------------------------------------------------------------------------------- /misc/nixos/greetd/run-desktop.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use v5.38; 3 | use strict; 4 | use warnings; 5 | 6 | use Config::INI::Reader; 7 | 8 | my $session = $ARGV[0]; 9 | if (not defined $session) { 10 | die "Usage: $0 \n"; 11 | } 12 | 13 | say "Session: $session"; 14 | 15 | my @session_dirs = ( 16 | "/run/current-system/sw/share/wayland-sessions", 17 | "/run/current-system/sw/share/xsessions", 18 | ); 19 | 20 | foreach my $dir (@session_dirs) { 21 | opendir(my $dh, $dir) or die "Can't open $dir: $!"; 22 | 23 | foreach my $file (readdir $dh) { 24 | next if $file =~ /^\.\.?$/; 25 | say $file; 26 | 27 | # Check if $file matches $session.desktop 28 | if ($file =~ /^$session\.desktop$/) { 29 | my $path = "$dir/$file"; 30 | say "Found $path"; 31 | 32 | my $ini = Config::INI::Reader->read_file($path); 33 | my $exec = $ini->{"Desktop Entry"}->{Exec}; 34 | say "Exec: $exec"; 35 | exec $exec; 36 | } 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /misc/nixos/greetd/shell.nix: -------------------------------------------------------------------------------- 1 | with import {}; 2 | mkShellNoCC {nativeBuildInputs = [perl perlPackages.ConfigINI];} 3 | -------------------------------------------------------------------------------- /misc/nixos/hyprland.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | ... 4 | }: { 5 | imports = [./wayland-compositors.nix]; 6 | 7 | programs.hyprland = { 8 | enable = true; 9 | }; 10 | 11 | home-manager.sharedModules = [ 12 | inputs.self.homeModules.hyprland 13 | ]; 14 | 15 | # environment.sessionVariables = { 16 | # XDG_CURRENT_DESKTOP = "Hyprland"; 17 | # XDG_SESSION_TYPE = "wayland"; 18 | # XDG_SESSION_DESKTOP = "Hyprland"; 19 | # }; 20 | 21 | services.gnome.gnome-keyring.enable = true; 22 | services.gnome.at-spi2-core.enable = true; 23 | } 24 | -------------------------------------------------------------------------------- /misc/nixos/sway.nix: -------------------------------------------------------------------------------- 1 | { 2 | packages, 3 | inputs, 4 | ... 5 | }: { 6 | imports = [./wayland-compositors.nix]; 7 | 8 | home-manager.sharedModules = [inputs.self.homeModules.sway {wayland.windowManager.sway.fx = true;}]; 9 | 10 | programs.sway = { 11 | enable = true; 12 | package = packages.self.sway-custom; 13 | extraPackages = []; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /misc/nixos/wayland-compositors.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | imports = [./fcitx5.nix]; 3 | 4 | services.xserver = { 5 | enable = true; 6 | displayManager = {sddm.enable = true;}; 7 | }; 8 | 9 | services.gnome.gnome-keyring.enable = true; 10 | 11 | services.blueman.enable = true; 12 | 13 | environment.sessionVariables = { 14 | # NIXOS_OZONE_WL = "1"; 15 | MOZ_ENABLE_WAYLAND = "1"; 16 | _JAVA_AWT_WM_NONREPARENTING = "1"; 17 | # https://github.com/NixOS/nixpkgs/commit/ebde08adf37932ff59c27b5935840aa733965bdb 18 | GTK_USE_PORTAL = "1"; 19 | GDK_BACKEND = "wayland,x11"; 20 | QT_QPA_PLATFORM = "wayland;xcb"; 21 | QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; 22 | }; 23 | 24 | environment.systemPackages = with pkgs; [ 25 | gnome.seahorse 26 | haruna 27 | 28 | libsForQt5.dolphin 29 | libsForQt5.ark 30 | libsForQt5.gwenview 31 | libsForQt5.dolphin-plugins 32 | libsForQt5.ffmpegthumbs 33 | libsForQt5.kdegraphics-thumbnailers 34 | libsForQt5.kio 35 | libsForQt5.kio-extras 36 | libsForQt5.qtwayland 37 | libsForQt5.okular 38 | ]; 39 | 40 | services.gnome.at-spi2-core.enable = true; 41 | 42 | xdg.portal = { 43 | enable = true; 44 | extraPortals = [pkgs.xdg-desktop-portal-gtk]; 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /misc/private/ssh.yaml: -------------------------------------------------------------------------------- 1 | ssh_config: ENC[AES256_GCM,data:feU3gz9qCzL/oFZmdBALcHC+Tg62/8puRV1yGjTGjJa+/DtpUWiCkgO6XznQ0O4PX5KmVp0K+feLVAnJ/aT5qP0ByVK/GLbo9Gc1Y/eGui8FkbovglmyaT4dqZ2reGN9WeDTKp1xPF/OxxGQFMmUg2VqaIz6nQOsxiaBio07wX0PnYneDKDSiATNhTcvVKCZn+ej+hxwHBI7edtkaqDQqRpwxQ84ZNvWH1wO89j+9BFc1QLnteUq0KZS5zMIDG47CvmrdHW6kWbePsE16RX1NMKO5hwX6A/7yCPiml+fiFSQHaJ8XlbB5FZgfR1K6VRfcg1nlcag+97nkYetnnzCbVoxHE0lrsDgEk4vl1A94FE4eyUvuIgyqPa3J9CvOkXiXiR/kOSCuC0BdpG1rbuDzPKmB46kHtwjLjGqIZuV8A+nZ9V+M9eU15elO2gJBdMY2U8+/5wBQP77GAslSncL8ad8zdCfvj9n5ALsTj8SSPBwO2RHp5dVPIRk9gU9sUqw7uMJrqywwVncJi3UqI1Ed/x+QmHtzg/X7d4ZcCGHdS3z0Un5A99WToBcvPYTvsc8bkAdhxgWe2raSPh4B+3REhkrKy2KeEckGrFr0gEgjSfMuzK+LtGqN+z/WAphKIIcY5TOQFGPGVZ0mbs7C1uZ3IOkai5m1NLX/eBgYPf/gA8HBcy4l/uwiVi+C6KUMrfH0Sp4Y3gQnskwT/2Z7udXTRQbI7sCfjn0cH8KK9uYeZU3RYeq3pY8Bj+KOaKIckeEbGpvsAPzLEDfFjxv9bB+A9HIHUHA0M3t0FHNIjBsxLFMekfuY2v1FjwVhImf9f+sy/uxXonMTtrA7J/cd/AQcvHxdev5IKM5OXTZCdcqeSWSOlSvv3Bhapz0npSQj6MDzhB+ZetJVJNroy9tf3WLR67oYabwgKXQbwXrH2cbHoyi+YRtGnb6zdu0YFNj+oc3KORYb+Kh27PDvPDhOCppd38O4YoaN0KSI8Kc8OJFZtflKv4E88j/TzlnfCZWWnM+upgYvRdE3IeoAXhz/7/wHxwxRm1XPf208KzQOmvHGCnereVuVdVlICEx+ovSDY95Wm3iR0QfPloa3nNLYhlky8KoyA3yshxjeEweiJV4WwbMOFaNo7Wqu/8FiYEDtq/QF3Pe3rT5hG6zYM8k4pnMaraanpIVm76q/UU+i4895oWuq7TS0TNazsb71cM0o4lWkviaMANQEv7qIkqm3rWJXyd943OqCZ7XIv7jaguv1WX+omh5ytdYFnLcWtuwQZwEuIbh9yPKOCe6SohjgL8+O/X6JKE3CVQp+C51oDeIEdDi+E3pZctEEE2Y5hEu7UBjz23tCre0y0z6f9t7JWirQeaXAd2oYa2H/LgBKP7Pbirio53JsTB8IstcSQEaGUIhBFDisiX6k+0+Bbu3NgTXq0MVK3NEyo/4e95sQjIsepKUumYqriYJnRImgRcUAmDnMWRyr8DiNzHn8T+CLKRRxQS8tVgaq60lXjW3Zy06vIAu831Qb3Vk51txrSEKHzkpsGT8vp8LUWHT5q92GAx0BuRWgHqkyJ+KUwWpzyXCCCb1ZNgkbJ3fjQYfOAFtR6errt3LPfZ/u00C44dUE2xjLU8PLvV7N4tIaZ8bKpXV/C36b9rTkkHQejx4psEPryKzySo1oUid4QPyG/YUDrnNzp5F6jcKunrperZUj+b5uWlc1wvkKW+6WskS3/NMxvFYFMxgptlNhktk1e81KfuXLHAM1onIRvm50Sp4/XY+G693Y3+lwdOjbYXisCxgVlgNdRD6FQhjgqARY3tOYOsG1my0xBRYc6UmVQtIIL2eWiirNDvs0xDGcKke5R1uP7D82CT215sLk3r6e01XwByCnKT+HOXltVzVFNbOvCrO9oZAnCKRYFIHSBJDGCtHTr2YdXnCm8o1ZwruV/bZZlw6v1x2g5xgzaoVNHdz+6rJ7mAnKqqX7zfAdd6n+Hz8HveTKf7YuItLfkGjMISng2TLJwMazhcDCSpnvam7J/MrG5YnOCYplPdhxWVTVa/KrEgItCTG3F2bagc+kV+FryRm5Ds50pdhbcEwFzLQ6XIE7Dq4n5kz8mJ0Jgl1BdHFR4oAtmJsq4JQlPVT+PzhNq1f0PlPwq2MOX4r3zOFqW+nNINAEUdrFI9v1ZdejlUn21aitkQ+AlcECfHbb0mzyUYT7OhSNJ0393qqzcO1dCcpe72FWyFLNbZ8f215me0viLn8t8mllxDVX3a2Xfrj94LAGoKHZc/YuqsJftERTrtBHdTcn2gvPEl7xlkasXbnFiI3Z0LfWjliLfQ/1YSdiYV/V+g74l7s0T46We6ilIzc2hcagsZJveLJ8JZ34zGjmbHey0SUmO2XKgRL3pG+UREwXtKg+7nWG54mlje7QmnF1jMSbUvRG/GNT7dhw38mEIyRbNur+FunJ3Kyr5vLUc90tID+znwb8yBnR+tQi0/HcskLnHO3ZN0axOhQx3jLoKaz1332r03I6GsJn3O7Pn0n9VAXPdr4RT78c9Yl/ybC7an0l8kmLcW7V/w7fAQBF0zDElbBr2wfh2RfIex6GTiRNJEhpXWQfkVY6KkCDN/X1yp7dsU7NtPssnMI1FG9fIS03NZX5A4akt9QzIFZ9F0LbCWhbjptYFlRoD9trGfnxW+ctJlMWyQ/tTyC35pLxGAo+/u6eAvfwzshAfHE03aLLbcf61wu1WIZR/cFxwlerW/KniSg6pJI9yvYDh3B9fAi1gKiM0RmrUQ35WrIYFnHt/p6fz4cfIILU6lLHoV6Xux9KNMGV8Dzbd7mUUICXZD03yqQTr6Gjk450AwvWQ/uhRiZtsImK6Qu+Jv/J5iFuQCOYIBTePxMhPUJDSzmZKI+/I1MF+6Sm6j9oRqClsh84M6w2nYIWI3HS/86wVm40PBtoBltiDT8D2oCEUjhnGKn5SaSNaGdC1stmPt/ZyZDB9edRe8GabvA7+jCV15aKI2LwKNyEFCPYEj5yRCPPrHsmJMgC0eNcjWn7H2oONq9+Ii3rtPCZoA2NYm7keBu0rYcww7OFqbQJxN9/e/LTMjLiouYNL5BMGcHk4Povs9YJD6SV09YuclaDGv7j+ZATIMT4YRpxVtLJLuhsp+uVEm4n7ITUxxCaC8rjgDoidax4bEPCf3gMYKJfEHDb7Nqn57VOjTXvbuKvr1LF5zrS9chUAE8fLVolDwjHrw2z8XYfi8pPlojjquqsuAAcYEQUkDjdl5xWdzoTJv2vH3VYW1iktxhn7VSlKRPtQwseFhof+W3ZUaUYLYIHt+bm1OAntxIgn9Qt7njuyybNMf8oFDDE8Fyo3raBKixIQhyQaXjeybdiNivskCyOVKhFgyWlAJEtaMz7gMkCRbJmvXN26kwxoLEaLpCIAKVUMxJSbVt0iuLqnQnc2sPvCvyu3uS0fPdqBBYYR6UAzFOG+OMSQtyvuczgwJgYlw1VHQSFQ5dp7p91/39HFevBnTsiDa5b4lUWDuH0gukCYKhUMz0Gz5nOdpbk/wbDtEp0bnUxydpZWRSR+NfCP99zUYTPAZOpx5ociOtsu4d,iv:oLbw3e61z1fHonTdGWV9+0xS0f9utrpDiirZraVooBM=,tag:moBgPPYdtJUIEdoHKOaF/g==,type:str] 2 | sops: 3 | kms: [] 4 | gcp_kms: [] 5 | azure_kv: [] 6 | hc_vault: [] 7 | age: 8 | - recipient: age15qe0fp9ys9qhmwypznwcl0sw946wkqsd60wlepw5jsfcwq7rl37q7m9g7v 9 | enc: | 10 | -----BEGIN AGE ENCRYPTED FILE----- 11 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBOSUgyNVFYblBCU1huc3Zn 12 | UHVvVEt5VzFtUXJLQkNoZS9IbmtYZ0dPQ2g0Cm9sZEN5UkwyMytkVUo1REdYY3lD 13 | ZWpyZU51cGdiaWxUTWtCQW5GeUt4TE0KLS0tIFN4SndpN3Y0Rm1VZWxFMGw2ZFd5 14 | ZnQ1VXRqdE9sbW5lU1RYbTM4SU1DN2cKHFIv0+M2H8cVI6j8r8GhmaL0nt5E5gI7 15 | p8H4VxzloHDObftI5E8F5GVeuJPz4B/ZsSsFlcYHJNreWtrxTUmjag== 16 | -----END AGE ENCRYPTED FILE----- 17 | - recipient: age1u8wy6s9tnz9e8se9e05gmqnwzhg4yy8crujvh8t00kxk3020dqdsq0974j 18 | enc: | 19 | -----BEGIN AGE ENCRYPTED FILE----- 20 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBCc2pZZGNhN3FwWkZWRk93 21 | TGVCQXJncnNNdlBPYWkrRlNRbGxXYkRXakd3CitkTk1ucXNhTkZ4TWdydDFISUQr 22 | Z3B3dTdHRjRtd2l3bm1OTWMzbi90R1EKLS0tIFQ1Tyt1TVZVV1grcE9SaWNma3lh 23 | WnBNSDdxMEw0UGdrQTY0YWt3M2tOeW8KK0sUcTHik3B5hGYmO1itjxf7gIa3qyaz 24 | N0XNgvCRGvTb/ASG8yeYgt9lvVb+L3YOzqHUqfnNKmLMxYI9mMuDSA== 25 | -----END AGE ENCRYPTED FILE----- 26 | - recipient: age15tc72xv439m579qna5pn3nskm60np9vqak2jtk6sczqltsltncyq2h5udy 27 | enc: | 28 | -----BEGIN AGE ENCRYPTED FILE----- 29 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBJeWFjRGg1L1FGSkc0ejNp 30 | bWplZHB0d2dDT1NyMnBVNnFrQ3ZXeDZNbEY4CkZzSWtIVmkzVjBCR2pBOGQ1ZHhL 31 | M2NYNzNydEZVQlNVb3UyaGNMemdSUEkKLS0tIG1mNEVxNXovNTRqS3NRU3dVTWd4 32 | c0IvNC9wdEdaSDN1STJDemNiRHJkZUEKNiiv4CtO7dZn0SuBiyMhPyTmfbUQ7Bum 33 | jR/8/mH911A88K1SV2/iKbVr1Gf5TeaRwWRfvuGS0wkllo2VbStvlw== 34 | -----END AGE ENCRYPTED FILE----- 35 | lastmodified: "2024-07-24T07:18:50Z" 36 | mac: ENC[AES256_GCM,data:qc1pyq04qh9DUtc7Co0vhYIa4MB6wtbPgGrYJrFK2Y/Xqe4+sagJJMC9cjkViVBP1aOVbwBs4b/czbZnltEhOfKrNRXxXCVMwBfbm4H2TFAF2KCOUjQTTf+qumuPmIrBkNIXIHCKiW+nHpDVptGxVH2Hy3mRV9zc/494FD8KgUU=,iv:2bp+SEaZjSStCKVN0oGwTugCq/ETnVqWrQyoQfnc8hM=,tag:HoXINhfvmtqCGR9o1UfZtg==,type:str] 37 | pgp: [] 38 | unencrypted_suffix: _unencrypted 39 | version: 3.8.1 40 | -------------------------------------------------------------------------------- /misc/starship.toml: -------------------------------------------------------------------------------- 1 | "$schema" = 'https://starship.rs/config-schema.json' 2 | 3 | format = """\ 4 | ([\\[](fg:8) \ 5 | $shlvl\ 6 | $custom\ 7 | $python\ 8 | $package\ 9 | $container\ 10 | $terraform\ 11 | $env_var\ 12 | $singularity\ 13 | $spack\ 14 | [\\]](fg:8) 15 | )\ 16 | ([\\[](fg:8) $direnv$git_branch$git_commit$git_state$git_status$git_metrics[\\]](fg:8) 17 | )\ 18 | ([\\[](fg:8) \ 19 | $username\ 20 | $hostname\ 21 | $status\ 22 | $cmd_duration\ 23 | [\\]](fg:8) 24 | )\ 25 | $directory 26 | $character 27 | """ 28 | 29 | scan_timeout = 10 30 | add_newline = false 31 | 32 | [character] 33 | disabled = false 34 | success_symbol = "[\\$](bold)" 35 | error_symbol = "[\\$](bold)" 36 | 37 | [username] 38 | show_always = false 39 | format = "[$user@](fg:8)" 40 | 41 | [hostname] 42 | ssh_only = true 43 | format = "[$hostname](fg:8) " 44 | 45 | [directory] 46 | style = "bold cyan" 47 | read_only = " " 48 | truncate_to_repo = false 49 | #truncation_length = 0 50 | format = "[󰉋 $path]($style)([$read_only]($read_only_style))" 51 | #repo_root_style = "red" 52 | home_symbol = "~" 53 | #disabled = true 54 | truncation_length = 0 55 | 56 | [git_branch] 57 | format = " [$symbol$branch]($style) " 58 | symbol = "" 59 | only_attached = true 60 | 61 | [git_commit] 62 | style = "dimmed white" 63 | format = '[([$tag](bold purple) )$hash]($style) ' 64 | tag_disabled = false 65 | tag_symbol = "" 66 | 67 | 68 | [git_status] 69 | format = "([$stashed$conflicted$deleted$renamed$modified$staged$untracked$ahead_behind]($style))" 70 | style = "bold cyan" 71 | up_to_date = "" 72 | conflicted = "=$count " 73 | ahead = "⇡$count " 74 | behind = "⇣$count " 75 | diverged = "⇕$count " 76 | untracked = "?$count " 77 | stashed = "\\(stash: $count\\) " 78 | modified = "!$count " 79 | staged = "+$count " 80 | renamed = "»$count " 81 | deleted = "✘$count " 82 | 83 | [git_metrics] 84 | disabled = false 85 | format = "([+$added]($added_style) )([-$deleted]($deleted_style) )" 86 | 87 | [python] 88 | format = "[${symbol}${pyenv_prefix}(${version} )(($virtualenv) )]($style)" 89 | symbol = " " 90 | 91 | [package] 92 | format = "[$symbol$version]($style) " 93 | symbol = "󰏗 " 94 | 95 | [cmd_duration] 96 | min_time = 60_000 97 | 98 | [status] 99 | disabled = false 100 | format = "[(✖ $status $common_meaning )](bold red)" 101 | 102 | [custom.nix] 103 | command = "nix-shell-info" 104 | when = "nix-shell-info" 105 | symbol = "" 106 | style = "bold cyan" 107 | format = "[$symbol]($style) [$output]($style) " 108 | os = "linux" 109 | 110 | [custom.module] 111 | when = "printenv LOADEDMODULES" 112 | os = "linux" 113 | command = "echo $LOADEDMODULES | sed 's#/[^:]*##g; s#:# #g'" 114 | symbol = "󱗜 mod:" 115 | style = "bold yellow" 116 | format = "[$symbol]($style) [$output]($style) " 117 | 118 | [env_var.HOVER] 119 | style = "white dimmed bold" 120 | format = "([$symbol $env_value]($style) )" 121 | variable = "HOVER" 122 | default = "" 123 | symbol = "󰼪 " 124 | 125 | [env_var.IN_NIX_SHELL] 126 | style = "blue bold" 127 | format = "([$symbol $env_value]($style) )" 128 | variable = "IN_NIX_SHELL" 129 | default = "" 130 | symbol = "󱄅" 131 | 132 | [env_var.GUIX_ENVIRONMENT] 133 | style = "yellow dimmed bold" 134 | format = "([$symbol $env_value]($style) )" 135 | variable = "GUIX_ENVIRONMENT" 136 | default = "" 137 | symbol = " " 138 | 139 | [env_var.GUIX_PACKAGE_PATH] 140 | style = "yellow dimmed bold" 141 | format = "([$symbol $env_value]($style) )" 142 | variable = "GUIX_PACKAGE_PATH" 143 | default = "" 144 | symbol = " " 145 | 146 | [env_var.SLURM_JOB_UID] 147 | style = "blue bold" 148 | format = "([$symbol $env_value]($style) )" 149 | symbol = " slurm" 150 | variable = "SLURM_JOB_UID" 151 | default = "" 152 | 153 | 154 | [singularity] 155 | style = "bold dimmed blue" 156 | format = "[$symbol$env]($style) " 157 | symbol = " " 158 | 159 | [env_var.OAR_JOBID] 160 | style = "blue bold" 161 | format = "([$symbol $env_value]($style) )" 162 | symbol = " oar" 163 | variable = "OAR_JOBID" 164 | default = "" 165 | 166 | [direnv] 167 | format = "($loaded )" 168 | loaded_msg = "\u001B[32m󰴉 \u001B[0m" 169 | unloaded_msg = "\u001B[31m󰴉 \u001B[0m" 170 | disabled = false 171 | 172 | [shlvl] 173 | repeat = true 174 | disabled = false 175 | symbol = "↕" 176 | format ="[$symbol]($style) " 177 | repeat_offset = 1 178 | 179 | [spack] 180 | format = "[$symbol$environment]($style) " 181 | symbol = " " 182 | 183 | -------------------------------------------------------------------------------- /modules/maid/containers/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | file.xdg_config.containers.source = ./.; 3 | } 4 | -------------------------------------------------------------------------------- /modules/maid/containers/policy.json: -------------------------------------------------------------------------------- 1 | { 2 | "default": [ 3 | { 4 | "type": "insecureAcceptAnything" 5 | } 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /modules/maid/containers/registries.conf: -------------------------------------------------------------------------------- 1 | [registries.search] 2 | registries = ['docker.io'] 3 | -------------------------------------------------------------------------------- /modules/maid/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | ... 5 | }: 6 | { 7 | imports = [ 8 | ./containers 9 | ./gnome 10 | ]; 11 | 12 | options = { 13 | impureDotfilesPath = lib.mkOption { 14 | type = lib.types.str; 15 | default = "{{home}}/Documents/dotfiles"; 16 | }; 17 | }; 18 | 19 | config = { 20 | file.home.".gitconfig".source = pkgs.git-viper.gitconfig; 21 | systemd.tmpfiles.dynamicRules = [ 22 | "D {{home}}/.spack 0755 {{user}} {{group}} 0 -" 23 | ]; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /modules/maid/gnome/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | gsettings.settings = { 3 | "org.gnome.mutter"."experimental-features" = [ 4 | "scale-monitor-framebuffer" 5 | "xwayland-native-scaling" 6 | ]; 7 | }; 8 | 9 | dconf.settings = { 10 | "/org/gnome/desktop/interface/color-scheme" = "prefer-dark"; 11 | "/org/gnome/desktop/interface/cursor-size" = 24; 12 | "/org/gnome/desktop/interface/cursor-theme" = "Yaru"; 13 | "/org/gnome/desktop/interface/document-font-name" = "Inter 11"; 14 | "/org/gnome/desktop/interface/enable-hot-corners" = false; 15 | "/org/gnome/desktop/interface/font-name" = "Inter 11"; 16 | "/org/gnome/desktop/interface/gtk-enable-primary-paste" = false; 17 | "/org/gnome/desktop/interface/gtk-theme" = "adw-gtk3-dark"; 18 | "/org/gnome/desktop/interface/icon-theme" = "Yaru"; 19 | "/org/gnome/desktop/lockdown/disable-lock-screen" = true; 20 | "/org/gnome/desktop/peripherals/mouse/accel-profile" = "flat"; 21 | "/org/gnome/desktop/wm/preferences/titlebar-font" = "Inter Bold 11"; 22 | "/org/gnome/desktop/peripherals/touchpad/click-method" = "areas"; 23 | "/org/gnome/desktop/interface/show-battery-percentage" = true; 24 | "/org/gnome/desktop/interface/clock-format" = "12h"; 25 | "/org/gnome/desktop/wm/preferences/resize-with-right-button" = true; 26 | "/org/gnome/desktop/search-providers/disabled" = [ 27 | "org.gnome.Characters.desktop" 28 | "org.gnome.clocks.desktop" 29 | "org.gnome.seahorse.Application.desktop" 30 | "org.gnome.Nautilus.desktop" 31 | # "user-theme@gnome-shell-extensions.gcampax.github.com" 32 | ]; 33 | "/org/gnome/shell/disable-user-extensions" = false; 34 | "/org/gnome/shell/enabled-extensions" = [ 35 | "appindicatorsupport@rgcjonas.gmail.com" 36 | "dash-to-panel@jderose9.github.com" 37 | "monitor@astraext.github.io" 38 | ]; 39 | "/org/gnome/shell/keybindings/switch-to-application-1" = [ ]; 40 | "/org/gnome/shell/keybindings/switch-to-application-2" = [ ]; 41 | "/org/gnome/shell/keybindings/switch-to-application-3" = [ ]; 42 | "/org/gnome/shell/keybindings/switch-to-application-4" = [ ]; 43 | "/org/gnome/desktop/wm/keybindings/switch-to-workspace-1" = [ "1" ]; 44 | "/org/gnome/desktop/wm/keybindings/switch-to-workspace-2" = [ "2" ]; 45 | "/org/gnome/desktop/wm/keybindings/switch-to-workspace-3" = [ "3" ]; 46 | "/org/gnome/desktop/wm/keybindings/switch-to-workspace-4" = [ "4" ]; 47 | "/org/gnome/desktop/wm/keybindings/move-to-workspace-1" = [ "1" ]; 48 | "/org/gnome/desktop/wm/keybindings/move-to-workspace-2" = [ "2" ]; 49 | "/org/gnome/desktop/wm/keybindings/move-to-workspace-3" = [ "3" ]; 50 | "/org/gnome/desktop/wm/keybindings/move-to-workspace-4" = [ "4" ]; 51 | "/org/gnome/desktop/wm/keybindings/close" = [ "q" ]; 52 | "/org/gnome/mutter/dynamic-workspaces" = false; 53 | "/org/gnome/desktop/wm/preferences/num-workspaces" = 4; 54 | "/org/gnome/mutter/workspaces-only-on-primary" = false; 55 | }; 56 | } 57 | -------------------------------------------------------------------------------- /modules/nixos/_mkUser.nix: -------------------------------------------------------------------------------- 1 | name: 2 | { 3 | lib, 4 | config, 5 | pkgs, 6 | ... 7 | }: 8 | let 9 | inherit (config.users.users.${name}) home; 10 | in 11 | { 12 | _file = ./_mkUser.nix; 13 | 14 | environment.shells = [ 15 | pkgs.fish-viper 16 | ]; 17 | 18 | users.users.${name} = { 19 | inherit name; 20 | home = lib.mkDefault "/home/${name}"; 21 | createHome = true; 22 | description = name; 23 | isNormalUser = true; 24 | extraGroups = [ 25 | "audio" 26 | "input" 27 | "networkmanager" 28 | "systemd-journal" 29 | "uucp" 30 | "video" 31 | "wheel" 32 | "dialout" 33 | ]; 34 | openssh.authorizedKeys.keys = [ ]; 35 | hashedPasswordFile = "/var/lib/secrets/users.passwd"; 36 | shell = "/run/current-system/sw/bin/fish"; 37 | }; 38 | 39 | systemd.tmpfiles.rules = 40 | [ 41 | "d ${home} 0700 ${name} ${config.users.users.${name}.group} - -" 42 | "z ${home} 0700 ${name} ${config.users.users.${name}.group} - -" 43 | ] 44 | ++ (lib.flatten ( 45 | map 46 | (d: [ 47 | "d ${home}/${d} 0755 ${name} users - -" 48 | "z ${home}/${d} 0755 ${name} users - -" 49 | ]) 50 | [ 51 | ".config" 52 | ".local" 53 | ".local/share" 54 | ".cache" 55 | ".ssh" 56 | 57 | "Desktop" 58 | "Documents" 59 | "Downloads" 60 | "Music" 61 | "Pictures" 62 | "Videos" 63 | ] 64 | )); 65 | } 66 | -------------------------------------------------------------------------------- /modules/nixos/common.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | # inputs', 6 | ... 7 | }: 8 | { 9 | imports = [ ./swap.nix ]; 10 | 11 | # broken 12 | services.envfs.enable = lib.mkForce false; 13 | 14 | programs.nh = { 15 | enable = true; 16 | clean.enable = true; 17 | clean.extraArgs = "--keep-since 1w --keep 3"; 18 | # package = inputs'.nh.packages.default; 19 | }; 20 | 21 | nix = { 22 | # package = self'.packages.nix; 23 | daemonCPUSchedPolicy = "idle"; 24 | settings = lib.mkMerge [ 25 | (import ../../misc/nix-conf.nix) 26 | (import ../../misc/nix-conf-privileged.nix) 27 | { "flake-registry" = "/etc/nix/registry.json"; } 28 | ]; 29 | channel.enable = false; 30 | nixPath = [ "nixpkgs=/etc/nixpkgs" ]; 31 | # FIXME: Should use a `path` entry using the narHash from npins 32 | registry.nixpkgs.to = { 33 | type = "github"; 34 | owner = "NixOS"; 35 | repo = "nixpkgs"; 36 | ref = (import ../../npins).nixpkgs.revision; 37 | }; 38 | }; 39 | 40 | environment.etc.nixpkgs.source = pkgs.path; 41 | 42 | users.mutableUsers = false; 43 | 44 | services.udev.packages = with pkgs; [ android-udev-rules ]; 45 | 46 | environment.defaultPackages = [ ]; 47 | 48 | environment.sessionVariables = { 49 | EDITOR = "nvim"; 50 | # NIXPKGS_CONFIG = lib.mkForce ""; 51 | }; 52 | 53 | environment.systemPackages = with pkgs; [ 54 | # CLI base tools 55 | usbutils 56 | pciutils 57 | file 58 | pax-utils 59 | efibootmgr 60 | e2fsprogs.bin 61 | android-tools 62 | 63 | # Global dev, not part of env 64 | # self'.packages.env 65 | env-viper 66 | nixpkgs-fmt 67 | nix-output-monitor 68 | shellcheck 69 | # inputs'.tree-sitter.packages.tree-sitter-cat 70 | sops 71 | age 72 | aichat 73 | 74 | # GUI 75 | warp 76 | # google-chrome 77 | # self'.packages.google-chrome 78 | # self'.packages.microsoft-edge 79 | brave 80 | # ptyxis 81 | zellij 82 | # self'.packages.alacritty 83 | # self'.packages.wezterm 84 | vscode 85 | # self'.packages.ghostty 86 | alacritty 87 | # self'.packages.tmux 88 | libcgroup 89 | wl-color-picker 90 | # self'.packages.code-cursor 91 | 92 | maid 93 | ]; 94 | 95 | # i18n = let 96 | # # defaultLocale = "en_US.UTF-8"; 97 | # inherit (config.i18n) defaultLocale; # set in nix-common 98 | # es = "es_ES.UTF-8"; 99 | # in { 100 | # inherit defaultLocale; 101 | # extraLocaleSettings = { 102 | # LANG = defaultLocale; 103 | # LC_COLLATE = defaultLocale; 104 | # LC_CTYPE = defaultLocale; 105 | # LC_MESSAGES = defaultLocale; 106 | # 107 | # LC_ADDRESS = es; 108 | # LC_IDENTIFICATION = es; 109 | # LC_MEASUREMENT = es; 110 | # LC_MONETARY = es; 111 | # LC_NAME = es; 112 | # LC_NUMERIC = es; 113 | # LC_PAPER = es; 114 | # LC_TELEPHONE = es; 115 | # LC_TIME = es; 116 | # }; 117 | # }; 118 | 119 | systemd = 120 | let 121 | extraConfig = '' 122 | DefaultTimeoutStartSec=15s 123 | DefaultTimeoutStopSec=15s 124 | DefaultTimeoutAbortSec=15s 125 | DefaultDeviceTimeoutSec=15s 126 | ''; 127 | in 128 | { 129 | inherit extraConfig; 130 | user = { inherit extraConfig; }; 131 | services."getty@tty1".enable = false; 132 | services."autovt@tty1".enable = false; 133 | services."getty@tty7".enable = false; 134 | services."autovt@tty7".enable = false; 135 | services."kmsconvt@tty1".enable = false; 136 | services."kmsconvt@tty7".enable = false; 137 | }; 138 | 139 | programs.ssh = { 140 | startAgent = true; 141 | agentTimeout = "8h"; 142 | }; 143 | 144 | fonts.packages = [ 145 | # pkgs.roboto 146 | pkgs.inter 147 | # self'.packages.iosevka 148 | pkgs.iosevka-normal 149 | # (pkgs.nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];}) 150 | pkgs.nerd-fonts.symbols-only 151 | pkgs.corefonts 152 | # config.services.desktopManager.plasma6.notoPackage 153 | ]; 154 | 155 | time.timeZone = "Europe/Madrid"; 156 | 157 | services.xserver = { 158 | enable = true; 159 | xkb = { 160 | layout = "es"; 161 | options = "compose:rctrl"; 162 | }; 163 | excludePackages = [ pkgs.xterm ]; 164 | }; 165 | 166 | services.libinput = { 167 | enable = true; 168 | mouse.accelProfile = "flat"; 169 | mouse.accelSpeed = "0.0"; 170 | mouse.middleEmulation = false; 171 | }; 172 | 173 | console.useXkbConfig = true; 174 | 175 | services.kmscon = { 176 | # enable = true; 177 | extraConfig = '' 178 | font-size=14 179 | xkb-layout=${config.services.xserver.layout} 180 | ''; 181 | hwRender = true; 182 | fonts = [ 183 | { 184 | name = "iosevka-normal Semibold"; 185 | package = pkgs.iosevka-normal; 186 | } 187 | { 188 | name = "Symbols Nerd Font"; 189 | package = pkgs.nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; }; 190 | } 191 | ]; 192 | }; 193 | 194 | programs.git = { 195 | enable = true; 196 | lfs.enable = true; 197 | }; 198 | 199 | hardware.steam-hardware.enable = true; 200 | } 201 | -------------------------------------------------------------------------------- /modules/nixos/consul.nix: -------------------------------------------------------------------------------- 1 | {config, ...}: { 2 | services.resolved.extraConfig = '' 3 | [Resolve] 4 | DNS=127.0.0.1:8600 5 | DNSSEC=false 6 | Domains=~consul 7 | ''; 8 | 9 | services.consul = { 10 | enable = true; 11 | webUi = true; 12 | interface = { 13 | bind = config.services.tailscale.interfaceName; 14 | advertise = config.services.tailscale.interfaceName; 15 | }; 16 | extraConfig = { 17 | # server = true; 18 | # bootstrap_expect = 2; 19 | client_addr = '' 20 | {{ GetInterfaceIP "${config.services.tailscale.interfaceName}" }} {{ GetAllInterfaces | include "flags" "loopback" | join "address" " " }}''; 21 | }; 22 | }; 23 | 24 | networking.firewall.interfaces.${config.services.tailscale.interfaceName} = rec { 25 | allowedTCPPorts = [8500 8600 8501 8502 8503 8301 8302 8300]; 26 | allowedUDPPorts = allowedTCPPorts; 27 | allowedTCPPortRanges = [ 28 | { 29 | from = 21000; 30 | to = 21255; 31 | } 32 | ]; 33 | }; 34 | 35 | assertions = [ 36 | { 37 | assertion = config.services.resolved.enable; 38 | message = "consul.nix module uses resolved"; 39 | } 40 | { 41 | assertion = config.servives.tailscale.enable; 42 | message = "consul.nix module uses tailscale"; 43 | } 44 | ]; 45 | } 46 | -------------------------------------------------------------------------------- /modules/nixos/ddc.nix: -------------------------------------------------------------------------------- 1 | {config, ...}: { 2 | boot.kernelModules = ["i2c-dev"]; 3 | services.udev.extraRules = '' 4 | KERNEL=="i2c-[0-9]*", GROUP="i2c", MODE="0660" 5 | ''; 6 | 7 | users.groups."i2c".members = config.users.groups.wheel.members; 8 | } 9 | -------------------------------------------------------------------------------- /modules/nixos/docker.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | { 8 | virtualisation.docker = { 9 | enable = true; 10 | enableOnBoot = true; 11 | # extraOptions = 12 | extraOptions = lib.concatStringsSep " " [ 13 | "--registry-mirror=https://mirror.gcr.io" 14 | # "--add-runtime crun=${pkgs.crun}/bin/crun" 15 | # "--default-runtime=crun" 16 | # "--iptables=false" 17 | # "--ip6tables=false" 18 | ]; 19 | enableNvidia = lib.mkIf (builtins.any (v: v == "nvidia") config.services.xserver.videoDrivers) true; 20 | }; 21 | 22 | virtualisation.oci-containers = { 23 | backend = "docker"; 24 | }; 25 | 26 | users.groups.docker.members = config.users.groups.wheel.members; 27 | 28 | systemd = { 29 | timers.docker-prune = { 30 | wantedBy = [ "timers.target" ]; 31 | partOf = [ "docker-prune.service" ]; 32 | timerConfig = { 33 | OnCalendar = "weekly"; 34 | Persistent = true; 35 | }; 36 | }; 37 | services.docker-prune = { 38 | serviceConfig.Type = "oneshot"; 39 | script = '' 40 | ${config.virtualisation.docker.package}/bin/docker system prune --all --force 41 | ''; 42 | requires = [ "docker.service" ]; 43 | }; 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /modules/nixos/es.nix: -------------------------------------------------------------------------------- 1 | {lib, ...}: { 2 | i18n = { 3 | defaultLocale = lib.mkForce "es_ES.UTF-8"; 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /modules/nixos/gnome.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | services.xserver = { 4 | displayManager.gdm.enable = true; 5 | desktopManager.gnome = { 6 | enable = true; 7 | extraGSettingsOverridePackages = with pkgs; [ 8 | mutter 9 | ]; 10 | }; 11 | }; 12 | 13 | environment.systemPackages = with pkgs; [ 14 | # adw-gtk3 15 | gnome-tweaks 16 | # wl-clipboard 17 | # vanilla-dmz 18 | gnomeExtensions.appindicator 19 | gnomeExtensions.dash-to-panel 20 | gnomeExtensions.astra-monitor 21 | # gnomeExtensions.user-themes 22 | gnomeExtensions.clipboard-history 23 | yaru-theme 24 | adw-gtk3 25 | ]; 26 | 27 | environment.gnome.excludePackages = with pkgs; [ 28 | totem 29 | gnome-maps 30 | gnome-logs 31 | simple-scan 32 | gnome-calculator 33 | epiphany 34 | gnome-music 35 | gnome-tour 36 | gnome-contacts 37 | gnome-disk-utility 38 | ]; 39 | 40 | programs.geary.enable = false; 41 | 42 | environment.sessionVariables = { 43 | MOZ_ENABLE_WAYLAND = "1"; 44 | # SSH_ASKPASS_REQUIRE = "prefer"; 45 | NIXOS_OZONE_WL = "1"; 46 | XCURSOR_THEME = "DMZ-White"; 47 | XCURSOR_SIZE = "24"; 48 | }; 49 | 50 | # programs.git.config = { 51 | # credential.helper = "${pkgs.gitFull}/bin/git-credential-libsecret"; 52 | # }; 53 | } 54 | -------------------------------------------------------------------------------- /modules/nixos/guix/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | options, 6 | ... 7 | }: 8 | let 9 | cfg = config.services.guix; 10 | in 11 | { 12 | environment.systemPackages = [ 13 | pkgs.guix-search 14 | ]; 15 | 16 | services.guix = { 17 | enable = true; 18 | # package = self'.packages.guix; 19 | gc = { 20 | enable = true; 21 | dates = "weekly"; 22 | }; 23 | substituters = { 24 | urls = options.services.guix.substituters.urls.default ++ [ 25 | "https://bordeaux.guix.gnu.org" 26 | "https://guix.bordeaux.inria.fr" 27 | ]; 28 | authorizedKeys = options.services.guix.substituters.authorizedKeys.default ++ [ 29 | ./guix.bordeaux.inria.fr.pub 30 | ]; 31 | }; 32 | }; 33 | 34 | systemd.services.guix-daemon = { 35 | # use the system guix for the daemon 36 | script = lib.mkForce '' 37 | exec ${lib.getExe' config.services.guix.package "guix-daemon"} \ 38 | --build-users-group=${cfg.group} \ 39 | ${ 40 | lib.optionalString ( 41 | cfg.substituters.urls != [ ] 42 | ) "--substitute-urls='${lib.concatStringsSep " " cfg.substituters.urls}'" 43 | } \ 44 | ${lib.escapeShellArgs cfg.extraArgs} 45 | ''; 46 | }; 47 | 48 | environment.extraInit = 49 | # bash 50 | '' 51 | export GUILE_LOAD_PATH="$GUILE_LOAD_PATH:$HOME/.config/guix/current/share/guile/site/3.0" 52 | 53 | export GUILE_LOAD_COMPILED_PATH="$GUILE_LOAD_COMPILED_PATH:$HOME/.config/guix/current/share/guile/site/3.0" 54 | export GUILE_LOAD_COMPILED_PATH="$GUILE_LOAD_COMPILED_PATH:$HOME/.config/guix/current/lib/guile/3.0/site-ccache" 55 | 56 | export GUIX_LOCPATH="/var/guix/profiles/per-user/$USER/guix-home/profile/lib/locale:$GUIX_LOCPATH" 57 | ''; 58 | 59 | # https://guix.gnu.org/manual/en/html_node/X_002e509-Certificates.html 60 | environment.sessionVariables = 61 | let 62 | SSL_CERT_FILE = "/run/current-system/etc/ssl/certs/ca-certificates.crt"; 63 | in 64 | { 65 | SSL_CERT_DIR = "/run/current-system/etc/ssl/certs"; 66 | inherit SSL_CERT_FILE; 67 | GIT_SSL_CAINFO = SSL_CERT_FILE; 68 | CURL_CA_BUNDLE = SSL_CERT_FILE; 69 | }; 70 | 71 | systemd.services."guix-daemon" = { 72 | environment = { 73 | # GUIX_LOCPATH = lib.mkForce "/run/current-system/sw/lib/locale"; 74 | # GUIX_LOCPATH = lib.mkForce "/gnu/store/03v1svhv6wj9pd6awpdi5zn4wd31b23f-glibc-locales-2.35/lib/locale"; 75 | }; 76 | }; 77 | } 78 | -------------------------------------------------------------------------------- /modules/nixos/guix/guix.bordeaux.inria.fr.pub: -------------------------------------------------------------------------------- 1 | (public-key 2 | (ecc 3 | (curve Ed25519) 4 | (q #89FBA276A976A8DE2A69774771A92C8C879E0F24614AAAAE23119608707B3F06#))) 5 | -------------------------------------------------------------------------------- /modules/nixos/hyprland.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, ... }: 2 | { 3 | services.xserver = { 4 | displayManager.gdm.enable = true; 5 | }; 6 | 7 | programs.hyprland = { 8 | enable = true; 9 | }; 10 | 11 | environment.systemPackages = with pkgs; [ 12 | vanilla-dmz 13 | wofi 14 | wdisplays 15 | seahorse 16 | xdg-utils 17 | libsecret 18 | nwg-displays 19 | brightnessctl 20 | ]; 21 | 22 | environment.sessionVariables = { 23 | MOZ_ENABLE_WAYLAND = "1"; 24 | NIXOS_OZONE_WL = "1"; 25 | # XCURSOR_THEME = "DMZ-White"; 26 | # XCURSOR_SIZE = "24"; 27 | }; 28 | 29 | services.gnome.gnome-keyring.enable = true; 30 | services.gnome.at-spi2-core.enable = true; 31 | } 32 | -------------------------------------------------------------------------------- /modules/nixos/incus.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: 6 | let 7 | bridge = "incusbr0"; 8 | dnsDomain = "incus"; 9 | ipv4 = "10.0.100.1"; 10 | ipv4Subnet = "24"; 11 | in 12 | # Stuff from https://microk8s.io/docs/install-lxd 13 | # https://raw.githubusercontent.com/ubuntu/microk8s/master/tests/lxc/microk8s.profile 14 | { 15 | assertions = [ 16 | { 17 | assertion = config.services.resolved.enable; 18 | description = "incus module uses resolved"; 19 | } 20 | { 21 | assertion = !config.virtualisation.docker.enable; 22 | description = "incus conflicts with docker"; 23 | } 24 | ]; 25 | 26 | environment.systemPackages = [ 27 | pkgs.sshfs 28 | ]; 29 | 30 | boot.kernelModules = [ 31 | "ip_vs" 32 | "ip_vs_rr" 33 | "ip_vs_wrr" 34 | "ip_vs_sh" 35 | "ip_tables" 36 | "ip6_tables" 37 | "netlink_diag" 38 | "nf_nat" 39 | "overlay" 40 | "br_netfilter" 41 | "iptable_nat" 42 | "iptable_filter" 43 | ]; 44 | 45 | virtualisation.incus = { 46 | enable = true; 47 | package = pkgs.incus; # default is -lts 48 | preseed = { 49 | networks = [ 50 | { 51 | name = bridge; 52 | type = "bridge"; 53 | config = { 54 | "ipv4.address" = "${ipv4}/${ipv4Subnet}"; 55 | "ipv4.nat" = "true"; 56 | "dns.mode" = "managed"; 57 | "dns.domain" = dnsDomain; 58 | }; 59 | } 60 | ]; 61 | profiles = [ 62 | { 63 | name = "default"; 64 | config = { 65 | "security.nesting" = true; 66 | "security.privileged" = true; 67 | "raw.lxc" = '' 68 | lxc.apparmor.profile=unconfined 69 | lxc.mount.auto=proc:rw sys:rw cgroup:rw 70 | lxc.cgroup.devices.allow=a 71 | lxc.cap.drop= 72 | ''; 73 | }; 74 | devices = { 75 | eth0 = { 76 | name = "eth0"; 77 | network = bridge; 78 | type = "nic"; 79 | }; 80 | root = { 81 | path = "/"; 82 | pool = "default"; 83 | size = "35GiB"; 84 | type = "disk"; 85 | }; 86 | nix_store = rec { 87 | type = "disk"; 88 | path = "/nix/store"; 89 | readonly = true; 90 | source = path; 91 | }; 92 | nix_profiles = rec { 93 | type = "disk"; 94 | path = "/nix/var/nix/profiles"; 95 | source = path; 96 | readonly = true; 97 | }; 98 | nixos_etc_static = rec { 99 | type = "disk"; 100 | readonly = true; 101 | source = "/etc/static"; 102 | path = source; 103 | }; 104 | disable1 = { 105 | type = "disk"; 106 | path = "/sys/module/nf_conntrack/parameters/hashsize"; 107 | source = "/sys/module/nf_conntrack/parameters/hashsize"; 108 | }; 109 | disable2 = { 110 | type = "unix-char"; 111 | path = "/dev/kmsg"; 112 | source = "/dev/kmsg"; 113 | }; 114 | disable3 = { 115 | type = "disk"; 116 | path = "/sys/fs/bpf"; 117 | source = "/sys/fs/bpf"; 118 | }; 119 | disable4 = { 120 | type = "disk"; 121 | path = "/proc/sys/net/netfilter/nf_conntrack_max"; 122 | source = "/proc/sys/net/netfilter/nf_conntrack_max"; 123 | }; 124 | disable5 = { 125 | type = "unix-block"; 126 | path = "/dev/dm-0"; 127 | source = "/dev/dm-0"; 128 | }; 129 | }; 130 | } 131 | ]; 132 | storage_pools = [ 133 | { 134 | config = { 135 | source = "/var/lib/incus/storage-pools/default"; 136 | }; 137 | driver = "dir"; 138 | name = "default"; 139 | } 140 | ]; 141 | }; 142 | }; 143 | 144 | users.groups."incus-admin".members = config.users.groups."wheel".members; 145 | 146 | networking.firewall.trustedInterfaces = [ bridge ]; 147 | 148 | # https://linuxcontainers.org/incus/docs/main/howto/network_bridge_resolved 149 | systemd.services."incus-dns-${bridge}" = rec { 150 | description = "Incus per-link DNS configuration for ${bridge}"; 151 | bindsTo = [ "sys-subsystem-net-devices-${bridge}.device" ]; 152 | after = bindsTo; 153 | wantedBy = bindsTo; 154 | serviceConfig = { 155 | Type = "oneshot"; 156 | RemainAfterExit = true; 157 | }; 158 | script = '' 159 | resolvectl dns '${bridge}' '${ipv4}' 160 | resolvectl domain '${bridge}' '~${dnsDomain}' 161 | ''; 162 | postStop = '' 163 | resolvectl revert '${bridge}' 164 | ''; 165 | }; 166 | } 167 | -------------------------------------------------------------------------------- /modules/nixos/plasma6.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | config, 4 | lib, 5 | ... 6 | }: { 7 | services = { 8 | desktopManager.plasma6.enable = true; 9 | displayManager = { 10 | sddm.enable = true; 11 | defaultSession = "plasma"; 12 | }; 13 | }; 14 | 15 | environment.sessionVariables = { 16 | MOZ_ENABLE_WAYLAND = "1"; 17 | SSH_ASKPASS_REQUIRE = "prefer"; 18 | NIXOS_OZONE_WL = "1"; 19 | }; 20 | 21 | environment.systemPackages = [ 22 | pkgs.vanilla-dmz 23 | pkgs.kdePackages.ksshaskpass 24 | pkgs.wl-clipboard-rs 25 | ]; 26 | 27 | environment.sessionVariables = { 28 | XCURSOR_THEME = "DMZ-White"; 29 | }; 30 | 31 | programs.git.config = { 32 | credential.helper = "${pkgs.gitFull}/bin/git-credential-libsecret"; 33 | }; 34 | 35 | programs.kde-pim = let 36 | cfg = config.programs.kde-pim.enable; 37 | in { 38 | enable = lib.mkOverride 999 false; 39 | kmail = lib.mkIf cfg true; 40 | kontact = lib.mkIf cfg true; 41 | merkuro = lib.mkIf cfg true; 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /modules/nixos/podman.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | ... 5 | }: 6 | let 7 | toml = pkgs.formats.toml { }; 8 | in 9 | { 10 | virtualisation.podman = { 11 | enable = true; 12 | 13 | autoPrune = { 14 | enable = true; 15 | flags = [ "--all" ]; 16 | dates = "weekly"; 17 | }; 18 | }; 19 | 20 | virtualisation.oci-containers = { 21 | backend = "podman"; 22 | }; 23 | 24 | environment.etc = { 25 | "containers/registries.conf".source = 26 | lib.mkForce 27 | <| toml.generate "registries.conf" { 28 | unqualified-search-registries = [ "docker.io" ]; 29 | registry = [ 30 | { 31 | prefix = "docker.io"; 32 | location = "mirror.gcr.io"; 33 | insecure = false; 34 | } 35 | ]; 36 | }; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /modules/nixos/printing.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | services.avahi = { 3 | enable = true; 4 | nssmdns4 = true; 5 | openFirewall = true; 6 | # publish = { 7 | # enable = true; 8 | # userServices = true; 9 | # }; 10 | }; 11 | 12 | services.printing = { 13 | enable = true; 14 | # listenAddresses = [ "*:631" ]; 15 | # allowFrom = [ "all" ]; 16 | # browsing = true; 17 | # defaultShared = true; 18 | drivers = with pkgs; [ 19 | gutenprint 20 | hplipWithPlugin 21 | postscript-lexmark 22 | samsung-unified-linux-driver 23 | splix 24 | brlaser 25 | cnijfilter2 26 | ]; 27 | }; 28 | 29 | # networking.firewall = { 30 | # allowedTCPPorts = [ 631 ]; 31 | # allowedUDPPorts = [ 631 ]; 32 | # }; 33 | } 34 | -------------------------------------------------------------------------------- /modules/nixos/silent-boot.nix: -------------------------------------------------------------------------------- 1 | { 2 | boot.kernelParams = [ 3 | "quiet" 4 | "systemd.show_status=auto" 5 | "rd.udev.log_level=3" 6 | "plymouth.use-simpledrm" 7 | ]; 8 | 9 | boot.plymouth = { 10 | enable = true; 11 | }; 12 | 13 | boot.loader.timeout = 0; 14 | } 15 | -------------------------------------------------------------------------------- /modules/nixos/swap.nix: -------------------------------------------------------------------------------- 1 | { 2 | swapDevices = [ 3 | { 4 | device = "/swapfile"; 5 | size = 4096; 6 | } 7 | ]; 8 | 9 | zramSwap = {enable = true;}; 10 | } 11 | -------------------------------------------------------------------------------- /modules/nixos/tailscale.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: let 7 | inherit (config.services.tailscale) interfaceName; 8 | in { 9 | services.tailscale.enable = true; 10 | 11 | networking.firewall = { 12 | # Strict reverse path filtering breaks Tailscale exit node use and some subnet routing setups. 13 | checkReversePath = "loose"; 14 | interfaces.${interfaceName} = { 15 | allowedTCPPorts = [22]; 16 | allowedTCPPortRanges = [ 17 | { 18 | from = 8000; 19 | to = 8999; 20 | } 21 | ]; 22 | }; 23 | }; 24 | 25 | environment.systemPackages = lib.mkMerge [ 26 | (lib.mkIf config.services.desktopManager.plasma6.enable [ 27 | pkgs.ktailctl 28 | ]) 29 | ]; 30 | } 31 | -------------------------------------------------------------------------------- /modules/nixos/tmpfs.nix: -------------------------------------------------------------------------------- 1 | {lib, ...}: { 2 | fileSystems = let 3 | mkTmpfs = { 4 | device = "none"; 5 | fsType = "tmpfs"; 6 | options = ["size=2G" "mode=0755"]; 7 | neededForBoot = true; 8 | }; 9 | in { 10 | "/etc" = mkTmpfs; 11 | "/bin" = mkTmpfs; 12 | "/lib" = mkTmpfs; 13 | "/lib64" = mkTmpfs; 14 | "/opt" = mkTmpfs; 15 | "/srv" = mkTmpfs; 16 | "/usr" = mkTmpfs; 17 | }; 18 | 19 | systemd.tmpfiles.rules = let 20 | move = { 21 | from, 22 | to, 23 | }: [ 24 | "d ${to} 0755 root root - -" 25 | "z ${to} 0755 root root - -" 26 | "L ${from} - - - - ${to}" 27 | ]; 28 | in 29 | lib.mkMerge [ 30 | (move { 31 | from = "/etc/NetworkManager/system-connections"; 32 | to = "/var/lib/NetworkManager-system-connections"; 33 | }) 34 | ]; 35 | } 36 | -------------------------------------------------------------------------------- /modules/nixos/tpm2/default.nix: -------------------------------------------------------------------------------- 1 | # https://wiki.gentoo.org/wiki/Trusted_Platform_Module/SSH#Key_Creation 2 | { 3 | pkgs, 4 | config, 5 | ... 6 | }: 7 | let 8 | pkcs11pkg = pkgs.tpm2-pkcs11.overrideAttrs (old: { 9 | configureFlags = old.configureFlags ++ [ 10 | "--with-fapi=no" 11 | ]; 12 | }); 13 | # pkcs11pkg = pkgs.tpm2-pkcs11-esapi; 14 | cmdname = "git-key-command"; 15 | in 16 | { 17 | environment.systemPackages = with pkgs; [ 18 | sbctl 19 | dmidecode 20 | (pkgs.runCommandLocal cmdname { } '' 21 | mkdir -p $out/bin 22 | cp -v ${./git-key-command.sh} $out/bin/${cmdname} 23 | patchShebangs --host $out/bin/* 24 | '') 25 | ]; 26 | 27 | security.tpm2 = { 28 | enable = true; 29 | abrmd.enable = true; 30 | pkcs11 = { 31 | enable = true; 32 | package = pkcs11pkg; 33 | }; 34 | tctiEnvironment = { 35 | enable = true; 36 | # interface = "tabrmd"; 37 | }; 38 | }; 39 | 40 | programs.ssh = { 41 | agentPKCS11Whitelist = "${pkcs11pkg}/lib/*"; 42 | }; 43 | 44 | users.groups."tss".members = config.users.groups."wheel".members; 45 | 46 | programs.git.config = { 47 | commit.gpgsign = true; 48 | gpg = { 49 | format = "ssh"; 50 | ssh.defaultKeyCommand = cmdname; 51 | }; 52 | }; 53 | } 54 | -------------------------------------------------------------------------------- /modules/nixos/tpm2/git-key-command.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | set -x 3 | unset SSH_ASKPASS 4 | 5 | lib=/run/current-system/sw/lib/libtpm2_pkcs11.so 6 | 7 | if ! ssh-add -L | grep --quiet libtpm2_pkcs11.so; then 8 | set -e 9 | ssh-add -s $lib 10 | set +e 11 | fi 12 | 13 | echo "key::$(ssh-keygen -D $lib)" 14 | 15 | -------------------------------------------------------------------------------- /modules/nixos/user-ayats.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | (import ./_mkUser.nix "ayats") 4 | ]; 5 | 6 | users.users.ayats = { 7 | uid = 10000; 8 | home = "/var/home/ayats"; 9 | 10 | maid = ../maid; 11 | }; 12 | 13 | systemd.tmpfiles.rules = [ 14 | "z /var/home 0755 root root - -" 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /modules/nixos/user-soch.nix: -------------------------------------------------------------------------------- 1 | { 2 | imports = [ 3 | (import ./_mkUser.nix "soch") 4 | ]; 5 | 6 | users.users.soch = { 7 | uid = 10001; 8 | home = "/tmp/soch"; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /modules/nixos/yubikey/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: { 6 | environment.systemPackages = [pkgs.pam_u2f pkgs.yubikey-manager pkgs.gnupg]; 7 | 8 | security.pam.u2f = { 9 | enable = true; 10 | settings = { 11 | origin = "pam://${config.networking.hostName}"; 12 | appId = "pam://${config.networking.hostName}"; 13 | cue = true; 14 | }; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /modules/nixos/yubikey/setup-yubikey.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | set -eux 3 | 4 | mkdir -p ~/.config/Yubico 5 | pamu2fcfg -o pam://$(hostname) -i pam://$(hostname) > ~/.config/Yubico/u2f_keys 6 | -------------------------------------------------------------------------------- /modules/wrapper-manager/alacritty/alacritty.toml: -------------------------------------------------------------------------------- 1 | [font] 2 | normal = { family = "iosevka-normal", style = "Medium" } 3 | size = 11.5 4 | 5 | [window] 6 | # padding = { x = 10, y = 10 } 7 | # dynamic_padding = true 8 | 9 | [terminal] 10 | osc52 = "CopyPaste" 11 | 12 | # [[keyboard.bindings]] 13 | # key = "C" 14 | # mods = "Control | Shift" 15 | # # passthru as 16 | # chars = "\u001b[5;5~" 17 | 18 | [[keyboard.bindings]] 19 | key = "V" 20 | mods = "Control | Shift" 21 | action = "Paste" 22 | 23 | [[keyboard.bindings]] 24 | key = "Tab" 25 | mods = "Control" 26 | chars = "\u001b[9;5u" 27 | 28 | [[keyboard.bindings]] 29 | key = "Tab" 30 | mods = "Control | Shift" 31 | chars = "\u001b[1;5Z" 32 | 33 | [colors] 34 | draw_bold_text_with_bright_colors = false 35 | 36 | [cursor] 37 | style = { shape = "Beam", blinking = "On" } 38 | 39 | [env] 40 | TERM = "xterm-256color" 41 | -------------------------------------------------------------------------------- /modules/wrapper-manager/alacritty/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | config, 5 | ... 6 | }: 7 | let 8 | ascii-table = import "${pkgs.path}/lib/ascii-table.nix"; 9 | ascii-table' = lib.mapAttrs' (name: value: { 10 | name = builtins.toString value; 11 | value = name; 12 | }) ascii-table; 13 | tomlFormat = pkgs.formats.toml { }; 14 | esc = builtins.fromJSON ''"\u001b"''; 15 | in 16 | { 17 | options = { 18 | alacrittyConfig = lib.mkOption { 19 | default = { }; 20 | type = tomlFormat.type; 21 | }; 22 | }; 23 | 24 | config = { 25 | alacrittyConfig = lib.mkMerge [ 26 | (lib.importTOML ./alacritty.toml) 27 | # (lib.importTOML ./theme.toml) 28 | (lib.importTOML ./mocha.toml) 29 | { 30 | # terminal.shell.program = pkgs.writeShellScript "alacritty-start" '' 31 | # if [[ $(type -P tmux) ]]; then 32 | # exec tmux new-session -A -s main 33 | # else 34 | # exec "$SHELL" 35 | # fi 36 | # ''; 37 | terminal.shell.program = pkgs.writeShellScript "alacritty-start" '' 38 | if [[ $(type -P zellij) ]]; then 39 | exec zellij attach -c main 40 | else 41 | exec "$SHELL" 42 | fi 43 | ''; 44 | 45 | keyboard.bindings = 46 | (lib.range 65 90) 47 | |> (builtins.filter ( 48 | n: 49 | !(builtins.elem n [ 50 | # 67 # C 51 | 86 # V 52 | ]) 53 | )) 54 | |> (map (n: { 55 | key = builtins.getAttr (builtins.toString n) ascii-table'; 56 | mods = "Control | Shift"; 57 | chars = "${esc}[${builtins.toString n};5u"; 58 | })); 59 | } 60 | ]; 61 | 62 | wrappers.alacritty = { 63 | basePackage = pkgs.alacritty; 64 | flags = [ 65 | "--config-file" 66 | ((pkgs.formats.toml { }).generate "alacritty.toml" config.alacrittyConfig) 67 | ]; 68 | }; 69 | }; 70 | } 71 | -------------------------------------------------------------------------------- /modules/wrapper-manager/alacritty/macchiato.toml: -------------------------------------------------------------------------------- 1 | [colors.primary] 2 | background = "#24273a" 3 | foreground = "#cad3f5" 4 | dim_foreground = "#8087a2" 5 | bright_foreground = "#cad3f5" 6 | 7 | [colors.cursor] 8 | text = "#24273a" 9 | cursor = "#f4dbd6" 10 | 11 | [colors.vi_mode_cursor] 12 | text = "#24273a" 13 | cursor = "#b7bdf8" 14 | 15 | [colors.search.matches] 16 | foreground = "#24273a" 17 | background = "#a5adcb" 18 | 19 | [colors.search.focused_match] 20 | foreground = "#24273a" 21 | background = "#a6da95" 22 | 23 | [colors.footer_bar] 24 | foreground = "#24273a" 25 | background = "#a5adcb" 26 | 27 | [colors.hints.start] 28 | foreground = "#24273a" 29 | background = "#eed49f" 30 | 31 | [colors.hints.end] 32 | foreground = "#24273a" 33 | background = "#a5adcb" 34 | 35 | [colors.selection] 36 | text = "#24273a" 37 | background = "#f4dbd6" 38 | 39 | [colors.normal] 40 | black = "#494d64" 41 | red = "#ed8796" 42 | green = "#a6da95" 43 | yellow = "#eed49f" 44 | blue = "#8aadf4" 45 | magenta = "#f5bde6" 46 | cyan = "#8bd5ca" 47 | white = "#b8c0e0" 48 | 49 | [colors.bright] 50 | black = "#5b6078" 51 | red = "#ed8796" 52 | green = "#a6da95" 53 | yellow = "#eed49f" 54 | blue = "#8aadf4" 55 | magenta = "#f5bde6" 56 | cyan = "#8bd5ca" 57 | white = "#a5adcb" 58 | 59 | [[colors.indexed_colors]] 60 | index = 16 61 | color = "#f5a97f" 62 | 63 | [[colors.indexed_colors]] 64 | index = 17 65 | color = "#f4dbd6" 66 | -------------------------------------------------------------------------------- /modules/wrapper-manager/alacritty/mocha.toml: -------------------------------------------------------------------------------- 1 | [colors.primary] 2 | background = "#1e1e2e" 3 | foreground = "#cdd6f4" 4 | dim_foreground = "#7f849c" 5 | bright_foreground = "#cdd6f4" 6 | 7 | [colors.cursor] 8 | text = "#1e1e2e" 9 | cursor = "#f5e0dc" 10 | 11 | [colors.vi_mode_cursor] 12 | text = "#1e1e2e" 13 | cursor = "#b4befe" 14 | 15 | [colors.search.matches] 16 | foreground = "#1e1e2e" 17 | background = "#a6adc8" 18 | 19 | [colors.search.focused_match] 20 | foreground = "#1e1e2e" 21 | background = "#a6e3a1" 22 | 23 | [colors.footer_bar] 24 | foreground = "#1e1e2e" 25 | background = "#a6adc8" 26 | 27 | [colors.hints.start] 28 | foreground = "#1e1e2e" 29 | background = "#f9e2af" 30 | 31 | [colors.hints.end] 32 | foreground = "#1e1e2e" 33 | background = "#a6adc8" 34 | 35 | [colors.selection] 36 | text = "#1e1e2e" 37 | background = "#f5e0dc" 38 | 39 | [colors.normal] 40 | black = "#45475a" 41 | red = "#f38ba8" 42 | green = "#a6e3a1" 43 | yellow = "#f9e2af" 44 | blue = "#89b4fa" 45 | magenta = "#f5c2e7" 46 | cyan = "#94e2d5" 47 | white = "#bac2de" 48 | 49 | [colors.bright] 50 | black = "#585b70" 51 | red = "#f38ba8" 52 | green = "#a6e3a1" 53 | yellow = "#f9e2af" 54 | blue = "#89b4fa" 55 | magenta = "#f5c2e7" 56 | cyan = "#94e2d5" 57 | white = "#a6adc8" 58 | 59 | [[colors.indexed_colors]] 60 | index = 16 61 | color = "#fab387" 62 | 63 | [[colors.indexed_colors]] 64 | index = 17 65 | color = "#f5e0dc" 66 | 67 | -------------------------------------------------------------------------------- /modules/wrapper-manager/alacritty/theme.toml: -------------------------------------------------------------------------------- 1 | # Default colors 2 | [colors.primary] 3 | background = '0x1D1D1D' 4 | foreground = '0xc5c8c6' 5 | 6 | # Colors the cursor will use if `custom_cursor_colors` is true 7 | [colors.cursor] 8 | text = '0x1d1f21' 9 | cursor = '0xc5c8c6' 10 | 11 | # Normal colors 12 | [colors.normal] 13 | black = '0x1d1f21' 14 | red = '0xcc6666' 15 | green = '0xb5bd68' 16 | yellow = '0xf0c674' 17 | blue = '0x81a2be' 18 | magenta = '0xb294bb' 19 | cyan = '0x8abeb7' 20 | white = '0xc5c8c6' 21 | 22 | # Bright colors 23 | [colors.bright] 24 | black = '0x696969' 25 | red = '0xCC6666' 26 | green = '0xB5BD68' 27 | yellow = '0xF0C674' 28 | blue = '0x81A2BE' 29 | magenta = '0xB294BB' 30 | cyan = '0x8ABEB7' 31 | white = '0xFFFFFF' 32 | 33 | -------------------------------------------------------------------------------- /modules/wrapper-manager/chrome/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | let 3 | commonFlags = [ 4 | "--enable-features=${ 5 | lib.concatStringsSep "," [ 6 | "WebUIDarkMode" 7 | "TouchpadOverscrollHistoryNavigation" 8 | "WaylandTextInputV3" 9 | ] 10 | }" 11 | "--force-dark-mode" 12 | ]; 13 | in 14 | { 15 | wrappers.google-chrome = { 16 | basePackage = pkgs.google-chrome; 17 | flags = commonFlags; 18 | }; 19 | 20 | wrappers.ungoogled-chromium = { 21 | basePackage = pkgs.ungoogled-chromium; 22 | flags = commonFlags ++ [ 23 | "--enable-features=${ 24 | lib.concatStringsSep "," [ 25 | "ClearDataOnExit" 26 | ] 27 | }" 28 | ]; 29 | }; 30 | 31 | wrappers.microsoft-edge = { 32 | basePackage = pkgs.microsoft-edge; 33 | flags = commonFlags; 34 | }; 35 | 36 | wrappers.brave = { 37 | basePackage = pkgs.brave; 38 | flags = commonFlags; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /modules/wrapper-manager/fish/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | let 3 | inherit (pkgs) writeTextDir; 4 | vendorConf = "share/fish/vendor_conf.d"; 5 | 6 | loadPlugin = 7 | writeTextDir "${vendorConf}/viper_load.fish" 8 | # fish 9 | '' 10 | function viper_load_plugin 11 | if test (count $argv) -lt 1 12 | echo Failed to load plugin, incorrect number of arguments 13 | return 1 14 | end 15 | set -l __plugin_dir $argv[1]/share/fish 16 | if test -d $__plugin_dir/vendor_functions.d 17 | set -p fish_function_path $__plugin_dir/vendor_functions.d 18 | end 19 | if test -d $__plugin_dir/vendor_completions.d 20 | set -p fish_complete_path $__plugin_dir/vendor_completions.d 21 | end 22 | if test -d $__plugin_dir/vendor_conf.d 23 | for f in $plugin_dir/vendor_conf.d/*.fish 24 | source $f 25 | end 26 | end 27 | end 28 | ''; 29 | 30 | direnvConfig = writeTextDir "direnvrc" '' 31 | source ${pkgs.nix-direnv}/share/nix-direnv/direnvrc 32 | ''; 33 | 34 | # ${lib.concatMapStringsSep "\n" initPlugin plugins} 35 | config = 36 | writeTextDir "${vendorConf}/viper_config.fish" 37 | # fish 38 | '' 39 | # Only source once 40 | # set -q __fish_config_sourced; and exit 41 | # set -gx __fish_config_sourced 1 42 | ${ 43 | (with pkgs.fishPlugins; [ 44 | foreign-env 45 | fzf-fish 46 | ]) 47 | |> (map (elem: "viper_load_plugin ${elem}")) 48 | |> (lib.concatStringsSep "\n") 49 | } 50 | 51 | # NixOS's /etc/profile already exits early with __ETC_PROFILE_SOURCED 52 | # For some reason, status is-login doesn't work consistently 53 | fenv source /etc/profile 54 | 55 | if status is-interactive 56 | source ${./interactive.fish} 57 | source ${./pushd_mod.fish} 58 | set -gx STARSHIP_CONFIG ${../../../misc/starship.toml} 59 | function starship_transient_prompt_func 60 | ${lib.getExe pkgs.starship} module character 61 | end 62 | ${lib.getExe pkgs.starship} init fish | source 63 | enable_transience 64 | set -gx DIRENV_LOG_FORMAT "" 65 | set -gx direnv_config_dir ${direnvConfig} 66 | ${lib.getExe pkgs.direnv} hook fish | source 67 | end 68 | ''; 69 | in 70 | { 71 | wrappers.fish-viper = { 72 | basePackage = pkgs.fish; 73 | extraWrapperFlags = '' 74 | --prefix XDG_DATA_DIRS : "${ 75 | lib.makeSearchPathOutput "out" "share" [ 76 | # order matters 77 | loadPlugin 78 | config 79 | ] 80 | }" 81 | ''; 82 | }; 83 | } 84 | -------------------------------------------------------------------------------- /modules/wrapper-manager/fish/fish-on-tmpfs.patch: -------------------------------------------------------------------------------- 1 | --- a/src/path.cpp 2 | +++ b/src/path.cpp 3 | @@ -384,7 +384,7 @@ static const base_directory_t &get_data_directory() { 4 | } 5 | 6 | static const base_directory_t &get_config_directory() { 7 | - static base_directory_t s_dir = make_base_directory(L"XDG_CONFIG_HOME", L"/.config/fish"); 8 | + static base_directory_t s_dir = make_base_directory(L"XDG_RUNTIME_DIR", L"/.config/fish"); 9 | return s_dir; 10 | } 11 | -------------------------------------------------------------------------------- /modules/wrapper-manager/fish/interactive.fish: -------------------------------------------------------------------------------- 1 | set -gx fish_greeting 2 | 3 | # Use this function to get keys 4 | # fish_key_reader 5 | 6 | # Bindings 7 | bind \b backward-kill-word 8 | bind \e\x7F backward-delete-char 9 | 10 | bind \e\[1\;5C forward-word 11 | bind \e\[1\;5D backward-word 12 | 13 | 14 | bind \e\[1\;5A history-token-search-backward 15 | bind \e\[1\;5B history-token-search-forward 16 | 17 | # Env vars 18 | set -gx LS_COLORS "di=34:ln=36:so=32:pi=33:ex=1;32:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43" 19 | set -gx FZF_DEFAULT_OPTS "--color=16 --ansi" 20 | 21 | 22 | # Abbrs 23 | abbr -a -g e eza 24 | abbr -a -g p python3 25 | abbr -a -g n nvim 26 | abbr -a -g y yazi 27 | 28 | # Admin 29 | abbr -a -g ss sudo systemctl 30 | abbr -a -g us systemctl --user 31 | abbr -a -g sf journalctl -xefu 32 | abbr -a -g uf journalctl -xef --user-unit 33 | 34 | # Image cat 35 | # abbr -a -g wat "wezterm imgcat --height 50%" 36 | 37 | set self (builtin realpath /proc/self/exe) 38 | 39 | # Git abbreviations 40 | # https://gist.github.com/james2doyle/6e8a120e31dbaa806a2f91478507314c 41 | abbr -a -g gd "git difftool" 42 | abbr -a -g ga "git add" 43 | abbr -a -g gs "git status" 44 | abbr -a -g gm "git merge" 45 | abbr -a -g gp "git push" 46 | abbr -a -g gl "git logs" 47 | abbr -a -g glt "git logtags" 48 | abbr -a -g gr "cd (git-root)" 49 | abbr -a -g gcm "git commit -m" 50 | abbr -a -g gf "git forgor" 51 | 52 | set -gx fish_color_normal brwhite 53 | set -gx fish_color_command green 54 | set -gx fish_color_keyword brblue 55 | set -gx fish_color_quote yellow 56 | set -gx fish_color_redirection brwhite 57 | set -gx fish_color_end brred 58 | set -gx fish_color_error -o red 59 | set -gx fish_color_param white 60 | set -gx fish_color_comment brblack 61 | set -gx fish_color_selection --background=brblack 62 | # set -gx fish_color_selection cyan 63 | # set -gx fish_color_search_match cyan 64 | set -gx fish_color_search_match --background=brblack 65 | set -gx fish_color_operator green 66 | set -gx fish_color_escape brblue 67 | set -gx fish_color_autosuggestion brblack 68 | set -gx fish_pager_color_progress brblack 69 | set -gx fish_pager_color_prefix green 70 | set -gx fish_pager_color_completion white 71 | set -gx fish_pager_color_description brblack 72 | 73 | # Configure FZF keybinds 74 | # https://github.com/PatrickF1/fzf.fish 75 | fzf_configure_bindings --directory=\cf 76 | 77 | # Print newline after a command 78 | function postexec_test --on-event fish_postexec 79 | echo -e '\e[5 q\e[?12h' 80 | end 81 | 82 | function __fish_command_not_found_handler --on-event fish_command_not_found 83 | echo -e >&2 "\e[31m$argv[1]: command not found\e[0m" 84 | end 85 | 86 | function , 87 | if test (count $argv) -lt 1 88 | echo "Usage: , " 89 | return 90 | end 91 | nix-locate --top-level --at-root -w /bin/$argv[1] 92 | end 93 | 94 | function yazi 95 | set tmp (mktemp -t -p "$XDG_RUNTIME_DIR" "yazi-cwd.XXXXXX") 96 | command yazi $argv --cwd-file="$tmp" 97 | if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] 98 | builtin cd -- "$cwd" 99 | end 100 | rm -f -- "$tmp" 101 | end 102 | -------------------------------------------------------------------------------- /modules/wrapper-manager/fish/pushd_mod.fish: -------------------------------------------------------------------------------- 1 | # clone of builtin pushd/popd 2 | # But exposes $DIRSTACK env variable to use in starship 3 | 4 | function pushd --description 'Push directory to stack' 5 | set -l rot_r 6 | set -l rot_l 7 | 8 | if count $argv >/dev/null 9 | # check for --help 10 | switch $argv[1] 11 | case -h --h --he --hel --help 12 | __fish_print_help pd 13 | return 0 14 | end 15 | 16 | # emulate bash by checking if argument of form +n or -n 17 | if string match -qr '^-[0-9]+$' -- $argv[1] 18 | set rot_r (string sub -s 2 -- $argv[1]) 19 | else if string match -qr '^\+[0-9]+$' -- $argv[1] 20 | set rot_l (string sub -s 2 -- $argv[1]) 21 | end 22 | end 23 | 24 | set -q DIRSTACK 25 | or set -g -x DIRSTACK 26 | 27 | # emulate bash: an empty pd should switch the top of dirs 28 | if not set -q argv[1] 29 | # check that the stack isn't empty 30 | if not set -q DIRSTACK[1] 31 | echo "pd: no other directory" 32 | return 1 33 | end 34 | 35 | # get the top two values of the dirs stack ... the first is pwd 36 | set -l top_dir $PWD 37 | set -l next_dir $DIRSTACK[1] 38 | 39 | # alter the top of DIRSTACK and move to directory 40 | set -g -x DIRSTACK[1] $top_dir 41 | cd $next_dir 42 | return 43 | end 44 | 45 | # emulate bash: check for rotations 46 | if test -n "$rot_l" -o -n "$rot_r" 47 | # grab the current stack 48 | set -l stack $PWD $DIRSTACK 49 | 50 | # translate a right rotation to a left rotation 51 | if test -n "$rot_r" 52 | # check the rotation in range 53 | if test $rot_r -ge (count $stack) 54 | echo "pd: -$rot_r: directory stack index out of range" 55 | return 1 56 | end 57 | 58 | set rot_l (math (count $stack) - 1 - $rot_r) 59 | end 60 | 61 | # check the rotation in range 62 | if test $rot_l -ge (count $stack) 63 | echo "pd: +$rot_l: directory stack index out of range" 64 | return 1 65 | else 66 | # rotate stack unless rot_l is 0 67 | if test $rot_l -gt 0 68 | set stack $stack[(math $rot_l + 1)..(count $stack)] $stack[1..$rot_l] 69 | end 70 | 71 | # now reconstruct DIRSTACK and change directory 72 | set -g -x DIRSTACK $stack[2..(count $stack)] 73 | cd $stack[1] 74 | end 75 | 76 | # print the new stack 77 | dirs 78 | return 79 | end 80 | 81 | # argv[1] is a directory 82 | set -l old_pwd $PWD 83 | cd $argv[1]; and set -g -x -p DIRSTACK $old_pwd 84 | end 85 | 86 | function popd --description "Pop directory from the stack and cd to it" 87 | if count $argv >/dev/null 88 | switch $argv[1] 89 | case -h --h --he --hel --help 90 | __fish_print_help popd 91 | return 0 92 | end 93 | end 94 | 95 | if set -q DIRSTACK[1] 96 | cd $DIRSTACK[1] 97 | set -e DIRSTACK[1] 98 | else 99 | printf (_ "%s: Directory stack is empty…\n") popd 1>&2 100 | return 1 101 | end 102 | end 103 | -------------------------------------------------------------------------------- /modules/wrapper-manager/foot/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | wrappers.foot = { 3 | basePackage = pkgs.foot; 4 | flags = ["--config=${./foot.ini}"]; 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /modules/wrapper-manager/foot/foot.ini: -------------------------------------------------------------------------------- 1 | # -*- conf -*- 2 | 3 | # shell=fish -C zellij 4 | # term=foot (or xterm-256color if built with -Dterminfo=disabled) 5 | # login-shell=no 6 | 7 | # app-id=foot 8 | # title=foot 9 | # locked-title=no 10 | 11 | font=iosevka\-normal:size=14 12 | # font-bold= 13 | # font-italic= 14 | # font-bold-italic= 15 | # line-height= 16 | # letter-spacing=0 17 | # horizontal-letter-offset=0 18 | # vertical-letter-offset=0 19 | # underline-offset= 20 | # box-drawings-uses-font-glyphs=no 21 | # dpi-aware=auto 22 | 23 | # initial-window-size-pixels=700x500 # Or, 24 | # initial-window-size-chars= 25 | # initial-window-mode=windowed 26 | pad=4x4 # optionally append 'center' 27 | # resize-delay-ms=100 28 | 29 | # notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body} 30 | 31 | # bold-text-in-bright=no 32 | # word-delimiters=,│`|:"'()[]{}<> 33 | # selection-target=primary 34 | # workers= 35 | 36 | [environment] 37 | # name=value 38 | 39 | [bell] 40 | # urgent=no 41 | # notify=no 42 | # command= 43 | # command-focused=no 44 | 45 | [scrollback] 46 | # lines=1000 47 | # multiplier=3.0 48 | # indicator-position=relative 49 | # indicator-format= 50 | 51 | [url] 52 | # launch=xdg-open ${url} 53 | # label-letters=sadfjklewcmpgh 54 | # osc8-underline=url-mode 55 | # protocols=http, https, ftp, ftps, file, gemini, gopher 56 | # uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[] 57 | 58 | [cursor] 59 | style=beam 60 | # color= 61 | # blink=no 62 | # beam-thickness=1.5 63 | # underline-thickness= 64 | 65 | [mouse] 66 | # hide-when-typing=no 67 | # alternate-scroll-mode=yes 68 | 69 | [colors] 70 | # alpha=1.0 71 | # foreground=dcdccc 72 | # background=111111 73 | 74 | ## Normal/regular colors (color palette 0-7) 75 | # regular0=222222 # black 76 | # regular1=cc9393 # red 77 | # regular2=7f9f7f # green 78 | # regular3=d0bf8f # yellow 79 | # regular4=6ca0a3 # blue 80 | # regular5=dc8cc3 # magenta 81 | # regular6=93e0e3 # cyan 82 | # regular7=dcdccc # white 83 | 84 | ## Bright colors (color palette 8-15) 85 | # bright0=666666 # bright black 86 | # bright1=dca3a3 # bright red 87 | # bright2=bfebbf # bright green 88 | # bright3=f0dfaf # bright yellow 89 | # bright4=8cd0d3 # bright blue 90 | # bright5=fcace3 # bright magenta 91 | # bright6=b3ffff # bright cyan 92 | # bright7=ffffff # bright white 93 | 94 | ## dimmed colors (see foot.ini(5) man page) 95 | # dim0= 96 | # ... 97 | # dim7= 98 | 99 | ## The remaining 256-color palette 100 | # 16 = <256-color palette #16> 101 | # ... 102 | # 255 = <256-color palette #255> 103 | 104 | ## Misc colors 105 | # selection-foreground= 106 | # selection-background= 107 | # jump-labels= # black-on-yellow 108 | # scrollback-indicator= # black-on-bright-blue 109 | # search-box-no-match= # black-on-red 110 | # search-box-match= # black-on-yellow 111 | # urls= 112 | 113 | [csd] 114 | # preferred=server 115 | size=30 116 | font=Roboto 117 | # color=121212 118 | # hide-when-typing=no 119 | # border-width=0 120 | # border-color= 121 | # button-width=26 122 | # button-color= 123 | # button-minimize-color= 124 | # button-maximize-color= 125 | # button-close-color= 126 | 127 | [key-bindings] 128 | # scrollback-up-page=Shift+Page_Up 129 | # scrollback-up-half-page=none 130 | # scrollback-up-line=none 131 | # scrollback-down-page=Shift+Page_Down 132 | # scrollback-down-half-page=none 133 | # scrollback-down-line=none 134 | # clipboard-copy=Control+Shift+c XF86Copy 135 | # clipboard-paste=Control+Shift+v XF86Paste 136 | # primary-paste=Shift+Insert 137 | # search-start=Control+Shift+r 138 | # font-increase=Control+plus Control+equal Control+KP_Add 139 | # font-decrease=Control+minus Control+KP_Subtract 140 | # font-reset=Control+0 Control+KP_0 141 | # spawn-terminal=Control+Shift+n 142 | # minimize=none 143 | # maximize=none 144 | # fullscreen=none 145 | # pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none 146 | # pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none 147 | # pipe-selected=[xargs -r firefox] none 148 | # show-urls-launch=Control+Shift+u 149 | # show-urls-copy=none 150 | # show-urls-persistent=none 151 | # prompt-prev=Control+Shift+z 152 | # prompt-next=Control+Shift+x 153 | # unicode-input=none 154 | # noop=none 155 | 156 | [search-bindings] 157 | # cancel=Control+g Control+c Escape 158 | # commit=Return 159 | # find-prev=Control+r 160 | # find-next=Control+s 161 | # cursor-left=Left Control+b 162 | # cursor-left-word=Control+Left Mod1+b 163 | # cursor-right=Right Control+f 164 | # cursor-right-word=Control+Right Mod1+f 165 | # cursor-home=Home Control+a 166 | # cursor-end=End Control+e 167 | # delete-prev=BackSpace 168 | # delete-prev-word=Mod1+BackSpace Control+BackSpace 169 | # delete-next=Delete 170 | # delete-next-word=Mod1+d Control+Delete 171 | # extend-to-word-boundary=Control+w 172 | # extend-to-next-whitespace=Control+Shift+w 173 | # clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste 174 | # primary-paste=Shift+Insert 175 | # unicode-input=none 176 | 177 | [url-bindings] 178 | # cancel=Control+g Control+c Control+d Escape 179 | # toggle-url-visible=t 180 | 181 | [text-bindings] 182 | # \x03=Mod4+c # Map Super+c -> Ctrl+c 183 | 184 | [mouse-bindings] 185 | # selection-override-modifiers=Shift 186 | # primary-paste=BTN_MIDDLE 187 | # select-begin=BTN_LEFT 188 | # select-begin-block=Control+BTN_LEFT 189 | # select-extend=BTN_RIGHT 190 | # select-extend-character-wise=Control+BTN_RIGHT 191 | # select-word=BTN_LEFT-2 192 | # select-word-whitespace=Control+BTN_LEFT-2 193 | # select-row=BTN_LEFT-3 194 | font-increase=Control+BTN_WHEEL_BACK 195 | font-decrease=Control+BTN_WHEEL_FORWARD 196 | 197 | # vim: ft=dosini 198 | -------------------------------------------------------------------------------- /modules/wrapper-manager/ghostty/config: -------------------------------------------------------------------------------- 1 | font-family = iosevka-normal 2 | font-variation = wght=500 3 | font-size = 13 4 | 5 | background = #1D1D1D 6 | 7 | window-padding-x = 10 8 | window-padding-y = 10 9 | 10 | keybind = ctrl+t=new_tab 11 | keybind = alt+enter=new_split:right 12 | keybind = alt+shift+enter=new_split:down 13 | 14 | keybind = alt+left=goto_split:left 15 | keybind = alt+right=goto_split:right 16 | keybind = alt+up=goto_split:up 17 | keybind = alt+down=goto_split:down 18 | 19 | keybind = alt+shift+left=resize_split:left,50 20 | keybind = alt+shift+right=resize_split:right,50 21 | -------------------------------------------------------------------------------- /modules/wrapper-manager/ghostty/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | wrappers.ghostty = { 3 | basePackage = pkgs.ghostty; 4 | flags = [ 5 | "--config-file=${./config}" 6 | ]; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /modules/wrapper-manager/git/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | ... 4 | }: 5 | let 6 | gitconfig = builtins.toFile "gitconfig" ( 7 | (builtins.readFile ../../../misc/gitconfig) 8 | + 9 | # gitconfig 10 | '' 11 | [commit] 12 | template = ${../../../misc/git_template} 13 | '' 14 | ); 15 | in 16 | { 17 | wrappers.git-viper = { 18 | basePackage = pkgs.git.overrideAttrs (old: { 19 | passthru = (old.passhtru or { }) // { 20 | inherit gitconfig; 21 | }; 22 | }); 23 | extraPackages = [ 24 | pkgs.git-extras 25 | pkgs.git-graph 26 | # myGit 27 | ]; 28 | env.GIT_CONFIG_GLOBAL.value = gitconfig; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /modules/wrapper-manager/git/git-config-gmail: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # Define usage function to display help information 4 | usage() { 5 | echo "Usage: $0 " 6 | exit 1 7 | } 8 | 9 | # Parse options with getopts for any flags (like help) 10 | while getopts "h" opt; do 11 | case ${opt} in 12 | h) 13 | usage 14 | ;; 15 | \?) 16 | echo "Invalid option: $OPTARG" 1>&2 17 | usage 18 | ;; 19 | esac 20 | done 21 | 22 | # Shift past the optional arguments 23 | shift $((OPTIND-1)) 24 | 25 | # Check if email was provided as a positional argument 26 | if [ $# -eq 0 ]; then 27 | echo "Error: Email address is required as a positional argument." 28 | usage 29 | fi 30 | 31 | email="$1" 32 | 33 | gitconfig_path=~/.config/git/local 34 | echo ":: Configuring git at $gitconfig_path" 35 | mkdir -p "$(dirname $gitconfig_path)" 36 | 37 | _gitconfig() { 38 | git config --file $gitconfig_path "$@" 39 | } 40 | 41 | _gitconfig sendemail.smtpserver smtp.googlemail.com 42 | _gitconfig sendemail.smtpencryption tls 43 | _gitconfig sendemail.smtpserverport 587 44 | _gitconfig sendemail.smtpuser "$email" 45 | 46 | echo ":: Saving password to libsecret" 47 | secret-tool store --label='gmail send-email' \ 48 | server smtp.googlemail.com \ 49 | port 587 \ 50 | protocol smtp \ 51 | user "$email" \ 52 | xdg:schema org.gnome.keyring.NetworkPassword 53 | 54 | 55 | # vim: ft=bash 56 | -------------------------------------------------------------------------------- /modules/wrapper-manager/git/gnome-accounts-oauth2: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | set -eu 3 | 4 | accounts=$(busctl --user call --json=pretty org.gnome.OnlineAccounts /org/gnome/OnlineAccounts org.freedesktop.DBus.ObjectManager GetManagedObjects) 5 | 6 | google_account_path=$(echo "$accounts" | fq -r '.data[0] | keys[] | select(. != "/org/gnome/OnlineAccounts/Manager") | select(contains("account"))' | head -n 1) 7 | 8 | if [ -z "$google_account_path" ]; then 9 | echo "No Google accounts found." 10 | exit 1 11 | fi 12 | 13 | busctl --user call --json=pretty org.gnome.OnlineAccounts "$google_account_path" org.gnome.OnlineAccounts.OAuth2Based GetAccessToken | fq -r '.data[0]' 14 | 15 | -------------------------------------------------------------------------------- /modules/wrapper-manager/helix/config.toml: -------------------------------------------------------------------------------- 1 | theme = "ayu_evolve" 2 | 3 | [editor] 4 | line-number = "relative" 5 | cursorline = true 6 | true-color = true 7 | bufferline = "always" 8 | color-modes = true 9 | 10 | [editor.cursor-shape] 11 | insert = "bar" 12 | 13 | [editor.lsp] 14 | display-messages = true 15 | display-inlay-hints = true 16 | 17 | [editor.statusline] 18 | left = ["mode", "spacer", "version-control", "spinner", "diagnostics"] 19 | right = ["file-base-name", "file-type", "selections", "position", "file-encoding"] 20 | 21 | [editor.whitespace.render] 22 | space = "none" 23 | tab = "all" 24 | nbsp = "all" 25 | 26 | [editor.gutters] 27 | layout = ["diff", "diagnostics", "line-numbers", "spacer"] 28 | 29 | [editor.soft-wrap] 30 | enable = true 31 | 32 | # https://github.com/LGUG2Z/helix-vim 33 | [keys.normal] 34 | Z = { Z = ":wq", Q = ":q!" } 35 | 36 | # Quick iteration on config changes 37 | C-o = ":config-open" 38 | C-r = ":config-reload" 39 | 40 | # Some nice Helix stuff 41 | C-h = "select_prev_sibling" 42 | C-j = "shrink_selection" 43 | C-k = "expand_selection" 44 | C-l = "select_next_sibling" 45 | 46 | # Personal preference 47 | o = ["open_below", "insert_mode"] 48 | O = ["open_above", "insert_mode"] 49 | 50 | # Muscle memory 51 | "{" = ["goto_prev_paragraph", "collapse_selection"] 52 | "}" = ["goto_next_paragraph", "collapse_selection"] 53 | 0 = "goto_line_start" 54 | "$" = "goto_line_end" 55 | "^" = "goto_first_nonwhitespace" 56 | G = "goto_file_end" 57 | "%" = "match_brackets" 58 | V = ["select_mode", "extend_to_line_bounds"] 59 | C = ["extend_to_line_end", "yank_main_selection_to_clipboard", "delete_selection", "insert_mode"] 60 | D = ["extend_to_line_end", "yank_main_selection_to_clipboard", "delete_selection"] 61 | S = "surround_add" # Would be nice to be able to do something after this but it isn't chainable 62 | 63 | # Clipboards over registers ye ye 64 | x = "delete_selection" 65 | p = ["paste_clipboard_after", "collapse_selection"] 66 | P = ["paste_clipboard_before", "collapse_selection"] 67 | # Would be nice to add ya and yi, but the surround commands can't be chained 68 | Y = ["extend_to_line_end", "yank_main_selection_to_clipboard", "collapse_selection"] 69 | 70 | # Uncanny valley stuff, this makes w and b behave as they do Vim 71 | w = ["move_next_word_start", "move_char_right", "collapse_selection"] 72 | W = ["move_next_long_word_start", "move_char_right", "collapse_selection"] 73 | e = ["move_next_word_end", "collapse_selection"] 74 | E = ["move_next_long_word_end", "collapse_selection"] 75 | b = ["move_prev_word_start", "collapse_selection"] 76 | B = ["move_prev_long_word_start", "collapse_selection"] 77 | 78 | # If you want to keep the selection-while-moving behaviour of Helix, this two lines will help a lot, 79 | # especially if you find having text remain selected while you have switched to insert or append mode 80 | # 81 | # There is no real difference if you have overridden the commands bound to 'w', 'e' and 'b' like above 82 | # But if you really want to get familiar with the Helix way of selecting-while-moving, comment the 83 | # bindings for 'w', 'e', and 'b' out and leave the bindings for 'i' and 'a' active below. A world of difference! 84 | i = ["insert_mode", "collapse_selection"] 85 | a = ["append_mode", "collapse_selection"] 86 | 87 | # Undoing the 'd' + motion commands restores the selection which is annoying 88 | u = ["undo", "collapse_selection"] 89 | 90 | # Escape the madness! No more fighting with the cursor! Or with multiple cursors! 91 | esc = ["collapse_selection", "keep_primary_selection"] 92 | 93 | # Search for word under cursor 94 | "*" = ["move_char_right", "move_prev_word_start", "move_next_word_end", "search_selection", "search_next"] 95 | "#" = ["move_char_right", "move_prev_word_start", "move_next_word_end", "search_selection", "search_prev"] 96 | 97 | # Make j and k behave as they do Vim when soft-wrap is enabled 98 | j = "move_line_down" 99 | k = "move_line_up" 100 | 101 | # Extend and select commands that expect a manual input can't be chained 102 | # I've kept d[X] commands here because it's better to at least have the stuff you want to delete 103 | # selected so that it's just a keystroke away to delete 104 | [keys.normal.d] 105 | d = ["extend_to_line_bounds", "yank_main_selection_to_clipboard", "delete_selection"] 106 | t = ["extend_till_char"] 107 | s = ["surround_delete"] 108 | i = ["select_textobject_inner"] 109 | a = ["select_textobject_around"] 110 | j = ["select_mode", "extend_to_line_bounds", "extend_line_below", "yank_main_selection_to_clipboard", "delete_selection", "normal_mode"] 111 | down = ["select_mode", "extend_to_line_bounds", "extend_line_below", "yank_main_selection_to_clipboard", "delete_selection", "normal_mode"] 112 | k = ["select_mode", "extend_to_line_bounds", "extend_line_above", "yank_main_selection_to_clipboard", "delete_selection", "normal_mode"] 113 | up = ["select_mode", "extend_to_line_bounds", "extend_line_above", "yank_main_selection_to_clipboard", "delete_selection", "normal_mode"] 114 | G = ["select_mode", "extend_to_line_bounds", "goto_last_line", "extend_to_line_bounds", "yank_main_selection_to_clipboard", "delete_selection", "normal_mode"] 115 | w = ["move_next_word_start", "yank_main_selection_to_clipboard", "delete_selection"] 116 | W = ["move_next_long_word_start", "yank_main_selection_to_clipboard", "delete_selection"] 117 | g = { g = ["select_mode", "extend_to_line_bounds", "goto_file_start", "extend_to_line_bounds", "yank_main_selection_to_clipboard", "delete_selection", "normal_mode"] } 118 | 119 | [keys.normal.y] 120 | y = ["extend_to_line_bounds", "yank_main_selection_to_clipboard", "normal_mode", "collapse_selection"] 121 | j = ["select_mode", "extend_to_line_bounds", "extend_line_below", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"] 122 | down = ["select_mode", "extend_to_line_bounds", "extend_line_below", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"] 123 | k = ["select_mode", "extend_to_line_bounds", "extend_line_above", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"] 124 | up = ["select_mode", "extend_to_line_bounds", "extend_line_above", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"] 125 | G = ["select_mode", "extend_to_line_bounds", "goto_last_line", "extend_to_line_bounds", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"] 126 | w = ["move_next_word_start", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"] 127 | W = ["move_next_long_word_start", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"] 128 | g = { g = ["select_mode", "extend_to_line_bounds", "goto_file_start", "extend_to_line_bounds", "yank_main_selection_to_clipboard", "collapse_selection", "normal_mode"] } 129 | 130 | [keys.insert] 131 | # Escape the madness! No more fighting with the cursor! Or with multiple cursors! 132 | esc = ["collapse_selection", "normal_mode"] 133 | 134 | [keys.select] 135 | # Muscle memory 136 | "{" = ["extend_to_line_bounds", "goto_prev_paragraph"] 137 | "}" = ["extend_to_line_bounds", "goto_next_paragraph"] 138 | 0 = "goto_line_start" 139 | "$" = "goto_line_end" 140 | "^" = "goto_first_nonwhitespace" 141 | G = "goto_file_end" 142 | D = ["extend_to_line_bounds", "delete_selection", "normal_mode"] 143 | C = ["goto_line_start", "extend_to_line_bounds", "change_selection"] 144 | "%" = "match_brackets" 145 | S = "surround_add" # Basically 99% of what I use vim-surround for 146 | u = ["switch_to_lowercase", "collapse_selection", "normal_mode"] 147 | U = ["switch_to_uppercase", "collapse_selection", "normal_mode"] 148 | 149 | # Visual-mode specific muscle memory 150 | i = "select_textobject_inner" 151 | a = "select_textobject_around" 152 | 153 | # Some extra binds to allow us to insert/append in select mode because it's nice with multiple cursors 154 | tab = ["insert_mode", "collapse_selection"] # tab is read by most terminal editors as "C-i" 155 | C-a = ["append_mode", "collapse_selection"] 156 | 157 | # Make selecting lines in visual mode behave sensibly 158 | k = ["extend_line_up", "extend_to_line_bounds"] 159 | j = ["extend_line_down", "extend_to_line_bounds"] 160 | 161 | # Clipboards over registers ye ye 162 | d = ["yank_main_selection_to_clipboard", "delete_selection"] 163 | x = ["yank_main_selection_to_clipboard", "delete_selection"] 164 | y = ["yank_main_selection_to_clipboard", "normal_mode", "flip_selections", "collapse_selection"] 165 | Y = ["extend_to_line_bounds", "yank_main_selection_to_clipboard", "goto_line_start", "collapse_selection", "normal_mode"] 166 | p = "replace_selections_with_clipboard" # No life without this 167 | P = "paste_clipboard_before" 168 | 169 | # Escape the madness! No more fighting with the cursor! Or with multiple cursors! 170 | esc = ["collapse_selection", "keep_primary_selection", "normal_mode"] 171 | -------------------------------------------------------------------------------- /modules/wrapper-manager/helix/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | wrappers.helix = { 3 | basePackage = pkgs.helix; 4 | flags = ["-c" ./config.toml]; 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /modules/wrapper-manager/kitty/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | wrappers.kitty = { 4 | basePackage = pkgs.kitty; 5 | env.KITTY_CONFIG_DIRECTORY.value = ./.; 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /modules/wrapper-manager/kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | font_family iosevka-normal 2 | font_size 13.0 3 | 4 | symbol_map U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A2,U+E0A3,U+E0B0-U+E0B3,U+E0B4-U+E0C8,U+E0CA,U+E0CC-U+E0D7,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6B7,U+E700-U+E8EF,U+EA60-U+EC1E,U+ED00-U+EFCE,U+F000-U+F2FF,U+F300-U+F381,U+F400-U+F533,U+F0001-U+F1AF0 Symbols Nerd Font 5 | 6 | -------------------------------------------------------------------------------- /modules/wrapper-manager/neofetch/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | wrappers.neofetch = { 3 | basePackage = pkgs.neofetch.override {x11Support = false;}; 4 | flags = ["--config" ./config.sh "--ascii" ./logo]; 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /modules/wrapper-manager/neofetch/logo: -------------------------------------------------------------------------------- 1 |  2 | <> \ / <> 3 | \_\/ \/_/ 4 | \\\// 5 | _<>_\_\<>/_/_<>_ 6 | <> / /<>\ \ <> 7 | _ //\\\ _ 8 | / /\ /\ \ 9 | <> / \ <> 10 | -------------------------------------------------------------------------------- /modules/wrapper-manager/nushell/config.nu: -------------------------------------------------------------------------------- 1 | let direnv_installed = not (which direnv | is-empty) 2 | let starship_installed = not (which starship | is-empty) 3 | 4 | $env.config = { 5 | show_banner: false 6 | # use_ansi_coloring: false 7 | render_right_prompt_on_last_line: true 8 | # shell_integration: false 9 | hooks: { 10 | pre_prompt: { 11 | if not $direnv_installed { 12 | return 13 | } 14 | 15 | direnv export json | from json | default {} | load-env 16 | } 17 | command_not_found: { 18 | |cmd_name| ( 19 | if ($nu.os-info.name == "linux" and 'CNF' in $env) {try { 20 | let raw_results = (nix-locate --minimal --no-group --type x --type s --top-level --whole-name --at-root $"/bin/($cmd_name)") 21 | let parsed = ($raw_results | split row "\n" | each {|elem| ($elem | parse "{attr}.{output}" | first) }) 22 | let names = ($parsed | each {|row| 23 | if ($row.output == "out") { 24 | $row.attr 25 | } else { 26 | $"($row.attr).($row.output)" 27 | } 28 | }) 29 | let names_display = ($names | str join "\n") 30 | ( 31 | "nix-index found the follwing matches:\n\n" + $names_display 32 | ) 33 | } catch { 34 | null 35 | }} 36 | ) 37 | } 38 | } 39 | keybindings: [ 40 | { 41 | name: completion_menu 42 | modifier: none 43 | keycode: tab 44 | mode: [emacs vi_normal vi_insert] 45 | event: { 46 | until: [ 47 | { send: menu name: completion_menu } 48 | { send: menunext } 49 | ] 50 | } 51 | } 52 | ] 53 | color_config: { 54 | } 55 | rm: { 56 | always_trash: true 57 | } 58 | table: { 59 | mode: compact 60 | index_mode: auto 61 | } 62 | completions: { 63 | quick: true 64 | partial: true 65 | case_sensitive: false 66 | algorithm: "fuzzy" 67 | external: (if ((which carapace | length) > 0) { 68 | { 69 | enable: true 70 | completer: { |spans| carapace $spans.0 nushell $spans | from json } 71 | max_results: 100 72 | } 73 | } else { 74 | {} 75 | }) 76 | } 77 | history: { 78 | file_format: "sqlite" 79 | } 80 | filesize: { 81 | metric: false 82 | } 83 | highlight_resolved_externals: true 84 | } 85 | 86 | if $starship_installed { 87 | $env.STARSHIP_SHELL = "nu" 88 | $env.STARSHIP_SESSION_KEY = (random chars -l 16) 89 | $env.STARSHIP_SESSION_KEY = (random chars -l 16) 90 | $env.PROMPT_MULTILINE_INDICATOR = (starship prompt --continuation) 91 | $env.PROMPT_INDICATOR = "$ " 92 | $env.PROMPT_COMMAND = {|| starship prompt $"--cmd-duration=($env.CMD_DURATION_MS)" $"--status=($env.LAST_EXIT_CODE)" } 93 | $env.PROMPT_COMMAND_RIGHT = '' 94 | } else {} 95 | 96 | 97 | if ($nu.os-info.name == "windows") { 98 | $env.DIRENV_CONFIG = ([ $env.APPDATA "direnv" "conf" ] | path join) 99 | $env.XDG_DATA_HOME = ([ $env.LOCALAPPDATA ] | path join) 100 | $env.XDG_CACHE_HOME = ([ $env.LOCALAPPDATA "cache" ] | path join) 101 | } 102 | 103 | # $env.SHELL = "nu" 104 | -------------------------------------------------------------------------------- /modules/wrapper-manager/nushell/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | wrappers.nushell = { 3 | basePackage = pkgs.nushell; 4 | env.STARSHIP_CONFIG = { 5 | force = true; 6 | value = ../../../misc/starship.toml; 7 | }; 8 | flags = ["--env-config" ./env.nu "--config" ./config.nu]; 9 | pathAdd = [pkgs.starship pkgs.carapace]; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /modules/wrapper-manager/nushell/env.nu: -------------------------------------------------------------------------------- 1 | # empty 2 | -------------------------------------------------------------------------------- /modules/wrapper-manager/nvfetcher/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | _file = ./default.nix; 3 | wrappers.nvfetcher = { 4 | # basePackage = pkgs.nvfetcher-bin; 5 | basePackage = pkgs.nvfetcher; 6 | env.NIX_PATH.value = "nixpkgs=${pkgs.path}"; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /modules/wrapper-manager/stylua/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | wrappers.stylua = { 3 | basePackage = pkgs.stylua; 4 | flags = [ 5 | "--config-path" 6 | ./stylua.toml 7 | ]; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /modules/wrapper-manager/stylua/stylua.toml: -------------------------------------------------------------------------------- 1 | indent_type = "Spaces" 2 | indent_width = 2 3 | call_parentheses = "NoSingleTable" 4 | -------------------------------------------------------------------------------- /modules/wrapper-manager/tmux/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | let 3 | plugins = with pkgs.tmuxPlugins; [ 4 | ]; 5 | in 6 | { 7 | wrappers.tmux = { 8 | basePackage = pkgs.tmux; 9 | flags = [ 10 | "-f" 11 | (pkgs.writeText "tmux-conf" '' 12 | run-shell ${pkgs.tmuxPlugins.sensible.rtp} 13 | 14 | source-file ${./tmux.conf} 15 | 16 | ${plugins |> (map (plugin: "run-shell ${plugin.rtp}")) |> (lib.concatStringsSep "\n")} 17 | '') 18 | ]; 19 | extraWrapperFlags = '' 20 | --run 'export TMUX_TMPDIR="''${XDG_RUNTIME_DIR}"' 21 | ''; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /modules/wrapper-manager/tmux/tmux.conf: -------------------------------------------------------------------------------- 1 | # Based on: 2 | # https://github.com/wincent/wincent/blob/6b083ee658fc11a893f5a86382b44875e2326b8f/aspects/dotfiles/files/.config/tmux/tmux.conf 3 | %hidden TMUX_VERSION="#{s|next-||:#{version}}" 4 | %hidden IS_TMUX_3_3_OR_ABOVE="#{e|>=|f|0:$TMUX_VERSION,3.3}" 5 | %hidden IS_TMUX_3_4_OR_ABOVE="#{e|>=|f|0:$TMUX_VERSION,3.4}" 6 | %hidden IS_TMUX_3_5_OR_ABOVE="#{e|>=|f|0:$TMUX_VERSION,3.5}" 7 | 8 | # Symbolic names for "Vim"-like modes. 9 | %hidden NORMAL=0 10 | %hidden VISUAL=1 11 | %hidden VISUAL_LINE=2 12 | %hidden VISUAL_BLOCK=3 13 | 14 | set-option -g @mode $NORMAL 15 | 16 | # No prefix 17 | unbind-key C-b 18 | # set-option -g prefix C-Space 19 | 20 | unbind-key % 21 | unbind-key '"' 22 | 23 | # Same for new windows. 24 | unbind-key c 25 | bind-key c new-window -c '#{pane_current_path}' 26 | 27 | unbind-key h 28 | unbind-key j 29 | unbind-key k 30 | unbind-key l # normally used for last-window 31 | unbind-key Left 32 | unbind-key Right 33 | unbind-key Down 34 | unbind-key Up 35 | set-option -g status-left-length 40 36 | set-option -g status-left ' #{session_name}  ' # SECTION SIGN (UTF-8: c2 a7) 37 | set-option -g status-right "" 38 | set-option -g status-interval 60 # Default is 15. 39 | set-option -g renumber-windows on 40 | set-option -w -g window-status-current-format '#[reverse] #{window_index}:#{window_name}#{window_flags} ' 41 | set-option -w -g window-status-format ' #{window_index}:#{window_name}#{?#{==:#{window_flags},}, ,#{window_flags} }' 42 | set-option -g mouse on 43 | unbind-key -T copy-mode-vi MouseDragEnd1Pane 44 | bind-key -T copy-mode-vi Escape { 45 | send-keys -X cancel 46 | set-option -g @mode $NORMAL 47 | } 48 | bind-key -T copy-mode-vi C-c { 49 | send-keys -X cancel 50 | set-option -g @mode $NORMAL 51 | } 52 | bind-key -T copy-mode-vi q { 53 | send-keys -X cancel 54 | set-option -g @mode $NORMAL 55 | } 56 | bind-key -T copy-mode-vi C-S-c { 57 | send-keys -X copy-selection-and-cancel 58 | set-option -g @mode $NORMAL 59 | } 60 | bind-key -T copy-mode-vi y { 61 | send-keys -X copy-selection-and-cancel 62 | set-option -g @mode $NORMAL 63 | } 64 | bind-key -T copy-mode-vi C-PageUp { 65 | send-keys -X copy-selection-and-cancel 66 | set-option -g @mode $NORMAL 67 | } 68 | 69 | # Custom 70 | 71 | set-option -g base-index 1 72 | set-option -g pane-base-index 1 73 | set-option -g pane-border-lines heavy 74 | 75 | # unbind-key M-Left 76 | # unbind-key M-Right 77 | # unbind-key M-Up 78 | # unbind-key M-Down 79 | 80 | # bind-key -n M-Right select-pane -R 81 | # bind-key -n M-Left select-pane -L 82 | # bind-key -n M-Up select-pane -U 83 | # bind-key -n M-Down select-pane -D 84 | 85 | # Smart pane switching with awareness of Neovim splits. 86 | bind-key -n M-Left if -F "#{@pane-is-vim}" 'send-keys M-Left' 'select-pane -L' 87 | bind-key -n M-Down if -F "#{@pane-is-vim}" 'send-keys M-Down' 'select-pane -D' 88 | bind-key -n M-Up if -F "#{@pane-is-vim}" 'send-keys M-Up' 'select-pane -U' 89 | bind-key -n M-Right if -F "#{@pane-is-vim}" 'send-keys M-Right' 'select-pane -R' 90 | 91 | bind-key -n M-S-Left if -F "#{@pane-is-vim}" 'send-keys M-S-Left' 'resize-pane -L 3' 92 | bind-key -n M-S-Down if -F "#{@pane-is-vim}" 'send-keys M-S-Down' 'resize-pane -D 3' 93 | bind-key -n M-S-Up if -F "#{@pane-is-vim}" 'send-keys M-S-Up' 'resize-pane -U 3' 94 | bind-key -n M-S-Right if -F "#{@pane-is-vim}" 'send-keys M-S-Right' 'resize-pane -R 3' 95 | 96 | bind-key -n M-Enter split-window -h -c "#{pane_current_path}" 97 | bind-key -n M-S-Enter split-window -v -c "#{pane_current_path}" 98 | 99 | bind-key -n C-t new-window -c "#{pane_current_path}" 100 | bind-key -n C-Tab next-window 101 | bind-key -n C-S-Tab previous-window 102 | 103 | setenv -gu SHLVL 104 | set-option -g status-position top 105 | set -s set-clipboard external 106 | set -g allow-passthrough on 107 | 108 | set-option -g set-titles on 109 | set-option -g set-titles-string "#W" 110 | 111 | set-option -g cursor-style blinking-bar 112 | 113 | set -g default-terminal "tmux-256color" 114 | set -ag terminal-overrides ",xterm-256color:RGB" 115 | 116 | # set -g extended-keys always 117 | -------------------------------------------------------------------------------- /modules/wrapper-manager/tym/config.lua: -------------------------------------------------------------------------------- 1 | local tym = require("tym") 2 | 3 | local p = 0 4 | 5 | tym.set_config({ 6 | -- shell = "zellij", 7 | font = "iosevka-normal Medium 14", 8 | cursor_shape = "ibeam", 9 | padding_top = p, 10 | padding_bottom = p, 11 | padding_right = p, 12 | padding_left = p, 13 | color_window_background = "NONE", 14 | }) 15 | -------------------------------------------------------------------------------- /modules/wrapper-manager/tym/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | wrappers.tym = { 3 | basePackage = pkgs.tym; 4 | flags = [ 5 | "--use=${./config.lua}" 6 | ]; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /modules/wrapper-manager/vscode/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | let 3 | env = { 4 | NIXOS_OZONE_WL = { 5 | value = "1"; 6 | }; 7 | }; 8 | in 9 | { 10 | wrappers.vscode = { 11 | basePackage = pkgs.vscode; 12 | inherit env; 13 | }; 14 | 15 | wrappers.code-cursor = { 16 | basePackage = pkgs.code-cursor; 17 | inherit env; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /modules/wrapper-manager/wezterm/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | ... 4 | }: 5 | { 6 | wrappers.wezterm = { 7 | basePackage = pkgs.wezterm; 8 | # basePackage = inputs'.wezterm.packages.default; 9 | env.WEZTERM_CONFIG_FILE.value = 10 | pkgs.writeText "wezterm.lua" 11 | # lua 12 | '' 13 | local wezterm = require("wezterm") 14 | local config = wezterm.config_builder() 15 | 16 | dofile("${./viper/init.lua}").apply_to_config(config) 17 | dofile("${./viper/linux.lua}").apply_to_config(config) 18 | 19 | dofile("${pkgs.vimPlugins.smart-splits-nvim}/plugin/init.lua").apply_to_config(config, { 20 | -- direction_keys = { "LeftArrow", "DownArrow", "UpArrow", "RightArrow" }, 21 | direction_keys = { "LeftArrow", "DownArrow", "UpArrow", "RightArrow" }, 22 | modifiers = { 23 | move = "ALT", 24 | resize = "SHIFT|ALT", 25 | }, 26 | }) 27 | 28 | return config 29 | ''; 30 | 31 | env.WEZTERM_CONFIG_FILE.force = true; 32 | 33 | env.WEZTERM_LOG.value = builtins.concatStringsSep "," [ 34 | "window::os::wayland::window=off" 35 | "info" 36 | ]; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /modules/wrapper-manager/wezterm/viper/linux.lua: -------------------------------------------------------------------------------- 1 | local wezterm = require("wezterm") 2 | 3 | local M = {} 4 | 5 | local os = require("os") 6 | 7 | M.apply_to_config = function(config) 8 | config.font = wezterm.font_with_fallback { 9 | { family = "iosevka-normal", weight = "Medium" }, 10 | { family = "Symbols Nerd Font" }, 11 | } 12 | config.font_size = 13 13 | 14 | local session = os.getenv("XDG_SESSION_TYPE") 15 | 16 | local shell = os.getenv("SHELL") 17 | config.default_prog = { shell } 18 | 19 | if session == "wayland" then 20 | config.enable_wayland = true 21 | -- config.front_end = "WebGpu" 22 | config.window_decorations = "INTEGRATED_BUTTONS|RESIZE" 23 | -- config.integrated_title_button_style = "Gnome" 24 | else 25 | config.enable_wayland = false 26 | config.xcursor_theme = "DMZ-White" 27 | config.xcursor_size = 24 28 | end 29 | end 30 | 31 | return M 32 | -------------------------------------------------------------------------------- /modules/wrapper-manager/wezterm/viper/windows.lua: -------------------------------------------------------------------------------- 1 | local wezterm = require("wezterm") 2 | 3 | local M = {} 4 | 5 | M.apply_to_config = function(config) 6 | config.default_prog = { "nu" } 7 | config.font = wezterm.font_with_fallback { 8 | { family = "iosevka-normal", weight = "Medium" }, 9 | { family = "Symbols Nerd Font" }, 10 | } 11 | config.font_size = 12 12 | end 13 | 14 | return M 15 | -------------------------------------------------------------------------------- /modules/wrapper-manager/wezterm/wezterm.lua: -------------------------------------------------------------------------------- 1 | local wezterm = require("wezterm") 2 | local config = wezterm.config_builder() 3 | 4 | require("viper").apply_to_config(config) 5 | require("viper.windows").apply_to_config(config) 6 | 7 | return config 8 | -------------------------------------------------------------------------------- /modules/wrapper-manager/zellij/_sources/generated.json: -------------------------------------------------------------------------------- 1 | { 2 | "zellij-autolock": { 3 | "cargoLocks": null, 4 | "date": null, 5 | "extract": null, 6 | "name": "zellij-autolock", 7 | "passthru": null, 8 | "pinned": false, 9 | "src": { 10 | "name": null, 11 | "sha256": "sha256-aclWB7/ZfgddZ2KkT9vHA6gqPEkJ27vkOVLwIEh7jqQ=", 12 | "type": "url", 13 | "url": "https://github.com/fresh2dev/zellij-autolock/releases/download/0.2.2/zellij-autolock.wasm" 14 | }, 15 | "version": "0.2.2" 16 | }, 17 | "zjstatus": { 18 | "cargoLocks": null, 19 | "date": null, 20 | "extract": null, 21 | "name": "zjstatus", 22 | "passthru": null, 23 | "pinned": false, 24 | "src": { 25 | "name": null, 26 | "sha256": "sha256-OSg7Q1AWKW32Y9sHWJbWOXWF1YI5mt0N4Vsa2fcvuNg=", 27 | "type": "url", 28 | "url": "https://github.com/dj95/zjstatus/releases/download/v0.20.2/zjstatus.wasm" 29 | }, 30 | "version": "v0.20.2" 31 | } 32 | } -------------------------------------------------------------------------------- /modules/wrapper-manager/zellij/_sources/generated.nix: -------------------------------------------------------------------------------- 1 | # This file was generated by nvfetcher, please do not modify it manually. 2 | { fetchgit, fetchurl, fetchFromGitHub, dockerTools }: 3 | { 4 | zellij-autolock = { 5 | pname = "zellij-autolock"; 6 | version = "0.2.2"; 7 | src = fetchurl { 8 | url = "https://github.com/fresh2dev/zellij-autolock/releases/download/0.2.2/zellij-autolock.wasm"; 9 | sha256 = "sha256-aclWB7/ZfgddZ2KkT9vHA6gqPEkJ27vkOVLwIEh7jqQ="; 10 | }; 11 | }; 12 | zjstatus = { 13 | pname = "zjstatus"; 14 | version = "v0.20.2"; 15 | src = fetchurl { 16 | url = "https://github.com/dj95/zjstatus/releases/download/v0.20.2/zjstatus.wasm"; 17 | sha256 = "sha256-OSg7Q1AWKW32Y9sHWJbWOXWF1YI5mt0N4Vsa2fcvuNg="; 18 | }; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /modules/wrapper-manager/zellij/config.kdl: -------------------------------------------------------------------------------- 1 | // Defaults 2 | // https://github.com/zellij-org/zellij/blob/main/zellij-utils/assets/config/default.kdl 3 | 4 | session_serialization false 5 | default_layout "compact" 6 | // copy_on_select true 7 | // copy_command: "wl-copy" 8 | copy_command: "osc copy" 9 | mouse_mode true 10 | show_startup_tips false 11 | 12 | ui { 13 | pane_frames { 14 | rounded_corners true 15 | } 16 | } 17 | 18 | theme "ansi" 19 | 20 | plugins { 21 | autolock location="nix:zellij-autolock" { 22 | is_enabled true 23 | triggers "nvim|vim|fzf|git" 24 | // watch_triggers "fzf|zoxide|atuin|atac" 25 | // watch_interval "1.0" 26 | // reaction_seconds "0.8" 27 | } 28 | 29 | zjstatus location="nix:zjstatus" 30 | } 31 | 32 | load_plugins { 33 | autolock 34 | } 35 | 36 | keybinds clear-defaults=true { 37 | normal { 38 | // bind "Ctrl p" { SwitchToMode "pane"; } 39 | } 40 | shared { 41 | bind "Ctrl t" { NewTab; SwitchToMode "Normal"; } 42 | bind "Ctrl Tab" { GoToNextTab; } 43 | bind "Ctrl Shift Tab" { GoToPreviousTab; } 44 | bind "Alt Enter" { NewPane "Right"; SwitchToMode "Normal"; } 45 | bind "Alt Shift Enter" { NewPane "Down"; SwitchToMode "Normal"; } 46 | } 47 | shared_except "locked" { 48 | bind "Ctrl Shift C" { Copy; } 49 | // bind "Alt C" { Copy; } 50 | 51 | bind "Alt Left" { MoveFocus "Left"; } 52 | bind "Alt Right" { MoveFocus "Right"; } 53 | bind "Alt Down" { MoveFocus "Down"; } 54 | bind "Alt Up" { MoveFocus "Up"; } 55 | bind "Alt Shift Left" { Resize "Increase Left"; } 56 | bind "Alt Shift Right" { Resize "Increase Right"; } 57 | bind "Alt Shift Up" { Resize "Increase Up"; } 58 | bind "Alt Shift Down" { Resize "Increase Down"; } 59 | } 60 | } 61 | 62 | -------------------------------------------------------------------------------- /modules/wrapper-manager/zellij/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | ... 5 | }: 6 | let 7 | plugins = pkgs.callPackages ./_sources/generated.nix { }; 8 | 9 | configDir = pkgs.runCommandLocal "zellij-config-dir" { } '' 10 | mkdir -p $out/etc 11 | cp -rL --no-preserve=mode ${./.} $out/etc/zellij 12 | shopt -s globstar 13 | substituteInPlace $out/**/*.kdl --replace-warn FOO BAR \ 14 | ${ 15 | plugins 16 | |> builtins.attrValues 17 | |> (map ({ pname, src, ... }: "--replace-warn 'nix:${pname}' 'file:${src}'")) 18 | |> lib.concatStringsSep " " 19 | } 20 | find $out/etc/zellij -type f ! -name '*.kdl' -delete 21 | ''; 22 | 23 | in 24 | { 25 | wrappers.zellij = { 26 | basePackage = pkgs.zellij; 27 | # env.ZELLIJ_CONFIG_DIR.value = ./.; 28 | # env.ZELLIJ_CONFIG_DIR.value = "${configDir}/etc/zellij"; 29 | flags = [ 30 | "--config" 31 | "${configDir}/etc/zellij/config.kdl" 32 | # FIXME doesn't pick it by default 33 | "--layout" 34 | "${configDir}/etc/zellij/layouts/default.kdl" 35 | ]; 36 | extraPackages = [ configDir ]; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /modules/wrapper-manager/zellij/layouts/default.kdl: -------------------------------------------------------------------------------- 1 | 2 | layout { 3 | pane size=1 borderless=true { 4 | plugin location="zjstatus" { 5 | format_left "#[fg=white] {session} {mode} {tabs}" 6 | format_right "#[bg=#8A8A8A,fg=#000000,bold]{swap_layout}" 7 | 8 | mode_locked "#[fg=magenta,bold] {name} " 9 | mode_normal "#[fg=green,bold] {name} " 10 | mode_resize "#[fg=yellow,bold] {name} " 11 | // mode_default_to_mode "resize" 12 | 13 | tab_normal "#[fg=white,bold] {name} {sync_indicator}{fullscreen_indicator}{floating_indicator}" 14 | tab_active "#[bg=green,fg=black,bold] {name} {sync_indicator}{fullscreen_indicator}{floating_indicator}" 15 | 16 | tab_sync_indicator " " 17 | tab_fullscreen_indicator "□ " 18 | tab_floating_indicator "󰉈 " 19 | } 20 | } 21 | 22 | pane split_direction="vertical" { 23 | pane 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /modules/wrapper-manager/zellij/nvfetcher.toml: -------------------------------------------------------------------------------- 1 | [zjstatus] 2 | src.github = "dj95/zjstatus" 3 | fetch.url = "https://github.com/dj95/zjstatus/releases/download/$ver/zjstatus.wasm" 4 | 5 | [zellij-autolock] 6 | fetch.url = "https://github.com/fresh2dev/zellij-autolock/releases/download/$ver/zellij-autolock.wasm" 7 | src.github = "fresh2dev/zellij-autolock" 8 | -------------------------------------------------------------------------------- /npins/default.nix: -------------------------------------------------------------------------------- 1 | /* 2 | This file is provided under the MIT licence: 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | */ 10 | # Generated by npins. Do not modify; will be overwritten regularly 11 | let 12 | data = builtins.fromJSON (builtins.readFile ./sources.json); 13 | version = data.version; 14 | 15 | # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 16 | range = 17 | first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1); 18 | 19 | # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 20 | stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); 21 | 22 | # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 23 | stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); 24 | concatMapStrings = f: list: concatStrings (map f list); 25 | concatStrings = builtins.concatStringsSep ""; 26 | 27 | # If the environment variable NPINS_OVERRIDE_${name} is set, then use 28 | # the path directly as opposed to the fetched source. 29 | # (Taken from Niv for compatibility) 30 | mayOverride = 31 | name: path: 32 | let 33 | envVarName = "NPINS_OVERRIDE_${saneName}"; 34 | saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null then "_" else c) name; 35 | ersatz = builtins.getEnv envVarName; 36 | in 37 | if ersatz == "" then 38 | path 39 | else 40 | # this turns the string into an actual Nix path (for both absolute and 41 | # relative paths) 42 | builtins.trace "Overriding path of \"${name}\" with \"${ersatz}\" due to set \"${envVarName}\"" ( 43 | if builtins.substring 0 1 ersatz == "/" then 44 | /. + ersatz 45 | else 46 | /. + builtins.getEnv "PWD" + "/${ersatz}" 47 | ); 48 | 49 | mkSource = 50 | name: spec: 51 | assert spec ? type; 52 | let 53 | path = 54 | if spec.type == "Git" then 55 | mkGitSource spec 56 | else if spec.type == "GitRelease" then 57 | mkGitSource spec 58 | else if spec.type == "PyPi" then 59 | mkPyPiSource spec 60 | else if spec.type == "Channel" then 61 | mkChannelSource spec 62 | else if spec.type == "Tarball" then 63 | mkTarballSource spec 64 | else 65 | builtins.throw "Unknown source type ${spec.type}"; 66 | in 67 | spec // { outPath = mayOverride name path; }; 68 | 69 | mkGitSource = 70 | { 71 | repository, 72 | revision, 73 | url ? null, 74 | submodules, 75 | hash, 76 | branch ? null, 77 | ... 78 | }: 79 | assert repository ? type; 80 | # At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository 81 | # In the latter case, there we will always be an url to the tarball 82 | if url != null && !submodules then 83 | builtins.fetchTarball { 84 | inherit url; 85 | sha256 = hash; # FIXME: check nix version & use SRI hashes 86 | } 87 | else 88 | let 89 | url = 90 | if repository.type == "Git" then 91 | repository.url 92 | else if repository.type == "GitHub" then 93 | "https://github.com/${repository.owner}/${repository.repo}.git" 94 | else if repository.type == "GitLab" then 95 | "${repository.server}/${repository.repo_path}.git" 96 | else 97 | throw "Unrecognized repository type ${repository.type}"; 98 | urlToName = 99 | url: rev: 100 | let 101 | matched = builtins.match "^.*/([^/]*)(\\.git)?$" url; 102 | 103 | short = builtins.substring 0 7 rev; 104 | 105 | appendShort = if (builtins.match "[a-f0-9]*" rev) != null then "-${short}" else ""; 106 | in 107 | "${if matched == null then "source" else builtins.head matched}${appendShort}"; 108 | name = urlToName url revision; 109 | in 110 | builtins.fetchGit { 111 | rev = revision; 112 | inherit name; 113 | # hash = hash; 114 | inherit url submodules; 115 | }; 116 | 117 | mkPyPiSource = 118 | { url, hash, ... }: 119 | builtins.fetchurl { 120 | inherit url; 121 | sha256 = hash; 122 | }; 123 | 124 | mkChannelSource = 125 | { url, hash, ... }: 126 | builtins.fetchTarball { 127 | inherit url; 128 | sha256 = hash; 129 | }; 130 | 131 | mkTarballSource = 132 | { 133 | url, 134 | locked_url ? url, 135 | hash, 136 | ... 137 | }: 138 | builtins.fetchTarball { 139 | url = locked_url; 140 | sha256 = hash; 141 | }; 142 | in 143 | if version == 5 then 144 | builtins.mapAttrs mkSource data.pins 145 | else 146 | throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`" 147 | -------------------------------------------------------------------------------- /npins/sources.json: -------------------------------------------------------------------------------- 1 | { 2 | "pins": { 3 | "guix-search": { 4 | "type": "Git", 5 | "repository": { 6 | "type": "GitHub", 7 | "owner": "viperML", 8 | "repo": "guix-search" 9 | }, 10 | "branch": "master", 11 | "submodules": false, 12 | "revision": "ba2bd8bfb46eed4359cc592098a0ea5e666d727e", 13 | "url": "https://github.com/viperML/guix-search/archive/ba2bd8bfb46eed4359cc592098a0ea5e666d727e.tar.gz", 14 | "hash": "0s24dxdv9fza8ripc39mxyylnfyr7b5s9ssr49k9nzsmdj1ynvbs" 15 | }, 16 | "hover-rs": { 17 | "type": "Git", 18 | "repository": { 19 | "type": "GitHub", 20 | "owner": "viperML", 21 | "repo": "hover-rs" 22 | }, 23 | "branch": "master", 24 | "submodules": false, 25 | "revision": "7a699b1e8a52c416e6d113a000b500752a6c3371", 26 | "url": "https://github.com/viperML/hover-rs/archive/7a699b1e8a52c416e6d113a000b500752a6c3371.tar.gz", 27 | "hash": "1jc1vl3c3misi6lq0j08vp991w0yly4szjgznsnjqvnpgpni973n" 28 | }, 29 | "lanzaboote": { 30 | "type": "GitRelease", 31 | "repository": { 32 | "type": "GitHub", 33 | "owner": "nix-community", 34 | "repo": "lanzaboote" 35 | }, 36 | "pre_releases": false, 37 | "version_upper_bound": null, 38 | "release_prefix": null, 39 | "submodules": false, 40 | "version": "v0.4.2", 41 | "revision": "f0212638a2ec787a7841882f4477d40ae24f0a5d", 42 | "url": "https://api.github.com/repos/nix-community/lanzaboote/tarball/v0.4.2", 43 | "hash": "0xc1wawnb0297h5khxblmf9pd1fry950xkcm7mwlck19s2906h80" 44 | }, 45 | "mnw": { 46 | "type": "Git", 47 | "repository": { 48 | "type": "GitHub", 49 | "owner": "Gerg-L", 50 | "repo": "mnw" 51 | }, 52 | "branch": "master", 53 | "submodules": false, 54 | "revision": "cb45be22ed184aac47015c5686b10c4841292b84", 55 | "url": "https://github.com/Gerg-L/mnw/archive/cb45be22ed184aac47015c5686b10c4841292b84.tar.gz", 56 | "hash": "0zmy1j5xlp5jswgpkl5fwdyxwmhkbigrp4wi2bpfl9vv2r6f1pan" 57 | }, 58 | "nh": { 59 | "type": "Git", 60 | "repository": { 61 | "type": "GitHub", 62 | "owner": "nix-community", 63 | "repo": "nh" 64 | }, 65 | "branch": "master", 66 | "submodules": false, 67 | "revision": "f761c6f35dd392bbfea1fc7861a25e0494b96b32", 68 | "url": "https://github.com/nix-community/nh/archive/f761c6f35dd392bbfea1fc7861a25e0494b96b32.tar.gz", 69 | "hash": "1qv8wwa51f69qgp8jhvmrkxjcj0jpg2lfi6j27z01y4s47yfvcyv" 70 | }, 71 | "nix-common": { 72 | "type": "Git", 73 | "repository": { 74 | "type": "GitHub", 75 | "owner": "viperML", 76 | "repo": "nix-common" 77 | }, 78 | "branch": "master", 79 | "submodules": false, 80 | "revision": "cfc4a69045bd8d858319875c572d52ce2a53a533", 81 | "url": "https://github.com/viperML/nix-common/archive/cfc4a69045bd8d858319875c572d52ce2a53a533.tar.gz", 82 | "hash": "1hkj2f4iq8qf157qklzp59qny2j4yh8i9f5cmgrsn3ny9wyxf62y" 83 | }, 84 | "nix-index-database": { 85 | "type": "Git", 86 | "repository": { 87 | "type": "GitHub", 88 | "owner": "nix-community", 89 | "repo": "nix-index-database" 90 | }, 91 | "branch": "main", 92 | "submodules": false, 93 | "revision": "e9b21b01e4307176b9718a29ac514838e7f6f4ff", 94 | "url": "https://github.com/nix-community/nix-index-database/archive/e9b21b01e4307176b9718a29ac514838e7f6f4ff.tar.gz", 95 | "hash": "085414ygbi9pnv8qmx7mpjklcdiwx5881vqnjaih831cbpwa4zny" 96 | }, 97 | "nix-maid": { 98 | "type": "Git", 99 | "repository": { 100 | "type": "GitHub", 101 | "owner": "viperML", 102 | "repo": "nix-maid" 103 | }, 104 | "branch": "master", 105 | "submodules": false, 106 | "revision": "569c749c0b6c1f1b12f1485e982db567796a2c2c", 107 | "url": "https://github.com/viperML/nix-maid/archive/569c749c0b6c1f1b12f1485e982db567796a2c2c.tar.gz", 108 | "hash": "09zpyacvk5v06dishi8y61f2sd1f38mgkqy7kksp4py8612k1y6l" 109 | }, 110 | "nixpkgs": { 111 | "type": "Git", 112 | "repository": { 113 | "type": "GitHub", 114 | "owner": "NixOS", 115 | "repo": "nixpkgs" 116 | }, 117 | "branch": "nixos-unstable", 118 | "submodules": false, 119 | "revision": "292fa7d4f6519c074f0a50394dbbe69859bb6043", 120 | "url": "https://github.com/NixOS/nixpkgs/archive/292fa7d4f6519c074f0a50394dbbe69859bb6043.tar.gz", 121 | "hash": "171wlwhw8sqkc6p1nzhs6rl1c4zhvlv2w4xrdp7h7sj9v6g9k8qr" 122 | }, 123 | "wrapper-manager": { 124 | "type": "Git", 125 | "repository": { 126 | "type": "GitHub", 127 | "owner": "viperML", 128 | "repo": "wrapper-manager" 129 | }, 130 | "branch": "master", 131 | "submodules": false, 132 | "revision": "f2b0bec5140403cf24cae96f6764d97b5d59b0e2", 133 | "url": "https://github.com/viperML/wrapper-manager/archive/f2b0bec5140403cf24cae96f6764d97b5d59b0e2.tar.gz", 134 | "hash": "003rl9myjkxz1r08lnbhjhc87b43m3pnz39108fb0ng873kpxwax" 135 | } 136 | }, 137 | "version": 5 138 | } 139 | -------------------------------------------------------------------------------- /packages/default.nix: -------------------------------------------------------------------------------- 1 | let 2 | sources = import ../npins; 3 | lib = import "${sources.nixpkgs}/lib"; 4 | in 5 | import sources.nixpkgs { 6 | config = { 7 | allowInsecurePredicate = 8 | pkg: 9 | let 10 | pname = lib.getName pkg; 11 | byName = builtins.elem pname [ 12 | "nix" 13 | ]; 14 | in 15 | if byName then lib.warn "Allowing insecure package: ${pname}" true else false; 16 | 17 | allowUnfreePredicate = pkg: lib.warn "Allowing unfree package: ${lib.getName pkg}" true; 18 | }; 19 | 20 | overlays = [ 21 | (import ./overlay.nix lib) 22 | ]; 23 | } 24 | -------------------------------------------------------------------------------- /packages/elfutils-cli/default.nix: -------------------------------------------------------------------------------- 1 | # only some programs from elfutils 2 | { elfutils, runCommandLocal }: runCommandLocal "elfutils" {} /* bash */ '' 3 | mkdir -p $out/bin 4 | 5 | for f in readelf strings; do 6 | ln -vsfT ${elfutils}/bin/eu-$f $out/bin/$f 7 | done 8 | '' 9 | -------------------------------------------------------------------------------- /packages/emacs/custom.el: -------------------------------------------------------------------------------- 1 | (custom-set-variables) 2 | -------------------------------------------------------------------------------- /packages/emacs/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | symlinkJoin, 3 | emacsWithPackagesFromUsePackage, 4 | emacs-pgtk, 5 | runCommandLocal, 6 | makeWrapper, 7 | }: 8 | let 9 | pkg = emacsWithPackagesFromUsePackage { 10 | config = ./init.el; 11 | # package = emacs-pgtk; 12 | alwaysEnsure = true; 13 | # defaultInitFile = runCommandLocal "default.el" { } '' 14 | # cp ${./init.el} $out 15 | # ''; 16 | defaultInitFile = true; 17 | }; 18 | in 19 | symlinkJoin { 20 | inherit (pkg) 21 | name 22 | meta 23 | passthru 24 | ; 25 | 26 | paths = [ pkg ]; 27 | nativeBuildInputs = [ makeWrapper ]; 28 | postBuild = '' 29 | for file in $out/bin/emacs $out/bin/emacs-*; do 30 | wrapProgram $file \ 31 | --add-flags -nw 32 | done 33 | 34 | rm $out/share/applications 35 | mkdir -p $out/share/applications 36 | cp ${pkg}/share/applications/emacs.desktop $out/share/applications 37 | sed -i -E "s#Exec=emacs([[:space:]]*)#Exec=${pkg}/bin/emacs\1#g" $out/share/applications/emacs.desktop 38 | ''; 39 | } 40 | -------------------------------------------------------------------------------- /packages/emacs/init.el: -------------------------------------------------------------------------------- 1 | ;;; My Emacs configuration 2 | ;;; Commentary: 3 | ;;; - 4 | ;;; Code: 5 | 6 | (set-fontset-font t 'unicode (font-spec :family "all-the-icons") nil 'append) 7 | (set-fontset-font t 'unicode (font-spec :family "file-icons") nil 'append) 8 | (set-fontset-font t 'unicode (font-spec :family "Material Icons") nil 'append) 9 | (set-fontset-font t 'unicode (font-spec :family "github-octicons") nil 'append) 10 | (set-fontset-font t 'unicode (font-spec :family "FontAwesome") nil 'append) 11 | (set-fontset-font t 'unicode (font-spec :family "Weather Icons") nil 'append) 12 | 13 | ;; (setq package-user-dir "~/.config/emacs/elpa") 14 | 15 | ;; (eval-and-compile 16 | ;; (require 'package) 17 | ;; (setq package-archives '( 18 | ;; ;; ("elpa" . "https://elpa.gnu.org/packages/") 19 | ;; ;; ("marmalade" . "https://marmalade-repo.org/packages/") 20 | ;; ;; ("melpa" . "https://melpa.org/packages/") 21 | ;; )) 22 | ;; (package-initialize) 23 | ;; ;; i always fetch the archive contents on startup and during compilation, which is slow 24 | ;; (package-refresh-contents) 25 | ;; (unless (package-installed-p 'use-package) 26 | ;; (package-install 'use-package)) 27 | ;; (require 'use-package) 28 | ;; ;; i don't really know why this isn't the default... 29 | ;; (setf use-package-always-ensure t)) 30 | 31 | (eval-when-compile 32 | (require 'use-package)) 33 | 34 | (use-package no-littering) 35 | 36 | (setq 37 | make-backup-files nil 38 | inhibit-startup-screen t 39 | create-lockfiles nil 40 | ring-bell-function 'ignore 41 | confirm-kill-processes nil 42 | confirm-kill-emacs nil 43 | ;; Sane defaults 44 | ;; increase garbage collection during startup 45 | gc-cons-threshold 100000000 46 | read-process-output-max (* 1024 1024) ;; 1mb 47 | initial-scratch-message "" ; Make *scratch* buffer blank 48 | 49 | scroll-conservatively 101) 50 | 51 | (defalias 'yes-or-no-p 'y-or-n-p) 52 | 53 | 54 | 55 | (add-hook 'after-init-hook #'(lambda () 56 | ;; restore after startup 57 | (setq gc-cons-threshold 800000))) 58 | 59 | (fset 'yes-or-no-p 'y-or-n-p) ; y-or-n-p makes answering questions faster 60 | (global-auto-revert-mode t) ; Auto-update buffer if file has changed on disk 61 | 62 | (if (fboundp 'tool-bar-mode) 63 | (tool-bar-mode -1)) 64 | (if (fboundp 'menu-bar-mode) (menu-bar-mode -1)) 65 | (if (fboundp 'scroll-bar-mode) 66 | (scroll-bar-mode -1)) 67 | 68 | 69 | ;; (use-package smooth-scrolling 70 | ;; :config 71 | ;; (smooth-scrolling-mode 1) 72 | ;; (setq smooth-scroll-margin 3)) 73 | 74 | ;; use asynchronous processes wherever possible 75 | ;;(use-package async 76 | ;; :init (dired-async-mode 1)) 77 | 78 | (setq locale-coding-system 'utf-8) 79 | (set-terminal-coding-system 'utf-8) 80 | (set-keyboard-coding-system 'utf-8) 81 | (set-selection-coding-system 'utf-8) 82 | (prefer-coding-system 'utf-8) 83 | 84 | ;; set default tab display width to 4 spaces 85 | (setq-default tab-width 4) 86 | (setq tab-width 4) 87 | 88 | ;; set indent commands to always use space only 89 | (progn (setq-default indent-tabs-mode nil)) 90 | 91 | 92 | (set-face-attribute 'default nil :font "iosevka-normal-13" :weight 'medium) 93 | 94 | 95 | (recentf-mode 1) 96 | (unless (display-graphic-p) 97 | (xterm-mouse-mode 1)) 98 | 99 | ;; (defun synchronize-theme () 100 | ;; (let* ((light-theme 'doom-one-light) 101 | ;; (dark-theme 'doom-one) 102 | ;; (start-time-light-theme 6) 103 | ;; (end-time-light-theme 18) 104 | ;; (hour (string-to-number (substring (current-time-string) 11 13))) 105 | ;; (next-theme (if (member hour (number-sequence start-time-light-theme end-time-light-theme)) 106 | ;; light-theme dark-theme))) 107 | ;; (load-theme next-theme))) 108 | 109 | (setq select-enable-clipboard nil) 110 | 111 | ; (run-with-timer 0 900 'synchronize-theme) 112 | 113 | ;; Padding 114 | (setq header-line-format " ") 115 | ; (lambda () (progn 116 | ; (setq left-margin-width 10) 117 | ; (setq right-margin-width 10) 118 | ; 119 | 120 | (add-hook 'prog-mode-hook (lambda () (electric-pair-mode))) 121 | 122 | 123 | ;; Pkgs 124 | (use-package evil 125 | :init 126 | (setq evil-want-integration t) ;; This is optional since it's already set to t by default. 127 | (setq evil-want-keybinding nil) 128 | :config 129 | (evil-mode 1)) 130 | 131 | (use-package evil-collection 132 | :after evil 133 | :config 134 | (evil-collection-init)) 135 | 136 | (use-package evil-terminal-cursor-changer 137 | :after evil 138 | :config 139 | (unless (display-graphic-p) 140 | (evil-terminal-cursor-changer-activate))) 141 | 142 | (use-package direnv 143 | :config (direnv-mode)) 144 | 145 | (use-package mixed-pitch 146 | :hook (text-mode . mixed-pitch-mode)) 147 | 148 | (use-package which-key 149 | :diminish which-key-mode 150 | :init 151 | (which-key-mode) 152 | (setq which-key-idle-delay 0.2)) 153 | 154 | (use-package markdown-mode 155 | :mode ("\\.md\\'" . gfm-mode) 156 | :init (setq markdown-command "multimarkdown")) 157 | 158 | (use-package ivy) 159 | (use-package projectile) 160 | ;; (setq projectile-cache-file "~/.config/emacs/projectile.cache") 161 | ;; (setq projectile-known-projects-file "~/.config/emacs/projectile.eld") 162 | (setq projectile-project-search-path '("~/Documents/" "~/Projects/")) 163 | (use-package counsel 164 | :init (counsel-mode 1)) 165 | (use-package counsel-projectile 166 | :init (counsel-projectile-mode 1)) 167 | 168 | (use-package doom-themes 169 | :init 170 | (setq doom-themes-enable-bold t ; if nil, bold is universally disabled 171 | doom-themes-enable-italic t) ; if nil, italics is universally disabled 172 | (load-theme 'doom-tomorrow-night t) 173 | (doom-themes-org-config)) 174 | 175 | (use-package solaire-mode 176 | :after (doom-themes) 177 | :init (solaire-global-mode 1)) 178 | 179 | (use-package dashboard 180 | :init 181 | (dashboard-setup-startup-hook) 182 | (setq dashboard-startup-banner 'logo) 183 | (setq dashboard-set-heading-icons t) 184 | (setq dashboard-set-file-icons t) 185 | (setq dashboard-items '((recents . 10) 186 | (projects . 5) 187 | (bookmarks . 5))) 188 | 189 | (setq dashboard-set-footer nil) 190 | (setq dashboard-center-content t) 191 | (setq dashboard-projects-switch-function 'counsel-projectile-switch-project-by-name)) 192 | 193 | (use-package all-the-icons) 194 | 195 | (use-package general 196 | :config 197 | (general-define-key 198 | :keymaps 'global 199 | "C-S-v" 'clipboard-yank 200 | "C-S-c" 'clipboard-kill-ring-save) 201 | (general-define-key 202 | :states '(normal visual insert emacs) 203 | :prefix "SPC" 204 | :non-normal-prefix "C-SPC" 205 | "SPC" '(counsel-file-jump :which-key "Jump to file") 206 | "p" '(:keymap projectile-command-map :package counsel-projectile :which-key "Projectile") 207 | "b" '(treemacs :package treemacs))) 208 | 209 | 210 | 211 | (use-package doom-modeline 212 | :init 213 | (doom-modeline-mode 1)) 214 | 215 | (use-package treemacs 216 | :defer t) 217 | 218 | (use-package treemacs-nerd-icons 219 | :after treemacs 220 | :config 221 | (treemacs-load-theme "nerd-icons")) 222 | 223 | (use-package treemacs-projectile 224 | :after (treemacs projectile)) 225 | 226 | (use-package treemacs-evil 227 | :after (treemacs evil)) 228 | 229 | (use-package centaur-tabs 230 | :demand 231 | :config 232 | (setq centaur-tabs-style "chamfer") 233 | (setq centaur-tabs-set-icons t) 234 | (setq centaur-tabs-height 30) 235 | (centaur-tabs-mode t)) 236 | 237 | ;; (use-package smartparens-config 238 | ;; :ensure smartparens 239 | ;; :config 240 | ;; (progn 241 | ;; (show-smartparens-global-mode t) 242 | ;; (add-hook 'prog-mode-hook 'turn-on-smartparens-strict-mode) 243 | ;; (add-hook 'markdown-mode-hook 'turn-on-smartparens-strict-mode))) 244 | 245 | (use-package paredit 246 | :init 247 | (add-hook 'clojure-mode-hook #'enable-paredit-mode) 248 | (add-hook 'cider-repl-mode-hook #'enable-paredit-mode) 249 | (add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) 250 | (add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode) 251 | (add-hook 'ielm-mode-hook #'enable-paredit-mode) 252 | (add-hook 'lisp-mode-hook #'enable-paredit-mode) 253 | (add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode) 254 | (add-hook 'scheme-mode-hook #'enable-paredit-mode) 255 | :config 256 | (show-paren-mode t) 257 | ;; :bind (("M-[" . paredit-wrap-square) 258 | ;; ("M-{" . paredit-wrap-curly)) 259 | :diminish nil) 260 | 261 | (use-package evil-cleverparens 262 | :config 263 | (add-hook 'paredit-mode-hook #'evil-cleverparens-mode)) 264 | 265 | 266 | ;; LSP 267 | (use-package lsp-mode 268 | :hook 269 | (lsp-mode . lsp-enable-which-key-integration) 270 | :commands (lsp lsp-deferred)) 271 | (use-package lsp-ui 272 | :commands lsp-ui-mode) 273 | (use-package lsp-ivy 274 | :commands lsp-ivy-workspace-symbol) 275 | (use-package lsp-treemacs 276 | :commands lsp-treemacs-errors-list) 277 | (use-package flycheck 278 | :init (global-flycheck-mode)) 279 | (use-package company 280 | :init (global-company-mode)) 281 | 282 | ;; Nix 283 | (use-package nix-mode 284 | :mode "\\.nix\\'") 285 | 286 | ;; Last to override keybinds 287 | (use-package ergoemacs-mode 288 | :config 289 | (setq ergoemacs-theme nil) 290 | (setq ergoemacs-keyboard-layout "us") 291 | (ergoemacs-mode 1)) 292 | 293 | 294 | ;;; init.el ends here 295 | (custom-set-variables 296 | ;; custom-set-variables was added by Custom. 297 | ;; If you edit it by hand, you could mess it up, so be careful. 298 | ;; Your init file should contain only one such instance. 299 | ;; If there is more than one, they won't work right. 300 | '(package-selected-packages nil)) 301 | (custom-set-faces) 302 | ;; custom-set-faces was added by Custom. 303 | ;; If you edit it by hand, you could mess it up, so be careful. 304 | ;; Your init file should contain only one such instance. 305 | ;; If there is more than one, they won't work right. 306 | 307 | 308 | (use-package geiser-guile) 309 | (setq geiser-active-implementations '(guile)) 310 | (use-package geiser) 311 | (use-package guix 312 | :config 313 | (add-hook 'scheme-mode-hook 'guix-devel-mode)) 314 | -------------------------------------------------------------------------------- /packages/env-viper/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | buildEnv, 4 | # 5 | fzf, 6 | starship, 7 | direnv, 8 | nix-index, 9 | eza, 10 | bat, 11 | fish-viper, 12 | neovim, 13 | elf-info, 14 | gh, 15 | unar, 16 | hexyl, 17 | du-dust, 18 | magic-wormhole-rs, 19 | fd, 20 | ripgrep, 21 | libarchive, 22 | dogdns, 23 | git-viper, 24 | difftastic, 25 | elfutils-cli, 26 | lurk, 27 | fq, 28 | jq, 29 | nixfmt-rfc-style, 30 | npins, 31 | psmisc, 32 | nil, 33 | yazi, 34 | httpie, 35 | osc, 36 | }@args: 37 | buildEnv { 38 | name = "env"; 39 | paths = args |> builtins.attrValues |> builtins.filter lib.isDerivation; 40 | extraOutputsToInstall = [ 41 | "out" 42 | "man" 43 | ]; 44 | } 45 | -------------------------------------------------------------------------------- /packages/guix/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | guix, 3 | symlinkJoin, 4 | writeShellScriptBin, 5 | 6 | # passed by nixos module 7 | storeDir ? null, 8 | stateDir ? null, 9 | }: 10 | let 11 | dispatch = 12 | binName: 13 | writeShellScriptBin binName '' 14 | gusers=("/var/guix/profiles/per-user"/*) 15 | gprofiles="''${gusers[0]}" 16 | current_guix="$gprofiles/current-guix" 17 | 18 | if [[ -f "$current_guix/bin/${binName}" ]]; then 19 | exec -a "$0" "$current_guix/bin/${binName}" "$@" 20 | else 21 | echo "Falling back to Nix-installed Guix" >&2 22 | exec -a "$0" "${guix}/bin/${binName}" "$@" 23 | fi 24 | ''; 25 | in 26 | symlinkJoin { 27 | inherit (guix) 28 | name 29 | pname 30 | version 31 | meta 32 | ; 33 | paths = [ 34 | (dispatch "guix") 35 | (dispatch "guix-daemon") 36 | guix 37 | ]; 38 | } 39 | -------------------------------------------------------------------------------- /packages/hpc-env/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | dockerTools, 3 | neovim, 4 | fish, 5 | git, 6 | eza, 7 | coreutils, 8 | fakeNss, 9 | }: 10 | dockerTools.streamLayeredImage { 11 | name = "hpc-env"; 12 | contents = [ 13 | fakeNss 14 | neovim 15 | fish 16 | git 17 | coreutils 18 | eza 19 | dockerTools.usrBinEnv 20 | dockerTools.binSh 21 | ]; 22 | extraCommands = '' 23 | mkdir -m 1777 tmp 24 | ''; 25 | config = { 26 | Cmd = [ "/bin/fish" ]; 27 | WorkingDir = "/work"; 28 | Env = [ 29 | "HOME=/work" 30 | ]; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /packages/iosevka-normal/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | callPackages, 3 | lib, 4 | stdenvNoCC, 5 | unzip, 6 | }: let 7 | nv = (callPackages ./generated.nix {}).iosevka; 8 | in 9 | stdenvNoCC.mkDerivation { 10 | inherit (nv) pname src; 11 | version = lib.removePrefix "v" nv.version; 12 | 13 | nativeBuildInputs = [unzip]; 14 | 15 | unpackPhase = '' 16 | runHook preUnpack 17 | 18 | unzip $src -d $PWD 19 | 20 | runHook postUnpack 21 | ''; 22 | 23 | installPhase = '' 24 | runHook preInstall 25 | 26 | dest=$out/share/fonts/truetype 27 | mkdir -p $dest 28 | cp -avL TTF/*.ttf $dest 29 | 30 | runHook postInstall 31 | ''; 32 | } 33 | -------------------------------------------------------------------------------- /packages/iosevka-normal/generated.json: -------------------------------------------------------------------------------- 1 | { 2 | "iosevka": { 3 | "cargoLocks": null, 4 | "date": null, 5 | "extract": null, 6 | "name": "iosevka", 7 | "passthru": null, 8 | "pinned": false, 9 | "src": { 10 | "name": null, 11 | "sha256": "sha256-ZSGdT1mO1LezVkbg8hc1lKLisKtvVftOPtmjQl8qxGE=", 12 | "type": "url", 13 | "url": "https://github.com/viperML/iosevka/releases/download/v1.5.3/iosevka.zip" 14 | }, 15 | "version": "v1.5.3" 16 | } 17 | } -------------------------------------------------------------------------------- /packages/iosevka-normal/generated.nix: -------------------------------------------------------------------------------- 1 | # This file was generated by nvfetcher, please do not modify it manually. 2 | { fetchgit, fetchurl, fetchFromGitHub, dockerTools }: 3 | { 4 | iosevka = { 5 | pname = "iosevka"; 6 | version = "v1.5.3"; 7 | src = fetchurl { 8 | url = "https://github.com/viperML/iosevka/releases/download/v1.5.3/iosevka.zip"; 9 | sha256 = "sha256-ZSGdT1mO1LezVkbg8hc1lKLisKtvVftOPtmjQl8qxGE="; 10 | }; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /packages/iosevka-normal/nvfetcher.toml: -------------------------------------------------------------------------------- 1 | [iosevka] 2 | src.github = "viperML/iosevka" 3 | fetch.url = "https://github.com/viperML/iosevka/releases/download/$ver/iosevka.zip" 4 | -------------------------------------------------------------------------------- /packages/neovim/.envrc: -------------------------------------------------------------------------------- 1 | use nix 2 | -------------------------------------------------------------------------------- /packages/neovim/.nvim.lua: -------------------------------------------------------------------------------- 1 | -- vim.notify("Hello from dotfiles!") 2 | 3 | local rt = vim.api.nvim_get_runtime_file("", true) 4 | 5 | vim.lsp.config["lua_ls"] = { 6 | cmd = { "lua-language-server" }, 7 | single_file_support = false, 8 | filetypes = { "lua" }, 9 | root_markers = { ".git", ".git/" }, 10 | settings = { 11 | Lua = { 12 | runtime = { 13 | version = "LuaJIT", 14 | }, 15 | diagnostics = { 16 | globals = { "vim" }, 17 | }, 18 | workspace = { 19 | checkThirdParty = false, 20 | library = rt, 21 | }, 22 | }, 23 | }, 24 | } 25 | 26 | vim.lsp.enable("lua_ls") 27 | -------------------------------------------------------------------------------- /packages/neovim/module.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | let 3 | fs = lib.fileset; 4 | in 5 | { 6 | appName = "nvim-viper-mnw"; 7 | desktopEntry = false; 8 | providers.python3.enable = false; 9 | providers.ruby.enable = false; 10 | 11 | extraLuaPackages = lp: [ 12 | lp.luassert 13 | lp.luaposix 14 | lp.lyaml 15 | ]; 16 | 17 | extraBinPath = with pkgs; [ 18 | vscode-langservers-extracted 19 | yaml-language-server 20 | taplo 21 | nodePackages.bash-language-server 22 | ]; 23 | 24 | wrapperArgs = [ 25 | "--set-default" 26 | "NVIM_NODE" 27 | (lib.getExe (pkgs.nodejs.override { enableNpm = false; })) 28 | ]; 29 | 30 | initLua = 31 | #lua 32 | '' 33 | vim.loader.enable(true) 34 | require("viper") 35 | vim.opt.exrc = true 36 | ''; 37 | 38 | plugins = { 39 | dev.main = { 40 | pure = 41 | 42 | ( 43 | fs.toSource { 44 | root = ./viper-init-plugin; 45 | fileset = lib.fileset.fromSource (lib.sources.cleanSource ./viper-init-plugin); 46 | } 47 | ); 48 | impure = ./viper-init-plugin; 49 | }; 50 | start = lib.mkMerge [ 51 | ( 52 | pkgs.vimPlugins.nvim-treesitter.grammarPlugins 53 | |> lib.filterAttrs (n: _: !(builtins.elem n [ "comment" ])) 54 | |> builtins.attrValues 55 | ) 56 | (with pkgs.vimPlugins; [ 57 | nvim-web-devicons 58 | snacks-nvim 59 | plenary-nvim 60 | mini-nvim 61 | kanagawa-nvim 62 | catppuccin-nvim 63 | bufferline-nvim 64 | lualine-nvim 65 | 66 | # No autostart 67 | blink-cmp-copilot 68 | lsp-progress-nvim 69 | nui-nvim 70 | SchemaStore-nvim 71 | 72 | # Fine to not lazy-load 73 | lz-n 74 | nvim-treesitter 75 | nvim-treesitter-context 76 | nvim-treesitter-textobjects 77 | nvim-ts-autotag 78 | fidget-nvim 79 | haskell-tools-nvim 80 | 81 | # ./viper-init-plugin 82 | ]) 83 | ]; 84 | opt = with pkgs.vimPlugins; [ 85 | # codecompanion-nvim 86 | avante-nvim 87 | comment-nvim 88 | conform-nvim 89 | git-conflict-nvim 90 | gitsigns-nvim 91 | indent-blankline-nvim 92 | marks-nvim 93 | neo-tree-nvim 94 | noice-nvim 95 | nvim-autopairs 96 | nvim-lspconfig 97 | blink-cmp 98 | nvim-navic 99 | parinfer-rust 100 | smart-splits-nvim 101 | # zellij-nav-nvim 102 | telescope-fzf-native-nvim 103 | telescope-nvim 104 | trouble-nvim 105 | vim-better-whitespace 106 | vim-nix 107 | which-key-nvim 108 | yazi-nvim 109 | 110 | # Check of having some autostart 111 | copilot-lua 112 | ]; 113 | }; 114 | extraBuilderArgs = { 115 | doInstallCheck = true; 116 | installCheckPhase = '' 117 | export HOME="$(mktemp -d)" 118 | export NVIM_SILENT=1 119 | "$out/bin/nvim" --headless '+lua =require("viper.health").loaded_exit()' '+q' 120 | ''; 121 | }; 122 | } 123 | -------------------------------------------------------------------------------- /packages/neovim/shell.nix: -------------------------------------------------------------------------------- 1 | let 2 | pkgs = import ../.; 3 | in 4 | with pkgs; mkShellNoCC { 5 | packages = [ 6 | lua-language-server 7 | neovim.devMode 8 | ]; 9 | } 10 | -------------------------------------------------------------------------------- /packages/neovim/viper-init-plugin/after/plugin/init.lua: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /packages/neovim/viper-init-plugin/after/queries/markdown/highlights.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperML/dotfiles/ac6a34bda5255d7288f7f8b83031cafcbf29ad0d/packages/neovim/viper-init-plugin/after/queries/markdown/highlights.scm -------------------------------------------------------------------------------- /packages/neovim/viper-init-plugin/lua/viper/ai.lua: -------------------------------------------------------------------------------- 1 | ---@param path string 2 | ---@return string 3 | local read_file = function(path) 4 | local a = require("plenary.async") 5 | local err, fd = a.uv.fs_open(path, "r", 438) 6 | assert(not err, err) 7 | 8 | local err, stat = a.uv.fs_fstat(fd) 9 | assert(not err, err) 10 | 11 | local err, data = a.uv.fs_read(fd, stat.size, 0) 12 | assert(not err, err) 13 | 14 | local err = a.uv.fs_close(fd) 15 | assert(not err, err) 16 | 17 | return data 18 | end 19 | 20 | ---@class Model 21 | ---@field name string 22 | 23 | ---@param aichat_config_raw string 24 | local load_aichat_config = function(aichat_config_raw) 25 | local lyaml = require("lyaml") 26 | local aichat_config = lyaml.load(aichat_config_raw) 27 | 28 | local aichat_client = aichat_config.clients[1] 29 | ---@type Model[] 30 | local models = aichat_client.models 31 | 32 | require("posix.stdlib").setenv("OPENAI_API_KEY", aichat_client.api_key) 33 | 34 | require("lz.n").trigger_load("copilot.lua") 35 | 36 | require("avante_lib").load() 37 | require("avante").setup { 38 | provider = "copilot", 39 | hints = { 40 | enabled = false, 41 | }, 42 | openai = { 43 | endpoint = aichat_client.api_base, 44 | model = models[1].name, 45 | disable_tools = true, -- disable tools! 46 | }, 47 | } 48 | end 49 | 50 | require("viper.lazy").add_specs { 51 | { 52 | "avante.nvim", 53 | event = "DeferredUIEnter", 54 | after = function() 55 | local a = require("plenary.async") 56 | ---@diagnostic disable-next-line: missing-parameter 57 | a.run(function() 58 | local err, ret = pcall(function() 59 | return read_file(vim.fn.expand("~/.config/aichat/config.yaml")) 60 | end) 61 | 62 | vim.schedule(function() 63 | if err then 64 | require("viper.health").aichat_config = true 65 | load_aichat_config(ret) 66 | end 67 | end) 68 | end) 69 | end, 70 | }, 71 | { 72 | "copilot.lua", 73 | lazy = false, 74 | after = function() 75 | local node = os.getenv("NVIM_NODE") 76 | if node ~= nil then 77 | ---@diagnostic disable-next-line: redundant-parameter 78 | require("copilot").setup { 79 | copilot_node_command = node, 80 | panel = { 81 | enabled = false, 82 | }, 83 | suggestion = { 84 | enabled = false, 85 | }, 86 | } 87 | -- vim.keymap.set({"n", "i"}, "", require("copilot.suggestion").next, { desc = "Copilot: next suggestion" }) 88 | -- vim.keymap.set({"n", "i"}, "", require("copilot.suggestion").prev, { desc = "Copilot: previous suggestion" }) 89 | else 90 | vim.notify("NVIM_NODE not set") 91 | end 92 | end, 93 | }, 94 | } 95 | -------------------------------------------------------------------------------- /packages/neovim/viper-init-plugin/lua/viper/base.lua: -------------------------------------------------------------------------------- 1 | ---@type snacks.Config 2 | local snacks_opts = { 3 | bigfile = { enabled = true }, 4 | -- dashboard = { enabled = true }, 5 | -- explorer = { enabled = true, replace_netrw = true }, 6 | -- indent = { enabled = true }, 7 | input = { enabled = true }, 8 | picker = { enabled = true }, 9 | -- notifier = { enabled = true }, 10 | quickfile = { enabled = true }, 11 | -- scope = { enabled = true }, 12 | -- scroll = { enabled = true }, 13 | -- statuscolumn = { enabled = true }, 14 | -- words = { enabled = true }, 15 | } 16 | 17 | require("snacks").setup(snacks_opts) 18 | 19 | require("fidget").setup {} 20 | 21 | local default_notify = vim.notify 22 | vim.notify = function(msg, level, opts) 23 | local env = require("os").getenv("NVIM_SILENT") 24 | if env ~= nil and level <= vim.log.levels.INFO then 25 | return 26 | else 27 | default_notify(msg, level, opts) 28 | end 29 | end 30 | 31 | require("viper.lazy").add_specs { 32 | -- { 33 | -- "noice.nvim", 34 | -- event = "DeferredUIEnter", 35 | -- after = function() 36 | -- require("viper.lazy").packadd("nui.nvim") 37 | -- require("noice").setup { 38 | -- routes = { 39 | -- { 40 | -- view = "notify", 41 | -- filter = { event = "msg_showmode" }, 42 | -- }, 43 | -- }, 44 | -- lsp = { 45 | -- -- override markdown rendering so that **cmp** and other plugins use **Treesitter** 46 | -- override = { 47 | -- ["vim.lsp.util.convert_input_to_markdown_lines"] = true, 48 | -- ["vim.lsp.util.stylize_markdown"] = true, 49 | -- ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp 50 | -- }, 51 | -- }, 52 | -- -- you can enable a preset for easier configuration 53 | -- presets = { 54 | -- bottom_search = true, -- use a classic bottom cmdline for search 55 | -- command_palette = true, -- position the cmdline and popupmenu together 56 | -- -- long_message_to_split = true, -- long messages will be sent to a split 57 | -- -- inc_rename = false, -- enables an input dialog for inc-rename.nvim 58 | -- -- lsp_doc_border = false, -- add a border to hover docs and signature help 59 | -- }, 60 | -- } 61 | -- end, 62 | -- }, 63 | } 64 | 65 | vim.keymap.set("n", "", "", { silent = true, remap = false }) 66 | vim.g.mapleader = " " 67 | vim.g.maplocalleader = " " 68 | 69 | vim.opt.expandtab = true 70 | vim.opt.tabstop = 4 71 | vim.opt.softtabstop = 4 72 | vim.opt.shiftwidth = 0 -- use tabstop 73 | 74 | vim.opt.number = false 75 | 76 | vim.opt.scrolloff = 2 77 | vim.opt.showmode = false 78 | vim.opt.modeline = true 79 | vim.opt.signcolumn = "yes:2" 80 | 81 | -- vim.opt.mousemoveevent = true 82 | 83 | vim.o.timeout = true 84 | vim.o.timeoutlen = 500 85 | 86 | vim.o.cmdheight = 0 87 | vim.o.shortmess = "atToOCFI" 88 | local messages = { 89 | "a", 90 | "o", 91 | "O", 92 | "s", 93 | "t", 94 | "T", 95 | "W", 96 | "I", 97 | "C", 98 | "F", 99 | } 100 | local messages_res = "" 101 | for _, m in ipairs(messages) do 102 | messages_res = messages_res .. m 103 | end 104 | vim.o.shortmess = messages_res 105 | 106 | vim.o.showbreak = "↪ " 107 | 108 | vim.opt.sessionoptions:remove("folds") 109 | 110 | vim.list_extend(require("viper.lazy.specs"), { 111 | { 112 | "vim-nix", 113 | ft = { "nix" }, 114 | }, 115 | { 116 | "neovim-session-manager", 117 | -- event = "DeferredUIEnter", 118 | cmd = "SessionManager", 119 | keys = { "p" }, 120 | after = function() 121 | local session_config = require("session_manager.config") 122 | require("session_manager").setup { 123 | autoload_mode = session_config.AutoloadMode.Disabled, 124 | } 125 | 126 | vim.keymap.set("n", "p", require("session_manager").load_session, { desc = "Project: open" }) 127 | end, 128 | }, 129 | }) 130 | 131 | -- Auto save feature 132 | vim.opt.updatetime = 500 133 | vim.g.autosave = false 134 | vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI", "InsertLeave" }, { 135 | callback = function() 136 | if vim.g.autosave == true then 137 | local buf = vim.api.nvim_get_current_buf() 138 | 139 | if vim.fn.getbufvar(buf, "&modifiable") == 1 then 140 | vim.api.nvim_buf_call(buf, function() 141 | vim.cmd("silent! write") 142 | end) 143 | end 144 | end 145 | end, 146 | }) 147 | 148 | vim.api.nvim_create_user_command("ToggleAutoSave", function(args) 149 | if vim.g.autosave == true then 150 | vim.g.autosave = false 151 | vim.notify("Disabled auto save") 152 | else 153 | vim.g.autosave = true 154 | vim.notify("Enabled auto save") 155 | end 156 | end, {}) 157 | 158 | -- Ctrl movement 159 | -- vim.opt.keymodel = "startsel,stopsel" 160 | vim.keymap.set({ "n", "v" }, "", "e", { desc = "Jump to next word" }) 161 | vim.keymap.set({ "n", "v" }, "", "b", { desc = "Jump to previous word" }) 162 | vim.keymap.set("n", "", "ve", { desc = "Select to next word" }) 163 | vim.keymap.set("n", "", "vb", { desc = "Select to previous word" }) 164 | 165 | vim.keymap.set({ "n", "v", "i" }, "", "/", { desc = "Search in file" }) 166 | 167 | vim.keymap.set("i", "", "xdbi") 168 | vim.keymap.set("i", "", "ce") 169 | 170 | vim.api.nvim_create_user_command("Date", function() 171 | vim.system({ "date", "--utc", "+%Y-%m-%dT%H:%M:%SZ" }, { text = true }, function(obj) 172 | vim.schedule(function() 173 | local res = obj.stdout:gsub("^%s+", ""):gsub("%s+$", "") 174 | vim.api.nvim_put({ res }, "c", true, true) 175 | end) 176 | end) 177 | end, { desc = "Insert current date" }) 178 | 179 | -- require("mini.move").setup { 180 | -- mappings = { 181 | -- left = "", 182 | -- right = "", 183 | -- down = "", 184 | -- up = "", 185 | -- line_left = "", 186 | -- line_right = "", 187 | -- line_down = "", 188 | -- line_up = "", 189 | -- }, 190 | -- options = { 191 | -- reindent_linewise = false, 192 | -- }, 193 | -- } 194 | 195 | for _, key in ipairs { "", "" } do 196 | vim.keymap.set("v", key, '"+y', { desc = "Copy to system's clipboard" }) 197 | end 198 | 199 | -- Move through wrapped lines 200 | vim.keymap.set({ "n", "v" }, "", "g", { noremap = true, silent = true }) 201 | vim.keymap.set({ "n", "v" }, "", "g", { noremap = true, silent = true }) 202 | -------------------------------------------------------------------------------- /packages/neovim/viper-init-plugin/lua/viper/format.lua: -------------------------------------------------------------------------------- 1 | local two_tabs_default = { 2 | "astro", 3 | -- "c", 4 | -- "cpp", 5 | "css", 6 | "gitconfig", 7 | "html", 8 | "javascript", 9 | "json", 10 | "jsonc", 11 | "lua", 12 | "markdown", 13 | "mdx", 14 | "meson", 15 | "nix", 16 | "r", 17 | "scheme", 18 | "terraform", 19 | "typescript", 20 | "typst", 21 | } 22 | 23 | for _, lang in ipairs(two_tabs_default) do 24 | vim.api.nvim_create_autocmd("FileType", { 25 | pattern = lang, 26 | callback = function() 27 | vim.opt_local.tabstop = 2 28 | end, 29 | }) 30 | end 31 | 32 | local cc = { 33 | -- ["rust"] = 100, 34 | -- ["scheme"] = 100, 35 | -- ["lua"] = 100, 36 | -- ["python"] = 80, 37 | } 38 | 39 | for lang, col in pairs(cc) do 40 | vim.api.nvim_create_autocmd("FileType", { 41 | pattern = lang, 42 | callback = function() 43 | vim.opt_local.colorcolumn = "" .. col 44 | end, 45 | }) 46 | end 47 | 48 | local cc_wrap = { 49 | -- ["markdown"] = 80, 50 | -- ["mdx"] = 80, 51 | -- ["typst"] = 80, 52 | } 53 | 54 | for lang, col in pairs(cc_wrap) do 55 | vim.api.nvim_create_autocmd("FileType", { 56 | pattern = lang, 57 | callback = function() 58 | vim.opt_local.colorcolumn = "" .. col 59 | vim.opt_local.textwidth = col 60 | end, 61 | }) 62 | end 63 | 64 | vim.list_extend(require("viper.lazy.specs"), { 65 | { 66 | "indent-blankline.nvim", 67 | event = "DeferredUIEnter", 68 | after = function() 69 | require("ibl").setup() 70 | end, 71 | }, 72 | { 73 | "conform.nvim", 74 | cmd = "Format", 75 | keys = { "gq" }, 76 | after = function() 77 | require("conform").setup { 78 | formatters = { 79 | guix = { 80 | command = "guix", 81 | args = { "style", "-f", "$FILENAME" }, 82 | stdin = false, 83 | }, 84 | }, 85 | formatters_by_ft = { 86 | lua = { "stylua" }, 87 | nix = { "nixfmt" }, 88 | c = { "clang-format" }, 89 | typst = { "typstyle" }, 90 | rust = { "rustfmt" }, 91 | haskell = { "fourmolu" }, 92 | scheme = { "guix" }, 93 | }, 94 | } 95 | 96 | vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" 97 | 98 | vim.api.nvim_create_user_command("Format", function(args) 99 | local range = nil 100 | if args.count ~= -1 then 101 | local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1] 102 | range = { 103 | start = { args.line1, 0 }, 104 | ["end"] = { args.line2, end_line:len() }, 105 | } 106 | end 107 | require("conform").format { async = true, lsp_format = "fallback", range = range } 108 | end, { range = true }) 109 | end, 110 | }, 111 | -- { 112 | -- "parinfer-rust", 113 | -- ft = { "scheme", "lisp", "elisp" }, 114 | -- }, 115 | { 116 | "comment.nvim", 117 | event = "DeferredUIEnter", 118 | after = function() 119 | require("Comment").setup {} 120 | end, 121 | }, 122 | }) 123 | -------------------------------------------------------------------------------- /packages/neovim/viper-init-plugin/lua/viper/health.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.loaded = false 4 | 5 | local externals = { 6 | "date", 7 | "direnv", 8 | } 9 | 10 | M.aichat_config = false 11 | 12 | M.check = function() 13 | vim.health.start("Configuration") 14 | if M.loaded then 15 | vim.health.ok("loaded properly") 16 | else 17 | vim.health.error("didn't load properly") 18 | end 19 | 20 | vim.health.start("External programs") 21 | for _, external in ipairs(externals) do 22 | if vim.fn.executable(external) == 1 then 23 | vim.health.ok(external .. " found") 24 | else 25 | vim.health.error(external .. " not found") 26 | end 27 | end 28 | 29 | vim.health.start("AiChat") 30 | if M.aichat_config then 31 | vim.health.ok("Using ~/.config/aichat/config.yaml") 32 | else 33 | vim.health.error("Didn't find ~/.config/aichat/config.yaml") 34 | end 35 | end 36 | 37 | M.loaded_exit = function() 38 | if M.loaded then 39 | print(":: Health OK") 40 | else 41 | print(":: Health FAIL") 42 | require("os").exit(1) 43 | end 44 | end 45 | 46 | return M 47 | -------------------------------------------------------------------------------- /packages/neovim/viper-init-plugin/lua/viper/init.lua: -------------------------------------------------------------------------------- 1 | require("viper.base") 2 | require("viper.visual") 3 | require("viper.lsp") 4 | require("viper.tree-sitter") 5 | require("viper.format") 6 | require("viper.ai") 7 | 8 | vim.opt.sessionoptions:append("globals") 9 | 10 | vim.keymap.set({ "n", "i", "v" }, "", "") 11 | vim.keymap.set({ "n", "i", "v" }, "", "") 12 | vim.keymap.set({ "n", "i", "v" }, "", "") 13 | vim.keymap.set({ "n", "i", "v" }, "", "") 14 | 15 | require("viper.lazy").finish() 16 | 17 | -- vim.opt.exrc = true 18 | 19 | require("viper.health").loaded = true 20 | -------------------------------------------------------------------------------- /packages/neovim/viper-init-plugin/lua/viper/lazy/init.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | local _finished = false 3 | 4 | M.finish = function() 5 | require("lz.n").load(require("viper.lazy.specs")) 6 | _finished = true 7 | end 8 | 9 | ---@param name string 10 | M.packadd = function(name) 11 | vim.api.nvim_cmd({ 12 | cmd = "packadd", 13 | args = { name }, 14 | }, {}) 15 | end 16 | 17 | ---@param specs lz.n.Spec[] 18 | M.add_specs = function(specs) 19 | if _finished then 20 | vim.notify("Cannot add specs after finishing", vim.log.levels.ERROR) 21 | return 22 | end 23 | vim.list_extend(require("viper.lazy.specs"), specs) 24 | end 25 | 26 | return M 27 | -------------------------------------------------------------------------------- /packages/neovim/viper-init-plugin/lua/viper/lazy/specs.lua: -------------------------------------------------------------------------------- 1 | ---@type lz.n.Spec[] 2 | local M = {} 3 | 4 | return M 5 | -------------------------------------------------------------------------------- /packages/neovim/viper-init-plugin/lua/viper/lsp.lua: -------------------------------------------------------------------------------- 1 | vim.opt.ignorecase = true 2 | vim.opt.smartcase = true 3 | 4 | require("viper.lazy").add_specs { 5 | { 6 | "trouble.nvim", 7 | cmd = "Trouble", 8 | after = function() 9 | require("trouble").setup {} 10 | end, 11 | }, 12 | { 13 | "nvim-lspconfig", 14 | -- FIXME 15 | -- event = "DeferredUIEnter", 16 | -- lazy = false, 17 | after = function() 18 | local lspconfig = require("lspconfig") 19 | require("viper.lazy").packadd("blink.cmp") 20 | require("viper.lazy").packadd("nvim-navic") 21 | require("lz.n").trigger_load("copilot.lua") 22 | 23 | require("blink.cmp").setup { 24 | completion = { 25 | accept = { auto_brackets = { enabled = true } }, 26 | ghost_text = { enabled = true }, 27 | }, 28 | keymap = { 29 | preset = "super-tab", 30 | [""] = { "show", "fallback" }, 31 | [""] = { 32 | function(cmp) 33 | cmp.show { providers = { "copilot" } } 34 | end, 35 | }, 36 | }, 37 | sources = { 38 | default = { 39 | "lsp", 40 | "path", 41 | -- "snippets", 42 | -- "buffer", 43 | -- "copilot", 44 | }, 45 | providers = { 46 | copilot = { 47 | name = "copilot", 48 | module = "blink-cmp-copilot", 49 | score_offset = 100, 50 | async = true, 51 | }, 52 | }, 53 | }, 54 | } 55 | 56 | local capabilities = require("blink.cmp").get_lsp_capabilities() 57 | 58 | lspconfig.util.default_config = vim.tbl_extend("force", lspconfig.util.default_config, { 59 | on_attach = function(client, bufnr) 60 | if client.server_capabilities.documentSymbolProvider then 61 | require("nvim-navic").attach(client, bufnr) 62 | end 63 | end, 64 | capabilities = capabilities, 65 | }) 66 | 67 | lspconfig.util.on_setup = lspconfig.util.add_hook_before(lspconfig.util.on_setup, function(config) 68 | config.cmd[1] = vim.fs.basename(config.cmd[1]) -- motherfuckers, who resolved the absolute path 69 | 70 | local bin_name = config.cmd[1] 71 | 72 | local bin_exists = vim.fn.executable(bin_name) 73 | 74 | if bin_exists == 1 then 75 | config.autostart = true 76 | -- vim.notify("Enabling " .. config.name, levels.TRACE) 77 | else 78 | config.autostart = false 79 | -- vim.notify("Disabling " .. config.name, levels.TRACE) 80 | end 81 | end) 82 | 83 | for k, v in pairs(require("viper.lsp_config")) do 84 | lspconfig[k].setup(v) 85 | end 86 | 87 | vim.keymap.set("n", ".", vim.lsp.buf.hover, { desc = "LSP hover" }) 88 | vim.keymap.set({ "n", "i" }, "", vim.lsp.buf.code_action, { desc = "LSP action" }) 89 | vim.keymap.set({ "n", "i" }, "", function() 90 | vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) 91 | end, { desc = "LSP toggle inlay hints" }) 92 | -- vim.keymap.set("n", ",", vim.diagnostic.open_float, { desc = "LSP diagnostics" }) 93 | vim.keymap.set({ "n", "i" }, "", vim.lsp.buf.rename, { desc = "Rename symbol" }) 94 | end, 95 | }, 96 | { 97 | "nvim-autopairs", 98 | event = "InsertEnter", 99 | after = function() 100 | require("nvim-autopairs").setup { 101 | disable_filetype = { "scheme", "elisp" }, 102 | } 103 | end, 104 | }, 105 | } 106 | 107 | vim.diagnostic.config { 108 | virtual_text = { 109 | prefix = " ", 110 | ---@param diagnostic vim.Diagnostic 111 | ---@return string? 112 | format = function(diagnostic) 113 | if diagnostic.severity >= vim.diagnostic.severity.INFO then 114 | return nil 115 | else 116 | local it = vim.gsplit(diagnostic.message, "\n") 117 | return it() 118 | end 119 | end, 120 | }, 121 | jump = { 122 | float = true, 123 | }, 124 | float = { border = "single" }, 125 | signs = { 126 | text = { 127 | [vim.diagnostic.severity.ERROR] = " ", 128 | [vim.diagnostic.severity.WARN] = " ", 129 | [vim.diagnostic.severity.HINT] = "󰌶 ", 130 | [vim.diagnostic.severity.INFO] = " ", 131 | }, 132 | numhl = { 133 | [vim.diagnostic.severity.ERROR] = "DiagnosticSignError", 134 | [vim.diagnostic.severity.WARN] = "DiagnosticSignWarn", 135 | [vim.diagnostic.severity.HINT] = "DiagnosticSignHint", 136 | [vim.diagnostic.severity.INFO] = "DiagnosticSignInfo", 137 | }, 138 | linehl = { 139 | [vim.diagnostic.severity.ERROR] = "DiagnosticErrorLn", 140 | [vim.diagnostic.severity.WARN] = "DiagnosticWarnLn", 141 | [vim.diagnostic.severity.INFO] = "DiagnosticInfoLn", 142 | [vim.diagnostic.severity.HINT] = "DiagnosticHintLn", 143 | }, 144 | }, 145 | } 146 | 147 | for _, severity in pairs { "Error", "Warn", "Info", "Hint" } do 148 | local blend = require("snacks.util").blend 149 | local rgbToHex = require("viper.util").rgbToHex 150 | 151 | local base = vim.api.nvim_get_hl(0, { name = string.format("DiagnosticSign%s", severity) }).fg 152 | local color 153 | if base ~= nil then 154 | color = rgbToHex(base) 155 | else 156 | color = "#FFFFFF" -- FIXME 157 | end 158 | vim.api.nvim_set_hl(0, string.format("Diagnostic%sLn", severity), { 159 | bg = blend("#121212", color, 0.95), 160 | }) 161 | end 162 | -------------------------------------------------------------------------------- /packages/neovim/viper-init-plugin/lua/viper/lsp_config.lua: -------------------------------------------------------------------------------- 1 | local lspconfig = require("lspconfig") 2 | local root_pattern = lspconfig.util.root_pattern 3 | 4 | vim.filetype.add { 5 | extension = { 6 | ["nomad"] = "hcl" 7 | }, 8 | filename = { 9 | [".envrc"] = "bash", 10 | ["gitconfig"] = "gitconfig", 11 | [".guix-channel"] = "scheme", 12 | }, 13 | } 14 | 15 | return { 16 | ["rnix"] = { 17 | cmd = { "nil" }, 18 | settings = { 19 | ["nil"] = { 20 | nix = { 21 | flake = { 22 | autoArchive = false, 23 | }, 24 | }, 25 | }, 26 | }, 27 | }, 28 | ["rust_analyzer"] = { 29 | settings = { 30 | ["rust-analyzer"] = { 31 | imports = { 32 | granularity = { 33 | group = "module", 34 | }, 35 | prefix = "self", 36 | }, 37 | cargo = { 38 | buildScripts = { 39 | enable = true, 40 | }, 41 | }, 42 | procMacro = { 43 | enable = true, 44 | }, 45 | }, 46 | }, 47 | }, 48 | -- JS 49 | ["astro"] = {}, 50 | ["ts_ls"] = {}, 51 | ["html"] = {}, 52 | ["tailwindcss"] = {}, 53 | ["cssls"] = {}, 54 | ["volar"] = {}, 55 | -- C 56 | ["clangd"] = {}, 57 | ["mesonlsp"] = {}, 58 | ["neocmake"] = {}, 59 | -- Python 60 | ["ruff"] = {}, 61 | -- ["pylsp"] = {}, 62 | ["basedpyright"] = {}, 63 | -- Schemas 64 | ["taplo"] = {}, 65 | ["jsonls"] = { 66 | settings = { 67 | json = { 68 | schemas = require("schemastore").json.schemas { 69 | select = { 70 | "package.json", 71 | "tsconfig.json", 72 | }, 73 | }, 74 | -- validate = { enable = true }, 75 | }, 76 | }, 77 | }, 78 | ["yamlls"] = { 79 | settings = { 80 | redhat = { 81 | telemetry = { 82 | enabled = false, 83 | }, 84 | }, 85 | yaml = { 86 | validate = true, 87 | schemaStore = { 88 | enable = false, 89 | url = "", 90 | }, 91 | schemas = { 92 | ["https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json"] = ".gitlab-ci.{yaml,yml}", 93 | ["https://json.schemastore.org/github-action.json"] = "action.{yaml,yml}", 94 | ["https://json.schemastore.org/github-workflow.json"] = ".github/workflows/*", 95 | ["https://raw.githubusercontent.com/canonical/cloud-init/main/cloudinit/config/schemas/versions.schema.cloud-config.json"] = "user-data.{yaml,yml}", 96 | ["https://json.schemastore.org/hugo.json"] = "hugo.{yaml,yml}", 97 | -- Spack 98 | ["https://raw.githubusercontent.com/spack/schemas/refs/heads/main/schemas/spack.json"] = "spack.yaml", 99 | ["https://raw.githubusercontent.com/spack/schemas/refs/heads/main/schemas/packages.json"] = ".spack/packages.yaml", 100 | ["https://raw.githubusercontent.com/spack/schemas/refs/heads/main/schemas/config.json"] = ".spack/config.yaml", 101 | ["https://raw.githubusercontent.com/spack/schemas/refs/heads/main/schemas/modules.json"] = ".spack/modules.yaml", 102 | ["https://raw.githubusercontent.com/spack/schemas/refs/heads/main/schemas/mirrors.json"] = ".spack/mirrors.yaml", 103 | ["https://raw.githubusercontent.com/spack/schemas/refs/heads/main/schemas/concretizer.json"] = ".spack/concretizer.yaml", 104 | ["https://raw.githubusercontent.com/spack/schemas/refs/heads/main/schemas/ci.json"] = ".spack/ci.yaml", 105 | }, 106 | }, 107 | }, 108 | }, 109 | -- Misc 110 | ["bashls"] = {}, 111 | ["ltex_plus"] = { 112 | filetypes = { 113 | "markdown", 114 | "mdx", 115 | "org", 116 | "tex", 117 | "typst", 118 | }, 119 | }, 120 | ["gopls"] = {}, 121 | ["zls"] = { 122 | enable_build_on_save = true, 123 | }, 124 | ["tinymist"] = { 125 | offset_encoding = "utf-8", 126 | }, 127 | -- ["lua_ls"] = {}, 128 | ["terraformls"] = {}, 129 | ["dockerls"] = {}, 130 | ["guile_ls"] = { 131 | filetypes = { "scheme" }, 132 | }, 133 | } 134 | -------------------------------------------------------------------------------- /packages/neovim/viper-init-plugin/lua/viper/org.lua: -------------------------------------------------------------------------------- 1 | vim.list_extend(require("viper.lazy.specs"), { 2 | { 3 | "orgmode", 4 | ft = { "org" }, 5 | after = function() 6 | require("orgmode").setup { 7 | org_startup_folded = "showeverything", 8 | -- org_agenda_files = {}, 9 | -- org_default_notes_file = '~/Dropbox/org/refile.org', 10 | } 11 | 12 | require("viper.lazy").packadd("org-bullets.nvim") 13 | require("org-bullets").setup { 14 | symbols = { 15 | checkboxes = { 16 | done = { "×", "@org.keyword.done" }, 17 | half = { "-", "@org.checkbox.halfchecked" }, 18 | todo = { " ", "@org.keyword.todo" }, 19 | }, 20 | }, 21 | } 22 | end, 23 | }, 24 | }) 25 | -------------------------------------------------------------------------------- /packages/neovim/viper-init-plugin/lua/viper/tree-sitter.lua: -------------------------------------------------------------------------------- 1 | ---@dignostic disable: missing-fields 2 | require("nvim-treesitter.configs").setup { 3 | -- ignore_install = { "all" }, 4 | highlight = { 5 | enable = true, 6 | disable = { "bigfile" }, 7 | -- additional_vim_regex_highlighting = false, 8 | }, 9 | indent = { 10 | enable = true, 11 | }, 12 | textobjects = { 13 | select = { 14 | enable = true, 15 | lookahead = true, 16 | keymaps = { 17 | ["ia"] = { query = "@parameter.inner", desc = "inner argument" }, 18 | ["aa"] = { query = "@parameter.outer", desc = "around argument" }, 19 | }, 20 | }, 21 | }, 22 | } 23 | 24 | vim.wo.foldmethod = "expr" 25 | vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" 26 | vim.opt.foldlevel = 99 27 | 28 | -- Conflicts with treesitter 29 | vim.opt.smartindent = false 30 | 31 | -- Don't acidentally run these 32 | -- vim.api.nvim_del_user_command("TSUpdate") 33 | -- vim.api.nvim_del_user_command("TSUpdateSync") 34 | -- vim.api.nvim_del_user_command("TSInstall") 35 | -- vim.api.nvim_del_user_command("TSInstallSync") 36 | -- vim.api.nvim_del_user_command("TSInstallFromGrammar") 37 | -- vim.api.nvim_del_user_command("TSUninstall") 38 | 39 | require("nvim-ts-autotag").setup {} 40 | 41 | require("treesitter-context").setup { 42 | enable = true, 43 | max_lines = 4, 44 | } 45 | -------------------------------------------------------------------------------- /packages/neovim/viper-init-plugin/lua/viper/util.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | ---@param decimal number 4 | ---@return string 5 | M.rgbToHex = function(decimal) 6 | local bit = require("bit") 7 | local r = bit.rshift(decimal, 16) % 256 8 | local g = bit.rshift(decimal, 8) % 256 9 | local b = decimal % 256 10 | return string.format("#%02X%02X%02X", r, g, b) 11 | end 12 | 13 | return M 14 | -------------------------------------------------------------------------------- /packages/nix-index/command-not-found.fish: -------------------------------------------------------------------------------- 1 | function __fish_command_not_found_handler --on-event fish_command_not_found 2 | echo -e >&2 "\n\e[31m-> $argv[1]: command not found\e[39m\n" 3 | 4 | set candidates ( 5 | nix-locate --minimal --no-group --type x --type s --top-level --whole-name --at-root "/bin/$argv[1]" \ 6 | | string replace ".out" "" 7 | ) 8 | 9 | set selections (printf "%s\n" $candidates | fzf --filter="$argv[1]") 10 | 11 | if set -q NIX_AUTO_RUN 12 | set result (nix build --no-link --print-out-paths nixpkgs\#$selections[1]) 13 | $result/bin/$argv 14 | return 127 15 | else 16 | for item in $selections 17 | echo "nix shell nixpkgs#$item" 18 | end 19 | for item in $candidates 20 | if not contains $item $selections 21 | echo "nix shell nixpkgs#$item" 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /packages/nix-index/command-not-found.sh: -------------------------------------------------------------------------------- 1 | # bash handler 2 | command_not_found_handle() { 3 | # do not run when inside Midnight Commander or within a Pipe 4 | if [ -n "${MC_SID-}" ] || ! [ -t 1 ]; then 5 | echo -e >&2 "\e[31m$1: command not found\e[39m" 6 | return 127 7 | fi 8 | 9 | echo -e >&2 "\n\e[31m-> $1: command not found\e[39m\n" 10 | 11 | mapfile -t candidates < <("nix-locate" --minimal --no-group --type x --type s --top-level --whole-name --at-root "/bin/$1") 12 | 13 | # Remove .out suffix 14 | candidates=("${candidates[@]%%.out}") 15 | 16 | # Sort by proximity 17 | mapfile -t selections < <(printf "%s\n" ${candidates[@]} | fzf --filter=$1) 18 | 19 | if [ -z ${NIX_AUTO_RUN+x} ]; then 20 | result="$(nix build --no-link --print-out-paths nixpkgs#${selections[0]}.out)" 21 | $result/bin/$@ 22 | return $? 23 | else 24 | # Iterate through sorted programs 25 | for elem in "${selections[@]}"; do 26 | echo >&2 "nix shell nixpkgs#$elem" 27 | done 28 | # Iterate through the rest of programs not in fzf output 29 | for elem in "${candidates[@]}"; do 30 | if [[ ! " ${selections[*]} " =~ " ${elem} " ]]; then 31 | echo >&2 "nix shell nixpkgs#$elem" 32 | fi 33 | done 34 | fi 35 | 36 | return 127 # command not found should always exit with 127 37 | } 38 | 39 | # zsh handler 40 | command_not_found_handler() { 41 | # do not run when inside Midnight Commander or within a Pipe 42 | if [ -n "${MC_SID-}" ] || ! [ -t 1 ]; then 43 | echo -e >&2 "\e[31m$1: command not found\e[39m" 44 | return 127 45 | fi 46 | 47 | echo -e >&2 "\n\e[31m-> $1: command not found\e[39m\n" 48 | 49 | candidates=("${(@f)$(nix-locate --minimal --no-group --type x --type s --top-level --whole-name --at-root /bin/$1)}") 50 | 51 | # Remove .out suffix 52 | candidates=("${candidates[@]%%.out}") 53 | 54 | # Sort by proximity 55 | selections=("${(@f)$(printf "%s\n" ${candidates[@]} | fzf --filter=$1)}") 56 | 57 | if [ -z ${NIX_AUTO_RUN+x} ]; then 58 | result="$(nix build --no-link --print-out-paths nixpkgs\#${selections[1]}.out)" 59 | $result/bin/$@ 60 | return $? 61 | else 62 | # Iterate through sorted programs 63 | for elem in "${selections[@]}"; do 64 | echo >&2 "nix shell nixpkgs#$elem" 65 | done 66 | # Iterate through the rest of programs not in fzf output 67 | for elem in "${candidates[@]}"; do 68 | if [[ ! " ${selections[*]} " =~ " ${elem} " ]]; then 69 | echo >&2 "nix shell nixpkgs#$elem" 70 | fi 71 | done 72 | fi 73 | 74 | return 127 # command not found should always exit with 127 75 | } 76 | 77 | -------------------------------------------------------------------------------- /packages/nix-index/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | symlinkJoin, 3 | nix-index-unwrapped, 4 | runCommandLocal, 5 | fzf, 6 | database, 7 | databaseDate, 8 | makeWrapper, 9 | }: let 10 | # Add a folder in between and set name to `file` 11 | database' = runCommandLocal "nix-index-database" {} '' 12 | mkdir -p $out 13 | ln -s ${database} $out/files 14 | ''; 15 | inherit (nix-index-unwrapped) pname; 16 | version = "${nix-index-unwrapped.version}+db=${databaseDate}"; 17 | in 18 | symlinkJoin { 19 | name = "${pname}-${version}"; 20 | inherit pname version; 21 | paths = [nix-index-unwrapped]; 22 | buildInputs = [makeWrapper]; 23 | # Install broken, command-not-found is not detected by fish by using the vendor functions 24 | postBuild = '' 25 | cp -fv ${./command-not-found.sh} $out/etc/profile.d/command-not-found.sh 26 | substituteInPlace $out/etc/profile.d/command-not-found.sh \ 27 | --replace "nix-locate" "$out/bin/nix-locate" \ 28 | --replace "fzf" "${fzf}/bin/fzf" 29 | 30 | mkdir -p $out/share/fish/vendor_functions.d 31 | cp -v ${./command-not-found.fish} $out/share/fish/vendor_functions.d/nix-index.fish 32 | substituteInPlace $out/share/fish/vendor_functions.d/nix-index.fish \ 33 | --replace "nix-locate" "$out/bin/nix-locate" \ 34 | --replace "fzf" "${fzf}/bin/fzf" 35 | 36 | wrapProgram $out/bin/nix-index \ 37 | --add-flags "--db ${database'}" 38 | wrapProgram $out/bin/nix-locate \ 39 | --add-flags "--db ${database'}" 40 | ''; 41 | } 42 | -------------------------------------------------------------------------------- /packages/overlay.nix: -------------------------------------------------------------------------------- 1 | lib: 2 | let 3 | inherit (builtins) 4 | mapAttrs 5 | readDir 6 | ; 7 | 8 | sources = import ../npins; 9 | 10 | overlayPatches = final: prev: { 11 | gnome-keyring = prev.gnome-keyring.overrideAttrs (old: { 12 | # configureFlags = (lib.remove "--enable-ssh-agent" old.configureFlags) ++ [ 13 | # "--disable-ssh-agent" 14 | # ]; 15 | mesonFlags = (lib.remove "-Dssh-agent=true" old.mesonFlags) ++ [ 16 | "-Dssh-agent=false" 17 | ]; 18 | }); 19 | }; 20 | 21 | overlayAuto = 22 | final: prev: 23 | ( 24 | readDir ./. 25 | |> lib.filterAttrs (_: value: value == "directory") 26 | |> mapAttrs ( 27 | name: _: 28 | final.callPackage ./${name} { 29 | } 30 | ) 31 | ) 32 | // { 33 | # Prevent infrec 34 | guix = final.callPackage ./guix { inherit (prev) guix; }; 35 | yazi = final.callPackage ./yazi { inherit (prev) yazi; }; 36 | }; 37 | 38 | overlayMisc = final: prev: { 39 | # nix = flake.self.lib.versionGate pkgs.nixVersions.nix_2_26 pkgs.nix; 40 | nix = prev.nix; 41 | 42 | nix-index = 43 | let 44 | imported = import sources.nix-index-database { pkgs = final; }; 45 | in 46 | imported.nix-index-with-db; 47 | 48 | neovim = (import sources.mnw).lib.wrap final { imports = [ ./neovim/module.nix ]; }; 49 | 50 | nh = final.callPackage "${sources.nh}/package.nix" { 51 | rev = sources.nh.revision; 52 | }; 53 | 54 | hover-rs = final.callPackage "${sources.hover-rs}/package.nix" { }; 55 | guix-search = final.python3.pkgs.callPackage "${sources.guix-search}/package.nix" { }; 56 | 57 | maid = (import sources.nix-maid) final ../modules/maid; 58 | }; 59 | 60 | overlayWrapperManager = 61 | final: prev: 62 | let 63 | wrapper-manager = import sources.wrapper-manager { inherit lib; }; 64 | evald = wrapper-manager.lib { 65 | pkgs = prev; 66 | modules = 67 | builtins.readDir ../modules/wrapper-manager 68 | |> builtins.attrNames 69 | |> map (n: ../modules/wrapper-manager/${n}); 70 | }; 71 | in 72 | mapAttrs (_: value: value.wrapped) evald.config.wrappers; 73 | 74 | overlayVersion = final: prev: { 75 | lib = prev.lib.extend (finalLib: prevLib: { 76 | trivial = prevLib.trivial // { 77 | versionSuffix = ".${finalLib.substring 0 7 sources.nixpkgs.revision}"; 78 | }; 79 | }); 80 | }; 81 | in 82 | lib.composeManyExtensions [ 83 | overlayPatches 84 | overlayAuto 85 | overlayMisc 86 | overlayWrapperManager 87 | # (import sources.lanzaboote).overlays.default 88 | overlayVersion 89 | ] 90 | -------------------------------------------------------------------------------- /packages/wl-clip-persist/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | callPackages, 3 | rustPlatform, 4 | makeWrapper, 5 | wayland, 6 | pkg-config, 7 | }: let 8 | nv = (callPackages ./generated.nix {}).wl-clip-persist; 9 | in 10 | rustPlatform.buildRustPackage { 11 | inherit (nv) pname src; 12 | version = nv.date; 13 | cargoLock = nv.cargoLock."Cargo.lock"; 14 | 15 | nativeBuildInputs = [makeWrapper pkg-config]; 16 | 17 | buildInputs = [wayland]; 18 | } 19 | -------------------------------------------------------------------------------- /packages/wl-clip-persist/generated.json: -------------------------------------------------------------------------------- 1 | { 2 | "wl-clip-persist": { 3 | "cargoLocks": { 4 | "Cargo.lock": [ 5 | "./wl-clip-persist-d9fc91734d482e95e80405df8da11547c41881d5/Cargo.lock", 6 | {} 7 | ] 8 | }, 9 | "date": "2024-05-03", 10 | "extract": null, 11 | "name": "wl-clip-persist", 12 | "passthru": null, 13 | "pinned": false, 14 | "src": { 15 | "deepClone": false, 16 | "fetchSubmodules": false, 17 | "leaveDotGit": false, 18 | "name": null, 19 | "rev": "d9fc91734d482e95e80405df8da11547c41881d5", 20 | "sha256": "sha256-dFhHsBazBHVWgPxoRDNwh8Yctt4w64E0RyFaHEC4mvk=", 21 | "type": "git", 22 | "url": "https://github.com/Linus789/wl-clip-persist" 23 | }, 24 | "version": "d9fc91734d482e95e80405df8da11547c41881d5" 25 | } 26 | } -------------------------------------------------------------------------------- /packages/wl-clip-persist/generated.nix: -------------------------------------------------------------------------------- 1 | # This file was generated by nvfetcher, please do not modify it manually. 2 | { fetchgit, fetchurl, fetchFromGitHub, dockerTools }: 3 | { 4 | wl-clip-persist = { 5 | pname = "wl-clip-persist"; 6 | version = "d9fc91734d482e95e80405df8da11547c41881d5"; 7 | src = fetchgit { 8 | url = "https://github.com/Linus789/wl-clip-persist"; 9 | rev = "d9fc91734d482e95e80405df8da11547c41881d5"; 10 | fetchSubmodules = false; 11 | deepClone = false; 12 | leaveDotGit = false; 13 | sha256 = "sha256-dFhHsBazBHVWgPxoRDNwh8Yctt4w64E0RyFaHEC4mvk="; 14 | }; 15 | cargoLock."Cargo.lock" = { 16 | lockFile = ./wl-clip-persist-d9fc91734d482e95e80405df8da11547c41881d5/Cargo.lock; 17 | outputHashes = { 18 | 19 | }; 20 | }; 21 | date = "2024-05-03"; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /packages/wl-clip-persist/nvfetcher.toml: -------------------------------------------------------------------------------- 1 | [wl-clip-persist] 2 | src.git = "https://github.com/Linus789/wl-clip-persist" 3 | fetch.git = "https://github.com/Linus789/wl-clip-persist" 4 | cargo_locks = ["Cargo.lock"] 5 | -------------------------------------------------------------------------------- /packages/xdg-ninja/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | callPackages, 3 | stdenvNoCC, 4 | makeWrapper, 5 | jq, 6 | glow, 7 | lib, 8 | }: let 9 | nv = (callPackages ./generated.nix {}).xdg-ninja; 10 | in 11 | stdenvNoCC.mkDerivation rec { 12 | inherit (nv) pname src; 13 | version = nv.date; 14 | 15 | nativeBuildInputs = [makeWrapper]; 16 | 17 | propagatedBuildInputs = [jq glow]; 18 | 19 | installPhase = '' 20 | runHook preInstall 21 | mkdir -pv $out/{bin,share/xdg-ninja} 22 | cp -av xdg-ninja.sh $out/bin/xdg-ninja 23 | cp -av programs $out/share/xdg-ninja 24 | substituteInPlace $out/bin/xdg-ninja \ 25 | --replace '$0' "$out/share/xdg-ninja/programs" 26 | wrapProgram $out/bin/xdg-ninja \ 27 | --prefix PATH ':' ${lib.makeBinPath propagatedBuildInputs} 28 | runHook postInstall 29 | ''; 30 | } 31 | -------------------------------------------------------------------------------- /packages/xdg-ninja/generated.json: -------------------------------------------------------------------------------- 1 | { 2 | "xdg-ninja": { 3 | "cargoLocks": null, 4 | "date": "2024-06-05", 5 | "extract": null, 6 | "name": "xdg-ninja", 7 | "passthru": null, 8 | "pinned": false, 9 | "src": { 10 | "deepClone": false, 11 | "fetchSubmodules": false, 12 | "leaveDotGit": false, 13 | "name": null, 14 | "owner": "b3nj5m1n", 15 | "repo": "xdg-ninja", 16 | "rev": "d56175dfbbb25541228c2d62e6b466a2ee60639b", 17 | "sha256": "sha256-BtVqbKTyM/52e1nkZNLcXaP4kDiFP/uDTLVugDDYJv8=", 18 | "type": "github" 19 | }, 20 | "version": "d56175dfbbb25541228c2d62e6b466a2ee60639b" 21 | } 22 | } -------------------------------------------------------------------------------- /packages/xdg-ninja/generated.nix: -------------------------------------------------------------------------------- 1 | # This file was generated by nvfetcher, please do not modify it manually. 2 | { fetchgit, fetchurl, fetchFromGitHub, dockerTools }: 3 | { 4 | xdg-ninja = { 5 | pname = "xdg-ninja"; 6 | version = "d56175dfbbb25541228c2d62e6b466a2ee60639b"; 7 | src = fetchFromGitHub { 8 | owner = "b3nj5m1n"; 9 | repo = "xdg-ninja"; 10 | rev = "d56175dfbbb25541228c2d62e6b466a2ee60639b"; 11 | fetchSubmodules = false; 12 | sha256 = "sha256-BtVqbKTyM/52e1nkZNLcXaP4kDiFP/uDTLVugDDYJv8="; 13 | }; 14 | date = "2024-06-05"; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /packages/xdg-ninja/nvfetcher.toml: -------------------------------------------------------------------------------- 1 | [xdg-ninja] 2 | src.git = "https://github.com/b3nj5m1n/xdg-ninja" 3 | fetch.github = "b3nj5m1n/xdg-ninja" 4 | git.date_format = "%Y-%m-%d" 5 | -------------------------------------------------------------------------------- /packages/yazi/default.nix: -------------------------------------------------------------------------------- 1 | { yazi }: 2 | yazi.override { 3 | settings.keymap = builtins.readFile ./keymap.toml |> builtins.fromTOML; 4 | } 5 | -------------------------------------------------------------------------------- /packages/yazi/keymap.toml: -------------------------------------------------------------------------------- 1 | [[manager.prepend_keymap]] 2 | on = "" 3 | run = "quit" 4 | desc = "Quit" 5 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 |

viperML/dotfiles

2 | 3 | 4 | # 🗒 About 5 | 6 | These are my personal configuration files for my Linux and Windows machines. Feel free to grab anything that you find interesting. 7 | 8 | --------------------------------------------------------------------------------