diff --git a/.gitattributes b/.gitattributes index 39d2d68..42db5b2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ **/private/** filter=git-crypt diff=git-crypt -encrypted-test filter=git-crypt diff=git-crypt \ No newline at end of file +private/** filter=git-crypt diff=git-crypt \ No newline at end of file diff --git a/.gitignore b/.gitignore index ab386ab..6b35e68 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ \#*\# +.\# .vscode \ No newline at end of file diff --git a/README.org b/README.org index fe28e90..300b684 100644 --- a/README.org +++ b/README.org @@ -1,21 +1,10 @@ -#+TITLE: nixos-config -#+AUTHOR: materus +TITLE: Lemon +#+AUTHOR: materus (Mateusz Słodkowicz) #+DESCRIPTION: NixOS config and dotfiles #+OPTIONS: \n:t -My NixOS and home-manager configs. -Dotfiles and helper scripts. - -Part of it is encrypted by git-crypt, mostly just ips and names. Secrets are managed by sops. - -* Hosts -[[./configurations/host/materusPC/][materusPC]] - my main PC - -[[./configurations/host/Old-materusPC/][Old-materusPC]] - my old PC, barely used - -[[./configurations/host/flamaster/][flamaster]] - my laptop, used mostly as server for games. - -[[./configurations/host/valkyrie/][valkyrie]] - VPS, my website and pleroma instance - -[[./configurations/host/waffentrager/][waffentrager]] - raspberry pi4, home server +#+LANGUAGE: en +Lemon is mine collection of NixOS config, dotfiles and some scripts. +Most of my config is tangled from Emacs Org files located [[./org-conf/][there]]. +Part of it is encrypted with [[https://github.com/AGWA/git-crypt][git-crypt]]. diff --git a/configurations/host/Old-materusPC/configuration.nix b/configurations/host/Old-materusPC/configuration.nix deleted file mode 100755 index 68d9ab9..0000000 --- a/configurations/host/Old-materusPC/configuration.nix +++ /dev/null @@ -1,345 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ - config, - pkgs, - materusCfg, - materusArg, - ... -}: -let - unstable = import materusCfg.materusFlake.inputs.nixpkgs { - system = "x86_64-linux"; - config = { - allowUnfree = true; - nvidia.acceptLicense = true; - }; - }; -in -{ - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - ./network.nix - ]; - boot.supportedFilesystems = [ "ntfs" ]; - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - nix.settings.auto-optimise-store = true; - nix.settings.substituters = [ - "https://nix-community.cachix.org" - "https://cache.nixos.org/" - ]; - nix.settings.trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - ]; - nixpkgs.config.allowUnfree = true; - - # Use the systemd-boot EFI boot loader. - boot.loader.grub = { - enable = true; - efiSupport = true; - device = "nodev"; - gfxmodeEfi = "1920x1080"; - gfxmodeBios = "1920x1080"; - useOSProber = true; - }; - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.efi.efiSysMountPoint = "/boot/efi"; - boot.kernelPackages = unstable.linuxPackages_zen; - boot.tmp.useTmpfs = true; - - services.flatpak.enable = true; - services.gvfs.enable = true; - programs.kdeconnect.enable = true; - - # Set your time zone. - time.timeZone = "Europe/Warsaw"; - - services.syncthing = { - enable = true; - user = "materus"; - dataDir = "/home/materus"; - }; - services.fstrim = { - enable = true; - interval = "weekly"; - }; - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Select internationalisation properties. - i18n.defaultLocale = "pl_PL.UTF-8"; - console = { - font = "lat2-16"; - # keyMap = "pl"; - useXkbConfig = true; # use xkbOptions in tty. - }; - - hardware.bluetooth.enable = true; - # Enable the X11 windowing system. - services.xserver.enable = true; - - hardware.opengl.enable = true; - hardware.opengl.driSupport32Bit = true; - - materus.profile.steam.enable = true; - - # Configure keymap in X11 - services.xserver.xkb.layout = "pl"; - # services.xserver.xkbOptions = { - # "eurosign:e"; - # "caps:escape" # map caps to escape. - # }; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable sound. - sound.enable = true; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - jack.enable = true; - }; - hardware.pulseaudio.enable = false; - services.udev = { - extraRules = '' - KERNEL=="rtc0", GROUP="audio" - KERNEL=="hpet", GROUP="audio" - DEVPATH=="/devices/virtual/misc/cpu_dma_latency", OWNER="root", GROUP="audio", MODE="0660" - ''; - }; - - virtualisation.podman = { - enable = true; - dockerCompat = true; - dockerSocket.enable = true; - }; - - users.users.materus = { - isNormalUser = true; - extraGroups = [ - "wheel" - "networkmanager" - "kvm" - "input" - "libvirt" - "libvirtd" - "podman" - "audio" - "pipewire" - ]; - shell = pkgs.zsh; - description = "Mateusz Słodkowicz"; - - }; - environment.sessionVariables = rec { - XDG_CACHE_HOME = "\${HOME}/.cache"; - XDG_CONFIG_HOME = "\${HOME}/.config"; - XDG_BIN_HOME = "\${HOME}/.local/bin"; - XDG_DATA_HOME = "\${HOME}/.local/share"; - - #SSH_ASKPASS_REQUIRE = "prefer"; - - STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d"; - - MOZ_USE_XINPUT2 = "1"; - PATH = [ "\${XDG_BIN_HOME}" ]; - }; - environment.shellInit = '' - if ! [ -z "$DISPLAY" ]; then xhost +si:localuser:root &> /dev/null; fi; - if ! [ -z "$DISPLAY" ]; then xhost +si:localuser:$USER &> /dev/null; fi; - ''; - # List packages installed in system profile. To search, run: - # $ nix search wget - - i18n.inputMethod.enabled = "fcitx5"; - i18n.inputMethod.fcitx5.addons = [ - pkgs.fcitx5-configtool - pkgs.fcitx5-lua - pkgs.fcitx5-mozc - pkgs.libsForQt5.fcitx5-qt - ]; - - environment.systemPackages = with pkgs; [ - brave - - glibc - patchelf - vim - wget - killall - xorg.xkill - xorg.xhost - nix-top - gitFull - curl - jdk - nss_latest - (aspellWithDicts ( - ds: with ds; [ - en - en-computers - en-science - pl - ] - )) - distrobox - p7zip - unrar - bzip2 - rar - unzip - zstd - xz - zip - gzip - sops - - tree - mc - lf - htop - nmon - iftop - iptraf-ng - mprocs - - nix-du - git-crypt - - wineWowPackages.stagingFull - winetricks - protontricks - openal - gnupg - ncurses - monkeysphere - gparted - - inkscape - gimp - - virt-manager - libguestfs - - bubblewrap - bindfs - - pulseaudio - - binutils - - ]; - - fonts.fontDir.enable = true; - fonts.enableDefaultPackages = true; - fonts.packages = with pkgs; [ - dejavu_fonts - hack-font - noto-fonts - noto-fonts-extra - noto-fonts-emoji - noto-fonts-cjk-sans - noto-fonts-cjk-serif - ubuntu_font_family - wqy_zenhei - monocraft - (nerdfonts.override { - fonts = [ - "FiraCode" - "DroidSansMono" - "Meslo" - "ProFont" - ]; - }) - ]; - fonts.fontconfig.enable = true; - fonts.fontconfig.cache32Bit = true; - fonts.fontconfig.defaultFonts.sansSerif = [ - "Noto Sans" - "DejaVu Sans" - "WenQuanYi Zen Hei" - "Noto Color Emoji" - ]; - fonts.fontconfig.defaultFonts.serif = [ - "Noto Serif" - "DejaVu Serif" - "WenQuanYi Zen Hei" - "Noto Color Emoji" - ]; - fonts.fontconfig.defaultFonts.emoji = [ - "Noto Color Emoji" - "OpenMoji Color" - ]; - fonts.fontconfig.defaultFonts.monospace = [ - "Hack Nerd Font" - "Noto Sans Mono" - "WenQuanYi Zen Hei Mono" - ]; - - environment.enableAllTerminfo = true; - environment.pathsToLink = [ "/share/zsh" ]; - environment.shells = with pkgs; [ zsh ]; - programs = { - steam = { - enable = true; - dedicatedServer.openFirewall = true; - remotePlay.openFirewall = true; - }; - fish.enable = true; - java.enable = true; - command-not-found.enable = false; - dconf.enable = true; - }; - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - services.pcscd.enable = true; - - /* - systemd.user.services.gpg-agent.serviceConfig.ExecStart = [ - "" - '' - ${pkgs.gnupg}/bin/gpg-agent --supervised \ - --pinentry-program ${pkgs.kwalletcli}/bin/pinentry-kwallet - '' - ]; - */ - - programs.gnupg.agent = { - enable = true; - enableSSHSupport = false; - enableBrowserSocket = true; - }; - programs.ssh.startAgent = true; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - services.openssh.enable = true; - - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - system.copySystemConfiguration = false; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.11"; # Did you read the comment? - -} diff --git a/configurations/host/Old-materusPC/default.nix b/configurations/host/Old-materusPC/default.nix deleted file mode 100644 index d6274e5..0000000 --- a/configurations/host/Old-materusPC/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - imports = - [ - ./secrets - ./configuration.nix - ./nvidia.nix - ./plasma.nix - ]; - - - -} diff --git a/configurations/host/Old-materusPC/hardware-configuration.nix b/configurations/host/Old-materusPC/hardware-configuration.nix deleted file mode 100755 index f29f9bc..0000000 --- a/configurations/host/Old-materusPC/hardware-configuration.nix +++ /dev/null @@ -1,91 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" "vfio-pci" ]; - boot.extraModulePackages = [ ]; - boot.kernel.sysctl = { "vm.swappiness" = 10; }; - boot.kernelParams = [ "ibt=off" "intel_iommu=on" "iommu=pt" "pcie_acs_override=downstream,multifunction" ]; - fileSystems."/" = - { - device = "/dev/disk/by-label/NixOS_Root"; - fsType = "btrfs"; - options = [ "subvol=@" "noatime" "ssd" "space_cache=v2" ]; - }; - - fileSystems."/boot" = - { - device = "/dev/disk/by-label/NixOS_Root"; - fsType = "btrfs"; - options = [ "subvol=@boot" "ssd" ]; - }; - - fileSystems."/materus" = - { - device = "/dev/disk/by-label/NixOS_Root"; - fsType = "btrfs"; - options = [ "subvol=@materus" "noatime" "compress=zstd" "ssd" "space_cache=v2" ]; - neededForBoot = true; - - }; - - fileSystems."/nix" = - { - device = "/dev/disk/by-label/NixOS_Root"; - fsType = "btrfs"; - options = [ "subvol=@nix" "noatime" "compress=zstd" "ssd" "space_cache=v2" ]; - }; - - fileSystems."/home" = - { - device = "/dev/disk/by-label/NixOS_Home"; - fsType = "btrfs"; - options = [ "subvol=@home" "nossd" "noatime" "compress=zstd" "space_cache=v2" "autodefrag" ]; - }; - - fileSystems."/materus/data" = - { - device = "/dev/disk/by-label/NixOS_Home"; - fsType = "btrfs"; - options = [ "subvol=@data" "nossd" "noatime" "compress=zstd" "space_cache=v2" "autodefrag" ]; - }; - - fileSystems."/boot/efi" = - { - device = "/dev/disk/by-uuid/A5C2-31D1"; - fsType = "vfat"; - }; - - swapDevices = - [{ device = "/dev/disk/by-label/NixOS_Swap"; }]; - - fileSystems."/etc/nixos" = - { - device = "/materus/config/nixos-config"; - fsType = "none"; - options = [ "bind" ]; - depends = [ "/materus" ]; - }; - - - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkForce true; -} diff --git a/configurations/host/Old-materusPC/home/materus/default.nix b/configurations/host/Old-materusPC/home/materus/default.nix deleted file mode 100644 index 0d574e1..0000000 --- a/configurations/host/Old-materusPC/home/materus/default.nix +++ /dev/null @@ -1,158 +0,0 @@ -{ config, pkgs, materusArg, materusCfg, lib, ... }: -{ - home.stateVersion = "22.11"; - home.homeDirectory = "/home/materus"; - programs.wezterm.enable = true; - programs.git = { - userEmail = "materus@podkos.pl"; - userName = "materus"; - signing.signByDefault = true; - signing.key = "${materusArg.cfg.path}/extraFiles/keys/ssh/materus.pub"; - extraConfig = { - commit.gpgsign = true; - gpg.format = "ssh"; - }; - }; - - programs.vscode.userSettings = { - "vscord.app.name" = "VSCodium"; - "window.dialogStyle" = "custom"; - "window.titleBarStyle" = "custom"; - "editor.fontFamily" = "'Hack Nerd Font', 'monospace', monospace"; - "workbench.colorTheme" = "Dracula Theme"; - "workbench.productIconTheme" = "material-product-icons"; - "workbench.iconTheme" = "material-icon-theme"; - - "d.aggressiveUpdate" = false; - "d.servedPath" = "${pkgs.serve-d}/bin/serve-d"; - - "direnv.path.executable" = "${pkgs.direnv}/bin/direnv"; - - "nix.enableLanguageServer" = true; - "nix.serverPath" = "${pkgs.nixd}/bin/nixd"; - "nix.formatterPath" = "${pkgs.nixfmt-rfc-style}/bin/nixfmt"; - - "C_Cpp.clang_format_path" = "${pkgs.clang-tools}/bin/clang-format"; - "C_Cpp.clang_format_fallbackStyle" = "Microsoft"; - "clang-tidy.executable" = "${pkgs.clang-tools}/bin/clang-tidy"; - - "python.defaultInterpreterPath" = "${pkgs.python3Full}/bin/python"; - "[cpp]" = { - "editor.defaultFormatter" = "xaver.clang-format"; - }; - }; - - materus.profile = { - fonts.enable = lib.mkDefault true; - nixpkgs.enable = lib.mkDefault false; - enableDesktop = lib.mkDefault true; - enableTerminal = lib.mkDefault true; - enableTerminalExtra = lib.mkDefault true; - enableNixDevel = lib.mkDefault true; - editor.code.fhs.enable = false; - - editor.code.fhs.packages = (ps: with ps; let llvmpkgs = llvmPackages_16; in [ - llvmpkgs.clang - llvmpkgs.llvm - llvmpkgs.bintools - llvmpkgs.lld - llvmpkgs.lldb - llvmpkgs.libllvm - llvmpkgs.libllvm.dev - - - gcc - gdb - - cmake - gnumake - ninja - binutils - coreutils - util-linux - - dotnet-sdk_8 - mono - mold - python3 - lua - gtk4.dev - gtk4 - miniaudio - SDL2.dev - SDL2 - freeglut.dev - freeglut - boost.dev - boost - glew.dev - libGL.dev - libGLU.dev - vulkan-loader.dev - - jdk - - - ldc - dmd - dub - ]); - - editor.emacs.enable = true; - - }; - xdg.desktopEntries.brave-browser = - let - env = lib.concatStringsSep " " [ - ''__NV_PRIME_RENDER_OFFLOAD="1"'' - ''__NV_PRIME_RENDER_OFFLOAD_PROVIDER="NVIDIA-G0"'' - ''__GLX_VENDOR_LIBRARY_NAME="nvidia"'' - ''__VK_LAYER_NV_optimus="NVIDIA_only"'' - ''NIXOS_OZONE_WL="1"'' - ]; - script = pkgs.writeShellScript "brave" '' - ${env} brave "$@" - ''; - - in - { - name = "Brave Web Browser"; - genericName = "Przeglądarka WWW"; - comment = "Skorzystaj z internetu"; - exec = "${script} %U"; - icon = "brave-browser"; - terminal = false; - categories = [ "Application" "Network" "WebBrowser" ]; - mimeType = [ - "application/pdf" - "application/rdf+xml" - "application/rss+xml" - "application/xhtml+xml" - "application/xhtml_xml" - "application/xml" - "image/gif" - "image/jpeg" - "image/png" - "image/webp" - "text/html" - "text/xml" - "x-scheme-handler/http" - "x-scheme-handler/https" - "x-scheme-handler/ipfs" - "x-scheme-handler/ipns" - ]; - actions.new-windows = { - exec = "${script}"; - name = "Nowe okno"; - }; - actions.new-private-windows = { - exec = "${script} --incognito"; - name = "Nowe okno incognito"; - }; - }; - home.packages = [ - pkgs.papirus-icon-theme - (materusArg.pkgs.polymc-qt5.wrap { withWaylandGLFW = true; extraJDKs = [ pkgs.graalvm-ce ]; }) - ]; - -} diff --git a/configurations/host/Old-materusPC/network.nix b/configurations/host/Old-materusPC/network.nix deleted file mode 100644 index 420fe43..0000000 --- a/configurations/host/Old-materusPC/network.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -{ - sops.templates."networkmanager.env".content = '' - WIREGUARD_PRIVATEKEY="${config.sops.placeholder.wg-key}" - ''; - - networking.useDHCP = lib.mkDefault true; - networking.hostName = "Old-materusPC"; - networking.wireless.iwd.enable = true; - networking.networkmanager.enable = true; - # Open ports in the firewall. - networking.firewall.allowedTCPPorts = [ 24800 5900 5357 4656 - 22000 config.services.syncthing.relay.statusPort config.services.syncthing.relay.port # Syncthing - ]; - networking.firewall.allowedUDPPorts = [ 24800 5900 3702 4656 - 22000 21027 # Syncthing - ]; - # Or disable the firewall altogether. - networking.firewall.enable = true; - networking.networkmanager.settings = { - connectivity = { - uri = "http://nmcheck.gnome.org/check_network_status.txt"; - }; - }; - - networking.networkmanager.ensureProfiles.environmentFiles = [ - config.sops.templates."networkmanager.env".path - ]; - networking.networkmanager.ensureProfiles.profiles = { - wg0 = { - connection = { - id = "wg0"; - type = "wireguard"; - interface-name = "wg0"; - }; - wireguard = { - private-key = "$WIREGUARD_PRIVATEKEY"; - }; - "wireguard-peer.${materusArg.wireguard.pubKeys.valkyrie}" = { - endpoint = "${materusArg.ips.valkyrie}:${materusArg.wireguard.port}"; - allowed-ips = "${materusArg.ip-masks.wireguard.general};"; - persistent-keepalive = "20"; - }; - ipv4 = { - address1 = "${materusArg.ips.wireguard.Old-materusPC}/23"; - dns = "${materusArg.ips.wireguard.valkyrie};"; - method = "manual"; - never-default = "true"; - }; - ipv6 = { - addr-gen-mode = "stable-privacy"; - method = "disabled"; - }; - proxy = { }; - }; - }; -} \ No newline at end of file diff --git a/configurations/host/Old-materusPC/nvidia.nix b/configurations/host/Old-materusPC/nvidia.nix deleted file mode 100644 index 2596fb4..0000000 --- a/configurations/host/Old-materusPC/nvidia.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ config, pkgs, ... }: -{ - services.xserver.videoDrivers = [ "nvidia" ]; - hardware.nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.latest; - modesetting.enable = true; - nvidiaSettings = true; - - }; - hardware.opengl.extraPackages = with pkgs; [ - vaapiVdpau - nvidia-vaapi-driver - libvdpau-va-gl - ]; - - hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ - vaapiVdpau - nvidia-vaapi-driver - libvdpau-va-gl - ]; - materus.profile.steam.extraEnv = { - VK_ICD_FILENAMES=''''$VK_ICD_FILENAMES:/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json:/run/opengl-driver-32/share/vulkan/icd.d/nvidia_icd.i686.json''; - __NV_PRIME_RENDER_OFFLOAD="1"; - __NV_PRIME_RENDER_OFFLOAD_PROVIDER="NVIDIA-G0"; - __GLX_VENDOR_LIBRARY_NAME="nvidia"; - __VK_LAYER_NV_optimus="NVIDIA_only"; - }; -} diff --git a/configurations/host/Old-materusPC/plasma.nix b/configurations/host/Old-materusPC/plasma.nix deleted file mode 100644 index c0c94ef..0000000 --- a/configurations/host/Old-materusPC/plasma.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ pkgs, ... }: -{ - - services.displayManager.sddm.enable = true; - services.displayManager.sddm.wayland.enable = true; - services.displayManager.sddm.settings = { - General = { - InputMethod = ""; - }; - Theme = { - CursorTheme = "breeze_cursors"; - CursorSize = "24"; - }; - }; - environment.variables = { - QT_PLUGIN_PATH = [ "${pkgs.qt6.qtimageformats}/${pkgs.qt6.qtbase.qtPluginPrefix}" ]; - XCURSOR_THEME = "breeze_cursors"; - }; - xdg.portal.enable = true; - xdg.portal.wlr.enable = true; - xdg.portal.xdgOpenUsePortal = true; - xdg.portal.extraPortals = [ pkgs.kdePackages.xdg-desktop-portal-kde ]; - services.desktopManager.plasma6.enable = true; - services.desktopManager.plasma6.enableQt5Integration = true; - environment.plasma6.excludePackages = with pkgs.kdePackages; [ kwallet kwalletmanager kwallet-pam ]; - environment.systemPackages = with pkgs.kdePackages; [ - ark - kate - ]; - materus.profile.steam.extraPkgs = [ pkgs.kdePackages.breeze pkgs.kdePackages.breeze-gtk pkgs.kdePackages.dolphin ]; -} diff --git a/configurations/host/Old-materusPC/secrets/default.nix b/configurations/host/Old-materusPC/secrets/default.nix deleted file mode 100644 index 3699a3b..0000000 --- a/configurations/host/Old-materusPC/secrets/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ config, pkgs, lib, materusCfg, ... }: -{ - imports = - [ - - ] ++ (if (materusCfg.materusFlake.decrypted) then [ ./private ] else [ ]); - - sops.age.generateKey = false; - sops.gnupg.home = null; - sops.gnupg.sshKeyPaths = [ ]; - sops.defaultSopsFile = materusCfg.hostPath + "/secrets/secrets.yaml"; - sops.secrets."wg-key" = { }; - services.openssh.hostKeys = [ - { - bits = 4096; - path = "/materus/root/ssh_host_rsa_key"; - type = "rsa"; - } - { - path = "/materus/root/ssh_host_ed25519_key"; - type = "ed25519"; - } - ]; - -} diff --git a/configurations/host/Old-materusPC/secrets/private/default.nix b/configurations/host/Old-materusPC/secrets/private/default.nix deleted file mode 100644 index 19144af..0000000 Binary files a/configurations/host/Old-materusPC/secrets/private/default.nix and /dev/null differ diff --git a/configurations/host/Old-materusPC/secrets/secrets.yaml b/configurations/host/Old-materusPC/secrets/secrets.yaml deleted file mode 100644 index 34cde6d..0000000 --- a/configurations/host/Old-materusPC/secrets/secrets.yaml +++ /dev/null @@ -1,33 +0,0 @@ -wg-key: ENC[AES256_GCM,data:+z+Xxq6A1h5ceCOZry9PSz871zVZpd9Y6vtqpfoAulHCN03DjzZ/PLmRvYQ=,iv:7hdjnUuaRk30hFJ8rv4zXxI8v42RWC1iQb64LMNgBnQ=,tag:eUSTVygR+u9ERPU9gfhYIw==,type:str] -sops: - kms: [] - gcp_kms: [] - azure_kv: [] - hc_vault: [] - age: - - recipient: age1el7zhjxkrlravpt7hw36fuac0xfgd42qkjjkvxzqmyl28u8csasqkd4a40 - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBsT2w4SCt2ZGdLYktHckMw - QVhza2tqU2M1Q3lsYnhld1dKcTdYUHcvSzFrCjMxT05yU01nUmFQK0FCUThUNDNN - V2EyTUhoVUNjNlNwTU9FeTlGRkxvVDgKLS0tIDBFYys1TmI0T0x0RnE2N3JCWWpq - VFVjMGUvRVBaY0JsR2lVcUFsdk4rYjQKEiiqEcTaQSVXSAm5c9uylaf2Tt/KJtPl - GDp+2YSBHHnVYjtYf7k9WqsIEe5/0AifDp3YA8jNhOXuZwZdvk+fLw== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-03-30T18:21:12Z" - mac: ENC[AES256_GCM,data:0DMB+ukujc6PMU45n1QJGryGie25Bj2hXmia69QgYZNk2vgfO+nYmWSpmqK4Z00xXNtbsgejfDto5mrzU/OJ4FF3eOfwWfdIwxQLEQKoPF5U3niON3YO8FEA+JIn+/fNGF3fY1AgBfhberST5ikKnmff1Nwe5GOwQHSB3LU+CZE=,iv:V89EFUby3bwsoZKpoJRmJS9E/UheMBkKDq7j40IzBTA=,tag:aOJnFFGIuzQ3T7YrIFiWtw==,type:str] - pgp: - - created_at: "2024-03-30T18:20:23Z" - enc: |- - -----BEGIN PGP MESSAGE----- - - hF4D5fSX77p80GYSAQdAnUVLGsgIKd3EtSAGTPyXqSlsz1T8RnDvAtBz/XaH0y0w - pkp84zTe85FRZDnTO8a44WkpNIrUih0CYQSPPCZqSi/qnIxPWgx67HTC1bPAO9Iw - 1GgBCQIQNcrKr4YNKSP5XxJqMXOyZD7rZ4g02Xdw5XplZ/y34m9c83S44XRgHwg4 - 0obXI1UlsqyHf/ZnTM1pbXO/kdTdFomWvWbfbuKDgDvyiJJ18mJ48GOsv/SBBJjJ - 3877O+Ia5I8Chg== - =q58P - -----END PGP MESSAGE----- - fp: 28D140BCA60B4FD1 - unencrypted_suffix: _unencrypted - version: 3.8.1 diff --git a/configurations/host/Old-materusPC/vbios.rom b/configurations/host/Old-materusPC/vbios.rom deleted file mode 100755 index f7eaafb..0000000 Binary files a/configurations/host/Old-materusPC/vbios.rom and /dev/null differ diff --git a/configurations/host/default.nix b/configurations/host/default.nix deleted file mode 100644 index dabd4aa..0000000 --- a/configurations/host/default.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ inputs, materusFlake }: - -let - profiles = import ../profile; - - makeSystem = { host, arch ? "x86_64-linux", extraModules ? [ ], stable ? true, hmAsModule ? true, hmUsers ? [ "materus" ] }: - let - nixosSystem = if stable then inputs.nixpkgs-stable.lib.nixosSystem else inputs.nixpkgs.lib.nixosSystem; - hm = if stable then inputs.configInputs-stable.home-manager else inputs.configInputs.home-manager; - materusCfg = { - inherit stable; - inherit materusFlake; - inherit host; - inherit hm; - inherit hmAsModule; - inherit arch; - nixerus = if stable then inputs.configInputs-stable.nixerus else inputs.configInputs.nixerus; - configInputs = if stable then inputs.configInputs-stable else inputs.configInputs; - path = materusFlake.selfPath; - hostPath = materusFlake.selfPath + "/configurations/host/${host}"; - isHm = false; - }; - in - (nixosSystem { - specialArgs = { inherit materusCfg; }; - system = arch; - modules = [ - ./${host} - profiles.osProfile - materusCfg.configInputs.sops-nix.nixosModules.sops - (if hmAsModule then hm.nixosModules.home-manager else { }) - (if hmAsModule then - { - home-manager.backupFileExtension = "hm-backup"; - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.sharedModules = [ - materusCfg.configInputs.plasma-manager.homeManagerModules.plasma-manager - materusCfg.configInputs.sops-nix.homeManagerModules.sops - ]; - home-manager.users = (builtins.foldl' (a: b: a // b) { } (builtins.map - (user: { - ${user} = ({ ... }: - { - imports = [ - (materusFlake.selfPath + "/configurations/shared/home/${user}") - (materusFlake.selfPath + "/configurations/host/${host}/home/${user}") - profiles.homeProfile - ]; - }); - }) - hmUsers)); - home-manager.extraSpecialArgs = { materusCfg = materusCfg // { isHm = true; }; }; - } else { }) - - ] ++ extraModules; - }) // { inherit materusCfg; }; -in -{ - materusPC = makeSystem { host = "materusPC"; stable = true; }; - flamaster = makeSystem { host = "flamaster"; stable = true; }; - valkyrie = makeSystem { host = "valkyrie"; stable = true; }; - waffentrager = makeSystem { host = "waffentrager"; stable = true; arch = "aarch64-linux"; }; - - Old-materusPC = makeSystem { host = "Old-materusPC"; stable = true; }; -} diff --git a/configurations/host/flamaster/configuration.nix b/configurations/host/flamaster/configuration.nix deleted file mode 100644 index a8c39ac..0000000 --- a/configurations/host/flamaster/configuration.nix +++ /dev/null @@ -1,191 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, lib, pkgs, materusArg, ... }: - -{ - imports = - [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - - networking.wireless.iwd.enable = true; - services.logind.lidSwitch = "ignore"; - services.logind.lidSwitchExternalPower = "ignore"; - programs.steam = { - enable = true; - remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play - dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server - }; - - programs.tmux = { - enable = true; - clock24 = true; - }; - programs.java = { - enable = true; - package = pkgs.graalvm-ce; - binfmt = true; - }; - # Bootloader. - boot.loader.grub = { - enable = true; - efiSupport = true; - device = "nodev"; - useOSProber = true; - gfxmodeEfi = pkgs.lib.mkDefault "1920x1080"; - gfxmodeBios = pkgs.lib.mkDefault "1920x1080"; - #efiInstallAsRemovable = true; - }; - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.efi.efiSysMountPoint = "/boot/efi"; - - networking.hostName = "flamaster"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - networking.networkmanager.enable = true; - networking.networkmanager.wifi.backend = "iwd"; - # Set your time zone. - time.timeZone = "Europe/Warsaw"; - - # Select internationalisation properties. - i18n.defaultLocale = "pl_PL.utf8"; - - # Enable the X11 windowing system. - services.xserver.enable = true; - - services.xserver.videoDrivers = [ "nvidia" ]; - hardware.opengl.enable = true; - hardware.nvidia.prime = { - offload.enable = true; - - # Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA - intelBusId = "PCI:0:2:0"; - - # Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA - nvidiaBusId = "PCI:1:0:0"; - }; - - - # Enable the KDE Plasma Desktop Environment. - services.xserver.displayManager.sddm.enable = true; - services.xserver.desktopManager.plasma5.enable = true; - - # Configure keymap in X11 - services.xserver = { - layout = "pl"; - xkbVariant = ""; - }; - - # Configure console keymap - console.keyMap = "pl2"; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; - }; - - # Enable touchpad support (enabled default in most desktopManager). - services.libinput.enable = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.materus = { - isNormalUser = true; - description = "Mateusz Słodkowicz"; - extraGroups = [ "networkmanager" "wheel" ]; - openssh.authorizedKeys.keyFiles = [ ("${materusArg.cfg.path}" + "/extraFiles/keys/ssh/materus.pub") ]; - packages = with pkgs; [ - kate - ]; - shell = pkgs.zsh; - }; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - wget - util-linux - killall - pciutils - lshw - steamcmd - distrobox - - - config.materus.profile.packages.firefox - config.programs.java.package - - - ]; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - services.openssh.enable = true; - - # Open ports in the firewall. - networking.firewall.allowedTCPPorts = [ 22 27015 25565 24454 8123 24800 ]; - networking.firewall.allowedTCPPortRanges = [{ from = 16262; to = 16272; }]; - networking.firewall.allowedUDPPorts = [ 22 16261 16262 8766 8767 25565 24454 8123 24800 ]; - # Or disable the firewall altogether. - networking.firewall.enable = true; - - networking.networkmanager.settings = { - connectivity = { uri = lib.mkDefault "http://nmcheck.gnome.org/check_network_status.txt"; }; - }; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; # Did you read the comment? - - - programs.neovim.enable = true; - programs.neovim.vimAlias = true; - programs.neovim.viAlias = true; - - services.flatpak.enable = true; - xdg.portal.enable = true; - - virtualisation.podman.enable = true; - virtualisation.podman.dockerCompat = true; - virtualisation.podman.enableNvidia = true; - virtualisation.podman.dockerSocket.enable = true; - } diff --git a/configurations/host/flamaster/default.nix b/configurations/host/flamaster/default.nix deleted file mode 100644 index 6950019..0000000 --- a/configurations/host/flamaster/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - imports = - [ - # Include the results of the hardware scan. - ./configuration.nix - ]; - materus.profile.nix.enable = true; - materus.profile.steam.enable = true; - - -} diff --git a/configurations/host/flamaster/hardware-configuration.nix b/configurations/host/flamaster/hardware-configuration.nix deleted file mode 100644 index 309d817..0000000 --- a/configurations/host/flamaster/hardware-configuration.nix +++ /dev/null @@ -1,67 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_usb_sdmmc" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { - device = "/dev/disk/by-label/NixOS_Root_Laptop"; - fsType = "btrfs"; - options = [ "subvol=@" "noatime" "ssd" "space_cache=v2" "compress=zstd" ]; - }; - fileSystems."/nix" = - { - device = "/dev/disk/by-label/NixOS_Root_Laptop"; - fsType = "btrfs"; - options = [ "subvol=@nix" "noatime" "compress=zstd" "ssd" "space_cache=v2" ]; - }; - fileSystems."/boot" = - { - device = "/dev/disk/by-label/NixOS_Root_Laptop"; - fsType = "btrfs"; - options = [ "subvol=@boot" "ssd" ]; - }; - - fileSystems."/boot/efi" = - { - device = "/dev/disk/by-label/NixOS_EFI_L"; - fsType = "vfat"; - }; - - - fileSystems."/etc/nixos" = - { - device = "/materus/config/nixos-config"; - fsType = "none"; - options = [ "bind" ]; - }; - - swapDevices = [{ - device = "/var/.swapfile"; - size = 32 * 1024; - }]; - - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/configurations/host/flamaster/home/materus/default.nix b/configurations/host/flamaster/home/materus/default.nix deleted file mode 100644 index 317a326..0000000 --- a/configurations/host/flamaster/home/materus/default.nix +++ /dev/null @@ -1,83 +0,0 @@ -{ config, pkgs, materusArg, lib, ... }: -{ - home.stateVersion = "23.05"; - home.homeDirectory = "/home/materus"; - - materus.profile = { - fonts.enable = lib.mkDefault true; - nixpkgs.enable = lib.mkDefault false; - enableDesktop = lib.mkDefault true; - enableTerminal = lib.mkDefault true; - enableTerminalExtra = lib.mkDefault true; - enableNixDevel = lib.mkDefault true; - - bash.enable = true; - zsh.enable = true; - editor.code.fhs.enable = true; - editor.code.fhs.packages = (ps: with ps; let llvmpkgs = llvmPackages_16; in [ - llvmpkgs.clang - llvmpkgs.llvm - llvmpkgs.bintools - llvmpkgs.lld - llvmpkgs.lldb - llvmpkgs.libllvm - llvmpkgs.libllvm.dev - - raylib - gcc - gdb - materusArg.unstable.nixd - nixfmt-rfc-style - nixpkgs-fmt - cmake - gnumake - ninja - binutils - coreutils - util-linux - openssl - openssl.dev - pkg-config - dotnet-sdk_8 - mono - mold - python3 - lua - gtk4.dev - gtk4 - miniaudio - SDL2.dev - SDL2 - freeglut.dev - freeglut - boost.dev - boost - glew.dev - libGL.dev - libGLU.dev - vulkan-loader.dev - xorg.xorgproto - xorg.libX11.dev - xorg.libXrandr.dev - xorg.libXrender.dev - rustup - freetype.dev - - fpc - openjdk21 - bison - flex - - ldc - dmd - dub - ]); - - }; - - home.packages = [ - pkgs.papirus-icon-theme - (materusArg.pkgs.polymc.wrap { extraJDKs = [ pkgs.graalvm-ce ]; }) - ]; - -} diff --git a/configurations/host/materusPC/audio.nix b/configurations/host/materusPC/audio.nix deleted file mode 100644 index 4b137fe..0000000 --- a/configurations/host/materusPC/audio.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ pkgs, lib, ... }: -{ - - sound.enable = true; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - audio.enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - systemWide = false; - jack.enable = true; - }; - hardware.pulseaudio.enable = false; - - environment.sessionVariables = - let - makePluginPath = format: - (lib.makeSearchPath format [ - "$HOME/.nix-profile/lib" - "/run/current-system/sw/lib" - "/etc/profiles/per-user/$USER/lib" - ]) - + ":$HOME/.${format}"; - in - { - ALSOFT_DRIVERS = "pulse"; - - DSSI_PATH = makePluginPath "dssi"; - LADSPA_PATH = makePluginPath "ladspa"; - LV2_PATH = makePluginPath "lv2"; - LXVST_PATH = makePluginPath "lxvst"; - VST_PATH = makePluginPath "vst"; - VST3_PATH = makePluginPath "vst3"; - - }; - - services.udev = { - extraRules = '' - KERNEL=="rtc0", GROUP="audio" - KERNEL=="hpet", GROUP="audio" - DEVPATH=="/devices/virtual/misc/cpu_dma_latency", OWNER="root", GROUP="audio", MODE="0660" - ''; - }; - environment.systemPackages = with pkgs; [ - openal - pulseaudio - - reaper - - yabridge - yabridgectl - - vital - odin2 - surge - fire - decent-sampler - lsp-plugins - - ]; - -} diff --git a/configurations/host/materusPC/containers/arch.nix b/configurations/host/materusPC/containers/arch.nix deleted file mode 100644 index 7681e6c..0000000 --- a/configurations/host/materusPC/containers/arch.nix +++ /dev/null @@ -1,135 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -let - mainMirror = "https://ftp.icm.edu.pl/pub/Linux/dist/archlinux"; - extraMirrors = [ ]; - getty = [ - 6 - 7 - ]; - ttys = [ - 6 - 7 - 8 - ] ++ getty; - - startPkgs = lib.strings.concatStringsSep " " [ - "base" - "base-devel" - "dbus" - "less" - "nano" - "bash-completion" - ]; - scripts = { - preStart = pkgs.writeShellScript "arch-pre-start" '' - if [ ! -d "/var/lib/machines/archlinux" ]; then - export PATH=''${PATH:+''${PATH}:}${ - lib.strings.makeBinPath ( - with pkgs; - [ - wget - coreutils-full - gnutar - zstd - ] - ) - } - - ARCH_IMAGE=$(mktemp) - trap 'rm $ARCH_IMAGE' EXIT - - wget "${mainMirror}/iso/latest/archlinux-bootstrap-x86_64.tar.zst" -O $ARCH_IMAGE - mkdir -p /var/lib/machines/archlinux - trap 'rm -rf /var/lib/machines/archlinux' ERR - - tar -xaf $ARCH_IMAGE -C "/var/lib/machines/archlinux" --strip-components=1 --numeric-owner - printf 'Server = %s/$repo/os/$arch\n' "${mainMirror}" > /var/lib/machines/archlinux/etc/pacman.d/mirrorlist - rm "/var/lib/machines/archlinux/etc/resolv.conf" - - [ -f "/var/lib/machines/archlinux/etc/securetty" ] && \ - printf 'pts/%d\n' $(seq 0 10) >>"/var/lib/machines/archlinux/etc/securetty" - - systemd-machine-id-setup --root="/var/lib/machines/archlinux" - systemd-nspawn -q --settings=false --system-call-filter=@sandbox -D "/var/lib/machines/archlinux" /bin/sh -c " - export PATH=/bin - touch /etc/systemd/do-not-udevadm-trigger-on-update - pacman-key --init && pacman-key --populate - pacman -Rs --noconfirm arch-install-scripts - pacman -Sy --noconfirm --needed ${startPkgs} - pacman -Syu --noconfirm - - systemctl disable getty@tty1.service - ${ - lib.strings.concatStringsSep "\n" ( - lib.lists.forEach getty (x: "systemctl enable getty@tty${builtins.toString x}.service") - ) - } - - - " - fi - ''; - }; -in -{ - systemd.nspawn."archlinux" = { - enable = true; - execConfig = { - Boot = true; - SystemCallFilter = [ "@known" ]; - Timezone = "bind"; - Capability = "all"; - PrivateUsers = "no"; - ResolvConf = "copy-host"; - }; - - filesConfig = { - BindReadOnly = [ - "/nix" - - "/run/current-system" - "/run/booted-system" - "/run/opengl-driver" - "/run/opengl-driver-32" - - ]; - Bind = [ - "/:/run/host-root" - - "/run/udev" - - "/dev/input" - "/dev/shm" - "/dev/kfd" - "/dev/dri" - "/dev/tty" - "/dev/tty0" - - "/tmp/.X11-unix" - - /materus - - ] ++ lib.lists.forEach ttys (x: "/dev/tty${builtins.toString x}"); - }; - networkConfig = { - Private = false; - }; - }; - systemd.services."systemd-nspawn@archlinux" = { - enable = true; - preStart = "${scripts.preStart}"; - overrideStrategy = "asDropin"; - serviceConfig = { - DeviceAllow = [ - "char-tty rwm" - "char-input rwm" - "char-drm rwm" - ]; - }; - }; -} diff --git a/configurations/host/materusPC/containers/default.nix b/configurations/host/materusPC/containers/default.nix deleted file mode 100644 index e997ef4..0000000 --- a/configurations/host/materusPC/containers/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{...}: -{ - imports = [ - ./arch.nix - ]; - virtualisation.lxc.enable = true; - virtualisation.lxc.lxcfs.enable = true; - virtualisation.lxd.enable = false; - - virtualisation.waydroid.enable = true; - virtualisation.podman = { - enable = true; - dockerCompat = true; - dockerSocket.enable = true; - }; -} \ No newline at end of file diff --git a/configurations/host/materusPC/default.nix b/configurations/host/materusPC/default.nix deleted file mode 100644 index 23d59eb..0000000 --- a/configurations/host/materusPC/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - imports = - [ - - ./hardware - ./vm - ./secrets - ./containers - ./other - - ./scripts.nix - ./tmp.nix - ./network.nix - - ./audio.nix - ]; - - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - system.copySystemConfiguration = false; - system.stateVersion = "23.05"; - - - materus.profile.nix.enable = true; - materus.profile.nixpkgs.enable = true; - materus.profile.fonts.enable = true; - materus.profile.steam.enable = true; - - services.logind.extraConfig = '' - NAutoVTs=4 - ReserveVT=4 - ''; - -} diff --git a/configurations/host/materusPC/hardware/boot.nix b/configurations/host/materusPC/hardware/boot.nix deleted file mode 100644 index 76e3b0a..0000000 --- a/configurations/host/materusPC/hardware/boot.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -let - video = [ - - "video=HDMI-A-3:1920x1080@144" - "video=DP-3:1920x1080@240" - - - #"video=DP-1:1920x1080@240" - #"video=DP-2:1920x1080@240" - #"video=HDMI-A-1:1920x1080@240" - #"video=HDMI-A-2:1920x1080@240" - - - ]; - -in -{ - #Kernel - - boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_zen; - - boot.kernelParams = [ - "rcu_nocbs=${materusArg.materusPC.vmCores}" - "nohz_full=${materusArg.materusPC.vmCores}" - "vfio_iommu_type1.allow_unsafe_interrupts=1" - "pcie_acs_override=downstream,multifunction" /*"pci-stub.ids=1002:744c"*/ - "nox2apic" - "nvme_core.default_ps_max_latency_us=0" - "nvme_core.io_timeout=255" - "nvme_core.max_retries=10" - "nvme_core.shutdown_timeout=10" - "amd_iommu=on" - "amdgpu.ppfeaturemask=0xffffffff" - "iommu=pt" - "psi=1" - ] ++ video; - boot.kernelModules = [ "pci-stub" "amdgpu" "i2c_dev" "kvm_amd" "vfio" "vfio_iommu_type1" "vfio-pci" ]; - boot.extraModprobeConfig = '' - options kvm_amd nested=1 avic=1 npt=1 sev=0 - options vfio_iommu_type1 allow_unsafe_interrupts=1 - ''; - boot.kernel.sysctl = { - "vm.max_map_count" = 1000000; - "vm.swappiness" = 10; - "net.ipv4.ip_forward"=1; - }; - - - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ "amdgpu" ]; - - boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; - - - boot.supportedFilesystems = [ "ntfs" "btrfs" "vfat" "exfat" "ext4" ]; - - boot.tmp.useTmpfs = true; - - - #bootloader - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.efi.efiSysMountPoint = "/boot/efi"; - boot.loader.grub = { - enable = true; - efiSupport = true; - device = "nodev"; - gfxmodeEfi = pkgs.lib.mkDefault "1920x1080@240"; - gfxmodeBios = pkgs.lib.mkDefault "1920x1080@240"; - useOSProber = true; - memtest86.enable = true; - }; - - boot.plymouth.enable = true; - - boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; -} diff --git a/configurations/host/materusPC/hardware/default.nix b/configurations/host/materusPC/hardware/default.nix deleted file mode 100644 index 4c8de3b..0000000 --- a/configurations/host/materusPC/hardware/default.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -{ - imports = - [ - ./filesystem.nix - ./boot.nix - - ]; - hardware.firmware = with pkgs; [ - materusArg.pkgs.amdgpu-pro-libs.firmware.vcn - materusArg.pkgs.amdgpu-pro-libs.firmware - linux-firmware - alsa-firmware - sof-firmware - ]; - - environment.variables = { - DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1 = "1"; - VK_ICD_FILENAMES = "${pkgs.mesa.drivers}/share/vulkan/icd.d/radeon_icd.x86_64.json:${pkgs.driversi686Linux.mesa.drivers}/share/vulkan/icd.d/radeon_icd.i686.json"; - AMD_VULKAN_ICD = "RADV"; - RADV_PERFTEST = "gpl,rt,sam"; - OCL_ICD_VENDORS = "${pkgs.rocmPackages.clr.icd}/etc/OpenCL/vendors/"; - }; - hardware.cpu.amd.updateMicrocode = lib.mkForce true; - - #extra - hardware.wooting.enable = true; - hardware.bluetooth.enable = true; - #Graphics - hardware.opengl.enable = true; - hardware.opengl.driSupport32Bit = true; - hardware.opengl.extraPackages = with pkgs; [ - vaapiVdpau - libvdpau-va-gl - amdvlk - vkbasalt - rocmPackages.clr.icd - rocmPackages.clr - materusArg.pkgs.amdgpu-pro-libs.vulkan - materusArg.pkgs.amdgpu-pro-libs.amf - ]; - hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ - vaapiVdpau - vkbasalt - pkgs.driversi686Linux.amdvlk - materusArg.pkgs.i686Linux.amdgpu-pro-libs.vulkan - libvdpau-va-gl - ]; - /*services.udev.extraRules = '' - - #GPU bar size - ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1002", ATTR{device}=="0x744c", ATTR{resource0_resize}="15" - ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1002", ATTR{device}=="0x744c", ATTR{resource2_resize}="8" - '';*/ - - - #Trim - services.fstrim = { - enable = true; - interval = "weekly"; - }; - -} diff --git a/configurations/host/materusPC/hardware/filesystem.nix b/configurations/host/materusPC/hardware/filesystem.nix deleted file mode 100644 index 14f76f7..0000000 --- a/configurations/host/materusPC/hardware/filesystem.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - zramSwap = { - enable = true; - memoryPercent = 25; - }; - - swapDevices = [ - { - label = "NixOS_Swap"; - } - ]; - - - fileSystems."/etc/nixos" = - { - device = "/materus/config/nixos-config"; - fsType = "none"; - options = [ "bind" ]; - depends = [ "/materus" ]; - }; - - - fileSystems."/materus" = - { - device = "/dev/disk/by-label/NixOS_Root"; - fsType = "btrfs"; - options = [ "subvol=@materus" "noatime" "compress=zstd" "ssd" "space_cache=v2" ]; - neededForBoot = true; - }; - - fileSystems."/" = - { - device = "/dev/disk/by-label/NixOS_Root"; - fsType = "btrfs"; - options = [ "subvol=@" "noatime" "ssd" "space_cache=v2" "compress=zstd" ]; - }; - - fileSystems."/nix" = - { - device = "/dev/disk/by-label/NixOS_Root"; - fsType = "btrfs"; - options = [ "subvol=@nix" "noatime" "compress=zstd" "ssd" "space_cache=v2" ]; - }; - - fileSystems."/home" = - { - device = "/dev/disk/by-label/NixOS_Root"; - fsType = "btrfs"; - options = [ "subvol=@home" "noatime" "compress=zstd" "ssd" "space_cache=v2" ]; - }; - - fileSystems."/boot" = - { - device = "/dev/disk/by-label/NixOS_Root"; - fsType = "btrfs"; - options = [ "subvol=@boot" "ssd" ]; - }; - - - - fileSystems."/boot/efi" = - { - device = "/dev/disk/by-label/NixOS_EFI"; - fsType = "vfat"; - }; - -} diff --git a/configurations/host/materusPC/home/materus/default.nix b/configurations/host/materusPC/home/materus/default.nix deleted file mode 100644 index 1462705..0000000 --- a/configurations/host/materusPC/home/materus/default.nix +++ /dev/null @@ -1,164 +0,0 @@ -{ pkgs, materusArg, lib, ... }: -{ - imports = [ - ./plasma.nix - ]; - home.stateVersion = "23.05"; - home.homeDirectory = "/home/materus"; - - programs.git.signing.signByDefault = true; - - xdg.userDirs.enable = true; - materus.profile = { - - fonts.enable = lib.mkDefault true; - nixpkgs.enable = lib.mkDefault false; - enableDesktop = lib.mkDefault true; - enableTerminal = lib.mkDefault true; - enableTerminalExtra = lib.mkDefault true; - enableNixDevel = lib.mkDefault true; - editor.emacs.enable = true; - editor.code.fhs.enable = true; - editor.code.fhs.packages = (ps: with ps; let llvmpkgs = llvmPackages_18; in [ - llvmpkgs.clang - llvmpkgs.llvm - llvmpkgs.bintools - llvmpkgs.lld - llvmpkgs.lldb - llvmpkgs.libllvm - llvmpkgs.mlir - llvmpkgs.libllvm.dev - - fpc - xmake - raylib - gcc - gdb - materusArg.unstable.nixd - nixfmt-rfc-style - nixpkgs-fmt - cmake - gnumake - ninja - binutils - coreutils - util-linux - openssl - openssl.dev - pkg-config - dotnet-sdk_8 - mono - mold - python3 - lua - gtk4.dev - gtk4 - glib - glib.dev - miniaudio - SDL2.dev - SDL2 - freeglut.dev - freeglut - boost.dev - boost - glew.dev - libGL.dev - libGLU.dev - vulkan-loader.dev - vulkan-headers - xorg.xorgproto - xorg.libX11.dev - xorg.libXrandr.dev - xorg.libXrender.dev - rustup - freetype.dev - - fpc - gradle - bison - flex - - ldc - dmd - dub - ]); - - - - }; - - home.packages = [ - materusArg.pkgs.ffmpeg_7-amf-full - (materusArg.pkgs.polymc-qt5.wrap { extraJDKs = [ pkgs.graalvm-ce ]; extraLibs = [ ]; }) - pkgs.git-crypt - pkgs.obsidian - ]; - - programs.obs-studio = { - enable = true; - plugins = with pkgs.obs-studio-plugins; [ - wlrobs - input-overlay - - obs-source-switcher - obs-tuna - obs-vaapi - obs-vkcapture - obs-gstreamer - obs-backgroundremoval - obs-multi-rtmp - obs-pipewire-audio-capture - ]; - }; - - home.file.".gradle/gradle.properties".text = '' - org.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_17_HOME,JAVA_21_HOME - org.gradle.home=${pkgs.jdk21} - ''; - - xdg.desktopEntries.brave-browser = - let - env = lib.concatStringsSep " " [ - ]; - script = pkgs.writeShellScript "brave" '' - ${env} brave "$@" - ''; - - in - { - name = "Brave Web Browser"; - genericName = "Przeglądarka WWW"; - comment = "Skorzystaj z internetu"; - exec = "${script} %U"; - icon = "brave-browser"; - terminal = false; - categories = [ "Application" "Network" "WebBrowser" ]; - mimeType = [ - "application/pdf" - "application/rdf+xml" - "application/rss+xml" - "application/xhtml+xml" - "application/xhtml_xml" - "application/xml" - "image/gif" - "image/jpeg" - "image/png" - "image/webp" - "text/html" - "text/xml" - "x-scheme-handler/http" - "x-scheme-handler/https" - "x-scheme-handler/ipfs" - "x-scheme-handler/ipns" - ]; - actions.new-windows = { - exec = "${script}"; - name = "Nowe okno"; - }; - actions.new-private-windows = { - exec = "${script} --incognito"; - name = "Nowe okno incognito"; - }; - }; -} diff --git a/configurations/host/materusPC/home/materus/plasma.nix b/configurations/host/materusPC/home/materus/plasma.nix deleted file mode 100644 index c966b98..0000000 --- a/configurations/host/materusPC/home/materus/plasma.nix +++ /dev/null @@ -1,139 +0,0 @@ -{ pkgs, materusArg, ... }: -{ - home.packages = [ - pkgs.papirus-icon-theme - (pkgs.nerdfonts.override { fonts = [ "Hack" ]; }) - ]; - - xdg.dataFile."konsole/materus-linux.keytab".source = ("${materusArg.cfg.path}" + "/extraFiles/config/plasma/materus-linux.keytab"); - programs.konsole = { - enable = true; - profiles = { - materus = { - colorScheme = "Breeze"; - font.name = "Hack Nerd Font"; - extraConfig = { - Keyboard = { - KeyBindings="materus-linux"; - }; - Scrolling = { - HistoryMode = 2; - }; - }; - }; - }; - extraConfig = { - KonsoleWindow = { - RememberWindowSize = "false"; - }; - MainWindow = { - MenuBar = "Enabled"; - }; - - "Desktop Entry" = { - DefaultProfile = "materus.profile"; - }; - }; - }; - programs.plasma = { - enable = true; - overrideConfig = false; - - - - workspace = { - lookAndFeel = "org.kde.breezedark.desktop"; - iconTheme = "Papirus-Dark"; - }; - - shortcuts = { - "kwin"."Grid View" = "Meta+Alt+Tab"; - "kwin"."Overview" = "Meta+Tab"; - "services/org.kde.kcalc.desktop"."_launch" = [ ]; - }; - spectacle.shortcuts = { - captureActiveWindow = "Meta+Print"; - captureCurrentMonitor = "Print"; - captureEntireDesktop = "Shift+Print"; - captureRectangularRegion = "Meta+S"; - launchWithoutCapturing = "Meta+Shift+S"; - launch = "Meta+Alt+S"; - }; - - kwin = { - effects = { - wobblyWindows.enable = true; - }; - }; - - input = { - keyboard = { - options = [ "caps:none" ]; - }; - }; - kscreenlocker = { - autoLock = false; - }; - - panels = [ - { - location = "left"; - screen = 0; - widgets = [ - { - name = "org.kde.plasma.kickerdash"; - config = { - General = { - icon = "nix-snowflake-white"; - customButtonImage="nix-snowflake-white"; - alphaSort = true; - }; - }; - - } - "org.kde.plasma.icontasks" - "org.kde.plasma.marginsseparator" - "org.kde.plasma.systemtray" - { - name = "org.kde.plasma.digitalclock"; - config = { - Appearance = { - showDate = "false"; - }; - }; - } - ]; - - } - - ]; - configFile = { - "kwinrc"."Effect-overview"."BorderActivate" = 9; - - "klaunchrc"."BusyCursorSettings"."Timeout" = 1; - "klaunchrc"."FeedbackStyle"."TaskbarButton" = false; - - "kcminputrc"."Libinput/9610/46/SINOWEALTH Wired Gaming Mouse"."PointerAccelerationProfile" = 1; - "kcminputrc"."Libinput/9610/47/SINOWEALTH 2.4G Wireless Receiver"."PointerAccelerationProfile" = 1; - - "spectaclerc"."ImageSave"."imageFilenameTemplate" = "--
.__-.materusPC"; - "spectaclerc"."VideoSave"."videoFilenameTemplate" = "--
.__-.materusPC"; - "spectaclerc"."ImageSave"."preferredImageFormat" = "WEBP"; - "spectaclerc"."ImageSave"."translatedScreenshotsFolder" = "Zrzuty ekranu"; - "spectaclerc"."VideoSave"."translatedScreencastsFolder" = "Nagranie ekranu"; - - "dolphinrc"."General"."RememberOpenedTabs" = false; - - "kwalletrc"."Wallet"."Enabled" = false; - - }; - dataFile = { - "dolphin/view_properties/global/.directory"."Settings"."HiddenFilesShown" = true; - }; - - resetFiles = [ - "spectaclerc" - ]; - - }; -} diff --git a/configurations/host/materusPC/network.nix b/configurations/host/materusPC/network.nix deleted file mode 100644 index a709151..0000000 --- a/configurations/host/materusPC/network.nix +++ /dev/null @@ -1,79 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -{ - sops.templates."networkmanager.env".content = '' - WIREGUARD_PRIVATEKEY="${config.sops.placeholder.wireguard}" - ''; - - networking.firewall = { - logReversePathDrops = false; - # wireguard trips rpfilter up - extraCommands = '' - ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport ${materusArg.wireguard.port} -j RETURN - ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport ${materusArg.wireguard.port} -j RETURN - ''; - extraStopCommands = '' - ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport ${materusArg.wireguard.port} -j RETURN || true - ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport ${materusArg.wireguard.port} -j RETURN || true - ''; - }; - - networking.useDHCP = lib.mkDefault true; - networking.hostName = "materusPC"; - networking.wireless.iwd.enable = true; - networking.networkmanager.enable = true; - #networking.networkmanager.wifi.backend = "iwd"; - networking.firewall.enable = true; - networking.firewall.allowedTCPPorts = [ - 24800 5900 5357 4656 8080 9943 9944 - 22000 config.services.syncthing.relay.statusPort config.services.syncthing.relay.port # Syncthing - ]; - networking.firewall.allowedUDPPorts = [ (lib.strings.toInt materusArg.wireguard.port) - 24800 5900 3702 4656 6000 9943 9944 - 22000 21027 # Syncthing - ]; - networking.networkmanager.settings = { - connectivity = { - uri = "http://nmcheck.gnome.org/check_network_status.txt"; - }; - }; - - - networking.networkmanager.ensureProfiles.environmentFiles = [ - config.sops.templates."networkmanager.env".path - ]; - networking.networkmanager.ensureProfiles.profiles = { - wg0 = { - connection = { - id = "wg0"; - type = "wireguard"; - interface-name = "wg0"; - }; - wireguard = { - private-key = "$WIREGUARD_PRIVATEKEY"; - }; - "wireguard-peer.${materusArg.wireguard.pubKeys.valkyrie}" = { - endpoint = "${materusArg.ips.valkyrie}:${materusArg.wireguard.port}"; - allowed-ips = "${materusArg.ip-masks.wireguard.general};"; - persistent-keepalive = "20"; - }; - ipv4 = { - address1 = "${materusArg.ips.wireguard.materusPC}/23"; - dns = "${materusArg.ips.wireguard.valkyrie};"; - method = "manual"; - never-default = "true"; - }; - ipv6 = { - addr-gen-mode = "stable-privacy"; - method = "disabled"; - }; - proxy = { }; - }; - }; - services = { - syncthing = { - enable = true; - user = "materus"; - dataDir = "/home/materus"; - }; - }; -} diff --git a/configurations/host/materusPC/other/apps.nix b/configurations/host/materusPC/other/apps.nix deleted file mode 100644 index cc801b7..0000000 --- a/configurations/host/materusPC/other/apps.nix +++ /dev/null @@ -1,139 +0,0 @@ -{ - config, - pkgs, - materusArg, - ... -}: -{ - - services.jackett.enable = true; - programs.nix-ld.enable = true; - programs.nix-ld.libraries = with pkgs; [ - - ]; - - environment.systemPackages = with pkgs; [ - #(pkgs.lutris.override { extraLibraries = pkgs: with pkgs; [ pkgs.samba pkgs.jansson pkgs.tdb pkgs.libunwind pkgs.libusb1 pkgs.gnutls pkgs.gtk3 pkgs.pango ]; }) - materusArg.pkgs.amdgpu-pro-libs.prefixes - (pkgs.bottles.override { - extraPkgs = pkgs: [ - pkgs.libsForQt5.breeze-qt5 - pkgs.kdePackages.breeze-gtk - pkgs.nss_latest - ]; - extraLibraries = pkgs: [ - pkgs.samba - pkgs.jansson - pkgs.tdb - pkgs.libunwind - pkgs.libusb1 - pkgs.gnutls - pkgs.gtk3 - pkgs.pango - ]; - }) - glibc - glib - gtk3 - gtk4 - gsettings-desktop-schemas - kdePackages.dolphin - vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - vlc - vkbasalt-cli - - patchelf - killall - util-linux - xorg.xhost - nix-top - - gitFull - curl - wget - - config.programs.java.package - - nss_latest - - pciutils - - (aspellWithDicts ( - ds: with ds; [ - en - en-computers - en-science - pl - ] - )) - steamtinkerlaunch - distrobox - # WebP support - libwebp - webp-pixbuf-loader - - # Compression - p7zip - unrar - bzip2 - rar - unzip - zstd - xz - zip - gzip - - tree - mc - lf - htop - nmon - iftop - iptraf-ng - mprocs - tldr - bat - ##config.materus.profile.packages.home-manager - gcr - # pgcli - # litecli - materusArg.pkgs.alvr - #zenmonitor - - nix-du - - kate - krusader - - wineWowPackages.stagingFull - winetricks - protontricks - gnupg - pinentry - pinentry-gnome3 - pinentry-curses - ncurses - monkeysphere - gparted - - virt-viewer - - inkscape - gimp - - git-crypt - - bubblewrap - bindfs - - binutils - - materusArg.unstable.qbittorrent - mkvtoolnix - nicotine-plus - picard - opusTools - aegisub - audacity - ]; -} diff --git a/configurations/host/materusPC/other/default.nix b/configurations/host/materusPC/other/default.nix deleted file mode 100644 index 59d8a21..0000000 --- a/configurations/host/materusPC/other/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: -{ - imports = [ - ./apps.nix - ./java.nix - ./users.nix - ./desktop - ]; - -} \ No newline at end of file diff --git a/configurations/host/materusPC/other/desktop/default.nix b/configurations/host/materusPC/other/desktop/default.nix deleted file mode 100644 index cdd7afa..0000000 --- a/configurations/host/materusPC/other/desktop/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: -{ - imports = [ - ./kde.nix - ./sddm.nix - - ]; - -} \ No newline at end of file diff --git a/configurations/host/materusPC/other/desktop/gnome.nix b/configurations/host/materusPC/other/desktop/gnome.nix deleted file mode 100644 index 198703c..0000000 --- a/configurations/host/materusPC/other/desktop/gnome.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - services.displayManager.defaultSession = "gnome"; - - services.xserver.desktopManager.gnome.enable = true; - services.xserver.desktopManager.gnome.sessionPath = [ pkgs.gnome.gpaste ]; - - services.gnome.gnome-online-accounts.enable = true; - services.gnome.gnome-browser-connector.enable = true; - services.gnome.core-utilities.enable = true; - services.gnome.core-shell.enable = true; - services.gnome.core-os-services.enable = true; - - programs.gnupg.agent.pinentryPackage = lib.mkForce pkgs.pinentry-gnome3; - - - programs.gnome-terminal.enable = true; - - services.udev.packages = with pkgs; [ gnome.gnome-settings-daemon ]; - services.dbus.packages = with pkgs; [ gnome2.GConf ]; - - environment.systemPackages = with pkgs; [ - - gnome3.adwaita-icon-theme - gnome3.gnome-tweaks - gnome3.gnome-color-manager - gnome3.gnome-shell-extensions - - gnomeExtensions.appindicator - gnomeExtensions.desktop-clock - gnomeExtensions.gtk4-desktop-icons-ng-ding - gnomeExtensions.compiz-windows-effect - gnomeExtensions.burn-my-windows - gnomeExtensions.user-themes - gnomeExtensions.gsconnect - - ]; -} diff --git a/configurations/host/materusPC/other/desktop/kde.nix b/configurations/host/materusPC/other/desktop/kde.nix deleted file mode 100644 index 28cb618..0000000 --- a/configurations/host/materusPC/other/desktop/kde.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - services.displayManager.defaultSession = "plasma"; - - xdg.portal.enable = true; - xdg.portal.wlr.enable = true; - xdg.portal.xdgOpenUsePortal = true; - xdg.portal.extraPortals = [ pkgs.kdePackages.xdg-desktop-portal-kde ]; - - services.desktopManager.plasma6.enable = true; - services.desktopManager.plasma6.enableQt5Integration = true; - programs.gnupg.agent.pinentryPackage = lib.mkForce pkgs.pinentry-gnome3; - environment.plasma6.excludePackages = with pkgs.kdePackages; [ kwallet kwalletmanager kwallet-pam ]; - environment.variables = { - # Old fix for black cursor on amdgpu, seems to work fine now - #KWIN_DRM_NO_AMS = "1"; - - #Fix for amdgpu crashes - KWIN_DRM_USE_MODIFIERS = "0"; - KWIN_DRM_NO_DIRECT_SCANOUT = "1"; - QT_PLUGIN_PATH = [ - "${pkgs.qt6.qtimageformats}/${pkgs.qt6.qtbase.qtPluginPrefix}" - "${pkgs.kdePackages.ffmpegthumbs}/${pkgs.qt6.qtbase.qtPluginPrefix}" - ]; - XCURSOR_THEME = "breeze_cursors"; - }; - environment.systemPackages = with pkgs; [ - kdePackages.ark - kdePackages.kcalc - ]; - programs.kdeconnect.enable = true; - materus.profile.steam.extraPkgs = [ pkgs.kdePackages.breeze pkgs.kdePackages.breeze-gtk pkgs.kdePackages.dolphin pkgs.vlc pkgs.vkbasalt-cli ]; -} diff --git a/configurations/host/materusPC/other/desktop/sddm.nix b/configurations/host/materusPC/other/desktop/sddm.nix deleted file mode 100644 index 2b05310..0000000 --- a/configurations/host/materusPC/other/desktop/sddm.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ config, pkgs, lib, ... }: -let - westonSddm = let xcfg = config.services.xserver; in pkgs.writeText "weston.ini" - '' - [core] - xwayland=false - shell=fullscreen-shell.so - - [keyboard] - keymap_model = ${builtins.toString xcfg.xkb.model}; - keymap_layout = ${builtins.toString xcfg.xkb.layout}; - keymap_variant = ${builtins.toString xcfg.xkb.variant}; - keymap_options = ${builtins.toString xcfg.xkb.options}; - - [libinput] - enable-tap = ${builtins.toString xcfg.libinput.mouse.tapping}; - left-handed = ${builtins.toString xcfg.libinput.mouse.leftHanded}; - - [output] - name=DP-3 - mode=1920x1080@240 - - [output] - name=DP-2 - mode=off - - [output] - name=HDMI-A-3 - mode=off - - ''; -in -{ - services.displayManager.sddm.enable = true; - services.displayManager.sddm.wayland.enable = true; - services.displayManager.sddm.wayland.compositor = lib.mkForce "weston"; - services.displayManager.sddm.wayland.compositorCommand = lib.concatStringsSep " " [ - "${lib.getExe pkgs.weston}" - "--shell=kiosk" - "-c ${westonSddm}" - ]; - - services.displayManager.sddm.settings = { - General = { - InputMethod = ""; - }; - Theme = { - CursorTheme = "breeze_cursors"; - CursorSize = "24"; - }; - }; -} \ No newline at end of file diff --git a/configurations/host/materusPC/other/java.nix b/configurations/host/materusPC/other/java.nix deleted file mode 100644 index 46d4f2e..0000000 --- a/configurations/host/materusPC/other/java.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ pkgs, ... }: -{ - programs = { - java.enable = true; - java.package = pkgs.jdk; - java.binfmt = true; - }; - - environment.variables = { - JAVA_8_HOME = "${pkgs.jdk8}/lib/openjdk/"; - JAVA_17_HOME = "${pkgs.jdk17}/lib/openjdk/"; - JAVA_21_HOME = "${pkgs.jdk21}/lib/openjdk/"; - }; -} diff --git a/configurations/host/materusPC/other/users.nix b/configurations/host/materusPC/other/users.nix deleted file mode 100644 index f097820..0000000 --- a/configurations/host/materusPC/other/users.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ pkgs, materusArg, config, ... }: -{ - -users.users.materus = { - isNormalUser = true; - extraGroups = [ - "audio" - "video" - "render" - "pipewire" - "wheel" - "networkmanager" - "input" - "kvm" - "libvirt-qemu" - "libvirt" - "libvirtd" - "podman" - "scanner" - "lp" - ]; - shell = pkgs.zsh; - description = "Mateusz Słodkowicz"; - openssh.authorizedKeys.keyFiles = [ ("${materusArg.cfg.path}" + "/extraFiles/keys/ssh/materus.pub") ]; - #hashedPasswordFile = config.sops.secrets."users/materus".path; - }; -} \ No newline at end of file diff --git a/configurations/host/materusPC/scripts.nix b/configurations/host/materusPC/scripts.nix deleted file mode 100644 index 52fa557..0000000 --- a/configurations/host/materusPC/scripts.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ config, pkgs, lib, ... }: -let - valkyrie-sync = pkgs.writeShellScriptBin "valkyrie-sync" '' - ${pkgs.rsync}/bin/rsync -avzrh --delete --exclude ".git*" --exclude "flake.lock" /materus/config/nixos-config materus@valkyrie:/materus/config/ && \ - ${pkgs.rsync}/bin/rsync -avzrh --delete --exclude ".git*" /materus/config/private/valkyrie materus@valkyrie:/materus/config/private - ''; - - valkyrie-flakelock = pkgs.writeShellScriptBin "valkyrie-flakelock" '' - ${pkgs.openssh}/bin/ssh materus@valkyrie "nix flake update /materus/config/nixos-config --override-input nixpkgs github:NixOS/nixpkgs/23.05 \ - --override-input home-manager github:nix-community/home-manager/release-23.05 \ - --override-input private /materus/config/private/valkyrie/flake" - ''; - - valkyrie-rebuild-boot = pkgs.writeShellScriptBin "valkyrie-rebuild-boot" '' - ${pkgs.openssh}/bin/ssh -t materus@valkyrie "sudo nixos-rebuild boot --flake /materus/config/nixos-config#valkyrie \ - --override-input private /materus/config/private/valkyrie/flake" - ''; - valkyrie-rebuild-switch = pkgs.writeShellScriptBin "valkyrie-rebuild-switch" '' - ${pkgs.openssh}/bin/ssh -t materus@valkyrie "sudo nixos-rebuild switch --flake /materus/config/nixos-config#valkyrie \ - --override-input private /materus/config/private/valkyrie/flake" - ''; - - - - flamaster-sync = pkgs.writeShellScriptBin "flamaster-sync" '' - ${pkgs.rsync}/bin/rsync -avzrh --delete --exclude ".git*" --exclude "flake.lock" /materus/config/nixos-config materus@flamaster:/materus/config/ && \ - ${pkgs.rsync}/bin/rsync -avzrh --delete --exclude ".git*" /materus/config/private/flamaster materus@flamaster:/materus/config/private - ''; - - flamaster-flakelock = pkgs.writeShellScriptBin "flamaster-flakelock" '' - ${pkgs.openssh}/bin/ssh materus@flamaster "nix flake update /materus/config/nixos-config --override-input nixpkgs github:NixOS/nixpkgs/23.05 \ - --override-input home-manager github:nix-community/home-manager/release-23.05 \ - --override-input private /materus/config/private/flamaster/flake" - ''; - - flamaster-rebuild-boot = pkgs.writeShellScriptBin "flamaster-rebuild-boot" '' - ${pkgs.openssh}/bin/ssh -t materus@flamaster "sudo nixos-rebuild boot --flake /materus/config/nixos-config#flamaster \ - --override-input private /materus/config/private/flamaster/flake" - ''; - flamaster-rebuild-switch = pkgs.writeShellScriptBin "flamaster-rebuild-switch" '' - ${pkgs.openssh}/bin/ssh -t materus@flamaster "sudo nixos-rebuild switch --flake /materus/config/nixos-config#flamaster \ - --override-input private /materus/config/private/flamaster/flake" - ''; - - -in -{ - environment.systemPackages = [ - valkyrie-rebuild-boot - valkyrie-rebuild-switch - valkyrie-sync - valkyrie-flakelock - - flamaster-rebuild-boot - flamaster-rebuild-switch - flamaster-sync - flamaster-flakelock - ]; -} diff --git a/configurations/host/materusPC/secrets/default.nix b/configurations/host/materusPC/secrets/default.nix deleted file mode 100644 index 5116f5f..0000000 --- a/configurations/host/materusPC/secrets/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ config, pkgs, lib, materusCfg, ... }: -{ - imports = - [ - - ] ++ (if (materusCfg.materusFlake.decrypted) then [ ./private ] else [ ]); - - sops.age.generateKey = false; - sops.gnupg.home = null; - sops.gnupg.sshKeyPaths = [ ]; - sops.age.sshKeyPaths = [ "/materus/root/ssh_host_ed25519_key" ]; - sops.defaultSopsFile = materusCfg.hostPath + "/secrets/secrets.yaml"; - #sops.secrets."users/materus" = { neededForUsers = true; }; - sops.secrets.wireguard = { }; - - services.openssh.hostKeys = [ - { - bits = 4096; - path = "/materus/root/ssh_host_rsa_key"; - type = "rsa"; - } - { - path = "/materus/root/ssh_host_ed25519_key"; - type = "ed25519"; - } - ]; -} diff --git a/configurations/host/materusPC/secrets/private/default.nix b/configurations/host/materusPC/secrets/private/default.nix deleted file mode 100644 index 1f4409d..0000000 Binary files a/configurations/host/materusPC/secrets/private/default.nix and /dev/null differ diff --git a/configurations/host/materusPC/secrets/secrets.yaml b/configurations/host/materusPC/secrets/secrets.yaml deleted file mode 100644 index 3840ce5..0000000 --- a/configurations/host/materusPC/secrets/secrets.yaml +++ /dev/null @@ -1,36 +0,0 @@ -users: - materus: ENC[AES256_GCM,data:okqSgMvdFq1BMAg+Gs725zaNbeAQIpJKSPB2Sa83i3EYimphZNBtrJLen+gQEGNq4yeTyAc9Ih/hcnr+3z+Tea/g9ffh/UC4YA==,iv:OhKoWLREAqCbtmS3Rw9nE9+PtcBLwEHimJXcj4oejRA=,tag:Ht/SQSwumnQR6E45Pl47AQ==,type:str] - root: ENC[AES256_GCM,data:vnPjK+xayk/Zk895rERYAeCzpjv5NJ7EAyK4MRDUzDbW++4Dy+UEI81v1v7w9dfpDeL+x5kOqUFO5zVVDUGfZ3yf/l8M8N8KcA==,iv:gGFGcy3K27nQxn0+7I/t0kg3nZyXeGWqysOl2auZJXo=,tag:N+LYhKpPCbI1EjEBwxuh1g==,type:str] -wireguard: ENC[AES256_GCM,data:rBkftzBcdamhP0xZB3qxfLptL8bX1qc7SdcfPNpYV67TeQs6i79+5KB/da4=,iv:22J5SZbFtYco7iSHvD2GD1bcazfGWlyEJ2isa3Ab4bI=,tag:BeUn9Srl2vyoDgK5Xv0UCg==,type:str] -sops: - kms: [] - gcp_kms: [] - azure_kv: [] - hc_vault: [] - age: - - recipient: age1fq9ckkwtgvm69w045rf9pgurnhch6ukdxejr8yxgrthn7j8vp48qvd9rkx - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBEbHZZUVF1dVJSU1NvNXVk - N3VtTm00ZHRWb082T0FkNXJncUxCU3haVmpVCk9FQkJBZnVJVFNLOThjZzlxNVF1 - b0phQ2daejRrdVhEZ2YvRHVRRU5BQlEKLS0tIGdQeDlOSzl4VDhGNURQditCWUFG - dWVzbzUyakxXUGpTQjNsYzcyVG1aRDgKXVa8tIAbmggw1vSt3NJYRLgXhbagpNrX - RNXyndPaeQXVPVXuJWmHgRCYbwPTcfAFpGwFlX2IxVLlmC914Zklhw== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-04-19T15:58:46Z" - mac: ENC[AES256_GCM,data:BLa0G3ci8EWH43UkLI2OoFJp2F9YeuKDrg6+2I/bq/lLi/YUitkJvBkA9VSIbvCyYWs/5SlEL5MayX8iiVdJ7r9bCiw+LVsWNAdaYDCafbZRW5F7KiHS5WXV3v4c201kFok7rmnRhEfKfdDxLlQ/mFHqOhupHU/qCNMTuUzJBiA=,iv:EPRoXHVMB6I16lTFJdFVAuSnMD/B55fPYtSBOQddutE=,tag:gohg+BdRlMPAQmNpRdk8sg==,type:str] - pgp: - - created_at: "2024-03-02T22:10:50Z" - enc: |- - -----BEGIN PGP MESSAGE----- - - hF4D5fSX77p80GYSAQdAvGVUu56Pd2+DMHqgIcJokyh11952nQK2eVtQNj42CAUw - NQfulNRUHX5BonsLyvXPx74bVku6Wxr80loIWoz049/xbFj4S7FyftkakY8rOUGu - 1GgBCQIQOoEFvTQB8qGbea/85fktuljXPou/WgUY6Mxd4n0dBz54f69B/NttnBGc - 7eUDKfe79Omr0o/0CVC/6SGKoiS38suV903QHeF1MXFPeOG72k4TvfF9lVlBgK8H - k4DXtzC7wm3WWg== - =eh7Z - -----END PGP MESSAGE----- - fp: 28D140BCA60B4FD1 - unencrypted_suffix: _unencrypted - version: 3.8.1 diff --git a/configurations/host/materusPC/tmp.nix b/configurations/host/materusPC/tmp.nix deleted file mode 100644 index 8df4d53..0000000 --- a/configurations/host/materusPC/tmp.nix +++ /dev/null @@ -1,157 +0,0 @@ -{ config, pkgs, materusArg, ... }: - -{ - - - programs.gamemode.enable = true; - programs.corectrl.enable = true; - - - - services.teamviewer.enable = true; - - systemd.tmpfiles.rules = [ - "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" - ]; - - services.flatpak.enable = true; - services.gvfs.enable = true; - - - services.xserver.xkb.layout = "pl"; - - - services.xserver.enable = true; - services.xserver.videoDrivers = [ "amdgpu" ]; - services.dbus.enable = true; - services.dbus.packages = [ pkgs.gcr ]; - - - - services.xserver.displayManager.startx.enable = false; - - services.xserver.exportConfiguration = true; - services.xserver.extraConfig = pkgs.lib.mkDefault '' - Section "OutputClass" - Identifier "amd-options" - Option "TearFree" "True" - Option "SWCursor" "True" - Option "VariableRefresh" "true" - Option "AsyncFlipSecondaries" "true" - Option "DRI3" "1" - MatchDriver "amdgpu" - EndSection - - ''; - - - - - services.printing.enable = true; - - services.libinput.enable = true; - - - - environment.sessionVariables = { - XDG_CACHE_HOME = "\${HOME}/.cache"; - XDG_CONFIG_HOME = "\${HOME}/.config"; - XDG_BIN_HOME = "\${HOME}/.local/bin"; - XDG_DATA_HOME = "\${HOME}/.local/share"; - QT_XKB_CONFIG_ROOT = "\${XKB_CONFIG_ROOT}"; - GTK_IM_MODULE = "fcitx"; - QT_IM_MODULE = "fcitx"; - XMODIFIERS = "@im=fcitx"; - SDL_IM_MODULE = "fcitx"; - - - MOZ_USE_XINPUT2 = "1"; - PATH = [ - "\${XDG_BIN_HOME}" - ]; - }; - environment.shellInit = '' - if ! [ -z "$DISPLAY" ]; then xhost +si:localuser:root &> /dev/null; fi; - if ! [ -z "$DISPLAY" ]; then xhost +si:localuser:$USER &> /dev/null; fi; - ''; - - i18n.inputMethod.enabled = "fcitx5"; - i18n.inputMethod.fcitx5.addons = [ pkgs.kdePackages.fcitx5-configtool pkgs.fcitx5-lua pkgs.fcitx5-mozc pkgs.fcitx5-gtk pkgs.kdePackages.fcitx5-qt ]; - - - - services.pcscd.enable = true; - - services.samba-wsdd.enable = true; - services.samba-wsdd.openFirewall = true; - services.samba = { - enable = true; - package = pkgs.sambaFull; - securityType = "user"; - openFirewall = true; - extraConfig = '' - workgroup = WORKGROUP - server string = smbmaterus - netbios name = smbmaterus - security = user - hosts allow = 192.168.122. 127.0.0.1 localhost - hosts deny = 0.0.0.0/0 - guest account = nobody - map to guest = bad user - allow insecure wide links = yes - ''; - shares = { - windows = { - path = "/materus/data/VM/windows_shared"; - browseable = "yes"; - "read only" = "no"; - "guest ok" = "no"; - "create mask" = "0644"; - "directory mask" = "0755"; - "force user" = "materus"; - "force group" = "users"; - "follow symlinks" = "yes"; - "wide links" = "yes"; - }; - }; - }; - - programs.gnupg.agent = { - enable = true; - enableSSHSupport = false; - enableBrowserSocket = true; - - }; - programs.ssh.startAgent = true; - services.openssh.enable = true; - services.openssh.settings.PermitRootLogin = "no"; - services.openssh.settings.PasswordAuthentication = false; - services.openssh.openFirewall = true; - - services.sunshine = { - enable = true; - capSysAdmin = true; - openFirewall = true; - autoStart = false; - }; - - hardware.sane.enable = true; - hardware.sane.extraBackends = [ pkgs.hplipWithPlugin ]; - - environment.enableAllTerminfo = true; - environment.pathsToLink = [ "/share/zsh" "/share/bash-completion" "/share/fish" ]; - environment.shells = with pkgs; [ zsh bashInteractive fish ]; - programs = { - fish.enable = true; - command-not-found.enable = false; - dconf.enable = true; - }; - - materus.profile.browser.enable = true; - - - services.davfs2.enable = true; - - - -} diff --git a/configurations/host/materusPC/vm/default.nix b/configurations/host/materusPC/vm/default.nix deleted file mode 100644 index a9df763..0000000 --- a/configurations/host/materusPC/vm/default.nix +++ /dev/null @@ -1,85 +0,0 @@ -{ config, pkgs, ... }: -{ - imports = [ - ./win-vfio - ]; - materus.materusArg.materusPC = { - allCores = "0-31"; - allCoresMask = "ffffffff"; - hostCores = "0-7,16-23"; - hostCoresMask = "00ff00ff"; - vmCores = "8-15,24-31"; - vmCoresMask = "ff00ff00"; - }; - systemd.mounts = [ - { - where = "/dev/hugepages"; - enable = false; - } - { - where = "/dev/hugepages/hugepages-2048kB"; - enable = true; - what = "hugetlbfs"; - type = "hugetlbfs"; - options = "pagesize=2M"; - requiredBy = [ "basic.target" ]; - } - { - where = "/dev/hugepages/hugepages-1048576kB"; - enable = true; - what = "hugetlbfs"; - type = "hugetlbfs"; - options = "pagesize=1G"; - requiredBy = [ "basic.target" ]; - } - ]; - - virtualisation.libvirtd = { - enable = true; - onBoot = "ignore"; - onShutdown = "shutdown"; - qemu.ovmf.enable = true; - qemu.ovmf.packages = [ pkgs.OVMFFull.fd ]; - qemu.runAsRoot = true; - qemu.swtpm.enable = true; - qemu.package = pkgs.qemu_full; - }; - - virtualisation.spiceUSBRedirection.enable = true; - - environment.systemPackages = with pkgs; [ - virtiofsd - config.virtualisation.libvirtd.qemu.package - looking-glass-client - virt-manager - libguestfs-with-appliance - ]; - - systemd.services.libvirtd = { - path = - let - env = pkgs.buildEnv { - name = "qemu-hook-env"; - paths = with pkgs; [ - bash - libvirt - kmod - systemd - ripgrep - sd - coreutils - sudo - su - killall - procps - util-linux - bindfs - qemu-utils - psmisc - procps - ]; - }; - in - [ env ]; - }; -} diff --git a/configurations/host/materusPC/vm/win-vfio/default.nix b/configurations/host/materusPC/vm/win-vfio/default.nix deleted file mode 100644 index 610c5cc..0000000 --- a/configurations/host/materusPC/vm/win-vfio/default.nix +++ /dev/null @@ -1,209 +0,0 @@ -{ config, pkgs, materusArg, ... }: -let - bar0_guest="15"; - bar2_guest="8"; - bar0_host="15"; - bar2_host="8"; - - VM_UUID = "ad2632db-0da0-4204-98b3-0592a185ebd0"; - - startedHook = '' - QEMU_PID=$(ps aux | grep qemu-system-x86_64 | grep "${VM_UUID}" | tr -s ' ' | cut -d " " -f 2) - - for pid in $(cat /sys/fs/cgroup/cpu/machine.slice/machine-qemu*$1.scope/libvirt/vcpu*/tasks); do - renice -n "-15" -p "$pid"; - done - renice -n "-10" -p "$QEMU_PID"; - - echo "${materusArg.materusPC.hostCoresMask}" > /proc/irq/default_smp_affinity - for irq in /proc/irq/[0-9]*/smp_affinity; do - if [ $(cat $irq) = "${materusArg.materusPC.allCoresMask}" ]; then - echo "${materusArg.materusPC.hostCoresMask}" > $irq 2> /dev/null - fi; - done; - for irq in $(cat /proc/interrupts | grep vfio | cut -d ":" -f 1); do - echo "${materusArg.materusPC.vmCoresMask}" > /proc/irq/$irq/smp_affinity; - done - - - ''; - startHook = /*'' - - - # Debugging - exec 19>/home/materus/startlogfile - BASH_XTRACEFD=19 - set -x - - exec 3>&1 4>&2 - trap 'exec 2>&4 1>&3' 0 1 2 3 - exec 1>/home/materus/startlogfile.out 2>&1 - '' - +*/ - '' - systemctl stop windows-share-mount.service - - # Make sure nothing renders on gpu to prevent "sysfs: cannot create duplicate filename" after rebinding to amdgpu - chmod 0 /dev/dri/by-path/pci-$VIRSH_GPU_VIDEO-render - chmod 0 /dev/dri/by-path/pci-$VIRSH_GPU_VIDEO-card - fuser -k /dev/dri/by-path/pci-$VIRSH_GPU_VIDEO-render - pkill Xwayland - - # Seems to fix reset bug for 7900 XTX - echo "0" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/d3cold_allowed" - - ##################################################################### - # Weird bug on kernel 6.7+, after changing bar sizes and binding to vfio driver, performance after returning to host will be lower than expected - # binding to amdgpu after changing bar sizes and binding after it to vfio will work as expected. - # I could skip changing bar sizes since I'm able to use full bar, but keeping it just in case - echo ''$VIRSH_GPU_VIDEO > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/driver/unbind" - sleep 1s - echo "${bar0_host}" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource0_resize" - echo "${bar2_host}" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource2_resize" - - echo ''$VIRSH_GPU_VIDEO > /sys/bus/pci/drivers/amdgpu/bind - - sleep 1s - - chmod 0 /dev/dri/renderD128 - fuser -k /dev/dri/renderD128 - ##################################################################### - - echo ''$VIRSH_GPU_VIDEO > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/driver/unbind" - echo ''$VIRSH_GPU_AUDIO > "/sys/bus/pci/devices/''${VIRSH_GPU_AUDIO}/driver/unbind" - - echo "${bar0_guest}" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource0_resize" - echo "${bar2_guest}" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource2_resize" - - sync - echo "3" > /proc/sys/vm/drop_caches - sync - echo "1" > /proc/sys/vm/compact_memory - - - - - systemctl set-property --runtime -- user.slice AllowedCPUs=${materusArg.materusPC.hostCores} - systemctl set-property --runtime -- system.slice AllowedCPUs=${materusArg.materusPC.hostCores} - systemctl set-property --runtime -- init.scope AllowedCPUs=${materusArg.materusPC.hostCores} - echo "${materusArg.materusPC.hostCoresMask}" > /sys/bus/workqueue/devices/writeback/cpumask - echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor - - sysctl vm.stat_interval=120 - sysctl -w kernel.watchdog=0 - - - - - - ''; - stopHook = '' - - # Debugging - # exec 19>/home/materus/stoplogfile - # BASH_XTRACEFD=19 - # set -x - - # exec 3>&1 4>&2 - # trap 'exec 2>&4 1>&3' 0 1 2 3 - # exec 1>/home/materus/stoplogfile.out 2>&1 - echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor - - sysctl vm.stat_interval=1 - sysctl -w kernel.watchdog=1 - echo "${materusArg.materusPC.allCoresMask}" > /proc/irq/default_smp_affinity - for irq in /proc/irq/[0-9]*/smp_affinity; do - if [ $(cat $irq) = "${materusArg.materusPC.hostCoresMask}" ] || [ $(cat $irq) = "${materusArg.materusPC.vmCoresMask}" ]; then - echo "${materusArg.materusPC.allCoresMask}" > $irq 2> /dev/null - fi; - done; - - - sleep 1s - echo ''$VIRSH_GPU_VIDEO > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/driver/unbind" - echo ''$VIRSH_GPU_AUDIO > "/sys/bus/pci/devices/''${VIRSH_GPU_AUDIO}/driver/unbind" - - - - - echo "${bar0_host}" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource0_resize" - echo "${bar2_host}" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource2_resize" - echo "1" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/d3cold_allowed" - - - echo ''$VIRSH_GPU_VIDEO > /sys/bus/pci/drivers/amdgpu/bind - echo ''$VIRSH_GPU_AUDIO > /sys/bus/pci/drivers/snd_hda_intel/bind - - - systemctl start windows-share-mount.service - - systemctl set-property --runtime -- user.slice AllowedCPUs=${materusArg.materusPC.allCores} - systemctl set-property --runtime -- system.slice AllowedCPUs=${materusArg.materusPC.allCores} - systemctl set-property --runtime -- init.scope AllowedCPUs=${materusArg.materusPC.allCores} - echo "${materusArg.materusPC.allCoresMask}" > /sys/bus/workqueue/devices/writeback/cpumask - - ''; -in -{ - - - - - - - - - virtualisation.libvirtd.hooks.qemu = { - "windows-vfio" = pkgs.writeShellScript "windows.sh" '' - VIRSH_GPU_VIDEO="0000:03:00.0" - VIRSH_GPU_AUDIO="0000:03:00.1" - VIRSH_USB1="0000:10:00.0" - - if [ ''$1 = "windows-vfio" ]; then - if [ ''$2 = "prepare" ] && [ ''$3 = "begin" ]; then - ${startHook} - fi - - if [ ''$2 = "started" ] && [ ''$3 = "begin" ]; then - ${startedHook} - fi - - if [ ''$2 = "release" ] && [ ''$3 = "end" ]; then - ${stopHook} - fi - - fi - - - if [ ''$1 = "windows" ]; then - if [ ''$2 = "prepare" ] && [ ''$3 = "begin" ]; then - systemctl stop windows-share-mount.service - fi - - if [ ''$2 = "release" ] && [ ''$3 = "end" ]; then - systemctl start windows-share-mount.service - fi - fi - - - ''; - }; - - systemd.services.windows-share-mount = { - wantedBy = [ "multi-user.target" ]; - path = [ config.virtualisation.libvirtd.qemu.package pkgs.util-linux pkgs.kmod pkgs.coreutils ]; - serviceConfig.Type = "oneshot"; - serviceConfig.RemainAfterExit = true; - script = '' - modprobe nbd max_part=16 - sleep 1 - qemu-nbd -c /dev/nbd10 /materus/data/VM/data.qcow2 --discard=unmap - sleep 1 - mount /dev/nbd10p1 /materus/data/Windows -o uid=1000,gid=100 - ''; - preStop = '' - umount -r /dev/nbd10p1 - qemu-nbd -d /dev/nbd10 - ''; - }; -} diff --git a/configurations/host/valkyrie/default.nix b/configurations/host/valkyrie/default.nix deleted file mode 100644 index 9586372..0000000 --- a/configurations/host/valkyrie/default.nix +++ /dev/null @@ -1,176 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running `nixos-help`). - -{ pkgs, materusArg, config, ... }: - -{ - imports = - [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - ./services - ./secrets - ]; - - materus.profile.nix.enable = true; - - - - - # Use the GRUB 2 boot loader. - boot.loader.grub.enable = true; - # boot.loader.grub.efiSupport = true; - # boot.loader.grub.efiInstallAsRemovable = true; - # boot.loader.efi.efiSysMountPoint = "/boot/efi"; - # Define on which hard drive you want to install Grub. - boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only - - networking.hostName = "valkyrie"; # Define your hostname. - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - networking.networkmanager.enable = false; - - # Set your time zone. - time.timeZone = "Europe/Warsaw"; - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Select internationalisation properties. - i18n.defaultLocale = "pl_PL.UTF-8"; - console = { - font = "lat2-16"; - keyMap = "pl"; - useXkbConfig = false; # use xkbOptions in tty. - }; - - # Enable the X11 windowing system. - # services.xserver.enable = true; - - - - - # Configure keymap in X11 - # services.xserver.layout = "us"; - # services.xserver.xkbOptions = "eurosign:e,caps:escape"; - - # Enable CUPS to print documents. - # services.printing.enable = true; - - # Enable sound. - # sound.enable = true; - # hardware.pulseaudio.enable = true; - - # Enable touchpad support (enabled default in most desktopManager). - services.libinput.enable = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.materus = { - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - packages = [ - ]; - openssh.authorizedKeys.keyFiles = [ ("${materusArg.cfg.path}" + "/extraFiles/keys/ssh/materus.pub") ]; - shell = pkgs.zsh; - }; - users.users.acme.openssh.authorizedKeys.keyFiles = [ ("${materusArg.cfg.path}" + "/extraFiles/keys/ssh/waffentrager.pub") ]; - users.users.acme.shell = pkgs.scponly; - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - wget - nano - git - ]; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - services.openssh.enable = true; - services.openssh.openFirewall = false; - services.openssh.settings.PermitRootLogin = "no"; - services.openssh.settings.PasswordAuthentication = false; - - - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - networking.firewall.enable = true; - - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - # system.copySystemConfiguration = true; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It's perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; # Did you read the comment? - - - services.nginx = { - enable = true; - package = pkgs.tengine; - recommendedTlsSettings = true; - recommendedOptimisation = true; - recommendedGzipSettings = true; - }; - - services.postgresql = { - enable = true; - package = pkgs.postgresql_15; - enableTCPIP = true; - authentication = pkgs.lib.mkOverride 10 '' - local all all trust - ''; - }; - - - virtualisation.podman.autoPrune.enable = true; - virtualisation.podman.autoPrune.dates = "daily"; - virtualisation.oci-containers.backend = "podman"; - - - security.acme.acceptTerms = true; - security.acme.defaults.email = "materus+acme@podkos.pl"; - security.acme.defaults.credentialsFile = config.sops.secrets.certs.path; - security.acme.defaults.dnsResolver = "9.9.9.9:53"; - security.acme.certs."materus.pl" = { - domain = "materus.pl"; - group = "nginx"; - extraDomainNames = [ "*.materus.pl" ]; - dnsProvider = "ovh"; - }; - - security.acme.certs."podkos.pl" = { - domain = "podkos.pl"; - group = "nginx"; - extraDomainNames = [ "*.podkos.pl" ]; - dnsProvider = "ovh"; - }; - - security.acme.certs."podkos.xyz" = { - domain = "podkos.xyz"; - group = "nginx"; - extraDomainNames = [ "*.podkos.xyz" ]; - dnsProvider = "ovh"; - }; - -} - diff --git a/configurations/host/valkyrie/hardware-configuration.nix b/configurations/host/valkyrie/hardware-configuration.nix deleted file mode 100644 index bb4855d..0000000 --- a/configurations/host/valkyrie/hardware-configuration.nix +++ /dev/null @@ -1,47 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ - (modulesPath + "/profiles/qemu-guest.nix") - ]; - - boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "floppy" "sr_mod" "virtio_blk" ]; - boot.initrd.kernelModules = [ ]; - boot.kernel.sysctl = { "net.ipv4.ip_forward" = 1; "net.ipv6.conf.all.forwarding" = 1; }; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; - boot.tmp.useTmpfs = true; - - fileSystems."/" = - { - device = "/dev/disk/by-uuid/924b1a69-2256-444f-baf6-d2d9405e451d"; - fsType = "ext4"; - }; - - fileSystems."/etc/nixos" = - { - device = "/materus/config/nixos-config"; - fsType = "none"; - options = [ "bind" ]; - }; - - swapDevices = [ - { - device = "/swapfile"; - size = 4 * 1024; - } - ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = false; - networking.nameservers = [ "9.9.9.9" "1.1.1.1" "8.8.8.8" ]; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; -} diff --git a/configurations/host/valkyrie/home/materus/default.nix b/configurations/host/valkyrie/home/materus/default.nix deleted file mode 100644 index a0cd593..0000000 --- a/configurations/host/valkyrie/home/materus/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ ... }: -{ - home.stateVersion = "23.05"; - home.homeDirectory = "/home/materus"; - materus.profile = { - fonts.enable = false; - nixpkgs.enable = false; - enableDesktop = false; - enableTerminal = false; - enableTerminalExtra = false; - enableNixDevel = false; - - fish.enable = false; - bash.enable = true; - zsh.enable = true; - }; -} diff --git a/configurations/host/valkyrie/secrets/default.nix b/configurations/host/valkyrie/secrets/default.nix deleted file mode 100644 index f290f4d..0000000 --- a/configurations/host/valkyrie/secrets/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ materusCfg, ... }: -{ - imports = - [ - - ] ++ (if (materusCfg.materusFlake.decrypted) then [ ./private ] else [ ]); - - sops.age.generateKey = false; - sops.gnupg.home = null; - sops.gnupg.sshKeyPaths = [ ]; - sops.defaultSopsFile = materusCfg.hostPath + "/secrets/secrets.yaml"; - - sops.secrets.wireguard = { }; - sops.secrets.discord-token = {}; - sops.secrets.spotify-client-id = {}; - sops.secrets.spotify-client-secret = {}; - sops.secrets.youtube-api = {}; - sops.secrets.certs = {}; - sops.secrets.steamladder-api = {}; - sops.secrets.webarchive-accesskey = {}; - sops.secrets.webarchive-secretkey = {}; - - services.openssh.hostKeys = [ - { - bits = 4096; - path = "/materus/root/ssh_host_rsa_key"; - type = "rsa"; - } - { - path = "/materus/root/ssh_host_ed25519_key"; - type = "ed25519"; - } - ]; - -} diff --git a/configurations/host/valkyrie/secrets/private/default.nix b/configurations/host/valkyrie/secrets/private/default.nix deleted file mode 100644 index 01dc9e3..0000000 Binary files a/configurations/host/valkyrie/secrets/private/default.nix and /dev/null differ diff --git a/configurations/host/valkyrie/secrets/private/tosave.nix b/configurations/host/valkyrie/secrets/private/tosave.nix deleted file mode 100644 index 7094ad4..0000000 Binary files a/configurations/host/valkyrie/secrets/private/tosave.nix and /dev/null differ diff --git a/configurations/host/valkyrie/secrets/secrets.yaml b/configurations/host/valkyrie/secrets/secrets.yaml deleted file mode 100644 index 9d9477a..0000000 --- a/configurations/host/valkyrie/secrets/secrets.yaml +++ /dev/null @@ -1,41 +0,0 @@ -wireguard: ENC[AES256_GCM,data:i98U0ugxbNqWNuKR8u+mdWoSMLViHXfsWRBS1lvjb+hgGxveyzjBcagBIeY=,iv:/hF9oH2R6NSeHT/UQTlbmtx+gPX/3CJOLPNnxrzsY/g=,tag:2ub5w8uH2O1B2hoku8Kowg==,type:str] -discord-token: ENC[AES256_GCM,data:JQ/6MJvBlJpKzs/L0hFB1LPpQSfJvDdEB6YerVZyDqGo7plA0S5wORACgA88Dei1x1NGsXhYtiwT4vE9jjeCOlWXZdl1mA==,iv:BsDu1De0qLX/8VDiZ5co1q1LXxkz/Som9+hvm/67/xU=,tag:YO0wQNF3/AXbifpeAa935Q==,type:str] -spotify-client-id: ENC[AES256_GCM,data:WK7CJGw6mtIG3Jfp59cWx3ool4z1P09TvHcpbOQ2JV0=,iv:EaJ5ecXdmx0Ky+43xZITM811IOo4EisvPSyogXrJXng=,tag:NYTI4vLsWGa695CJ+TIgbw==,type:str] -spotify-client-secret: ENC[AES256_GCM,data:TnR+zLLklTfzMdR4woaZWuMVJQ9VIYsFM588GRO6WCY=,iv:cYiqw8ZdMgLeug4ptwPV3L+MeY6xIldfUBfiYg1mFD8=,tag:YDLh6BXFcBHnpdgM7e87wg==,type:str] -youtube-api: ENC[AES256_GCM,data:qmpFlFvudS9rXQfN+Th/UrPWCW0mg5GkpMucS/01AmOnlChqtojC,iv:q3bKwI2I6BNa3L9ezKCE1fWT/vZLiJ8uzug1z2z+TWA=,tag:gKG3HTz8jp2LAFh8e8O6sg==,type:str] -steamladder-api: ENC[AES256_GCM,data:m30o5atqugwqn/WbXGkUq5GvqiIKQT0kSRQCtHc1Gxk/dC3YcbDvMw==,iv:duLKl1NvysD0XMaUOkl/6nclMQB6seXcQYkGMrm7K7Y=,tag:9dw+UH10uAdca5fVdlw1Mg==,type:str] -webarchive-accesskey: ENC[AES256_GCM,data:jdKlHsZq2Dkk1BcBfUVv5g==,iv:BXCgPb/2W57PYXxRktInz1LxSEwlw6m3xnQU4TOPMeY=,tag:kK4+InaH7K4D4n1hyGaR+w==,type:str] -webarchive-secretkey: ENC[AES256_GCM,data:t7lZ1aA72BrBxaE+jXmE3w==,iv:A8PF/MyRTIluqEzzt4uCw7eNCYDXAt4iB29PSrwlVyY=,tag:6HbtcrFeFcpagjzPXOANzA==,type:str] -certs: ENC[AES256_GCM,data:ttmSNTTx51a3L2HTC8RnSphDLHO2OSyIgXQ0YpZGySTdu69mgEyhaiSi+IAXg/1AHKRjpFJgE4fhsLAiW78pNYb+Zg7aDL47YtABO99sTZrZnBxZo6k6itpZ3oClDch2ZALzoXChLroc0tUbZKwsfOwGe3pw9lOJZJT34AhV+BVoXDDLQcpQoxz23Baa8oxklecT6wpJ1u1nW+aAHw33gm41Vw==,iv:b0aNZwaRKBg+ipe5+19BowyFbCjZt52S738om6emYGo=,tag:lUqtcc4vVWKx/fnc19vj7A==,type:str] -sops: - kms: [] - gcp_kms: [] - azure_kv: [] - hc_vault: [] - age: - - recipient: age1wscr6kv8393wv0fjaux8juplaxq55znlzrp62qyteq0fauu3yg0s7d7k98 - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBSRXNLdUZaVU13alNhVGgz - aXdMb3IzNjNQcHJFV2JLNVM2SUVBa3VNZlRFCkxxd21CTWVDUkVXbzR6ZEkxbm5J - VGorSkp6a2xSdHRHcFk5T3VYVlJJa0UKLS0tIE1WdHo5eTlpNEEyN25oSjk1KzdS - d2dMUUh1RDB3UnpEdFJsNHpQRXFWemMKc41dlOapTsvH91QLNhdPbrzerPFakOiX - J/uoZDMIhsmQxgQM7Fqxr05NywhI/ZjOtJS2bayp73O57xjjMYcyNQ== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-11-18T09:01:39Z" - mac: ENC[AES256_GCM,data:CVsqff1qCcxyQ0e78ewottYKgqA2rG3j1m8X0Sb8If3qibAiBMMblc8T0doB+Fg4dVhPpbJSZdCx4JiV7sHopv2wNdguXd6Xe0L8iJqWtBeHTGTxSLvJ8UIHknak9c+JeQzZz8jAkbHYUXsc7VyeJaXoQptosz1BbE74D48Xjrg=,iv:0e+etjwabJx7PXgDUoh41Ha3aziQxBlH6QJZGG02ME0=,tag:oQIf503tmFlPoLE5d8Y24w==,type:str] - pgp: - - created_at: "2024-03-21T22:55:36Z" - enc: |- - -----BEGIN PGP MESSAGE----- - - hF4D5fSX77p80GYSAQdA667A9P/3ktuS2iEjxkv3aYMAGSu0oPGIX7dsC23VVgkw - OmcwhXxBnipcG+izbtNylXz5VonyyKHwdR2QIgkt9FEuC8lI17GHVyogTCFiP7Dj - 1GgBCQIQN4EqFdiXqzJUeeE+PdOzVPs+1kStz+S1H22NjrJAFv67cbyIgwpItuXD - Sfao+MU1HWDY4iKZrcfWArUgpQj/pvsmUeJ72iXD3bkTTrK61g3GZA+g9lFewl/B - SORJMu9btS4GAw== - =aBMP - -----END PGP MESSAGE----- - fp: 28D140BCA60B4FD1 - unencrypted_suffix: _unencrypted - version: 3.8.1 diff --git a/configurations/host/valkyrie/services/dcbot.nix b/configurations/host/valkyrie/services/dcbot.nix deleted file mode 100644 index d861849..0000000 --- a/configurations/host/valkyrie/services/dcbot.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -{ - options.valkyrieService.dcbot.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable muse bot"; - - - - - config = - let - cfg = config.valkyrieService.dcbot; - in - lib.mkIf cfg.enable { - sops.templates."muse.env".content = '' - CACHE_LIMIT=512MB - BOT_STATUS=online - BOT_ACTIVITY_TYPE=LISTENING - BOT_ACTIVITY=Coś - DISCORD_TOKEN=${config.sops.placeholder.discord-token} - YOUTUBE_API_KEY=${config.sops.placeholder.youtube-api} - SPOTIFY_CLIENT_ID=${config.sops.placeholder.spotify-client-id} - SPOTIFY_CLIENT_SECRET=${config.sops.placeholder.spotify-client-secret} - ''; - - systemd.tmpfiles.rules = [ - "d /var/lib/muse 0776 root root -" - ]; - - virtualisation.oci-containers.containers.dcbot = { - image = "ghcr.io/museofficial/muse:latest"; - volumes = [ - "/var/lib/muse:/data" - ]; - environmentFiles = [ - config.sops.templates."muse.env".path - ]; - }; - - }; - - -} \ No newline at end of file diff --git a/configurations/host/valkyrie/services/default.nix b/configurations/host/valkyrie/services/default.nix deleted file mode 100644 index 33bc442..0000000 --- a/configurations/host/valkyrie/services/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ config, pkgs, ... }: -{ - imports = - [ - ./pleroma.nix - ./pihole.nix - ./dcbot.nix - ./secureyoursoul.nix - ]; - services.adguardhome.enable = true; - - valkyrieService.pihole.enable = false; - valkyrieService.pleroma.enable = true; - valkyrieService.dcbot.enable = true; - valkyrieService.secureyoursoul.enable = true; - -} diff --git a/configurations/host/valkyrie/services/pihole.nix b/configurations/host/valkyrie/services/pihole.nix deleted file mode 100644 index 25fd708..0000000 --- a/configurations/host/valkyrie/services/pihole.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -{ - options.valkyrieService.pihole.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable pihole"; - options.valkyrieService.pihole.dnsIP = lib.mkOption { default = "127.0.0.1"; }; - options.valkyrieService.pihole.webIP = lib.mkOption { default = "127.0.0.1"; }; - - - - config = - let - cfg = config.valkyrieService.pihole; - dnsmasqConf = pkgs.writeText "02-dnsmasq-custom.conf" '' - no-hosts - ''; - - in - lib.mkIf config.valkyrieService.pihole.enable { - systemd.tmpfiles.rules = [ - "d /var/lib/dnsmasq.d 0776 root root -" - "d /var/lib/pihole 0776 root root -" - "L+ /var/lib/dnsmasq.d/02-dnsmasq-custom.conf 0776 root root - ${dnsmasqConf}" - ]; - - virtualisation.oci-containers.containers.pihole = { - image = "pihole/pihole:latest"; - ports = - [ - "${cfg.dnsIP}:53:53/tcp" - "${cfg.dnsIP}:53:53/udp" - "${cfg.webIP}:3000:80" - ]; - environment = { - TZ = "Europe/Warsaw"; - FTLCONF_LOCAL_IPV4 = "127.0.0.1"; - DNSMASQ_USER = "root"; - VIRTUAL_HOST = "pi.hole"; - PROXY_LOCATION = "pi.hole"; - }; - volumes = [ - "/var/lib/pihole/:/etc/pihole/" - "/var/lib/dnsmasq.d:/etc/dnsmasq.d/" - "/nix/store:/nix/store" - ]; - extraOptions = - [ - "--cap-add=NET_ADMIN" - "--dns=127.0.0.1" - "--dns=9.9.9.9" - "--hostname=pi.hole" - ]; - }; - - }; - - -} diff --git a/configurations/host/valkyrie/services/pleroma.nix b/configurations/host/valkyrie/services/pleroma.nix deleted file mode 100644 index 9bf335a..0000000 --- a/configurations/host/valkyrie/services/pleroma.nix +++ /dev/null @@ -1,149 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -let - - socketPath = "/run/pleroma/http.sock"; - - - socketChmod = with pkgs; with lib; pkgs.writers.writeBashBin "pleroma-socket" - '' - coproc { - ${inotify-tools}/bin/inotifywait -q -m -e create ${escapeShellArg (dirOf socketPath)} - } - - trap 'kill "$COPROC_PID"' EXIT TERM - - until ${pkgs.coreutils}/bin/test -S ${escapeShellArg socketPath} - do read -r -u "''${COPROC[0]}" - done - - ${pkgs.coreutils}/bin/chmod 0666 ${socketPath} - ''; - - soapbox = pkgs.stdenv.mkDerivation rec { - pname = "soapbox"; - version = "v3.2.0"; - dontBuild = true; - dontConfigure = true; - src = pkgs.fetchurl { - name = "soapbox"; - url = "https://gitlab.com/soapbox-pub/soapbox/-/jobs/artifacts/${version}/download?job=build-production"; - sha256 = "sha256-AdW6JK7JkIKLZ8X+N9STeOHqmGNUdhcXyC9jsQPTa9o="; - }; - nativeBuildInputs = [ pkgs.unzip ]; - unpackPhase = '' - unzip $src -d . - ''; - installPhase = '' - mv ./static $out - ''; - - }; - -in -{ - options.valkyrieService.pleroma.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable pleroma"; - config = lib.mkIf config.valkyrieService.pleroma.enable { - systemd.tmpfiles.rules = [ - "d /var/lib/pleroma 0766 pleroma pleroma -" - "d /var/lib/pleroma/static 0766 pleroma pleroma -" - "d /var/lib/pleroma/uploads 0766 pleroma pleroma -" - "L+ /var/lib/pleroma/static/frontends/soapbox/${soapbox.version} 0766 pleroma pleroma - ${soapbox}" - ]; - - services.nginx.virtualHosts."podkos.xyz" = { - http2 = true; - useACMEHost = "podkos.xyz"; - forceSSL = true; - locations."/" = { - proxyPass = "http://unix:${socketPath}"; - extraConfig = '' - etag on; - gzip on; - - add_header 'Access-Control-Allow-Origin' '*' always; - add_header 'Access-Control-Allow-Methods' 'POST, PUT, DELETE, GET, PATCH, OPTIONS' always; - add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Idempotency-Key' always; - add_header 'Access-Control-Expose-Headers' 'Link, X-RateLimit-Reset, X-RateLimit-Limit, X-RateLimit-Remaining, X-Request-Id' always; - if ($request_method = OPTIONS) { - return 204; - } - - add_header X-XSS-Protection "1; mode=block"; - add_header X-Permitted-Cross-Domain-Policies none; - add_header X-Frame-Options DENY; - add_header X-Content-Type-Options nosniff; - add_header Referrer-Policy same-origin; - add_header X-Download-Options noopen; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - - client_max_body_size 8m; - - - ''; - }; - - }; - systemd.services.pleroma.serviceConfig = { - RuntimeDirectory = "pleroma"; - RuntimeDirectoryPreserve = true; - - - ExecStartPost = "${socketChmod}/bin/pleroma-socket"; - ExecStopPost = ''${pkgs.coreutils}/bin/rm -f ${socketPath}''; - }; - - - - - services.pleroma = { - enable = true; - secretConfigFile = "/var/lib/pleroma/secrets.exs"; - configs = [ - '' - import Config - - config :pleroma, Pleroma.Web.Endpoint, - url: [host: "podkos.xyz", scheme: "https", port: 443], - http: [ip: {:local, "${socketPath}"}, port: 0] - - config :pleroma, :instance, - name: "Podziemia Kosmosu", - email: "admin@podkos.xyz", - notify_email: "noreply@podkos.xyz", - limit: 5000, - registrations_open: false - - config :pleroma, :media_proxy, - enabled: false, - redirect_on_failure: true - - config :pleroma, Pleroma.Repo, - adapter: Ecto.Adapters.Postgres, - socket: "/run/postgresql/.s.PGSQL.5432", - username: "pleroma", - database: "pleroma" - - - # Configure web push notifications - config :web_push_encryption, :vapid_details, - subject: "mailto:admin@podkos.x yz" - config :pleroma, :frontends, - primary: %{ - "name" => "soapbox", - "ref" => "${soapbox.version}" - } - - config :pleroma, :database, rum_enabled: false - config :pleroma, :instance, static_dir: "/var/lib/pleroma/static" - config :pleroma, Pleroma.Uploaders.Local, uploads: "/var/lib/pleroma/uploads" - - config :pleroma, configurable_from_database: true - config :pleroma, Pleroma.Upload, filters: [Pleroma.Upload.Filter.AnonymizeFilename] - '' - ]; - }; - }; -} diff --git a/configurations/host/valkyrie/services/secureyoursoul.nix b/configurations/host/valkyrie/services/secureyoursoul.nix deleted file mode 100644 index d888fea..0000000 --- a/configurations/host/valkyrie/services/secureyoursoul.nix +++ /dev/null @@ -1,141 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -{ - options.valkyrieService.secureyoursoul.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable secureyoursoul, web archive"; - - - - - config = - let - cfg = config.valkyrieService.secureyoursoul; - in - lib.mkIf cfg.enable { - systemd.timers.secureyoursoul-steam = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnCalendar = "*-*-1,7,14,21 3:00:00"; - Persistent = true; - Unit = "secureyoursoul-steam.service"; - }; - }; - systemd.timers.secureyoursoul-p1 = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnCalendar = "*-*-3,9,16,23 3:00:00"; - Persistent = true; - Unit = "secureyoursoul-p1.service"; - }; - }; - systemd.timers.secureyoursoul-p2 = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnCalendar = "*-*-5,11,18,25 3:00:00"; - Persistent = true; - Unit = "secureyoursoul-p2.service"; - }; - }; - - systemd.services.secureyoursoul-steam = { - description = "Make curl requests to archive steam related things"; - path = [ pkgs.coreutils pkgs.util-linux pkgs.curl ]; - serviceConfig.Type = "oneshot"; - serviceConfig.RemainAfterExit = false; - script = '' - STEAM_IDS=( ${ builtins.foldl' (x: y: x +"\""+ y + "\" ") "" materusArg.to_save.steamids }) - EXTRA_LINKS=( ${ builtins.foldl' (x: y: x +"\""+ y + "\" ") "" materusArg.to_save.extraLinks-steam }) - - steamladder() { - for id in ''${STEAM_IDS[@]}; do - curl -X POST -H "Authorization: Token ''$(cat ${config.sops.secrets.steamladder-api.path})" \ - "https://steamladder.com/api/v1/profile/$id/" - done; - } - - webarchive(){ - for id in ''${STEAM_IDS[@]}; do - curl -X POST -H "Accept: application/json" \ - -H "Authorization: LOW ''$(cat ${config.sops.secrets.webarchive-accesskey.path}):''$(cat ${config.sops.secrets.webarchive-secretkey.path})" \ - -d"url=https://steamcommunity.com/profiles/$id" \ - -d"capture_outlinks=1" \ - -d"capture_screenshot=on" \ - -d"capture_all=on" \ - "https://web.archive.org/save"; - sleep 180; - done; - - - for link in ''${EXTRA_LINKS[@]}; do - curl -X POST -H "Accept: application/json" \ - -H "Authorization: LOW ''$(cat ${config.sops.secrets.webarchive-accesskey.path}):''$(cat ${config.sops.secrets.webarchive-secretkey.path})" \ - -d"url=$link" \ - -d"capture_outlinks=1" \ - -d"capture_screenshot=on" \ - -d"capture_all=on" \ - "https://web.archive.org/save"; - sleep 180; - done; - - } - - - - steamladder & - webarchive - wait - ''; - }; - - - systemd.services.secureyoursoul-p1 = { - description = "Make curl requests to archive related things"; - path = [ pkgs.coreutils pkgs.util-linux pkgs.curl ]; - serviceConfig.Type = "oneshot"; - serviceConfig.RemainAfterExit = false; - script = '' - EXTRA_LINKS=( ${ builtins.foldl' (x: y: x +"\""+ y + "\" ") "" materusArg.to_save.extraLinks1 }) - webarchive(){ - for link in ''${EXTRA_LINKS[@]}; do - curl -X POST -H "Accept: application/json" \ - -H "Authorization: LOW ''$(cat ${config.sops.secrets.webarchive-accesskey.path}):''$(cat ${config.sops.secrets.webarchive-secretkey.path})" \ - -d"url=$link" \ - -d"capture_outlinks=1" \ - -d"capture_screenshot=on" \ - -d"capture_all=on" \ - "https://web.archive.org/save"; - sleep 180; - done; - - } - webarchive - ''; - }; - - systemd.services.secureyoursoul-p2 = { - description = "Make curl requests to archive related things - part 2"; - path = [ pkgs.coreutils pkgs.util-linux pkgs.curl ]; - serviceConfig.Type = "oneshot"; - serviceConfig.RemainAfterExit = false; - script = '' - EXTRA_LINKS=( ${ builtins.foldl' (x: y: x +"\""+ y + "\" ") "" materusArg.to_save.extraLinks2 }) - webarchive(){ - for link in ''${EXTRA_LINKS[@]}; do - curl -X POST -H "Accept: application/json" \ - -H "Authorization: LOW ''$(cat ${config.sops.secrets.webarchive-accesskey.path}):''$(cat ${config.sops.secrets.webarchive-secretkey.path})" \ - -d"url=$link" \ - -d"capture_outlinks=1" \ - -d"capture_screenshot=on" \ - -d"capture_all=on" \ - "https://web.archive.org/save"; - sleep 180; - done; - - } - webarchive - ''; - }; - - - }; - - -} diff --git a/configurations/host/waffentrager/configuration.nix b/configurations/host/waffentrager/configuration.nix deleted file mode 100644 index be68832..0000000 --- a/configurations/host/waffentrager/configuration.nix +++ /dev/null @@ -1,154 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running `nixos-help`). - -{ config, pkgs, materusArg, ... }: - -{ - imports = - [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; - networking.firewall.allowedTCPPorts = [ 1900 ]; - networking.firewall.allowedUDPPorts = [ 1900 7359]; - materus.profile.nixpkgs.enable = true; - environment.systemPackages = with pkgs; [ - libraspberrypi - raspberrypi-eeprom - git - - p7zip - unrar - bzip2 - unzip - zstd - xz - zip - gzip - - ]; - sound.enable = false; - boot.tmp.useTmpfs = true; - services.xserver.enable = false; - networking.hostName = "waffentrager"; - - services.openssh.enable = true; - services.openssh.settings.PermitRootLogin = "no"; - - users.users.materus = { - isNormalUser = true; - extraGroups = [ "wheel" ]; - openssh.authorizedKeys.keyFiles = [ ("${materusArg.cfg.path}" + "/extraFiles/keys/ssh/materus.pub") ]; - hashedPasswordFile = config.sops.secrets."users/materus".path; - shell = pkgs.zsh; - }; - - nix = { - settings = { - auto-optimise-store = true; - experimental-features = [ "nix-command" "flakes" "no-url-literals" ]; - trusted-users = [ "root" "@wheel" ]; - substituters = [ - "https://nix-community.cachix.org" - "https://cache.nixos.org/" - "https://nixerus.cachix.org/" - ]; - trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nixerus.cachix.org-1:2x7sIG7y1vAoxc8BNRJwsfapZsiX4hIl4aTi9V5ZDdE=" ]; - }; - }; - # Use the extlinux boot loader. (NixOS wants to enable GRUB by default) - boot.loader.grub.enable = false; - # Enables the generation of /boot/extlinux/extlinux.conf - boot.loader.generic-extlinux-compatible.enable = true; - # networking.hostName = "nixos"; # Define your hostname. - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - - # Set your time zone. - # time.timeZone = "Europe/Amsterdam"; - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Select internationalisation properties. - # i18n.defaultLocale = "en_US.UTF-8"; - # console = { - # font = "Lat2-Terminus16"; - # keyMap = "us"; - # useXkbConfig = true; # use xkbOptions in tty. - # }; - - # Enable the X11 windowing system. - # services.xserver.enable = true; - - - - - # Configure keymap in X11 - # services.xserver.layout = "us"; - # services.xserver.xkbOptions = "eurosign:e,caps:escape"; - - # Enable CUPS to print documents. - # services.printing.enable = true; - - # Enable sound. - # sound.enable = true; - # hardware.pulseaudio.enable = true; - - # Enable touchpad support (enabled default in most desktopManager). - services.libinput.enable = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. - # users.users.alice = { - # isNormalUser = true; - # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - # packages = with pkgs; [ - # firefox - # tree - # ]; - # }; - - # List packages installed in system profile. To search, run: - # $ nix search wget - # environment.systemPackages = with pkgs; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - # wget - # ]; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - # services.openssh.enable = true; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - # system.copySystemConfiguration = true; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It's perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.11"; # Did you read the comment? - -} - diff --git a/configurations/host/waffentrager/default.nix b/configurations/host/waffentrager/default.nix deleted file mode 100644 index 133cd26..0000000 --- a/configurations/host/waffentrager/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, pkgs, materusCfg, ... }: -{ - - imports = [ - materusCfg.configInputs.nixos-hardware.nixosModules.raspberry-pi-4 - ./configuration.nix - ./secrets - ./services - ]; - - virtualisation.podman.autoPrune.enable = true; - virtualisation.podman.autoPrune.dates = "daily"; - virtualisation.podman.defaultNetwork.settings = { - default_subnet = "10.88.0.0/16"; - }; - virtualisation.oci-containers.backend = "podman"; - -} diff --git a/configurations/host/waffentrager/hardware-configuration.nix b/configurations/host/waffentrager/hardware-configuration.nix deleted file mode 100644 index f557c20..0000000 --- a/configurations/host/waffentrager/hardware-configuration.nix +++ /dev/null @@ -1,46 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - boot.kernelPackages = pkgs.linuxPackages_rpi4; - boot.initrd.availableKernelModules = [ "xhci_pci" "usb_storage" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; - boot.kernel.sysctl = { - "vm.swappiness" = 10; - }; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; - fsType = "ext4"; - }; - fileSystems."/etc/nixos" = - { - device = "/materus/config/nixos-config"; - fsType = "none"; - options = [ "bind" ]; - }; - - swapDevices = [{ - device = "/var/.swapfile"; - size = 8 * 1024; - }]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.end0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = "aarch64-linux"; - powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; -} diff --git a/configurations/host/waffentrager/home/materus/default.nix b/configurations/host/waffentrager/home/materus/default.nix deleted file mode 100644 index de02863..0000000 --- a/configurations/host/waffentrager/home/materus/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - home.stateVersion = "23.11"; - home.homeDirectory = "/home/materus"; - materus.profile = { - fonts.enable = false; - nixpkgs.enable = false; - enableDesktop = false; - enableTerminal = false; - enableTerminalExtra = false; - enableNixDevel = false; - - fish.enable = false; - bash.enable = true; - zsh.enable = true; - }; -} diff --git a/configurations/host/waffentrager/secrets/default.nix b/configurations/host/waffentrager/secrets/default.nix deleted file mode 100644 index 8a49847..0000000 --- a/configurations/host/waffentrager/secrets/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ materusCfg, ... }: -{ - imports = - [ - - ] ++ (if (materusCfg.materusFlake.decrypted) then [ ./private ] else [ ]); - - sops.age.generateKey = false; - sops.gnupg.home = null; - sops.gnupg.sshKeyPaths = [ ]; - sops.defaultSopsFile = materusCfg.hostPath + "/secrets/secrets.yaml"; - - services.openssh.hostKeys = [ - { - bits = 4096; - path = "/materus/root/ssh_host_rsa_key"; - type = "rsa"; - } - { - path = "/materus/root/ssh_host_ed25519_key"; - type = "ed25519"; - } - ]; - sops.secrets.wireguard = { }; - sops.secrets."users/materus" = { neededForUsers = true; }; - sops.secrets.elements = { }; - sops.secrets.nextcloud-adminpass = { }; - sops.secrets.maloja = { }; - sops.secrets.maloja-api = { }; - sops.secrets.spotify-client-id = {}; - sops.secrets.spotify-client-secret = {}; - sops.secrets.lastfm-user= {}; - sops.secrets.lastfm-pass = {}; - sops.secrets.lastfm-api = {}; - sops.secrets.lastfm-secret = {}; - sops.secrets.lastfm-token = {}; - sops.secrets.listenbrainz-api = {}; -} diff --git a/configurations/host/waffentrager/secrets/private/default.nix b/configurations/host/waffentrager/secrets/private/default.nix deleted file mode 100644 index c463b89..0000000 Binary files a/configurations/host/waffentrager/secrets/private/default.nix and /dev/null differ diff --git a/configurations/host/waffentrager/secrets/secrets.yaml b/configurations/host/waffentrager/secrets/secrets.yaml deleted file mode 100644 index 7192769..0000000 --- a/configurations/host/waffentrager/secrets/secrets.yaml +++ /dev/null @@ -1,52 +0,0 @@ -wireguard: ENC[AES256_GCM,data:fFQKj78HGLDmslDST+usAZxWDanHkUORBgIeOb7lQN4EPXdz6mQODHhn1ek=,iv:/BbbiFlfk8fMX4yFgVXuYkxitbRJqai5PHku2wZUFw4=,tag:cutoXkApljbB3bgSvaS1LQ==,type:str] -nextcloud-adminpass: ENC[AES256_GCM,data:5vohRPEcJJ8gIRro38O73ufSYYEp1DXpBgjCPdPnMcg=,iv:STh3k5wUwx3AfSDTPCXhuXbPb3d+Vi1cAaQN2a9eW1w=,tag:Ef/Z2Idvl6575Jvs2GDJ8A==,type:str] -jwt: ENC[AES256_GCM,data:1Qn7DaBZr8vEa8VZiv2BpwePPOBYRTdHEiDv0asUbvhCtfHvhG4mX5/plyRPlQok6FLEjEzKZTEdnvyyOtFEgA==,iv:kqfHkEr0jkKAro9gQup6CeopQnjfMGhEqbVL81wnDgc=,tag:gP/WACy5cOzzmQOh1v8wsQ==,type:str] -lldap-database: ENC[AES256_GCM,data:rNLS4WwvqRd3TFWDXaf8UmDTRsHZNPPS,iv:URV4Oz4ik2vHb03+Zh7ND+AbozSmoXpxENpvad4yvRI=,tag:6TbuMCnHwtTaG5mMWVN/mQ==,type:str] -authelia-storagekey: ENC[AES256_GCM,data:T5b5QWf6vlGHniuUic0tEFSJNNWaFbvi3emZOWEQz0AhNqDpxJZqO57KdjZ02NVMoxHN54c0ChWlHRCoAj234A==,iv:Rch5RQ0oblTTWXz0it7zZuYQNYhYMa0MsorAx9N4GV0=,tag:+GlwGnPXLukzDnW6BUf6Hg==,type:str] -authelia-database: ENC[AES256_GCM,data:XZYk4clzLaMb3/plELOnEoy4bwu/YSQg,iv:TGDKjLdcdmwEI12XDDNGHTgYnJxB+vV6RaomKU+jwpY=,tag:c/p7X4tzPWWiLvAL7DJmYg==,type:str] -ldap-master: ENC[AES256_GCM,data:jiinK8xzuKiTwB9k44okgj+sWWEgbeay,iv:Slvci3EBylIbP/I6NFIJTd3eitxVApXrORtnXY48eGg=,tag:OwaVYBNxNbQyIHrqOcUGhg==,type:str] -elements: ENC[AES256_GCM,data:Kh6ueReXpj9h5yQ3P0qY8X1ow4RRZD9zyXZLS6DUIIVuthgqgu9dPzBc7ojnz6nXoYTHt1I2LJJKLOGQYZC+iVxXOk+QADJMPwY4NCyeZ3prgvYMghlD,iv:WFA/UQ0XDFjpbgaDEacrBxkteLitXv3CJP54ANVSJHM=,tag:M+tTpTR0alvQxvUiP2MWlA==,type:str] -users: - materus: ENC[AES256_GCM,data:MhPrMJ4/0oxEsFZDUKcYb3WMUWLI2ZbRTgnh1fQZG1Ly2J781jcUWtA8vVAdMBedNfWky0mDq5+KEQ/2fJNGU4IkTBvLdAqnWw==,iv:Dpl+M+x1weNIVkEsf3I/uXpG0SM6bDz+d9w7AYwn/MY=,tag:yGc1D2ODp6Te/QAztOj7yA==,type:str] -maloja: ENC[AES256_GCM,data:V/WV0181zupKLiDtf5pinwYFFzL1hg+j,iv:KmGHapsD7thnmgkHwnTYFP/fvBS6dft9ZmmFN4AZEXs=,tag:uEmZaFkvBIQfu+3+0gQFlg==,type:str] -maloja-api: ENC[AES256_GCM,data:8vLC1a5pL8ldS7LWXqA/HOqtnyYFQk7/oisGgOOYH7TtnpBL93I2O3mWQIGCZUwWqMWFLvbOxIAnpoS0Qmg=,iv:swziHFypoh1YZkyEpDhqH2BhqUrWi0J63CqzORyY4s4=,tag:B9kkYHqyWP0KGPMD4S1I1A==,type:str] -spotify-client-id: ENC[AES256_GCM,data:2vC2E7rHBrZ2VHTGqYRJp1fWNWprDaYq4J6gJ7tTfF0=,iv:KQJgzUiD70N2vQeTO9r8ucC96xc9mSW9VlU2IGmKT7Y=,tag:kWR+1Hhb4yGK/AAqxMCd3A==,type:str] -spotify-client-secret: ENC[AES256_GCM,data:MKHo36AF1hHiXERltKdeMiuMhiGyyH8E3TqQfTf1tqc=,iv:/dPWUqjDtxZUOLZRx2lrHuU5Sf2fch2Fvnl+20KZ5dk=,tag:ZgsbCFBNHXSUuHbdSlrm4w==,type:str] -lastfm-user: ENC[AES256_GCM,data:o/FUjIiB9PcFTQ==,iv:UtovNmHISz9jUj+HFZPIduZj6h3ayjA5RyVlh11k8LM=,tag:bS3ReGR2BRcs3lcutt95UQ==,type:str] -lastfm-pass: ENC[AES256_GCM,data:g90kxN+HkSqN+B9XFH6AvbD376bHFPVI,iv:ZRxKxdKXIgKOm7TKKPLR1yLzTBjuCWQk4tTJN5d/0N4=,tag:soIJI75WAhoiXwVYlxkmQA==,type:str] -lastfm-api: ENC[AES256_GCM,data:UxGOqFEsjDb5zBXjm6G+66zlr5M0pk/NdTad3a5MBVE=,iv:3v9Lg0bjmlAhcSOjCW44CN7FezSdNG3KVVLrk1G9Ies=,tag:amgDr25PYiB+E7+D/fVEOw==,type:str] -lastfm-secret: ENC[AES256_GCM,data:z+XqodyRm9qnZwYwdON/KwAQ3E6hSI+mA0Nby0PQVT4=,iv:sY3Eqr7ZCx5lwjZaRFSghx/3OjuWlDQHQywgt7LpoIo=,tag:f7j1PFanHfLdDK+ASusCMA==,type:str] -lastfm-token: ENC[AES256_GCM,data:X877lDOXtou5OF0KbkvuJ4rhJ+3IY5XnyXlqq4LuSb8=,iv:f8t36ut6zlHvBuKGmJabyc9nHViQvUcqNvCVy0YIeB8=,tag:0h9Jm1h2cxegUXXk6UTz9Q==,type:str] -listenbrainz-api: ENC[AES256_GCM,data:eh03MPc5kn7CUDXXnEJTx4DXv9BpyabyRL+ENDFJw+kS66tV,iv:gerOaZ3gqM7ccLursFuCJrW1HcSjlTGk0wOLM8x4/2A=,tag:ZqxYNlgdqV0zRUUHm7VK3Q==,type:str] -sops: - kms: [] - gcp_kms: [] - azure_kv: [] - hc_vault: [] - age: - - recipient: age1j34lqh0z6ak2c94n564wgyjeykn9srma34f5e5e7xvf498fwk3rqxvwx0l - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAvejRrcGVwZHNkTVB5dkYr - RnhVVjNEblFVd0xXSStqdjFhWVVNS3ljUTNZCnBFVmRRVVVENGhJUVg2L1lSM1NO - dkQydVhOaFVxd0p0aFhVcmp6eXdGeVEKLS0tIFIvRDlvZDdsbm1USEZUZ3FYMmla - eFN4VVdUMkVjcTVWNFdLM0xtbExLdncK6LYUufWzIcd2jFyEeZDypo0xkJQ4z91F - ULyGxJLLWl6/inYXtxHNdxIIPfwW+5yppBAbXaOgvABi1E7tf1JZcA== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-09-13T18:29:55Z" - mac: ENC[AES256_GCM,data:djOmSpNrZoFgUK4JlueCUpZtvHldVEsH90ASO+strLJ7wd1MEFdQaYyNonvTaUUzJQkUncyX3cXdO9Aoj9B6CPSKAuSKE7LRScCCXn+OezwUB5d5m/jLy4KmRhtADO0QHap4+/3fXzOupsHyZpVMIjwUw4tJ9MZMT8iMtbaHv2A=,iv:x4RaxRelUOyyTWpTLFRik92TibE+2mFctz/OYHvBoZA=,tag:S9dIzTc7rVBSFXUISuEDAQ==,type:str] - pgp: - - created_at: "2024-03-21T18:15:00Z" - enc: |- - -----BEGIN PGP MESSAGE----- - - hF4D5fSX77p80GYSAQdAWetrf0jhs/b9qcQc4b21+PJUPdSjk372BjokfwJ2oXQw - 4LaIaNB3LRmY4FF3UOqk28NwkwBw6n0AzYKC/k1G4ntaNBMI9eDtFJ1c1+KkxSl2 - 1GYBCQIQMCKcu2aBEMiIGOyG08vcRW2T23DUAfTQqQdRKD/SgSTqAZLSICVJ91xU - TBsdiPBKO2cRDfPc7DlVLbPNe/SUqVUX9N4GTGPUocXc1s6lvgx3NBP5cGoSNx+A - xCmXl373IDc= - =uSyc - -----END PGP MESSAGE----- - fp: 28D140BCA60B4FD1 - unencrypted_suffix: _unencrypted - version: 3.8.1 diff --git a/configurations/host/waffentrager/services/auth/authelia.nix b/configurations/host/waffentrager/services/auth/authelia.nix deleted file mode 100644 index a461cd7..0000000 --- a/configurations/host/waffentrager/services/auth/authelia.nix +++ /dev/null @@ -1,80 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -{ - options.waffentragerService.auth.authelia.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable authelia"; - config = - let - cfg = config.waffentragerService.auth.authelia; - port = 9091; - in - lib.mkIf cfg.enable { - sops.secrets."authelia-storagekey" = { owner = "authelia"; }; - sops.secrets."authelia-database" = { owner = "authelia"; }; - sops.secrets."ldap-master" = { owner = "authelia"; }; - users.users.authelia = { - group = "lldap"; - isSystemUser = true; - }; - services.authelia.instances.main = { - enable = true; - user = "authelia"; - environmentVariables = { - AUTHELIA_AUTHENTICATION_BACKEND_LDAP_PASSWORD_FILE = config.sops.secrets."ldap-master".path; - AUTHELIA_STORAGE_POSTGRES_PASSWORD_FILE = config.sops.secrets."authelia-database".path; - }; - secrets = { - jwtSecretFile = config.sops.secrets.jwt.path; - storageEncryptionKeyFile = config.sops.secrets."authelia-storagekey".path; - }; - settings = { - access_control = { - default_policy = "one_factor"; - }; - authentication_backend = { - ldap.url = "ldap://127.0.0.1:3890"; - ldap.implementation = "custom"; - ldap.base_dn = config.services.lldap.settings.ldap_base_dn; - ldap.user = "CN=master,ou=people,DC=podkos,DC=pl"; - ldap.additional_users_dn = "OU=people"; - ldap.users_filter = "(&({username_attribute}={input})(objectClass=person))"; - ldap.additional_groups_dn = "OU=groups"; - ldap.groups_filter = "(&(member={dn})(objectClass=groupOfNames))"; - }; - storage = { - postgres.host = "/var/run/postgresql"; - postgres.port = "5432"; - postgres.database = "authelia"; - postgres.username = "authelia"; - - }; - notifier = { - disable_startup_check = false; - filesystem.filename = "/tmp/test_notification.txt"; - }; - session = { - name = "materus-session"; - domain = "materus.pl"; - }; - - default_redirection_url = "https://materus.pl"; - server.port = port; - }; - }; - services.nginx.virtualHosts."gatekeeper.materus.pl" = { - forceSSL = true; - http3 = true; - sslTrustedCertificate = "/var/lib/mnt_acme/materus.pl/chain.pem"; - sslCertificateKey = "/var/lib/mnt_acme/materus.pl/key.pem"; - sslCertificate = "/var/lib/mnt_acme/materus.pl/fullchain.pem"; - locations."/" = { - proxyPass = "http://127.0.0.1:${builtins.toString port}"; - extraConfig = '' - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-Ssl on; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - ''; - }; - }; - }; -} diff --git a/configurations/host/waffentrager/services/auth/default.nix b/configurations/host/waffentrager/services/auth/default.nix deleted file mode 100644 index 2892b8c..0000000 --- a/configurations/host/waffentrager/services/auth/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, materusArg, lib, pkgs, ... }: -{ - imports = - [ - ./lldap.nix - ./authelia.nix - ]; - config = - { - waffentragerService.auth.lldap.enable = true; - waffentragerService.auth.authelia.enable = true; - }; -} diff --git a/configurations/host/waffentrager/services/auth/lldap.nix b/configurations/host/waffentrager/services/auth/lldap.nix deleted file mode 100644 index 65c2f4f..0000000 --- a/configurations/host/waffentrager/services/auth/lldap.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -{ - options.waffentragerService.auth.lldap.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable lldap"; - config = - let - cfg = config.waffentragerService.auth.lldap; - in - lib.mkIf cfg.enable { - waffentragerService.elements.enable = true; - waffentragerService.nginx.enable = true; - services.nginx.virtualHosts."mamba.podkos.pl" = { - forceSSL = true; - http3 = true; - sslTrustedCertificate = "/var/lib/mnt_acme/mamba.podkos.pl/chain.pem"; - sslCertificateKey = "/var/lib/mnt_acme/mamba.podkos.pl/key.pem"; - sslCertificate = "/var/lib/mnt_acme/mamba.podkos.pl/fullchain.pem"; - locations."/" = { - proxyPass = "http://127.0.0.1:17170"; - extraConfig = '' - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-Ssl on; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - - allow ${materusArg.ip-masks.wireguard.private}; - allow 192.168.100.0/24; - deny all; - ''; - }; - }; - - systemd.services.lldap = { - requires = [ "elements-mount.service" ]; - after = [ "elements-mount.service" ]; - serviceConfig = { - DynamicUser = lib.mkForce false; - WorkingDirectory = lib.mkForce config.waffentragerService.elements.lldapDir; - }; - }; - users.groups.lldap = { }; - users.users.lldap = { - group = "lldap"; - isSystemUser = true; - }; - sops.secrets.jwt = { owner = "lldap"; group = "lldap"; mode = "0440"; }; - sops.secrets."lldap-database" = { owner = "lldap"; group = "lldap"; }; - services.lldap.enable = true; - services.lldap.environmentFile = config.sops.templates."lldap.env".path; - sops.templates."lldap.env" = { - content = '' - LLDAP_JWT_SECRET_FILE="${config.sops.secrets.jwt.path}" - LLDAP_DATABASE_URL="postgres://lldap:${config.sops.placeholder."lldap-database"}@%2Fvar%2Frun%2Fpostgresql/lldap" - ''; - owner = "lldap"; - group = "lldap"; - }; - - services.lldap.settings = { - ldap_base_dn = "dc=podkos,dc=pl"; - - ldap_host = "127.0.0.1"; - http_url = "https://mamba.podkos.pl"; - ldap_user_dn = "master"; - ldap_user_email = "materus@podkos.pl"; - ldap_port = 3890; - key_seed = materusArg.waffentrager.lldap.seed; - }; - }; -} diff --git a/configurations/host/waffentrager/services/default.nix b/configurations/host/waffentrager/services/default.nix deleted file mode 100644 index 675318a..0000000 --- a/configurations/host/waffentrager/services/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ ... }: -{ - imports = - [ - ./storage/elements.nix - ./storage/mount-acme.nix - ./storage/gitea.nix - ./storage/nextcloud.nix - ./storage/samba.nix - ./storage/syncthing.nix - ./multimedia/jellyfin.nix - ./multimedia/scrobbling.nix - ./monitoring.nix - ./nginx.nix - ./postgresql.nix - ./auth - ]; - waffentragerService.elements.enable = true; - waffentragerService.postgresql.enable = true; - waffentragerService.mount-acme.enable = true; - waffentragerService.gitea.enable = true; - waffentragerService.nginx.enable = true; - waffentragerService.nextcloud.enable = true; - waffentragerService.samba.enable = true; - waffentragerService.jellyfin.enable = true; - waffentragerService.scrobbling.enable = true; - - waffentragerService.syncthing.enable = true; - waffentragerService.monitoring.enable = true; -} \ No newline at end of file diff --git a/configurations/host/waffentrager/services/monitoring.nix b/configurations/host/waffentrager/services/monitoring.nix deleted file mode 100644 index 2562811..0000000 --- a/configurations/host/waffentrager/services/monitoring.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ materusArg, config, lib, ... }: -{ - options.waffentragerService.monitoring.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable monitoring"; - config = - let - cfg = config.waffentragerService.monitoring; - in - lib.mkIf cfg.enable { - services.grafana = { - dataDir = "${config.waffentragerService.elements.path}/services/grafana"; - enable = true; - settings = { - server = { - http_addr = "127.0.0.1"; - http_port = 3232; - - domain = "watchman.materus.pl"; - serve_from_sub_path = true; - }; - }; - }; - services.prometheus = { - enable = true; - port = 3233; - globalConfig.scrape_interval = "30s"; - stateDir = "elements/services/prometheus"; - scrapeConfigs = [ - { - job_name = "node"; - static_configs = [{ - targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; - }]; - } - ]; - }; - services.prometheus.exporters.node = { - enable = true; - port = 3234; - enabledCollectors = [ "systemd" ]; - extraFlags = [ "--collector.ethtool" "--collector.softirqs" "--collector.tcpstat" "--collector.wifi" ]; - - }; - services.nginx.virtualHosts."watchman.materus.pl" = { - addSSL = true; - sslTrustedCertificate = "/var/lib/mnt_acme/materus.pl/chain.pem"; - sslCertificateKey = "/var/lib/mnt_acme/materus.pl/key.pem"; - sslCertificate = "/var/lib/mnt_acme/materus.pl/fullchain.pem"; - http2 = false; - http3 = true; - locations."/" = { - proxyPass = "http://${toString config.services.grafana.settings.server.http_addr}:${toString config.services.grafana.settings.server.http_port}"; - proxyWebsockets = true; - recommendedProxySettings = true; - }; - }; - }; -} diff --git a/configurations/host/waffentrager/services/multimedia/jellyfin.nix b/configurations/host/waffentrager/services/multimedia/jellyfin.nix deleted file mode 100644 index 28f0049..0000000 --- a/configurations/host/waffentrager/services/multimedia/jellyfin.nix +++ /dev/null @@ -1,150 +0,0 @@ -{ lib, config, materusArg, ... }: -{ - options.waffentragerService.jellyfin.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable jellyfin"; - - config = - let - cfg = config.waffentragerService.jellyfin; - in - lib.mkIf cfg.enable { - services.jellyfin = rec { - enable = true; - openFirewall = true; - user = "materus"; - group = "nextcloud"; - dataDir = config.waffentragerService.elements.jellyfinDir; - cacheDir = "${dataDir}/cache"; - }; - /* - services.jellyseerr = { - enable = true; - openFirewall = true; - };*/ - - services.nginx = { - appendHttpConfig = '' - map $request_uri $h264Level { ~(h264-level=)(.+?)& $2; } - map $request_uri $h264Profile { ~(h264-profile=)(.+?)& $2; } - ''; - proxyCachePath."jellyfin" = { - enable = true; - maxSize = "1g"; - levels = "1:2"; - keysZoneName = "jellyfin"; - keysZoneSize = "100m"; - inactive = "1d"; - useTempPath = false; - - }; - virtualHosts = { - "noot.materus.pl" = { - extraConfig = '' - client_max_body_size 20M; - add_header X-Frame-Options "SAMEORIGIN"; - add_header X-XSS-Protection "0"; # Do NOT enable. This is obsolete/dangerous - add_header X-Content-Type-Options "nosniff"; - add_header Permissions-Policy "accelerometer=(), ambient-light-sensor=(), battery=(), bluetooth=(), camera=(), clipboard-read=(), display-capture=(), document-domain=(), encrypted-media=(), gamepad=(), geolocation=(), gyroscope=(), hid=(), idle-detection=(), interest-cohort=(), keyboard-map=(), local-fonts=(), magnetometer=(), microphone=(), payment=(), publickey-credentials-get=(), serial=(), sync-xhr=(), usb=(), xr-spatial-tracking=()" always; - ''; - sslTrustedCertificate = "/var/lib/mnt_acme/materus.pl/chain.pem"; - sslCertificateKey = "/var/lib/mnt_acme/materus.pl/key.pem"; - sslCertificate = "/var/lib/mnt_acme/materus.pl/fullchain.pem"; - addSSL = true; - http2 = false; - http3 = true; - locations."~ /Items/(.*)/Images" = { - proxyPass = "http://127.0.0.1:8096"; - extraConfig = '' - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Protocol $scheme; - proxy_set_header X-Forwarded-Host $http_host; - - proxy_cache jellyfin; - proxy_cache_revalidate on; - proxy_cache_lock on; - ''; - }; - locations."~ ^/web/htmlVideoPlayer-plugin.[0-9a-z]+.chunk.js$" = { - proxyPass = "http://127.0.0.1:8096"; - extraConfig = '' - proxy_set_header Accept-Encoding ""; - - sub_filter_types *; - sub_filter 'return u=30' 'return u=600'; - sub_filter 'return u=6' 'return u=60'; - sub_filter 'maxBufferLength:u' 'maxBufferLength:u,maxBufferSize:180000000'; - sub_filter_once on; - ''; - }; - locations."~* ^/Videos/(.*)/(?!live)" = { - proxyPass = "http://127.0.0.1:8096"; - extraConfig = '' - # Set size of a slice (this amount will be always requested from the backend by nginx) - # Higher value means more latency, lower more overhead - # This size is independent of the size clients/browsers can request - slice 2m; - - proxy_cache jellyfin; - proxy_cache_valid 200 206 301 302 30d; - proxy_ignore_headers Expires Cache-Control Set-Cookie X-Accel-Expires; - proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; - proxy_connect_timeout 15s; - proxy_http_version 1.1; - proxy_set_header Connection ""; - # Transmit slice range to the backend - proxy_set_header Range $slice_range; - - # This saves bandwidth between the proxy and jellyfin, as a file is only downloaded one time instead of multiple times when multiple clients want to at the same time - # The first client will trigger the download, the other clients will have to wait until the slice is cached - # Esp. practical during SyncPlay - proxy_cache_lock on; - proxy_cache_lock_age 60s; - - proxy_cache_key "jellyvideo$uri?MediaSourceId=$arg_MediaSourceId&VideoCodec=$arg_VideoCodec&AudioCodec=$arg_AudioCodec&AudioStreamIndex=$arg_AudioStreamIndex&VideoBitrate=$arg_VideoBitrate&AudioBitrate=$arg_AudioBitrate&SubtitleMethod=$arg_SubtitleMethod&TranscodingMaxAudioChannels=$arg_TranscodingMaxAudioChannels&RequireAvc=$arg_RequireAvc&SegmentContainer=$arg_SegmentContainer&MinSegments=$arg_MinSegments&BreakOnNonKeyFrames=$arg_BreakOnNonKeyFrames&h264-profile=$h264Profile&h264-level=$h264Level&slicerange=$slice_range"; - - ''; - }; - locations."/" = { - proxyPass = "http://127.0.0.1:8096"; - extraConfig = '' - proxy_pass_request_headers on; - - proxy_set_header Host $host; - - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $http_host; - - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $http_connection; - - - ''; - }; - locations."/socket" = { - proxyPass = "http://127.0.0.1:8096"; - extraConfig = '' - proxy_pass_request_headers on; - - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Protocol $scheme; - proxy_set_header X-Forwarded-Host $http_host; - - - ''; - }; - - }; - }; - }; - }; -} diff --git a/configurations/host/waffentrager/services/multimedia/scrobbling.nix b/configurations/host/waffentrager/services/multimedia/scrobbling.nix deleted file mode 100644 index a6e3d0d..0000000 --- a/configurations/host/waffentrager/services/multimedia/scrobbling.nix +++ /dev/null @@ -1,240 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -{ - options.waffentragerService.scrobbling.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable scrobbling"; - - - - - config = - let - cfg = config.waffentragerService.scrobbling; - in - - - #### MALOJA -------------------------------------------------------------------- - lib.mkIf cfg.enable { - sops.templates."maloja.env".content = '' - MALOJA_DATA_DIRECTORY=/data - MALOJA_DIRECTORY_STATE=/data/state - MALOJA_DIRECTORY_CACHE=/data/cache - - MALOJA_SKIP_SETUP=yes - MALOJA_FORCE_PASSWORD=${config.sops.placeholder.maloja} - MALOJA_SPOTIFY_API_ID=${config.sops.placeholder.spotify-client-id} - MALOJA_SPOTIFY_API_SECRET=${config.sops.placeholder.spotify-client-secret} - - MALOJA_NAME=Melody - - MALOJA_WEEK_OFFSET=1 - - PUID=${builtins.toString config.users.users.scrobbler.uid} - PGID=${builtins.toString config.users.groups.scrobbler.gid} - TC=Europe/Warsaw - TIMEZONE=Europe/Warsaw - ''; - services.nginx.virtualHosts = { - "melody.materus.pl" = { - sslTrustedCertificate = "/var/lib/mnt_acme/materus.pl/chain.pem"; - sslCertificateKey = "/var/lib/mnt_acme/materus.pl/key.pem"; - sslCertificate = "/var/lib/mnt_acme/materus.pl/fullchain.pem"; - addSSL = true; - http2 = false; - http3 = true; - locations."/" = { - proxyPass = "http://127.0.0.1:42010"; - extraConfig = '' - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-Ssl on; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - ''; - }; - - }; - - }; - - - virtualisation.oci-containers.containers.maloja = - { - - image = "krateng/maloja:latest"; - ports = [ - "42010:42010" - ]; - volumes = [ - "${config.waffentragerService.elements.malojaDir}:/data" - ]; - environmentFiles = [ - config.sops.templates."maloja.env".path - ]; - }; - systemd.services."${config.virtualisation.oci-containers.backend}-maloja" = - - let - malojaCfg = pkgs.writeText "settings.ini" ''[MALOJA] -directory_config = /data -lastfm_api_key = False -audiodb_api_key = False -spotify_api_id = False -spotify_api_secret = False -delimiters_feat = ["ft.","ft","feat.","feat","featuring","Ft.","Ft","Feat.","Feat","Featuring"] -delimiters_informal = ["vs.","vs","&","with"] -delimiters_formal = ["; ",";"] -metadata_providers = ["spotify","deezer","lastfm","audiodb","musicbrainz"] - -''; - in - { - requires = [ "elements-mount.service" ]; - after = [ "elements-mount.service" ]; - preStart = ''cp --update=none ${malojaCfg} ${config.waffentragerService.elements.malojaDir}/settings.ini''; - - }; - - #### MULTI SCROBBLER -------------------------------------------------------------------- - users.groups.scrobbler = { gid = 3000; }; - users.users.scrobbler = { - group = "scrobbler"; - uid = 3000; - isSystemUser = true; - }; - sops.templates."multi-scrobbler.env".content = '' - TC=Europe/Warsaw - CONFIG_DIR=/config - PUID=${builtins.toString config.users.users.scrobbler.uid} - PGID=${builtins.toString config.users.groups.scrobbler.gid} - ''; - sops.templates."multi-scrobbler.json".owner = "scrobbler"; - sops.templates."multi-scrobbler.json".group = "scrobbler"; - sops.templates."multi-scrobbler.json".content = builtins.toJSON { - baseUrl = "https://scrobbler.materus.pl"; - disableWeb = false; - debugMode = false; - sources = [ - { - name = "materus-spotify"; - enable = true; - clients = [ "maloja" ]; - data = { - clientId = "${config.sops.placeholder.spotify-client-id}"; - clientSecret = "${config.sops.placeholder.spotify-client-secret}"; - redirectUri = "https://scrobbler.materus.pl/callback"; - interval = 30; - }; - type = "spotify"; - } - { - name = "materus-jellyfin"; - enable = true; - clients = [ "maloja" ]; - data = { - users = [ - "materus" - ]; - servers = [ - "waffentrager" - ]; - }; - options = { - logPayload = false; - logFilterFailure = "warn"; - }; - type = "jellyfin"; - } - ]; - clients = [ - { - name = "maloja"; - enable = true; - data = { - url = "https://melody.materus.pl/"; - apiKey = "${config.sops.placeholder.maloja-api}"; - }; - type = "maloja"; - } - { - name = "materus-brainz"; - enable = true; - configureAs = "client"; - data = { - token = "${config.sops.placeholder.listenbrainz-api}"; - username = "materus"; - }; - type = "listenbrainz"; - } - { - name = "materus-lastfm"; - enable = true; - configureAs = "client"; - data = { - apiKey = "${config.sops.placeholder.lastfm-api}"; - secret = "${config.sops.placeholder.lastfm-secret}"; - redirectUri = "https://scrobbler.materus.pl/lastfm/callback"; - }; - type = "lastfm"; - } - - ]; - - }; - - - - - services.nginx.virtualHosts = { - "scrobbler.materus.pl" = { - sslTrustedCertificate = "/var/lib/mnt_acme/materus.pl/chain.pem"; - sslCertificateKey = "/var/lib/mnt_acme/materus.pl/key.pem"; - sslCertificate = "/var/lib/mnt_acme/materus.pl/fullchain.pem"; - addSSL = true; - http2 = false; - http3 = true; - locations."/" = { - proxyPass = "http://127.0.0.1:42011"; - extraConfig = '' - allow ${materusArg.ip-masks.wireguard.private}; - allow 192.168.100.0/24; - deny all; - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-Ssl on; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - ''; - }; - - }; - - }; - systemd.services."${config.virtualisation.oci-containers.backend}-multi-scrobbler" = - { - preStart = ''cp -f ${config.sops.templates."multi-scrobbler.json".path} ${config.waffentragerService.elements.malojaDir}/multi-scrobbler/config.json''; - requires = [ "elements-mount.service" ]; - after = [ "elements-mount.service" ]; - }; - virtualisation.oci-containers.containers.multi-scrobbler = { - image = "foxxmd/multi-scrobbler:latest"; - ports = [ - "127.0.0.1:42011:9078" - ]; - volumes = [ - "${config.waffentragerService.elements.malojaDir}/multi-scrobbler:/config" - ]; - environmentFiles = [ - config.sops.templates."multi-scrobbler.env".path - ]; - }; - - - - - - - }; -} diff --git a/configurations/host/waffentrager/services/nginx.nix b/configurations/host/waffentrager/services/nginx.nix deleted file mode 100644 index 1e8daa4..0000000 --- a/configurations/host/waffentrager/services/nginx.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ materusArg, config, lib, pkgs, ... }: -{ - options.waffentragerService.nginx.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable nginx"; - - - config = - let - cfg = config.waffentragerService.nginx; - in - lib.mkIf cfg.enable { - networking.firewall.allowedTCPPorts = [ 80 443 ]; - services.nginx = { - enable = true; - recommendedTlsSettings = true; - recommendedOptimisation = true; - recommendedGzipSettings = true; - package = pkgs.tengine; - virtualHosts."default" = { - sslTrustedCertificate = "/var/lib/mnt_acme/materus.pl/chain.pem"; - sslCertificateKey = "/var/lib/mnt_acme/materus.pl/key.pem"; - sslCertificate = "/var/lib/mnt_acme/materus.pl/fullchain.pem"; - forceSSL = true; - http2 = false; - default = true; - locations."/" = { extraConfig = ''deny all;''; }; - }; - }; - - systemd.services.nginx = { - requires = [ "var-lib-mnt_acme.mount" ]; - after = [ "var-lib-mnt_acme.mount" ]; - serviceConfig = { - restart = "always"; - restartSec = 60; - }; - }; - }; - -} diff --git a/configurations/host/waffentrager/services/postgresql.nix b/configurations/host/waffentrager/services/postgresql.nix deleted file mode 100644 index ae97fe4..0000000 --- a/configurations/host/waffentrager/services/postgresql.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ materusArg, config, lib, pkgs, ... }: -{ - options.waffentragerService.postgresql.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable postgresql"; - options.waffentragerService.postgresql.version = lib.mkOption { default = "16"; }; - - config = - let - cfg = config.waffentragerService.postgresql; - in - lib.mkIf cfg.enable { - waffentragerService.elements.enable = true; - - services.postgresql.enable = true; - services.postgresql.package = pkgs."postgresql_${cfg.version}"; - services.postgresql.dataDir = "${config.waffentragerService.elements.postgresqlDir}/${cfg.version}"; - services.postgresql.enableJIT = true; - services.postgresql.authentication = pkgs.lib.mkOverride 10 '' - local all all trust - host all all 127.0.0.1/32 scram-sha-256 - host all all ::1/128 scram-sha-256 - ''; - systemd.services.postgresql = { - requires = [ "elements-mount.service" ]; - after = [ "elements-mount.service" ]; - }; - }; -} diff --git a/configurations/host/waffentrager/services/storage/elements.nix b/configurations/host/waffentrager/services/storage/elements.nix deleted file mode 100644 index 15e3209..0000000 --- a/configurations/host/waffentrager/services/storage/elements.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ materusArg, config, lib, pkgs, ... }: -{ - options.waffentragerService.elements.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable elements drive"; - options.waffentragerService.elements.path = lib.mkOption { default = "/var/lib/elements"; }; - options.waffentragerService.elements.uuid = lib.mkOption { default = "e32039c6-e98d-44b0-8e7d-120994bf7be1"; }; - options.waffentragerService.elements.postgresqlDir = lib.mkOption { default = "${config.waffentragerService.elements.path}/services/postgresql"; }; - options.waffentragerService.elements.nextcloudDir = lib.mkOption { default = "${config.waffentragerService.elements.path}/services/nextcloud"; }; - options.waffentragerService.elements.lldapDir = lib.mkOption { default = "${config.waffentragerService.elements.path}/services/lldap"; }; - options.waffentragerService.elements.jellyfinDir = lib.mkOption { default = "${config.waffentragerService.elements.path}/services/jellyfin"; }; - options.waffentragerService.elements.malojaDir = lib.mkOption { default = "${config.waffentragerService.elements.path}/services/maloja"; }; - - config = - let - cfg = config.waffentragerService.elements; - in - lib.mkIf cfg.enable { - - systemd.services.elements-mount = { - description = "Decrypt and mount elements drive"; - wantedBy = [ "multi-user.target" ]; - path = [ pkgs.cryptsetup pkgs.coreutils pkgs.util-linux ]; - serviceConfig.Type = "oneshot"; - serviceConfig.RemainAfterExit = true; - script = '' - mkdir -p ${cfg.path} - cryptsetup luksOpen /dev/disk/by-uuid/${cfg.uuid} elements -d ${config.sops.secrets.elements.path} - mount /dev/mapper/elements ${cfg.path} - '' - - ; - preStop = '' - umount ${cfg.path} - cryptsetup luksClose elements - ''; - }; - - systemd.services.elements-dirmake = { - description = "Create dirs in elements drive"; - path = [ pkgs.cryptsetup pkgs.coreutils pkgs.util-linux ]; - - serviceConfig.Type = "oneshot"; - serviceConfig.RemainAfterExit = false; - script = lib.optionalString config.waffentragerService.postgresql.enable '' - mkdir -p ${cfg.postgresqlDir}/${config.waffentragerService.postgresql.version} - chown -R postgres:postgres ${cfg.postgresqlDir} - '' + lib.optionalString config.waffentragerService.nextcloud.enable '' - mkdir -p ${cfg.nextcloudDir} - chown -R nextcloud:nextcloud ${cfg.nextcloudDir} - '' + lib.optionalString config.waffentragerService.auth.lldap.enable '' - mkdir -p ${cfg.lldapDir} - chown -R lldap:lldap ${cfg.lldapDir} - '' + lib.optionalString config.waffentragerService.jellyfin.enable '' - mkdir -p ${cfg.jellyfinDir} - chown -R materus:nextcloud ${cfg.jellyfinDir} - '' + lib.optionalString config.waffentragerService.scrobbling.enable '' - mkdir -p ${cfg.malojaDir}/multi-scrobbler - chown -R scrobbler:scrobbler ${cfg.malojaDir} - '' - - - ; - }; - - }; -} diff --git a/configurations/host/waffentrager/services/storage/gitea.nix b/configurations/host/waffentrager/services/storage/gitea.nix deleted file mode 100644 index 4c27342..0000000 --- a/configurations/host/waffentrager/services/storage/gitea.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ materusArg, config, lib, ... }: -{ - options.waffentragerService.gitea.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable gitea"; - - - config = - let - cfg = config.waffentragerService.gitea; - in - lib.mkMerge - [ - (lib.mkIf cfg.enable { - waffentragerService.postgresql.enable = true; - waffentragerService.elements.enable = true; - - services.gitea.enable = true; - services.gitea.lfs.enable = true; - services.gitea.stateDir = "${config.waffentragerService.elements.path}/services/gitea"; - services.gitea.settings.service.DISABLE_REGISTRATION = true; - services.gitea.settings.server.DOMAIN = "baka.materus.pl"; - services.gitea.settings.server.ROOT_URL = lib.mkForce "https://baka.materus.pl/"; - services.gitea.settings.server.PROTOCOL = "fcgi+unix"; - services.gitea.settings.cors = { - ENABLED = true; - X_FRAME_OPTIONS = "ALLOW-FROM https://*.materus.pl/"; - }; - - services.gitea.database.type = "postgres"; - services.gitea.database.socket = "/var/run/postgresql/"; - - }) - (lib.mkIf (cfg.enable && config.waffentragerService.nginx.enable) { - - services.nginx.virtualHosts = { - "baka.materus.pl" = { - sslTrustedCertificate = "/var/lib/mnt_acme/materus.pl/chain.pem"; - sslCertificateKey = "/var/lib/mnt_acme/materus.pl/key.pem"; - sslCertificate = "/var/lib/mnt_acme/materus.pl/fullchain.pem"; - addSSL = true; - http2 = false; - locations."/" = { - extraConfig = '' - client_max_body_size 2G; - include ${config.services.nginx.package}/conf/fastcgi.conf; - include ${config.services.nginx.package}/conf/fastcgi_params; - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-Ssl on; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - fastcgi_pass unix:/var/run/gitea/gitea.sock; - ''; - }; - - }; - }; - } - ) - ]; -} diff --git a/configurations/host/waffentrager/services/storage/mount-acme.nix b/configurations/host/waffentrager/services/storage/mount-acme.nix deleted file mode 100644 index ecebb40..0000000 --- a/configurations/host/waffentrager/services/storage/mount-acme.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ materusArg, config, lib, pkgs, ... }: -{ - options.waffentragerService.mount-acme.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable mount-acme"; - - config = - let - cfg = config.waffentragerService.mount-acme; - in - lib.mkIf cfg.enable { - environment.systemPackages = with pkgs; [ sshfs ]; - systemd.mounts = [{ - description = "Mount remote acme dir from valkyrie"; - what = "acme@valkyrie:/var/lib/acme"; - where = "/var/lib/mnt_acme"; - type = "fuse.sshfs"; - options = "reconnect,gid=${builtins.toString config.ids.gids.nginx},_netdev,rw,nosuid,allow_other,default_permissions,follow_symlinks,idmap=user,compression=yes,identityfile=/materus/root/ssh_host_ed25519_key"; - wantedBy = [ "multi-user.target" ]; - }]; - }; -} diff --git a/configurations/host/waffentrager/services/storage/nextcloud.nix b/configurations/host/waffentrager/services/storage/nextcloud.nix deleted file mode 100644 index 0fde56a..0000000 --- a/configurations/host/waffentrager/services/storage/nextcloud.nix +++ /dev/null @@ -1,102 +0,0 @@ -{ materusArg, config, lib, pkgs, ... }: -{ - options.waffentragerService.nextcloud.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable nextcloud"; - - config = - let - cfg = config.waffentragerService.nextcloud; - in - lib.mkIf cfg.enable { - waffentragerService.elements.enable = true; - waffentragerService.postgresql.enable = true; - waffentragerService.nginx.enable = true; - environment.systemPackages = [ pkgs.samba pkgs.exiftool pkgs.ffmpeg-headless ]; - sops.secrets.nextcloud-adminpass.owner = config.users.users.nextcloud.name; - sops.secrets.nextcloud-adminpass.group = config.users.users.nextcloud.group; - - services.postgresql.ensureDatabases = [ "nextcloud" ]; - services.postgresql.ensureUsers = [{ - name = "nextcloud"; - ensureDBOwnership = true; - }]; - services.nextcloud = { - enable = true; - notify_push.enable = true; - package = pkgs.nextcloud29; - hostName = "waffentrager.materus.pl"; - home = config.waffentragerService.elements.nextcloudDir; - config.adminuser = "nextcloud-master"; - config.adminpassFile = config.sops.secrets.nextcloud-adminpass.path; - config.dbtype = "pgsql"; - extraAppsEnable = true; - maxUploadSize = "8G"; - https = true; - enableImagemagick = true; - configureRedis = true; - webfinger = true; - appstoreEnable = true; - database.createLocally = true; - nginx.recommendedHttpHeaders = true; - extraApps = with pkgs.nextcloud29Packages.apps; { - inherit notify_push previewgenerator; - }; - settings = { - log_type = "file"; - "profile.enabled" = true; - default_phone_region = "PL"; - trusted_proxies = [ materusArg.ips.valkyrie materusArg.ips.wireguard.valkyrie materusArg.ips.wireguard.waffentrager ]; - mail_smtpmode = "sendmail"; - mail_sendmailmode = "pipe"; - enable_previews = true; - preview_format = "webp"; - enabledPreviewProviders = [ - ''OC\Preview\Movie'' - ''OC\Preview\PNG'' - ''OC\Preview\JPEG'' - ''OC\Preview\GIF'' - ''OC\Preview\BMP'' - ''OC\Preview\XBitmap'' - ''OC\Preview\MP3'' - ''OC\Preview\OGG'' - ''OC\Preview\OPUS'' - ''OC\Preview\MP4'' - ''OC\Preview\TXT'' - ''OC\Preview\MarkDown'' - ''OC\Preview\PDF'' - ''OC\Preview\WebP'' - ''OC\Preview\OpenDocument'' - ''OC\Preview\Krita'' - ''OC\Preview\AVIF'' - ]; - "overwrite.cli.url" = "https://${config.services.nextcloud.hostName}"; - }; - - phpOptions = { - "opcache.memory_consumption" = "512"; - "opcache.interned_strings_buffer" = "64"; - "opcache.max_accelerated_files"="50000"; - "opcache.jit" = "1255"; - "opcache.jit_buffer_size" = "128M"; - "opcache.validate_timestamps" = "0"; - "opcache.revalidate_freq" = "0"; - "opcache.fast_shutdown" = "1"; - "opcache.save_comments" = "1"; - }; - phpExtraExtensions = ex: [ ex.zip ex.zlib ex.tidy ex.smbclient ex.sodium ]; - }; - services.nginx.virtualHosts.${config.services.nextcloud.hostName} = { - forceSSL = true; - http3 = true; - sslTrustedCertificate = "/var/lib/mnt_acme/materus.pl/chain.pem"; - sslCertificateKey = "/var/lib/mnt_acme/materus.pl/key.pem"; - sslCertificate = "/var/lib/mnt_acme/materus.pl/fullchain.pem"; - extraConfig = '' - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - dav_methods PUT DELETE MKCOL COPY MOVE; - dav_ext_methods PROPFIND OPTIONS; - create_full_put_path on; - dav_access user:rw group:rw all:r; - ''; - }; - }; -} diff --git a/configurations/host/waffentrager/services/storage/samba.nix b/configurations/host/waffentrager/services/storage/samba.nix deleted file mode 100644 index 378b553..0000000 --- a/configurations/host/waffentrager/services/storage/samba.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ lib, pkgs, materusArg, config, ... }: -{ - options.waffentragerService.samba.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable samba"; - - config = - let - cfg = config.waffentragerService.samba; - in - lib.mkIf cfg.enable { - waffentragerService.elements.enable = true; - - systemd.services.samba-nmbd = { - requires = [ "elements-mount.service" ]; - after = [ "elements-mount.service" ]; - }; - systemd.services.samba-wsdd = { - requires = [ "elements-mount.service" ]; - after = [ "elements-mount.service" ]; - }; - services.samba-wsdd.enable = true; - services.samba-wsdd.openFirewall = true; - services.samba = { - enable = true; - package = pkgs.sambaFull; - securityType = "user"; - openFirewall = true; - extraConfig = '' - workgroup = WORKGROUP - server string = smbwaffentrager - netbios name = smbwaffentrager - security = user - hosts allow = ${materusArg.wireguard.sambaIp} 192.168.100. 127.0.0.1 localhost - hosts deny = 0.0.0.0/0 - guest account = nobody - map to guest = bad user - mangled names = no - dos charset = CP850 - unix charset = UTF-8 - display charset = UTF-8 - catia:mappings = 0x22:0xa8,0x2a:0xa4,0x2f:0xf8,0x3a:0xf7,0x3c:0xab,0x3e:0xbb,0x3f:0xbf,0x5c:0xff,0x7c:0xa6 - ''; - shares = { - materus = { - path = "${config.waffentragerService.elements.path}/storage/materus"; - browseable = "yes"; - "read only" = "no"; - "guest ok" = "no"; - "create mask" = "0770"; - "directory mask" = "0770"; - "force user" = "materus"; - "force group" = "nextcloud"; - }; - }; - }; - }; -} diff --git a/configurations/host/waffentrager/services/storage/syncthing.nix b/configurations/host/waffentrager/services/storage/syncthing.nix deleted file mode 100644 index 958abfd..0000000 --- a/configurations/host/waffentrager/services/storage/syncthing.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ lib, pkgs, materusArg, config, ... }: -{ - options.waffentragerService.syncthing.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable syncthing"; - - config = - let - cfg = config.waffentragerService.syncthing; - in - lib.mkIf cfg.enable { - waffentragerService.elements.enable = true; networking.firewall.allowedTCPPorts = [ 22000 config.services.syncthing.relay.statusPort config.services.syncthing.relay.port]; - networking.firewall.allowedUDPPorts = [ 22000 21027 ]; - systemd.services.syncthing = { - requires = [ "elements-mount.service" ]; - after = [ "elements-mount.service" ]; - }; - services = { - syncthing = { - enable = true; - user = "materus"; - group = "nextcloud"; - dataDir = "${config.waffentragerService.elements.path}/storage/materus"; - configDir = "${config.waffentragerService.elements.path}/storage/materus/Inne/Config/Syncthing/waffentrager/"; - }; - }; - }; -} diff --git a/configurations/profile/common/default.nix b/configurations/profile/common/default.nix deleted file mode 100644 index 6a47f68..0000000 --- a/configurations/profile/common/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ config, pkgs, lib, materusCfg, ... }: -let - materusArg = { - pkgs = (import materusCfg.nixerus { inherit pkgs; }) // - (if pkgs.system == "x86_64-linux" then { i686Linux = import materusCfg.nixerus { pkgs = pkgs.pkgsi686Linux; }; } else { }); - cfg = materusCfg; - unstable = import materusCfg.materusFlake.inputs.nixpkgs { system = materusCfg.arch; config = { allowUnfree = true; nvidia.acceptLicense = true; }; }; - - }; -in -{ - imports = [ - ./nixpkgs.nix - ./packages - ./private - ]; - options.materus.materusArg = lib.mkOption { default = { }; }; - config._module.args.materusArg = config.materus.materusArg // materusArg; - config.assertions = [ - { - assertion = materusCfg.materusFlake.decrypted; - message = "Repository not decrypted, use crypt.sh to decrypt"; - } - ]; - - - -} diff --git a/configurations/profile/common/nixpkgs.nix b/configurations/profile/common/nixpkgs.nix deleted file mode 100644 index 8817fbf..0000000 --- a/configurations/profile/common/nixpkgs.nix +++ /dev/null @@ -1,99 +0,0 @@ -{ config, pkgs, lib, materusArg, materusCfg, ... }: -let - mkBoolOpt = default: description: lib.mkOption { - inherit default; - inherit description; - type = lib.types.bool; - example = true; - }; - - cfg = config.materus.profile.nixpkgs; -in -{ - options.materus.profile.nixpkgs.enable = mkBoolOpt false "Enable materus nixpkgs config"; - options.materus.profile.nixpkgs.enableOverlays = mkBoolOpt (cfg.enable) "Enable materus overlays"; - options.materus.profile.nix.enableRegistry = mkBoolOpt (!materusCfg.isHm) "Enable materus nix registry"; - - config.nixpkgs.config = lib.mkIf cfg.enable { - allowUnfree = lib.mkDefault true; - joypixels.acceptLicense = lib.mkDefault true; - }; - config.nixpkgs.overlays = lib.mkIf cfg.enableOverlays [ materusArg.cfg.configInputs.emacs-overlay.overlay ]; - - config.nix.package = lib.mkDefault pkgs.nixVersions.latest; - config.nix.registry = lib.mkIf config.materus.profile.nix.enableRegistry { - nixpkgs-stable = { - from = { type = "indirect"; id = "nixpkgs-stable"; }; - flake = materusCfg.materusFlake.inputs.nixpkgs-stable; - }; - nixpkgs-unstable = { - from = { type = "indirect"; id = "nixpkgs-unstable"; }; - flake = materusCfg.materusFlake.inputs.nixpkgs; - }; - - nixpkgs = { - from = { type = "indirect"; id = "nixpkgs"; }; - flake = materusCfg.configInputs.nixpkgs; - }; - - emacs-overlay = { - from = { type = "indirect"; id = "emacs-overlay"; }; - flake = materusCfg.configInputs.emacs-overlay; - }; - - flake-utils = { - from = { type = "indirect"; id = "flake-utils"; }; - flake = materusCfg.configInputs.flake-utils; - }; - - nixos-hardware = { - from = { type = "indirect"; id = "nixos-hardware"; }; - flake = materusCfg.configInputs.nixos-hardware; - }; - - nixerus = { - from = { type = "indirect"; id = "nixerus"; }; - flake = materusCfg.configInputs.nixerus; - }; - - devshell = { - from = { type = "indirect"; id = "devshell"; }; - flake = materusCfg.configInputs.devshell; - }; - - home-manager = { - from = { type = "indirect"; id = "home-manager"; }; - flake = materusCfg.configInputs.home-manager; - }; - - sops-nix = { - from = { type = "indirect"; id = "sops-nix"; }; - flake = materusCfg.configInputs.sops-nix; - }; - - base16 = { - from = { type = "indirect"; id = "base16"; }; - flake = materusCfg.configInputs.base16; - }; - - git-agecrypt = { - from = { type = "indirect"; id = "git-agecrypt"; }; - flake = materusCfg.configInputs.git-agecrypt; - }; - - plasma-manager = { - from = { type = "indirect"; id = "plasma-manager"; }; - flake = materusCfg.configInputs.plasma-manager; - }; - - nur = { - from = { type = "indirect"; id = "nur"; }; - flake = materusCfg.configInputs.nur; - }; - nix-vscode-extensions = { - from = { type = "indirect"; id = "nix-vscode-extensions"; }; - flake = materusCfg.configInputs.nix-vscode-extensions; - }; - - }; -} diff --git a/configurations/profile/common/packages/default.nix b/configurations/profile/common/packages/default.nix deleted file mode 100644 index dbd91fe..0000000 --- a/configurations/profile/common/packages/default.nix +++ /dev/null @@ -1,76 +0,0 @@ -{ - config, - pkgs, - lib, - materusArg, - ... -}: -with materusArg.pkgs.lib; -{ - imports = [ ./fonts.nix ]; - - #Single Packages - options.materus.profile.packages.home-manager = - mkPrivateVar - materusArg.cfg.configInputs.home-manager.packages.${pkgs.system}.home-manager; - options.materus.profile.packages.firefox = mkPrivateVar ( - pkgs.firefox.override { nativeMessagingHosts = [ pkgs.plasma-browser-integration ]; } - ); - - #Package Lists - options.materus.profile.packages.list.nixRelated = mkPrivateVar ( - with pkgs; - [ - nix-prefetch - nix-prefetch-scripts - nix-prefetch-github - nix-prefetch-docker - nixfmt-rfc-style - nix-top - nix-tree - nix-diff - nix-ld - nixpkgs-fmt - nixpkgs-review - ] - ); - - options.materus.profile.packages.list.desktopApps = mkPrivateVar ( - with pkgs; - [ - (discord.override { - nss = nss_latest; - withOpenASAR = true; - withTTS = true; - }) - tdesktop - syncplay - ani-cli - nextcloud-client - spotify - thunderbird - keepassxc - (aspellWithDicts ( - ds: with ds; [ - en - en-computers - en-science - pl - ] - )) - onlyoffice-bin - qalculate-qt - ] - ); - - options.materus.profile.packages.list.terminalApps = mkPrivateVar ( - with pkgs; - [ - neofetch - ripgrep - fd - micro - ] - ); - -} diff --git a/configurations/profile/common/packages/fonts.nix b/configurations/profile/common/packages/fonts.nix deleted file mode 100644 index f80c4c6..0000000 --- a/configurations/profile/common/packages/fonts.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ pkgs, lib, ... }: - -let - defaultFonts = [ - pkgs.dejavu_fonts - pkgs.freefont_ttf - pkgs.gyre-fonts - pkgs.liberation_ttf - pkgs.unifont - ]; - fonts = [ - pkgs.noto-fonts - pkgs.noto-fonts-extra - pkgs.noto-fonts-emoji - pkgs.noto-fonts-cjk-sans - pkgs.noto-fonts-cjk-serif - pkgs.wqy_zenhei - pkgs.corefonts - pkgs.hack-font - (pkgs.nerdfonts.override { fonts = [ "Hack" ]; }) - - ] ++ defaultFonts; - - moreFonts = [ - pkgs.ubuntu_font_family - pkgs.monocraft - (pkgs.nerdfonts.override { fonts = [ "DroidSansMono" "Meslo" "ProFont" "FiraCode"]; }) - ]; -in -{ - - options.materus.profile.packages.list.fonts = lib.mkOption { default = fonts; readOnly = true; visible = false; }; - options.materus.profile.packages.list.moreFonts = lib.mkOption { default = moreFonts; readOnly = true; visible = false; }; - -} diff --git a/configurations/profile/common/private/default.nix b/configurations/profile/common/private/default.nix deleted file mode 100644 index 2a33b9c..0000000 Binary files a/configurations/profile/common/private/default.nix and /dev/null differ diff --git a/configurations/profile/default.nix b/configurations/profile/default.nix deleted file mode 100644 index 1a161ce..0000000 --- a/configurations/profile/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - osProfile = { - imports = [ - ./os - ./common - ]; - }; - - homeProfile = { - imports = [ - ./common - ./home - ]; - }; - -} diff --git a/configurations/profile/home/browser.nix b/configurations/profile/home/browser.nix deleted file mode 100644 index b26534c..0000000 --- a/configurations/profile/home/browser.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ config, lib, pkgs, materusArg, ... }: -let - cfg = config.materus.profile.browser; - osConfig = (if (builtins.hasAttr "osConfig" config._module.args) then config._module.args.osConfig else null); -in -{ - - options = let mkBoolOpt = materusArg.pkgs.lib.mkBoolOpt; in { - materus.profile.browser.firefox.enable = mkBoolOpt false "Enable Firefox with materus cfg"; - materus.profile.browser.vivaldi.enable = mkBoolOpt false "Enable Vivaldi with materus cfg"; - materus.profile.browser.brave.enable = mkBoolOpt false "Enable Brave with materus cfg"; - - }; - #TODO: Make some config - config = lib.mkMerge [{ - home.packages = [ - (lib.mkIf cfg.firefox.enable config.materus.profile.packages.firefox) - (lib.mkIf cfg.vivaldi.enable pkgs.vivaldi) - (lib.mkIf cfg.brave.enable pkgs.brave) - ] ++ [ (lib.mkIf (osConfig != null && osConfig.materus.profile.browser.enable) osConfig.materus.profile.browser.package)]; - } - ]; - - -} diff --git a/configurations/profile/home/default.nix b/configurations/profile/home/default.nix deleted file mode 100644 index 37da3a0..0000000 --- a/configurations/profile/home/default.nix +++ /dev/null @@ -1,85 +0,0 @@ -{ config, lib, pkgs, materusArg, ... }: -let - packages = cfg.packages; - cfg = config.materus.profile; -in -{ - imports = [ - ./fonts.nix - ./browser.nix - ./xdg.nix - - ./shell - ./editor - ./terminal - - ]; - options.materus.profile.enableDesktop = materusArg.pkgs.lib.mkBoolOpt false "Enable settings for desktop"; - options.materus.profile.enableTerminal = materusArg.pkgs.lib.mkBoolOpt true "Enable settings for terminal"; - options.materus.profile.enableTerminalExtra = materusArg.pkgs.lib.mkBoolOpt false "Enable extra settings for terminal"; - options.materus.profile.enableNixDevel = materusArg.pkgs.lib.mkBoolOpt false "Enable settings for nix devel"; - - config = - { - - home.packages = (if cfg.enableDesktop then packages.list.desktopApps else [ ]) ++ - (if cfg.enableNixDevel then packages.list.nixRelated else [ ]) ++ - (if cfg.enableTerminal then packages.list.terminalApps else [ ]); - #Desktop - programs.feh.enable = lib.mkDefault cfg.enableDesktop; - programs.mpv = lib.mkIf cfg.enableDesktop { - enable = true; - config = { - ytdl-format = "bestvideo+bestaudio"; - slang="pl,pol,Polish,Polski,en,eng,English"; - alang="ja,jp,jpn,Japanese,pl,pol,Polski,en,eng,English"; - demuxer-max-bytes="500MiB"; - demuxer-max-back-bytes="150MiB"; - cache="yes"; - cache-pause-wait="10"; - cache-pause-initial="yes"; - keep-open="yes"; - }; - }; - - #Terminal - programs.git = { - enable = lib.mkDefault cfg.enableTerminal; - package = lib.mkDefault pkgs.gitFull; - delta.enable = lib.mkDefault cfg.enableTerminal; - lfs.enable = lib.mkDefault cfg.enableTerminal; - }; - programs.gitui.enable = cfg.enableTerminalExtra; - - programs.nix-index = { - enable = lib.mkDefault cfg.enableTerminal; - enableBashIntegration = lib.mkDefault config.programs.bash.enable; - enableFishIntegration = lib.mkDefault config.programs.fish.enable; - enableZshIntegration = lib.mkDefault config.programs.zsh.enable; - }; - - programs.direnv = { - enable = lib.mkDefault (cfg.enableTerminalExtra || cfg.enableNixDevel); - nix-direnv.enable = lib.mkDefault (cfg.enableNixDevel && (config.programs.direnv.enable == true)); - enableBashIntegration = lib.mkDefault config.programs.bash.enable; - #enableFishIntegration = lib.mkDefault config.programs.fish.enable; - enableZshIntegration = lib.mkDefault config.programs.zsh.enable; - }; - - - - programs.fzf = { - enable = lib.mkDefault cfg.enableTerminalExtra; - enableBashIntegration = lib.mkDefault config.programs.bash.enable; - enableFishIntegration = lib.mkDefault config.programs.fish.enable; - enableZshIntegration = lib.mkDefault config.programs.zsh.enable; - }; - - programs.eza.enable = lib.mkDefault cfg.enableTerminalExtra; - - programs.yt-dlp.enable = lib.mkDefault cfg.enableTerminalExtra; - - }; - - -} diff --git a/configurations/profile/home/editor/code.nix b/configurations/profile/home/editor/code.nix deleted file mode 100644 index 8502e91..0000000 --- a/configurations/profile/home/editor/code.nix +++ /dev/null @@ -1,152 +0,0 @@ -{ config, lib, pkgs, materusArg, materusCfg, ... }: -let - cfg = config.materus.profile.editor.code; - ext = let - market = - (materusCfg.configInputs.nix-vscode-extensions.extensions."${materusCfg.arch}".forVSCodeVersion - config.programs.vscode.package.version); - marketNv = - (materusCfg.configInputs.nix-vscode-extensions.extensions."${materusCfg.arch}"); - in with market; - with pkgs; [ - #Cpp - open-vsx.twxs.cmake - vscode-extensions.ms-vscode.cpptools - vscode-marketplace.ms-vscode.cmake-tools - vscode-marketplace.cs128.cs128-clang-tidy - - #Python - vscode-marketplace.ms-python.python - vscode-marketplace.ms-python.vscode-pylance - vscode-marketplace.ms-python.debugpy - - # CSharp - open-vsx.muhammad-sammy.csharp - - #Java - vscode-marketplace.redhat.java - vscode-marketplace.vscjava.vscode-java-debug - vscode-marketplace.vscjava.vscode-java-test - vscode-marketplace.vscjava.vscode-gradle - vscode-marketplace.vscjava.vscode-java-dependency - - #JS - vscode-marketplace.angular.ng-template - #DLang - open-vsx.webfreak.code-d - - #Nix - open-vsx.jnoortheen.nix-ide - - #Web - open-vsx.ecmel.vscode-html-css - open-vsx.formulahendry.auto-close-tag - - #Lua - open-vsx.sumneko.lua - - #YAML, XML - open-vsx.redhat.vscode-yaml - open-vsx.redhat.vscode-xml - - #Git - open-vsx.donjayamanne.githistory - open-vsx.mhutchie.git-graph - open-vsx.eamodio.gitlens - - #Other - open-vsx.ms-azuretools.vscode-docker - open-vsx.webfreak.debug - open-vsx.mkhl.direnv - vscode-marketplace.ms-vscode-remote.remote-wsl - vscode-marketplace.ms-vscode-remote.remote-containers - open-vsx.esbenp.prettier-vscode - open-vsx.formulahendry.code-runner - open-vsx.leonardssh.vscord - open-vsx.ms-vscode.hexeditor - open-vsx.alefragnani.project-manager - vscode-marketplace.cantonios.project-templates - - #Icons - open-vsx.pkief.material-icon-theme - open-vsx.pkief.material-product-icons - #Themes - open-vsx.dracula-theme.theme-dracula - open-vsx.ahmadawais.shades-of-purple - - #Languages - marketNv.vscode-marketplace.ms-ceintl.vscode-language-pack-pl - - ]; - set = { - "vscord.app.name" = lib.mkDefault "VSCodium"; - "window.dialogStyle" = lib.mkDefault "custom"; - "window.titleBarStyle" = lib.mkDefault "custom"; - "editor.fontFamily" = - lib.mkDefault "'Hack Nerd Font', 'monospace', monospace"; - "workbench.colorTheme" = lib.mkDefault "Shades of Purple"; - "workbench.productIconTheme" = lib.mkDefault "material-product-icons"; - "workbench.iconTheme" = lib.mkDefault "material-icon-theme"; - - "d.aggressiveUpdate" = lib.mkDefault false; - "d.servedPath" = lib.mkDefault "${pkgs.serve-d}/bin/serve-d"; - - "direnv.path.executable" = lib.mkDefault "${pkgs.direnv}/bin/direnv"; - - "nix.enableLanguageServer" = lib.mkDefault true; - "nix.serverPath" = lib.mkDefault "${pkgs.nixd}/bin/nixd"; - "nix.formatterPath" = lib.mkDefault "${pkgs.nixfmt-rfc-style}/bin/nixfmt"; - "nix.serverSettings" = { - "nixd" = { "formatting" = { "command" = lib.mkDefault [ "nixfmt" ]; }; }; - }; - - "C_Cpp.clang_format_path" = - lib.mkDefault "${pkgs.clang-tools}/bin/clang-format"; - "C_Cpp.clang_format_fallbackStyle" = lib.mkDefault "Microsoft"; - "clang-tidy.executable" = - lib.mkDefault "${pkgs.clang-tools}/bin/clang-tidy"; - "redhat.telemetry.enabled" = lib.mkDefault false; - "python.defaultInterpreterPath" = - lib.mkDefault "${pkgs.python3Full}/bin/python"; - "[cpp]" = { - "editor.defaultFormatter" = lib.mkDefault "xaver.clang-format"; - }; - "cmake.showOptionsMovedNotification" = false; - "cmake.pinnedCommands" = [ - "workbench.action.tasks.configureTaskRunner" - "workbench.action.tasks.runTask" - ]; - - }; -in { - options.materus.profile.editor.code.enable = - materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableDesktop - "Enable VSCodium with materus cfg"; - options.materus.profile.editor.code.fhs.enable = - materusArg.pkgs.lib.mkBoolOpt false "Use fhs vscodium"; - options.materus.profile.editor.code.fhs.packages = - lib.mkOption { default = (ps: [ ]); }; - options.materus.profile.editor.code.extensions = - lib.mkOption { default = [ ]; }; - options.materus.profile.editor.code.settings = - lib.mkOption { default = { }; }; - config = lib.mkIf cfg.enable { - materus.profile.editor.code.extensions = ext; - materus.profile.editor.code.settings = set; - programs.vscode = { - enable = lib.mkDefault true; - package = lib.mkDefault (if (cfg.fhs.enable) then - (pkgs.vscodium.fhsWithPackages cfg.fhs.packages) - else - pkgs.vscodium); - mutableExtensionsDir = - lib.mkDefault config.materus.profile.editor.code.fhs.enable; - extensions = lib.mkDefault config.materus.profile.editor.code.extensions; - enableExtensionUpdateCheck = - lib.mkDefault config.materus.profile.editor.code.fhs.enable; - enableUpdateCheck = lib.mkDefault false; - userSettings = lib.mkDefault config.materus.profile.editor.code.settings; - }; - materus.profile.fonts.enable = lib.mkDefault true; - }; -} diff --git a/configurations/profile/home/editor/default.nix b/configurations/profile/home/editor/default.nix deleted file mode 100644 index b386d8d..0000000 --- a/configurations/profile/home/editor/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - imports = [ - ./code.nix - ./neovim.nix - ./emacs - ]; -} diff --git a/configurations/profile/home/editor/emacs/default.nix b/configurations/profile/home/editor/emacs/default.nix deleted file mode 100644 index b65b76c..0000000 --- a/configurations/profile/home/editor/emacs/default.nix +++ /dev/null @@ -1,390 +0,0 @@ -{ - config, - lib, - pkgs, - materusArg, - materusCfg, - ... -}: -let - emacs-pkg = materusCfg.configInputs.emacs-overlay.packages.x86_64-linux.emacs-unstable; - - materus-config = - e: - e.trivialBuild { - pname = "materus-config"; - src = pkgs.writeText "materus-config.el" '' - (when (file-exists-p "${config.programs.emacs.package}/opt/emacs/buildtime") - (setq emacs-build-time (decode-time (seconds-to-time (string-to-number (with-temp-buffer - (insert-file-contents "${config.programs.emacs.package}/opt/emacs/buildtime") - (buffer-string))))))) - (provide 'materus-config) - ''; - version = "1.0.0"; - }; - - configPath = "${materusArg.cfg.path}" + "/extraFiles/config/emacs/"; - packages = - epkgs: with epkgs; [ - (materus-config epkgs) - treesit-grammars.with-all-grammars - use-package - elcord - dashboard - magit - git-timemachine - avy - vterm - direnv - projectile - clipetty - which-key - iedit - hideshowvis - perspective - treemacs - treemacs-perspective - treemacs-nerd-icons - treemacs-icons-dired - treemacs-magit - treemacs-projectile - tree-edit - nerd-icons - nerd-icons-completion - minions - rainbow-delimiters - rainbow-mode - cmake-mode - lsp-mode - lsp-java - lsp-jedi - lsp-haskell - lsp-pascal - lsp-pyright - lsp-ui - lsp-treemacs - dap-mode - flycheck - gradle-mode - groovy-mode - kotlin-mode - d-mode - lua-mode - multiple-cursors - org - org-contrib - org-ql - org-rainbow-tags - org-roam - org-roam-ui - org-review - org-present - org-modern - org-auto-tangle - visual-fill-column - csharp-mode - markdown-mode - json-mode - nix-mode - nixfmt - nix-ts-mode - no-littering - right-click-context - dracula-theme - doom-themes - doom-modeline - popper - undo-tree - bash-completion - eldoc-box - yasnippet - yasnippet-capf - async - request - markdown-ts-mode - llvm-ts-mode - treesit-fold - treesit-auto - tree-sitter-langs - eat - vlf - edit-indirect - zones - sudo-edit - toc-org - empv - volatile-highlights - highlight - elfeed - elfeed-goodies - drag-stuff - dirvish - rg - shfmt - mermaid-mode - ob-mermaid - visual-replace - scroll-restore - highlight-indent-guides - diff-hl - transient - embark - embark-consult - ef-themes - pdf-tools - minimap - geiser-guile - fennel-mode - paredit - # Completions & Minibuffer - corfu - corfu-terminal - kind-icon - cape - orderless - vertico - marginalia - ]; - - emacsEnv = pkgs.buildEnv { - name = "emacs-env"; - paths = with pkgs; [ - luaformatter - (luajit.withPackages (p: [p.fennel p.lua-lsp])) - fennel-ls - fnlfmt - - guile - plantuml - mermaid-cli - pyright - shfmt - ripgrep - cmake - gnumake - nixfmt-rfc-style - python3Full - multimarkdown - git - emacs-lsp-booster - llvmPackages.clang-tools - llvmPackages.clang - llvmPackages.lldb - (hiPrio gcc) - gdb - materusArg.unstable.nixd - jdt-language-server - jdk - gradle - fpc - nodejs - omnisharp-roslyn - texlive.combined.scheme-full - ]; - }; - - cfg = config.materus.profile.editor.emacs; - - setNixInit = '' - (defvar lsp-java-configuration-runtimes nil) - (setq dap-lldb-debug-program '("${pkgs.llvmPackages.lldb}/bin/lldb-vscode")) - (setq lsp-java-configuration-runtimes '[(:name "JavaSE-1.8" - :path "${pkgs.jdk8}/lib/openjdk/") - (:name "JavaSE-17" - :path "${pkgs.jdk17}/lib/openjdk/") - (:name "JavaSE-21" - :path "${pkgs.jdk21}/lib/openjdk/" - :default t)]) - (setq lsp-nix-nixd-nixos-options-expr (concat "(builtins.getFlake \"/etc/nixos\").nixosConfigurations." (system-name) ".options")) - (setenv "PATH" (concat (getenv "PATH") ":${emacsEnv}/bin")) - (setq exec-path (append exec-path '("${emacsEnv}/bin"))) - (call-process-shell-command "${pkgs.xorg.xmodmap}/bin/xmodmap -e \"keycode 148 = Hyper_L\" -e \"remove Mod4 = Hyper_L\" -e \"add Mod3 = Hyper_L\" &" nil 0) - (call-process-shell-command "${pkgs.xorg.xmodmap}/bin/xmodmap -e \"keycode 66 = Hyper_L\" -e \"remove Mod4 = Hyper_L\" -e \"add Mod3 = Hyper_L\" &" nil 0) - ''; -in -{ - options.materus.profile.editor.emacs.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable emacs with materus cfg"; - - config = lib.mkIf cfg.enable { - home.activation.emacsSetup = lib.hm.dag.entryAfter [ "linkGeneration" ] '' - mkdir -p ${config.xdg.configHome}/emacs/var/recovery - mkdir -p ${config.xdg.configHome}/emacs/etc/materus - mkdir -p ${config.xdg.configHome}/emacs/var/backups - ${pkgs.rsync}/bin/rsync -zr --no-times --chmod=744 "${configPath}" "${config.xdg.configHome}/emacs" - - - run ${config.programs.emacs.finalPackage}/bin/emacs -Q --batch \ - --eval '(setq warning-minimum-log-level :error)' \ - --eval '(setq package-user-dir (concat user-emacs-directory "var/elpa/" emacs-version "/" ))' \ - --eval '(setq package-gnupghome-dir (concat user-emacs-directory "var/elpa/gnupg/" ))' \ - --eval '(package-initialize)' \ - --eval '(byte-recompile-directory (concat user-emacs-directory "etc/materus/extra") 0 t)' \ - --eval '(byte-compile-file "${config.xdg.configHome}/emacs/early-init.el")' \ - --eval '(byte-compile-file "${config.xdg.configHome}/emacs/init.el")' \ - --eval '(byte-compile-file "${config.xdg.configHome}/emacs/etc/materus/nix-init.el")' \ - --eval '(byte-compile-file "${config.xdg.configHome}/emacs/etc/materus/emacs-config.el")' - ''; - - xdg.configFile = { - "emacs/etc/materus/nix-init.el".text = setNixInit; - }; - - #Emacsclient with COLORTERM env variable, without it display in "-nw" client is broken - xdg.desktopEntries.emacs = { - name = "Emacs"; - genericName = "Edytor tekstu"; - comment = "Edytuj tekst"; - exec = ''env COLORTERM=truecolor emacsclient -a "" -r %F''; - icon = "emacs"; - terminal = false; - type = "Application"; - categories = [ - "Development" - "TextEditor" - ]; - mimeType = [ - "text/english" - "text/plain" - "text/x-makefile" - "text/x-c++hdr" - "text/x-c++src" - "text/x-chdr" - "text/x-csrc" - "text/x-java" - "text/x-moc" - "text/x-pascal" - "text/x-tcl" - "text/x-tex" - "application/x-shellscript" - "text/x-c" - "text/x-c++" - "x-scheme-handler/org-protocol" - ]; - actions.new-window = { - exec = ''env COLORTERM=truecolor emacsclient -a "" -c %F''; - name = "Nowe okno"; - }; - actions.no-daemon = { - exec = "env COLORTERM=truecolor emacs %F"; - name = "Instancja samodzielna"; - }; - }; - - programs.emacs = { - enable = true; - package = lib.mkDefault ( - (emacs-pkg.override { - withSQLite3 = true; - withWebP = true; - withX = true; - #withXwidgets = true; - withGTK3 = true; - withAlsaLib = true; - withGconf = true; - withImageMagick = true; - }).overrideAttrs - ( - f: p: { - #Remove .desktop files, will use my own. Add file with buildtime in case of using elpaca - postInstall = - p.postInstall - + '' - rm -fr $out/share/applications/* - mkdir -p $out/opt/emacs - date +%s | tr -d '\n' > $out/opt/emacs/buildtime - ''; - } - ) - ); - extraPackages = - epkgs: - (packages ( - epkgs.overrideScope ( - ff: pp: { - #Build lsp-mode with plist support, need to set this in emacs too - - lsp-mode = ( - pp.lsp-mode.overrideAttrs ( - f: p: { - patches = [ ./lsp-mode.patch ]; - buildPhase = - '' - export LSP_USE_PLISTS=true - '' - + p.buildPhase; - } - ) - ); - lsp-java = ( - pp.lsp-java.overrideAttrs ( - f: p: { - buildPhase = - '' - export LSP_USE_PLISTS=true - '' - + p.buildPhase; - } - ) - ); - lsp-jedi = ( - pp.lsp-jedi.overrideAttrs ( - f: p: { - buildPhase = - '' - export LSP_USE_PLISTS=true - '' - + p.buildPhase; - } - ) - ); - lsp-haskell = ( - pp.lsp-haskell.overrideAttrs ( - f: p: { - buildPhase = - '' - export LSP_USE_PLISTS=true - '' - + p.buildPhase; - } - ) - ); - lsp-ui = ( - pp.lsp-ui.overrideAttrs ( - f: p: { - buildPhase = - '' - export LSP_USE_PLISTS=true - '' - + p.buildPhase; - } - ) - ); - lsp-treemacs = ( - pp.lsp-treemacs.overrideAttrs ( - f: p: { - buildPhase = - '' - export LSP_USE_PLISTS=true - '' - + p.buildPhase; - } - ) - ); - dap-mode = ( - pp.dap-mode.overrideAttrs ( - f: p: { - buildPhase = - '' - export LSP_USE_PLISTS=true - '' - + p.buildPhase; - } - ) - ); - } - ) - )); - }; - - }; -} diff --git a/configurations/profile/home/editor/emacs/lsp-mode.patch b/configurations/profile/home/editor/emacs/lsp-mode.patch deleted file mode 100644 index 458809e..0000000 --- a/configurations/profile/home/editor/emacs/lsp-mode.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 75e41ae5bd1c0879b323ed0ddc4bac29badb29ff Mon Sep 17 00:00:00 2001 -From: fanshi1028 -Date: Fri, 1 Nov 2024 14:41:26 +0000 -Subject: [PATCH] fix lsp-org breaks with org 9.7 (#4300) - ---- - lsp-mode.el | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lsp-mode.el b/lsp-mode.el -index f5c700dbf3..a149d6d2c7 100644 ---- a/lsp-mode.el -+++ b/lsp-mode.el -@@ -9668,7 +9668,7 @@ defaults to `progress-bar." - (save-excursion - (funcall goto-buffer) - (funcall f)))))) -- ((&plist :begin :end :post-blank :language) (cl-second (org-element-context))) -+ ((begin end post-blank language) (--map (org-element-property it (org-element-context) nil t) '(:begin :end :post-blank :language))) - ((&alist :tangle file-name) (cl-third (org-babel-get-src-block-info 'light))) - - (file-name (if file-name \ No newline at end of file diff --git a/configurations/profile/home/editor/neovim.nix b/configurations/profile/home/editor/neovim.nix deleted file mode 100644 index 46585ed..0000000 --- a/configurations/profile/home/editor/neovim.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ config, lib, pkgs, materusArg, ... }: -let - cfg = config.materus.profile.editor.neovim; -in -{ - options.materus.profile.editor.neovim.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableTerminalExtra "Enable neovim with materus cfg"; - config = lib.mkIf cfg.enable { - programs.neovim = { - enable = true; - package = materusArg.unstable.neovim-unwrapped; - coc.enable = true; - coc.package = materusArg.unstable.vimPlugins.coc-nvim; - viAlias = true; - vimAlias = true; - vimdiffAlias = true; - defaultEditor = lib.mkDefault false; - - - extraConfig = '' - set number - ''; - extraLuaConfig = '' - ''; - - extraPackages = with pkgs;[ - ]; - - plugins = with materusArg.unstable.vimPlugins;[ - syntastic - vim-fugitive - vim-airline - vim-nix - nvim-fzf - nvim-treesitter.withAllGrammars - - ]; - }; - }; - -} diff --git a/configurations/profile/home/fonts.nix b/configurations/profile/home/fonts.nix deleted file mode 100644 index 40d9cde..0000000 --- a/configurations/profile/home/fonts.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -let - packages = config.materus.profile.packages; - cfg = config.materus.profile.fonts; -in -{ - options.materus.profile.fonts.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable materus font settings"; - - config = lib.mkIf cfg.enable { - fonts.fontconfig.enable = lib.mkDefault true; - home.packages = packages.list.fonts; - }; -} diff --git a/configurations/profile/home/shell/bash.nix b/configurations/profile/home/shell/bash.nix deleted file mode 100644 index b674545..0000000 --- a/configurations/profile/home/shell/bash.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -let - cfg = config.materus.profile.bash; -in -{ - options.materus.profile.bash.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableTerminal "Enable materus bash config"; - - - config = lib.mkIf cfg.enable { - - programs.bash = { - - enable = true; - enableCompletion = lib.mkDefault true; - enableVteIntegration = lib.mkDefault true; - historyControl = lib.mkDefault [ "erasedups" "ignorespace" ]; - shellOptions = lib.mkDefault [ "autocd" "checkwinsize" "cmdhist" "expand_aliases" "extglob" "globstar" "checkjobs" "nocaseglob" ]; - initExtra = '' - if [ -n "$EAT_SHELL_INTEGRATION_DIR" ]; then - source "$EAT_SHELL_INTEGRATION_DIR/bash"; - fi - ''; - }; - }; - -} diff --git a/configurations/profile/home/shell/default.nix b/configurations/profile/home/shell/default.nix deleted file mode 100644 index ea28819..0000000 --- a/configurations/profile/home/shell/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{config, pkgs, lib, ...}: -{ - - imports = [ - ./zsh.nix - ./bash.nix - ./fish.nix - ./starship.nix - ]; - home.sessionVariables = { - EDITOR = lib.mkDefault (if (config.materus.profile.editor.emacs.enable) then - lib.getBin (pkgs.writeShellScript "editor" ''${config.programs.emacs.finalPackage}/bin/emacsclient --alternate-editor= -c -nw $@'') - else "${pkgs.micro}/bin/micro"); - VISUAL = lib.mkDefault (if (config.materus.profile.editor.emacs.enable) then - lib.getBin (pkgs.writeShellScript "editor-visual" ''exec env COLORTERM=truecolor ${config.programs.emacs.finalPackage}/bin/emacsclient --alternate-editor= -c $@'') - else "${pkgs.micro}/bin/micro"); - }; -} diff --git a/configurations/profile/home/shell/fish.nix b/configurations/profile/home/shell/fish.nix deleted file mode 100644 index a85c150..0000000 --- a/configurations/profile/home/shell/fish.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -let - cfg = config.materus.profile.fish; -in -{ - options.materus.profile.fish.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableTerminalExtra "Enable materus fish config"; - config = lib.mkIf cfg.enable { - programs.fish = { - enable = true; - }; - }; -} diff --git a/configurations/profile/home/shell/starship.nix b/configurations/profile/home/shell/starship.nix deleted file mode 100644 index 8b88759..0000000 --- a/configurations/profile/home/shell/starship.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -let - profile = config.materus.profile; - cfg = config.materus.profile.starship; -in -{ - options.materus.profile.starship.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable materus starship config"; - - config = lib.mkIf cfg.enable { - programs.starship.enable = true; - - programs.starship.settings = { - - python = { - symbol = " "; - }; - - format = "$username@$hostname$all"; - right_format = "$cmd_duration $time"; - - time = { - disabled = false; - style = "bold bright-black"; - format = "[$time]($style)"; - }; - - line_break = { disabled = true; }; - shell = { - disabled = false; - fish_indicator = "fish"; - bash_indicator = "bash"; - zsh_indicator = "zsh"; - style = "blue bold"; - }; - - hostname = { - ssh_only = false; - }; - username = { - disabled = false; - show_always = true; - format = "[$user]($style)"; - style_user = "white bold"; - style_root = "black bold"; - }; - }; - }; -} diff --git a/configurations/profile/home/shell/zsh.nix b/configurations/profile/home/shell/zsh.nix deleted file mode 100644 index 9614951..0000000 --- a/configurations/profile/home/shell/zsh.nix +++ /dev/null @@ -1,202 +0,0 @@ -{ - config, - pkgs, - lib, - materusArg, - ... -}: -let - - relToDotDir = - file: - (lib.optionalString (config.programs.zsh.dotDir != null) (config.programs.zsh.dotDir + "/")) + file; - pluginsDir = - if config.programs.zsh.dotDir != null then - relToDotDir "plugins" - else - "${config.home.homeDirectory}/.zsh/plugins"; - - p10kcfg = "${zshcfg}/p10kcfg"; - zshcfg = "${materusArg.cfg.path}" + "/extraFiles/config/zsh"; - cfg = config.materus.profile.zsh; - - makeEnv = name: val: ''${name}=''${${name}:-"${val}"}''; - makeIfVar = var: val: ret: '' - if [[ "''$${var}" = "${val}" ]]; then - ${ret} - fi - ''; - - makePlugin = nameArg: fileArg: srcArg: rec { - name = nameArg; - src = srcArg; - path = pluginsDir + "/" + name; - file = fileArg; - fullPath = path + "/" + file; - }; - - extraPlugins = { - powerlevel10k = makePlugin "powerlevel10k" "powerlevel10k.zsh-theme" ( - pkgs.fetchFromGitHub { - owner = "romkatv"; - repo = "powerlevel10k"; - rev = "v1.20.0"; - sha256 = "sha256-ES5vJXHjAKw/VHjWs8Au/3R+/aotSbY7PWnWAMzCR8E="; - } - ); - sudo = makePlugin "sudo" "sudo.plugin.zsh" "${pkgs.oh-my-zsh}/share/oh-my-zsh/plugins/sudo"; - extract = - makePlugin "extract" "extract.plugin.zsh" - "${pkgs.oh-my-zsh}/share/oh-my-zsh/plugins/extract"; - - }; -in -{ - options.materus.profile.zsh.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableTerminalExtra "Enable materus zsh config"; - options.materus.profile.zsh.prompt = lib.mkOption { - type = lib.types.enum [ "p10k" ]; - example = "p10k"; - default = "p10k"; - }; - options.materus.profile.zsh.endConfig = lib.mkOption { - default = ""; - description = "Zsh config after all of config"; - type = lib.types.lines; - }; - - config = lib.mkIf cfg.enable { - home.packages = [ pkgs.ripgrep ]; - - home.file = lib.mkMerge [ - (builtins.foldl' (a: b: a // b) { } ( - builtins.map (plugin: { ${plugin.path}.source = plugin.src; }) (builtins.attrValues extraPlugins) - )) - { "${relToDotDir ".zshrc"}".text = lib.mkAfter cfg.endConfig; } - ]; - - programs.zsh = { - enable = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - enableVteIntegration = true; - historySubstringSearch.enable = true; - historySubstringSearch.searchUpKey = "$key[Up]"; - historySubstringSearch.searchDownKey = "$key[Down]"; - - envExtra = '' - ${makeEnv "__MATERUS_HM_ZSH" "1"} - ${makeEnv "__MATERUS_HM_ZSH_PROMPT" cfg.prompt} - ${makeEnv "__MATERUS_HM_ZSH_PRIVATE" "0"} - ''; - initExtraFirst = '' - bindkey -e - if [ -n "$EAT_SHELL_INTEGRATION_DIR" ]; then - source "$EAT_SHELL_INTEGRATION_DIR/zsh"; - fi - - ${makeIfVar "__MATERUS_HM_ZSH_PROMPT" "p10k" '' - if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then - source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" - fi - if [[ -f "${extraPlugins.powerlevel10k.fullPath}" ]]; then - source "${extraPlugins.powerlevel10k.fullPath}" - fi - ''} - if zmodload zsh/terminfo && (( "$terminfo[colors]" >= "256" )); then - __MATERUS_HM_ZSH_256COLORS="''${__MATERUS_HM_ZSH_256COLORS:-1}"; else - __MATERUS_HM_ZSH_256COLORS="''${__MATERUS_HM_ZSH_256COLORS:-0}"; - fi - - if [[ -f "${extraPlugins.sudo.fullPath}" ]]; then - source "${extraPlugins.sudo.fullPath}" - fi - if [[ -f "${extraPlugins.extract.fullPath}" ]]; then - source "${extraPlugins.extract.fullPath}" - path+="${extraPlugins.extract.path}" - fpath+="${extraPlugins.extract.path}" - fi - ''; - - plugins = [ ]; - - history = { - extended = true; - save = 100000; - size = 100000; - share = true; - ignoreDups = true; - ignoreAllDups = true; - ignoreSpace = true; - }; - - completionInit = '' - ZSH_COMPDUMP="''${ZSH_COMPDUMP:-''${XDG_CACHE_HOME:-${config.home.homeDirectory}/.cache}/.zcompdump-''${HOST}-''${ZSH_VERSION}}" - autoload -U compinit && compinit -d $ZSH_COMPDUMP - ''; - initExtra = - '' - if [[ "$__ETC_ZSHRC_SOURCED" != "1" ]]; then - . ${zshcfg}/zinputrc - fi - source ${zshcfg}/zshcompletion.zsh - - history-substring-search-up-prefixed(){ - HISTORY_SUBSTRING_SEARCH_PREFIXED=1 history-substring-search-up - } - history-substring-search-down-prefixed(){ - HISTORY_SUBSTRING_SEARCH_PREFIXED=1 history-substring-search-down - } - - - zle -N history-substring-search-up-prefixed - zle -N history-substring-search-down-prefixed - - - bindkey -r "^[" - bindkey "^[[1;5C" forward-word - bindkey "^[[1;5D" backward-word - bindkey "^[[1;5A" history-substring-search-up-prefixed - bindkey "^[[1;5B" history-substring-search-down-prefixed - - bindkey '^[[3~' delete-char - bindkey '^[[3;2~' delete-word - - zsh-private() { - __MATERUS_HM_ZSH_PRIVATE=1 ${lib.getExe config.programs.zsh.package} - } - - myip() { - ${lib.getExe pkgs.wget} -qO- https://wtfismyip.com/text - } - - speedtest() { - ${lib.getExe pkgs.curl} -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | ${lib.getExe pkgs.python3} - } - ${lib.optionalString config.materus.profile.editor.emacs.enable ''alias "e"="emacsclient -nw -c --alternate-editor= "''} - ${lib.optionalString config.materus.profile.editor.emacs.enable ''alias "ee"="emacsclient -n -r --alternate-editor= "''} - - - - - '' - + makeIfVar "__MATERUS_HM_ZSH_PROMPT" "p10k" '' - if [[ "$__MATERUS_HM_ZSH_256COLORS" = "1" ]] ; then - [[ ! -f ${p10kcfg}/fullcolor.zsh ]] || source ${p10kcfg}/fullcolor.zsh - else - [[ ! -f ${p10kcfg}/compatibility.zsh ]] || source ${p10kcfg}/compatibility.zsh - fi - '' - + makeIfVar "__MATERUS_HM_ZSH_PRIVATE" "1" '' - unset HISTFILE - ${lib.optionalString config.programs.zsh.history.share "unsetopt SHARE_HISTORY"} - alias -- 'zsh'="__MATERUS_HM_ZSH_PRIVATE=0 zsh " - '' - - ; - - }; - - programs.starship.enableZshIntegration = lib.mkDefault false; - }; - -} diff --git a/configurations/profile/home/terminal/default.nix b/configurations/profile/home/terminal/default.nix deleted file mode 100644 index a947ba7..0000000 --- a/configurations/profile/home/terminal/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{...}: -{ - - imports = [ - ./wezterm.nix - ./tmux.nix - ]; - -} diff --git a/configurations/profile/home/terminal/tmux.nix b/configurations/profile/home/terminal/tmux.nix deleted file mode 100644 index dd28f20..0000000 --- a/configurations/profile/home/terminal/tmux.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ materusArg, config, lib, ... }: -let - cfg = config.materus.profile.tmux; -in -{ - options.materus.profile.tmux.enable = materusArg.pkgs.lib.mkBoolOpt true "Enable materus tmux config"; - config = lib.mkIf cfg.enable - { - programs.tmux = { - enable = true; - clock24 = lib.mkDefault true; - aggressiveResize = lib.mkDefault true; - escapeTime = lib.mkDefault 0; - historyLimit = lib.mkDefault 10000; - mouse = lib.mkDefault true; - terminal = lib.mkDefault "tmux-256color"; - }; - - }; -} diff --git a/configurations/profile/home/terminal/wezterm.nix b/configurations/profile/home/terminal/wezterm.nix deleted file mode 100644 index ab8fc6c..0000000 --- a/configurations/profile/home/terminal/wezterm.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ config, lib, materusArg, pkgs, ... }: -let - cfg = config.materus.profile.wezterm; - zshCfg = '' - source "${config.programs.wezterm.package}/etc/profile.d/wezterm.sh" - ''; -in -{ - options.materus.profile.wezterm.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable materus wezterm config"; - options.materus.profile.wezterm.enableHackFont = materusArg.pkgs.lib.mkBoolOpt true "Enable hack nerd font for wezterm"; - options.materus.profile.wezterm.enableWezcraft = materusArg.pkgs.lib.mkBoolOpt true "Enable alias to start wezcraft with monocraft font"; - options.materus.profile.wezterm.extraConfig = lib.mkOption { - default = ""; - description = "Config for wezterm"; - type = lib.types.lines; - }; - config = lib.mkIf cfg.enable - { - programs.wezterm.enable = true; - programs.wezterm.colorSchemes = { }; - programs.wezterm.enableZshIntegration = false; - programs.wezterm.extraConfig = '' - - package.path = package.path .. ";${materusArg.cfg.path}/extraFiles/config/wezterm/?.lua" - require("wezterm_config"); - local config = materus_wezterm_config(); - ${lib.optionalString cfg.enableHackFont "config.font = wezterm.font 'Hack Nerd Font';"} - ${cfg.extraConfig} - - return config; - ''; - - home.packages = [ - (lib.mkIf cfg.enableHackFont (pkgs.nerdfonts.override { - fonts = [ "Hack" ]; - })) - (lib.mkIf cfg.enableWezcraft (pkgs.monocraft)) - (lib.mkIf cfg.enableWezcraft (pkgs.writeShellScriptBin "wezcraft" '' - ${lib.getExe config.programs.wezterm.package} --config font="wezterm.font 'Monocraft Nerd Font'" $@ - '')) - ]; - - materus.profile.zsh.endConfig = lib.optionalString cfg.enableWezcraft zshCfg; - }; -} diff --git a/configurations/profile/home/xdg.nix b/configurations/profile/home/xdg.nix deleted file mode 100644 index 75bf18b..0000000 --- a/configurations/profile/home/xdg.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ config, lib, materusArg, pkgs, ... }: -{ - - options.materus.profile.xdg = - { - enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable xdg settings"; - }; - - config = - let - cfg = config.materus.profile.xdg; - in - lib.mkIf cfg.enable { - xdg.enable = true; - - xdg.userDirs.enable = lib.mkDefault true; - xdg.userDirs.createDirectories = lib.mkDefault config.xdg.userDirs.enable; - - xdg.userDirs.desktop = lib.mkDefault "${config.home.homeDirectory}/Pulpit"; - xdg.userDirs.documents = lib.mkDefault "${config.home.homeDirectory}/Dokumenty"; - xdg.userDirs.download = lib.mkDefault "${config.home.homeDirectory}/Pobrane"; - xdg.userDirs.music = lib.mkDefault "${config.xdg.userDirs.extraConfig.XDG_AUDIO_DIR}/Muzyka"; - xdg.userDirs.pictures = lib.mkDefault "${config.home.homeDirectory}/Obrazy"; - xdg.userDirs.publicShare = lib.mkDefault "${config.home.homeDirectory}/Publiczny"; - xdg.userDirs.templates = lib.mkDefault "${config.home.homeDirectory}/Szablony"; - xdg.userDirs.videos = lib.mkDefault "${config.home.homeDirectory}/Wideo"; - xdg.userDirs.extraConfig = { - XDG_MISC_DIR = lib.mkDefault "${config.home.homeDirectory}/Inne"; - XDG_PIC_SCREENSHOTS_DIR = lib.mkDefault "${config.xdg.userDirs.pictures}/Zrzuty ekranu"; - XDG_PIC_MEMES_DIR = lib.mkDefault "${config.xdg.userDirs.pictures}/Memy"; - XDG_PIC_MISC_DIR = lib.mkDefault "${config.xdg.userDirs.pictures}/Inne"; - XDG_PIC_PHOTOS_DIR = lib.mkDefault "${config.xdg.userDirs.pictures}/Zdjęcia"; - XDG_PIC_AVATARS_DIR = "${config.xdg.userDirs.pictures}/Avatar"; - XDG_AUDIO_DIR = lib.mkDefault "${config.home.homeDirectory}/Audio"; - XDG_KEYS_DIR = lib.mkDefault "${config.xdg.userDirs.documents}/Klucze"; - }; - }; - - -} diff --git a/configurations/profile/os/default.nix b/configurations/profile/os/default.nix deleted file mode 100644 index 40afbc8..0000000 --- a/configurations/profile/os/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ config, pkgs, lib, ... }: { - imports = [ - ./nix.nix - ./fonts.nix - - ./shell - ./games - ./desktop - ]; - - time.timeZone = lib.mkDefault "Europe/Warsaw"; - i18n.defaultLocale = lib.mkDefault "pl_PL.UTF-8"; - - console = { - enable = lib.mkDefault true; - earlySetup = lib.mkDefault true; - font = lib.mkDefault "LatArCyrHeb-16"; - keyMap = lib.mkDefault "pl"; - }; - environment.sessionVariables = { - MATERUS_CONFIG_DIR = lib.mkDefault "/etc/nixos/"; - }; - - programs.tmux = { - enable = lib.mkDefault true; - clock24 = lib.mkDefault true; - }; - environment.systemPackages = - lib.mkIf config.programs.tmux.enable [ pkgs.tmux.terminfo ]; - -} - - diff --git a/configurations/profile/os/desktop/browser.nix b/configurations/profile/os/desktop/browser.nix deleted file mode 100644 index cd1af1b..0000000 --- a/configurations/profile/os/desktop/browser.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ materusArg, config, pkgs, lib, ... }: -let - cfg = config.materus.profile.browser; -in -{ - options.materus.profile.browser.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable materus default browser config"; - options.materus.profile.browser.default = lib.mkOption { - type = lib.types.enum [ "firefox" "brave" "vivaldi" ]; - example = "vivaldi"; - default = "brave"; - }; - options.materus.profile.browser.package = materusArg.pkgs.lib.mkPrivateVar - (if (cfg.default == "firefox") then config.materus.profile.packages.firefox else - if (cfg.default == "vivaldi") then pkgs.vivaldi else - if (cfg.default == "brave") then pkgs.brave else { }); - config = lib.mkIf cfg.enable { - - environment.systemPackages = [ - config.materus.profile.browser.package - ]; - - }; - -} diff --git a/configurations/profile/os/desktop/default.nix b/configurations/profile/os/desktop/default.nix deleted file mode 100644 index 8f16833..0000000 --- a/configurations/profile/os/desktop/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - - imports = [ - ./browser.nix - ]; -} \ No newline at end of file diff --git a/configurations/profile/os/fonts.nix b/configurations/profile/os/fonts.nix deleted file mode 100644 index 3b47fe4..0000000 --- a/configurations/profile/os/fonts.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ config, pkgs, lib, materusArg, ... }: -let - packages = config.materus.profile.packages; - cfg = config.materus.profile.fonts; -in -{ - options.materus.profile.fonts.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable materus font settings for OS"; - - config = lib.mkIf cfg.enable { - - fonts.packages = packages.list.fonts ++ packages.list.moreFonts; - fonts.enableDefaultPackages = lib.mkDefault true; - - fonts.fontconfig.enable = lib.mkDefault true; - fonts.fontconfig.cache32Bit = lib.mkDefault true; - - fonts.fontconfig.defaultFonts.sansSerif = [ "Noto Sans" "DejaVu Sans" "WenQuanYi Zen Hei" "Noto Color Emoji" ]; - fonts.fontconfig.defaultFonts.serif = [ "Noto Serif" "DejaVu Serif" "WenQuanYi Zen Hei" "Noto Color Emoji" ]; - fonts.fontconfig.defaultFonts.emoji = [ "Noto Color Emoji" "OpenMoji Color" ]; - fonts.fontconfig.defaultFonts.monospace = [ "Hack Nerd Font" "Noto Sans Mono" "WenQuanYi Zen Hei Mono" ]; - - fonts.fontDir.enable = lib.mkDefault true; - }; -} diff --git a/configurations/profile/os/games/default.nix b/configurations/profile/os/games/default.nix deleted file mode 100644 index ca96881..0000000 --- a/configurations/profile/os/games/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ config, pkgs, ... }: -{ - imports = [ - ./steam.nix - ]; -} diff --git a/configurations/profile/os/games/steam.nix b/configurations/profile/os/games/steam.nix deleted file mode 100644 index 6dea036..0000000 --- a/configurations/profile/os/games/steam.nix +++ /dev/null @@ -1,117 +0,0 @@ -{ config, pkgs, lib, materusArg, inputs, ... }: -let - steamPkg = pkgs.steam.override { - extraPkgs = pkgs: [ - pkgs.libdecor - pkgs.obs-studio-plugins.obs-vkcapture - pkgs.steamcmd - pkgs.nss_latest - pkgs.libstrangle - pkgs.libkrb5 - pkgs.keyutils - pkgs.libGL - pkgs.libglvnd - pkgs.steamPackages.steam - pkgs.libxcrypt - pkgs.gnutls - pkgs.xorg.libXcursor - pkgs.xorg.libXi - pkgs.xorg.libXinerama - pkgs.xorg.libXScrnSaver - pkgs.xorg.xinput - pkgs.xorg.xcbutilwm - pkgs.xorg.xcbutilimage - pkgs.xorg.xcbutilkeysyms - pkgs.xorg.xcbutilerrors - pkgs.xorg.xcbutilrenderutil - pkgs.xorg.xcbutil - pkgs.xorg.xwininfo - pkgs.yad - pkgs.xdotool - pkgs.libinput - pkgs.openvdb - pkgs.openssl - pkgs.tbb - pkgs.gtk4 - pkgs.gtk3 - pkgs.glib - pkgs.gsettings-desktop-schemas - pkgs.fuse - pkgs.samba4Full - pkgs.tdb - pkgs.jbig2enc - pkgs.jbig2dec - pkgs.vivaldi - pkgs.x264.lib - pkgs.steamtinkerlaunch - pkgs.pipewire - pkgs.gitFull - pkgs.git-lfs - - ] ++ config.materus.profile.packages.list.fonts ++ config.materus.profile.steam.extraPkgs; - - extraLibraries = pkgs: [ - pkgs.libkrb5 - pkgs.keyutils - pkgs.ncurses6 - pkgs.xorg.xinput - pkgs.libinput - pkgs.fontconfig - pkgs.libxcrypt - pkgs.gnutls - pkgs.samba - pkgs.tdb - pkgs.jemalloc - pkgs.gperftools - ] ++ - (with config.hardware.opengl; if pkgs.hostPlatform.is64bit - then [ package ] ++ extraPackages - else [ package32 ] ++ extraPackages32); - - extraEnv = config.materus.profile.steam.extraEnv; - - }; - - cfg = config.materus.profile.steam; -in -{ - options.materus.profile.steam.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable materus steam settings for OS"; - options.materus.profile.steam.package = lib.mkOption { - type = lib.types.package; - default = steamPkg; - description = "Package used by steam"; - }; - options.materus.profile.steam.extraPkgs = lib.mkOption { - default = [ ]; - description = "Extra packages for steam"; - }; - options.materus.profile.steam.extraEnv = lib.mkOption { - default = { }; - description = "Extra Env for steam"; - }; - - - config = lib.mkIf cfg.enable { - programs.gamescope.enable = lib.mkDefault true; - programs.gamescope.capSysNice = lib.mkDefault false; - hardware.steam-hardware.enable = lib.mkDefault true; - materus.profile.steam.extraEnv = { - XDG_DATA_DIRS = "/usr/share:\${XDG_DATA_DIRS}"; - OBS_VKCAPTURE = "1"; - }; - programs.steam = { - enable = lib.mkDefault true; - dedicatedServer.openFirewall = lib.mkDefault true; - remotePlay.openFirewall = lib.mkDefault true; - gamescopeSession.enable = lib.mkDefault true; - }; - environment.sessionVariables = rec { - STEAM_EXTRA_COMPAT_TOOLS_PATHS = lib.mkDefault "\${HOME}/.steam/root/compatibilitytools.d"; - }; - environment.systemPackages = [ - steamPkg - steamPkg.run - - ]; - }; -} diff --git a/configurations/profile/os/nix.nix b/configurations/profile/os/nix.nix deleted file mode 100644 index b2527dc..0000000 --- a/configurations/profile/os/nix.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ config, pkgs, lib, materusArg, materusCfg, ... }: -let - cfg = config.materus.profile.nix; -in -{ - options.materus.profile.nix.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable materus nix settings"; - config.nix = lib.mkIf cfg.enable { - - settings = { - experimental-features = lib.mkMerge [[ "nix-command" "flakes" "no-url-literals" ]]; - auto-optimise-store = true; - trusted-users = [ "root" "@wheel" ]; - - substituters = [ - "https://nix-community.cachix.org" - "https://cache.nixos.org/" - "https://nixerus.cachix.org/" - ]; - trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nixerus.cachix.org-1:2x7sIG7y1vAoxc8BNRJwsfapZsiX4hIl4aTi9V5ZDdE=" ]; - }; - }; -} diff --git a/configurations/profile/os/shell/default.nix b/configurations/profile/os/shell/default.nix deleted file mode 100644 index f9b4e10..0000000 --- a/configurations/profile/os/shell/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - imports = [ - ./zsh.nix - ]; - - -} diff --git a/configurations/profile/os/shell/zsh.nix b/configurations/profile/os/shell/zsh.nix deleted file mode 100644 index 89e7be0..0000000 --- a/configurations/profile/os/shell/zsh.nix +++ /dev/null @@ -1,22 +0,0 @@ -{materusArg, config, pkgs, lib, ...}: -let -cfg = config.materus.profile.zsh; -in -{ - options.materus.profile.zsh.enable = materusArg.pkgs.lib.mkBoolOpt true "Enable materus system zsh config"; - config = lib.mkIf cfg.enable { - users.defaultUserShell = pkgs.zsh; - environment.shells = [ pkgs.zsh ]; - programs.zsh = { - enable = true; - enableGlobalCompInit=false; - interactiveShellInit = '' - if [[ ''${__MATERUS_HM_ZSH:-0} == 0 ]]; then - source ${pkgs.grml-zsh-config}/etc/zsh/zshrc - fi - ''; - promptInit = '' - ''; - }; - }; -} diff --git a/configurations/shared/home/default.nix b/configurations/shared/home/default.nix deleted file mode 100644 index 4f878f8..0000000 --- a/configurations/shared/home/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ inputs, materusFlake, ... }: -let - genHomes = import ./genHomes.nix { inherit inputs; inherit materusFlake; }; -in -genHomes "materus" diff --git a/configurations/shared/home/genHomes.nix b/configurations/shared/home/genHomes.nix deleted file mode 100644 index f20f5dc..0000000 --- a/configurations/shared/home/genHomes.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ inputs, materusFlake, ... }: -let - profiles = import (materusFlake.selfPath + "/configurations/profile"); - - hosts = builtins.attrNames materusFlake.nixosConfigurations; - genHomes = username: - let - #Make host specific user profile "username@host" - _list = builtins.map (host: username + "@" + host) hosts; - _for = i: ( - let len = builtins.length hosts; in - ([{ - name = builtins.elemAt _list i; - value = let host = builtins.elemAt hosts i; in - materusFlake.nixosConfigurations.${host}.materusCfg.hm.lib.homeManagerConfiguration { - pkgs = materusFlake.nixosConfigurations.${host}.pkgs; - extraSpecialArgs = { materusCfg = materusFlake.nixosConfigurations.${host}.materusCfg // { isHm = true; }; }; - modules = [ - (materusFlake.selfPath + "/configurations/shared/home/${username}") - (materusFlake.selfPath + "/configurations/host/${host}/home/${username}") - profiles.homeProfile - ]; - }; - }] - ++ (if ((i + 1) < len) then _for (i + 1) else [ ])) - ); - in - (builtins.listToAttrs (_for 0)) // { - #Make generic x86_64-linux user profile "username" - ${username} = - let - materusCfg = { - stable = false; - inherit materusFlake; - host = "Generic"; - hm = inputs.configInputs.home-manager; - hmAsModule = false; - nixerus = inputs.configInputs.nixerus; - configInputs = inputs.configInputs; - path = materusFlake.selfPath; - isHm = true; - }; - in - inputs.configInputs.home-manager.lib.homeManagerConfiguration { - pkgs = import inputs.nixpkgs { system = "x86_64-linux"; config = { allowUnfree = true; }; }; - extraSpecialArgs = { inherit materusCfg; }; - modules = [ - ./${username} - profiles.homeProfile - materusCfg.configInputs.sops-nix.homeManagerModules.sops - materusCfg.configInputs.plasma-manager.homeManagerModules.plasma-manager - ]; - }; - }; -in -genHomes diff --git a/configurations/shared/home/materus/default.nix b/configurations/shared/home/materus/default.nix deleted file mode 100644 index 398a685..0000000 --- a/configurations/shared/home/materus/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - - home.username = "materus"; - home.packages = [ ]; - - programs.git.signing.key = lib.mkDefault "28D140BCA60B4FD1"; - programs.git.userEmail = lib.mkDefault "materus@podkos.pl"; - programs.git.userName = lib.mkDefault "materus"; - - home.stateVersion = lib.mkDefault "23.05"; - home.homeDirectory = lib.mkDefault "/home/materus"; - - programs.home-manager.enable = lib.mkDefault true; -} diff --git a/crypt.sh b/crypt.sh deleted file mode 100755 index ac693db..0000000 --- a/crypt.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -cd $SCRIPT_DIR - -if [ $# = 0 ] || ( [ $# = 1 ] && [ $1 = "help" ] ); then - echo "Use \"unlock\" to unlock with pgp" - echo "Use \"unlock\" /path/to/key to unlock with symmetric key" - echo "Use \"lock\": to lock repository" - exit -fi -check_git () { - if [ "$(git status --porcelain)" ]; then - echo "Working directory not clean." - echo "Please commit your changes or 'git stash' them before running this script" - exit 1 - fi -} - -create_decrypt () { - touch decrypted - git add --intent-to-add decrypted - git update-index --assume-unchanged decrypted -} -delete_decrypt () { - rm decrypted - git rm decrypted -} - - -if [ $# = 1 ]; then - - if [ $1 = "unlock" ]; then - check_git - git-crypt unlock - create_decrypt - exit - fi - - if [ $1 = "lock" ]; then - check_git - delete_decrypt - git-crypt lock - exit - fi - - if [ $1 = "create_decrypt" ]; then - create_decrypt - exit - fi - - if [ $1 = "delete_decrypt" ]; then - delete_decrypt - exit - fi - -fi - -if [ $# = 2 ] && [ $1 = "unlock" ]; then - git-crypt unlock $2 - create_decrypt - exit -fi diff --git a/decrypted b/decrypted deleted file mode 100644 index e69de29..0000000 diff --git a/extraFiles/config/emacs/early-init.el b/dotfiles/emacs/early-init.el similarity index 93% rename from extraFiles/config/emacs/early-init.el rename to dotfiles/emacs/early-init.el index 5e8a868..a875000 100644 --- a/extraFiles/config/emacs/early-init.el +++ b/dotfiles/emacs/early-init.el @@ -1,6 +1,6 @@ ;;; -*- lexical-binding: t; -*- -;; [[file:emacs-materus-config.org::*Early Init Variables][Early Init Variables:1]] +;; [[file:../../org-conf/emacs-config.org::*Early Init Variables][Early Init Variables:1]] (defvar materus/init-early t "Is emacs using materus early init") ; Var to ensure early-init loaded, not used anymore but keeping it anyway (setq materus/init-early t) ; Probably useless @@ -38,7 +38,7 @@ "The value of `gc-cons-threshold' after Emacs startup.") ; Define after init garbage collector threshold ;; Early Init Variables:1 ends here -;; [[file:emacs-materus-config.org::*Garbage Collector][Garbage Collector:1]] +;; [[file:../../org-conf/emacs-config.org::*Garbage Collector][Garbage Collector:1]] (setq gc-cons-threshold most-positive-fixnum) ; Set `gc-cons-threshold' so it won't collectect during initialization (add-hook 'emacs-startup-hook @@ -46,7 +46,7 @@ (setq gc-cons-threshold materus-emacs-gc-cons-threshold))) ; Set `gc-cons-threshold' to desired value after startup ;; Garbage Collector:1 ends here -;; [[file:emacs-materus-config.org::*Early Frame Settings][Early Frame Settings:1]] +;; [[file:../../org-conf/emacs-config.org::*Early Frame Settings][Early Frame Settings:1]] (setq frame-inhibit-implied-resize t) (setq frame-resize-pixelwise t) (setq window-resize-pixelwise t) ; Allow pixelwise resizing of window and frame @@ -66,7 +66,7 @@ ))) ;; Early Frame Settings:1 ends here -;; [[file:emacs-materus-config.org::*Native compilation][Native compilation:1]] +;; [[file:../../org-conf/emacs-config.org::*Native compilation][Native compilation:1]] (setq native-comp-async-report-warnings-errors nil) ; Silence warnings (setq native-comp-speed 3) ; Set native-comp speed diff --git a/extraFiles/config/emacs/etc/materus/emacs-config.el b/dotfiles/emacs/etc/materus/emacs-config.el similarity index 89% rename from extraFiles/config/emacs/etc/materus/emacs-config.el rename to dotfiles/emacs/etc/materus/emacs-config.el index e5df92e..b653961 100644 --- a/extraFiles/config/emacs/etc/materus/emacs-config.el +++ b/dotfiles/emacs/etc/materus/emacs-config.el @@ -1,6 +1,6 @@ ;;; -*- lexical-binding: t; -*- -;; [[file:../../emacs-materus-config.org::*Compile Time][Compile Time:2]] +;; [[file:../../../../org-conf/emacs-config.org::*Compile Time][Compile Time:2]] (eval-when-compile (defvar doom-modeline-support-imenu nil) (defvar display-time-24hr-format nil) @@ -12,11 +12,11 @@ ) ;; Compile Time:2 ends here -;; [[file:../../emacs-materus-config.org::*Init package manager config][Init package manager config:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Init package manager config][Init package manager config:1]] ;; Init package manager config:1 ends here -;; [[file:../../emacs-materus-config.org::*Packages list & function][Packages list & function:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Packages list & function][Packages list & function:1]] (defvar materus/packages '( use-package @@ -139,7 +139,7 @@ (materus/install-packages)) ;; Packages list & function:1 ends here -;; [[file:../../emacs-materus-config.org::*No Littering][No Littering:1]] +;; [[file:../../../../org-conf/emacs-config.org::*No Littering][No Littering:1]] (require 'recentf) (use-package no-littering :config @@ -151,7 +151,7 @@ (recentf-expand-file-name no-littering-etc-directory))) ;; No Littering:1 ends here -;; [[file:../../emacs-materus-config.org::*Mouse][Mouse:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Mouse][Mouse:1]] (context-menu-mode 1) (setq mouse-wheel-follow-mouse 't) (setq scroll-step 1) @@ -161,7 +161,7 @@ (setq-default pixel-scroll-precision-large-scroll-height 10.0) ;; Mouse:1 ends here -;; [[file:../../emacs-materus-config.org::*Misc][Misc:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Misc][Misc:1]] (when (daemonp) (add-hook 'after-make-frame-functions (lambda (frame) (when (= (length (frame-list)) 2) @@ -221,7 +221,7 @@ (advice-add 'display-startup-screen :around #'startup-screen-advice) ; Hide startup screen if started with file ;; Misc:1 ends here -;; [[file:../../emacs-materus-config.org::*Dashboard][Dashboard:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Dashboard][Dashboard:1]] (use-package dashboard :after (nerd-icons projectile) :config @@ -241,7 +241,7 @@ ) ;; Dashboard:1 ends here -;; [[file:../../emacs-materus-config.org::*Modeline][Modeline:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Modeline][Modeline:1]] (use-package doom-modeline :init (setq doom-modeline-support-imenu t) :hook (after-init . doom-modeline-mode) @@ -260,7 +260,7 @@ :hook (after-init . minions-mode)) ;; Modeline:1 ends here -;; [[file:../../emacs-materus-config.org::*Diff-hl][Diff-hl:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Diff-hl][Diff-hl:1]] (use-package diff-hl :config (setq diff-hl-side 'right) @@ -270,7 +270,7 @@ (global-diff-hl-show-hunk-mouse-mode 1)) ;; Diff-hl:1 ends here -;; [[file:../../emacs-materus-config.org::*Org-mode][Org-mode:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Org-mode][Org-mode:1]] (use-package org :mode (("\\.org$" . org-mode)) :hook @@ -318,7 +318,7 @@ (sqlite . t))) ;; Org-mode:1 ends here -;; [[file:../../emacs-materus-config.org::*Style][Style:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Style][Style:1]] (use-package orderless :init ;; Tune the global completion style settings to your liking! @@ -328,7 +328,7 @@ completion-category-overrides nil)) ;; Style:1 ends here -;; [[file:../../emacs-materus-config.org::*Minibuffer][Minibuffer:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Minibuffer][Minibuffer:1]] (use-package consult) (use-package marginalia) @@ -352,7 +352,7 @@ (vertico-mouse-mode 1)) ;; Minibuffer:1 ends here -;; [[file:../../emacs-materus-config.org::*Code completion][Code completion:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Code completion][Code completion:1]] (use-package cape) (use-package corfu @@ -401,18 +401,18 @@ (global-completion-preview-mode 1) ;; Code completion:1 ends here -;; [[file:../../emacs-materus-config.org::*Eat][Eat:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Eat][Eat:1]] (use-package eat) (defvar cua--eat-semi-char-keymap (copy-keymap cua--cua-keys-keymap) "EAT semi-char mode CUA keymap") (defvar cua--eat-char-keymap (copy-keymap cua--cua-keys-keymap) "EAT char mode CUA keymap") ;; Eat:1 ends here -;; [[file:../../emacs-materus-config.org::*Defaults][Defaults:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Defaults][Defaults:1]] (setq-default buffer-file-coding-system 'utf-8-unix) (setq text-mode-ispell-word-completion nil) ; Disable ispell ;; Defaults:1 ends here -;; [[file:../../emacs-materus-config.org::*Elcord][Elcord:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Elcord][Elcord:1]] (defun materus/elcord-toggle (&optional _frame) "Toggle elcord based on visible frames" (if (> (length (frame-list)) 1) @@ -426,7 +426,7 @@ (add-hook 'server-after-make-frame-hook 'materus/elcord-toggle)) ;; Elcord:1 ends here -;; [[file:../../emacs-materus-config.org::*Undo-Tree][Undo-Tree:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Undo-Tree][Undo-Tree:1]] (use-package undo-tree :config (global-undo-tree-mode 1) @@ -439,12 +439,12 @@ ) ;; Undo-Tree:1 ends here -;; [[file:../../emacs-materus-config.org::*Projectile][Projectile:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Projectile][Projectile:1]] (use-package projectile :config (projectile-mode 1)) ;; Projectile:1 ends here -;; [[file:../../emacs-materus-config.org::*Treemacs][Treemacs:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Treemacs][Treemacs:1]] (use-package treemacs) (use-package treemacs-projectile :after (projectile treemacs)) @@ -456,11 +456,11 @@ :after (treemacs)) ;; Treemacs:1 ends here -;; [[file:../../emacs-materus-config.org::*Magit][Magit:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Magit][Magit:1]] (use-package magit) ;; Magit:1 ends here -;; [[file:../../emacs-materus-config.org::*Dirvish / Dired][Dirvish / Dired:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Dirvish / Dired][Dirvish / Dired:1]] (setq dired-mouse-drag-files t) (use-package dirvish :config @@ -475,14 +475,14 @@ file-size))) ;; Dirvish / Dired:1 ends here -;; [[file:../../emacs-materus-config.org::*Perspective][Perspective:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Perspective][Perspective:1]] (require 'perspective) (setq persp-mode-prefix-key (kbd "C-c M-p")) (setq persp-modestring-short t) (persp-mode 1) ;; Perspective:1 ends here -;; [[file:../../emacs-materus-config.org::*LSP][LSP:1]] +;; [[file:../../../../org-conf/emacs-config.org::*LSP][LSP:1]] (use-package lsp-mode :custom (lsp-completion-provider :none) ;; we use Corfu! @@ -541,7 +541,7 @@ (advice-add 'lsp-resolve-final-command :around #'lsp-booster--advice-final-command) ;; LSP:1 ends here -;; [[file:../../emacs-materus-config.org::*DAP][DAP:1]] +;; [[file:../../../../org-conf/emacs-config.org::*DAP][DAP:1]] (use-package dap-mode :config (require 'dap-lldb) @@ -552,7 +552,7 @@ ) ;; DAP:1 ends here -;; [[file:../../emacs-materus-config.org::*Nix][Nix:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Nix][Nix:1]] (use-package nix-mode) (use-package nix-ts-mode) (use-package nixfmt) @@ -573,11 +573,11 @@ (when (treesit-language-available-p 'nix) (push '(nix-mode . nix-ts-mode) major-mode-remap-alist)) ;; Nix:1 ends here -;; [[file:../../emacs-materus-config.org::*Emacs Lisp][Emacs Lisp:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Emacs Lisp][Emacs Lisp:1]] (add-hook 'emacs-lisp-mode-hook 'display-line-numbers-mode) ;; Emacs Lisp:1 ends here -;; [[file:../../emacs-materus-config.org::*C/C++][C/C++:1]] +;; [[file:../../../../org-conf/emacs-config.org::*C/C++][C/C++:1]] (use-package lsp-clangd) (setq lsp-clients-clangd-args '("--fallback-style=microsoft")) @@ -599,7 +599,7 @@ (add-to-list 'c-default-style '(c++-ts-mode . "bsd")) ;; C/C++:1 ends here -;; [[file:../../emacs-materus-config.org::*Python][Python:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Python][Python:1]] (use-package lsp-pyright) (setq lsp-pyright-langserver-command "pyright") (add-hook 'python-mode-hook 'lsp-deferred) @@ -607,7 +607,7 @@ (when (treesit-language-available-p 'python) (push '(python-mode . python-ts-mode) major-mode-remap-alist)) ;; Python:1 ends here -;; [[file:../../emacs-materus-config.org::*Java][Java:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Java][Java:1]] (use-package lsp-java) (setq lsp-java-vmargs '("-XX:+UseParallelGC" "-XX:GCTimeRatio=4" "-XX:AdaptiveSizePolicyWeight=90" "-Dsun.zip.disableMemoryMapping=true" "-Xmx2G" "-Xms100m")) (add-hook 'java-mode-hook (lambda () (when (getenv "JDTLS_PATH") (setq lsp-java-server-install-dir (getenv "JDTLS_PATH"))))) @@ -624,7 +624,7 @@ (add-to-list 'c-default-style '(java-ts-mode . "java")) ;; Java:1 ends here -;; [[file:../../emacs-materus-config.org::*Other][Other:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Other][Other:1]] (add-to-list 'c-default-style '(awk-mode . "awk")) (add-to-list 'c-default-style '(other . "bsd")) @@ -648,7 +648,7 @@ (add-hook 'prog-mode-hook 'electric-indent-local-mode) ;; Other:1 ends here -;; [[file:../../emacs-materus-config.org::*Keys][Keys:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Keys][Keys:1]] (use-package cua-base) ;;; Keybinds @@ -701,7 +701,7 @@ (define-key isearch-mode-map (kbd "C-r") nil) ;; Keys:1 ends here -;; [[file:../../emacs-materus-config.org::*CUA Overrides][CUA Overrides:1]] +;; [[file:../../../../org-conf/emacs-config.org::*CUA Overrides][CUA Overrides:1]] (defun cua--eat-semi-char-override-keymap () (setq-local cua--keymap-alist (copy-tree cua--keymap-alist)) (setf (alist-get 'cua--ena-cua-keys-keymap cua--keymap-alist) cua--eat-semi-char-keymap)) @@ -714,12 +714,12 @@ ;(add-hook 'eat-char-mode-hook #'cua--eat-char-override-keymap) ;; CUA Overrides:1 ends here -;; [[file:../../emacs-materus-config.org::*Yasnippet init][Yasnippet init:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Yasnippet init][Yasnippet init:1]] (use-package yasnippet :config (yas-global-mode 1)) ;; Yasnippet init:1 ends here -;; [[file:../../emacs-materus-config.org::*Update config script][Update config script:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Update config script][Update config script:1]] (defun materus/sync-config () "Function to sync config from MATERUS_CONFIG_DIR to emacs folder" (if (getenv "MATERUS_CONFIG_DIR") @@ -748,11 +748,11 @@ (when (materus/sync-config) (materus/compile-config-if-needed) (byte-recompile-directory (concat user-emacs-directory "etc/materus/extra") 0 t))) ;; Update config script:1 ends here -;; [[file:../../emacs-materus-config.org::*Byte compile][Byte compile:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Byte compile][Byte compile:1]] (materus/compile-config-if-needed) ;; Byte compile:1 ends here -;; [[file:../../emacs-materus-config.org::*Test][Test:1]] +;; [[file:../../../../org-conf/emacs-config.org::*Test][Test:1]] ;;; (global-set-key (kbd "C-∇") (kbd "C-H")) ;;; (global-set-key (kbd "H-∇") (lambda () (interactive) (insert-char #x2207))) ;;; (buffer-text-pixel-size) diff --git a/extraFiles/config/emacs/init.el b/dotfiles/emacs/init.el similarity index 95% rename from extraFiles/config/emacs/init.el rename to dotfiles/emacs/init.el index 75ca2e3..b0f1ab1 100644 --- a/extraFiles/config/emacs/init.el +++ b/dotfiles/emacs/init.el @@ -1,6 +1,6 @@ ;;; -*- lexical-binding: t; -*- -;; [[file:emacs-materus-config.org::*Init][Init:2]] +;; [[file:../../org-conf/emacs-config.org::*Init][Init:2]] (setq-default materus/use-nix-packages (require 'materus-config nil 'noerror)) (require 'cl-lib) (require 'package) diff --git a/extraFiles/config/emacs/etc/materus/extra/corfu-mouse.el b/extraFiles/config/emacs/etc/materus/extra/corfu-mouse.el deleted file mode 100644 index 1b1a2b9..0000000 --- a/extraFiles/config/emacs/etc/materus/extra/corfu-mouse.el +++ /dev/null @@ -1,169 +0,0 @@ -;;; corfu-mouse.el --- Mouse support for Corfu -*- lexical-binding: t; -*- - -;; Copyright (C) 2021, 2022 Free Software Foundation, Inc. -;; Copyright (C) 2022 Akib Azmain Turja. - -;; Author: Akib Azmain Turja -;; Maintainer: Akib Azmain Turja -;; Created: 2022 -;; Version: 0.1 -;; Package-Requires: ((emacs "24.4") (corfu "0.25")) -;; Homepage: https://codeberg.org/akib/emacs-corfu-mouse - -;; This file is not part of GNU Emacs. - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;; Disclaimer: This file is based on vertico-mouse.el of Vertico -;; package, which is a part of GNU Emacs. - -;;; Commentary: - -;; This package is a Corfu extension, which adds mouse support. - -;; To enable, M-x corfu-mouse-mode. - - -;; Modified to support pixel-scroll-precision-mode and fixed adding spaces - -;;; Code: - -(require 'corfu) -(defgroup corfu-mouse nil - "Mouse support for Corfu." - :group 'corfu - :link '(url-link "https://codeberg.org/akib/emacs-corfu-mouse") - :prefix "corfu-mouse-") - -(defface corfu-mouse - '((t :inherit highlight)) - "Face used for mouse highlighting." - :group 'corfu-mouse) - -(defvar corfu-mouse--completion-buffer nil - "The buffer for which the popup is being shown.") - -(defun corfu-mouse--candidate-map (index) - "Return keymap for candidate with INDEX." - (let ((map (make-sparse-keymap)) - (mouse-1 (make-symbol "corfu-mouse--on-mouse-1")) - (mouse-3 (make-symbol "corfu-mouse--on-mouse-3"))) - (fset mouse-1 (lambda () - (interactive) - (corfu--goto index) - (corfu-insert))) - (fset mouse-3 (lambda () - (interactive) - (corfu--goto index) - (corfu-complete))) - (define-key map [mouse-1] mouse-1) - (define-key map [mouse-3] mouse-3) - - ;; Ignore these events to keep completion session alive. - (define-key map [down-mouse-1] #'ignore) - (define-key map [down-mouse-3] #'ignore) - map)) - -(defun corfu-mouse--format-candidates (fcands) - "Format candidates. - FCANDS is the return value of `corfu--format-candidates'." - (let ((index corfu--scroll) - (cands (caddr fcands))) - (while cands - (let ((line (car cands))) - ;; Append necessary amount of spaces to make it as wide as the - ;; popup. - (let ((strlen (- (cadr fcands) (string-width line)))) - (when (> strlen 0) - (setq line (concat line (make-string strlen ? ))))) - - (add-text-properties 0 (length line) - `(mouse-face - corfu-mouse - keymap - ,(corfu-mouse--candidate-map index)) - line) - (setcar cands line) - (setq cands (cdr cands)) - (setq index (1+ index)))) - fcands)) - -(defun corfu-mouse--scroll-up (n) - "Scroll up by N lines." - (with-current-buffer corfu-mouse--completion-buffer - (corfu-next n))) - -(defun corfu-mouse--scroll-down (n) - "Scroll down by N lines." - (corfu-mouse--scroll-up (- n))) - -(defun corfu-mouse-mwheel-scroll () - "Call `mwheel-scroll'." - (interactive) - (call-interactively #'mwheel-scroll)) - -(defun corfu-mouse--setup-scrolling (buffer) - "Setup mouse scrolling on BUFFER." - (let ((current-buffer (current-buffer))) - (with-current-buffer buffer - (when (boundp 'pixel-scroll-precision-mode) - (setq-local pixel-scroll-precision-mode nil)) - (setq-local mwheel-scroll-up-function #'corfu-mouse--scroll-up) - (setq-local mwheel-scroll-down-function - #'corfu-mouse--scroll-down) - (setq-local corfu-mouse--completion-buffer current-buffer))) - buffer) - -(defun corfu-mouse--post-command-set-buffer () - "Set `corfu-mouse--completion-buffer' the current buffer." - (when corfu-mouse--completion-buffer - (switch-to-buffer corfu-mouse--completion-buffer))) - -;;;###autoload -(define-minor-mode corfu-mouse-mode - "Mouse support for Corfu." - :global t :group 'corfu - (let ((scroll-events '(wheel-up wheel-down mouse-4 mouse-5)) - (continue-commands '("corfu-mouse--on-mouse-1" - "corfu-mouse--on-mouse-3" - corfu-mouse-mwheel-scroll))) - (cond - (corfu-mouse-mode - (advice-add #'corfu--format-candidates :filter-return - #'corfu-mouse--format-candidates) - (advice-add #'corfu--make-buffer :filter-return - #'corfu-mouse--setup-scrolling) - (advice-add #'corfu--post-command :before - #'corfu-mouse--post-command-set-buffer) - (setq corfu-continue-commands - (append corfu-continue-commands continue-commands)) - (dolist (event scroll-events) - (define-key corfu--mouse-ignore-map (vector event) - #'corfu-mouse-mwheel-scroll))) - (t - (advice-remove #'corfu--format-candidates - #'corfu-mouse--format-candidates) - (advice-remove #'corfu--make-buffer - #'corfu-mouse--setup-scrolling) - (advice-remove #'corfu--post-command - #'corfu-mouse--post-command-set-buffer) - (dolist (command continue-commands) - (setq corfu-continue-commands - (delete command corfu-continue-commands))) - (dolist (event scroll-events) - (define-key corfu--mouse-ignore-map (vector event) - #'ignore)))))) - -(provide 'corfu-mouse) -;;; corfu-mouse.el ends here diff --git a/extraFiles/config/plasma/materus-linux.keytab b/extraFiles/config/plasma/materus-linux.keytab deleted file mode 100644 index fb87f64..0000000 --- a/extraFiles/config/plasma/materus-linux.keytab +++ /dev/null @@ -1,114 +0,0 @@ -keyboard "Domyślny (XFree 4) - materus" -key Clear+KeyPad : "\E[E" -key Space+Ctrl : "\x00" -key Backspace+Ctrl : "\b" -key Backspace-Ctrl : "\x7f" -key F8+AnyModifier : "\E[19;*~" -key F8-AnyModifier : "\E[19~" -key Enter-NewLine : "\r" -key Enter+NewLine : "\r\n" -key Return+Shift : "\EOM" -key Return-Shift+NewLine : "\r\n" -key Return-Shift-NewLine : "\r" -key PgUp+Shift+Ctrl-AppScreen : ScrollPromptUp -key PgUp+Shift-Ctrl-AppScreen : ScrollPageUp -key PgUp+Shift+AppScreen : "\E[5;*~" -key PgUp-Shift+AnyModifier : "\E[5;*~" -key PgUp-Shift-AnyModifier : "\E[5~" -key PgUp-Shift+KeyPad : "\E[5~" -key Esc : "\E" -key Tab+Ctrl-Ansi : "\t" -key Tab+Ctrl+Ansi : "\E[27;5;9~" -key Tab+Shift-Ansi : "\t" -key Tab+Shift+Ansi : "\E[Z" -key Tab-Shift : "\t" -key F6+AnyModifier : "\E[17;*~" -key F6-AnyModifier : "\E[17~" -key Down+Shift-Ctrl-Alt-AppScreen : ScrollLineDown -key Down-Shift+KeyPad+Ansi-AppCursorKeys : "\E[B" -key Down-Shift+KeyPad+Ansi+AppCursorKeys : "\EOB" -key Down+Shift+Ctrl-AppScreen : "\E[1;*B" -key Down+Shift+Alt-AppScreen : "\E[1;*B" -key Down+Shift+AppScreen : "\E[1;*B" -key Down-Shift+Ansi+AnyModifier : "\E[1;*B" -key Down-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[B" -key Down-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOB" -key Down-Shift-Ansi : "\EB" -key Up+Shift-Ctrl-Alt-AppScreen : ScrollLineUp -key Up-Shift+KeyPad+Ansi-AppCursorKeys : "\E[A" -key Up-Shift+KeyPad+Ansi+AppCursorKeys : "\EOA" -key Up+Shift+Ctrl-AppScreen : "\E[1;*A" -key Up+Shift+Alt-AppScreen : "\E[1;*A" -key Up+Shift+AppScreen : "\E[1;*A" -key Up-Shift+Ansi+AnyModifier : "\E[1;*A" -key Up-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[A" -key Up-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOA" -key Up-Shift-Ansi : "\EA" -key F10+AnyModifier : "\E[21;*~" -key F10-AnyModifier : "\E[21~" -key Left-Shift+KeyPad+Ansi-AppCursorKeys : "\E[D" -key Left-Shift+KeyPad+Ansi+AppCursorKeys : "\EOD" -key Left+Shift+Ctrl-AppScreen : "\E[1;*D" -key Left+Shift+Alt-AppScreen : "\E[1;*D" -key Left+Shift+AppScreen : "\E[1;*D" -key Left-Shift+Ansi+AnyModifier : "\E[1;*D" -key Left-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[D" -key Left-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOD" -key Left-Shift-Ansi : "\ED" -key F5+AnyModifier : "\E[15;*~" -key F5-AnyModifier : "\E[15~" -key F9+AnyModifier : "\E[20;*~" -key F9-AnyModifier : "\E[20~" -key F1+AnyModifier : "\EO*P" -key F1-AnyModifier : "\EOP" -key F12+AnyModifier : "\E[24;*~" -key F12-AnyModifier : "\E[24~" -key Right-Shift+KeyPad+Ansi-AppCursorKeys : "\E[C" -key Right-Shift+KeyPad+Ansi+AppCursorKeys : "\EOC" -key Right+Shift+Ctrl-AppScreen : "\E[1;*C" -key Right+Shift+Alt-AppScreen : "\E[1;*C" -key Right+Shift+AppScreen : "\E[1;*C" -key Right-Shift+Ansi+AnyModifier : "\E[1;*C" -key Right-Shift+Ansi-AppCursorKeys-AnyModifier : "\E[C" -key Right-Shift+Ansi+AppCursorKeys-AnyModifier : "\EOC" -key Right-Shift-Ansi : "\EC" -key F4+AnyModifier : "\EO*S" -key F4-AnyModifier : "\EOS" -key F11+AnyModifier : "\E[23;*~" -key F11-AnyModifier : "\E[23~" -key Home+Shift-AppScreen : ScrollUpToTop -key Home+AnyModifier : "\E[1;*H" -key Home+AppCursorKeys-AnyModifier : "\EOH" -key Home-AppCursorKeys-AnyModifier : "\E[H" -key Home+KeyPad-AppCursorKeys : "\E[H" -key Home+KeyPad+AppCursorKeys : "\EOH" -key F7+AnyModifier : "\E[18;*~" -key F7-AnyModifier : "\E[18~" -key End+Shift-AppScreen : ScrollDownToBottom -key End+AnyModifier : "\E[1;*F" -key End+AppCursorKeys-AnyModifier : "\EOF" -key End-AppCursorKeys-AnyModifier : "\E[F" -key End+KeyPad-AppCursorKeys : "\E[F" -key End+KeyPad+AppCursorKeys : "\EOF" -key F2+AnyModifier : "\EO*Q" -key F2-AnyModifier : "\EOQ" -key F3+AnyModifier : "\EO*R" -key F3-AnyModifier : "\EOR" -key Backtab+Ctrl-Ansi : "\t" -key Backtab+Ctrl+Ansi : "\E[27;6;9~" -key Backtab-Ansi : "\t" -key Backtab+Ansi : "\E[Z" -key PgDown+Shift+Ctrl-AppScreen : ScrollPromptDown -key PgDown+Shift-Ctrl-AppScreen : ScrollPageDown -key PgDown+Shift+AppScreen : "\E[6;*~" -key PgDown-Shift+AnyModifier : "\E[6;*~" -key PgDown-Shift-AnyModifier : "\E[6~" -key PgDown-Shift+KeyPad : "\E[6~" -key Del+AnyModifier : "\E[3;*~" -key Del-AnyModifier : "\E[3~" -key Del+KeyPad : "\E[3~" -key Ins+AnyModifier : "\E[2;*~" -key Ins-AnyModifier : "\E[2~" -key Ins+KeyPad : "\E[2~" -key Calculator : "\xe2\x88\x87" - diff --git a/extraFiles/config/wezterm/wezterm_config.lua b/extraFiles/config/wezterm/wezterm_config.lua deleted file mode 100644 index 75c6eda..0000000 --- a/extraFiles/config/wezterm/wezterm_config.lua +++ /dev/null @@ -1,9 +0,0 @@ -local wezterm_config = {}; - -function materus_wezterm_config() - local wezterm = require 'wezterm'; - local cfg = wezterm.config_builder(); - cfg.hide_tab_bar_if_only_one_tab = true; - cfg.enable_scroll_bar = true; - return cfg; -end diff --git a/extraFiles/config/zsh/p10kcfg/compatibility.zsh b/extraFiles/config/zsh/p10kcfg/compatibility.zsh deleted file mode 100644 index 1f01822..0000000 --- a/extraFiles/config/zsh/p10kcfg/compatibility.zsh +++ /dev/null @@ -1,1643 +0,0 @@ -# Generated by Powerlevel10k configuration wizard on 2022-10-23 at 22:37 CEST. -# Based on romkatv/powerlevel10k/config/p10k-lean-8colors.zsh. -# Wizard options: ascii, lean_8colors, 24h time, 1 line, sparse, concise, -# instant_prompt=verbose. -# Type `p10k configure` to generate another config. -# -# Config for Powerlevel10k with 8-color lean prompt style. Type `p10k configure` to generate -# your own config based on it. -# -# Tip: Looking for a nice color? Here's a one-liner to print colormap. -# -# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done - -# Temporarily change options. -'builtin' 'local' '-a' 'p10k_config_opts' -[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') -[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') -[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') -'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' - -() { - emulate -L zsh -o extended_glob - - # Unset all configuration options. This allows you to apply configuration changes without - # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. - unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' - - # Zsh >= 5.1 is required. - [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return - - # The list of segments shown on the left. Fill it with the most important segments. - typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( - # os_icon # os identifier - dir # current directory - vcs # git status - prompt_char # prompt symbol - ) - - # The list of segments shown on the right. Fill it with less important segments. - # Right prompt on the last prompt line (where you are typing your commands) gets - # automatically hidden when the input line reaches it. Right prompt above the - # last prompt line gets hidden if it would overlap with left prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( - status # exit code of the last command - command_execution_time # duration of the last command - background_jobs # presence of background jobs - direnv # direnv status (https://direnv.net/) - asdf # asdf version manager (https://github.com/asdf-vm/asdf) - virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) - anaconda # conda environment (https://conda.io/) - pyenv # python environment (https://github.com/pyenv/pyenv) - goenv # go environment (https://github.com/syndbg/goenv) - nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) - nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) - nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) - # node_version # node.js version - # go_version # go version (https://golang.org) - # rust_version # rustc version (https://www.rust-lang.org) - # dotnet_version # .NET version (https://dotnet.microsoft.com) - # php_version # php version (https://www.php.net/) - # laravel_version # laravel php framework version (https://laravel.com/) - # java_version # java version (https://www.java.com/) - # package # name@version from package.json (https://docs.npmjs.com/files/package.json) - rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) - rvm # ruby version from rvm (https://rvm.io) - fvm # flutter version management (https://github.com/leoafarias/fvm) - luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) - jenv # java version from jenv (https://github.com/jenv/jenv) - plenv # perl version from plenv (https://github.com/tokuhirom/plenv) - perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew) - phpenv # php version from phpenv (https://github.com/phpenv/phpenv) - scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) - haskell_stack # haskell version from stack (https://haskellstack.org/) - kubecontext # current kubernetes context (https://kubernetes.io/) - terraform # terraform workspace (https://www.terraform.io) - # terraform_version # terraform version (https://www.terraform.io) - aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) - aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) - azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) - gcloud # google cloud cli account and project (https://cloud.google.com/) - google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) - toolbox # toolbox name (https://github.com/containers/toolbox) - context # user@hostname - nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) - ranger # ranger shell (https://github.com/ranger/ranger) - nnn # nnn shell (https://github.com/jarun/nnn) - xplr # xplr shell (https://github.com/sayanarijit/xplr) - vim_shell # vim shell indicator (:sh) - midnight_commander # midnight commander shell (https://midnight-commander.org/) - nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) - # vpn_ip # virtual private network indicator - # load # CPU load - # disk_usage # disk usage - # ram # free RAM - # swap # used swap - todo # todo items (https://github.com/todotxt/todo.txt-cli) - timewarrior # timewarrior tracking status (https://timewarrior.net/) - taskwarrior # taskwarrior task count (https://taskwarrior.org/) - # cpu_arch # CPU architecture - private - time # current time - # ip # ip address and bandwidth usage for a specified network interface - # public_ip # public IP address - # proxy # system-wide http/https/ftp proxy - # battery # internal battery - # wifi # wifi speed - # example # example user-defined segment (see prompt_example function below) - ) - - # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. - typeset -g POWERLEVEL9K_MODE=ascii - # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid - # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. - typeset -g POWERLEVEL9K_ICON_PADDING=none - - # Basic style options that define the overall look of your prompt. You probably don't want to - # change them. - typeset -g POWERLEVEL9K_BACKGROUND= # transparent background - typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace - typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space - typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol - - # When set to true, icons appear before content on both sides of the prompt. When set - # to false, icons go after content. If empty or not set, icons go before content in the left - # prompt and after content in the right prompt. - # - # You can also override it for a specific segment: - # - # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false - # - # Or for a specific segment in specific state: - # - # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false - typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=true - - # Add an empty line before each prompt. - typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true - - # Connect left prompt lines with these symbols. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX= - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX= - typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX= - # Connect right prompt lines with these symbols. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX= - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX= - typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX= - - # The left end of left prompt. - typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= - # The right end of right prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL= - - # Ruler, a.k.a. the horizontal line before each prompt. If you set it to true, you'll - # probably want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false above and - # POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' below. - typeset -g POWERLEVEL9K_SHOW_RULER=false - typeset -g POWERLEVEL9K_RULER_CHAR='-' # reasonable alternative: '·' - typeset -g POWERLEVEL9K_RULER_FOREGROUND=7 - - # Filler between left and right prompt on the first prompt line. You can set it to '·' or '-' - # to make it easier to see the alignment between left and right prompt and to separate prompt - # from command output. It serves the same purpose as ruler (see above) without increasing - # the number of prompt lines. You'll probably want to set POWERLEVEL9K_SHOW_RULER=false - # if using this. You might also like POWERLEVEL9K_PROMPT_ADD_NEWLINE=false for more compact - # prompt. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' - if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then - # The color of the filler. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=7 - # Add a space between the end of left prompt and the filler. - typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=' ' - # Add a space between the filler and the start of right prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL=' ' - # Start filler from the edge of the screen if there are no left segments on the first line. - typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' - # End filler on the edge of the screen if there are no right segments on the first line. - typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' - fi - - #################################[ os_icon: os identifier ]################################## - # OS identifier color. - typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND= - # Custom icon. - # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' - - ################################[ prompt_char: prompt symbol ]################################ - # Green prompt symbol if the last command succeeded. - typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=2 - # Red prompt symbol if the last command failed. - typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=1 - # Default prompt symbol. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='>' - # Prompt symbol in command vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='<' - # Prompt symbol in visual vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' - # Prompt symbol in overwrite vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='^' - typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true - # No line terminator if prompt_char is the last segment. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='' - # No line introducer if prompt_char is the first segment. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= - - ##################################[ dir: current directory ]################################## - # Default current directory color. - typeset -g POWERLEVEL9K_DIR_FOREGROUND=4 - # If directory is too long, shorten some of its segments to the shortest possible unique - # prefix. The shortened directory can be tab-completed to the original. - typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique - # Replace removed segment suffixes with this symbol. - typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= - # Color of the shortened directory segments. - typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=4 - # Color of the anchor directory segments. Anchor segments are never shortened. The first - # segment is always an anchor. - typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=4 - # Set to true to display anchor directory segments in bold. - typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=false - # Don't shorten directories that contain any of these files. They are anchors. - local anchor_files=( - .bzr - .citc - .git - .hg - .node-version - .python-version - .go-version - .ruby-version - .lua-version - .java-version - .perl-version - .php-version - .tool-version - .shorten_folder_marker - .svn - .terraform - CVS - Cargo.toml - composer.json - go.mod - package.json - stack.yaml - ) - typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" - # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains - # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is - # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) - # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers - # and other directories don't. - # - # Optionally, "first" and "last" can be followed by ":" where is an integer. - # This moves the truncation point to the right (positive offset) or to the left (negative offset) - # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" - # respectively. - typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false - # Don't shorten this many last directory segments. They are anchors. - typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 - # Shorten directory if it's longer than this even if there is space for it. The value can - # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, - # directory will be shortened only when prompt doesn't fit or when other parameters demand it - # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). - # If set to `0`, directory will always be shortened to its minimum length. - typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 - # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this - # many columns for typing commands. - typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 - # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least - # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. - typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 - # If set to true, embed a hyperlink into the directory. Useful for quickly - # opening a directory in the file manager simply by clicking the link. - # Can also be handy when the directory is shortened, as it allows you to see - # the full directory that was used in previous commands. - typeset -g POWERLEVEL9K_DIR_HYPERLINK=false - - # Enable special styling for non-writable directories. See POWERLEVEL9K_LOCK_ICON and - # POWERLEVEL9K_DIR_CLASSES below. - typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v2 - - # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON - # and POWERLEVEL9K_DIR_CLASSES below. - typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 - - # The default icon shown next to non-writable and non-existent directories when - # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. - # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' - - # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different - # directories. It must be an array with 3 * N elements. Each triplet consists of: - # - # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with - # extended_glob option enabled. - # 2. Directory class for the purpose of styling. - # 3. An empty string. - # - # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. - # - # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories - # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_DIR_CLASSES=( - # '~/work(|/*)' WORK '' - # '~(|/*)' HOME '' - # '*' DEFAULT '') - # - # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one - # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or - # WORK_NON_EXISTENT. - # - # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an - # option to define custom colors and icons for different directory classes. - # - # # Styling for WORK. - # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=4 - # - # # Styling for WORK_NOT_WRITABLE. - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=4# - # - # Styling for WORK_NON_EXISTENT. - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=4 - # - # If a styling parameter isn't explicitly defined for some class, it falls back to the classless - # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls - # back to POWERLEVEL9K_DIR_FOREGROUND. - # - typeset -g POWERLEVEL9K_DIR_CLASSES=() - - # Custom prefix. - # typeset -g POWERLEVEL9K_DIR_PREFIX='%fin ' - - #####################################[ vcs: git status ]###################################### - # Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon. - typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= - - # Untracked files icon. It's really a question mark, your font isn't broken. - # Change the value of this parameter to show a different icon. - typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' - - # Formatter for Git status. - # - # Example output: master wip <42>42 *42 merge ~42 +42 !42 ?42. - # - # You can edit the function to customize how Git status looks. - # - # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: - # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. - function my_git_formatter() { - emulate -L zsh - - if [[ -n $P9K_CONTENT ]]; then - # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from - # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. - typeset -g my_git_format=$P9K_CONTENT - return - fi - - if (( $1 )); then - # Styling for up-to-date Git status. - local meta='%f' # default foreground - local clean='%2F' # green foreground - local modified='%3F' # yellow foreground - local untracked='%4F' # blue foreground - local conflicted='%1F' # red foreground - else - # Styling for incomplete and stale Git status. - local meta='%f' # default foreground - local clean='%f' # default foreground - local modified='%f' # default foreground - local untracked='%f' # default foreground - local conflicted='%f' # default foreground - fi - - local res - - if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then - local branch=${(V)VCS_STATUS_LOCAL_BRANCH} - # If local branch name is at most 32 characters long, show it in full. - # Otherwise show the first 12 .. the last 12. - # Tip: To always show local branch name in full without truncation, delete the next line. - (( $#branch > 32 )) && branch[13,-13]=".." # <-- this line - res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" - fi - - if [[ -n $VCS_STATUS_TAG - # Show tag only if not on a branch. - # Tip: To always show tag, delete the next line. - && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line - ]]; then - local tag=${(V)VCS_STATUS_TAG} - # If tag name is at most 32 characters long, show it in full. - # Otherwise show the first 12 .. the last 12. - # Tip: To always show tag name in full without truncation, delete the next line. - (( $#tag > 32 )) && tag[13,-13]=".." # <-- this line - res+="${meta}#${clean}${tag//\%/%%}" - fi - - # Display the current Git commit if there is no branch and no tag. - # Tip: To always display the current Git commit, delete the next line. - [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line - res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" - - # Show tracking branch name if it differs from local branch. - if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then - res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" - fi - - # Display "wip" if the latest commit's summary contains "wip" or "WIP". - if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then - res+=" ${modified}wip" - fi - - # <42 if behind the remote. - (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}<${VCS_STATUS_COMMITS_BEHIND}" - # >42 if ahead of the remote; no leading space if also behind the remote: <42>42. - (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " - (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}>${VCS_STATUS_COMMITS_AHEAD}" - # <-42 if behind the push remote. - (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}<-${VCS_STATUS_PUSH_COMMITS_BEHIND}" - (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " - # ->42 if ahead of the push remote; no leading space if also behind: <-42->42. - (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}->${VCS_STATUS_PUSH_COMMITS_AHEAD}" - # *42 if have stashes. - (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" - # 'merge' if the repo is in an unusual state. - [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" - # ~42 if have merge conflicts. - (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" - # +42 if have staged changes. - (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" - # !42 if have unstaged changes. - (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" - # ?42 if have untracked files. It's really a question mark, your font isn't broken. - # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. - # Remove the next line if you don't want to see untracked files at all. - (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" - # "-" if the number of unstaged files is unknown. This can happen due to - # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower - # than the number of files in the Git index, or due to bash.showDirtyState being set to false - # in the repository config. The number of staged and untracked files may also be unknown - # in this case. - (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}-" - - typeset -g my_git_format=$res - } - functions -M my_git_formatter 2>/dev/null - - # Don't count the number of unstaged, untracked and conflicted files in Git repositories with - # more than this many files in the index. Negative value means infinity. - # - # If you are working in Git repositories with tens of millions of files and seeing performance - # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output - # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's - # config: `git config bash.showDirtyState false`. - typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 - - # Don't show Git status in prompt for repositories whose workdir matches this pattern. - # For example, if set to '~', the Git repository at $HOME/.git will be ignored. - # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. - typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' - - # Disable the default Git status formatting. - typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true - # Install our own Git status formatter. - typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter(1)))+${my_git_format}}' - typeset -g POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION='${$((my_git_formatter(0)))+${my_git_format}}' - # Enable counters for staged, unstaged, etc. - typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 - - # Icon color. - typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=2 - typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR= - # Custom icon. - typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION= - # Custom prefix. - # typeset -g POWERLEVEL9K_VCS_PREFIX='%fon ' - - # Show status of repositories of these types. You can add svn and/or hg if you are - # using them. If you do, your prompt may become slow even when your current directory - # isn't in an svn or hg repository. - typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) - - # These settings are used for repositories other than Git or when gitstatusd fails and - # Powerlevel10k has to fall back to using vcs_info. - typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=2 - typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=2 - typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=3 - - ##########################[ status: exit code of the last command ]########################### - # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and - # style them independently from the regular OK and ERROR state. - typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true - - # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as - # it will signify success by turning green. - typeset -g POWERLEVEL9K_STATUS_OK=false - typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=2 - typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='ok' - - # Status when some part of a pipe command fails but the overall exit status is zero. It may look - # like this: 1|0. - typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true - typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=2 - typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='ok' - - # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as - # it will signify error by turning red. - typeset -g POWERLEVEL9K_STATUS_ERROR=false - typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=1 - typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='err' - - # Status when the last command was terminated by a signal. - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=1 - # Use terse signal names: "INT" instead of "SIGINT(2)". - typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION= - - # Status when some part of a pipe command fails and the overall exit status is also non-zero. - # It may look like this: 1|0. - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=1 - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='err' - - ###################[ command_execution_time: duration of the last command ]################### - # Show duration of the last command if takes at least this many seconds. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 - # Show this many fractional digits. Zero means round to seconds. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 - # Execution time color. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=3 - # Duration format: 1d 2h 3m 4s. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' - # Custom icon. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION= - # Custom prefix. - # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%ftook ' - - #######################[ background_jobs: presence of background jobs ]####################### - # Don't show the number of background jobs. - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false - # Background jobs color. - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=1 - # Custom icon. - # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######################[ direnv: direnv status (https://direnv.net/) ]######################## - # Direnv color. - typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3 - # Custom icon. - # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### - # Default asdf color. Only used to display tools for which there is no color override (see below). - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND. - typeset -g POWERLEVEL9K_ASDF_FOREGROUND=6 - - # There are four parameters that can be used to hide asdf tools. Each parameter describes - # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at - # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to - # hide a tool, it gets shown. - # - # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and - # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: - # - # asdf local python 3.8.1 - # asdf global python 3.8.1 - # - # After running both commands the current python version is 3.8.1 and its source is "local" as - # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, - # it'll hide python version in this case because 3.8.1 is the same as the global version. - # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't - # contain "local". - - # Hide tool versions that don't come from one of these sources. - # - # Available sources: - # - # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" - # - local `asdf current` says "set by /some/not/home/directory/file" - # - global `asdf current` says "set by /home/username/file" - # - # Note: If this parameter is set to (shell local global), it won't hide tools. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. - typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) - - # If set to false, hide tool versions that are the same as global. - # - # Note: The name of this parameter doesn't reflect its meaning at all. - # Note: If this parameter is set to true, it won't hide tools. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. - typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false - - # If set to false, hide tool versions that are equal to "system". - # - # Note: If this parameter is set to true, it won't hide tools. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. - typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true - - # If set to non-empty value, hide tools unless there is a file matching the specified file pattern - # in the current directory, or its parent directory, or its grandparent directory, and so on. - # - # Note: If this parameter is set to empty value, it won't hide tools. - # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. - # - # Example: Hide nodejs version when there is no package.json and no *.js files in the current - # directory, in `..`, in `../..` and so on. - # - # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' - typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= - - # Ruby version from asdf. - typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=1 - # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Python version from asdf. - typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=6 - # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Go version from asdf. - typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=6 - # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Node.js version from asdf. - typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=2 - # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Rust version from asdf. - typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' - - # .NET Core version from asdf. - typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=5 - # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Flutter version from asdf. - typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Lua version from asdf. - typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Java version from asdf. - typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Perl version from asdf. - typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=6 - # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Erlang version from asdf. - typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=1 - # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Elixir version from asdf. - typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=5 - # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Postgres version from asdf. - typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=6 - # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' - - # PHP version from asdf. - typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=5 - # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Haskell version from asdf. - typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=3 - # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Julia version from asdf. - typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=2 - # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' - - ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### - # NordVPN connection indicator color. - typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=6 - # Hide NordVPN connection indicator when not connected. - typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= - typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= - # Custom icon. - # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## - # Ranger shell color. - typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 - # Custom icon. - # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### - # Nnn shell color. - typeset -g POWERLEVEL9K_NNN_FOREGROUND=3 - # Custom icon. - # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## - # xplr shell color. - typeset -g POWERLEVEL9K_XPLR_FOREGROUND=3 - # Custom icon. - # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########################[ vim_shell: vim shell indicator (:sh) ]########################### - # Vim shell indicator color. - typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=3 - # Custom icon. - # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### - # Midnight Commander shell color. - typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 - # Custom icon. - # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## - # Nix shell color. - typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=4 - - # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. - # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= - - # Custom icon. - # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##################################[ disk_usage: disk usage ]################################## - # Colors for different levels of disk usage. - typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=2 - typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=3 - typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=1 - # Thresholds for different levels of disk usage (percentage points). - typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 - typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 - # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. - typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false - # Custom icon. - # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######################################[ ram: free RAM ]####################################### - # RAM color. - typeset -g POWERLEVEL9K_RAM_FOREGROUND=2 - # Custom icon. - # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #####################################[ swap: used swap ]###################################### - # Swap color. - typeset -g POWERLEVEL9K_SWAP_FOREGROUND=3 - # Custom icon. - # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######################################[ load: CPU load ]###################################### - # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. - typeset -g POWERLEVEL9K_LOAD_WHICH=5 - # Load color when load is under 50%. - typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=2 - # Load color when load is between 50% and 70%. - typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=3 - # Load color when load is over 70%. - typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=1 - # Custom icon. - # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ - # Todo color. - typeset -g POWERLEVEL9K_TODO_FOREGROUND=4 - # Hide todo when the total number of tasks is zero. - typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true - # Hide todo when the number of tasks after filtering is zero. - typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false - - # Todo format. The following parameters are available within the expansion. - # - # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. - # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. - # - # These variables correspond to the last line of the output of `todo.sh -p ls`: - # - # TODO: 24 of 42 tasks shown - # - # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. - # - # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' - - # Custom icon. - # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ - # Timewarrior color. - typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=4 - # If the tracked task is longer than 24 characters, truncate and append "..". - # Tip: To always display tasks without truncation, delete the following parameter. - # Tip: To hide task names and display just the icon when time tracking is enabled, set the - # value of the following parameter to "". - typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+..}' - - # Custom icon. - # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## - # Taskwarrior color. - typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=6 - - # Taskwarrior segment format. The following parameters are available within the expansion. - # - # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. - # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. - # - # Zero values are represented as empty parameters. - # - # The default format: - # - # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' - # - # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' - - # Custom icon. - # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################################[ cpu_arch: CPU architecture ]################################ - # CPU architecture color. - typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=3 - - # Hide the segment when on a specific CPU architecture. - # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION= - # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION= - - # Custom icon. - # typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##################################[ context: user@hostname ]################################## - # Context color when running with privileges. - typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 - # Context color in SSH without privileges. - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=7 - # Default context color (no privileges, no SSH). - typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=7 - - # Context format when running with privileges: bold user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m' - # Context format when in SSH without privileges: user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' - # Default context format (no privileges, no SSH): user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' - - # Don't show context unless running with privileges or in SSH. - # Tip: Remove the next line to always show context. - typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= - - # Custom icon. - # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%fwith ' - - ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### - # Python virtual environment color. - typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=6 - # Don't show Python version next to the virtual environment name. - typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false - # If set to "false", won't show virtualenv if pyenv is already shown. - # If set to "if-different", won't show virtualenv if it's the same as pyenv. - typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false - # Separate environment name from Python version only with a space. - typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= - # Custom icon. - # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #####################[ anaconda: conda environment (https://conda.io/) ]###################### - # Anaconda environment color. - typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=6 - - # Anaconda segment format. The following parameters are available within the expansion. - # - # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. - # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. - # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). - # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). - # - # CONDA_PROMPT_MODIFIER can be configured with the following command: - # - # conda config --set env_prompt '({default_env}) ' - # - # The last argument is a Python format string that can use the following variables: - # - # - prefix The same as CONDA_PREFIX. - # - default_env The same as CONDA_DEFAULT_ENV. - # - name The last segment of CONDA_PREFIX. - # - stacked_env Comma-separated list of names in the environment stack. The first element is - # always the same as default_env. - # - # Note: '({default_env}) ' is the default value of env_prompt. - # - # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER - # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former - # is empty. - typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' - - # Custom icon. - # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ - # Pyenv color. - typeset -g POWERLEVEL9K_PYENV_FOREGROUND=6 - # Hide python version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) - # If set to false, hide python version if it's the same as global: - # $(pyenv version-name) == $(pyenv global). - typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide python version if it's equal to "system". - typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true - - # Pyenv segment format. The following parameters are available within the expansion. - # - # - P9K_CONTENT Current pyenv environment (pyenv version-name). - # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). - # - # The default format has the following logic: - # - # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or - # starts with "$P9K_PYENV_PYTHON_VERSION/". - # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". - typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' - - # Custom icon. - # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ - # Goenv color. - typeset -g POWERLEVEL9K_GOENV_FOREGROUND=6 - # Hide go version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) - # If set to false, hide go version if it's the same as global: - # $(goenv version-name) == $(goenv global). - typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide go version if it's equal to "system". - typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## - # Nodenv color. - typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 - # Hide node version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) - # If set to false, hide node version if it's the same as global: - # $(nodenv version-name) == $(nodenv global). - typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide node version if it's equal to "system". - typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### - # Nvm color. - typeset -g POWERLEVEL9K_NVM_FOREGROUND=2 - # Custom icon. - # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ - # Nodeenv color. - typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 - # Don't show Node version next to the environment name. - typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false - # Separate environment name from Node version only with a space. - typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= - # Custom icon. - # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##############################[ node_version: node.js version ]############################### - # Node version color. - typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=2 - # Show node version only when in a directory tree containing package.json. - typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######################[ go_version: go version (https://golang.org) ]######################## - # Go version color. - typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=6 - # Show go version only when in a go project subdirectory. - typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## - # Rust version color. - typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=4 - # Show rust version only when in a rust project subdirectory. - typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ - # .NET version color. - typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=5 - # Show .NET version only when in a .NET project subdirectory. - typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #####################[ php_version: php version (https://www.php.net/) ]###################### - # PHP version color. - typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=5 - # Show PHP version only when in a PHP project subdirectory. - typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### - # Laravel version color. - typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=1 - # Custom icon. - # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ####################[ java_version: java version (https://www.java.com/) ]#################### - # Java version color. - typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=4 - # Show java version only when in a java project subdirectory. - typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true - # Show brief version. - typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false - # Custom icon. - # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### - # Package color. - typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=6 - # Package format. The following parameters are available within the expansion. - # - # - P9K_PACKAGE_NAME The value of `name` field in package.json. - # - P9K_PACKAGE_VERSION The value of `version` field in package.json. - # - # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' - # Custom icon. - # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## - # Rbenv color. - typeset -g POWERLEVEL9K_RBENV_FOREGROUND=1 - # Hide ruby version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) - # If set to false, hide ruby version if it's the same as global: - # $(rbenv version-name) == $(rbenv global). - typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide ruby version if it's equal to "system". - typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## - # Rvm color. - typeset -g POWERLEVEL9K_RVM_FOREGROUND=1 - # Don't show @gemset at the end. - typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false - # Don't show ruby- at the front. - typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false - # Custom icon. - # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ - # Fvm color. - typeset -g POWERLEVEL9K_FVM_FOREGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### - # Lua color. - typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=4 - # Hide lua version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) - # If set to false, hide lua version if it's the same as global: - # $(luaenv version-name) == $(luaenv global). - typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide lua version if it's equal to "system". - typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ - # Java color. - typeset -g POWERLEVEL9K_JENV_FOREGROUND=4 - # Hide java version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) - # If set to false, hide java version if it's the same as global: - # $(jenv version-name) == $(jenv global). - typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide java version if it's equal to "system". - typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ - # Perl color. - typeset -g POWERLEVEL9K_PLENV_FOREGROUND=6 - # Hide perl version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) - # If set to false, hide perl version if it's the same as global: - # $(plenv version-name) == $(plenv global). - typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide perl version if it's equal to "system". - typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############ - # Perlbrew color. - typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 - # Show perlbrew version only when in a perl project subdirectory. - typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true - # Don't show "perl-" at the front. - typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false - # Custom icon. - # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ - # PHP color. - typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=5 - # Hide php version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) - # If set to false, hide php version if it's the same as global: - # $(phpenv version-name) == $(phpenv global). - typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide php version if it's equal to "system". - typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### - # Scala color. - typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=1 - # Hide scala version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) - # If set to false, hide scala version if it's the same as global: - # $(scalaenv version-name) == $(scalaenv global). - typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide scala version if it's equal to "system". - typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### - # Haskell color. - typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=3 - # Hide haskell version if it doesn't come from one of these sources. - # - # shell: version is set by STACK_YAML - # local: version is set by stack.yaml up the directory tree - # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) - typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) - # If set to false, hide haskell version if it's the same as in the implicit global project. - typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true - # Custom icon. - # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# - # Show kubecontext only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' - - # Kubernetes context classes for the purpose of using different colors, icons and expansions with - # different contexts. - # - # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current kubernetes context gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' DEFAULT) - # - # If your current kubernetes context is "deathray-testing/default", its class is TEST - # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=3 - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=5 - # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext - # segment. Parameter expansions are very flexible and fast, too. See reference: - # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. - # - # Within the expansion the following parameters are always available: - # - # - P9K_CONTENT The content that would've been displayed if there was no content - # expansion defined. - # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the - # output of `kubectl config get-contexts`. - # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the - # output of `kubectl config get-contexts`. - # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE - # in the output of `kubectl config get-contexts`. If there is no - # namespace, the parameter is set to "default". - # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the - # output of `kubectl config get-contexts`. - # - # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), - # the following extra parameters are available: - # - # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. - # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. - # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. - # - # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, - # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": - # - # - P9K_KUBECONTEXT_CLOUD_NAME=gke - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account - # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a - # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 - # - # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": - # - # - P9K_KUBECONTEXT_CLOUD_NAME=eks - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 - # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 - # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= - # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. - POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' - # Append the current context's namespace if it's not "default". - POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' - - # Custom prefix. - # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat ' - - ################[ terraform: terraform workspace (https://www.terraform.io) ]################# - # Don't show terraform workspace if it's literally "default". - typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false - # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current terraform workspace gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' OTHER) - # - # If your current terraform workspace is "project_test", its class is TEST because "project_test" - # doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=2 - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' OTHER) - typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4 - # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #############[ terraform_version: terraform version (https://www.terraform.io) ]############## - # Terraform version color. - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# - # Show aws only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show aws. - typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' - - # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current AWS profile gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_AWS_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' DEFAULT) - # - # If your current AWS profile is "company_test", its class is TEST - # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=2 - # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_AWS_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=3 - # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # AWS segment format. The following parameters are available within the expansion. - # - # - P9K_AWS_PROFILE The name of the current AWS profile. - # - P9K_AWS_REGION The region associated with the current AWS profile. - typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' - - #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# - # AWS Elastic Beanstalk environment color. - typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 - # Custom icon. - # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## - # Show azure only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show azure. - typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' - # Azure account name color. - typeset -g POWERLEVEL9K_AZURE_FOREGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### - # Show gcloud only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show gcloud. - typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' - # Google cloud color. - typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=4 - - # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or - # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative - # enough. You can use the following parameters in the expansions. Each of them corresponds to the - # output of `gcloud` tool. - # - # Parameter | Source - # -------------------------|-------------------------------------------------------------------- - # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' - # P9K_GCLOUD_ACCOUNT | gcloud config get-value account - # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project - # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' - # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. - # - # Obtaining project name requires sending a request to Google servers. This can take a long time - # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud - # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets - # set and gcloud prompt segment transitions to state COMPLETE. - # - # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL - # and COMPLETE. You can also hide gcloud in state PARTIAL by setting - # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and - # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. - typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' - typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' - - # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name - # this often. Negative value disables periodic polling. In this mode project name is retrieved - # only when the current configuration, account or project id changes. - typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 - - # Custom icon. - # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# - # Show google_app_cred only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show google_app_cred. - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' - - # Google application credentials classes for the purpose of using different colors, icons and - # expansions with different credentials. - # - # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first - # element in each pair defines a pattern against which the current kubernetes context gets - # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion - # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION - # parameters, you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. - # The first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( - # '*:*prod*:*' PROD - # '*:*test*:*' TEST - # '*' DEFAULT) - # - # If your current Google application credentials is "service_account deathray-testing x@y.com", - # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=3 - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( - # '*:*prod*:*' PROD # These values are examples that are unlikely - # '*:*test*:*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=5 - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by - # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: - # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. - # - # You can use the following parameters in the expansion. Each of them corresponds to one of the - # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. - # - # Parameter | JSON key file field - # ---------------------------------+--------------- - # P9K_GOOGLE_APP_CRED_TYPE | type - # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id - # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email - # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' - - ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### - # Toolbox color. - typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=3 - # Don't display the name of the toolbox if it matches fedora-toolbox-*. - typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' - # Custom icon. - # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%fin ' - - ###############################[ public_ip: public IP address ]############################### - # Public IP color. - typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=6 - # Custom icon. - # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ########################[ vpn_ip: virtual private network indicator ]######################### - # VPN IP color. - typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=3 - # When on VPN, show just an icon without the IP address. - # Tip: To display the private IP address when on VPN, remove the next line. - typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= - # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN - # to see the name of the interface. - typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*' - # If set to true, show one segment per matching network interface. If set to false, show only - # one segment corresponding to the first matching network interface. - # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. - typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false - # Custom icon. - # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### - # IP color. - typeset -g POWERLEVEL9K_IP_FOREGROUND=4 - # The following parameters are accessible within the expansion: - # - # Parameter | Meaning - # ----------------------+------------------------------------------- - # P9K_IP_IP | IP address - # P9K_IP_INTERFACE | network interface - # P9K_IP_RX_BYTES | total number of bytes received - # P9K_IP_TX_BYTES | total number of bytes sent - # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt - # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt - # P9K_IP_RX_RATE | receive rate (since last prompt) - # P9K_IP_TX_RATE | send rate (since last prompt) - typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %2F<$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %3F>$P9K_IP_TX_RATE}' - # Show information for the first network interface whose name matches this regular expression. - # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. - typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' - # Custom icon. - # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #########################[ proxy: system-wide http/https/ftp proxy ]########################## - # Proxy color. - typeset -g POWERLEVEL9K_PROXY_FOREGROUND=2 - # Custom icon. - # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################################[ battery: internal battery ]################################# - # Show battery in red when it's below this level and not connected to power supply. - typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 - typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1 - # Show battery in green when it's charging or fully charged. - typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=2 - # Show battery in yellow when it's discharging. - typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3 - # Battery pictograms going from low to high level of charge. - typeset -g POWERLEVEL9K_BATTERY_STAGES=('battery') - # Don't show the remaining time to charge/discharge. - typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false - - #####################################[ wifi: wifi speed ]##################################### - # WiFi color. - typeset -g POWERLEVEL9K_WIFI_FOREGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). - # - # # Wifi colors and icons for different signal strength levels (low to high). - # typeset -g my_wifi_fg=(4 4 4 4 4) # <-- change these values - # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values - # - # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' - # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' - # - # The following parameters are accessible within the expansions: - # - # Parameter | Meaning - # ----------------------+--------------- - # P9K_WIFI_SSID | service set identifier, a.k.a. network name - # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown - # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second - # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 - # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 - # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) - - ####################################[ time: current time ]#################################### - # Current time color. - typeset -g POWERLEVEL9K_TIME_FOREGROUND=6 - # Format for the current time: 09:51:02. See `man 3 strftime`. - typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' - # If set to true, time will update when you hit enter. This way prompts for the past - # commands will contain the start times of their commands as opposed to the default - # behavior where they contain the end times of their preceding commands. - typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false - # Custom icon. - typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION= - # Custom prefix. - # typeset -g POWERLEVEL9K_TIME_PREFIX='%fat ' - - # Example of a user-defined prompt segment. Function prompt_example will be called on every - # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or - # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and green text greeting the user. - # - # Type `p10k help segment` for documentation and a more sophisticated example. - function prompt_example() { - p10k segment -f 2 -i '*' -t 'hello, %n' - } - function prompt_private() { - if [ $__MATERUS_HM_ZSH_PRIVATE = "1" ]; then - p10k segment -f 5 -t 'PRIVATE' - fi - } - # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job - # is to generate the prompt segment for display in instant prompt. See - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. - # - # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function - # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k - # will replay these calls without actually calling instant_prompt_*. It is imperative that - # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this - # rule is not observed, the content of instant prompt will be incorrect. - # - # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If - # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. - function instant_prompt_example() { - # Since prompt_example always makes the same `p10k segment` calls, we can call it from - # instant_prompt_example. This will give us the same `example` prompt segment in the instant - # and regular prompts. - prompt_example - } - - # User-defined prompt segments can be customized the same way as built-in segments. - # typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=208 - # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt - # when accepting a command line. Supported values: - # - # - off: Don't change prompt when accepting a command line. - # - always: Trim down prompt when accepting a command line. - # - same-dir: Trim down prompt when accepting a command line unless this is the first command - # typed after changing current working directory. - typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off - - # Instant prompt mode. - # - # - off: Disable instant prompt. Choose this if you've tried instant prompt and found - # it incompatible with your zsh configuration files. - # - quiet: Enable instant prompt and don't print warnings when detecting console output - # during zsh initialization. Choose this if you've read and understood - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. - # - verbose: Enable instant prompt and print a warning when detecting console output during - # zsh initialization. Choose this if you've never tried instant prompt, haven't - # seen the warning, or if you are unsure what this all means. - typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose - - # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. - # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload - # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you - # really need it. - typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true - - # If p10k is already loaded, reload configuration. - # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. - (( ! $+functions[p10k] )) || p10k reload -} - -# Tell `p10k configure` which file it should overwrite. -typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} - -(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} -'builtin' 'unset' 'p10k_config_opts' diff --git a/extraFiles/config/zsh/p10kcfg/fullcolor.zsh b/extraFiles/config/zsh/p10kcfg/fullcolor.zsh deleted file mode 100644 index 661748a..0000000 --- a/extraFiles/config/zsh/p10kcfg/fullcolor.zsh +++ /dev/null @@ -1,1750 +0,0 @@ -# Generated by Powerlevel10k configuration wizard on 2022-10-23 at 21:56 CEST. -# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh. -# Wizard options: nerdfont-complete + powerline, small icons, rainbow, unicode, -# 24h time, angled separators, sharp heads, flat tails, 1 line, compact, many icons, -# fluent, instant_prompt=verbose. -# Type `p10k configure` to generate another config. -# -# Config for Powerlevel10k with powerline prompt style with colorful background. -# Type `p10k configure` to generate your own config based on it. -# -# Tip: Looking for a nice color? Here's a one-liner to print colormap. -# -# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done - -# Temporarily change options. -'builtin' 'local' '-a' 'p10k_config_opts' -[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') -[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') -[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') -'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' - -() { - emulate -L zsh -o extended_glob - - # Unset all configuration options. This allows you to apply configuration changes without - # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. - unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' - - # Zsh >= 5.1 is required. - [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return - - # The list of segments shown on the left. Fill it with the most important segments. - typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( - os_icon # os identifier - dir # current directory - vcs # git status - # prompt_char # prompt symbol - ) - - # The list of segments shown on the right. Fill it with less important segments. - # Right prompt on the last prompt line (where you are typing your commands) gets - # automatically hidden when the input line reaches it. Right prompt above the - # last prompt line gets hidden if it would overlap with left prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( - status # exit code of the last command - command_execution_time # duration of the last command - background_jobs # presence of background jobs - direnv # direnv status (https://direnv.net/) - asdf # asdf version manager (https://github.com/asdf-vm/asdf) - virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) - anaconda # conda environment (https://conda.io/) - pyenv # python environment (https://github.com/pyenv/pyenv) - goenv # go environment (https://github.com/syndbg/goenv) - nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) - nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) - nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) - # node_version # node.js version - # go_version # go version (https://golang.org) - # rust_version # rustc version (https://www.rust-lang.org) - # dotnet_version # .NET version (https://dotnet.microsoft.com) - # php_version # php version (https://www.php.net/) - # laravel_version # laravel php framework version (https://laravel.com/) - # java_version # java version (https://www.java.com/) - # package # name@version from package.json (https://docs.npmjs.com/files/package.json) - rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) - rvm # ruby version from rvm (https://rvm.io) - fvm # flutter version management (https://github.com/leoafarias/fvm) - luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) - jenv # java version from jenv (https://github.com/jenv/jenv) - plenv # perl version from plenv (https://github.com/tokuhirom/plenv) - perlbrew # perl version from perlbrew (https://github.com/gugod/App-perlbrew) - phpenv # php version from phpenv (https://github.com/phpenv/phpenv) - scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) - haskell_stack # haskell version from stack (https://haskellstack.org/) - kubecontext # current kubernetes context (https://kubernetes.io/) - terraform # terraform workspace (https://www.terraform.io) - # terraform_version # terraform version (https://www.terraform.io) - aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) - aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) - azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) - gcloud # google cloud cli account and project (https://cloud.google.com/) - google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) - toolbox # toolbox name (https://github.com/containers/toolbox) - context # user@hostname - nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) - ranger # ranger shell (https://github.com/ranger/ranger) - nnn # nnn shell (https://github.com/jarun/nnn) - xplr # xplr shell (https://github.com/sayanarijit/xplr) - vim_shell # vim shell indicator (:sh) - midnight_commander # midnight commander shell (https://midnight-commander.org/) - nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) - vi_mode # vi mode (you don't need this if you've enabled prompt_char) - # vpn_ip # virtual private network indicator - # load # CPU load - # disk_usage # disk usage - # ram # free RAM - # swap # used swap - todo # todo items (https://github.com/todotxt/todo.txt-cli) - timewarrior # timewarrior tracking status (https://timewarrior.net/) - taskwarrior # taskwarrior task count (https://taskwarrior.org/) - # cpu_arch # CPU architecture - private - time # current time - # ip # ip address and bandwidth usage for a specified network interface - # public_ip # public IP address - # proxy # system-wide http/https/ftp proxy - # battery # internal battery - # wifi # wifi speed - # example # example user-defined segment (see prompt_example function below) - ) - - # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. - typeset -g POWERLEVEL9K_MODE=nerdfont-complete - # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid - # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. - typeset -g POWERLEVEL9K_ICON_PADDING=none - - # When set to true, icons appear before content on both sides of the prompt. When set - # to false, icons go after content. If empty or not set, icons go before content in the left - # prompt and after content in the right prompt. - # - # You can also override it for a specific segment: - # - # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false - # - # Or for a specific segment in specific state: - # - # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false - typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT= - - # Add an empty line before each prompt. - typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false - - # Connect left prompt lines with these symbols. You'll probably want to use the same color - # as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%242F╭─' - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%242F├─' - typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%242F╰─' - # Connect right prompt lines with these symbols. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX='%242F─╮' - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX='%242F─┤' - typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX='%242F─╯' - - # Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or - # '─'. The last two make it easier to see the alignment between left and right prompt and to - # separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false - # for more compact prompt if using this option. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND= - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND= - if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then - # The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE - # ornaments defined above. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242 - # Start filler from the edge of the screen if there are no left segments on the first line. - typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' - # End filler on the edge of the screen if there are no right segments on the first line. - typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' - fi - - # Separator between same-color segments on the left. - typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B1' - # Separator between same-color segments on the right. - typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B3' - # Separator between different-color segments on the left. - typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0' - # Separator between different-color segments on the right. - typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2' - # The right end of left prompt. - typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' - # The left end of right prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' - # The left end of left prompt. - typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='' - # The right end of right prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='' - # Left prompt terminator for lines without any segments. - typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= - - #################################[ os_icon: os identifier ]################################## - # OS identifier color. - typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=11 - typeset -g POWERLEVEL9K_OS_ICON_BACKGROUND=54 - # Custom icon. - # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' - - ################################[ prompt_char: prompt symbol ]################################ - # Transparent background. - typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND= - # Green prompt symbol if the last command succeeded. - typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 - # Red prompt symbol if the last command failed. - typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 - # Default prompt symbol. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' - # Prompt symbol in command vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' - # Prompt symbol in visual vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' - # Prompt symbol in overwrite vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' - typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true - # No line terminator if prompt_char is the last segment. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= - # No line introducer if prompt_char is the first segment. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= - # No surrounding whitespace. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE= - - ##################################[ dir: current directory ]################################## - # Current directory background color. - typeset -g POWERLEVEL9K_DIR_BACKGROUND=11 - # Default current directory foreground color. - typeset -g POWERLEVEL9K_DIR_FOREGROUND=54 - # If directory is too long, shorten some of its segments to the shortest possible unique - # prefix. The shortened directory can be tab-completed to the original. - typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique - # Replace removed segment suffixes with this symbol. - typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= - # Color of the shortened directory segments. - typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=54 - # Color of the anchor directory segments. Anchor segments are never shortened. The first - # segment is always an anchor. - typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=54 - # Display anchor directory segments in bold. - typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true - # Don't shorten directories that contain any of these files. They are anchors. - local anchor_files=( - .bzr - .citc - .git - .hg - .node-version - .python-version - .go-version - .ruby-version - .lua-version - .java-version - .perl-version - .php-version - .tool-version - .shorten_folder_marker - .svn - .terraform - CVS - Cargo.toml - composer.json - go.mod - package.json - stack.yaml - ) - typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" - # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains - # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is - # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) - # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers - # and other directories don't. - # - # Optionally, "first" and "last" can be followed by ":" where is an integer. - # This moves the truncation point to the right (positive offset) or to the left (negative offset) - # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" - # respectively. - typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false - # Don't shorten this many last directory segments. They are anchors. - typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 - # Shorten directory if it's longer than this even if there is space for it. The value can - # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, - # directory will be shortened only when prompt doesn't fit or when other parameters demand it - # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). - # If set to `0`, directory will always be shortened to its minimum length. - typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 - # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this - # many columns for typing commands. - typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 - # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least - # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. - typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 - # If set to true, embed a hyperlink into the directory. Useful for quickly - # opening a directory in the file manager simply by clicking the link. - # Can also be handy when the directory is shortened, as it allows you to see - # the full directory that was used in previous commands. - typeset -g POWERLEVEL9K_DIR_HYPERLINK=false - - # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON - # and POWERLEVEL9K_DIR_CLASSES below. - typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 - - # The default icon shown next to non-writable and non-existent directories when - # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. - # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' - - # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different - # directories. It must be an array with 3 * N elements. Each triplet consists of: - # - # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with - # extended_glob option enabled. - # 2. Directory class for the purpose of styling. - # 3. An empty string. - # - # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. - # - # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories - # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_DIR_CLASSES=( - # '~/work(|/*)' WORK '' - # '~(|/*)' HOME '' - # '*' DEFAULT '') - # - # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one - # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or - # WORK_NON_EXISTENT. - # - # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an - # option to define custom colors and icons for different directory classes. - # - # # Styling for WORK. - # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_DIR_WORK_BACKGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=254 - # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=250 - # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=255 - # - # # Styling for WORK_NOT_WRITABLE. - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_BACKGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=254 - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=250 - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=255 - # - # # Styling for WORK_NON_EXISTENT. - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_BACKGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=254 - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=250 - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=255 - # - # If a styling parameter isn't explicitly defined for some class, it falls back to the classless - # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls - # back to POWERLEVEL9K_DIR_FOREGROUND. - # - # typeset -g POWERLEVEL9K_DIR_CLASSES=() - - # Custom prefix. - # typeset -g POWERLEVEL9K_DIR_PREFIX='in ' - - #####################################[ vcs: git status ]###################################### - # Version control background colors. - typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2 - typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=50 - typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2 - typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=3 - typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=8 - - # Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon. - typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' - - # Untracked files icon. It's really a question mark, your font isn't broken. - # Change the value of this parameter to show a different icon. - typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' - - # Formatter for Git status. - # - # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. - # - # You can edit the function to customize how Git status looks. - # - # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: - # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. - function my_git_formatter() { - emulate -L zsh - - if [[ -n $P9K_CONTENT ]]; then - # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from - # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. - typeset -g my_git_format=$P9K_CONTENT - return - fi - - # Styling for different parts of Git status. - local meta='%7F' # white foreground - local clean='%0F' # black foreground - local modified='%0F' # black foreground - local untracked='%0F' # black foreground - local conflicted='%1F' # red foreground - - local res - - if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then - local branch=${(V)VCS_STATUS_LOCAL_BRANCH} - # If local branch name is at most 32 characters long, show it in full. - # Otherwise show the first 12 … the last 12. - # Tip: To always show local branch name in full without truncation, delete the next line. - (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line - res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" - fi - - if [[ -n $VCS_STATUS_TAG - # Show tag only if not on a branch. - # Tip: To always show tag, delete the next line. - && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line - ]]; then - local tag=${(V)VCS_STATUS_TAG} - # If tag name is at most 32 characters long, show it in full. - # Otherwise show the first 12 … the last 12. - # Tip: To always show tag name in full without truncation, delete the next line. - (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line - res+="${meta}#${clean}${tag//\%/%%}" - fi - - # Display the current Git commit if there is no branch and no tag. - # Tip: To always display the current Git commit, delete the next line. - [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line - res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" - - # Show tracking branch name if it differs from local branch. - if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then - res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" - fi - - # Display "wip" if the latest commit's summary contains "wip" or "WIP". - if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then - res+=" ${modified}wip" - fi - - # ⇣42 if behind the remote. - (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" - # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. - (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " - (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" - # ⇠42 if behind the push remote. - (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" - (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " - # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42. - (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" - # *42 if have stashes. - (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" - # 'merge' if the repo is in an unusual state. - [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" - # ~42 if have merge conflicts. - (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" - # +42 if have staged changes. - (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" - # !42 if have unstaged changes. - (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" - # ?42 if have untracked files. It's really a question mark, your font isn't broken. - # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. - # Remove the next line if you don't want to see untracked files at all. - (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" - # "─" if the number of unstaged files is unknown. This can happen due to - # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower - # than the number of files in the Git index, or due to bash.showDirtyState being set to false - # in the repository config. The number of staged and untracked files may also be unknown - # in this case. - (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" - - typeset -g my_git_format=$res - } - functions -M my_git_formatter 2>/dev/null - - # Don't count the number of unstaged, untracked and conflicted files in Git repositories with - # more than this many files in the index. Negative value means infinity. - # - # If you are working in Git repositories with tens of millions of files and seeing performance - # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output - # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's - # config: `git config bash.showDirtyState false`. - typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 - - # Don't show Git status in prompt for repositories whose workdir matches this pattern. - # For example, if set to '~', the Git repository at $HOME/.git will be ignored. - # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. - typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' - - # Disable the default Git status formatting. - typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true - # Install our own Git status formatter. - typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter()))+${my_git_format}}' - # Enable counters for staged, unstaged, etc. - typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 - - # Custom icon. - # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - typeset -g POWERLEVEL9K_VCS_PREFIX='on ' - - # Show status of repositories of these types. You can add svn and/or hg if you are - # using them. If you do, your prompt may become slow even when your current directory - # isn't in an svn or hg repository. - typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) - - ##########################[ status: exit code of the last command ]########################### - # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and - # style them independently from the regular OK and ERROR state. - typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true - - # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as - # it will signify success by turning green. - typeset -g POWERLEVEL9K_STATUS_OK=true - typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' - typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=2 - typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND=0 - - # Status when some part of a pipe command fails but the overall exit status is zero. It may look - # like this: 1|0. - typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true - typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' - typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=2 - typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0 - - # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as - # it will signify error by turning red. - typeset -g POWERLEVEL9K_STATUS_ERROR=true - typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' - typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=3 - typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=1 - - # Status when the last command was terminated by a signal. - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true - # Use terse signal names: "INT" instead of "SIGINT(2)". - typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=3 - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_BACKGROUND=1 - - # Status when some part of a pipe command fails and the overall exit status is also non-zero. - # It may look like this: 1|0. - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=3 - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_BACKGROUND=1 - - ###################[ command_execution_time: duration of the last command ]################### - # Execution time color. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0 - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=3 - # Show duration of the last command if takes at least this many seconds. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 - # Show this many fractional digits. Zero means round to seconds. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 - # Duration format: 1d 2h 3m 4s. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' - # Custom icon. - # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='took ' - - #######################[ background_jobs: presence of background jobs ]####################### - # Background jobs color. - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=6 - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=0 - # Don't show the number of background jobs. - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false - # Custom icon. - # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######################[ direnv: direnv status (https://direnv.net/) ]######################## - # Direnv color. - typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3 - typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### - # Default asdf color. Only used to display tools for which there is no color override (see below). - # Tip: Override these parameters for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND and - # POWERLEVEL9K_ASDF_${TOOL}_BACKGROUND. - typeset -g POWERLEVEL9K_ASDF_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_BACKGROUND=7 - - # There are four parameters that can be used to hide asdf tools. Each parameter describes - # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at - # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to - # hide a tool, it gets shown. - # - # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and - # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: - # - # asdf local python 3.8.1 - # asdf global python 3.8.1 - # - # After running both commands the current python version is 3.8.1 and its source is "local" as - # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, - # it'll hide python version in this case because 3.8.1 is the same as the global version. - # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't - # contain "local". - - # Hide tool versions that don't come from one of these sources. - # - # Available sources: - # - # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" - # - local `asdf current` says "set by /some/not/home/directory/file" - # - global `asdf current` says "set by /home/username/file" - # - # Note: If this parameter is set to (shell local global), it won't hide tools. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. - typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) - - # If set to false, hide tool versions that are the same as global. - # - # Note: The name of this parameter doesn't reflect its meaning at all. - # Note: If this parameter is set to true, it won't hide tools. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. - typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false - - # If set to false, hide tool versions that are equal to "system". - # - # Note: If this parameter is set to true, it won't hide tools. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. - typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true - - # If set to non-empty value, hide tools unless there is a file matching the specified file pattern - # in the current directory, or its parent directory, or its grandparent directory, and so on. - # - # Note: If this parameter is set to empty value, it won't hide tools. - # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. - # - # Example: Hide nodejs version when there is no package.json and no *.js files in the current - # directory, in `..`, in `../..` and so on. - # - # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' - typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= - - # Ruby version from asdf. - typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_RUBY_BACKGROUND=1 - # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Python version from asdf. - typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_PYTHON_BACKGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Go version from asdf. - typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_GOLANG_BACKGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Node.js version from asdf. - typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_NODEJS_BACKGROUND=2 - # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Rust version from asdf. - typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_RUST_BACKGROUND=208 - # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' - - # .NET Core version from asdf. - typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_BACKGROUND=5 - # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Flutter version from asdf. - typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_FLUTTER_BACKGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Lua version from asdf. - typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_LUA_BACKGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Java version from asdf. - typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=1 - typeset -g POWERLEVEL9K_ASDF_JAVA_BACKGROUND=7 - # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Perl version from asdf. - typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_PERL_BACKGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Erlang version from asdf. - typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_ERLANG_BACKGROUND=1 - # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Elixir version from asdf. - typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_ELIXIR_BACKGROUND=5 - # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Postgres version from asdf. - typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_POSTGRES_BACKGROUND=6 - # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' - - # PHP version from asdf. - typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_PHP_BACKGROUND=5 - # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Haskell version from asdf. - typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_HASKELL_BACKGROUND=3 - # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Julia version from asdf. - typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_JULIA_BACKGROUND=2 - # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' - - ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### - # NordVPN connection indicator color. - typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 - typeset -g POWERLEVEL9K_NORDVPN_BACKGROUND=4 - # Hide NordVPN connection indicator when not connected. - typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= - typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= - # Custom icon. - # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## - # Ranger shell color. - typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 - typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### - # Nnn shell color. - typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 - typeset -g POWERLEVEL9K_NNN_BACKGROUND=6 - # Custom icon. - # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## - # xplr shell color. - typeset -g POWERLEVEL9K_XPLR_FOREGROUND=0 - typeset -g POWERLEVEL9K_XPLR_BACKGROUND=6 - # Custom icon. - # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########################[ vim_shell: vim shell indicator (:sh) ]########################### - # Vim shell indicator color. - typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 - typeset -g POWERLEVEL9K_VIM_SHELL_BACKGROUND=2 - # Custom icon. - # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### - # Midnight Commander shell color. - typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 - typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## - # Nix shell color. - typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0 - typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4 - - # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. - # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= - - # Custom icon. - # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##################################[ disk_usage: disk usage ]################################## - # Colors for different levels of disk usage. - typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=3 - typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_BACKGROUND=0 - typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=0 - typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_BACKGROUND=3 - typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=7 - typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_BACKGROUND=1 - # Thresholds for different levels of disk usage (percentage points). - typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 - typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 - # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. - typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false - # Custom icon. - # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]########### - # Foreground color. - typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0 - # Text and color for normal (a.k.a. command) vi mode. - typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL - typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2 - # Text and color for visual vi mode. - typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL - typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4 - # Text and color for overtype (a.k.a. overwrite and replace) vi mode. - typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE - typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3 - # Text and color for insert vi mode. - typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= - typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8 - - ######################################[ ram: free RAM ]####################################### - # RAM color. - typeset -g POWERLEVEL9K_RAM_FOREGROUND=0 - typeset -g POWERLEVEL9K_RAM_BACKGROUND=3 - # Custom icon. - # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #####################################[ swap: used swap ]###################################### - # Swap color. - typeset -g POWERLEVEL9K_SWAP_FOREGROUND=0 - typeset -g POWERLEVEL9K_SWAP_BACKGROUND=3 - # Custom icon. - # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######################################[ load: CPU load ]###################################### - # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. - typeset -g POWERLEVEL9K_LOAD_WHICH=5 - # Load color when load is under 50%. - typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=0 - typeset -g POWERLEVEL9K_LOAD_NORMAL_BACKGROUND=2 - # Load color when load is between 50% and 70%. - typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=0 - typeset -g POWERLEVEL9K_LOAD_WARNING_BACKGROUND=3 - # Load color when load is over 70%. - typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=0 - typeset -g POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND=1 - # Custom icon. - # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ - # Todo color. - typeset -g POWERLEVEL9K_TODO_FOREGROUND=0 - typeset -g POWERLEVEL9K_TODO_BACKGROUND=8 - # Hide todo when the total number of tasks is zero. - typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true - # Hide todo when the number of tasks after filtering is zero. - typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false - - # Todo format. The following parameters are available within the expansion. - # - # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. - # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. - # - # These variables correspond to the last line of the output of `todo.sh -p ls`: - # - # TODO: 24 of 42 tasks shown - # - # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. - # - # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' - - # Custom icon. - # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ - # Timewarrior color. - typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=255 - typeset -g POWERLEVEL9K_TIMEWARRIOR_BACKGROUND=8 - - # If the tracked task is longer than 24 characters, truncate and append "…". - # Tip: To always display tasks without truncation, delete the following parameter. - # Tip: To hide task names and display just the icon when time tracking is enabled, set the - # value of the following parameter to "". - typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}' - - # Custom icon. - # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## - # Taskwarrior color. - typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=0 - typeset -g POWERLEVEL9K_TASKWARRIOR_BACKGROUND=6 - - # Taskwarrior segment format. The following parameters are available within the expansion. - # - # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. - # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. - # - # Zero values are represented as empty parameters. - # - # The default format: - # - # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' - # - # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' - - # Custom icon. - # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################################[ cpu_arch: CPU architecture ]################################ - # CPU architecture color. - typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=0 - typeset -g POWERLEVEL9K_CPU_ARCH_BACKGROUND=3 - - # Hide the segment when on a specific CPU architecture. - # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION= - # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION= - - # Custom icon. - # typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##################################[ context: user@hostname ]################################## - # Context color when running with privileges. - typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 - typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=0 - # Context color in SSH without privileges. - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=3 - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=0 - # Default context color (no privileges, no SSH). - typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=3 - typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=0 - - # Context format when running with privileges: user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n@%m' - # Context format when in SSH without privileges: user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' - # Default context format (no privileges, no SSH): user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' - - # Don't show context unless running with privileges or in SSH. - # Tip: Remove the next line to always show context. - typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= - - # Custom icon. - # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - typeset -g POWERLEVEL9K_CONTEXT_PREFIX='with ' - - ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### - # Python virtual environment color. - typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4 - # Don't show Python version next to the virtual environment name. - typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false - # If set to "false", won't show virtualenv if pyenv is already shown. - # If set to "if-different", won't show virtualenv if it's the same as pyenv. - typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false - # Separate environment name from Python version only with a space. - typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= - # Custom icon. - # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #####################[ anaconda: conda environment (https://conda.io/) ]###################### - # Anaconda environment color. - typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=0 - typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=4 - - # Anaconda segment format. The following parameters are available within the expansion. - # - # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. - # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. - # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). - # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). - # - # CONDA_PROMPT_MODIFIER can be configured with the following command: - # - # conda config --set env_prompt '({default_env}) ' - # - # The last argument is a Python format string that can use the following variables: - # - # - prefix The same as CONDA_PREFIX. - # - default_env The same as CONDA_DEFAULT_ENV. - # - name The last segment of CONDA_PREFIX. - # - stacked_env Comma-separated list of names in the environment stack. The first element is - # always the same as default_env. - # - # Note: '({default_env}) ' is the default value of env_prompt. - # - # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER - # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former - # is empty. - typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' - - # Custom icon. - # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ - # Pyenv color. - typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4 - # Hide python version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) - # If set to false, hide python version if it's the same as global: - # $(pyenv version-name) == $(pyenv global). - typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide python version if it's equal to "system". - typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true - - # Pyenv segment format. The following parameters are available within the expansion. - # - # - P9K_CONTENT Current pyenv environment (pyenv version-name). - # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). - # - # The default format has the following logic: - # - # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or - # starts with "$P9K_PYENV_PYTHON_VERSION/". - # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". - typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' - - # Custom icon. - # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ - # Goenv color. - typeset -g POWERLEVEL9K_GOENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_GOENV_BACKGROUND=4 - # Hide go version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) - # If set to false, hide go version if it's the same as global: - # $(goenv version-name) == $(goenv global). - typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide go version if it's equal to "system". - typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## - # Nodenv color. - typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 - typeset -g POWERLEVEL9K_NODENV_BACKGROUND=0 - # Hide node version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) - # If set to false, hide node version if it's the same as global: - # $(nodenv version-name) == $(nodenv global). - typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide node version if it's equal to "system". - typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### - # Nvm color. - typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 - typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 - # Custom icon. - # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ - # Nodeenv color. - typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 - typeset -g POWERLEVEL9K_NODEENV_BACKGROUND=0 - # Don't show Node version next to the environment name. - typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false - # Separate environment name from Node version only with a space. - typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= - # Custom icon. - # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##############################[ node_version: node.js version ]############################### - # Node version color. - typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=7 - typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=2 - # Show node version only when in a directory tree containing package.json. - typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######################[ go_version: go version (https://golang.org) ]######################## - # Go version color. - typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=255 - typeset -g POWERLEVEL9K_GO_VERSION_BACKGROUND=2 - # Show go version only when in a go project subdirectory. - typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## - # Rust version color. - typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=0 - typeset -g POWERLEVEL9K_RUST_VERSION_BACKGROUND=208 - # Show rust version only when in a rust project subdirectory. - typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ - # .NET version color. - typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=7 - typeset -g POWERLEVEL9K_DOTNET_VERSION_BACKGROUND=5 - # Show .NET version only when in a .NET project subdirectory. - typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #####################[ php_version: php version (https://www.php.net/) ]###################### - # PHP version color. - typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=0 - typeset -g POWERLEVEL9K_PHP_VERSION_BACKGROUND=5 - # Show PHP version only when in a PHP project subdirectory. - typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### - # Laravel version color. - typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=1 - typeset -g POWERLEVEL9K_LARAVEL_VERSION_BACKGROUND=7 - # Custom icon. - # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## - # Rbenv color. - typeset -g POWERLEVEL9K_RBENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_RBENV_BACKGROUND=1 - # Hide ruby version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) - # If set to false, hide ruby version if it's the same as global: - # $(rbenv version-name) == $(rbenv global). - typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide ruby version if it's equal to "system". - typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ####################[ java_version: java version (https://www.java.com/) ]#################### - # Java version color. - typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=1 - typeset -g POWERLEVEL9K_JAVA_VERSION_BACKGROUND=7 - # Show java version only when in a java project subdirectory. - typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true - # Show brief version. - typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false - # Custom icon. - # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### - # Package color. - typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=0 - typeset -g POWERLEVEL9K_PACKAGE_BACKGROUND=6 - - # Package format. The following parameters are available within the expansion. - # - # - P9K_PACKAGE_NAME The value of `name` field in package.json. - # - P9K_PACKAGE_VERSION The value of `version` field in package.json. - # - # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' - - # Custom icon. - # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## - # Rvm color. - typeset -g POWERLEVEL9K_RVM_FOREGROUND=0 - typeset -g POWERLEVEL9K_RVM_BACKGROUND=240 - # Don't show @gemset at the end. - typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false - # Don't show ruby- at the front. - typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false - # Custom icon. - # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ - # Fvm color. - typeset -g POWERLEVEL9K_FVM_FOREGROUND=0 - typeset -g POWERLEVEL9K_FVM_BACKGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### - # Lua color. - typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_LUAENV_BACKGROUND=4 - # Hide lua version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) - # If set to false, hide lua version if it's the same as global: - # $(luaenv version-name) == $(luaenv global). - typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide lua version if it's equal to "system". - typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ - # Java color. - typeset -g POWERLEVEL9K_JENV_FOREGROUND=1 - typeset -g POWERLEVEL9K_JENV_BACKGROUND=7 - # Hide java version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) - # If set to false, hide java version if it's the same as global: - # $(jenv version-name) == $(jenv global). - typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide java version if it's equal to "system". - typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ - # Perl color. - typeset -g POWERLEVEL9K_PLENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_PLENV_BACKGROUND=4 - # Hide perl version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) - # If set to false, hide perl version if it's the same as global: - # $(plenv version-name) == $(plenv global). - typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide perl version if it's equal to "system". - typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############ - # Perlbrew color. - typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67 - # Show perlbrew version only when in a perl project subdirectory. - typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true - # Don't show "perl-" at the front. - typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false - # Custom icon. - # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ - # PHP color. - typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_PHPENV_BACKGROUND=5 - # Hide php version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) - # If set to false, hide php version if it's the same as global: - # $(phpenv version-name) == $(phpenv global). - typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide PHP version if it's equal to "system". - typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### - # Scala color. - typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_SCALAENV_BACKGROUND=1 - # Hide scala version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) - # If set to false, hide scala version if it's the same as global: - # $(scalaenv version-name) == $(scalaenv global). - typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide scala version if it's equal to "system". - typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### - # Haskell color. - typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=0 - typeset -g POWERLEVEL9K_HASKELL_STACK_BACKGROUND=3 - - # Hide haskell version if it doesn't come from one of these sources. - # - # shell: version is set by STACK_YAML - # local: version is set by stack.yaml up the directory tree - # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) - typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) - # If set to false, hide haskell version if it's the same as in the implicit global project. - typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true - # Custom icon. - # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ terraform: terraform workspace (https://www.terraform.io) ]################# - # Don't show terraform workspace if it's literally "default". - typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false - # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current terraform workspace gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' OTHER) - # - # If your current terraform workspace is "project_test", its class is TEST because "project_test" - # doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=2 - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_BACKGROUND=0 - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' OTHER) - typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4 - typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=0 - # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #############[ terraform_version: terraform version (https://www.terraform.io) ]############## - # Terraform version color. - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]################# - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf' - - #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# - # Show kubecontext only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold' - - # Kubernetes context classes for the purpose of using different colors, icons and expansions with - # different contexts. - # - # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current kubernetes context gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' DEFAULT) - # - # If your current kubernetes context is "deathray-testing/default", its class is TEST - # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=0 - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_BACKGROUND=2 - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=7 - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_BACKGROUND=5 - # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext - # segment. Parameter expansions are very flexible and fast, too. See reference: - # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. - # - # Within the expansion the following parameters are always available: - # - # - P9K_CONTENT The content that would've been displayed if there was no content - # expansion defined. - # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the - # output of `kubectl config get-contexts`. - # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the - # output of `kubectl config get-contexts`. - # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE - # in the output of `kubectl config get-contexts`. If there is no - # namespace, the parameter is set to "default". - # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the - # output of `kubectl config get-contexts`. - # - # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), - # the following extra parameters are available: - # - # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. - # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. - # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. - # - # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, - # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": - # - # - P9K_KUBECONTEXT_CLOUD_NAME=gke - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account - # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a - # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 - # - # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": - # - # - P9K_KUBECONTEXT_CLOUD_NAME=eks - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 - # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 - # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= - # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. - POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' - # Append the current context's namespace if it's not "default". - POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' - - # Custom prefix. - typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at ' - - #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# - # Show aws only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show aws. - typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' - - # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current AWS profile gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_AWS_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' DEFAULT) - # - # If your current AWS profile is "company_test", its class is TEST - # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28 - # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_AWS_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=7 - typeset -g POWERLEVEL9K_AWS_DEFAULT_BACKGROUND=1 - # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # AWS segment format. The following parameters are available within the expansion. - # - # - P9K_AWS_PROFILE The name of the current AWS profile. - # - P9K_AWS_REGION The region associated with the current AWS profile. - typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' - - #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# - # AWS Elastic Beanstalk environment color. - typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 - typeset -g POWERLEVEL9K_AWS_EB_ENV_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## - # Show azure only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show azure. - typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' - # Azure account name color. - typeset -g POWERLEVEL9K_AZURE_FOREGROUND=7 - typeset -g POWERLEVEL9K_AZURE_BACKGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### - # Show gcloud only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show gcloud. - typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' - # Google cloud color. - typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7 - typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4 - - # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or - # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative - # enough. You can use the following parameters in the expansions. Each of them corresponds to the - # output of `gcloud` tool. - # - # Parameter | Source - # -------------------------|-------------------------------------------------------------------- - # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' - # P9K_GCLOUD_ACCOUNT | gcloud config get-value account - # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project - # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' - # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. - # - # Obtaining project name requires sending a request to Google servers. This can take a long time - # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud - # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets - # set and gcloud prompt segment transitions to state COMPLETE. - # - # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL - # and COMPLETE. You can also hide gcloud in state PARTIAL by setting - # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and - # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. - typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' - typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' - - # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name - # this often. Negative value disables periodic polling. In this mode project name is retrieved - # only when the current configuration, account or project id changes. - typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 - - # Custom icon. - # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# - # Show google_app_cred only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show google_app_cred. - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' - - # Google application credentials classes for the purpose of using different colors, icons and - # expansions with different credentials. - # - # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first - # element in each pair defines a pattern against which the current kubernetes context gets - # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion - # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION - # parameters, you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. - # The first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( - # '*:*prod*:*' PROD - # '*:*test*:*' TEST - # '*' DEFAULT) - # - # If your current Google application credentials is "service_account deathray-testing x@y.com", - # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28 - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( - # '*:*prod*:*' PROD # These values are examples that are unlikely - # '*:*test*:*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=7 - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_BACKGROUND=4 - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by - # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: - # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. - # - # You can use the following parameters in the expansion. Each of them corresponds to one of the - # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. - # - # Parameter | JSON key file field - # ---------------------------------+--------------- - # P9K_GOOGLE_APP_CRED_TYPE | type - # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id - # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email - # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' - - ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### - # Toolbox color. - typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=0 - typeset -g POWERLEVEL9K_TOOLBOX_BACKGROUND=3 - # Don't display the name of the toolbox if it matches fedora-toolbox-*. - typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' - # Custom icon. - # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='in ' - - ###############################[ public_ip: public IP address ]############################### - # Public IP color. - typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7 - typeset -g POWERLEVEL9K_PUBLIC_IP_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ########################[ vpn_ip: virtual private network indicator ]######################### - # VPN IP color. - typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=0 - typeset -g POWERLEVEL9K_VPN_IP_BACKGROUND=6 - # When on VPN, show just an icon without the IP address. - # Tip: To display the private IP address when on VPN, remove the next line. - typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= - # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN - # to see the name of the interface. - typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*' - # If set to true, show one segment per matching network interface. If set to false, show only - # one segment corresponding to the first matching network interface. - # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. - typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false - # Custom icon. - # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### - # IP color. - typeset -g POWERLEVEL9K_IP_BACKGROUND=4 - typeset -g POWERLEVEL9K_IP_FOREGROUND=0 - # The following parameters are accessible within the expansion: - # - # Parameter | Meaning - # ----------------------+------------------------------------------- - # P9K_IP_IP | IP address - # P9K_IP_INTERFACE | network interface - # P9K_IP_RX_BYTES | total number of bytes received - # P9K_IP_TX_BYTES | total number of bytes sent - # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt - # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt - # P9K_IP_RX_RATE | receive rate (since last prompt) - # P9K_IP_TX_RATE | send rate (since last prompt) - typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='${P9K_IP_RX_RATE:+⇣$P9K_IP_RX_RATE }${P9K_IP_TX_RATE:+⇡$P9K_IP_TX_RATE }$P9K_IP_IP' - # Show information for the first network interface whose name matches this regular expression. - # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. - typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' - # Custom icon. - # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #########################[ proxy: system-wide http/https/ftp proxy ]########################## - # Proxy color. - typeset -g POWERLEVEL9K_PROXY_FOREGROUND=4 - typeset -g POWERLEVEL9K_PROXY_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################################[ battery: internal battery ]################################# - # Show battery in red when it's below this level and not connected to power supply. - typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 - typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1 - # Show battery in green when it's charging or fully charged. - typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=2 - # Show battery in yellow when it's discharging. - typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3 - # Battery pictograms going from low to high level of charge. - typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578' - # Don't show the remaining time to charge/discharge. - typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false - typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=0 - - #####################################[ wifi: wifi speed ]##################################### - # WiFi color. - typeset -g POWERLEVEL9K_WIFI_FOREGROUND=0 - typeset -g POWERLEVEL9K_WIFI_BACKGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). - # - # # Wifi colors and icons for different signal strength levels (low to high). - # typeset -g my_wifi_fg=(0 0 0 0 0) # <-- change these values - # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values - # - # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' - # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' - # - # The following parameters are accessible within the expansions: - # - # Parameter | Meaning - # ----------------------+--------------- - # P9K_WIFI_SSID | service set identifier, a.k.a. network name - # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown - # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second - # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 - # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 - # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) - - ####################################[ time: current time ]#################################### - # Current time color. - typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 - typeset -g POWERLEVEL9K_TIME_BACKGROUND=7 - # Format for the current time: 09:51:02. See `man 3 strftime`. - typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' - # If set to true, time will update when you hit enter. This way prompts for the past - # commands will contain the start times of their commands as opposed to the default - # behavior where they contain the end times of their preceding commands. - typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false - # Custom icon. - # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - typeset -g POWERLEVEL9K_TIME_PREFIX='' - - # Example of a user-defined prompt segment. Function prompt_example will be called on every - # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or - # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and yellow text on red background - # greeting the user. - # - # Type `p10k help segment` for documentation and a more sophisticated example. - function prompt_private() { - if [ $__MATERUS_HM_ZSH_PRIVATE = "1" ]; then - p10k segment -b 54 -f 11 -i '󰗹' -t 'PRIVATE' - fi - } - - # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job - # is to generate the prompt segment for display in instant prompt. See - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. - # - # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function - # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k - # will replay these calls without actually calling instant_prompt_*. It is imperative that - # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this - # rule is not observed, the content of instant prompt will be incorrect. - # - # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If - # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. - function instant_prompt_example() { - # Since prompt_example always makes the same `p10k segment` calls, we can call it from - # instant_prompt_example. This will give us the same `example` prompt segment in the instant - # and regular prompts. - prompt_example - } - - # User-defined prompt segments can be customized the same way as built-in segments. - typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=3 - typeset -g POWERLEVEL9K_EXAMPLE_BACKGROUND=1 - # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt - # when accepting a command line. Supported values: - # - # - off: Don't change prompt when accepting a command line. - # - always: Trim down prompt when accepting a command line. - # - same-dir: Trim down prompt when accepting a command line unless this is the first command - # typed after changing current working directory. - typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off - - # Instant prompt mode. - # - # - off: Disable instant prompt. Choose this if you've tried instant prompt and found - # it incompatible with your zsh configuration files. - # - quiet: Enable instant prompt and don't print warnings when detecting console output - # during zsh initialization. Choose this if you've read and understood - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. - # - verbose: Enable instant prompt and print a warning when detecting console output during - # zsh initialization. Choose this if you've never tried instant prompt, haven't - # seen the warning, or if you are unsure what this all means. - typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose - - # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. - # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload - # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you - # really need it. - typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true - - # If p10k is already loaded, reload configuration. - # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. - (( ! $+functions[p10k] )) || p10k reload -} - -# Tell `p10k configure` which file it should overwrite. -typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} - -(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} -'builtin' 'unset' 'p10k_config_opts' diff --git a/extraFiles/config/zsh/zinputrc b/extraFiles/config/zsh/zinputrc deleted file mode 100644 index 928701a..0000000 --- a/extraFiles/config/zsh/zinputrc +++ /dev/null @@ -1,45 +0,0 @@ -# Stolen from ArchWiki - -# create a zkbd compatible hash; -# to add other keys to this hash, see: man 5 terminfo -typeset -A key - -key[Home]=${terminfo[khome]} - -key[End]=${terminfo[kend]} -key[Insert]=${terminfo[kich1]} -key[Delete]=${terminfo[kdch1]} -key[Up]=${terminfo[kcuu1]} -key[Down]=${terminfo[kcud1]} -key[Left]=${terminfo[kcub1]} -key[Right]=${terminfo[kcuf1]} -key[PageUp]=${terminfo[kpp]} -key[PageDown]=${terminfo[knp]} - -# setup key accordingly -[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line -[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line -[[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode -[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char -[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history -[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history -[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char -[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char -[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history -[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history - -# Finally, make sure the terminal is in application mode, when zle is -# active. Only then are the values from $terminfo valid. -if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then - function zle-line-init () { - printf '%s' "${terminfo[smkx]}" - } - function zle-line-finish () { - printf '%s' "${terminfo[rmkx]}" - } - zle -N zle-line-init - zle -N zle-line-finish -fi - - - diff --git a/extraFiles/config/zsh/zshcompletion.zsh b/extraFiles/config/zsh/zshcompletion.zsh deleted file mode 100644 index 2bbe7a0..0000000 --- a/extraFiles/config/zsh/zshcompletion.zsh +++ /dev/null @@ -1,190 +0,0 @@ -#Stolen from grml zsh config - - -function __zsh_compl () { - # TODO: This could use some additional information - - # Make sure the completion system is initialised - (( ${+_comps} )) || return 1 - - # allow one error for every three characters typed in approximate completer - zstyle ':completion:*:approximate:' max-errors 'reply=( $((($#PREFIX+$#SUFFIX)/3 )) numeric )' - - # don't complete backup files as executables - zstyle ':completion:*:complete:-command-::commands' ignored-patterns '(aptitude-*|*\~)' - - # start menu completion only if it could find no unambiguous initial string - zstyle ':completion:*:correct:*' insert-unambiguous true - zstyle ':completion:*:corrections' format $'%{\e[0;31m%}%d (errors: %e)%{\e[0m%}' - zstyle ':completion:*:correct:*' original true - - # activate color-completion - zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} - - # format on completion - zstyle ':completion:*:descriptions' format $'%{\e[0;31m%}completing %B%d%b%{\e[0m%}' - - # automatically complete 'cd -' and 'cd -' with menu - # zstyle ':completion:*:*:cd:*:directory-stack' menu yes select - - # insert all expansions for expand completer - zstyle ':completion:*:expand:*' tag-order all-expansions - zstyle ':completion:*:history-words' list false - - # activate menu - zstyle ':completion:*:history-words' menu yes - - # ignore duplicate entries - zstyle ':completion:*:history-words' remove-all-dups yes - zstyle ':completion:*:history-words' stop yes - - # match uppercase from lowercase - zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' - - # separate matches into groups - zstyle ':completion:*:matches' group 'yes' - zstyle ':completion:*' group-name '' - - if [[ "$NOMENU" -eq 0 ]] ; then - # if there are more than 5 options allow selecting from a menu - zstyle ':completion:*' menu select=5 - else - # don't use any menus at all - setopt no_auto_menu - fi - - zstyle ':completion:*:messages' format '%d' - zstyle ':completion:*:options' auto-description '%d' - - # describe options in full - zstyle ':completion:*:options' description 'yes' - - # on processes completion complete all user processes - zstyle ':completion:*:processes' command 'ps -au$USER' - - # offer indexes before parameters in subscripts - zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters - - # provide verbose completion information - zstyle ':completion:*' verbose true - - # recent (as of Dec 2007) zsh versions are able to provide descriptions - # for commands (read: 1st word in the line) that it will list for the user - # to choose from. The following disables that, because it's not exactly fast. - zstyle ':completion:*:-command-:*:' verbose false - - # set format for warnings - zstyle ':completion:*:warnings' format $'%{\e[0;31m%}No matches for:%{\e[0m%} %d' - - # define files to ignore for zcompile - zstyle ':completion:*:*:zcompile:*' ignored-patterns '(*~|*.zwc)' - zstyle ':completion:correct:' prompt 'correct to: %e' - - # Ignore completion functions for commands you don't have: - zstyle ':completion::(^approximate*):*:functions' ignored-patterns '_*' - - # Provide more processes in completion of programs like killall: - zstyle ':completion:*:processes-names' command 'ps c -u ${USER} -o command | uniq' - - # complete manual by their section - zstyle ':completion:*:manuals' separate-sections true - zstyle ':completion:*:manuals.*' insert-sections true - zstyle ':completion:*:man:*' menu yes select - - # Search path for sudo completion - zstyle ':completion:*:sudo:*' command-path /usr/local/sbin \ - /usr/local/bin \ - /usr/sbin \ - /usr/bin \ - /sbin \ - /bin \ - /usr/X11R6/bin \ - /run/current-system/sw/bin \ - /run/current-system/sw/sbin - - - - # provide .. as a completion - zstyle ':completion:*' special-dirs .. - - # run rehash on completion so new installed program are found automatically: - function _force_rehash () { - (( CURRENT == 1 )) && rehash - return 1 - } - - ## correction - # some people don't like the automatic correction - so run 'NOCOR=1 zsh' to deactivate it - if [[ "$NOCOR" -gt 0 ]] ; then - zstyle ':completion:*' completer _oldlist _expand _force_rehash _complete _files _ignored - setopt nocorrect - else - # try to be smart about when to use what completer... - setopt correct - zstyle -e ':completion:*' completer ' - if [[ $_last_try != "$HISTNO$BUFFER$CURSOR" ]] ; then - _last_try="$HISTNO$BUFFER$CURSOR" - reply=(_complete _match _ignored _prefix _files) - else - if [[ $words[1] == (rm|mv) ]] ; then - reply=(_complete _files) - else - reply=(_oldlist _expand _force_rehash _complete _ignored _correct _approximate _files) - fi - fi' - fi - - # command for process lists, the local web server details and host completion - zstyle ':completion:*:urls' local 'www' '/var/www/' 'public_html' - - # Some functions, like _apt and _dpkg, are very slow. We can use a cache in - # order to speed things up - if [[ ${__COMP_CACHING:-yes} == yes ]]; then - __COMP_CACHE_DIR=${__COMP_CACHE_DIR:-${ZDOTDIR:-$HOME}/.cache} - if [[ ! -d ${__COMP_CACHE_DIR} ]]; then - command mkdir -p "${__COMP_CACHE_DIR}" - fi - zstyle ':completion:*' use-cache yes - zstyle ':completion:*:complete:*' cache-path "${__COMP_CACHE_DIR}" - fi - - # host completion - _etc_hosts=() - _ssh_config_hosts=() - _ssh_hosts=() - if [[ -r ~/.ssh/config ]] ; then - _ssh_config_hosts=(${${(s: :)${(ps:\t:)${${(@M)${(f)"$(<$HOME/.ssh/config)"}:#Host *}#Host }}}:#*[*?]*}) - fi - - if [[ -r ~/.ssh/known_hosts ]] ; then - _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) - fi - - if [[ -r /etc/hosts ]] && [[ "$NOETCHOSTS" -eq 0 ]] ; then - : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(grep -v '^0\.0\.0\.0\|^127\.0\.0\.1\|^::1 ' /etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} - fi - - local localname - localname="$(uname -n)" - hosts=( - "${localname}" - "$_ssh_config_hosts[@]" - "$_ssh_hosts[@]" - "$_etc_hosts[@]" - localhost - ) - zstyle ':completion:*:hosts' hosts $hosts - # TODO: so, why is this here? - # zstyle '*' hosts $hosts - - # use generic completion system for programs not yet defined; (_gnu_generic works - # with commands that provide a --help option with "standard" gnu-like output.) - for compcom in cp deborphan df feh fetchipac gpasswd head hnb ipacsum mv \ - pal stow uname ; do - [[ -z ${_comps[$compcom]} ]] && compdef _gnu_generic ${compcom} - done; unset compcom - - # see upgrade function in this file - compdef _hosts upgrade -} -__zsh_compl \ No newline at end of file diff --git a/extraFiles/keys/ssh/materus.pub b/extraFiles/keys/ssh/materus.pub deleted file mode 100644 index d77bdd3..0000000 --- a/extraFiles/keys/ssh/materus.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPEDY+H8Hc/RSLE064AAh8IojvqxPd8BE5gec2aOfYMh materus@podkos.pl diff --git a/extraFiles/keys/ssh/waffentrager.pub b/extraFiles/keys/ssh/waffentrager.pub deleted file mode 100644 index 8b180df..0000000 --- a/extraFiles/keys/ssh/waffentrager.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFrSFfoYf7J35GrjrNWgD140kv/p7qzlSI8Xrp+A16jc root@nixos \ No newline at end of file diff --git a/extraFiles/scripts/convert_images.sh b/extraFiles/scripts/convert_images.sh deleted file mode 100755 index 4be8954..0000000 --- a/extraFiles/scripts/convert_images.sh +++ /dev/null @@ -1,50 +0,0 @@ -#/usr/bin/env bash -IFS=$'\n' -nix build nixpkgs\#imagemagick --no-link -CONVERT="$(nix eval nixpkgs\#imagemagick.outPath | tr -d '"')/bin/magick" -convert_cmd () { -if ! command -v magick &> /dev/null; then $CONVERT "$@"; else convert "$@"; fi -} - - -function max16 { - while [ `jobs | wc -l` -ge 16 ] - do - sleep 2 - done -} - -change_to_webp() { - f="$1" - file="${f%.*}" - file_webp="${file}.webp" - echo "Trying to convert to $file_webp" - if convert_cmd "$f" -define webp:thread-level=1 -define webp:method=6 -quality 99 "$file_webp"; then - if touch -r "$f" "$file_webp"; then - rm "$f" - echo "Finished converting $f" - else - echo "Failed to set old date to new file" - exit 1 - fi - else - echo "Failed to convert $f" - exit 1; - fi -} - -pushd $XDG_PICTURES_DIR -for f in `find "." \( -name "*.png" -type f -o -name "*.jpg" -type f -o -name "*.jpeg" -type f -o -name "*.avif" -type f \) \ - -a -not \( -path "./Inne/Special/*" -o -path "./Inne/Emojis/*" -o -path "./Inne/MCSkins/*" -o -path "./Avatar/*" -o -path "./Inne/GIF/*" \)`; -do - max16; change_to_webp "$f" & -done - - -for job in `jobs -p` -do -echo "Waiting for: $job" - wait $job || let "FAIL+=1" -done - -popd \ No newline at end of file diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 084ab9c..0000000 --- a/flake.lock +++ /dev/null @@ -1,894 +0,0 @@ -{ - "nodes": { - "base16": { - "inputs": { - "fromYaml": "fromYaml" - }, - "locked": { - "lastModified": 1721224776, - "narHash": "sha256-iakVQHg2DSmdOc5dNBwrDt9JLRxX5MT+IIbxfZEpGdo=", - "owner": "SenchoPens", - "repo": "base16.nix", - "rev": "c89c8123310257f3ddc04cc59aa4b5573c6d515f", - "type": "github" - }, - "original": { - "owner": "SenchoPens", - "ref": "main", - "repo": "base16.nix", - "type": "github" - } - }, - "base16_2": { - "inputs": { - "fromYaml": "fromYaml_2" - }, - "locked": { - "lastModified": 1721224776, - "narHash": "sha256-iakVQHg2DSmdOc5dNBwrDt9JLRxX5MT+IIbxfZEpGdo=", - "owner": "SenchoPens", - "repo": "base16.nix", - "rev": "c89c8123310257f3ddc04cc59aa4b5573c6d515f", - "type": "github" - }, - "original": { - "owner": "SenchoPens", - "ref": "main", - "repo": "base16.nix", - "type": "github" - } - }, - "configInputs": { - "inputs": { - "base16": "base16", - "devshell": "devshell", - "emacs-overlay": "emacs-overlay", - "flake-utils": "flake-utils", - "git-agecrypt": "git-agecrypt", - "home-manager": "home-manager", - "nix-vscode-extensions": "nix-vscode-extensions", - "nixerus": "nixerus", - "nixos-hardware": "nixos-hardware", - "nixpkgs": [ - "nixpkgs" - ], - "nur": "nur_2", - "plasma-manager": "plasma-manager", - "sops-nix": "sops-nix" - }, - "locked": { - "lastModified": 1730405317, - "narHash": "sha256-+0BfujrFEGC8xJD2rNwFslMjnrE89TXyDDUCVLCet5k=", - "owner": "materusPL", - "repo": "nixos-config", - "rev": "a7421ce7dd63f27c2118be2eaf41e38402f959a8", - "type": "github" - }, - "original": { - "owner": "materusPL", - "ref": "inputs", - "repo": "nixos-config", - "type": "github" - } - }, - "configInputs-stable": { - "inputs": { - "base16": "base16_2", - "devshell": "devshell_2", - "emacs-overlay": "emacs-overlay_2", - "flake-utils": "flake-utils_2", - "git-agecrypt": "git-agecrypt_2", - "home-manager": [ - "hm-stable" - ], - "nix-vscode-extensions": "nix-vscode-extensions_2", - "nixerus": "nixerus_2", - "nixos-hardware": "nixos-hardware_2", - "nixpkgs": [ - "nixpkgs-stable" - ], - "nur": "nur_4", - "plasma-manager": "plasma-manager_2", - "sops-nix": "sops-nix_2" - }, - "locked": { - "lastModified": 1730405317, - "narHash": "sha256-+0BfujrFEGC8xJD2rNwFslMjnrE89TXyDDUCVLCet5k=", - "owner": "materusPL", - "repo": "nixos-config", - "rev": "a7421ce7dd63f27c2118be2eaf41e38402f959a8", - "type": "github" - }, - "original": { - "owner": "materusPL", - "ref": "inputs", - "repo": "nixos-config", - "type": "github" - } - }, - "devshell": { - "inputs": { - "nixpkgs": [ - "configInputs", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1728330715, - "narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=", - "owner": "numtide", - "repo": "devshell", - "rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef", - "type": "github" - }, - "original": { - "owner": "numtide", - "ref": "main", - "repo": "devshell", - "type": "github" - } - }, - "devshell_2": { - "inputs": { - "nixpkgs": [ - "configInputs-stable", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1728330715, - "narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=", - "owner": "numtide", - "repo": "devshell", - "rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef", - "type": "github" - }, - "original": { - "owner": "numtide", - "ref": "main", - "repo": "devshell", - "type": "github" - } - }, - "emacs-overlay": { - "inputs": { - "nixpkgs": [ - "configInputs", - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1731517933, - "narHash": "sha256-j59F8M6LBre2Cc3QzxiYRlNe4wX/Jw1ziqPnbbmE3+Y=", - "owner": "nix-community", - "repo": "emacs-overlay", - "rev": "e074a4f54d88af0db5284d77e0b80bb1a8d2c80f", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "master", - "repo": "emacs-overlay", - "type": "github" - } - }, - "emacs-overlay_2": { - "inputs": { - "nixpkgs": [ - "configInputs-stable", - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable_3" - }, - "locked": { - "lastModified": 1731517933, - "narHash": "sha256-j59F8M6LBre2Cc3QzxiYRlNe4wX/Jw1ziqPnbbmE3+Y=", - "owner": "nix-community", - "repo": "emacs-overlay", - "rev": "e074a4f54d88af0db5284d77e0b80bb1a8d2c80f", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "master", - "repo": "emacs-overlay", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "ref": "main", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "ref": "main", - "repo": "flake-utils", - "type": "github" - } - }, - "fromYaml": { - "flake": false, - "locked": { - "lastModified": 1721222302, - "narHash": "sha256-5vL4w9+tS9yd8WpIiDUtxN1IuxCVK2nebZMs/hCXXis=", - "owner": "SenchoPens", - "repo": "fromYaml", - "rev": "93bad85d1633b8b27287b438c0bd394094c24d06", - "type": "github" - }, - "original": { - "owner": "SenchoPens", - "repo": "fromYaml", - "type": "github" - } - }, - "fromYaml_2": { - "flake": false, - "locked": { - "lastModified": 1721222302, - "narHash": "sha256-5vL4w9+tS9yd8WpIiDUtxN1IuxCVK2nebZMs/hCXXis=", - "owner": "SenchoPens", - "repo": "fromYaml", - "rev": "93bad85d1633b8b27287b438c0bd394094c24d06", - "type": "github" - }, - "original": { - "owner": "SenchoPens", - "repo": "fromYaml", - "type": "github" - } - }, - "git-agecrypt": { - "inputs": { - "flake-utils": [ - "configInputs", - "flake-utils" - ], - "nixpkgs": [ - "configInputs", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1710176518, - "narHash": "sha256-cmnBW/691mmLHq8tWpD3+zwCf7Wph5fcVdSxQGxqd1k=", - "owner": "vlaci", - "repo": "git-agecrypt", - "rev": "126be86c515466c5878a60561f754a9ab4af6ee8", - "type": "github" - }, - "original": { - "owner": "vlaci", - "ref": "main", - "repo": "git-agecrypt", - "type": "github" - } - }, - "git-agecrypt_2": { - "inputs": { - "flake-utils": [ - "configInputs-stable", - "flake-utils" - ], - "nixpkgs": [ - "configInputs-stable", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1710176518, - "narHash": "sha256-cmnBW/691mmLHq8tWpD3+zwCf7Wph5fcVdSxQGxqd1k=", - "owner": "vlaci", - "repo": "git-agecrypt", - "rev": "126be86c515466c5878a60561f754a9ab4af6ee8", - "type": "github" - }, - "original": { - "owner": "vlaci", - "ref": "main", - "repo": "git-agecrypt", - "type": "github" - } - }, - "hm-stable": { - "inputs": { - "nixpkgs": [ - "nixpkgs-stable" - ] - }, - "locked": { - "lastModified": 1726989464, - "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "release-24.05", - "repo": "home-manager", - "type": "github" - } - }, - "home-manager": { - "inputs": { - "nixpkgs": [ - "configInputs", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1731535640, - "narHash": "sha256-2EckCJn4wxran/TsRiCOFcmVpep2m9EBKl99NBh2GnM=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "35b055009afd0107b69c286fca34d2ad98940d57", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "master", - "repo": "home-manager", - "type": "github" - } - }, - "home-manager_2": { - "inputs": { - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1726989464, - "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", - "path": "/nix/store/q1ss75nhmjiydyqw8lbzwbx7cqk8z0qq-source", - "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176", - "type": "path" - }, - "original": { - "id": "home-manager", - "type": "indirect" - } - }, - "nix-vscode-extensions": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": [ - "configInputs", - "flake-utils" - ], - "nixpkgs": [ - "configInputs", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1731462465, - "narHash": "sha256-SL/d2lvJO+CDzQno7sOyUuktE7+o6kW1qpWsG8tBte4=", - "owner": "nix-community", - "repo": "nix-vscode-extensions", - "rev": "ac80fc4a7e7604c5699cbe61839af03bd55bf7bf", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "master", - "repo": "nix-vscode-extensions", - "type": "github" - } - }, - "nix-vscode-extensions_2": { - "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": [ - "configInputs-stable", - "flake-utils" - ], - "nixpkgs": [ - "configInputs-stable", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1731462465, - "narHash": "sha256-SL/d2lvJO+CDzQno7sOyUuktE7+o6kW1qpWsG8tBte4=", - "owner": "nix-community", - "repo": "nix-vscode-extensions", - "rev": "ac80fc4a7e7604c5699cbe61839af03bd55bf7bf", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "master", - "repo": "nix-vscode-extensions", - "type": "github" - } - }, - "nixerus": { - "inputs": { - "home-manager": [ - "configInputs", - "home-manager" - ], - "nixpkgs": [ - "configInputs", - "nixpkgs" - ], - "nur": "nur" - }, - "locked": { - "lastModified": 1729545139, - "narHash": "sha256-dyYxuBNdUOH5nvpbDAgwGJI4aN9CXv+m57VMuDYDGEg=", - "owner": "materusPL", - "repo": "Nixerus", - "rev": "c381bde8eab3998246dd7c31eb0047526a319224", - "type": "github" - }, - "original": { - "owner": "materusPL", - "ref": "master", - "repo": "Nixerus", - "type": "github" - } - }, - "nixerus_2": { - "inputs": { - "home-manager": [ - "configInputs-stable", - "home-manager" - ], - "nixpkgs": [ - "configInputs-stable", - "nixpkgs" - ], - "nur": "nur_3" - }, - "locked": { - "lastModified": 1729545139, - "narHash": "sha256-dyYxuBNdUOH5nvpbDAgwGJI4aN9CXv+m57VMuDYDGEg=", - "owner": "materusPL", - "repo": "Nixerus", - "rev": "c381bde8eab3998246dd7c31eb0047526a319224", - "type": "github" - }, - "original": { - "owner": "materusPL", - "ref": "master", - "repo": "Nixerus", - "type": "github" - } - }, - "nixos-hardware": { - "locked": { - "lastModified": 1731403644, - "narHash": "sha256-T9V7CTucjRZ4Qc6pUEV/kpgNGzQbHWfGcfK6JJLfUeI=", - "owner": "NixOS", - "repo": "nixos-hardware", - "rev": "f6581f1c3b137086e42a08a906bdada63045f991", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "master", - "repo": "nixos-hardware", - "type": "github" - } - }, - "nixos-hardware_2": { - "locked": { - "lastModified": 1731403644, - "narHash": "sha256-T9V7CTucjRZ4Qc6pUEV/kpgNGzQbHWfGcfK6JJLfUeI=", - "owner": "NixOS", - "repo": "nixos-hardware", - "rev": "f6581f1c3b137086e42a08a906bdada63045f991", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "master", - "repo": "nixos-hardware", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1716542732, - "narHash": "sha256-0Y9fRr0CUqWT4KgBITmaGwlnNIGMYuydu2L8iLTfHU4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "d12251ef6e8e6a46e05689eeccd595bdbd3c9e60", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1731239293, - "narHash": "sha256-q2yjIWFFcTzp5REWQUOU9L6kHdCDmFDpqeix86SOvDc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9256f7c71a195ebe7a218043d9f93390d49e6884", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable_2": { - "locked": { - "lastModified": 1730602179, - "narHash": "sha256-efgLzQAWSzJuCLiCaQUCDu4NudNlHdg2NzGLX5GYaEY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "3c2f1c4ca372622cb2f9de8016c9a0b1cbd0f37c", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable_3": { - "locked": { - "lastModified": 1731239293, - "narHash": "sha256-q2yjIWFFcTzp5REWQUOU9L6kHdCDmFDpqeix86SOvDc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9256f7c71a195ebe7a218043d9f93390d49e6884", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable_4": { - "locked": { - "lastModified": 1730602179, - "narHash": "sha256-efgLzQAWSzJuCLiCaQUCDu4NudNlHdg2NzGLX5GYaEY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "3c2f1c4ca372622cb2f9de8016c9a0b1cbd0f37c", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable_5": { - "locked": { - "lastModified": 1731239293, - "narHash": "sha256-q2yjIWFFcTzp5REWQUOU9L6kHdCDmFDpqeix86SOvDc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9256f7c71a195ebe7a218043d9f93390d49e6884", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1731676054, - "narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "5e4fbfb6b3de1aa2872b76d49fafc942626e2add", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nur": { - "locked": { - "lastModified": 1729516261, - "narHash": "sha256-uvW3pAtku4QrCjkThTFwJjLmS5evHPSH6XBGZFHGquA=", - "path": "/nix/store/yygrm3h9q9wslsdamcpahpzqzaag8rix-source", - "rev": "282dfd5c7da86c7315c231b95e95d71b36f22347", - "type": "path" - }, - "original": { - "id": "nur", - "type": "indirect" - } - }, - "nur_2": { - "locked": { - "lastModified": 1731530667, - "narHash": "sha256-/EBYF3f2kAPX3IOwxcjP/KTvXeX9b2cZyxgxGvp+XWI=", - "owner": "nix-community", - "repo": "NUR", - "rev": "481bba9ab4c2054b7cac86ee3be24f67e5256820", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "master", - "repo": "NUR", - "type": "github" - } - }, - "nur_3": { - "locked": { - "lastModified": 1729516261, - "narHash": "sha256-uvW3pAtku4QrCjkThTFwJjLmS5evHPSH6XBGZFHGquA=", - "path": "/nix/store/yygrm3h9q9wslsdamcpahpzqzaag8rix-source", - "rev": "282dfd5c7da86c7315c231b95e95d71b36f22347", - "type": "path" - }, - "original": { - "id": "nur", - "type": "indirect" - } - }, - "nur_4": { - "locked": { - "lastModified": 1731530667, - "narHash": "sha256-/EBYF3f2kAPX3IOwxcjP/KTvXeX9b2cZyxgxGvp+XWI=", - "owner": "nix-community", - "repo": "NUR", - "rev": "481bba9ab4c2054b7cac86ee3be24f67e5256820", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "master", - "repo": "NUR", - "type": "github" - } - }, - "nur_5": { - "locked": { - "lastModified": 1730720916, - "narHash": "sha256-sLuyisXE2KkcQ3gai2Y10e7vrddDCnR4n+op9n67AD0=", - "path": "/nix/store/n52f84spncfhpbgbx1gydvdqmwfkic3p-source", - "rev": "4a9ef04ed3048a17b50a11499e7f08d2ff00080c", - "type": "path" - }, - "original": { - "id": "nur", - "type": "indirect" - } - }, - "plasma-manager": { - "inputs": { - "home-manager": [ - "configInputs", - "home-manager" - ], - "nixpkgs": [ - "configInputs", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1731193165, - "narHash": "sha256-pGF8L5g9QpkQtJP9JmNIRNZfcyhJHf7uT+d8tqI1h6Y=", - "owner": "nix-community", - "repo": "plasma-manager", - "rev": "f33173b9d22e554a6f869626bc01808d35995257", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "trunk", - "repo": "plasma-manager", - "type": "github" - } - }, - "plasma-manager_2": { - "inputs": { - "home-manager": [ - "configInputs-stable", - "home-manager" - ], - "nixpkgs": [ - "configInputs-stable", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1731193165, - "narHash": "sha256-pGF8L5g9QpkQtJP9JmNIRNZfcyhJHf7uT+d8tqI1h6Y=", - "owner": "nix-community", - "repo": "plasma-manager", - "rev": "f33173b9d22e554a6f869626bc01808d35995257", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "trunk", - "repo": "plasma-manager", - "type": "github" - } - }, - "private": { - "locked": { - "lastModified": 1684365822, - "narHash": "sha256-qly3A3GgIYYwCSYIrmYRI7SJ6Q1I4Mo2zipJOrj50r0=", - "owner": "materusPL", - "repo": "Nixerus", - "rev": "f07f3e99a7cd8680dd6bb082108a67830857e542", - "type": "github" - }, - "original": { - "owner": "materusPL", - "ref": "mock", - "repo": "Nixerus", - "type": "github" - } - }, - "root": { - "inputs": { - "configInputs": "configInputs", - "configInputs-stable": "configInputs-stable", - "hm-stable": "hm-stable", - "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_2", - "nixpkgs-stable": "nixpkgs-stable_5", - "nur": "nur_5", - "private": "private" - } - }, - "sops-nix": { - "inputs": { - "nixpkgs": [ - "configInputs", - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable_2" - }, - "locked": { - "lastModified": 1731364708, - "narHash": "sha256-HC0anOL+KmUQ2hdRl0AtunbAckasxrkn4VLmxbW/WaA=", - "owner": "Mic92", - "repo": "sops-nix", - "rev": "4c91d52db103e757fc25b58998b0576ae702d659", - "type": "github" - }, - "original": { - "owner": "Mic92", - "ref": "master", - "repo": "sops-nix", - "type": "github" - } - }, - "sops-nix_2": { - "inputs": { - "nixpkgs": [ - "configInputs-stable", - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable_4" - }, - "locked": { - "lastModified": 1731364708, - "narHash": "sha256-HC0anOL+KmUQ2hdRl0AtunbAckasxrkn4VLmxbW/WaA=", - "owner": "Mic92", - "repo": "sops-nix", - "rev": "4c91d52db103e757fc25b58998b0576ae702d659", - "type": "github" - }, - "original": { - "owner": "Mic92", - "ref": "master", - "repo": "sops-nix", - "type": "github" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix index e1a8f20..70f2ddb 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,6 @@ +# [[file:org-conf/nix-flake.org::*Main Flake][Main Flake:1]] { - description = "Materus hosts and user config"; + description = "Lemon flake: NixOS and home manager configs"; inputs = { private = { type = "github"; @@ -29,14 +30,14 @@ type = "github"; owner = "NixOS"; repo = "nixpkgs"; - ref = "nixos-24.05"; + ref = "nixos-24.11"; }; hm-stable = { type = "github"; owner = "nix-community"; repo = "home-manager"; - ref = "release-24.05"; + ref = "release-24.11"; inputs.nixpkgs.follows = "nixpkgs-stable"; }; @@ -51,13 +52,13 @@ }; }; }; + outputs = + let + rootPath = builtins.toString ./.; + in + inputs@{ self, ... }: + { - - outputs = inputs @ { self, nixpkgs, home-manager, nur, ... }: - rec { - nixosConfigurations = import ./configurations/host { inherit inputs; materusFlake = self; }; - homeConfigurations = import ./configurations/shared/home { inherit inputs; materusFlake = self; }; - selfPath = self; - decrypted = builtins.pathExists (selfPath + "/decrypted"); }; } +# Main Flake:1 ends here diff --git a/nix/subflake/flake.nix b/nix/subflake/flake.nix new file mode 100644 index 0000000..59a2958 --- /dev/null +++ b/nix/subflake/flake.nix @@ -0,0 +1,129 @@ +# [[file:../../org-conf/nix-flake.org::*Subflake][Subflake:1]] +{ + description = "Subflake of Lemon repository, contains dependencies"; + inputs = { + nixpkgs = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + ref = "nixos-unstable"; + }; + + flake-utils = { + type = "github"; + owner = "numtide"; + repo = "flake-utils"; + ref = "main"; + }; + + base16 = { + type = "github"; + owner = "SenchoPens"; + repo = "base16.nix"; + ref = "main"; + }; + + devshell = { + type = "github"; + owner = "numtide"; + repo = "devshell"; + ref = "main"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; + + home-manager = { + type = "github"; + owner = "nix-community"; + repo = "home-manager"; + ref = "master"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; + + emacs-overlay = { + type = "github"; + owner = "nix-community"; + repo = "emacs-overlay"; + ref = "master"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; + }; + + nixos-hardware = { + type = "github"; + owner = "NixOS"; + repo = "nixos-hardware"; + ref = "master"; + }; + + nixerus = { + type = "github"; + owner = "materusPL"; + repo = "Nixerus"; + ref = "master"; + inputs = { + nixpkgs.follows = "nixpkgs"; + home-manager.follows = "home-manager"; + }; + }; + + nix-vscode-extensions = { + type = "github"; + owner = "nix-community"; + repo = "nix-vscode-extensions"; + ref = "master"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; + }; + + sops-nix = { + type = "github"; + owner = "Mic92"; + repo = "sops-nix"; + ref = "master"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; + + git-agecrypt = { + type = "github"; + owner = "vlaci"; + repo = "git-agecrypt"; + ref = "main"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; + }; + + plasma-manager = { + type = "github"; + owner = "nix-community"; + repo = "plasma-manager"; + ref = "trunk"; + inputs = { + nixpkgs.follows = "nixpkgs"; + home-manager.follows = "home-manager"; + }; + }; + + nur = { + type = "github"; + owner = "nix-community"; + repo = "NUR"; + ref = "master"; + }; + + }; + + outputs = inputs: inputs; +} +# Subflake:1 ends here diff --git a/extraFiles/config/emacs/emacs-materus-config.org b/org-conf/emacs-config.org similarity index 99% rename from extraFiles/config/emacs/emacs-materus-config.org rename to org-conf/emacs-config.org index 7dc3fc3..efd7b3a 100644 --- a/extraFiles/config/emacs/emacs-materus-config.org +++ b/org-conf/emacs-config.org @@ -1,13 +1,15 @@ +:PROPERTIES: +:EMACS-DIR: ../dotfiles/emacs/ +:END: #+TITLE: Materus Emacs Cfg #+AUTHOR: materus #+DESCRIPTION: materus emacs configuration #+STARTUP: overview -#+PROPERTY: EMACS-DIR: ./ #+PROPERTY: header-args :tangle (concat (org-entry-get nil "EMACS-DIR" t) "etc/materus/emacs-config.el") :comments link #+OPTIONS: \n:t #+auto_tangle: t -My emacs config, tangled file is [[file:etc/materus/emacs-config.el][there]] +My emacs config, tangled file is [[../dotfiles/emacs/etc/materus/emacs-config.el][there]] * Table of Contents :noexport:TOC_3: - [[#init-files][Init Files]] diff --git a/org-conf/nix-flake.org b/org-conf/nix-flake.org new file mode 100644 index 0000000..de7bce6 --- /dev/null +++ b/org-conf/nix-flake.org @@ -0,0 +1,210 @@ +:PROPERTIES: +:NIX-DIR: ../nix/ +:END: +#+TITLE: Nix Flakes Config +#+AUTHOR: materus +#+DESCRIPTION: Nix flake declarations and some configuration maker functions. +#+STARTUP: overview +#+PROPERTY: header-args :tangle (concat (org-entry-get nil "NIX-DIR" t) "default.nix") :comments link +#+OPTIONS: \n:t +#+auto_tangle: t + + +* Flakes +** Main Flake +Flake of entire repo. [[../flake.nix][link]] +#+begin_src nix header-args :tangle (concat (org-entry-get nil "NIX-DIR" t) "../flake.nix") :comments link + { + description = "Lemon flake: NixOS and home manager configs"; + inputs = { + private = { + type = "github"; + owner = "materusPL"; + repo = "Nixerus"; + ref = "mock"; + }; + + nixpkgs = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + ref = "nixos-unstable"; + }; + + configInputs = { + type = "github"; + owner = "materusPL"; + repo = "nixos-config"; + ref = "inputs"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; + + nixpkgs-stable = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + ref = "nixos-24.11"; + }; + + hm-stable = { + type = "github"; + owner = "nix-community"; + repo = "home-manager"; + ref = "release-24.11"; + inputs.nixpkgs.follows = "nixpkgs-stable"; + }; + + configInputs-stable = { + type = "github"; + owner = "materusPL"; + repo = "nixos-config"; + ref = "inputs"; + inputs = { + nixpkgs.follows = "nixpkgs-stable"; + home-manager.follows = "hm-stable"; + }; + }; + }; + outputs = + let + rootPath = builtins.toString ./.; + in + inputs@{ self, ... }: + { + + }; + } +#+end_src +** Subflake +Subflake with dependencies, use so there's no need for duplication for stable and unstable. [[../nix/subflake/flake.nix][link]] +#+begin_src nix header-args :tangle (concat (org-entry-get nil "NIX-DIR" t) "/subflake/flake.nix") :comments link + { + description = "Subflake of Lemon repository, contains dependencies"; + inputs = { + nixpkgs = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + ref = "nixos-unstable"; + }; + + flake-utils = { + type = "github"; + owner = "numtide"; + repo = "flake-utils"; + ref = "main"; + }; + + base16 = { + type = "github"; + owner = "SenchoPens"; + repo = "base16.nix"; + ref = "main"; + }; + + devshell = { + type = "github"; + owner = "numtide"; + repo = "devshell"; + ref = "main"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; + + home-manager = { + type = "github"; + owner = "nix-community"; + repo = "home-manager"; + ref = "master"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; + + emacs-overlay = { + type = "github"; + owner = "nix-community"; + repo = "emacs-overlay"; + ref = "master"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; + }; + + nixos-hardware = { + type = "github"; + owner = "NixOS"; + repo = "nixos-hardware"; + ref = "master"; + }; + + nixerus = { + type = "github"; + owner = "materusPL"; + repo = "Nixerus"; + ref = "master"; + inputs = { + nixpkgs.follows = "nixpkgs"; + home-manager.follows = "home-manager"; + }; + }; + + nix-vscode-extensions = { + type = "github"; + owner = "nix-community"; + repo = "nix-vscode-extensions"; + ref = "master"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; + }; + + sops-nix = { + type = "github"; + owner = "Mic92"; + repo = "sops-nix"; + ref = "master"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; + + git-agecrypt = { + type = "github"; + owner = "vlaci"; + repo = "git-agecrypt"; + ref = "main"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; + }; + + plasma-manager = { + type = "github"; + owner = "nix-community"; + repo = "plasma-manager"; + ref = "trunk"; + inputs = { + nixpkgs.follows = "nixpkgs"; + home-manager.follows = "home-manager"; + }; + }; + + nur = { + type = "github"; + owner = "nix-community"; + repo = "NUR"; + ref = "master"; + }; + + }; + + outputs = inputs: inputs; + } +#+end_src