dotfiles

My PC Dotfiles & Website
commit f6a45303b5f6a16a1f71d33a57dcfbae972b3563
parent 23aa4672aaaa4293bfc2272fdd1eed284ebb5c5e
Author: maydayv7 <maydayv7@gmail.com>
Date:   Fri, 25 Mar 2022 19:23:57 +0530

feat!: Add NixOS Configuration

Features:
+ `home-manager`, `sops-nix`
+ Pure, Flakes-compatible
+ Developer Shells
+ Library Functions
+ Multiple Devices
+ Program Configuration and `dotfiles`
+ Useful Scripts
...and many more!

Diffstat:

A.editorconfig | 9+++++++++
A.gitattributes | 2++
A.gitignore | 7+++++++
A.prettierignore | 9+++++++++
A.prettierrc | 1+
A.templates/README.md | 3+++
A.templates/minimal/.gitignore | 1+
A.templates/minimal/flake.nix | 47+++++++++++++++++++++++++++++++++++++++++++++++
A.version | 2++
AREADME.md | 544+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aconfiguration.nix | 137+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adefault.nix | 2++
Adevices/.git-keep | 0
Adevices/Futura.nix | 28++++++++++++++++++++++++++++
Adevices/README.md | 18++++++++++++++++++
Adevices/Vortex.nix | 36++++++++++++++++++++++++++++++++++++
Adevices/vm/README.md | 7+++++++
Adevices/vm/Windows.nix | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/README.md | 25+++++++++++++++++++++++++
Afiles/archive/.git-keep | 0
Afiles/archive/Linux/Arch/COMMANDS.md | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/archive/Linux/Arch/INSTALL.md | 174+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/archive/Linux/Arch/zshrc | 31+++++++++++++++++++++++++++++++
Afiles/archive/Linux/Pop/conky/conky.lua | 553+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/archive/Linux/Pop/conky/conkyrc | 80+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/archive/Linux/Pop/neofetch/config.conf | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/archive/Linux/Pop/p10k.zsh | 472+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/archive/Windows/APPS.md | 26++++++++++++++++++++++++++
Afiles/archive/Windows/Velociraptor.rmskin | 0
Afiles/ascii/groot | 10++++++++++
Afiles/ascii/lol | 7+++++++
Afiles/ascii/pacman | 12++++++++++++
Afiles/ascii/tux | 19+++++++++++++++++++
Afiles/default.nix | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/discord/plugins/CreationDate.plugin.js | 310+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/discord/plugins/ShowHiddenChannels.plugin.js | 987+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/discord/plugins/TypingUsersAvatars.plugin.js | 183+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/discord/theme.css | 1+
Afiles/firefox/userContent.css | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/fonts/fontconfig.xml | 42++++++++++++++++++++++++++++++++++++++++++
Afiles/fonts/proprietary/ms-core/arial.ttf | 0
Afiles/fonts/proprietary/ms-core/calibri.ttf | 0
Afiles/fonts/proprietary/ms-core/cour.ttf | 0
Afiles/fonts/proprietary/ms-core/symbol.ttf | 0
Afiles/fonts/proprietary/ms-core/times.ttf | 0
Afiles/fonts/proprietary/ms-core/wingding.ttf | 0
Afiles/fonts/proprietary/oneplus-slate/OnePlusSlate-Black.ttf | 0
Afiles/fonts/proprietary/oneplus-slate/OnePlusSlate-Bold.ttf | 0
Afiles/fonts/proprietary/oneplus-slate/OnePlusSlate-Book.ttf | 0
Afiles/fonts/proprietary/oneplus-slate/OnePlusSlate-Light.ttf | 0
Afiles/fonts/proprietary/oneplus-slate/OnePlusSlate-Medium.ttf | 0
Afiles/fonts/proprietary/oneplus-slate/OnePlusSlate-Regular.ttf | 0
Afiles/fonts/proprietary/oneplus-slate/OnePlusSlate-Thin.ttf | 0
Afiles/fonts/proprietary/product-sans/ProductSans-Black.ttf | 0
Afiles/fonts/proprietary/product-sans/ProductSans-BlackItalic.ttf | 0
Afiles/fonts/proprietary/product-sans/ProductSans-Bold.ttf | 0
Afiles/fonts/proprietary/product-sans/ProductSans-BoldItalic.ttf | 0
Afiles/fonts/proprietary/product-sans/ProductSans-Italic.ttf | 0
Afiles/fonts/proprietary/product-sans/ProductSans-Light.ttf | 0
Afiles/fonts/proprietary/product-sans/ProductSans-LightItalic.ttf | 0
Afiles/fonts/proprietary/product-sans/ProductSans-Medium.ttf | 0
Afiles/fonts/proprietary/product-sans/ProductSans-MediumItalic.ttf | 0
Afiles/fonts/proprietary/product-sans/ProductSans-Regular.ttf | 0
Afiles/fonts/proprietary/product-sans/ProductSans-Thin.ttf | 0
Afiles/fonts/proprietary/product-sans/ProductSans-ThinItalic.ttf | 0
Afiles/git/hooks/commit-msg | 15+++++++++++++++
Afiles/git/hooks/pre-commit | 9+++++++++
Afiles/gnome/accounts.conf | 11+++++++++++
Afiles/gnome/dconf.nix | 765+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/gnome/gnome-shell.css | 3+++
Afiles/gnome/nix.lang | 245+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/gnome/tango-dark.xml | 144+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/gtk/bookmarks | 2++
Afiles/images/Profile.png | 0
Afiles/images/desktop.png | 0
Afiles/images/logo.png | 0
Afiles/images/wallpapers/Beauty.jpg | 0
Afiles/images/wallpapers/City.jpg | 0
Afiles/images/wallpapers/Firewatch.jpg | 0
Afiles/images/wallpapers/Future.jpg | 0
Afiles/images/wallpapers/Island.jpg | 0
Afiles/images/wallpapers/Metro.jpg | 0
Afiles/images/wallpapers/Neon.jpg | 0
Afiles/images/wallpapers/Saturn.jpg | 0
Afiles/images/wallpapers/Shards.jpg | 0
Afiles/images/wallpapers/Sunrise.jpg | 0
Afiles/images/wallpapers/Sunset.jpg | 0
Afiles/images/wallpapers/Tomorrow.jpg | 0
Afiles/nano/nanorc | 8++++++++
Afiles/neofetch/config.conf | 603+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/plank/dock.desktop | 12++++++++++++
Afiles/plank/dock.theme | 34++++++++++++++++++++++++++++++++++
Afiles/plank/launchers/firefox.dockitem | 2++
Afiles/plank/launchers/org.xfce.mousepad.dockitem | 2++
Afiles/plank/launchers/thunar.dockitem | 2++
Afiles/plank/launchers/xfce-settings-manager.dockitem | 2++
Afiles/plank/launchers/xfce4-terminal.dockitem | 2++
Afiles/templates/Document.docx | 0
Afiles/templates/File | 0
Afiles/templates/Presentation.pptx | 0
Afiles/templates/Spreadsheet.xlsx | 0
Afiles/touchegg/touchegg.conf | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/vscode/keybindings.json | 14++++++++++++++
Afiles/vscode/settings.json | 42++++++++++++++++++++++++++++++++++++++++++
Afiles/wine/theme.msstyles | 0
Afiles/xdg/mime.nix | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/xfce/gtk.css | 6++++++
Afiles/xfce/panel.txt | 103+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/xfce/settings/displays.xml | 43+++++++++++++++++++++++++++++++++++++++++++
Afiles/xfce/settings/keyboards.xml | 8++++++++
Afiles/xfce/settings/parole.xml | 15+++++++++++++++
Afiles/xfce/settings/pointers.xml | 13+++++++++++++
Afiles/xfce/settings/thunar-volman.xml | 13+++++++++++++
Afiles/xfce/settings/thunar.xml | 19+++++++++++++++++++
Afiles/xfce/settings/xfce4-appfinder.xml | 46++++++++++++++++++++++++++++++++++++++++++++++
Afiles/xfce/settings/xfce4-desktop.xml | 41+++++++++++++++++++++++++++++++++++++++++
Afiles/xfce/settings/xfce4-keyboard-shortcuts.xml | 192+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/xfce/settings/xfce4-notifyd.xml | 19+++++++++++++++++++
Afiles/xfce/settings/xfce4-panel.xml | 175+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/xfce/settings/xfce4-power-manager.xml | 30++++++++++++++++++++++++++++++
Afiles/xfce/settings/xfce4-session.xml | 32++++++++++++++++++++++++++++++++
Afiles/xfce/settings/xfce4-settings-editor.xml | 9+++++++++
Afiles/xfce/settings/xfce4-settings-manager.xml | 9+++++++++
Afiles/xfce/settings/xfwm4.xml | 91+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afiles/xfce/settings/xsettings.xml | 47+++++++++++++++++++++++++++++++++++++++++++++++
Afiles/xfce/terminalrc | 38++++++++++++++++++++++++++++++++++++++
Afiles/xorg/Xresources | 6++++++
Afiles/zsh/p10k.zsh | 972+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aflake.lock | 380+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aflake.nix | 162+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alib/README.md | 35+++++++++++++++++++++++++++++++++++
Alib/build.nix | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alib/compat/build.nix | 1+
Alib/compat/flake.nix | 15+++++++++++++++
Alib/compat/nixos/default.nix | 3+++
Alib/compat/shell.nix | 1+
Alib/default.nix | 11+++++++++++
Alib/map.nix | 106+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alib/pack.nix | 23+++++++++++++++++++++++
Alib/types.nix | 10++++++++++
Amodules/README.md | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/apps/default.nix | 10++++++++++
Amodules/apps/discord.nix | 31+++++++++++++++++++++++++++++++
Amodules/apps/firefox.nix | 97+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/apps/git/default.nix | 153+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/apps/git/hosting.nix | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/apps/git/runner.nix | 47+++++++++++++++++++++++++++++++++++++++++++++++
Amodules/apps/git/secrets/.git-keep | 0
Amodules/apps/git/secrets/cloudflare.secret | 22++++++++++++++++++++++
Amodules/apps/git/secrets/github-runner.secret | 22++++++++++++++++++++++
Amodules/apps/git/secrets/github-token.secret | 22++++++++++++++++++++++
Amodules/apps/git/secrets/gitlab-runner.secret | 22++++++++++++++++++++++
Amodules/apps/git/secrets/gitlab-token.secret | 22++++++++++++++++++++++
Amodules/apps/git/user.nix | 28++++++++++++++++++++++++++++
Amodules/apps/office.nix | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/apps/vscode.nix | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/apps/wine.nix | 48++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/base/console.nix | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/base/default.nix | 21+++++++++++++++++++++
Amodules/base/firmware.nix | 128+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/default.nix | 162+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/gui/default.nix | 23+++++++++++++++++++++++
Amodules/gui/fonts.nix | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/gui/gnome.nix | 272+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/gui/xfce.nix | 146+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/gui/xorg.nix | 15+++++++++++++++
Amodules/hardware/boot.nix | 45+++++++++++++++++++++++++++++++++++++++++++++
Amodules/hardware/default.nix | 24++++++++++++++++++++++++
Amodules/hardware/filesystem.nix | 190+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/hardware/mobile.nix | 21+++++++++++++++++++++
Amodules/hardware/printer.nix | 21+++++++++++++++++++++
Amodules/hardware/security.nix | 98+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/hardware/virtualisation.nix | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/nix/checks.nix | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/nix/config.nix | 5+++++
Amodules/nix/default.nix | 48++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/nix/deploy.nix | 18++++++++++++++++++
Amodules/nix/index.nix | 39+++++++++++++++++++++++++++++++++++++++
Amodules/secrets.nix | 1+
Amodules/shell/bash.nix | 75+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/shell/default.nix | 104+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/shell/zsh.nix | 108+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/user/default.nix | 154+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/user/home.nix | 25+++++++++++++++++++++++++
Amodules/user/passwords/.git-keep | 0
Amodules/user/passwords/default | 2++
Amodules/user/passwords/navya.secret | 27+++++++++++++++++++++++++++
Amodules/user/passwords/root.secret | 27+++++++++++++++++++++++++++
Amodules/user/passwords/v7.secret | 27+++++++++++++++++++++++++++
Amodules/user/security.nix | 67+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apackages/README.md | 15+++++++++++++++
Apackages/dotfiles.nix | 22++++++++++++++++++++++
Apackages/firefox-gnome-theme/default.nix | 28++++++++++++++++++++++++++++
Apackages/firefox-gnome-theme/metadata.nix | 6++++++
Apackages/fly-pie.nix | 36++++++++++++++++++++++++++++++++++++
Apackages/fonts.nix | 20++++++++++++++++++++
Apackages/overlays/.git-keep | 0
Apackages/overlays/discord.nix | 11+++++++++++
Apackages/overlays/gnome-terminal.nix | 21+++++++++++++++++++++
Apackages/overlays/google-chrome.nix | 13+++++++++++++
Apackages/overlays/nixFlakes.nix | 25+++++++++++++++++++++++++
Apackages/patches/.git-keep | 0
Apackages/top-bar-organizer.nix | 40++++++++++++++++++++++++++++++++++++++++
Apackages/update.sh | 2++
Apackages/wine/.git-keep | 0
Apackages/wine/7zip.nix | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Arepl.nix | 37+++++++++++++++++++++++++++++++++++++
Ascripts/README.md | 30++++++++++++++++++++++++++++++
Ascripts/colors.sh | 9+++++++++
Ascripts/commands.sh | 73+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ascripts/mail.sh | 28++++++++++++++++++++++++++++
Ascripts/nixos.nix | 500+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ascripts/packages.sh | 128+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ascripts/partitions.sh | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ascripts/pci.sh | 13+++++++++++++
Asecrets/.sops.yaml | 17+++++++++++++++++
Asecrets/README.md | 3+++
Asecrets/cachix-token.secret | 22++++++++++++++++++++++
Asecrets/default.nix | 29+++++++++++++++++++++++++++++
Asecrets/keys/.gitattributes | 2++
Asecrets/keys/navya.gpg | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Asecrets/keys/v7.gpg | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Ashells/.envrc | 1+
Ashells/cc.nix | 6++++++
Ashells/default.nix | 10++++++++++
Ashells/format.nix | 11+++++++++++
Ashells/go.nix | 5+++++
Ashells/java.nix | 17+++++++++++++++++
Ashells/lisp.nix | 5+++++
Ashells/lua.nix | 5+++++
Ashells/python.nix | 24++++++++++++++++++++++++
Ashells/rust.nix | 13+++++++++++++
Ashells/video.nix | 13+++++++++++++
Ausers/README.md | 3+++
Ausers/default.nix | 87+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ausers/navya.nix | 11+++++++++++
Ausers/v7.nix | 30++++++++++++++++++++++++++++++
237 files changed, 13549 insertions(+), 0 deletions(-)

diff --git a/.editorconfig b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = false +tab_size = 2 +trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes @@ -0,0 +1 @@ +*.secret binary +\ No newline at end of file diff --git a/.gitignore b/.gitignore @@ -0,0 +1,7 @@ +*~* +*.bak +builds +.direnv +result +*.wiki +.pre-commit-config.yaml diff --git a/.prettierignore b/.prettierignore @@ -0,0 +1,9 @@ +result +files/discord/plugins + +# Formatting Errors +site/templates/macros/edit.html +site/templates/macros/javascript.html +site/templates/macros/posts.html +site/templates/macros/menu.html +site/templates/tags/list.html diff --git a/.prettierrc b/.prettierrc @@ -0,0 +1 @@ +bracketSameLine: true diff --git a/.templates/README.md b/.templates/README.md @@ -0,0 +1,3 @@ +### Configuration Templates + +You can use `nix flake init -t github:maydayv7/dotfiles` for a basic Flakes-compatible system configuration diff --git a/.templates/minimal/.gitignore b/.templates/minimal/.gitignore @@ -0,0 +1 @@ +flake.lock diff --git a/.templates/minimal/flake.nix b/.templates/minimal/flake.nix @@ -0,0 +1,47 @@ +{ + description = "Simple, Minimal NixOS Configuration"; + + ## System Repositories ## + inputs = { + ## Package Repositories ## + # NixOS Stable Release + nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-21.11"; + + ## Configuration Modules ## + # My PC Dotfiles + dotfiles.url = "github:maydayv7/dotfiles"; + }; + + ## System Configuration ## + outputs = inputs: let + lib = with inputs; nixpkgs.lib // dotfiles.lib; + in { + nixosConfigurations.host = lib.build.device { + name = "HOST_NAME"; + system = "x86_64-linux"; + channel = "stable"; + + # Generate these files using 'nixos-generate-config' + imports = [./configuration.nix ./hardware-configuration.nix]; + + timezone = "Asia/Kolkata"; + locale = "en_IN.UTF-8"; + + kernel = "linux_zen"; + kernelModules = ["xhci_pci" "ahci" "usb_storage" "sd_mod"]; + + hardware = { + boot = "efi"; + cores = 4; + filesystem = "simple"; + }; + + # Default User + user = { + name = "nixos"; + description = "Default User"; + password = "HASHED_PASSWORD"; # Generate using 'mkpasswd -m sha-512' + }; + }; + }; +} diff --git a/.version b/.version @@ -0,0 +1 @@ +21.11 +\ No newline at end of file diff --git a/README.md b/README.md @@ -0,0 +1,544 @@ +![Logo](./files/images/logo.png) + +![Version](https://img.shields.io/github/v/release/maydayv7/dotfiles?include_prereleases&label=version&style=flat-square&logo=github) ![License](https://img.shields.io/github/license/maydayv7/dotfiles?color=dgreen&style=flat-square) ![Size](https://img.shields.io/github/repo-size/maydayv7/dotfiles?color=red&label=size&style=flat-square) [![NixOS](https://img.shields.io/badge/NixOS-v21.11-9cf.svg?style=flat-square&logo=NixOS&logoColor=white)](https://nixos.org) + +This [repository](https://github.com/maydayv7/dotfiles) contains the configuration and `dotfiles` for my continuously evolving multi-PC setup (using [Nix](https://nixos.org/)). All the devices I own, controlled by code + +[![Desktop](./files/images/desktop.png)](https://www.reddit.com/r/unixporn/comments/ssb7mf/gnome_my_dream/) + +## Features + +[![Built with Nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org) + +- Self-Contained +- Device-Agnostic +- Convenient and Automated +- Hermetically Reproducible +- Declarative and Derivational +- Atomic, Generational and Immutable +- Configures Multiple Users and Devices + +#### Notable Features + +- Multiple Shell Configurations +- Support for Multiple Desktop Environments +- Cutting Edge Software - PipeWire, Wayland, ...and many more! +- Interactive [`repl`](./repl.nix) to explore Syntax and Configuration +- Authentication Credentials Management using the [`sops`](https://github.com/Mic92/sops-nix) Module and [`gnupg`](https://gnupg.org/) Keys +- Comprehensive User Configuration using the tightly integrated [`home-manager`](https://github.com/nix-community/home-manager) Module, with [Support](./modules/user/default.nix) for Configuring Shared User Configuration, Global Conditionals and User-Specific Configuration +- Support for Multiple Programming Language Development [`shells`](./shells) integrated with [`direnv`](https://direnv.net/) and [`lorri`](https://github.com/nix-community/lorri) +- Ephemeral, Opt-In File System State using the [`impermanence`](https://github.com/nix-community/impermanence) Module and [ZFS](https://zfsonlinux.org/) +- Auto-Magic using [`flake-utils-plus`](https://github.com/gytis-ivaskevicius/flake-utils-plus) Helper Functions +- Automatic `packages` Updates using [`update.sh`](./packages/update.sh) +- Install Media and Device Images using [`nixos-generators`](https://github.com/nix-community/nixos-generators) Image Generation Modules +- Automatic [Deployment](./modules/nix/deploy.nix) using the [`deploy-rs`](https://github.com/serokell/deploy-rs) Tool +- Advanced Configuration [Checks](./modules/nix/checks.nix) using [`pre-commit-hooks.nix`](https://github.com/cachix/pre-commit-hooks.nix) +- Support for `source` Filters with [`nix-filter`](https://github.com/numtide/nix-filter) and [`gitignore.nix`](https://github.com/hercules-ci/gitignore.nix) +- Wrapped `wine` [Applications](./packages/wine) using Emmanuel's [Wrapper](https://github.com/emmanuelrosa/erosanix/tree/0dabea58d483e13d2de141517cb4ff1cb230b2aa/pkgs/mkwindowsapp) +- Declaratively Configured [Windows VM](./modules/hardware/virtualisation/windows.nix) using the [WFVM](https://git.m-labs.hk/M-Labs/wfvm) Module + +## Programs + +| Type | Programs | +| :------------------- | :----------------------------------------------------------------------------------------------------------------------------: | +| Editors | [gEdit](https://wiki.gnome.org/Apps/Gedit), [`nano`](https://www.nano-editor.org/), [VS Code](https://code.visualstudio.com/) | +| Shells | [`bash`](https://www.gnu.org/software/bash/), [`zsh`](https://www.zsh.org) | +| Terminal | [GNOME Terminal](https://gitlab.gnome.org/GNOME/gnome-terminal), [`xfce4` Terminal](https://docs.xfce.org/apps/terminal/start) | +| Browser | [Firefox](https://www.mozilla.org/en-US/firefox/) | +| Desktop Environments | [GNOME](https://www.gnome.org), [XFCE](https://xfce.org/) | + +## Structure + +**_Overview of File Hierarchy_** + +<details> +<summary><b>Outputs</b></summary> + +```shellsession +$ nix flake show +github:maydayv7/dotfiles +├───apps +│ └───x86_64-linux +│ └───nixos: app +├───channels: package repositories +├───checks +│ └───x86_64-linux +│ ├───Device-gnome: derivation 'nixos-rebuild' +│ ├───Device-xfce: derivation 'nixos-rebuild' +│ ├───activate: derivation 'deploy-rs-check-activate' +│ ├───commit: derivation 'pre-commit-run' +│ └───schema: derivation 'jsonschema-deploy-system' +├───defaultApp +│ └───x86_64-linux: app +├───defaultPackage +│ └───x86_64-linux: package 'Dotfiles-v7.0' +├───defaultTemplate: template: Simple, Minimal NixOS Configuration +├───deploy: automatc deployments +├───devShell +│ └───x86_64-linux: development environment 'devShell' +├───devShells +│ └───x86_64-linux +│ ├───cc: development environment 'C' +│ ├───commit: development environment 'nix-shell' +│ ├───go: development environment 'Go' +│ ├───java: development environment 'Java' +│ ├───lisp: development environment 'Lisp' +│ ├───lua: development environment 'Lua' +│ ├───python: development environment 'Python' +│ ├───rust: development environment 'Rust' +│ └───video: development environment 'Video' +├───files: 'dotfiles' and program configuration +├───installMedia: device install media +├───legacyPackages +│ └───x86_64-linux: omitted (use '--legacy' to show) +├───lib: utility library functions +├───nixosConfigurations +│ ├───Futura: NixOS configuration +│ └───Vortex: NixOS configuration +├───nixosModule: NixOS module +├───nixosModules +│ ├───apps: NixOS module +│ ├───base: NixOS module +│ ├───gui: NixOS module +│ ├───hardware: NixOS module +│ ├───nix: NixOS module +│ ├───secrets: NixOS module +│ ├───shell: NixOS module +│ └───user: NixOS module +├───overlays +│ └───nixFlakes: Nixpkgs overlay +├───packages +│ └───x86_64-linux +│ ├───dotfiles: package 'Dotfiles-v7.0' +│ └───fonts: package 'fonts-7' +├───templates +│ ├───extensive: template: My Complete, Extensive NixOS Configuration +│ └───minimal: template: Simple, Minimal NixOS Configuration +└───vmConfigurations + └───Windows: Virtual Machine +``` + +- `checks`: custom configuration checks +- `channels`: configured system package repositories + +</details> + +``` +┌── configuration.nix +├── flake.nix +├── flake.lock +├── .version +├── .templates +├── files +├── secrets +├── shells +├── repl.nix +├── users +├── devices +│ └── vm +├── scripts +│ └── nixos.nix +├── packages +│ └── overlays +├── lib +│ ├── compat +│ ├── build.nix +│ ├── map.nix +│ ├── pack.nix +│ ├── types.nix +│ └── xdg.nix +└── modules + ├── apps + ├── base + ├── gui + ├── hardware + ├── nix + ├── shell + └── user + └── passwords +``` + +- `configuration.nix`: main system configuration file +- `flake.nix`: repository version control using `inputs` +- `.version`: system state version +- [`.templates`](./templates/README.md): custom Flakes configuration templates +- [`files`](./files/README.md): `dotfiles` and program configuration +- [`secrets`](./secrets/README.md): authentication credentials management using [`sops-nix`](https://github.com/Mic92/sops-nix) +- `shells`: sand-boxed shells for development purposes +- `repl.nix`: interactive shell to explore syntax and configuration +- [`users`](./users/README.md): individual user-specific configuration +- [`devices`](./devices/README.md): system configuration for various devices +- [`vm`](./devices/vm/README.md): declarative configuration to build multiple virtual machines +- [`scripts`](./scripts/README.md): useful system management scripts +- [`packages`](./packages/README.md): locally built custom packages +- `overlays`: overrides for pre-built packages +- [`lib`](./lib/README.md): custom functions designed for conveniently defining configuration +- [`compat`](./lib/compat): compatibility library for older Nix versions +- [`modules`](./modules/README.md): custom configuration modules for additional functionality + +## Installation + +<details> +<summary><b>Already Installed</b></summary> + +In case you want to use my configuration as-is for a fresh NixOS install, you can try the following steps: + +**_Note:_** You can run `nix develop` or `nix-shell ./lib/compat/shell.nix` in the repository to install all required dependencies + +1. Prepare `/etc/nixos`: <pre><code>sudo mkdir /etc/nixos + sudo chown $USER /etc/nixos && sudo chmod ugo+rw /etc/nixos + cd /etc/nixos + </code></pre> + +2. Clone this repository (and preferably initialize it using `git`): <pre><code>nix flake init -t github:maydayv7/dotfiles#extensive + git init + </code></pre> + +3. Install `gnupg` and generate a GPG Key for yourself (if you don't already have one), and include it in the [`.sops.yaml`](./secrets/.sops.yaml) file (using `gpg --list-keys`). You can use the following commands to generate the GPG key (Ultimate trust and w/o passphrase is preferred): + _Replace_ **_USER_** _,_ **_EMAIL_** _and_ **_COMMENT_** <pre><code>gpg --full-generate-key + 1 + 4096 + 0 + y + <b><i>USER + EMAIL + COMMENT</i></b> + O + gpg --output public.pgp --armor --export <b><i>USER</i></b>@<b><i>EMAIL</i></b> + gpg --output private.pgp --armor --export-secret-key <b><i>USER</i></b>@<b><i>EMAIL</i></b> + </code></pre> + _Save the keys `public.gpg` and `private.gpg` in a secure location_ + +4. Import all required GPG Keys into a convenient location (like `/etc/gpg`) using <code>gpg --homedir <i>DIR</i> import</code> and specify it at `config.sops.gnupg.home` (Required for decryption of `secrets` on boot, can also be on an external drive) + +5. Make new `secrets` and `passwords` in the desired directories by appending the paths to `.sops.yaml` and then using the following command (The [`nixos`](./scripts/README.md) script can be used to simplify the process): + _Replace_ **_PATH_** _with the path to the `secret`_ <pre><code>sops --config <i>/path/to/<b>.sops.yaml</b></i> -i <b><i>PATH</i></b></code></pre> + +6. Add device-specific configuration by creating a new file in [`devices`](./devices) (bear in mind that the name of the file must be same as the `HOSTNAME` of your device), and if required, hardware configuration using the `hardware.modules` option + +7. Finally, run `nixos-rebuild switch --flake /etc/nixos#HOSTNAME` (as `root`) to switch to the configuration! + +</details> + +<details> +<summary><b>From Scratch</b></summary> + +Download the latest NixOS `.iso` from the [Releases](../../releases/latest) page and burn it to a USB using a flashing utility such as [Etcher](https://www.balena.io/etcher/) + +**_Important:_** In order to directly use the configuration, you must first create a clone of this repository and follow steps 2 to 6 from the above section, and preferably upload it to a hosting platform like GitHub/GitLab + +<details> +<summary><i>Additional Install Media</i></summary> + +If Nix is already installed on your system, you may run the following command to build the Install Media: +_Replace_ **_VARIANT_** _with the name of Install Media to create_ + +<pre><code>nix build github:maydayv7/dotfiles#installMedia.<b><i>VARIANT</i></b>.config.system.build.isoImage</code></pre> + +You can also download the NixOS `.iso` from [here](https://nixos.org/download.html) and run the `install` script using the following command: + +``` +nix build github:maydayv7/dotfiles#nixos +sudo ./result/bin/nixos install +``` + +If you want to create an `.iso` image of the entire system, run the following command: +_Replace_ **_DEVICE_** _with the name of Device to build_ + +<pre><code>nix run github:nix-community/nixos-generators -- -f iso --flake github:maydayv7/dotfiles#<b><i>DEVICE</i></b></code></pre> + +</details> + +#### Partition Scheme + +_Note that the `install` script automatically creates and labels all the required partitions, so it is recommended that only the partition table on the disk be created and have enough free space_ + +| Name | Label | Format | Size (minimum) | +| :------------- | :----: | :--------: | :------------: | +| BOOT Partition | ESP | vfat | 500M | +| ROOT Partition | System | ext4/BTRFS | 25G | +| SWAP Area | swap | swap | 8G | +| DATA Partition | Files | NTFS | 10G | + +#### Procedure + +To install the OS, just boot the Live USB and run `sudo nixos install` +_If the image doesn't boot, try disabling the `secure boot` and `RAID` options from `BIOS`_ +After the reboot, run `nixos setup` in the newly installed system to finish setup +_In case you are using the `advanced` filesystem scheme, you may need to set the boot flag `zfs_force=1` on first boot_ + +</details> + +<details> +<summary><b>Automatic Deploy</b></summary> + +The `nixosConfigurations` support automatic deployments using [deploy-rs](https://github.com/serokell/deploy-rs) + +To deploy a Device, simply run the following command: +_Replace_ **_DEVICE_** _with the name of Device to deploy_ + +<pre><code>nix run github:serokell/deploy -- github:maydayv7/dotfiles#<b><i>DEVICE</i></b></code></pre> + +</details> + +<details> +<summary><b>Build It Yourself</b></summary> + +If you really want to get dirty with Nix and decide to invest oodles of your time into building your own configuration, this repository can be used as inspiration. For starters, you can run `nix flake init -t github:maydayv7/dotfiles` in `/etc/nixos` for a basic Flakes-compatible system configuration. If you have any doubts, feel free to open an issue. You can check out the list of links below to resourceful Nix documentation/tutorials/projects that may be helpful in your endeavour + +**Welcome** to the Nix Community! ;) + +</details> + +## Notes + +### Caution + +I am pretty new to Nix, and my configuration is still _WIP_ and uses Nix [Flakes](https://nixos.wiki/wiki/Flakes), an experimental feature (**Important:** Nix >= 2.7) + +It is not recommended to use NixOS if you are a beginner just starting out, without acquaintance with either the command-line or functional programming languages, since the learning curve is steep, debugging issues is difficult, documentation is shallow, and the effort required/time spent isn't worth the hassle for a novice/casual user + +If you have any doubts or suggestions, feel free to open an [issue](../../issues/new/choose) + +### Requirements + +_May change according to available hardware_ + +- UEFI Compatible System +- Intel CPU + iGPU + +### License + +All the files and scripts in this repository are licensed under the very permissive MIT [License](./LICENSE), allowing you to freely use, modify, copy, distribute, sell or give away the software, only requirement being that the license and copyright notice must be provided with it + +### Branches + +There are two branches, [`stable`](../../tree/stable) and [`develop`](../../tree/develop) (when required). The `stable` branch can be used at any time, and consists of configuration that builds without failure, but the `develop` branch is a bleeding-edge testbed, and is not recommended to be used. Releases are always made from the `stable` branch after extensive testing + +### Build + +While rebuilding system with Flakes, make sure that any file with unstaged changes will not be included. Use `git add .` in cases where the `git` tree is dirty + +#### Cache + +The system build cache is publicly hosted using [Cachix](https://www.cachix.org) at [maydayv7-dotfiles](https://app.cachix.org/cache/maydayv7-dotfiles), and can be used while building the system to prevent rebuilding from scratch + +#### Continuous Integration + +This repository makes use of [`GitHub Actions`](./.github/workflows) in order to automatically check the configuration syntax on every commit (using [`nix-linter`](https://github.com/Synthetica9/nix-linter) and [`statix`](https://github.com/nerdypepper/statix)) and format it (using [`alejandra`](https://github.com/kamadorueda/alejandra) and [`prettier`](https://github.com/prettier/prettier)), update the `inputs` every week, build the configuration and upload the build cache to [Cachix](https://app.cachix.org/cache/maydayv7-dotfiles) as well as publish the Install Media `.iso` to a draft Release upon creation of a tag (You can also find `GitLab CI/CD` configuration in [`.gitlab`](./.gitlab/.gitlab-ci.yml)). A `git` [hook](./.git-hooks) is used to check the commit message to adhere to the [`Conventional Commits`](https://www.conventionalcommits.org) specification + +###### Variables + +- [`ACCESS_TOKEN`](./modules/apps/git/secrets/gitlab-token.secret): Personal Access Token (To create one - [GitHub](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token), [GitLab](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html)) +- [`CACHIX_TOKEN`](./secrets/cachix-token.secret): Cachix Authentication Token + +### File System + +The system may be set up using either a `simple` or `advanced` filesystem layout. The advanced ZFS opt-in state filesystem configuration allows for a vastly improved experience, preventing formation of cruft and exerting total control over the device state, by erasing the system at every boot, keeping only what's required + +#### Data Storage + +All important, persisted user files are stored at `/data`. Personal files and media are stored on an NTFS partition mounted to `/data/files` + +## Links + +### Theming + +- [Neofetch](https://github.com/dylanaraps/neofetch): Snazzy CLI System Information Tool +- [Powerlevel10K](https://github.com/romkatv/powerlevel10k) Theme: ZSH Theme for the fancy-looking prompt with immense customization capabilities +- [Dash to Panel](https://github.com/home-sweet-gnome/dash-to-panel): GNOME Shell Extension providing a highly customizable icon taskbar for maximized productivity +- [DNOME](https://github.com/GeopJr/DNOME) Discord Theme: Discord theme inspired by Adwaita, designed to integrate Discord with GNOME +- [Firefox GNOME Theme](https://github.com/rafaelmardojai/firefox-gnome-theme): GNOME Theme for the Mozilla Firefox Browser, used for better desktop integration + +### Important Links + +**See:** A [Curated List](https://github.com/nix-community/awesome-nix) of the Best Resources in the Nix Community + +- Official [Documentation](https://nixos.org/learn.html) +- NixOS [Manual](https://nixos.org/manual/nixpkgs/stable) +- Nix [Pills](https://nixos.org/guides/nix-pills/) +- NixOS [Discourse](https://discourse.nixos.org/) +- NixOS [Package Search](https://search.nixos.org/) +- [`nixpkgs`](https://github.com/NixOS/nixpkgs) Package Repository +- [NUR](https://github.com/nix-community/NUR) Nix User Repository +- NixOS [Hardware Modules](https://github.com/nixos/hardware) +- Home Manager [Options](https://nix-community.github.io/home-manager/options.html) + +#### Other Sources + +- Tweag [Article](https://www.tweag.io/blog/2020-05-25-flakes/) introducing Flakes +- Serokell's [Blog](https://serokell.io/blog/practical-nix-flakes) on Flakes +- Jordan Isaac's [Blog](https://jdisaacs.com/series/nixos-desktop/) for porting configuration to Flakes +- Jon Ringer's [Videos](https://www.youtube.com/channel/UC-cY3DcYladGdFQWIKL90SQ) on General NixOS Tooling and Hackery +- Justin's [Notes](https://github.com/justinwoo/nix-shorts) on using Nix +- Lan Tian's Series of [Blog Posts](https://lantian.pub/en/article/modify-website/nixos-initial-config-flake-deploy.lantian/) on NixOS +- Christine's [Blog Posts](https://christine.website/blog/series/nixos) addressing NixOS Security +- [Graham](https://grahamc.com/blog/erase-your-darlings) and [Elis'](https://elis.nu/blog/2020/05/nixos-tmpfs-as-root/) Blog Posts on Ephemeral Partition Schemes + +#### Other Configurations + +Here are some repositories that I may have shamelessly rummaged through for building my `dotfiles`: +_Thanks a lot! ;)_ + +- Over-Engineered [Configuration](https://github.com/divnix/devos) to scare off Beginners +- Minimalistic [Configuration](https://github.com/colemickens/nixos-flake-example) for scared Beginners +- User Configurations - + - [balsoft](https://code.balsoft.ru/balsoft/nixos-config) + - [bbigras](https://github.com/bbigras/nix-config) + - [cole-h](https://github.com/cole-h/nixos-config/) + - [colemickens](https://github.com/cole-mickens/nixcfg) + - [davidtwco](https://github.com/davidtwco/veritas) + - [gvolpe](https://github.com/gvolpe/nix-config) + - [hlissner](https://github.com/hlissner/dotfiles) + - [jordanisaacs](https://github.com/jordanisaacs/dotfiles) + - [kclejeune](https://github.com/kclejeune/system) + - [lovesegfault](https://github.com/lovesegfault/nix-config) + - [lucasew](https://github.com/lucasew/nixcfg) + - [nobbz](https://github.com/NobbZ/nixos-config) + - [rasendubi](https://github.com/rasendubi/dotfiles) + - [vlaci](https://github.com/vlaci/nixos-config) + - [wiltaylor](https://github.com/wiltaylor/dotfiles) + +--- + +You can navigate to the `README`'s present in the various directories to know more about them + +<details> +<summary><b>Changelog</b></summary> + +- Refine Compatibility Libraries +- Refine Scripts + - Use `nix-shell` Shebangs + - Add `lib.build.script` +- Support Visual Studio Code Editor +- Use [`alejandra`](https://github.com/kamadorueda/alejandra) for formatting code + +- Improve `channels` Usage +- Support `source` Filters +- Refine `git` Configuration +- Use `wine` Application Wrapper +- Use System Independent `library` +- Add Support for Ephemeral `/home` +- Add Configuration for [XFCE](https://xfce.org/) Desktop +- Bifurcate `users` and Refine User Configuration +- Support Automatic `packages` Updates using `update.sh` +- Add Support for Automatic Deployments using [`deploy-rs`](https://github.com/serokell/deploy-rs) +- Add Developer `shells` for Multiple Programming Languages integrated with [`lorri`](https://github.com/nix-community/lorri) + +- Use Calendar Versioning +- Use `nixConfig` +- Support Auto-Upgrade +- Support Multiple Users per Device +- Improve Security and Harden System +- Use PipeWire (with low-latency) for audio +- Use [`nixos-generators`](https://github.com/nix-community/nixos-generators) for Image Generation + +- Use `nixConfig` +- Bifurcate `devices` + - Refactor `lib.build.system` into `build.iso` and `build.device` +- Improve `lib` Handling +- Improve Module Imports +- Improve and Bifurcate `docs` +- Handle `scripts` as packages +- Improve configuration `checks` +- Achieve `system` Independence +- Add `.editorconfig` and `nanorc` +- Refactor `sops` Encrypted Secrets +- Stabilise and document `templates` +- Fix `devshells`, `repl` and `scripts` +- Fix Module Imports and `inputs` Patching +- Improve Mime Types Handling with `lib.xdg` +- Use `advanced` Ephemeral Root File System Layout with [ZFS](https://zfsonlinux.org/) +- Use [`flake-compat`](https://github.com/edolstra/flake-compat), [`nix-gaming`](https://github.com/fufexan/nix-gaming) and [`nix-wayland`](https://github.com/nix-community/nix-wayland) +- Improve Code Consistency, reduce Complexity and fix Syntactic and Semantic Errors + - Use [`pre-commit-hooks`](https://github.com/cachix/pre-commit-hooks.nix) to improve configuration `checks` + - Use [`nixfmt`](https://github.com/serokell/nixfmt) for formatting code + - Use [`nix-linter`](https://github.com/Synthetica9/nix-linter) to check stylistic errors + +- Upgrade to NixOS v21.11 (Porcupine)! +- Improve Package Declaration +- Add Support for Instant Nix REPL +- Add Support for patching `inputs` +- Improve usage of Developer Shells +- Import Modules using `nixosModules` +- Use [`home-manager`](https://github.com/nix-community/home-manager) as a Module +- Merge Device and User Configuration +- Move all program configuration and dotfiles to `files` +- Use [`sops-nix`](https://github.com/Mic92/sops-nix) at `secrets` for managing authentication credentials +- Automatically map `modules`, `packages`, `overlays`, `shells` and `inputs` + +- Add `docs` directory +- Fix `.iso` Boot and Install Errors +- Improve Scripts with error-checking +- Add `direnv` support at `shells` +- Add Support for Nix Developer Shells at `shells` +- Use `secrets` as an `input` rather than as a `submodule` +- Improve CI with automatic `flake.lock` update and dependency-checking +- Bifurcate Flake `outputs` (as `configuration.nix`), `scripts` and `overlays` + +- Simplify Installation + - Add `install` Script + - Add Support for creating Install Media + - Add overhauled `setup` Script + - Automatically build `.iso` and publish release using CI +- Fix Home Activation + +- Add BTRFS (opt-in state) Configuration +- Improve Ephemeral Root Support with [impermanence](https://github.com/nix-community/impermanence) +- Improve Installation Experience +- Improve Home Activation +- Bifurcate Modules and Roles +- Reduce CI Time +- Add the Office role + +- Add Cachix Support +- Add Nix Shell Support +- Increase Readability +- Improve Package Management +- Under the hood CI changes + +- Improve Secrets Management using Private Submodule at `secrets` +- Overhaul Package Overrides + - Use `final: prev:` instead of `self: super:` + - Add support for NUR + - Split System Scripts and import as overlay + - Refactor Package Overrides into `packages` +- Add archived `dotfiles` and revitalize existing ones +- Improve Modulated Imports +- Improve Fonts Management +- Update README and `scripts` + +- Added Support for Nix Flakes +- Added Custom Libraries for Device and User Management +- Created System Management Script +- Updated README and `install` Script +- Add full support for Multi-Device Configuration +- Use Better Repository Management + +- Added basic NixOS system configuration using GNOME and GTK+ +- Added hardware support for 2 devices +- Added `setup` script +- Added `home-manager` support and user dotfiles +- Added Modulated Configuration +- Added Support for Nix User Repository +- Added Repository Pinning +- Added Essential Package Overlays +- Added Basic Password Management +- Added README + +</details> + +<details> +<summary><b>Known Limitations</b></summary> + +- It is a hard requirement to clone the repository to `/etc/nixos` in order to use it as intended +- Need to completely transition to Wayland + +</details> + +> Last Updated: **March** 2022 + +If you like this project, consider leaving a [star](https://github.com/maydayv7/dotfiles) + +**V 7** +<maydayv7@gmail.com> diff --git a/configuration.nix b/configuration.nix @@ -0,0 +1,137 @@ +{self, ...} @ inputs: +with inputs; let + ## Variable Declaration ## + # Supported Architectures + platforms = ["x86_64-linux"]; + + # NixOS Version + version = readFile ./.version; + + # System Libraries + inherit (self) files; + inherit (lib) eachSystem filters; + inherit (builtins) head readFile; + inherit (lib.util) build map pack; + lib = library.lib.extend (final: prev: + { + deploy = deploy.lib; + filters = ignore.lib // {inherit (filter.lib) filter matchExt;}; + hooks = hooks.lib; + image = generators.nixosGenerate; + wine = wine.lib; + util = import ./lib { + inherit self platforms; + lib = final; + }; + } + // home.lib + // utils.lib); +in + eachSystem platforms (system: let + # Default Package Channel + pkgs = self.legacyPackages."${system}"; + + # Package Calling Function + call = name: pkgs.callPackage name {inherit lib inputs pkgs files;}; + in { + ## Configuration Checks ## + checks = import ./modules/nix/checks.nix {inherit self system lib pkgs;}; + + ## Developer Shells ## + devShells = + map.modules' ./shells (file: pkgs.mkShell (import file pkgs)) + // { + default = import ./shells {inherit pkgs;}; + website = import ./site/shell.nix {inherit pkgs;}; + commit = + pkgs.mkShell {inherit (self.checks."${system}".commit) shellHook;}; + }; + + ## Package Configuration ## + legacyPackages = self.channels."${system}".stable; + + # Channels + channels = { + stable = (build.channel stable [] ./packages/patches)."${system}"; + unstable = (build.channel unstable [nur.overlay] [])."${system}"; + wine = wine.packages."${system}"; + gaming = gaming.packages."${system}"; + apps = { + deploy = deploy.defaultPackage."${system}"; + generators = generators.defaultPackage."${system}"; + }; + }; + + # Custom Packages + apps = map.modules ./scripts (name: lib.mkApp {drv = call name;}) // {default = self.apps."${system}".nixos;}; + packages = map.modules ./packages call // map.modules ./scripts call // {default = self.packages."${system}".dotfiles;}; + }) + // { + # Overrides + overlays = map.modules ./packages/overlays import; + + ## Program Configuration and 'dotfiles' ## + files = import ./files lib; + + ## Custom Library Functions ## + lib = lib.util; + + ## Custom Configuration Modules ## + nixosModule = import ./modules {inherit version lib inputs files;}; + nixosModules = map.modules ./modules import; + + ## Configuration Templates ## + templates = { + default = { + description = "Simple, Minimal NixOS Configuration"; + path = filters.filter { + root = ./.templates/minimal; + include = [(filters.matchExt "nix")]; + }; + }; + + extensive = { + description = "My Complete, Extensive NixOS Configuration"; + path = filters.filter { + root = ./.; + exclude = [ + ./.github + ./.gitlab + ./site + ./packages/website.nix + (filters.matchExt "md") + (filters.matchExt "secret") + ]; + }; + }; + }; + + ## Device Configuration ## + deploy = import ./modules/nix/deploy.nix {inherit self lib;}; + nixosConfigurations = + map.modules ./devices (name: build.device (import name)); + + ## Virtual Machines ## + vmConfigurations = + map.modules ./devices/vm (name: + import name (head platforms) inputs self.channels."${head platforms}".stable); + + ## Install Media Configuration ## + installMedia = { + # GNOME Desktop + gnome = build.iso { + timezone = "Asia/Kolkata"; + locale = "en_IN.UTF-8"; + kernel = "linux_zfs"; + gui.desktop = "gnome"; + }; + + # XFCE Desktop + xfce = build.iso { + timezone = "Asia/Kolkata"; + locale = "en_IN.UTF-8"; + kernel = "linux_zfs"; + gui.desktop = "xfce"; + }; + }; + } diff --git a/default.nix b/default.nix @@ -0,0 +1,2 @@ +# Default Package Channel +with builtins; (getFlake "git+file://${toString ./.}").legacyPackages."${currentSystem}" diff --git a/devices/.git-keep b/devices/.git-keep diff --git a/devices/Futura.nix b/devices/Futura.nix @@ -0,0 +1,28 @@ +{ + system = "x86_64-linux"; + name = "Futura"; + description = "PC - Dell Inspiron 11 3000"; + + timezone = "Asia/Kolkata"; + locale = "en_IN.UTF-8"; + update = "weekly"; + + kernel = "linux_5_4"; + hardware = { + boot = "efi"; + cores = 4; + filesystem = "simple"; + modules = ["common-cpu-intel" "common-pc" "common-pc-laptop"]; + }; + + gui.desktop = "gnome"; + apps.list = ["firefox" "office"]; + + # User Navya + user = { + name = "navya"; + groups = ["wheel"]; + description = "Navya"; + shell = "zsh"; + }; +} diff --git a/devices/README.md b/devices/README.md @@ -0,0 +1,18 @@ +### Devices + +The `devices` directory contains the core definitions for multiple PCs and various other devices. To add a new device, simply create a configuration file for it (name of the file/directory must be the same as the `hostname` of the device) and write down the configuration using the options of the desired modules from the [`modules`](../modules/README.md) directory, or add your own configuration modules using the `imports` keyword. You can also use the keyword `format` to generate a particular type of image for that device (Eg. `iso`, generated using [`nixos-generators`](https://github.com/nix-community/nixos-generators)). Use the `repo` keyword to specify the main package repository to be used (see [`self.channels.${system}`](../configuration.nix)). Optionally, add user-specific configuration in [`users`](../users/README.md). Then, run the command `nixos-rebuild switch --flake .#HOSTNAME` and let Nix do all the work for you! + +#### Additional Options + +These are the options that can be used in addition to the ones exposed by the `nixosModules`: + +- `description`: System Description (to add to `config.system.nixos.label`) +- `timezone`: System Time Zone - Ex. `"Asia/Kolkata"` +- `locale`: Default Locale - Ex. `"en_IN.UTF-8"` +- `channel`: System Package Repository to use (from `self.channels.${system}`) - `"stable" / "unstable"` +- `kernel`: Linux Kernel to use (from `pkgs.linuxKernel.packages.${kernel}`) - Ex. `linux_zfs` +- `kernelModules`: Additional Kernel Modules (to add to `config.boot.initrd.availableKernelModules`) - Ex. `[ "nvme" ]` +- `imports`: Additional Configuration Files to import - Ex. `[ ./hardware-configuration.nix ]` +- `format`: Generates Output for Specified Target Format (See [this](https://github.com/nix-community/nixos-generators#supported-formats) for the list of supported formats) +- `user` or `users` (---> `config.user.settings` <`home` ---> `homeConfig`>): Used to specify Device User/Multiple Users per Device - Ex. `users = [ { name "1"; } { name = "2"; } ]` +- `update`: Enable Automatic System Upgrades - Ex. `weekly` diff --git a/devices/Vortex.nix b/devices/Vortex.nix @@ -0,0 +1,36 @@ +{ + system = "x86_64-linux"; + name = "Vortex"; + description = "PC - Dell Inspiron 15 5000"; + channel = "stable"; + + timezone = "Asia/Kolkata"; + locale = "en_IN.UTF-8"; + + kernel = "linux_lqx"; + kernelModules = ["nvme" "thunderbolt"]; + + hardware = { + boot = "efi"; + cores = 8; + filesystem = "advanced"; + security = true; + support = ["mobile" "printer" "virtualisation"]; + modules = ["dell-inspiron-5509"]; + }; + + gui.desktop = "gnome"; + shell.utilities = true; + apps.list = ["discord" "firefox" "git" "office" "vscode" "wine"]; + + # User V7 + user = { + name = "v7"; + description = "V 7"; + groups = ["wheel" "keys"]; + uid = 1000; + shell = "zsh"; + shells = ["bash"]; + recovery = true; + }; +} diff --git a/devices/vm/README.md b/devices/vm/README.md @@ -0,0 +1,7 @@ +### Virtual Machines + +The `vm` directory contains the declarative configurations to build multiple Virtual Machines + +Virtualisation is done using `qemu-kvm` and `libvirt`. Preferred GUI is `virt-manager`. For VFI/O, you can use `hardware.passthrough` to specify the devices you want to pass through to the VM (you can use [`scripts/pci.sh`](../../scripts/pci.sh) to find the IDs) + +A [Windows](./Windows.nix) VM is declaratively installed and configured making use of the [WFVM](https://git.m-labs.hk/M-Labs/wfvm) Project. Use `nix build github:maydayv7/dotfiles#vmConfigurations.Windows` to build the image diff --git a/devices/vm/Windows.nix b/devices/vm/Windows.nix @@ -0,0 +1,53 @@ +system: inputs: pkgs: +## Windows Virtual Machine ## +let + lib = import "${inputs.windows}/wfvm" { + pkgs = import (pkgs.fetchFromGitHub { + owner = "NixOS"; + repo = "nixpkgs"; + rev = "f8248ab6d9e69ea9c07950d73d48807ec595e923"; + sha256 = "009i9j6mbq6i481088jllblgdnci105b2q4mscprdawg3knlyahk"; + }) {inherit system;}; + }; +in + lib.makeWindowsImage { + # Base Image + windowsImage = pkgs.requireFile rec { + name = "Win10_21H1_English_x64.iso"; + sha256 = "1sl51lnx4r6ckh5fii7m2hi15zh8fh7cf7rjgjq9kacg8hwyh4b9"; + message = "Get ${name} from https://www.microsoft.com/en-us/software-download/windows10ISO"; + }; + + # User Accounts + users = { + default = { + password = "1234567"; + description = "Default User"; + displayName = "Windows"; + groups = ["Administrators"]; + }; + }; + + # Auto Login + defaultUser = "default"; + administratorPassword = "admin"; + + # Organisation + fullName = "Microsoft"; + organization = "ms"; + + # Imperative Installation Commands + installCommands = with lib.layers; [ + (collapseLayers [disable-autosleep disable-autolock disable-firewall]) + ]; + + # License + imageSelection = "Windows 10 Pro"; + productKey = "VK7JG-NPHTM-C97JM-9MPGT-3V66T"; + + # Locales + uiLanguage = "en-US"; + inputLocale = "en-US"; + userLocale = "en-US"; + systemLocale = "en-US"; + } diff --git a/files/README.md b/files/README.md @@ -0,0 +1,25 @@ +### Dotfiles + +The `files` directory is used to store all my plain-text program configuration files _(or as we all love to call it, the `dotfiles`)_ + +- [`archive`](./archive) - Old, Archived Files +- [`ascii`](./ascii) - Personal Collection of beautiful Ascii Art +- [`discord`](./discord) - `discord` Chat Theming and Plugins +- [`firefox`](./firefox) - `firefox` Web Browser Theming +- [`fonts`](./fonts) - Proprietary Fonts and Configuration +- [`git`](./git) - Configuration for `git` Version Control +- [`gnome`](./gnome) - Configuration Files for GNOME Desktop +- [`gpg`](./gpg) - Encrypted GPG Keys +- [`gtk`](./gtk) - GTK+ Theming and Styles +- [`images`](./images) - Personal Wallpapers and Profile Pictures +- [`nano`](./nano) - `nano` Text Editor Global Configuration +- [`neofetch`](./neofetch) - `neofetch` CLI Theming +- [`plank`](./plank) - `plank` Dock Theming +- [`templates`](./templates) - Document Templates +- [`touchegg`](./touchegg) - X11 Gestures provided by `touchegg` +- [`vscode`](./vscode) - Visual Studio Code Editor Configuration +- [`wine`](./wine) - Configuration and Theming for `wine` applications +- [`xdg`](./xdg) - XDG Desktop Utilities Configuration +- [`xfce`](./xfce) - Configuration Files for XFCE Desktop +- [`xorg`](./xorg) - X11 Display Server Configuration +- [`zsh`](./zsh) - Z Shell Configuration and Prompt Theming diff --git a/files/archive/.git-keep b/files/archive/.git-keep diff --git a/files/archive/Linux/Arch/COMMANDS.md b/files/archive/Linux/Arch/COMMANDS.md @@ -0,0 +1,60 @@ +# Useful Commands + +#### GRUB + +_The update-grub script:_ +_Add the following in_ **/usr/sbin/update-grub** + +**_#!/bin/sh_** +**_set -e_** +**_exec grub-mkconfig -o /boot/grub/grub.cfg_** + +_Then execute:_ +`sudo chown root:root /usr/sbin/update-grub` +`sudo chmod 755 /usr/sbin/update-grub` + +#### Virtualization + +`sudo usermod -a -G libvirt $(whoami)` +`newgrp libvirt` +`sudo usermod -a -G kvm $(whoami)` + +#### Fonts + +`sudo ln -s /usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf /etc/fonts/conf.d/` +`sudo ln -s /usr/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d/` +`sudo fc-cache -fv` + +#### Theming + +_To set QT theme in GTK+ based DEs using qt5ct, add the following in /etc/environment:_ +`QT_QPA_PLATFORMTHEME=qt5ct` + +_To make apps running as root in **OpenSUSE** use the right theme:_ +`sudo ln -s /home/USER/.config/kdeglobals /root/.config/kdeglobals` +`sudo ln -s /home/USER/.config/gtk-4.0 /root/.config/gtk-4.0` + +#### Filesystem + +_Fix NTFS Disk after a faulty Windows shutdown:_ +`sudo ntfsfix /dev/X` + +_Create symlinks for home directories (Useful for multiboot)_ +`ln -s /PATH/HOME_DIR ~/home/USER/HOME_DIR` + +_If a home directory got deleted or if you want a custom home directory, modify this file_ +`nano ~/.config/user-dirs.dirs` + +_How I mount my data partition_ +`sudo mkdir /data` +`sudo chmod ugo+rw /data` + +``` +# DATA Partition +UUID=partuuid /data ntfs rw,defaults,x-gvfs-show 0 0 +``` + +#### Miscellaneous + +_To clear configuration files of deleted apps in **Debian**:_ +`sudo dpkg --purge dpkg --get-selections | grep deinstall | cut -f1` diff --git a/files/archive/Linux/Arch/INSTALL.md b/files/archive/Linux/Arch/INSTALL.md @@ -0,0 +1,174 @@ +# Arch Linux BTRFS Install + +Enter custom values for THESE letters +_These_ and **_these_** letters are comments + +## Create live disk + +Go to [this](https://www.archlinux.org/download/) website and download the latest .iso file, then either burn it to a USB using [Etcher](https://www.balena.io/etcher/) or a CD using [Brasero](https://wiki.gnome.org/Apps/Brasero). Make sure that the size of the device is at least 1 GB + +## Network + +_Replace_ **_DEVICE_** _with the name of the device found from device list_ +`iwctl` +`device list` +`station DEVICE get-networks` +`station DEVICE connect NETWORK` +`exit` + +## Partitions + +Create your partitions using a tool like [Gparted](https://gparted.org/) or [cfdisk](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwjM3OO5yLnwAhUDXSsKHZi0DGcQFjABegQIAhAD&url=https%3A%2F%2Fman.archlinux.org%2Fman%2Fcfdisk.8.en&usg=AOvVaw1IUZ8UEyqlKjnpyVtymdfu). It is recommended to have an ESP or BOOT Partition, a ROOT Partition and a DATA Partition for storing files + +`fdisk -l` +_Check which partitions to install onto and note their_ **_number_** +_Replace_ **_X_**, **_Y_** and **_Z_** _with the required partitions as +found from the above command_ + +`mkfs.btrfs -f -L Root /dev/X` **- ROOT Partition** +`mkfs.fat -F32 -n BOOT /dev/Y` **- BOOT Partition** +`mkswap -L Swap /dev/Z` **- SWAP Partition (Optional)** +`mount /dev/X /mnt` +`cd /mnt` +`btrfs subvolume create @` +`btrfs subvolume create @home` +`btrfs subvolume create snapshots` +`cd` +`umount /mnt` +`mount -o noatime,space_cache=v2,ssd,compress=zstd,subvol=@ /dev/X /mnt` +`mkdir /mnt/home` +`mount -o noatime,space_cache=v2,ssd,compress=zstd,subvol=@home /dev/X/mnt/home` +`swapon /dev/Z` + +\*Skip below if using a **_UEFI_** System\* +`mkdir /mnt/boot` +`mount /dev/Y /mnt/boot` + +## Install Arch + +`pacstrap /mnt base linux linux-firmware nano base-devel man-db man-pages texinfo btrfs-progs` +`genfstab -U /mnt >> /mnt/etc/fstab` + +### Configuring Disks + +`mkdir /mnt/mnt/volume` +`nano /mnt/etc/fstab` +_Remove subvolids from all entries, add the /mnt/volume entry. Eg:_ + +``` +# ROOT Subvolume +UUID=1a787b5a-c649-4c75-b8bc-b0ac970a1b6d / btrfs rw,noatime,compress=zstd:3,ssd,space_cache=v2,autodefrag,subvol=@ 0 0 + +# HOME Subvolume +UUID=1a787b5a-c649-4c75-b8bc-b0ac970a1b6d /home btrfs rw,noatime,compress=zstd:3,ssd,space_cache=v2,autodefrag,subvol=@home 0 0 + +# BTRFS Partition +UUID=1a787b5a-c649-4c75-b8bc-b0ac970a1b6d /mnt/volume btrfs rw,noatime,discard,autodefrag,space_cache=v2,subvol=/ 0 0 + +# SWAP Partition +UUID=e82defeb-409d-449f-bd51-cdd87bd2af02 none swap defaults 0 0 +``` + +_To get the UUID of a partition, use the `blkid` command_ + +## General Settings + +`arch-chroot /mnt` + +`timedatectl set-timezone CONTINENT/CITY` +`nano /etc/locale.gen` +**_Uncomment_** _the required locale_ +`locale-gen` +`nano /etc/locale.conf` +_Add:_ +_LANG=**ab_CD**.UTF-8_ + +_Replace_ **_HOSTNAME_** _with the desired name for your computer_ +`echo HOSTNAME > /etc/hostname` +`touch /etc/hosts` +`nano /etc/hosts` +_Add:_ + +``` +127.0.0.1 localhost +::1 localhost +127.0.1.1 HOSTNAME +``` + +_Replace_ **_USER_** _with the desired username_ +`passwd` +`useradd -m USER` +`passwd USER` +`export EDITOR=nano` +`visudo` +_Add:_ +_USER_ **_ALL=(ALL) ALL_** + +## Bootloader + +`pacman -S grub` + +#### For BIOS Systems + +`grub-install /dev/X` +`grub-mkconfig -o /boot/grub/grub.cfg` + +#### For UEFI Systems + +`pacman -S efibootmgr` +`mkdir /boot/efi` +`mount /dev/Y /boot/efi` +`grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi` +`grub-mkconfig -o /boot/grub/grub.cfg` + +## Desktop Environment + +### Gnome + +`pacman -S xorg gnome networkmanager` +`systemctl enable gdm` + +### XFCE + +`pacman -S xorg xfce4 xfce4-goodies lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings networkmanager` +`systemctl enable lightdm` + +### KDE + +`pacman -S xorg plasma plasma-wayland-session` +`systemctl enable sddm` + +## After Install + +### Essential Utilites + +`pacman -S bluez bluez-utils cups git ntfs-3g intel-ucode system-config-printer` +`systemctl enable bluetooth` +`systemctl enable cups` +`systemctl enable NetworkManager` + +### Zram (Optional) + +`nano /etc/systemd/system/zram.service` +_Add the following by changing the size according to your RAM:_ + +``` +[Unit] +Description=zRam block devices swapping + +[Service] +Type=oneshot +ExecStart=/usr/bin/bash -c "modprobe zram && echo lz4 > /sys/block/zram0/comp_algorithm && echo 6G > /sys/block/zram0/disksize && mkswap --label zram0 /dev/zram0 && swapon --priority 100 /dev/zram0" +ExecStop=/usr/bin/bash -c "swapoff /dev/zram0 && rmmod zram" +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target +``` + +`systemctl enable zram` + +### We're Done! :) + +`exit` +`reboot` diff --git a/files/archive/Linux/Arch/zshrc b/files/archive/Linux/Arch/zshrc @@ -0,0 +1,31 @@ +## Arch ZSH Config + +# Powerlevel10k Prompt +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +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 + +# Find The Command +source /usr/share/doc/find-the-command/ftc.zsh noprompt quiet + +# Oh My ZSH +export ZSH="/home/v7/.oh-my-zsh" +source $ZSH/oh-my-zsh.sh + +# Set name of the theme to load +ZSH_THEME="powerlevel10k/powerlevel10k" + +# Plugins +plugins=( + git + zsh-autosuggestions + zsh-syntax-highlighting +) + +# Aliases +alias sike="neofetch" +alias edit="nano" +alias hi="echo 'Hi there. How are you?'" +alias bye="exit" +alias repo="sudo systemctl start reflector.service" diff --git a/files/archive/Linux/Pop/conky/conky.lua b/files/archive/Linux/Pop/conky/conky.lua @@ -0,0 +1,553 @@ +-------------------------------------------------------------------------------- +-- Conky Pop!OS +-- Author : V7 <maydayv7@gmail.com> +-- +-------------------------------------------------------------------------------- + +require("cairo") + +-------------------------------------------------------------------------------- +-- Clock DATA +-- HOURS +clock_h = { + { + name = "time", + arg = "%H", + max_value = 12, + x = 110, + y = 80, + graph_radius = 53, + graph_thickness = 3, + graph_unit_angle = 30, + graph_unit_thickness = 30, + graph_bg_colour = 0xffffff, + graph_bg_alpha = 0.0, + graph_fg_colour = 0xFFFFFF, + graph_fg_alpha = 0.3, + txt_radius = 34, + txt_weight = 1, + txt_size = 10.0, + txt_fg_colour = 0xFFFFFF, + txt_fg_alpha = 0.6, + graduation_radius = 53, + graduation_thickness = 6, + graduation_mark_thickness = 2, + graduation_unit_angle = 30, + graduation_fg_colour = 0xFFFFFF, + graduation_fg_alpha = 0.3, + }, +} +-- MINUTES +clock_m = { + { + name = "time", + arg = "%M", + max_value = 60, + x = 110, + y = 80, + graph_radius = 57, + graph_thickness = 2, + graph_unit_angle = 6, + graph_unit_thickness = 6, + graph_bg_colour = 0xffffff, + graph_bg_alpha = 0.1, + graph_fg_colour = 0xFFFFFF, + graph_fg_alpha = 0.3, + txt_radius = 70, + txt_weight = 0, + txt_size = 9.0, + txt_fg_colour = 0xFFFFFF, + txt_fg_alpha = 0.6, + graduation_radius = 57, + graduation_thickness = 0, + graduation_mark_thickness = 2, + graduation_unit_angle = 30, + graduation_fg_colour = 0xFFFFFF, + graduation_fg_alpha = 0.3, + }, +} +-- SECONDS +clock_s = { + { + name = "time", + arg = "%S", + max_value = 60, + x = 110, + y = 80, + graph_radius = 50, + graph_thickness = 2, + graph_unit_angle = 6, + graph_unit_thickness = 2, + graph_bg_colour = 0xffffff, + graph_bg_alpha = 0.0, + graph_fg_colour = 0xFFFFFF, + graph_fg_alpha = 0.2, + txt_radius = 40, + txt_weight = 0, + txt_size = 12.0, + txt_fg_colour = 0xFFFFFF, + txt_fg_alpha = 0.3, + graduation_radius = 0, + graduation_thickness = 0, + graduation_mark_thickness = 0, + graduation_unit_angle = 0, + graduation_fg_colour = 0xFFFFFF, + graduation_fg_alpha = 0.0, + }, +} + +-------------------------------------------------------------------------------- +-- Gauge DATA +gauge = { + { + name = "cpu", + arg = "cpu0", + max_value = 100, + x = 85, + y = 200, + graph_radius = 24, + graph_thickness = 5, + graph_start_angle = 180, + graph_unit_angle = 2.7, + graph_unit_thickness = 2.7, + graph_bg_colour = 0xffffff, + graph_bg_alpha = 0.1, + graph_fg_colour = 0xFFFFFF, + graph_fg_alpha = 0.2, + hand_fg_colour = 0xEF5A29, + hand_fg_alpha = 1.0, + txt_radius = 34, + txt_weight = 0, + txt_size = 8.0, + txt_fg_colour = 0xEF5A29, + txt_fg_alpha = 1.0, + graduation_radius = 28, + graduation_thickness = 0, + graduation_mark_thickness = 1, + graduation_unit_angle = 27, + graduation_fg_colour = 0xFFFFFF, + graduation_fg_alpha = 0.3, + caption = "", + caption_weight = 1, + caption_size = 8.0, + caption_fg_colour = 0xFFFFFF, + caption_fg_alpha = 0.3, + }, + { + name = "cpu", + arg = "cpu1", + max_value = 100, + x = 85, + y = 200, + graph_radius = 18, + graph_thickness = 5, + graph_start_angle = 180, + graph_unit_angle = 2.7, + graph_unit_thickness = 2.7, + graph_bg_colour = 0xffffff, + graph_bg_alpha = 0.1, + graph_fg_colour = 0xFFFFFF, + graph_fg_alpha = 0.2, + hand_fg_colour = 0xEF5A29, + hand_fg_alpha = 1.0, + txt_radius = 10, + txt_weight = 0, + txt_size = 8.0, + txt_fg_colour = 0xEF5A29, + txt_fg_alpha = 1.0, + graduation_radius = 28, + graduation_thickness = 0, + graduation_mark_thickness = 1, + graduation_unit_angle = 27, + graduation_fg_colour = 0xFFFFFF, + graduation_fg_alpha = 0.3, + caption = "", + caption_weight = 1, + caption_size = 8.0, + caption_fg_colour = 0xFFFFFF, + caption_fg_alpha = 0.3, + }, + { + name = "memperc", + arg = "", + max_value = 100, + x = 85, + y = 300, + graph_radius = 24, + graph_thickness = 5, + graph_start_angle = 180, + graph_unit_angle = 2.7, + graph_unit_thickness = 2.7, + graph_bg_colour = 0xffffff, + graph_bg_alpha = 0.1, + graph_fg_colour = 0xFFFFFF, + graph_fg_alpha = 0.2, + hand_fg_colour = 0xEF5A29, + hand_fg_alpha = 1.0, + txt_radius = 10, + txt_weight = 0, + txt_size = 8.0, + txt_fg_colour = 0xEF5A29, + txt_fg_alpha = 1.0, + graduation_radius = 23, + graduation_thickness = 0, + graduation_mark_thickness = 2, + graduation_unit_angle = 27, + graduation_fg_colour = 0xFFFFFF, + graduation_fg_alpha = 0.5, + caption = "", + caption_weight = 1, + caption_size = 8.0, + caption_fg_colour = 0xFFFFFF, + caption_fg_alpha = 0.3, + }, + { + name = "fs_used_perc", + arg = "/", + max_value = 100, + x = 85, + y = 380, + graph_radius = 24, + graph_thickness = 5, + graph_start_angle = 180, + graph_unit_angle = 2.7, + graph_unit_thickness = 2.7, + graph_bg_colour = 0xffffff, + graph_bg_alpha = 0.1, + graph_fg_colour = 0xFFFFFF, + graph_fg_alpha = 0.2, + hand_fg_colour = 0xEF5A29, + hand_fg_alpha = 1.0, + txt_radius = 34, + txt_weight = 0, + txt_size = 8.0, + txt_fg_colour = 0xEF5A29, + txt_fg_alpha = 1.0, + graduation_radius = 28, + graduation_thickness = 0, + graduation_mark_thickness = 1, + graduation_unit_angle = 27, + graduation_fg_colour = 0xFFFFFF, + graduation_fg_alpha = 0.3, + caption = "/", + caption_weight = 1, + caption_size = 8.0, + caption_fg_colour = 0xFFFFFF, + caption_fg_alpha = 0.5, + }, + { + name = "fs_used_perc", + arg = "/home/", + max_value = 100, + x = 85, + y = 380, + graph_radius = 18, + graph_thickness = 5, + graph_start_angle = 180, + graph_unit_angle = 2.7, + graph_unit_thickness = 2.7, + graph_bg_colour = 0xffffff, + graph_bg_alpha = 0.1, + graph_fg_colour = 0xFFFFFF, + graph_fg_alpha = 0.2, + hand_fg_colour = 0xEF5A29, + hand_fg_alpha = 1.0, + txt_radius = 10, + txt_weight = 0, + txt_size = 8.0, + txt_fg_colour = 0xEF5A29, + txt_fg_alpha = 1.0, + graduation_radius = 28, + graduation_thickness = 0, + graduation_mark_thickness = 1, + graduation_unit_angle = 27, + graduation_fg_colour = 0xFFFFFF, + graduation_fg_alpha = 0.3, + caption = "/home", + caption_weight = 1, + caption_size = 8.0, + caption_fg_colour = 0xFFFFFF, + caption_fg_alpha = 0.5, + }, +} + +------------------------------------------------------------------------------- +-- Converts Color in Hexa to Decimal +-- +function rgb_to_r_g_b(colour, alpha) + return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha +end + +------------------------------------------------------------------------------- +-- Converts Degree to rad and Rotates (0 is on the Top) +-- +function angle_to_position(start_angle, current_angle) + local pos = current_angle + start_angle + return ((pos * (2 * math.pi / 360)) - (math.pi / 2)) +end + +------------------------------------------------------------------------------- +-- Displays Clock +-- +function draw_clock_ring(display, data, value) + local max_value = data["max_value"] + local x, y = data["x"], data["y"] + local graph_radius = data["graph_radius"] + local graph_thickness, graph_unit_thickness = data["graph_thickness"], data["graph_unit_thickness"] + local graph_unit_angle = data["graph_unit_angle"] + local graph_bg_colour, graph_bg_alpha = data["graph_bg_colour"], data["graph_bg_alpha"] + local graph_fg_colour, graph_fg_alpha = data["graph_fg_colour"], data["graph_fg_alpha"] + + -- Background Ring + cairo_arc(display, x, y, graph_radius, 0, 2 * math.pi) + cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha)) + cairo_set_line_width(display, graph_thickness) + cairo_stroke(display) + + -- Arc + local val = (value % max_value) + local i = 1 + while i <= val do + cairo_arc( + display, + x, + y, + graph_radius, + (((graph_unit_angle * i) - graph_unit_thickness) * (2 * math.pi / 360)) - (math.pi / 2), + ((graph_unit_angle * i) * (2 * math.pi / 360)) - (math.pi / 2) + ) + cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha)) + cairo_stroke(display) + i = i + 1 + end + local angle = (graph_unit_angle * i) - graph_unit_thickness + + -- Graduations + local graduation_radius = data["graduation_radius"] + local graduation_thickness, graduation_mark_thickness = + data["graduation_thickness"], data["graduation_mark_thickness"] + local graduation_unit_angle = data["graduation_unit_angle"] + local graduation_fg_colour, graduation_fg_alpha = data["graduation_fg_colour"], data["graduation_fg_alpha"] + if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then + local nb_graduation = 360 / graduation_unit_angle + local i = 1 + while i <= nb_graduation do + cairo_set_line_width(display, graduation_thickness) + cairo_arc( + display, + x, + y, + graduation_radius, + (((graduation_unit_angle * i) - (graduation_mark_thickness / 2)) * (2 * math.pi / 360)) - (math.pi / 2), + (((graduation_unit_angle * i) + (graduation_mark_thickness / 2)) * (2 * math.pi / 360)) - (math.pi / 2) + ) + cairo_set_source_rgba(display, rgb_to_r_g_b(graduation_fg_colour, graduation_fg_alpha)) + cairo_stroke(display) + cairo_set_line_width(display, graph_thickness) + i = i + 1 + end + end + + -- Text + local txt_radius = data["txt_radius"] + local txt_weight, txt_size = data["txt_weight"], data["txt_size"] + local txt_fg_colour, txt_fg_alpha = data["txt_fg_colour"], data["txt_fg_alpha"] + local movex = txt_radius * (math.cos((angle * 2 * math.pi / 360) - (math.pi / 2))) + local movey = txt_radius * (math.sin((angle * 2 * math.pi / 360) - (math.pi / 2))) + cairo_select_font_face(display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight) + cairo_set_font_size(display, txt_size) + cairo_set_source_rgba(display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha)) + cairo_move_to(display, x + movex - (txt_size / 2), y + movey + 3) + cairo_show_text(display, value) + cairo_stroke(display) +end + +------------------------------------------------------------------------------- +-- Displays Gauges +-- +function draw_gauge_ring(display, data, value) + local max_value = data["max_value"] + local x, y = data["x"], data["y"] + local graph_radius = data["graph_radius"] + local graph_thickness, graph_unit_thickness = data["graph_thickness"], data["graph_unit_thickness"] + local graph_start_angle = data["graph_start_angle"] + local graph_unit_angle = data["graph_unit_angle"] + local graph_bg_colour, graph_bg_alpha = data["graph_bg_colour"], data["graph_bg_alpha"] + local graph_fg_colour, graph_fg_alpha = data["graph_fg_colour"], data["graph_fg_alpha"] + local hand_fg_colour, hand_fg_alpha = data["hand_fg_colour"], data["hand_fg_alpha"] + local graph_end_angle = (max_value * graph_unit_angle) % 360 + + -- Background Ring + cairo_arc( + display, + x, + y, + graph_radius, + angle_to_position(graph_start_angle, 0), + angle_to_position(graph_start_angle, graph_end_angle) + ) + cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha)) + cairo_set_line_width(display, graph_thickness) + cairo_stroke(display) + + -- Arc + local val = value % (max_value + 1) + local start_arc = 0 + local stop_arc = 0 + local i = 1 + while i <= val do + start_arc = (graph_unit_angle * i) - graph_unit_thickness + stop_arc = (graph_unit_angle * i) + cairo_arc( + display, + x, + y, + graph_radius, + angle_to_position(graph_start_angle, start_arc), + angle_to_position(graph_start_angle, stop_arc) + ) + cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha)) + cairo_stroke(display) + i = i + 1 + end + local angle = start_arc + + -- Hand + start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2) + stop_arc = (graph_unit_angle * val) + cairo_arc( + display, + x, + y, + graph_radius, + angle_to_position(graph_start_angle, start_arc), + angle_to_position(graph_start_angle, stop_arc) + ) + cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha)) + cairo_stroke(display) + + -- Graduations + local graduation_radius = data["graduation_radius"] + local graduation_thickness, graduation_mark_thickness = + data["graduation_thickness"], data["graduation_mark_thickness"] + local graduation_unit_angle = data["graduation_unit_angle"] + local graduation_fg_colour, graduation_fg_alpha = data["graduation_fg_colour"], data["graduation_fg_alpha"] + if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then + local nb_graduation = graph_end_angle / graduation_unit_angle + local i = 0 + while i < nb_graduation do + cairo_set_line_width(display, graduation_thickness) + start_arc = (graduation_unit_angle * i) - (graduation_mark_thickness / 2) + stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2) + cairo_arc( + display, + x, + y, + graduation_radius, + angle_to_position(graph_start_angle, start_arc), + angle_to_position(graph_start_angle, stop_arc) + ) + cairo_set_source_rgba(display, rgb_to_r_g_b(graduation_fg_colour, graduation_fg_alpha)) + cairo_stroke(display) + cairo_set_line_width(display, graph_thickness) + i = i + 1 + end + end + + -- Text + local txt_radius = data["txt_radius"] + local txt_weight, txt_size = data["txt_weight"], data["txt_size"] + local txt_fg_colour, txt_fg_alpha = data["txt_fg_colour"], data["txt_fg_alpha"] + local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle)) + local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle)) + cairo_select_font_face(display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight) + cairo_set_font_size(display, txt_size) + cairo_set_source_rgba(display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha)) + cairo_move_to(display, x + movex - (txt_size / 2), y + movey + 3) + cairo_show_text(display, value) + cairo_stroke(display) + + -- Caption + local caption = data["caption"] + local caption_weight, caption_size = data["caption_weight"], data["caption_size"] + local caption_fg_colour, caption_fg_alpha = data["caption_fg_colour"], data["caption_fg_alpha"] + local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360) - (math.pi / 2))) + local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360) - (math.pi / 2))) + cairo_select_font_face(display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, caption_weight) + cairo_set_font_size(display, caption_size) + cairo_set_source_rgba(display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha)) + cairo_move_to(display, x + tox + 5, y + toy + 1) + if graph_start_angle < 105 then + cairo_move_to(display, x + tox - 30, y + toy + 1) + end + cairo_show_text(display, caption) + cairo_stroke(display) +end + +------------------------------------------------------------------------------- +-- Loads data and Displays Clock +-- +function go_clock_rings(display) + local function load_clock_rings(display, data) + local str, value = "", 0 + str = string.format("${%s %s}", data["name"], data["arg"]) + str = conky_parse(str) + value = tonumber(str) + draw_clock_ring(display, data, value) + end + + for i in pairs(clock_h) do + load_clock_rings(display, clock_h[i]) + end + for i in pairs(clock_m) do + load_clock_rings(display, clock_m[i]) + end + for i in pairs(clock_s) do + load_clock_rings(display, clock_s[i]) + end +end + +------------------------------------------------------------------------------- +-- Loads data and Displays Gauges +-- +function go_gauge_rings(display) + local function load_gauge_rings(display, data) + local str, value = "", 0 + str = string.format("${%s %s}", data["name"], data["arg"]) + str = conky_parse(str) + value = tonumber(str) + draw_gauge_ring(display, data, value) + end + + for i in pairs(gauge) do + load_gauge_rings(display, gauge[i]) + end +end + +------------------------------------------------------------------------------- +-- MAIN +function conky_main() + if conky_window == nil then + return + end + + local cs = cairo_xlib_surface_create( + conky_window.display, + conky_window.drawable, + conky_window.visual, + conky_window.width, + conky_window.height + ) + local display = cairo_create(cs) + + local updates = conky_parse("${updates}") + update_num = tonumber(updates) + + if update_num > 5 then + go_clock_rings(display) + go_gauge_rings(display) + end + + cairo_surface_destroy(cs) + cairo_destroy(display) +end diff --git a/files/archive/Linux/Pop/conky/conkyrc b/files/archive/Linux/Pop/conky/conkyrc @@ -0,0 +1,80 @@ +## PopOS Conky Config + +conky.config = { + background = true, + update_interval = 0.5, + cpu_avg_samples = 2, + net_avg_samples = 2, + temperature_unit = 'celsius', + double_buffer = true, + no_buffers = true, + text_buffer_size = 2048, + gap_x = 1600, + gap_y = 100, + minimum_width = 250, + minimum_height = 750, + own_window = true, + own_window_class = 'desktop', + own_window_type = 'desktop', + own_window_argb_visual = true, + own_window_transparent = true, + own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below', + border_inner_margin = 0, + border_outer_margin = 0, + alignment = tr, + draw_shades = false, + draw_outline = false, + draw_borders = false, + draw_graph_borders = false, + override_utf8_locale = true, + use_xft= true, + font = 'caviar dreams:size=8', + xftalpha = 0.5, + uppercase = false, + default_color = '49B9C7', + color1 = 'DDDDDD', + color2 = 'AAAAAA', + color3 = '888888', + color4 = '666666', + lua_load = '~/.conky/conky_pop/conky.lua', + lua_draw_hook_post = 'main' +} + +conky.text = [[ +${voffset 35} +${goto 95}${color4}${font ubuntu:size=22}${time %e}${color1}${offset -50}${font ubuntu:size=10}${time %A} +${goto 85}${color2}${voffset -2}${font ubuntu:size=9}${time %b}${voffset -2} ${color3}${font ubuntu:size=12}${time %Y}${font} + +${voffset 80} +${goto 90}${font fira bold:size=7}${color}CPU +${goto 90}${font fira:size=7}${color1}${top name 1}${alignr}${top cpu 1}% +${goto 90}${font fira:size=7}${color2}${top name 2}${alignr}${top cpu 2}% +${goto 90}${font fira:size=7}${color3}${top name 3}${alignr}${top cpu 3}% +${goto 90}${cpugraph 10,100 666666 666666} +${goto 90}${voffset -10}${font fira:size=7}${color}${threads} process + +${voffset 20} +${goto 90}${font fira bold:size=7}${color}MEM +${goto 90}${font fira:size=7}${color1}${top_mem name 1}${alignr}${top_mem mem 1}% +${goto 90}${font fira:size=7}${color2}${top_mem name 2}${alignr}${top_mem mem 2}% +${goto 90}${font fira:size=7}${color3}${top_mem name 3}${alignr}${top_mem mem 3}% + +${voffset 25} +${goto 90}${font fira bold:size=7}${color}DISKS + +${goto 90}${diskiograph 30,100 666666 666666}${voffset -30} +${goto 90}${font fira:size=7}${color}used: ${fs_used /home} /home +${goto 90}${font fira:size=7}${color}used: ${fs_used /} / + +${voffset 10} +${goto 70}${font fira bold:size=18}${color3}NET${alignr}${color2}${font fira bold:size=7}${color1}${if_up eth0}eth ${addr eth0} ${endif}${if_up wlan0}wifi ${addr wlan0}${endif} +${goto 90}${font fira bold:size=7}${color}open ports: ${alignr}${color2}${tcp_portmon 1 65535 count} +${goto 90}${font fira bold:size=7}${color}${offset 10}IP${alignr}DPORT +${goto 90}${font fira:size=7}${color1}${tcp_portmon 1 65535 rip 0}${alignr 1}${tcp_portmon 1 65535 rport 0} +${goto 90}${font fira:size=7}${color1}${tcp_portmon 1 65535 rip 1}${alignr 1}${tcp_portmon 1 65535 rport 1} +${goto 90}${font fira:size=7}${color1}${tcp_portmon 1 65535 rip 2}${alignr 1}${tcp_portmon 1 65535 rport 2} +${goto 90}${font fira:size=7}${color1}${tcp_portmon 1 65535 rip 3}${alignr 1}${tcp_portmon 1 65535 rport 3} +${goto 90}${font fira:size=7}${color1}${tcp_portmon 1 65535 rip 4}${alignr 1}${tcp_portmon 1 65535 rport 4} +${goto 90}${font fira:size=7}${color1}${tcp_portmon 1 65535 rip 5}${alignr 1}${tcp_portmon 1 65535 rport 5} +${goto 90}${font fira:size=7}${color1}${tcp_portmon 1 65535 rip 6}${alignr 1}${tcp_portmon 1 65535 rport 6} +]] diff --git a/files/archive/Linux/Pop/neofetch/config.conf b/files/archive/Linux/Pop/neofetch/config.conf @@ -0,0 +1,54 @@ +## PopOS Neofetch Config + +print_info() { + prin "Software Information" + info " " distro + info " " kernel + info " " packages + info " " de + info " " theme + info " " icons + info " " term_font + + info underline + prin "Hardware Information" + info " " model + info " " cpu + info "﬙ " gpu + info " " disk + info " " resolution + info "⊗ " uptime + info battery + + info cols +} + +# Kernel +kernel_shorthand="off" + +# OS Architecture +os_arch="off" + +# Uptime +uptime_shorthand="tiny" + +# Memory Unit +memory_unit="gib" + +# Packages +package_managers="tiny" + +# Text Colors +colors=(4 3 3 3 3 6) + +# Info Display +cpu_display="off" +memory_display="off" +battery_display="barinfo" +disk_display="off" + +# Ascii Distro +ascii_distro="POP_OS" + +# Ascii Colors +ascii_colors=(6) diff --git a/files/archive/Linux/Pop/p10k.zsh b/files/archive/Linux/Pop/p10k.zsh @@ -0,0 +1,472 @@ +## PopOS P10k config + +() { + emulate -L zsh -o extended_glob + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' + + typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( + os_icon + context + dir + vcs + ) + typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( + status + background_jobs + direnv + asdf + virtualenv + anaconda + pyenv + goenv + nodenv + nvm + nodeenv + rbenv + rvm + fvm + luaenv + jenv + plenv + phpenv + scalaenv + haskell_stack + kubecontext + terraform + aws + aws_eb_env + azure + gcloud + google_app_cred + nordvpn + ranger + vim_shell + midnight_commander + nix_shell + vi_mode + ram + todo + timewarrior + taskwarrior + battery + command_execution_time + time + ) + + # Character Set + typeset -g POWERLEVEL9K_MODE=nerdfont-complete + typeset -g POWERLEVEL9K_ICON_PADDING=none + + # OS Icon + typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=232 + typeset -g POWERLEVEL9K_OS_ICON_BACKGROUND=7 + + # Prompt + typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT= + typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%242F╭─' + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%242F├─' + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%242F╰─' + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX='%242F─╮' + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX='%242F─┤' + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX='%242F─╯' + 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 + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242 + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' + typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' + fi + typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B1' + typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B3' + typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0' + typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2' + typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' + typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' + typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' + typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND= + typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 + typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' + typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE= + + # Directory + typeset -g POWERLEVEL9K_DIR_BACKGROUND=3 + typeset -g POWERLEVEL9K_DIR_FOREGROUND=0 + typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique + typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= + typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=250 + typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=0 + typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true + 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})" + typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false + typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 + typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 + typeset -g POWERLEVEL9K_DIR_HYPERLINK=false + typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v2 + + # VCS + typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' + typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' + + 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 + 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 + local where # branch or tag + if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then + res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}" + where=${(V)VCS_STATUS_LOCAL_BRANCH} + elif [[ -n $VCS_STATUS_TAG ]]; then + res+="${meta}#" + where=${(V)VCS_STATUS_TAG} + fi + (( $#where > 32 )) && where[13,-13]="…" + res+="${clean}${where//\%/%%}" # escape % + [[ -z $where ]] && res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" + if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then + res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" # escape % + fi + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" + (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" + (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" + [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" + (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" + (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" + (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" + (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" + (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" + + typeset -g my_git_format=$res + } + functions -M my_git_formatter 2>/dev/null + typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 + typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' + typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true + typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter()))+${my_git_format}}' + typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 + typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) + + # Status + typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true + typeset -g POWERLEVEL9K_STATUS_OK=true + typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' + typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=6 + typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND=0 + typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=6 + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0 + typeset -g POWERLEVEL9K_STATUS_ERROR=true + typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=6 + typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=0 + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true + typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=6 + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_BACKGROUND=0 + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=6 + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_BACKGROUND=0 + + # Execution Time + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=3 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=0 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' + + # Background Jobs + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false + + # asdf + typeset -g POWERLEVEL9K_ASDF_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_BACKGROUND=7 + typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true + typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= + typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUBY_BACKGROUND=1 + typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PYTHON_BACKGROUND=4 + typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_GOLANG_BACKGROUND=4 + typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_NODEJS_BACKGROUND=2 + typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_RUST_BACKGROUND=208 + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_BACKGROUND=5 + typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_FLUTTER_BACKGROUND=4 + typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_LUA_BACKGROUND=4 + typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=1 + typeset -g POWERLEVEL9K_ASDF_JAVA_BACKGROUND=7 + typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PERL_BACKGROUND=4 + typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ERLANG_BACKGROUND=1 + typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_ELIXIR_BACKGROUND=5 + typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_POSTGRES_BACKGROUND=6 + typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_PHP_BACKGROUND=5 + typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_HASKELL_BACKGROUND=3 + typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_JULIA_BACKGROUND=2 + + # NordVPN + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= + + + # Disk + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 + typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false + + # Vi + typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0 + typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL + typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2 + typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL + typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4 + typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE + typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3 + typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= + typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8 + + # RAM + typeset -g POWERLEVEL9K_RAM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RAM_BACKGROUND=3 + + # CPU Load + typeset -g POWERLEVEL9K_LOAD_WHICH=5 + + # ToDo + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false + + # Timewarrior + typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}' + + + # Context + typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=0 + typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=6 + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=0 + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=4 + typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=0 + typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=6 + typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n@%m' + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n ✠ %m' + typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n ✠ %m' + + # Python + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false + typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' + typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true + typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_PYENV_PYTHON_VERSION:#$P9K_CONTENT}:+ $P9K_PYENV_PYTHON_VERSION}' + + # Node + typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true + typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false + typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= + typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true + + # Go + typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true + typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true + + # Rust + typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true + + # .NET + typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true + + # Laravel + typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_LARAVEL_VERSION_BACKGROUND=7 + + # Ruby + typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true + + # RVM + typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false + typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false + + # Lua + typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true + + # Java + typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_JAVA_VERSION_BACKGROUND=7 + typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true + typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false + typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true + + # Perl + typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true + + # PHP + typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=0 + typeset -g POWERLEVEL9K_PHP_VERSION_BACKGROUND=5 + typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true + typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true + + # Scala + typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true + + # Haskell + typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) + typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true + + # Terraform + typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false + 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 + + # Kubecontext + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile' + 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_CONTENT_EXPANSION= + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + 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) + + # Azure + typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' + + # GCloud + typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' + typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' + 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_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' + + # VPN + typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun))[0-9]*' + typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false + + # IP + typeset -g POWERLEVEL9K_IP_BACKGROUND=4 + typeset -g POWERLEVEL9K_IP_FOREGROUND=0 + 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' + typeset -g POWERLEVEL9K_IP_INTERFACE='e.*' + + # Battery + typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 + typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1 + typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=0 + typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=0 + typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578' + typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false + typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=6 + + # Time + typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' + typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false + typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='' + + # Instant Prompt + typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off + typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose + typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true + (( ! $+functions[p10k] )) || p10k reload +} + +typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} +(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} +'builtin' 'unset' 'p10k_config_opts' diff --git a/files/archive/Windows/APPS.md b/files/archive/Windows/APPS.md @@ -0,0 +1,26 @@ +## Apps + +- Microsoft Office +- Microsoft Teams +- Firefox +- 7-Zip +- VLC Media Player +- CCleaner +- Recuva +- EaseUS Partition Master +- Rufus +- VirtualBox +- BlueJ +- Zoom +- PowerToys +- TaskbarX +- Rainmeter +- Printer Driver + +### UWP + +- Dashboard PDF +- Notepads +- iTunes +- Speedtest +- Terminal diff --git a/files/archive/Windows/Velociraptor.rmskin b/files/archive/Windows/Velociraptor.rmskin Binary files differ. diff --git a/files/ascii/groot b/files/ascii/groot @@ -0,0 +1,10 @@ +  \^V// +  |. .|  I AM (G)ROOT! + - \ - / _ +  \_| |_/ +  \ \ +  __/_/__ + |_______|  With Great Power Comes Great Responsibility +  \ /  Use it Wisely +  \___/ + diff --git a/files/ascii/lol b/files/ascii/lol @@ -0,0 +1,6 @@ +██╗░░░░░░█████╗░██╗░░░░░ +██║░░░░░██╔══██╗██║░░░░░ +██║░░░░░██║░░██║██║░░░░░ +██║░░░░░██║░░██║██║░░░░░ +███████╗╚█████╔╝███████╗ +╚══════╝░╚════╝░╚══════╝ +\ No newline at end of file diff --git a/files/ascii/pacman b/files/ascii/pacman @@ -0,0 +1,11 @@ +================================================. + .-. .-. .--. | + | OO| | OO| / _.-' .-. .-. .-. .''. | + | | | | \ '-. '-' '-' '-' '..' | + '^^^' '^^^' '--' | +===============. .-. .================. .-. | + | | | | | '-' | + | | | | | | + | ':-:' | | .-. | + | '-' | | '-' | +===============' '================' | +\ No newline at end of file diff --git a/files/ascii/tux b/files/ascii/tux @@ -0,0 +1,18 @@ + .-"""-. + ' \ + |,. ,-. | + |()L( ()| | + |,' `".| | + |.___.',| ` + .j `--"' ` `. + / ' ' \ + / / ` `. + / / ` . + / / l | + . , | | + ,"`. .| | + _.' ``. | `..-'l +| `.`, | `. +| `. __.j ) +|__ |--""___| ,-' + `"--...,+"""" `._,.-' +\ No newline at end of file diff --git a/files/default.nix b/files/default.nix @@ -0,0 +1,109 @@ +lib: let + inherit (lib.util) build map; + inherit (builtins) fromJSON readFile; +in rec { + ## Dotfiles ## + # File Paths + path = { + toplevel = ./.; + system = "/etc/nixos"; + cache = "maydayv7-dotfiles"; + flake = "github:maydayv7/dotfiles"; + repo = "https://github.com/maydayv7/dotfiles"; + }; + + # ASCII Art + ascii = map.files' ./ascii lib.id ""; + + # Discord Chat + discord = { + plugins = ./discord/plugins; + theme = readFile ./discord/theme.css; + }; + + # Neofetch + fetch = readFile ./neofetch/config.conf; + + # Firefox Web Browser + firefox.theme = readFile ./firefox/userContent.css; + + # Custom Fonts + fonts = { + path = ./fonts/proprietary; + config = readFile ./fonts/fontconfig.xml; + }; + + # X11 Gestures + gestures = readFile ./touchegg/touchegg.conf; + + # 'git' Version Control + git.hooks = ./git/hooks; + + # GNOME Desktop + gnome = { + accounts = readFile ./gnome/accounts.conf; + dconf = ./gnome/dconf.nix; + shell = readFile ./gnome/gnome-shell.css; + syntax = readFile ./gnome/nix.lang; + theme = readFile ./gnome/tango-dark.xml; + }; + + # GPG Keys Directory + gpg = "/etc/gpg"; + + # GTK+ Settings + gtk.bookmarks = readFile ./gtk/bookmarks; + + # Pictures + images = { + profile = ./images/Profile.png; + wallpapers = ./images/wallpapers; + }; + + # Persisted Files + persist = "/nix/state"; + + # Plank Dock + plank = { + autostart = readFile ./plank/dock.desktop; + launchers = ./plank/launchers; + theme = readFile ./plank/dock.theme; + }; + + # Nano Text Editor + nano = readFile ./nano/nanorc; + + # Interactive Nix Shell + repl = ../repl.nix; + + # Bash Scripts + scripts = map.files ../scripts build.script ".sh"; + + # 'sops' Encrypted Secrets + sops = ../secrets/.sops.yaml; + + # Document Templates + templates = ./templates; + + # Visual Studio Code Editor + vscode = map.files ./vscode (file: fromJSON (readFile file)) ".json"; + + # XDG Settings + xdg.mime = import ./xdg/mime.nix; + + # XFCE Desktop + xfce = { + css = readFile ./xfce/gtk.css; + settings = ./xfce/settings; + terminal = readFile ./xfce/terminalrc; + }; + + # My Personal Website + website = "TODO"; + + # XORG Display Server + xorg = readFile ./xorg/Xresources; + + # Z Shell + zsh.prompt = readFile ./zsh/p10k.zsh; +} diff --git a/files/discord/plugins/CreationDate.plugin.js b/files/discord/plugins/CreationDate.plugin.js @@ -0,0 +1,309 @@ +/** + * @name CreationDate + * @author DevilBro + * @authorId 278543574059057154 + * @version 1.4.6 + * @description Displays the Creation Date of an Account in the UserPopout and UserModal + * @invite Jx3TjNS + * @donate https://www.paypal.me/MircoWittrien + * @patreon https://www.patreon.com/MircoWittrien + * @website https://mwittrien.github.io/ + * @source https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/CreationDate/ + * @updateUrl https://mwittrien.github.io/BetterDiscordAddons/Plugins/CreationDate/CreationDate.plugin.js + */ + +module.exports = (_ => { + const config = { + "info": { + "name": "CreationDate", + "author": "DevilBro", + "version": "1.4.6", + "description": "Displays the Creation Date of an Account in the UserPopout and UserModal" + }, + "changeLog": { + "fixed": { + "User Popout": "Fixing Stuff for the User Popout Update, thanks Discord" + } + } + }; + + return (window.Lightcord && !Node.prototype.isPrototypeOf(window.Lightcord) || window.LightCord && !Node.prototype.isPrototypeOf(window.LightCord) || window.Astra && !Node.prototype.isPrototypeOf(window.Astra)) ? class { + getName () {return config.info.name;} + getAuthor () {return config.info.author;} + getVersion () {return config.info.version;} + getDescription () {return "Do not use LightCord!";} + load () {BdApi.alert("Attention!", "By using LightCord you are risking your Discord Account, due to using a 3rd Party Client. Switch to an official Discord Client (https://discord.com/) with the proper BD Injection (https://betterdiscord.app/)");} + start() {} + stop() {} + } : !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class { + getName () {return config.info.name;} + getAuthor () {return config.info.author;} + getVersion () {return config.info.version;} + getDescription () {return `The Library Plugin needed for ${config.info.name} is missing. Open the Plugin Settings to download it. \n\n${config.info.description}`;} + + downloadLibrary () { + require("request").get("https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js", (e, r, b) => { + if (!e && b && r.statusCode == 200) require("fs").writeFile(require("path").join(BdApi.Plugins.folder, "0BDFDB.plugin.js"), b, _ => BdApi.showToast("Finished downloading BDFDB Library", {type: "success"})); + else BdApi.alert("Error", "Could not download BDFDB Library Plugin. Try again later or download it manually from GitHub: https://mwittrien.github.io/downloader/?library"); + }); + } + + load () { + if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []}); + if (!window.BDFDB_Global.downloadModal) { + window.BDFDB_Global.downloadModal = true; + BdApi.showConfirmationModal("Library Missing", `The Library Plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, { + confirmText: "Download Now", + cancelText: "Cancel", + onCancel: _ => {delete window.BDFDB_Global.downloadModal;}, + onConfirm: _ => { + delete window.BDFDB_Global.downloadModal; + this.downloadLibrary(); + } + }); + } + if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name); + } + start () {this.load();} + stop () {} + getSettingsPanel () { + let template = document.createElement("template"); + template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The Library Plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`; + template.content.firstElementChild.querySelector("a").addEventListener("click", this.downloadLibrary); + return template.content.firstElementChild; + } + } : (([Plugin, BDFDB]) => { + return class CreationDate extends Plugin { + onLoad () { + this.defaults = { + general: { + displayText: {value: true, description: "Display '{{presuffix}}' in the Date"} + }, + places: { + userPopout: {value: true, description: "User Popouts"}, + userProfile: {value: true, description: "User Profile Modal"} + }, + dates: { + creationDate: {value: {}, description: "Creation Date"}, + } + }; + + this.patchedModules = { + after: { + UserPopoutInfo: "UserPopoutInfo", + UserProfileModalHeader: "default" + } + }; + + } + + onStart () { + BDFDB.PatchUtils.forceAllUpdates(this); + } + + onStop () { + BDFDB.PatchUtils.forceAllUpdates(this); + } + + getSettingsPanel (collapseStates = {}) { + let settingsPanel; + return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, { + collapseStates: collapseStates, + children: _ => { + let settingsItems = []; + + settingsItems.push(Object.keys(this.defaults.general).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { + type: "Switch", + plugin: this, + keys: ["general", key], + label: key == "displayText" ? this.defaults.general[key].description.replace("{{presuffix}}", this.labels.created_at.replace("{{time}}", "").trim()) : this.defaults.general[key].description, + value: this.settings.general[key] + }))); + + settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, { + className: BDFDB.disCN.marginbottom8 + })); + + settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsPanelList, { + title: "Add Date in:", + children: Object.keys(this.defaults.places).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { + type: "Switch", + plugin: this, + keys: ["places", key], + label: this.defaults.places[key].description, + value: this.settings.places[key] + })) + })); + + settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, { + className: BDFDB.disCN.marginbottom8 + })); + + settingsItems.push(Object.keys(this.defaults.dates).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.DateInput, Object.assign({}, this.settings.dates[key], { + label: this.defaults.dates[key].description, + prefix: _ => (this.settings.general.displayText && this.labels.created_at.split("{{time}}")[0] || "").trim(), + suffix: _ => (this.settings.general.displayText && this.labels.created_at.split("{{time}}")[1] || "").trim(), + onChange: valueObj => { + this.SettingsUpdated = true; + this.settings.dates[key] = valueObj; + BDFDB.DataUtils.save(this.settings.dates, this, "dates"); + } + })))); + + return settingsItems.flat(10); + } + }); + } + + onSettingsClosed () { + if (this.SettingsUpdated) { + delete this.SettingsUpdated; + BDFDB.PatchUtils.forceAllUpdates(this); + } + } + + processUserPopoutInfo (e) { + if (e.instance.props.user && this.settings.places.userPopout) { + let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["DiscordTag", "ColoredFluxTag"]}); + if (index > -1) this.injectDate(children, index + 1, e.instance.props.user); + } + } + + processUserProfileModalHeader (e) { + if (e.instance.props.user && this.settings.places.userProfile) { + let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["DiscordTag", "ColoredFluxTag"]}); + if (index > -1) this.injectDate(children, index + 1, e.instance.props.user); + } + } + + injectDate (children, index, user) { + let timestamp = BDFDB.LibraryComponents.DateInput.format(this.settings.dates.creationDate, user.createdAt); + children.splice(index, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextScroller, { + className: BDFDB.disCNS._creationdatedate + BDFDB.disCNS.userinfodate + BDFDB.disCN.textrow, + children: this.settings.general.displayText ? this.labels.created_at.replace("{{time}}", timestamp) : timestamp + })); + } + + setLabelsByLanguage () { + switch (BDFDB.LanguageUtils.getLanguage().id) { + case "bg": // Bulgarian + return { + created_at: "Създадено на {{time}}" + }; + case "cs": // Czech + return { + created_at: "Vytvořeno {{time}}" + }; + case "da": // Danish + return { + created_at: "Oprettet den {{time}}" + }; + case "de": // German + return { + created_at: "Erstellt am {{time}}" + }; + case "el": // Greek + return { + created_at: "Δημιουργήθηκε στις {{time}}" + }; + case "es": // Spanish + return { + created_at: "Creado el {{time}}" + }; + case "fi": // Finnish + return { + created_at: "Luotu {{time}}" + }; + case "fr": // French + return { + created_at: "Créé le {{time}}" + }; + case "hi": // Hindi + return { + created_at: "{{time}} को बनाया गया" + }; + case "hr": // Croatian + return { + created_at: "Izrađeno {{time}}" + }; + case "hu": // Hungarian + return { + created_at: "Létrehozva: {{time}}" + }; + case "it": // Italian + return { + created_at: "Creato il {{time}}" + }; + case "ja": // Japanese + return { + created_at: "{{time}}に作成" + }; + case "ko": // Korean + return { + created_at: "{{time}}에 생성됨" + }; + case "lt": // Lithuanian + return { + created_at: "Sukurta {{time}}" + }; + case "nl": // Dutch + return { + created_at: "Gemaakt op {{time}}" + }; + case "no": // Norwegian + return { + created_at: "Opprettet {{time}}" + }; + case "pl": // Polish + return { + created_at: "Utworzono {{time}}" + }; + case "pt-BR": // Portuguese (Brazil) + return { + created_at: "Criado em {{time}}" + }; + case "ro": // Romanian + return { + created_at: "Creat la {{time}}" + }; + case "ru": // Russian + return { + created_at: "Создано {{time}}" + }; + case "sv": // Swedish + return { + created_at: "Skapad {{time}}" + }; + case "th": // Thai + return { + created_at: "สร้างเมื่อ {{time}}" + }; + case "tr": // Turkish + return { + created_at: "{{time}} tarihinde oluşturuldu" + }; + case "uk": // Ukrainian + return { + created_at: "Створено {{time}}" + }; + case "vi": // Vietnamese + return { + created_at: "Được tạo vào {{time}}" + }; + case "zh-CN": // Chinese (China) + return { + created_at: "创建于{{time}}" + }; + case "zh-TW": // Chinese (Taiwan) + return { + created_at: "創建於{{time}}" + }; + default: // English + return { + created_at: "Created on {{time}}" + }; + } + } + }; + })(window.BDFDB_Global.PluginUtils.buildPlugin(config)); +})(); +\ No newline at end of file diff --git a/files/discord/plugins/ShowHiddenChannels.plugin.js b/files/discord/plugins/ShowHiddenChannels.plugin.js @@ -0,0 +1,987 @@ +/** + * @name ShowHiddenChannels + * @author DevilBro + * @authorId 278543574059057154 + * @version 3.0.6 + * @description Displays all hidden Channels, which can't be accessed due to Role Restrictions, this won't allow you to read them (impossible) + * @invite Jx3TjNS + * @donate https://www.paypal.me/MircoWittrien + * @patreon https://www.patreon.com/MircoWittrien + * @website https://mwittrien.github.io/ + * @source https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/ShowHiddenChannels/ + * @updateUrl https://mwittrien.github.io/BetterDiscordAddons/Plugins/ShowHiddenChannels/ShowHiddenChannels.plugin.js + */ + +module.exports = (_ => { + const config = { + "info": { + "name": "ShowHiddenChannels", + "author": "DevilBro", + "version": "3.0.6", + "description": "Displays all hidden Channels, which can't be accessed due to Role Restrictions, this won't allow you to read them (impossible)" + }, + "changeLog": { + "fixed": { + "Permissions Tabs": "Fixed Issue, where Users that are specifically allowed/denied weren't listed in the tabs" + } + } + }; + + return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class { + getName () {return config.info.name;} + getAuthor () {return config.info.author;} + getVersion () {return config.info.version;} + getDescription () {return `The Library Plugin needed for ${config.info.name} is missing. Open the Plugin Settings to download it. \n\n${config.info.description}`;} + + downloadLibrary () { + require("request").get("https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js", (e, r, b) => { + if (!e && b && r.statusCode == 200) require("fs").writeFile(require("path").join(BdApi.Plugins.folder, "0BDFDB.plugin.js"), b, _ => BdApi.showToast("Finished downloading BDFDB Library", {type: "success"})); + else BdApi.alert("Error", "Could not download BDFDB Library Plugin. Try again later or download it manually from GitHub: https://mwittrien.github.io/downloader/?library"); + }); + } + + load () { + if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []}); + if (!window.BDFDB_Global.downloadModal) { + window.BDFDB_Global.downloadModal = true; + BdApi.showConfirmationModal("Library Missing", `The Library Plugin needed for ${config.info.name} is missing. Please click "Download Now" to install it.`, { + confirmText: "Download Now", + cancelText: "Cancel", + onCancel: _ => {delete window.BDFDB_Global.downloadModal;}, + onConfirm: _ => { + delete window.BDFDB_Global.downloadModal; + this.downloadLibrary(); + } + }); + } + if (!window.BDFDB_Global.pluginQueue.includes(config.info.name)) window.BDFDB_Global.pluginQueue.push(config.info.name); + } + start () {this.load();} + stop () {} + getSettingsPanel () { + let template = document.createElement("template"); + template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The Library Plugin needed for ${config.info.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`; + template.content.firstElementChild.querySelector("a").addEventListener("click", this.downloadLibrary); + return template.content.firstElementChild; + } + } : (([Plugin, BDFDB]) => { + var blackList = [], collapseList = [], hiddenCategory, lastGuildId, overrideTypes = []; + var hiddenChannelCache = {}; + var accessModal; + + const channelGroupMap = { + GUILD_TEXT: "SELECTABLE", + GUILD_VOICE: "VOCAL", + GUILD_ANNOUNCEMENT: "SELECTABLE", + GUILD_STORE: "SELECTABLE", + }; + + const typeNameMap = { + GUILD_TEXT: "TEXT_CHANNEL", + GUILD_VOICE: "VOICE_CHANNEL", + GUILD_ANNOUNCEMENT: "NEWS_CHANNEL", + GUILD_STORE: "STORE_CHANNEL", + GUILD_CATEGORY: "CATEGORY", + GUILD_STAGE_VOICE: "STAGE_CHANNEL", + PUBLIC_THREAD: "THREAD", + PRIVATE_THREAD: "PRIVATE_THREAD" + }; + + const sortOrders = { + NATIVE: {value: "native", label: "Native Category in correct Order"}, + BOTTOM: {value: "bottom", label: "Native Category at the bottom"}, + EXTRA: {value: "extra", label: "Extra Category 'Hidden'"} + }; + + const UserRowComponent = class UserRow extends BdApi.React.Component { + componentDidMount() { + if (this.props.user.fetchable) { + this.props.user.fetchable = false; + BDFDB.LibraryModules.UserProfileUtils.getUser(this.props.user.id).then(fetchedUser => { + this.props.user = Object.assign({}, fetchedUser, BDFDB.LibraryModules.MemberStore.getMember(this.props.guildId, this.props.user.id) || {}); + BDFDB.ReactUtils.forceUpdate(this); + }); + } + } + render() { + return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ListRow, { + prefix: BDFDB.ReactUtils.createElement("div", { + className: BDFDB.disCN.listavatar, + children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AvatarComponents.default, { + src: BDFDB.UserUtils.getAvatar(this.props.user.id), + status: BDFDB.UserUtils.getStatus(this.props.user.id), + size: BDFDB.LibraryComponents.AvatarComponents.Sizes.SIZE_40, + onClick: _ => { + if (accessModal) accessModal.props.onClose(); + BDFDB.LibraryModules.UserProfileModalUtils.openUserProfileModal({ + userId: this.props.user.id, + guildId: this.props.guildId + }); + } + }) + }), + labelClassName: BDFDB.disCN.nametag, + label: [ + BDFDB.ReactUtils.createElement("span", { + className: BDFDB.disCN.username, + children: this.props.user.nick || this.props.user.username, + style: {color: this.props.user.colorString} + }), + !this.props.user.discriminator ? null : BDFDB.ReactUtils.createElement("span", { + className: BDFDB.disCN.listdiscriminator, + children: `#${this.props.user.discriminator}` + }), + this.props.user.bot && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.BotTag, { + style: {marginLeft: 6} + }) + ] + }); + } + }; + + const RoleRowComponent = class RoleRow extends BdApi.React.Component { + render() { + return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ListRow, { + prefix: BDFDB.ReactUtils.createElement("div", { + className: BDFDB.disCNS.avataricon + BDFDB.disCNS.listavatar + BDFDB.disCNS.avatariconsizemedium + BDFDB.disCN.avatariconinactive, + style: { + boxSizing: "border-box", + padding: 10 + }, + children: BDFDB.ReactUtils.createElement("div", { + style: { + borderRadius: "50%", + height: "100%", + width: "100%", + backgroundColor: BDFDB.ColorUtils.convert(this.props.role.colorString, "RGB") || BDFDB.DiscordConstants.Colors.PRIMARY_DARK_300 + } + }) + }), + labelClassName: this.props.role.overwritten && BDFDB.disCN.strikethrough, + label: BDFDB.ReactUtils.createElement("span", { + children: this.props.role.name, + style: {color: this.props.role.colorString} + }) + }); + } + }; + + return class ShowHiddenChannels extends Plugin { + onLoad () { + overrideTypes = Object.keys(BDFDB.DiscordConstants.PermissionOverrideType); + + this.defaults = { + sortOrder: { + hidden: { + value: sortOrders[Object.keys(sortOrders)[0]].value, + description: "Sorts hidden Channels in", + options: Object.keys(sortOrders).map(n => sortOrders[n]) + } + }, + general: { + alwaysCollapse: {value: false, description: "Always collapse 'Hidden' Category after switching Servers"}, + showVoiceUsers: {value: true, description: "Show connected Users in hidden Voice Channels"}, + showForNormal: {value: true, description: "Add Access-Overview ContextMenu Entry for non-hidden Channels"} + }, + channels: { + GUILD_TEXT: {value: true}, + GUILD_VOICE: {value: true}, + GUILD_ANNOUNCEMENT: {value: true}, + GUILD_STORE: {value: true}, + GUILD_STAGE_VOICE: {value: true} + } + }; + + this.patchedModules = { + before: { + Channels: "render", + ChannelCategoryItem: "type", + ChannelItem: "default", + VoiceUsers: "render" + }, + after: { + ChannelItem: "default" + } + }; + + this.css = ` + ${BDFDB.dotCNS._showhiddenchannelsaccessmodal + BDFDB.dotCN.messagespopoutemptyplaceholder} { + position: absolute; + bottom: 0; + width: 100%; + } + `; + } + + onStart () { + let loadedBlackList = BDFDB.DataUtils.load(this, "blacklist"); + this.saveBlackList(!BDFDB.ArrayUtils.is(loadedBlackList) ? [] : loadedBlackList); + + let loadedCollapseList = BDFDB.DataUtils.load(this, "categorydata"); + this.saveCollapseList(!BDFDB.ArrayUtils.is(loadedCollapseList) ? [] : loadedCollapseList); + + BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.UnreadChannelUtils, "hasUnread", {after: e => { + return e.returnValue && !this.isChannelHidden(e.methodArguments[0]); + }}); + + BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.UnreadChannelUtils, "getMentionCount", {after: e => { + return this.isChannelHidden(e.methodArguments[0]) ? 0 : e.returnValue; + }}); + + BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.CategoryCollapseStore, "isCollapsed", {after: e => { + if (e.methodArguments[0] && e.methodArguments[0].endsWith("hidden")) { + if (this.settings.general.alwaysCollapse && e.methodArguments[0] != lastGuildId && !collapseList.includes(e.methodArguments[0])) { + collapseList.push(e.methodArguments[0]); + this.saveCollapseList(BDFDB.ArrayUtils.removeCopies(collapseList)); + } + lastGuildId = e.methodArguments[0]; + return collapseList.includes(e.methodArguments[0]); + } + }}); + + BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.CategoryCollapseUtils, "categoryCollapse", {before: e => { + if (e.methodArguments[0] && e.methodArguments[0].endsWith("hidden")) { + if (!collapseList.includes(e.methodArguments[0])) { + collapseList.push(e.methodArguments[0]); + this.saveCollapseList(BDFDB.ArrayUtils.removeCopies(collapseList)); + } + } + }}); + + BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.CategoryCollapseUtils, "categoryExpand", {before: e => { + if (e.methodArguments[0] && e.methodArguments[0].endsWith("hidden")) { + if (collapseList.includes(e.methodArguments[0])) { + BDFDB.ArrayUtils.remove(collapseList, e.methodArguments[0], true); + this.saveCollapseList(BDFDB.ArrayUtils.removeCopies(collapseList)); + } + } + }}); + + BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.GuildChannelStore, "getTextChannelNameDisambiguations", {after: e => { + let all = this.getAllChannels(); + for (let channel_id in all) if (all[channel_id].guild_id == e.methodArguments[0] && !e.returnValue[channel_id] && (all[channel_id].type != BDFDB.DiscordConstants.ChannelTypes.GUILD_CATEGORY && all[channel_id].type != BDFDB.DiscordConstants.ChannelTypes.GUILD_VOICE)) e.returnValue[channel_id] = {id: channel_id, name: all[channel_id].name}; + }}); + + BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.ChannelIconUtils, "getChannelIconComponent", {before: e => { + if (e.methodArguments[2] && e.methodArguments[2].locked && e.methodArguments[0] && this.isChannelHidden(e.methodArguments[0].id)) e.methodArguments[2].locked = false; + }}); + + this.forceUpdateAll(); + } + + onStop () { + this.forceUpdateAll(); + } + + getSettingsPanel (collapseStates = {}) { + let settingsPanel; + return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, { + collapseStates: collapseStates, + children: _ => { + let settingsItems = []; + + for (let key in this.defaults.selections) settingsItems.push(); + + settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CollapseContainer, { + title: "Settings", + collapseStates: collapseStates, + children: Object.keys(this.defaults.sortOrder).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { + type: "Select", + plugin: this, + keys: ["sortOrder", key], + label: this.defaults.sortOrder[key].description, + basis: "50%", + options: this.defaults.sortOrder[key].options, + value: this.settings.sortOrder[key] + })).concat(Object.keys(this.defaults.general).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { + type: "Switch", + plugin: this, + keys: ["general", key], + label: this.defaults.general[key].description, + value: this.settings.general[key] + }))).concat(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsPanelList, { + title: "Show Channels:", + children: Object.keys(this.defaults.channels).map(key => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, { + type: "Switch", + plugin: this, + keys: ["channels", key], + label: BDFDB.LanguageUtils.LanguageStrings[typeNameMap[key]], + value: this.settings.channels[key] + })) + })) + })); + + settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CollapseContainer, { + title: "Server Black List", + collapseStates: collapseStates, + children: [ + BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsGuildList, { + className: BDFDB.disCN.marginbottom20, + disabled: blackList, + onClick: disabledGuilds => this.saveBlackList(disabledGuilds) + }), + BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsItem, { + type: "Button", + color: BDFDB.LibraryComponents.Button.Colors.GREEN, + label: "Enable for all Servers", + onClick: _ => this.batchSetGuilds(settingsPanel, collapseStates, true), + children: BDFDB.LanguageUtils.LanguageStrings.ENABLE + }), + BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsItem, { + type: "Button", + color: BDFDB.LibraryComponents.Button.Colors.PRIMARY, + label: "Disable for all Servers", + onClick: _ => this.batchSetGuilds(settingsPanel, collapseStates, false), + children: BDFDB.LanguageUtils.LanguageStrings.DISABLE + }) + ] + })); + + return settingsItems; + } + }); + } + + onSettingsClosed () { + if (this.SettingsUpdated) { + delete this.SettingsUpdated; + this.forceUpdateAll(); + } + } + + forceUpdateAll () { + hiddenChannelCache = {}; + + BDFDB.PatchUtils.forceAllUpdates(this); + BDFDB.ChannelUtils.rerenderAll(); + } + + onChannelContextMenu (e) { + if (e.instance.props.channel) { + if (e.instance.props.channel.id.endsWith("hidden") && e.instance.props.channel.type == BDFDB.DiscordConstants.ChannelTypes.GUILD_CATEGORY) { + let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "ChannelMuteItem"}); + if (index > -1) children.splice(index, 1); + [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "mark-channel-read", group: true}); + children.splice(index > -1 ? index + 1 : 0, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, { + children: BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { + label: this.labels.context_changeorder, + id: BDFDB.ContextMenuUtils.createItemId(this.name, "change_order"), + children: Object.keys(sortOrders).filter(n => sortOrders[n].value != sortOrders.EXTRA.value).map(n => BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, { + children: BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { + label: this.labels["context_changeorder_" + sortOrders[n].value], + id: BDFDB.ContextMenuUtils.createItemId(this.name, "change_order", sortOrders[n].value), + action: _ => { + this.settings.sortOrder.hidden = sortOrders[n].value; + BDFDB.DataUtils.save(this.settings.sortOrder, this, "sortOrder"); + this.forceUpdateAll(); + } + }) + })) + }) + })); + } + let isHidden = this.isChannelHidden(e.instance.props.channel.id); + if (isHidden || this.settings.general.showForNormal) { + let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "mark-channel-read", group: true}); + children.splice(index > -1 ? index + 1 : 0, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, { + children: BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { + label: this.labels.context_channelaccess, + id: BDFDB.ContextMenuUtils.createItemId(this.name, "permissions"), + action: _ => this.openAccessModal(e.instance.props.channel, !isHidden) + }) + })); + } + } + } + + onGuildContextMenu (e) { + if (e.instance.props.guild) { + let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "hide-muted-channels"}); + if (index > -1) children.splice(index + 1, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuCheckboxItem, { + label: this.labels.context_hidehidden, + id: BDFDB.ContextMenuUtils.createItemId(this.name, "hide-locked-channels"), + checked: blackList.includes(e.instance.props.guild.id), + action: value => { + if (value) blackList.push(e.instance.props.guild.id); + else BDFDB.ArrayUtils.remove(blackList, e.instance.props.guild.id, true); + this.saveBlackList(BDFDB.ArrayUtils.removeCopies(blackList)); + + BDFDB.PatchUtils.forceAllUpdates(this); + BDFDB.ChannelUtils.rerenderAll(true); + } + })); + } + } + + onGuildHeaderContextMenu (e) { + this.onGuildContextMenu(e); + } + + processChannels (e) { + if (!e.instance.props.guild || blackList.includes(e.instance.props.guild.id)) return; + let [hiddenChannels, amount] = this.getHiddenChannels(e.instance.props.guild); + if (amount) { + e.instance.props.categories = Object.assign({}, e.instance.props.categories); + for (let catId in e.instance.props.categories) e.instance.props.categories[catId] = [].concat(e.instance.props.categories[catId]); + e.instance.props.channels = Object.assign({}, e.instance.props.channels); + for (let type in e.instance.props.channels) e.instance.props.channels[type] = [].concat(e.instance.props.channels[type]); + + let hiddenId = e.instance.props.guild.id + "_hidden"; + + delete e.instance.props.categories[hiddenId]; + e.instance.props.categories._categories = e.instance.props.categories._categories.filter(n => n.channel.id != hiddenId); + e.instance.props.channels[BDFDB.DiscordConstants.ChannelTypes.GUILD_CATEGORY] = e.instance.props.channels[BDFDB.DiscordConstants.ChannelTypes.GUILD_CATEGORY].filter(n => n.channel.id != hiddenId); + + let index = -1; + for (let catId in e.instance.props.categories) { + if (catId != "_categories") e.instance.props.categories[catId] = e.instance.props.categories[catId].filter(n => !this.isChannelHidden(n.channel.id)); + for (let channelObj of e.instance.props.categories[catId]) if (channelObj.index > index) index = parseInt(channelObj.index); + } + if (this.settings.sortOrder.hidden == sortOrders.EXTRA.value) { + hiddenCategory = new BDFDB.DiscordObjects.Channel({ + guild_id: e.instance.props.guild.id, + id: hiddenId, + name: "hidden", + type: BDFDB.DiscordConstants.ChannelTypes.GUILD_CATEGORY + }); + e.instance.props.categories[hiddenId] = []; + e.instance.props.categories._categories.push({ + channel: hiddenCategory, + index: ++index + }); + e.instance.props.channels[BDFDB.DiscordConstants.ChannelTypes.GUILD_CATEGORY].push({ + comparator: (e.instance.props.channels[BDFDB.DiscordConstants.ChannelTypes.GUILD_CATEGORY][e.instance.props.channels[BDFDB.DiscordConstants.ChannelTypes.GUILD_CATEGORY].length - 1] || {comparator: 0}).comparator + 1, + channel: hiddenCategory + }); + } + else hiddenCategory = null; + + for (let type in hiddenChannels) { + let channelType = channelGroupMap[BDFDB.DiscordConstants.ChannelTypes[type]] || type; + if (!BDFDB.ArrayUtils.is(e.instance.props.channels[channelType])) e.instance.props.channels[channelType] = []; + for (let channel of hiddenChannels[type]) { + let hiddenChannel = new BDFDB.DiscordObjects.Channel(Object.assign({}, channel, { + parent_id: hiddenCategory ? hiddenId : channel.parent_id, + position: this.settings.sortOrder.hidden == sortOrders.BOTTOM.value ? 999999999 : channel.position + })); + let parent_id = hiddenChannel.parent_id || "null"; + e.instance.props.categories[parent_id].push({ + channel: hiddenChannel, + index: hiddenChannel.position + }); + e.instance.props.channels[channelType].push({ + comparator: hiddenChannel.position, + channel: hiddenChannel + }); + } + } + + for (let parent_id in e.instance.props.categories) BDFDB.ArrayUtils.keySort(e.instance.props.categories[parent_id], "index"); + for (let channelType in e.instance.props.channels) BDFDB.ArrayUtils.keySort(e.instance.props.channels[channelType], "comparator"); + } + } + + processChannelCategoryItem (e) { + if (hiddenCategory && e.instance.props.channel && !e.instance.props.channel.id && e.instance.props.channel.type != BDFDB.DiscordConstants.ChannelTypes.GUILD_CATEGORY) e.instance.props.channel = hiddenCategory; + } + + processChannelItem (e) { + if (e.instance.props.channel && !blackList.includes(e.instance.props.channel.guild_id) && this.isChannelHidden(e.instance.props.channel.id)) { + if (!e.returnvalue) e.instance.props.className = BDFDB.DOMUtils.formatClassName(e.instance.props.className, BDFDB.disCN._showhiddenchannelshiddenchannel); + else { + let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "ChannelItemIcon"}); + let channelChildren = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelchildren]]}); + if (channelChildren && channelChildren.props && channelChildren.props.children) { + channelChildren.props.children = [BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, { + text: BDFDB.LanguageUtils.LanguageStrings.CHANNEL_LOCKED_SHORT, + children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, { + className: BDFDB.disCN.channeliconitem, + style: {display: "block"}, + children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, { + className: BDFDB.disCN.channelactionicon, + name: BDFDB.LibraryComponents.SvgIcon.Names.LOCK_CLOSED + }) + }) + })]; + } + if (!(e.instance.props.channel.type == BDFDB.DiscordConstants.ChannelTypes.GUILD_VOICE && e.instance.props.connected)) { + let wrapper = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelwrapper]]}); + if (wrapper) { + wrapper.props.onMouseDown = _ => {}; + wrapper.props.onMouseUp = _ => {}; + } + let mainContent = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelmaincontent]]}); + if (mainContent) { + mainContent.props.onClick = _ => {}; + mainContent.props.href = null; + } + } + } + } + } + + processVoiceUsers (e) { + if (!this.settings.general.showVoiceUsers && this.isChannelHidden(e.instance.props.channel.id)) e.instance.props.voiceStates = []; + } + + isChannelHidden (channelId) { + let channel = BDFDB.LibraryModules.ChannelStore.getChannel(channelId); + return channel && hiddenChannelCache[channel.guild_id] && hiddenChannelCache[channel.guild_id].hidden[channel.type] && hiddenChannelCache[channel.guild_id].hidden[channel.type].find(c => c.id == channel.id); + } + + getAllChannels () { + return (BDFDB.LibraryModules.ChannelStore.getGuildChannels || BDFDB.LibraryModules.ChannelStore.getMutableGuildChannels || (_ => ({})))(); + } + + getHiddenChannels (guild) { + if (!guild) return [{}, 0]; + let hiddenChannels = {}, visibleAmount = (BDFDB.LibraryModules.GuildChannelStore.getChannels(guild.id) || {count: 0}),count, rolesAmount = (BDFDB.LibraryModules.MemberStore.getMember(guild.id, BDFDB.UserUtils.me.id) || {roles: []}).roles.length; + if (!hiddenChannelCache[guild.id] || hiddenChannelCache[guild.id].visible != visibleAmount || hiddenChannelCache[guild.id].roles != rolesAmount) { + let all = this.getAllChannels(); + for (let type in BDFDB.DiscordConstants.ChannelTypes) hiddenChannels[BDFDB.DiscordConstants.ChannelTypes[type]] = []; + for (let channel_id in all) { + let channel = all[channel_id]; + if (channel.guild_id == guild.id && channel.type != BDFDB.DiscordConstants.ChannelTypes.GUILD_CATEGORY && (this.settings.channels[BDFDB.DiscordConstants.ChannelTypes[channel.type]] || this.settings.channels[BDFDB.DiscordConstants.ChannelTypes[channel.type]] === undefined) && !BDFDB.DMUtils.isDMChannel(channel.id) && !BDFDB.UserUtils.can("VIEW_CHANNEL", BDFDB.UserUtils.me.id, channel.id)) hiddenChannels[channel.type].push(channel); + } + } + else hiddenChannels = hiddenChannelCache[guild.id].hidden; + for (let type in hiddenChannels) hiddenChannels[type] = hiddenChannels[type].filter(c => BDFDB.LibraryModules.ChannelStore.getChannel(c.id)); + hiddenChannelCache[guild.id] = {hidden: hiddenChannels, amount: BDFDB.ObjectUtils.toArray(hiddenChannels).flat().length, visible: visibleAmount, roles: rolesAmount}; + return [hiddenChannelCache[guild.id].hidden, hiddenChannelCache[guild.id].amount]; + } + + batchSetGuilds (settingsPanel, collapseStates, value) { + if (!value) { + for (let id of BDFDB.LibraryModules.FolderStore.getFlattenedGuildIds()) blackList.push(id); + this.saveBlackList(BDFDB.ArrayUtils.removeCopies(blackList)); + } + else this.saveBlackList([]); + BDFDB.PluginUtils.refreshSettingsPanel(this, settingsPanel, collapseStates); + } + + saveBlackList (savedBlackList) { + blackList = savedBlackList; + BDFDB.DataUtils.save(savedBlackList, this, "blacklist"); + } + + saveCollapseList (savedCollapseList) { + collapseList = savedCollapseList; + BDFDB.DataUtils.save(savedCollapseList, this, "categorydata"); + } + + openAccessModal (channel, allowed) { + let isThread = BDFDB.ChannelUtils.isThread(channel); + let guild = BDFDB.LibraryModules.GuildStore.getGuild(channel.guild_id); + let myMember = guild && BDFDB.LibraryModules.MemberStore.getMember(guild.id, BDFDB.UserUtils.me.id); + + let parentChannel = isThread && BDFDB.LibraryModules.ChannelStore.getChannel(BDFDB.LibraryModules.ChannelStore.getChannel(channel.id).parent_id); + let category = parentChannel && parentChannel.parent_id && BDFDB.LibraryModules.ChannelStore.getChannel(parentChannel.parent_id) || BDFDB.LibraryModules.ChannelStore.getChannel(BDFDB.LibraryModules.ChannelStore.getChannel(channel.id).parent_id); + + let lightTheme = BDFDB.DiscordUtils.getTheme() == BDFDB.disCN.themelight; + + let addUser = (id, users) => { + let user = BDFDB.LibraryModules.UserStore.getUser(id); + if (user) users.push(Object.assign({}, user, BDFDB.LibraryModules.MemberStore.getMember(guild.id, id) || {})); + else users.push({id: id, username: `UserId: ${id}`, fetchable: true}); + }; + let checkAllowPerm = permString => { + return (permString | BDFDB.DiscordConstants.Permissions.VIEW_CHANNEL) == permString && (channel.type != BDFDB.DiscordConstants.ChannelTypes.GUILD_VOICE || (permString | BDFDB.DiscordConstants.Permissions.CONNECT) == permString); + }; + let checkDenyPerm = permString => { + return (permString | BDFDB.DiscordConstants.Permissions.VIEW_CHANNEL) == permString || (channel.type == BDFDB.DiscordConstants.ChannelTypes.GUILD_VOICE && (permString | BDFDB.DiscordConstants.Permissions.CONNECT) == permString); + }; + + let allowedRoles = [], allowedUsers = [], deniedRoles = [], deniedUsers = [], everyoneDenied = false; + for (let id in channel.permissionOverwrites) { + if ((channel.permissionOverwrites[id].type == BDFDB.DiscordConstants.PermissionOverrideType.ROLE || overrideTypes[channel.permissionOverwrites[id].type] == BDFDB.DiscordConstants.PermissionOverrideType.ROLE) && (guild.roles[id] && guild.roles[id].name != "@everyone") && checkAllowPerm(channel.permissionOverwrites[id].allow)) { + allowedRoles.push(Object.assign({overwritten: myMember && myMember.roles.includes(id) && !allowed}, guild.roles[id])); + } + else if ((channel.permissionOverwrites[id].type == BDFDB.DiscordConstants.PermissionOverrideType.MEMBER || overrideTypes[channel.permissionOverwrites[id].type] == BDFDB.DiscordConstants.PermissionOverrideType.MEMBER) && checkAllowPerm(channel.permissionOverwrites[id].allow)) { + addUser(id, allowedUsers); + } + if ((channel.permissionOverwrites[id].type == BDFDB.DiscordConstants.PermissionOverrideType.ROLE || overrideTypes[channel.permissionOverwrites[id].type] == BDFDB.DiscordConstants.PermissionOverrideType.ROLE) && checkDenyPerm(channel.permissionOverwrites[id].deny)) { + deniedRoles.push(guild.roles[id]); + if (guild.roles[id] && guild.roles[id].name == "@everyone") everyoneDenied = true; + } + else if ((channel.permissionOverwrites[id].type == BDFDB.DiscordConstants.PermissionOverrideType.MEMBER || overrideTypes[channel.permissionOverwrites[id].type] == BDFDB.DiscordConstants.PermissionOverrideType.MEMBER) && checkDenyPerm(channel.permissionOverwrites[id].deny)) { + addUser(id, deniedUsers); + } + } + + if (![].concat(allowedUsers, deniedUsers).find(user => user.id == guild.ownerId)) addUser(guild.ownerId, allowedUsers); + for (let id in guild.roles) if ((guild.roles[id].permissions | BDFDB.DiscordConstants.Permissions.ADMINISTRATOR) == guild.roles[id].permissions && ![].concat(allowedRoles, deniedRoles).find(role => role.id == id)) allowedRoles.push(Object.assign({overwritten: myMember && myMember.roles.includes(id) && !allowed}, guild.roles[id])); + if (allowed && !everyoneDenied) allowedRoles.push({name: "@everyone"}); + + let allowedElements = [], deniedElements = []; + for (let role of allowedRoles) allowedElements.push(BDFDB.ReactUtils.createElement(RoleRowComponent, {role: role, guildId: guild.id, channelId: channel.id})); + for (let user of allowedUsers) allowedElements.push(BDFDB.ReactUtils.createElement(UserRowComponent, {user: user, guildId: guild.id, channelId: channel.id})); + for (let role of deniedRoles) deniedElements.push(BDFDB.ReactUtils.createElement(RoleRowComponent, {role: role, guildId: guild.id, channelId: channel.id})); + for (let user of deniedUsers) deniedElements.push(BDFDB.ReactUtils.createElement(UserRowComponent, {user: user, guildId: guild.id, channelId: channel.id})); + + const infoStrings = [ + isThread && { + title: BDFDB.LanguageUtils.LanguageStrings.THREAD_NAME, + text: channel.name + }, !isThread && { + title: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_CHANNEL_NAME, + text: channel.name + }, channel.type == BDFDB.DiscordConstants.ChannelTypes.GUILD_VOICE ? { + title: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_BITRATE, + text: channel.bitrate || "---" + } : { + title: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_CHANNEL_TOPIC, + text: BDFDB.ReactUtils.markdownParse(channel.topic || "---") + }, { + title: BDFDB.LanguageUtils.LanguageStrings.CHANNEL_TYPE, + text: BDFDB.LanguageUtils.LanguageStrings[typeNameMap[BDFDB.DiscordConstants.ChannelTypes[channel.type]]] + }, isThread && parentChannel && { + title: BDFDB.LanguageUtils.LanguageStrings.FORM_LABEL_CHANNEL_NAME, + text: parentChannel.name + }, { + title: BDFDB.LanguageUtils.LanguageStrings.CATEGORY_NAME, + text: category && category.name || BDFDB.LanguageUtils.LanguageStrings.NO_CATEGORY + } + ].map((formLabel, i) => formLabel && [ + i == 0 ? null : BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormDivider, { + className: BDFDB.disCN.marginbottom20 + }), + BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormItem, { + title: `${formLabel.title}:`, + className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.marginbottom20, i == 0 && BDFDB.disCN.margintop8), + children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.FormComponents.FormText, { + className: BDFDB.disCN.marginleft8, + children: formLabel.text + }) + }) + ]).flat(10).filter(n => n); + + BDFDB.ModalUtils.open(this, { + size: "MEDIUM", + header: BDFDB.LanguageUtils.LanguageStrings.CHANNEL + " " + BDFDB.LanguageUtils.LanguageStrings.ACCESSIBILITY, + subHeader: "#" + channel.name, + className: BDFDB.disCN._showhiddenchannelsaccessmodal, + contentClassName: BDFDB.DOMUtils.formatClassName(!isThread && BDFDB.disCN.listscroller), + onOpen: modalInstance => {if (modalInstance) accessModal = modalInstance;}, + children: isThread ? infoStrings : [ + BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ModalComponents.ModalTabContent, { + className: BDFDB.disCN.modalsubinner, + tab: BDFDB.LanguageUtils.LanguageStrings.OVERLAY_SETTINGS_GENERAL_TAB, + children: infoStrings + }), + BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ModalComponents.ModalTabContent, { + tab: this.labels.modal_allowed, + children: allowedElements.length ? allowedElements : + BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MessagesPopoutComponents.EmptyStateBottom, { + msg: BDFDB.LanguageUtils.LanguageStrings.AUTOCOMPLETE_NO_RESULTS_HEADER, + image: lightTheme ? "/assets/9b0d90147f7fab54f00dd193fe7f85cd.svg" : "/assets/308e587f3a68412f137f7317206e92c2.svg" + }) + }), + BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ModalComponents.ModalTabContent, { + tab: this.labels.modal_denied, + children: deniedElements.length ? deniedElements : + BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MessagesPopoutComponents.EmptyStateBottom, { + msg: BDFDB.LanguageUtils.LanguageStrings.AUTOCOMPLETE_NO_RESULTS_HEADER, + image: lightTheme ? "/assets/9b0d90147f7fab54f00dd193fe7f85cd.svg" : "/assets/308e587f3a68412f137f7317206e92c2.svg" + }) + }) + ] + }); + } + + setLabelsByLanguage () { + switch (BDFDB.LanguageUtils.getLanguage().id) { + case "bg": // Bulgarian + return { + context_changeorder: "Промяна на реда на скритите канали", + context_changeorder_bottom: "Родна категория в долната част", + context_changeorder_native: "Родна категория в правилен ред", + context_channelaccess: "Достъп до канал", + context_hidehidden: "Скриване на заключените канали", + modal_allowed: "Разрешено", + modal_denied: "Отрича се" + }; + case "cs": // Czech + return { + context_changeorder: "Změnit pořadí skrytých kanálů", + context_changeorder_bottom: "Nativní kategorie dole", + context_changeorder_native: "Nativní kategorie ve správném pořadí", + context_channelaccess: "Přístup ke kanálu", + context_hidehidden: "Skrýt zamčené kanály", + modal_allowed: "Povoleno", + modal_denied: "Odepřeno" + }; + case "da": // Danish + return { + context_changeorder: "Skift rækkefølge for skjulte kanaler", + context_changeorder_bottom: "Indfødt kategori i bunden", + context_changeorder_native: "Native Kategori i korrekt rækkefølge", + context_channelaccess: "Kanaltilgang", + context_hidehidden: "Skjul låste kanaler", + modal_allowed: "Tilladt", + modal_denied: "Nægtet" + }; + case "de": // German + return { + context_changeorder: "Reihenfolge der versteckten Kanäle ändern", + context_changeorder_bottom: "Native Kategorie ganz unten", + context_changeorder_native: "Native Kategorie in der richtigen Reihenfolge", + context_channelaccess: "Kanalzugriff", + context_hidehidden: "Versteckte Kanäle ausblenden", + modal_allowed: "Erlaubt", + modal_denied: "Verweigert" + }; + case "el": // Greek + return { + context_changeorder: "Αλλαγή σειράς κρυφών καναλιών", + context_changeorder_bottom: "Εγγενής κατηγορία στο κάτω μέρος", + context_changeorder_native: "Εγγενής κατηγορία σε σωστή σειρά", + context_channelaccess: "Πρόσβαση καναλιού", + context_hidehidden: "Απόκρυψη κλειδωμένων καναλιών", + modal_allowed: "Επιτρεπόμενο", + modal_denied: "Απορρίφθηκε" + }; + case "es": // Spanish + return { + context_changeorder: "Cambiar el orden de los canales ocultos", + context_changeorder_bottom: "Categoría nativa en la parte inferior", + context_changeorder_native: "Categoría nativa en el orden correcto", + context_channelaccess: "Acceso al canal", + context_hidehidden: "Ocultar canales bloqueados", + modal_allowed: "Permitido", + modal_denied: "Negado" + }; + case "fi": // Finnish + return { + context_changeorder: "Muuta piilotettujen kanavien järjestystä", + context_changeorder_bottom: "Alkuperäinen luokka alareunassa", + context_changeorder_native: "Alkuperäinen luokka oikeassa järjestyksessä", + context_channelaccess: "Kanavan käyttöoikeus", + context_hidehidden: "Piilota lukitut kanavat", + modal_allowed: "Sallittu", + modal_denied: "Kielletty" + }; + case "fr": // French + return { + context_changeorder: "Modifier l'ordre des canaux cachés", + context_changeorder_bottom: "Catégorie native en bas", + context_changeorder_native: "Catégorie native dans le bon ordre", + context_channelaccess: "Accès à la chaîne", + context_hidehidden: "Masquer les salons verrouillées", + modal_allowed: "Permis", + modal_denied: "Refusé" + }; + case "hi": // Hindi + return { + context_changeorder: "हिडन चैनल ऑर्डर बदलें", + context_changeorder_bottom: "नीचे की ओर मूल श्रेणी", + context_changeorder_native: "मूल श्रेणी सही क्रम में", + context_channelaccess: "चैनल एक्सेस", + context_hidehidden: "बंद चैनल छुपाएं Hide", + modal_allowed: "अनुमति है", + modal_denied: "निषेध" + }; + case "hr": // Croatian + return { + context_changeorder: "Promijenite redoslijed skrivenih kanala", + context_changeorder_bottom: "Izvorna kategorija na dnu", + context_changeorder_native: "Izvorna kategorija u ispravnom redoslijedu", + context_channelaccess: "Pristup kanalu", + context_hidehidden: "Sakrij zaključane kanale", + modal_allowed: "Dopuštena", + modal_denied: "Odbijen" + }; + case "hu": // Hungarian + return { + context_changeorder: "Rejtett csatornák sorrendjének módosítása", + context_changeorder_bottom: "Natív kategória az alján", + context_changeorder_native: "Natív kategória helyes sorrendben", + context_channelaccess: "Csatornához való hozzáférés", + context_hidehidden: "Zárt csatornák elrejtése", + modal_allowed: "Megengedett", + modal_denied: "Megtagadva" + }; + case "it": // Italian + return { + context_changeorder: "Modifica l'ordine dei canali nascosti", + context_changeorder_bottom: "Categoria nativa in basso", + context_changeorder_native: "Categoria nativa nell'ordine corretto", + context_channelaccess: "Accesso al canale", + context_hidehidden: "Nascondi canali bloccati", + modal_allowed: "Consentito", + modal_denied: "Negato" + }; + case "ja": // Japanese + return { + context_changeorder: "非表示チャネルの順序を変更する", + context_changeorder_bottom: "下部のネイティブカテゴリ", + context_changeorder_native: "正しい順序のネイティブカテゴリ", + context_channelaccess: "チャネルアクセス", + context_hidehidden: "ロックされたチャンネルを非表示にする", + modal_allowed: "許可", + modal_denied: "拒否されました" + }; + case "ko": // Korean + return { + context_changeorder: "숨겨진 채널 순서 변경", + context_changeorder_bottom: "하단의 기본 카테고리", + context_changeorder_native: "올바른 순서의 네이티브 카테고리", + context_channelaccess: "채널 액세스", + context_hidehidden: "잠긴 채널 숨기기", + modal_allowed: "허용됨", + modal_denied: "거부 됨" + }; + case "lt": // Lithuanian + return { + context_changeorder: "Keisti paslėptų kanalų tvarką", + context_changeorder_bottom: "Gimtoji kategorija apačioje", + context_changeorder_native: "Gimtoji kategorija teisinga tvarka", + context_channelaccess: "Prieiga prie kanalo", + context_hidehidden: "Slėpti užrakintus kanalus", + modal_allowed: "Leidžiama", + modal_denied: "Paneigta" + }; + case "nl": // Dutch + return { + context_changeorder: "Wijzig de volgorde van verborgen kanalen", + context_changeorder_bottom: "Native categorie onderaan", + context_changeorder_native: "Native categorie in de juiste volgorde", + context_channelaccess: "Kanaaltoegang", + context_hidehidden: "Verberg vergrendelde kanalen", + modal_allowed: "Toegestaan", + modal_denied: "Geweigerd" + }; + case "no": // Norwegian + return { + context_changeorder: "Endre rekkefølgen på skjulte kanaler", + context_changeorder_bottom: "Innfødt kategori nederst", + context_changeorder_native: "Innfødt kategori i riktig rekkefølge", + context_channelaccess: "Kanaltilgang", + context_hidehidden: "Skjul låste kanaler", + modal_allowed: "Tillatt", + modal_denied: "Nektet" + }; + case "pl": // Polish + return { + context_changeorder: "Zmień kolejność ukrytych kanałów", + context_changeorder_bottom: "Kategoria natywna na dole", + context_changeorder_native: "Kategoria natywna we właściwej kolejności", + context_channelaccess: "Dostęp do kanałów", + context_hidehidden: "Ukryj zablokowane kanały", + modal_allowed: "Dozwolony", + modal_denied: "Odmówiono" + }; + case "pt-BR": // Portuguese (Brazil) + return { + context_changeorder: "Alterar a ordem dos canais ocultos", + context_changeorder_bottom: "Categoria nativa na parte inferior", + context_changeorder_native: "Categoria nativa na ordem correta", + context_channelaccess: "Acesso ao canal", + context_hidehidden: "Ocultar canais bloqueados", + modal_allowed: "Permitido", + modal_denied: "Negado" + }; + case "ro": // Romanian + return { + context_changeorder: "Schimbați comanda canalelor ascunse", + context_changeorder_bottom: "Categorie nativă în partea de jos", + context_changeorder_native: "Categorie nativă în ordine corectă", + context_channelaccess: "Acces la canal", + context_hidehidden: "Ascundeți canalele blocate", + modal_allowed: "Permis", + modal_denied: "Negat" + }; + case "ru": // Russian + return { + context_changeorder: "Изменить порядок скрытых каналов", + context_changeorder_bottom: "Родная категория внизу", + context_changeorder_native: "Собственная категория в правильном порядке", + context_channelaccess: "Доступ к каналу", + context_hidehidden: "Скрыть заблокированные каналы", + modal_allowed: "Разрешенный", + modal_denied: "Отказано" + }; + case "sv": // Swedish + return { + context_changeorder: "Ändra ordning för dolda kanaler", + context_changeorder_bottom: "Naturlig kategori längst ner", + context_changeorder_native: "Naturlig kategori i rätt ordning", + context_channelaccess: "Kanaltillgång", + context_hidehidden: "Dölj låsta kanaler", + modal_allowed: "Tillåtet", + modal_denied: "Förnekad" + }; + case "th": // Thai + return { + context_changeorder: "เปลี่ยนลำดับช่องที่ซ่อนอยู่", + context_changeorder_bottom: "หมวดหมู่ดั้งเดิมที่ด้านล่าง", + context_changeorder_native: "หมวดหมู่ดั้งเดิมในลำดับที่ถูกต้อง", + context_channelaccess: "การเข้าถึงช่อง", + context_hidehidden: "ซ่อนช่องที่ถูกล็อก", + modal_allowed: "ได้รับอนุญาต", + modal_denied: "ถูกปฏิเสธ" + }; + case "tr": // Turkish + return { + context_changeorder: "Gizli Kanal Sırasını Değiştir", + context_changeorder_bottom: "Altta Yerel Kategori", + context_changeorder_native: "Yerel Kategori doğru sırada", + context_channelaccess: "Kanal Erişimi", + context_hidehidden: "Kilitli Kanalları Gizle", + modal_allowed: "İzin veriliyor", + modal_denied: "Reddedildi" + }; + case "uk": // Ukrainian + return { + context_changeorder: "Змінити порядок прихованих каналів", + context_changeorder_bottom: "Рідна категорія внизу", + context_changeorder_native: "Рідна категорія в правильному порядку", + context_channelaccess: "Доступ до каналу", + context_hidehidden: "Сховати заблоковані канали", + modal_allowed: "Дозволено", + modal_denied: "Заперечується" + }; + case "vi": // Vietnamese + return { + context_changeorder: "Thay đổi thứ tự các kênh bị ẩn", + context_changeorder_bottom: "Danh mục Gốc ở dưới cùng", + context_changeorder_native: "Danh mục gốc theo đúng thứ tự", + context_channelaccess: "Quyền truy cập kênh", + context_hidehidden: "Ẩn các kênh đã khóa", + modal_allowed: "Được phép", + modal_denied: "Phủ định" + }; + case "zh-CN": // Chinese (China) + return { + context_changeorder: "更改隐藏频道顺序", + context_changeorder_bottom: "底部的原生类别", + context_changeorder_native: "正确顺序的本地类别", + context_channelaccess: "频道访问", + context_hidehidden: "隐藏锁定的频道", + modal_allowed: "允许的", + modal_denied: "被拒绝" + }; + case "zh-TW": // Chinese (Taiwan) + return { + context_changeorder: "更改隱藏頻道順序", + context_changeorder_bottom: "底部的原生類別", + context_changeorder_native: "正確順序的本地類別", + context_channelaccess: "頻道訪問", + context_hidehidden: "隱藏鎖定的頻道", + modal_allowed: "允許的", + modal_denied: "被拒絕" + }; + default: // English + return { + context_changeorder: "Change Hidden Channels Order", + context_changeorder_bottom: "Native Category at the bottom", + context_changeorder_native: "Native Category in correct Order", + context_channelaccess: "Channel Access", + context_hidehidden: "Hide Locked Channels", + modal_allowed: "Permitted", + modal_denied: "Denied" + }; + } + } + }; + })(window.BDFDB_Global.PluginUtils.buildPlugin(config)); +})(); diff --git a/files/discord/plugins/TypingUsersAvatars.plugin.js b/files/discord/plugins/TypingUsersAvatars.plugin.js @@ -0,0 +1,182 @@ + /** + * @name TypingUsersAvatars + * @source https://github.com/QWERTxD/BetterDiscordPlugins/blob/main/TypingUsersAvatars/TypingUsersAvatars.plugin.js + * @updateUrl https://raw.githubusercontent.com/QWERTxD/BetterDiscordPlugins/main/TypingUsersAvatars/TypingUsersAvatars.plugin.js + * @website https://github.com/QWERTxD/BetterDiscordPlugins/tree/main/TypingUsersAvatars + * @version 1.0.2 + * @description Shows avatars of typing users. + */ + + const request = require('request'); + const fs = require('fs'); + const path = require('path'); + + const config = { + info: { + name: 'TypingUsersAvatars', + authors: [ + { + name: 'QWERT' + } + ], + version: '1.0.2', + description: 'Shows avatars of typing users.', + }, + changelog: [ + { + title: 'Fixed', + type: 'fixed', + items: [ + 'the crashing issue' + ] + } + ], + defaultConfig: [ + { + type: 'switch', + name: 'Show users status', + id: 'showStatus', + value: true + } + ] + }; + + module.exports = !global.ZeresPluginLibrary ? class { + constructor() { + this._config = config; + } + + load() { + BdApi.showConfirmationModal('Library plugin is needed', + `The library plugin needed for AQWERT'sPluginBuilder is missing. Please click Download Now to install it.`, { + confirmText: 'Download', + cancelText: 'Cancel', + onConfirm: () => { + request.get('https://rauenzi.github.io/BDPluginLibrary/release/0PluginLibrary.plugin.js', (error, response, body) => { + if (error) + return electron.shell.openExternal('https://betterdiscord.net/ghdl?url=https://raw.githubusercontent.com/rauenzi/BDPluginLibrary/master/release/0PluginLibrary.plugin.js'); + + fs.writeFileSync(path.join(BdApi.Plugins.folder, '0PluginLibrary.plugin.js'), body); + }); + } + }); + } + + start() { } + + stop() { } + } : (([Plugin, Library]) => { + const { DiscordModules, WebpackModules, PluginUtilities, Patcher, ReactComponents, Popouts, Utilities, DiscordSelectors } = Library; + const { React, UserStore, RelationshipStore, UserStatusStore, Strings } = DiscordModules; + const Avatar = WebpackModules.getByProps('AnimatedAvatar'); + const VoiceUserSummary = WebpackModules.findByDisplayName("VoiceUserSummaryItem") + + class AvatarComponent extends React.Component { + render() { + const {user, status} = this.props; + return React.createElement(Avatar.default, { + src: user.getAvatarURL(), + status: status, + size: Avatar.Sizes.SIZE_16, + onClick() { + Popouts.showUserPopout(document.getElementById(`typing-user-${user.id}`), user) + } + }) + } + } + + class plugin extends Plugin { + constructor() { + super(); + this.getSettingsPanel = () => { + return this.buildSettingsPanel().getElement(); + }; + } + + onStart() { + Utilities.suppressErrors(this.patch.bind(this))(); + + PluginUtilities.addStyle('TypingUsersAvatars', ` + .typing-2GQL18 > .text-1y-e8- { + margin: 0; + } + + .typing-2GQL18 .wrapper-3t9DeA { + display: flex; + margin: 0 4px; + } + + .typing-2GQL18 > .text-1y-e8-, + .typing-2GQL18 > .text-1y-e8- > strong { + display: contents; + } + + .several-users { + margin-left: 5px; + margin-right: 5px; + } + + .several-users > .avatarSize-EXG1Is { + margin: 0; + } + `) + } + + onStop() { + Patcher.unpatchAll(); + PluginUtilities.removeStyle('TypingUsersAvatars'); + } + + filter(users) { + return Object.keys(users).filter((user) => { + return user != UserStore.getCurrentUser().id && !RelationshipStore.isBlocked(user); + }) + } + + /* code highly inspired by https://github.com/rauenzi/BetterDiscordAddons/blob/master/Plugins/BetterRoleColors/BetterRoleColors.plugin.js */ + async patch() { + const TypingUsers = await ReactComponents.getComponentByName('TypingUsers', DiscordSelectors.Typing.typing); + Patcher.after(TypingUsers.component.prototype, 'render', (thisObject, [props], ret) => { + const typingUsers = this.filter({...thisObject.props.typingUsers}); + + for (let u = 0; u < typingUsers.length; u++) { + const user = UserStore.getUser(typingUsers[u]); + const status = this.settings.showStatus ? UserStatusStore.getStatus(user.id) : null; + if(ret.props.children[1].props.children !== Strings.SEVERAL_USERS_TYPING) { + ret.props.children[1].props.children[2* u].props.children.unshift(React.createElement("div", { + id: `typing-user-${user.id}`, + children: React.createElement(AvatarComponent, {user, status}) + })); + }else{ + ret.props.children[1].props.children = [ + React.createElement(VoiceUserSummary, { + className: "several-users", + users: typingUsers.map(UserStore.getUser), + max: 3 + }), + ret.props.children[1].props.children + ] + + } + } + + if(!ret) return; + const tree = ret.props.children; + if(!tree) return; + + tree.map((child) => { + const children = child?.props?.children; + if(!children || typeof children !== 'object') return; + + child.props.style = { + display: 'flex', + alignItems: 'center' + }; + }) + }) + } + + } + + return plugin; + })(global.ZeresPluginLibrary.buildPlugin(config)); +\ No newline at end of file diff --git a/files/discord/theme.css b/files/discord/theme.css @@ -0,0 +1 @@ +@import "https://raw.githack.com/GeopJr/DNOME/main/dist/DNOME.css"; diff --git a/files/firefox/userContent.css b/files/firefox/userContent.css @@ -0,0 +1,72 @@ +/* ## Firefox GNOME Theme ## */ + +/* ## Color Scheme */ +:root { + --accent-color: 21, 83, 158; + --secondary-accent-color: 255, 255, 255; + --light-color: 227, 227, 227; + --light-color-text: 51, 51, 51; + --dark-color: 51, 51, 51; + --dark-color-text: 227, 227, 227; + --dark-color-light: 77, 77, 77; +} + +/* # Light Theme */ +:root { + --main-bgcolor: var(--dark-color); + --transparent-bgcolor: var(--dark-color); +} + +@media (prefers-color-scheme: light) { + @-moz-document url("about:newtab"), url("about:home"), url("about:blank") { + body { + background-color: rgba(var(--light-color), 1) !important; + } + } + .outer-wrapper.newtab-experience .search-wrapper .search-handoff-button, + .outer-wrapper.newtab-experience .search-wrapper input, + html body.activity-stream div#root div span button.personalize-button { + transition: all 0.3s ease !important; + background-color: rgba(var(--secondary-accent-color), 1) !important; + color: rgba(var(--light-color-text), 1) !important; + } + html body.activity-stream div#root div span button.personalize-button:hover { + background-color: rgba(var(--accent-color), 0.2) !important; + } +} + +/* # Dark Theme */ +:root:-moz-lwtheme-brighttext { + --main-bgcolor: var(--dark-color); + --transparent-bgcolor: var(--dark-color); +} +.outer-wrapper.newtab-experience .search-wrapper .search-handoff-button, +.outer-wrapper.newtab-experience .search-wrapper input { + box-shadow: none !important; +} +.outer-wrapper.newtab-experience + .search-wrapper.fake-focus:not(.search.disabled) + .search-handoff-button { + border-color: rgba(var(--accent-color), 1) !important; +} + +@media (prefers-color-scheme: dark) { + @-moz-document url("about:newtab"), url("about:home"), url("about:blank") { + body { + background-color: rgba(var(--dark-color), 1) !important; + } + } + .outer-wrapper.newtab-experience .search-wrapper .search-handoff-button, + .outer-wrapper.newtab-experience .search-wrapper input, + html body.activity-stream div#root div span button.personalize-button { + transition: all 0.3s ease !important; + background-color: rgba(var(--dark-color-light), 1) !important; + color: rgba(var(--dark-color-text), 1) !important; + } + html body.activity-stream div#root div span button.personalize-button:hover { + background-color: rgba(var(--accent-color), 0.3) !important; + } + .search-handoff-button .fake-textbox { + color: rgba(var(--light-color), 1) !important; + } +} diff --git a/files/fonts/fontconfig.xml b/files/fonts/fontconfig.xml @@ -0,0 +1,42 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> +<fontconfig> + <match target="font"> + <edit name="autohint" mode="assign"> + <bool>false</bool> + </edit> + <edit name="hinting" mode="assign"> + <bool>true</bool> + </edit> + <edit name="antialias" mode="assign"> + <bool>true</bool> + </edit> + <edit mode="assign" name="hintstyle"> + <const>hintslight</const> + </edit> + <edit mode="assign" name="rgba"> + <const>rgb</const> + </edit> + <edit mode="assign" name="lcdfilter"> + <const>lcddefault</const> + </edit> + </match> + <alias binding="weak"> + <family>monospace</family> + <prefer> + <family>emoji</family> + </prefer> + </alias> + <alias binding="weak"> + <family>sans-serif</family> + <prefer> + <family>emoji</family> + </prefer> + </alias> + <alias binding="weak"> + <family>serif</family> + <prefer> + <family>emoji</family> + </prefer> + </alias> +</fontconfig> diff --git a/files/fonts/proprietary/ms-core/arial.ttf b/files/fonts/proprietary/ms-core/arial.ttf Binary files differ. diff --git a/files/fonts/proprietary/ms-core/calibri.ttf b/files/fonts/proprietary/ms-core/calibri.ttf Binary files differ. diff --git a/files/fonts/proprietary/ms-core/cour.ttf b/files/fonts/proprietary/ms-core/cour.ttf Binary files differ. diff --git a/files/fonts/proprietary/ms-core/symbol.ttf b/files/fonts/proprietary/ms-core/symbol.ttf Binary files differ. diff --git a/files/fonts/proprietary/ms-core/times.ttf b/files/fonts/proprietary/ms-core/times.ttf Binary files differ. diff --git a/files/fonts/proprietary/ms-core/wingding.ttf b/files/fonts/proprietary/ms-core/wingding.ttf Binary files differ. diff --git a/files/fonts/proprietary/oneplus-slate/OnePlusSlate-Black.ttf b/files/fonts/proprietary/oneplus-slate/OnePlusSlate-Black.ttf Binary files differ. diff --git a/files/fonts/proprietary/oneplus-slate/OnePlusSlate-Bold.ttf b/files/fonts/proprietary/oneplus-slate/OnePlusSlate-Bold.ttf Binary files differ. diff --git a/files/fonts/proprietary/oneplus-slate/OnePlusSlate-Book.ttf b/files/fonts/proprietary/oneplus-slate/OnePlusSlate-Book.ttf Binary files differ. diff --git a/files/fonts/proprietary/oneplus-slate/OnePlusSlate-Light.ttf b/files/fonts/proprietary/oneplus-slate/OnePlusSlate-Light.ttf Binary files differ. diff --git a/files/fonts/proprietary/oneplus-slate/OnePlusSlate-Medium.ttf b/files/fonts/proprietary/oneplus-slate/OnePlusSlate-Medium.ttf Binary files differ. diff --git a/files/fonts/proprietary/oneplus-slate/OnePlusSlate-Regular.ttf b/files/fonts/proprietary/oneplus-slate/OnePlusSlate-Regular.ttf Binary files differ. diff --git a/files/fonts/proprietary/oneplus-slate/OnePlusSlate-Thin.ttf b/files/fonts/proprietary/oneplus-slate/OnePlusSlate-Thin.ttf Binary files differ. diff --git a/files/fonts/proprietary/product-sans/ProductSans-Black.ttf b/files/fonts/proprietary/product-sans/ProductSans-Black.ttf Binary files differ. diff --git a/files/fonts/proprietary/product-sans/ProductSans-BlackItalic.ttf b/files/fonts/proprietary/product-sans/ProductSans-BlackItalic.ttf Binary files differ. diff --git a/files/fonts/proprietary/product-sans/ProductSans-Bold.ttf b/files/fonts/proprietary/product-sans/ProductSans-Bold.ttf Binary files differ. diff --git a/files/fonts/proprietary/product-sans/ProductSans-BoldItalic.ttf b/files/fonts/proprietary/product-sans/ProductSans-BoldItalic.ttf Binary files differ. diff --git a/files/fonts/proprietary/product-sans/ProductSans-Italic.ttf b/files/fonts/proprietary/product-sans/ProductSans-Italic.ttf Binary files differ. diff --git a/files/fonts/proprietary/product-sans/ProductSans-Light.ttf b/files/fonts/proprietary/product-sans/ProductSans-Light.ttf Binary files differ. diff --git a/files/fonts/proprietary/product-sans/ProductSans-LightItalic.ttf b/files/fonts/proprietary/product-sans/ProductSans-LightItalic.ttf Binary files differ. diff --git a/files/fonts/proprietary/product-sans/ProductSans-Medium.ttf b/files/fonts/proprietary/product-sans/ProductSans-Medium.ttf Binary files differ. diff --git a/files/fonts/proprietary/product-sans/ProductSans-MediumItalic.ttf b/files/fonts/proprietary/product-sans/ProductSans-MediumItalic.ttf Binary files differ. diff --git a/files/fonts/proprietary/product-sans/ProductSans-Regular.ttf b/files/fonts/proprietary/product-sans/ProductSans-Regular.ttf Binary files differ. diff --git a/files/fonts/proprietary/product-sans/ProductSans-Thin.ttf b/files/fonts/proprietary/product-sans/ProductSans-Thin.ttf Binary files differ. diff --git a/files/fonts/proprietary/product-sans/ProductSans-ThinItalic.ttf b/files/fonts/proprietary/product-sans/ProductSans-ThinItalic.ttf Binary files differ. diff --git a/files/git/hooks/commit-msg b/files/git/hooks/commit-msg @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +error() { echo -e "\033[0;31merror:\033[0m $1"; exit 7; } + +## Commit Message ## +# Keywords +if ! head -1 "$1" | grep -qE "^(feat|fix|ci|blog|chore|docs|test|style|refactor)(\(.+?\))?\!?: .{1,}$" +then + error "Commit Message is invalid" +fi + +# Length +if ! head -1 "$1" | grep -qE "^.{1,50}$" +then + error "Commit Message is too long" +fi diff --git a/files/git/hooks/pre-commit b/files/git/hooks/pre-commit @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +error() { echo -e "\033[0;31merror:\033[0m $1"; exit 7; } + +## Pre-Commit Checks ## +# Nix Syntax +if [ "$(find . -name '*.nix' 2>/dev/null | wc -l)" != 0 ] && [ "$(git branch --show-current)" == "stable" ] +then + nix flake check || error "Invalid Syntax" +fi diff --git a/files/gnome/accounts.conf b/files/gnome/accounts.conf @@ -0,0 +1,11 @@ +[Account account_1635317848_0] +Provider=google +Identity=maydayv7@gmail.com +PresentationIdentity=maydayv7@gmail.com +MailEnabled=true +CalendarEnabled=true +ContactsEnabled=true +DocumentsEnabled=true +PhotosEnabled=true +FilesEnabled=false +PrintersEnabled=false diff --git a/files/gnome/dconf.nix b/files/gnome/dconf.nix @@ -0,0 +1,765 @@ +{ + config, + lib, + files, + ... +}: +with lib.hm.gvariant; let + homeDir = config.home.homeDirectory; +in { + # Home Directory + home.file = { + # Wallpapers + ".local/share/backgrounds".source = files.images.wallpapers; + + # GTK+ Bookmarks + ".config/gtk-3.0/bookmarks".text = lib.mkBefore '' + file://${homeDir}/Documents/TBD TBD + ''; + }; + + ## Dconf Keys ## + # Generated via dconf2nix: https://github.com/gvolpe/dconf2nix + dconf.settings = { + # Keyboard Shortcuts + "org/gnome/desktop/wm/keybindings" = { + begin-move = []; + begin-resize = []; + close = ["<Super>q" "<Alt>F4"]; + cycle-group = []; + cycle-group-backward = []; + maximize = ["<Super>Up"]; + minimize = ["<Super>Down"]; + move-to-monitor-down = []; + move-to-monitor-left = ["<Shift><Super>Left"]; + move-to-monitor-right = ["<Shift><Super>Right"]; + move-to-monitor-up = []; + move-to-workspace-1 = []; + move-to-workspace-down = []; + move-to-workspace-last = []; + move-to-workspace-left = ["<Primary><Super>Left"]; + move-to-workspace-right = ["<Primary><Super>Right"]; + move-to-workspace-up = []; + panel-main-menu = []; + panel-run-dialog = ["<Super>F2"]; + switch-group = []; + switch-group-backward = []; + switch-to-workspace-down = ["<Primary><Super>Down" "<Primary><Super>j"]; + switch-to-workspace-left = ["<Super>Left"]; + switch-to-workspace-right = ["<Super>Right"]; + switch-to-workspace-up = ["<Primary><Super>Up" "<Primary><Super>k"]; + toggle-maximized = ["<Super>m"]; + unmaximize = []; + }; + + "org/gnome/mutter/keybindings" = { + toggle-tiled-left = []; + toggle-tiled-right = []; + }; + + "org/gnome/shell/keybindings" = { + focus-active-notification = []; + open-application-menu = []; + toggle-message-tray = []; + toggle-overview = []; + }; + + "org/gnome/settings-daemon/plugins/media-keys" = { + area-screenshot = ["Print"]; + area-screenshot-clip = []; + control-center = ["<Super>i"]; + email = ["<Super>e"]; + home = ["<Super>f"]; + magnifier = ["<Super>x"]; + magnifier-zoom-in = ["<Super>equal"]; + magnifier-zoom-out = ["<Super>minus"]; + rotate-video-lock-static = []; + screencast = ["<Alt>Print"]; + screenreader = []; + screenshot = ["<Shift>Print"]; + screenshot-clip = []; + screensaver = ["<Super>l"]; + terminal = ["<Super>t"]; + volume-down = ["AudioLowerVolume"]; + volume-up = ["AudioRaiseVolume"]; + window-screenshot = ["<Primary>Print"]; + window-screenshot-clip = []; + www = ["<Super>w"]; + custom-keybindings = [ + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" + "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/" + ]; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { + binding = "<Primary><Alt>Return"; + command = "gnome-system-monitor"; + name = "Task Manager"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = { + binding = "<Super>t"; + command = "gnome-terminal"; + name = "Terminal"; + }; + + "org/gnome/desktop/wm/preferences" = { + button-layout = "appmenu:minimize,close"; + titlebar-font = "Product Sans Bold 11"; + visual-bell = false; + num-workspaces = 4; + workspace-names = ["Desktop" "School" "Work" "Play"]; + }; + + # Core Settings + "org/gnome/desktop/a11y".always-show-universal-access-status = true; + "org/gnome/desktop/a11y/applications".screen-magnifier-enabled = false; + + "org/gnome/mutter" = { + attach-modal-dialogs = true; + dynamic-workspaces = false; + edge-tiling = true; + focus-change-on-pointer-rest = true; + workspaces-only-on-primary = true; + }; + + "org/gnome/desktop/interface" = { + clock-show-weekday = true; + document-font-name = "Product Sans 11"; + enable-animations = true; + enable-hot-corners = false; + font-antialiasing = "grayscale"; + font-hinting = "slight"; + font-name = "Product Sans Medium, Medium 11"; + gtk-im-module = "gtk-im-context-simple"; + gtk-theme = "Adwaita-dark"; + icon-theme = "Papirus-Dark"; + locate-pointer = true; + monospace-font-name = "MesloLGS NF 10"; + show-battery-percentage = true; + toolkit-accessibility = false; + }; + + "org/gnome/desktop/peripherals/touchpad" = { + click-method = "areas"; + tap-to-click = true; + two-finger-scrolling-enabled = true; + }; + + "org/gnome/settings-daemon/plugins/power" = { + power-button-action = "interactive"; + sleep-inactive-ac-type = "nothing"; + sleep-inactive-battery-timeout = 1800; + }; + + "org/gnome/settings-daemon/plugins/color" = { + night-light-enabled = true; + night-light-schedule-automatic = false; + night-light-schedule-from = 19.0; + night-light-schedule-to = 7.0; + night-light-temperature = "uint32 3700"; + }; + + "org/gnome/desktop/a11y/magnifier" = { + cross-hairs-clip = true; + cross-hairs-color = "#15519a"; + cross-hairs-length = 1440; + cross-hairs-opacity = 1.0; + mouse-tracking = "proportional"; + show-cross-hairs = true; + }; + + "org/gnome/desktop/privacy" = { + disable-microphone = false; + old-files-age = "uint32 7"; + remember-recent-files = false; + remove-old-temp-files = true; + remove-old-trash-files = true; + }; + + "org/gnome/desktop/sound" = { + allow-volume-above-100-percent = true; + event-sounds = true; + theme-name = "freedesktop"; + }; + + "org/gnome/desktop/background" = { + color-shading-type = "solid"; + picture-options = "zoom"; + primary-color = "#000000000000"; + secondary-color = "#000000000000"; + }; + + "org/gnome/desktop/screensaver" = { + color-shading-type = "solid"; + lock-delay = "uint32 0"; + lock-enabled = false; + picture-options = "zoom"; + primary-color = "#000000000000"; + secondary-color = "#000000000000"; + }; + + # GTK+ Apps + "org/gnome/desktop/calendar".show-weekdate = true; + "ca/desrt/dconf-editor".show-warning = false; + "io/github/seadve/Kooha".video-format = "mp4"; + "org/gnome/boxes".shared-folders = "[<{'uuid': <'5b825243-4232-4426-9d82-3df05e684e42'>, 'path': <'${homeDir}'>, 'name': <'Home'>}>]"; + "org/gnome/shell/world-clocks".locations = "[<(uint32 2, <('Coordinated Universal Time (UTC)', '@UTC', false, @a(dd) [], @a(dd) [])>)>]"; + + "org/gnome/Geary" = { + ask-open-attachment = true; + compose-as-html = true; + formatting-toolbar-visible = false; + migrated-config = true; + optional-plugins = ["email-templates" "sent-sound" "mail-merge"]; + startup-notifications = true; + }; + + "org/gnome/epiphany" = { + active-clear-data-items = 391; + ask-for-default = false; + default-search-engine = "Google"; + restore-session-policy = "crashed"; + use-google-search-suggestions = true; + }; + + "org/gnome/epiphany/web" = { + default-zoom-level = 1.0; + enable-mouse-gestures = true; + }; + + "org/gnome/nautilus/preferences" = { + click-policy = "single"; + default-folder-viewer = "icon-view"; + fts-enabled = true; + search-filter-time-type = "last_modified"; + search-view = "list-view"; + show-create-link = true; + show-delete-permanently = true; + }; + + "com/github/hugolabe/Wike" = { + custom-font = true; + dark-mode = true; + font-family = "Product Sans"; + }; + + "org/gnome/builder/editor" = { + auto-hide-map = true; + auto-save-timeout = 60; + completion-n-rows = 7; + draw-spaces = ["tab"]; + highlight-current-line = true; + highlight-matching-brackets = true; + overscroll = 7; + show-map = false; + style-scheme-name = "builder-dark"; + }; + + "org/gnome/builder/terminal" = { + limit-scrollback = false; + scrollback-lines = "uint32 10000"; + }; + + "org/gnome/gitlab/somas/Apostrophe" = { + color-scheme = "dark"; + input-format = "gfm"; + }; + + "org/gnome/terminal/legacy" = { + default-show-menubar = true; + new-tab-position = "next"; + schema-version = 3; + theme-variant = "dark"; + }; + + "org/gnome/terminal/legacy/profiles:" = { + default = "b1dcc9dd-5262-4d8d-a863-c897e6d979b9"; + list = ["b1dcc9dd-5262-4d8d-a863-c897e6d979b9"]; + }; + + "org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9" = { + audible-bell = false; + background-transparency-percent = 8; + backspace-binding = "ascii-delete"; + cursor-blink-mode = "system"; + cursor-shape = "ibeam"; + default-size-columns = 100; + default-size-rows = 30; + delete-binding = "delete-sequence"; + exit-action = "close"; + login-shell = false; + palette = [ + "rgb(23,20,33)" + "rgb(192,28,40)" + "rgb(38,162,105)" + "rgb(162,115,76)" + "rgb(18,72,139)" + "rgb(163,71,186)" + "rgb(42,161,179)" + "rgb(208,207,204)" + "rgb(94,92,100)" + "rgb(246,97,81)" + "rgb(51,209,122)" + "rgb(233,173,12)" + "rgb(42,123,222)" + "rgb(192,97,203)" + "rgb(51,199,222)" + "rgb(255,255,255)" + ]; + scrollback-lines = 70000; + scrollback-unlimited = true; + scrollbar-policy = "always"; + use-custom-command = false; + use-system-font = true; + use-theme-colors = true; + use-transparent-background = true; + visible-name = "Terminal"; + }; + + "org/gnome/gedit/preferences/ui".show-tabs-mode = "auto"; + "org/gnome/gedit/preferences/editor" = { + scheme = "tango-dark"; + wrap-last-split-mode = "word"; + ensure-trailing-newline = false; + }; + + "org/gnome/gnome-screenshot" = { + delay = 0; + include-pointer = true; + last-save-directory = "file://${homeDir}/Pictures/Screenshots"; + }; + + # App Grid + "org/gnome/shell" = { + command-history = ["rt" "r"]; + disable-user-extensions = false; + disable-extension-version-validation = true; + disabled-extensions = ["workspace-indicator@gnome-shell-extensions.gcampax.github.com"]; + enabled-extensions = [ + "add-username-toppanel@brendaw.com" + "AlphabeticalAppGrid@stuarthayhurst" + "appindicatorsupport@rgcjonas.gmail.com" + "avatar@pawel.swiszcz.com" + "burn-my-windows@schneegans.github.com" + "caffeine@patapon.info" + "clipboard-indicator@tudmotu.com" + "color-picker@tuberry" + "color-picker@tuberry" + "compiz-alike-magic-lamp-effect@hermes83.github.com" + "compiz-windows-effect@hermes83.github.com" + "custom-hot-corners-extended@G-dH.github.com" + "dash-to-panel@jderose9.github.com" + "desktop-cube@schneegans.github.com" + "drive-menu@gnome-shell-extensions.gcampax.github.com" + "flypie@schneegans.github.com" + "gTile@vibou" + "just-perfection-desktop@just-perfection" + "lock-screen-message@advendradeswanta.gitlab.com" + "lockkeys@vaina.lt" + "screenshotlocations.timur@linux.com" + "sound-output-device-chooser@kgshank.net" + "timepp@zagortenay333" + "top-bar-organizer@julian.gse.jsts.xyz" + "user-theme@gnome-shell-extensions.gcampax.github.com" + "Vitals@CoreCoding.com" + "workspace-dry-names@benmoussatmouad.github.io" + "x11gestures@joseexposito.github.io" + ]; + favorite-apps = [ + "google-chrome.desktop" + "org.gnome.Geary.desktop" + "org.gnome.Nautilus.desktop" + "org.gnome.Terminal.desktop" + "org.gnome.gedit.desktop" + "gnome-control-center.desktop" + ]; + }; + + "org/gnome/desktop/app-folders" = { + folder-children = [ + "a136187d-1d93-4d35-8423-082f15957be9" + "b79e9b82-2127-459b-9e82-11bd3be09d04" + "4f9e09f6-cbd8-4a4a-beb3-9ec7b3e672ff" + "1c3e59e4-a571-4ada-af1d-ed1ced384cfb" + ]; + }; + + "org/gnome/desktop/app-folders/folders/4f9e09f6-cbd8-4a4a-beb3-9ec7b3e672ff" = { + name = "Games"; + apps = [ + "org.gnome.Chess.desktop" + "org.gnome.Sudoku.desktop" + "org.gnome.Mines.desktop" + "org.gnome.Quadrapassel.desktop" + ]; + }; + + "org/gnome/desktop/app-folders/folders/a136187d-1d93-4d35-8423-082f15957be9" = { + name = "Office"; + apps = [ + "Code.desktop" + "startcenter.desktop" + "writer.desktop" + "impress.desktop" + "draw.desktop" + "base.desktop" + "calc.desktop" + "math.desktop" + "onlyoffice-desktopeditors.desktop" + "net.sourceforge.gscan2pdf.desktop" + "virt-manager.desktop" + ]; + }; + + "org/gnome/desktop/app-folders/folders/b79e9b82-2127-459b-9e82-11bd3be09d04" = { + name = "Utilities"; + apps = [ + "org.gnome.Logs.desktop" + "org.gnome.Devhelp.desktop" + "org.gnome.Tour.desktop" + "cups.desktop" + "nixos-manual.desktop" + "yelp.desktop" + "org.gnome.baobab.desktop" + "xterm.desktop" + ]; + }; + + "org/gnome/desktop/app-folders/folders/1c3e59e4-a571-4ada-af1d-ed1ced384cfb" = { + name = "Wine"; + apps = [ + "7zip.desktop" + "Notepad++.desktop" + "playonlinux.desktop" + "net.lutris.Lutris.desktop" + ]; + }; + + # Shell Extensions + "org/gnome/shell/extensions/workspace-dry-names".name-option = "countries"; + "org/gnome/shell/extensions/user-theme".name = "Adwaita"; + "org/gnome/shell/extensions/alphabetical-app-grid".folder-order-position = "start"; + "org/gnome/shell/extensions/lock-screen-message".message = "Welcome, ${config.credentials.fullname}!"; + + "org/gnome/shell/extensions/avatar" = { + avatar-shadow-user-name = false; + buttons-icon-size = 20; + buttons-position = 50; + name-style-dark = false; + show-buttons = true; + show-system-name = false; + show-media-center = true; + set-custom-panel-menu-width = 400; + }; + + "org/gnome/shell/extensions/caffeine" = { + inhibit-apps = ["teams.desktop" "startcenter.desktop"]; + nightlight-control = "never"; + show-notifications = false; + user-enabled = true; + }; + + "org/gnome/shell/extensions/color-picker" = { + color-picker-shortcut = ["<Super>c"]; + enable-shortcut = true; + enable-systray = true; + menu-size = "uint32 8"; + notify-style = "uint32 1"; + persistent-mode = true; + }; + + "org/gnome/shell/extensions/clipboard-indicator" = { + cache-size = 1051; + clear-history = []; + confirm-clear = false; + history-size = 70; + move-item-first = true; + next-entry = []; + prev-entry = []; + strip-text = true; + toggle-menu = ["<Super>v"]; + }; + + "org/gnome/shell/extensions/custom-hot-corners-extended/misc" = { + ws-switch-wrap = true; + ws-switch-ignore-last = true; + ws-switch-indicator-mode = 1; + }; + + "org/gnome/shell/extensions/custom-hot-corners-extended/monitor-0-top-left-0".action = "toggle-overview"; + "org/gnome/shell/extensions/custom-hot-corners-extended/monitor-0-bottom-left-0".action = "show-applications"; + + "org/gnome/shell/extensions/custom-hot-corners-extended/monitor-0-bottom-right-0" = { + action = "show-desktop"; + ctrl = true; + }; + + "org/gnome/shell/extensions/custom-hot-corners-extended/monitor-0-top-right-0" = { + action = "next-workspace"; + ctrl = true; + }; + + "org/gnome/shell/extensions/burn-my-windows" = { + close-preview-effect = ""; + destroy-dialogs = true; + fire-color-1 = "rgba(0,110,255,0)"; + fire-color-2 = "rgba(30,111,180,0.24)"; + fire-color-3 = "rgba(38,181,255,0.54)"; + fire-color-4 = "rgba(34,162,255,0.84)"; + fire-color-5 = "rgb(97,189,255)"; + flame-movement-speed = -0.1; + flame-scale = 1.5; + open-preview-effect = ""; + tv-open-effect = true; + }; + + "org/gnome/shell/extensions/desktop-cube" = { + active-workpace-opacity = 195; + depth-separation = 25; + horizontal-stretch = 100; + inactive-workpace-opacity = 224; + overview-transition-time = 0; + unfold-to-desktop = false; + workpace-separation = 25; + workspace-transition-time = 250; + }; + + "org/gnome/shell/extensions/gtile" = { + show-icon = false; + target-presets-to-monitor-of-mouse = true; + theme = "Default"; + window-margin = 2; + window-margin-fullscreen-enabled = true; + }; + + "org/gnome/shell/extensions/just-perfection" = { + accessibility-menu = true; + aggregate-menu = true; + animation = 4; + app-menu-icon = false; + dash = false; + hot-corner = false; + notification-banner-position = 2; + show-prefs-intro = false; + workspace-switcher-should-show = true; + workspace-background-corner-size = 58; + workspace-switcher-size = 7; + workspace-wrap-around = true; + }; + + "org/gnome/shell/extensions/lockkeys".style = "show-hide"; + "org/gnome/shell/extensions/screenshotlocations".save-directory = "${homeDir}/Pictures/Screenshots"; + + "org/gnome/shell/extensions/sound-output-device-chooser" = { + expand-volume-menu = false; + hide-on-single-device = true; + }; + + "org/gnome/shell/extensions/timepp" = { + alarms-separate-menu = false; + panel-item-position = "Left"; + pomodoro-panel-mode = "Dynamic"; + pomodoro-show-seconds = true; + stopwatch-panel-mode = "Dynamic"; + timer-panel-mode = "Dynamic"; + timer-show-seconds = true; + todo-panel-mode = "Icon"; + todo-separate-menu = true; + unicon-mode = true; + }; + + "org/gnome/shell/extensions/top-bar-organizer" = { + center-box-order = ["dateMenu"]; + left-box-order = ["workspace-name-indicator" "timepp" "appMenu" "activities"]; + right-box-order = [ + "aggregateMenu" + "drive-menu" + "color-picker@tuberry" + "Caffeine" + "vitalsMenu" + "dwellClick" + "lockkeys" + "clipboardIndicator" + "a11y" + "keyboard" + ]; + }; + + "org/gnome/shell/extensions/vitals" = { + hot-sensors = ["_default_icon_"]; + show-battery = true; + show-storage = false; + }; + + "org/gnome/shell/extensions/dash-to-panel" = { + animate-appicon-hover = true; + animate-appicon-hover-animation-convexity = "{'RIPPLE': 2.2000000000000002, 'PLANK': 1.0, 'SIMPLE': 0.0}"; + animate-appicon-hover-animation-extent = "{'RIPPLE': 6, 'PLANK': 4, 'SIMPLE': 1}"; + animate-appicon-hover-animation-rotation = "{'SIMPLE': 7, 'RIPPLE': 10, 'PLANK': 0}"; + animate-appicon-hover-animation-travel = "{'SIMPLE': 0.16, 'RIPPLE': 0.27000000000000002, 'PLANK': 0.0}"; + animate-appicon-hover-animation-type = "RIPPLE"; + animate-appicon-hover-animation-zoom = "{'SIMPLE': 1.0900000000000001, 'RIPPLE': 1.1399999999999999, 'PLANK': 2.0}"; + appicon-margin = 6; + appicon-padding = 4; + available-monitors = [0]; + desktop-line-custom-color = "rgb(138,180,248)"; + desktop-line-use-custom-color = false; + dot-color-dominant = true; + dot-color-override = false; + dot-position = "BOTTOM"; + dot-size = 3; + dot-style-focused = "CILIORA"; + dot-style-unfocused = "CILIORA"; + enter-peek-mode-timeout = 1100; + focus-highlight = true; + focus-highlight-color = "#eeeeee"; + focus-highlight-dominant = false; + focus-highlight-opacity = 20; + hide-overview-on-startup = false; + hot-keys = true; + hotkeys-overlay-combo = "TEMPORARILY"; + intellihide = false; + isolate-workspaces = true; + leftbox-padding = -1; + middle-click-action = "LAUNCH"; + overview-click-to-exit = false; + panel-anchors = ''{"0":"MIDDLE"}''; + panel-element-positions = '' + {"0":[{"element":"showAppsButton","visible":true,"position":"stackedTL"},{"element":"activitiesButton","visible":false,"position":"stackedTL"},{"element":"dateMenu","visible":true,"position":"stackedTL"},{"element":"leftBox","visible":true,"position":"stackedTL"},{"element":"taskbar","visible":true,"position":"centerMonitor"},{"element":"centerBox","visible":true,"position":"stackedBR"},{"element":"rightBox","visible":true,"position":"stackedBR"},{"element":"systemMenu","visible":true,"position":"stackedBR"},{"element":"desktopButton","visible":true,"position":"stackedBR"}]}''; + panel-element-positions-monitors-sync = true; + panel-lengths = ''{"0":100}''; + panel-positions = ''{"0":"BOTTOM"}''; + panel-sizes = ''{"0":48}''; + scroll-panel-delay = 10; + scroll-panel-show-ws-popup = true; + secondarymenu-contains-appmenu = true; + secondarymenu-contains-showdetails = true; + shift-click-action = "QUIT"; + shift-middle-click-action = "RAISE"; + shortcut-previews = true; + show-appmenu = true; + show-apps-icon-file = ""; + show-showdesktop-hover = true; + show-tooltip = true; + showdesktop-button-width = 3; + status-icon-padding = -1; + stockgs-keep-dash = false; + stockgs-keep-top-panel = false; + stockgs-panelbtn-click-only = false; + taskbar-locked = false; + trans-bg-color = "#282828"; + trans-dynamic-anim-target = 1.0; + trans-dynamic-anim-time = 200; + trans-dynamic-behavior = "MAXIMIZED_WINDOWS"; + trans-dynamic-distance = 0; + trans-gradient-bottom-color = "#8ab4f8"; + trans-gradient-bottom-opacity = 5.0e-2; + trans-panel-opacity = 0.0; + trans-use-custom-bg = true; + trans-use-custom-gradient = false; + trans-use-custom-opacity = false; + trans-use-dynamic-opacity = false; + tray-padding = 1; + tray-size = 0; + window-preview-show-title = true; + window-preview-size = 150; + window-preview-title-position = "TOP"; + }; + + "org/gnome/shell/extensions/flypie" = { + active-stack-child = "settings-page"; + background-color = "rgba(0, 0, 0, 0.26)"; + center-auto-color-luminance = 0.8; + center-auto-color-luminance-hover = 0.8; + center-auto-color-opacity = 0.0; + center-auto-color-opacity-hover = 0.0; + center-auto-color-saturation = 0.75; + center-auto-color-saturation-hover = 0.75; + center-background-image = "/run/current-system/sw/share/gnome-shell/extensions/flypie@schneegans.github.com/presets/assets/adwaita-dark.svg"; + center-background-image-hover = "/run/current-system/sw/share/gnome-shell/extensions/flypie@schneegans.github.com/presets/assets/adwaita-dark.svg"; + center-color-mode = "fixed"; + center-color-mode-hover = "fixed"; + center-fixed-color = "rgba(255,255,255,0)"; + center-fixed-color-hover = "rgba(255,255,255,0)"; + center-icon-crop = 0.8; + center-icon-crop-hover = 0.8; + center-icon-opacity = 0.17; + center-icon-opacity-hover = 1.0; + center-icon-scale = 0.7; + center-icon-scale-hover = 0.7; + center-size = 110.0; + center-size-hover = 90.0; + child-auto-color-luminance = 0.7; + child-auto-color-luminance-hover = 0.8802816901408451; + child-auto-color-opacity = 1.0; + child-auto-color-opacity-hover = 1.0; + child-auto-color-saturation = 0.9; + child-auto-color-saturation-hover = 1.0; + child-background-image = "/run/current-system/sw/share/gnome-shell/extensions/flypie@schneegans.github.com/presets/assets/adwaita-dark.svg"; + child-background-image-hover = "/run/current-system/sw/share/gnome-shell/extensions/flypie@schneegans.github.com/presets/assets/adwaita-dark.svg"; + child-color-mode = "fixed"; + child-color-mode-hover = "fixed"; + child-draw-above = false; + child-fixed-color = "rgba(255,255,255,0)"; + child-fixed-color-hover = "rgba(255,255,255,0)"; + child-icon-crop = 0.8; + child-icon-crop-hover = 0.8; + child-icon-opacity = 1.0; + child-icon-opacity-hover = 1.0; + child-icon-scale = 0.7; + child-icon-scale-hover = 0.7; + child-offset = 106.0; + child-offset-hover = 113.0; + child-size = 59.0; + child-size-hover = 77.0; + easing-duration = 0.25; + easing-mode = "ease-out"; + font = "Product Sans Medium, Medium 11"; + grandchild-background-image = "/run/current-system/sw/share/gnome-shell/extensions/flypie@schneegans.github.com/presets/assets/adwaita-dark.svg"; + grandchild-background-image-hover = "/run/current-system/sw/share/gnome-shell/extensions/flypie@schneegans.github.com/presets/assets/adwaita-dark.svg"; + grandchild-color-mode = "fixed"; + grandchild-color-mode-hover = "fixed"; + grandchild-draw-above = false; + grandchild-fixed-color = "rgba(189,184,178,0)"; + grandchild-fixed-color-hover = "rgba(189,184,178,0)"; + grandchild-offset = 25.0; + grandchild-offset-hover = 31.0; + grandchild-size = 17.0; + grandchild-size-hover = 27.0; + menu-configuration = '' + [{"name":"Navigation","icon":"application-menu","shortcut":"F9","centered":false,"id":0,"children":[{"name":"Sound","icon":"audio-speakers","children":[{"name":"Mute","icon":"discord-tray-muted","type":"Shortcut","data":"AudioMute","angle":-1},{"name":"Play / Pause","icon":"exaile-play","type":"Shortcut","data":"AudioPlay","angle":-1},{"name":"Next","icon":"go-next-symbolic","type":"Shortcut","data":"AudioNext","angle":90},{"name":"Previous","icon":"go-next-symbolic-rtl","type":"Shortcut","data":"AudioPrev","angle":270}],"type":"CustomMenu","data":{},"angle":-1},{"name":"Menu","type":"Command","icon":"gnome-menu","data":{"command":"gnome-extensions prefs flypie@schneegans.github.com"},"angle":-1},{"name":"Tasks","type":"Command","icon":"gnome-system-monitor","data":{"command":"gnome-system-monitor"},"angle":-1},{"name":"System","type":"System","icon":"system-log-out","angle":-1,"data":{}},{"name":"Previous","icon":"go-previous","type":"Shortcut","data":{"shortcut":"<Super>Left"},"angle":270},{"name":"Close","icon":"window-close","type":"Shortcut","data":"<Alt>F4","angle":-1},{"name":"Switcher","icon":"preferences-system-windows","type":"RunningApps","data":{"activeWorkspaceOnly":false,"appGrouping":true,"hoverPeeking":true,"nameRegex":""},"angle":-1},{"name":"Favorites","icon":"emblem-favorite","type":"Favorites","data":{},"angle":-1},{"name":"Maximize","icon":"view-fullscreen","type":"Shortcut","data":{"shortcut":"<Super>Up"},"angle":-1},{"name":"Next","icon":"go-next","type":"Shortcut","data":{"shortcut":"<Super>Right"},"angle":-1}],"type":"CustomMenu","data":{}}]''; + preview-on-right-side = true; + stashed-items = "[ ]"; + stats-abortions = mkUint32 38; + stats-added-items = mkUint32 6; + stats-click-selections-depth1 = mkUint32 15; + stats-click-selections-depth2 = mkUint32 8; + stats-click-selections-depth3 = mkUint32 7; + stats-dbus-menus = mkUint32 24; + stats-gesture-selections-depth1 = mkUint32 5; + stats-gesture-selections-depth2 = mkUint32 3; + stats-gesture-selections-depth3 = mkUint32 1; + stats-preview-menus = mkUint32 19; + stats-selections = mkUint32 39; + stats-selections-1000ms-depth1 = mkUint32 6; + stats-selections-2000ms-depth2 = mkUint32 1; + stats-selections-3000ms-depth3 = mkUint32 1; + stats-selections-750ms-depth1 = mkUint32 5; + stats-settings-opened = mkUint32 13; + stats-sponsors-viewed = mkUint32 1; + stats-tutorial-menus = mkUint32 6; + stats-unread-achievements = mkUint32 0; + text-color = "rgb(222,222,222)"; + trace-color = "rgba(0,0,0,0.462838)"; + trace-min-length = 200.0; + trace-thickness = 8.0; + wedge-color = "rgba(0,0,0,0.129992)"; + wedge-color-hover = "rgba(0,0,0,0.0747331)"; + wedge-inner-radius = 43.0; + wedge-separator-color = "rgba(255, 255, 255, 0.13)"; + wedge-separator-width = 1.0; + wedge-width = 300.0; + }; + }; +} diff --git a/files/gnome/gnome-shell.css b/files/gnome/gnome-shell.css @@ -0,0 +1,3 @@ +#panel { + background: rgba(40, 40, 40, 1); +} diff --git a/files/gnome/nix.lang b/files/gnome/nix.lang @@ -0,0 +1,245 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Author: V 7 <maydayv7@gmail.com> + Copyright (C) 2021 V 7 <maydayv7@gmail.com> + + GtkSourceView is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + GtkSourceView 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +--> +<language id="nix" _name="Nix" version="2.0" _section="Others"> + <metadata> + <property name="globs">*.nix</property> + <property name="line-comment-start">#</property> + <property name="block-comment-start">/*</property> + <property name="block-comment-end">*/</property> + </metadata> + + <styles> + <style id="escape" _name="Escaped Character" map-to="def:special-char"/> + <style id="null-value" _name="Null Value" map-to="def:special-constant"/> + <style id="boolean" _name="Boolean Value" map-to="def:boolean"/> + <style id="keyword" _name="Keyword" map-to="def:keyword"/> + <style id="string" _name="String" map-to="def:string"/> + <style id="function" _name="Function" map-to="def:builtin"/> + <style id="indented-string" _name="Indented string" map-to="def:string"/> + <style id="path" _name="Path" map-to="def:underlined"/> + <style id="uri" _name="URI" map-to="def:underlined"/> + </styles> + + <definitions> + + <!--contexts NOT used in the main context--> + <context id="antiquotation" style-ref="def:statement"> + <start>\${</start> + <end>}</end> + <include> + <context ref="nix"/> + </include> + </context> + + <context id="null-value" style-ref="null-value"> + <keyword>null</keyword> + </context> + + <context id="boolean" style-ref="boolean"> + <keyword>false</keyword> + <keyword>true</keyword> + </context> + + <context id="keywords" style-ref="keyword"> + <keyword>assert</keyword> + <keyword>builtins</keyword> + <keyword>else</keyword> + <keyword>if</keyword> + <keyword>import</keyword> + <keyword>in</keyword> + <keyword>inherit</keyword> + <keyword>inputs</keyword> + <keyword>let</keyword> + <keyword>lib</keyword> + <keyword>outputs</keyword> + <keyword>rec</keyword> + <keyword>system</keyword> + <keyword>then</keyword> + <keyword>with</keyword> + </context> + + <context id="functions" style-ref="function"> + <keyword>abort</keyword> + <keyword>add</keyword> + <keyword>addErrorContext</keyword> + <keyword>all</keyword> + <keyword>any</keyword> + <keyword>appendContext</keyword> + <keyword>attrNames</keyword> + <keyword>attrValues</keyword> + <keyword>baseNameOf</keyword> + <keyword>bitAnd</keyword> + <keyword>bitOr</keyword> + <keyword>bitXor</keyword> + <keyword>catAttrs</keyword> + <keyword>ceil</keyword> + <keyword>compareVersions</keyword> + <keyword>concatLists</keyword> + <keyword>concatMap</keyword> + <keyword>concatStringsSep</keyword> + <keyword>currentSystem</keyword> + <keyword>currentTime</keyword> + <keyword>deepSeq</keyword> + <keyword>derivation</keyword> + <keyword>derivationStrict</keyword> + <keyword>dirOf</keyword> + <keyword>div</keyword> + <keyword>elem</keyword> + <keyword>elemAt</keyword> + <keyword>fetchGit</keyword> + <keyword>fetchMercurial</keyword> + <keyword>fetchTarball</keyword> + <keyword>fetchTree</keyword> + <keyword>fetchurl</keyword> + <keyword>filter</keyword> + <keyword>filterSource</keyword> + <keyword>findFile</keyword> + <keyword>floor</keyword> + <keyword>foldl</keyword> + <keyword>fromJSON</keyword> + <keyword>fromTOML</keyword> + <keyword>functionArgs</keyword> + <keyword>genList</keyword> + <keyword>genericClosure</keyword> + <keyword>getAttr</keyword> + <keyword>getContext</keyword> + <keyword>getEnv</keyword> + <keyword>getFlake</keyword> + <keyword>groupBy</keyword> + <keyword>hasAttr</keyword> + <keyword>hasContext</keyword> + <keyword>hashFile</keyword> + <keyword>hashString</keyword> + <keyword>head</keyword> + <keyword>intersectAttrs</keyword> + <keyword>isAttrs</keyword> + <keyword>isBool</keyword> + <keyword>isFloat</keyword> + <keyword>isFunction</keyword> + <keyword>isInt</keyword> + <keyword>isList</keyword> + <keyword>isNull</keyword> + <keyword>isPath</keyword> + <keyword>isString</keyword> + <keyword>langVersion</keyword> + <keyword>length</keyword> + <keyword>lessThan</keyword> + <keyword>listToAttrs</keyword> + <keyword>map</keyword> + <keyword>mapAttrs</keyword> + <keyword>match</keyword> + <keyword>mul</keyword> + <keyword>nixPath</keyword> + <keyword>nixVersion</keyword> + <keyword>parseDrvName</keyword> + <keyword>partition</keyword> + <keyword>path</keyword> + <keyword>pathExists</keyword> + <keyword>placeholder</keyword> + <keyword>readDir</keyword> + <keyword>readFile</keyword> + <keyword>removeAttrs</keyword> + <keyword>replaceStrings</keyword> + <keyword>scopedImport</keyword> + <keyword>seq</keyword> + <keyword>sort</keyword> + <keyword>split</keyword> + <keyword>splitVersion</keyword> + <keyword>storeDir</keyword> + <keyword>storePath</keyword> + <keyword>stringLength</keyword> + <keyword>sub</keyword> + <keyword>substring</keyword> + <keyword>tail</keyword> + <keyword>throw</keyword> + <keyword>toFile</keyword> + <keyword>toJSON</keyword> + <keyword>toPath</keyword> + <keyword>toString</keyword> + <keyword>toXML</keyword> + <keyword>trace</keyword> + <keyword>tryEval</keyword> + <keyword>typeOf</keyword> + <keyword>unsafeDiscardOutputDependency</keyword> + <keyword>unsafeDiscardStringContext</keyword> + <keyword>unsafeGetAttrPos</keyword> + <keyword>zipAttrsWith</keyword> + </context> + + <context id="indented-string" style-ref="indented-string" class="string" class-disabled="no-spell-check"> + <start>''</start> + <end>''</end> + <include> + <context id="indented-string-escape-antiquotation" style-ref="escape"> + <match>''\${</match> + </context> + <context id="indented-string-escape" style-ref="escape"> + <match>''\\.</match> + </context> + <context ref="antiquotation"/> + </include> + </context> + + <context id="string" style-ref="indented-string" class="string" class-disabled="no-spell-check"> + <start>"</start> + <end>"</end> + <include> + <context ref="def:escape"/> + <context ref="antiquotation"/> + </include> + </context> + + <context id="operators" style-ref="def:operator" extend-parent="false"> + <match>@|:|(//)|\+|\?|(==)|(\|\|)|(&amp;&amp;)|!|(->)</match> + </context> + + <context id="path" style-ref="path" class="path"> + <match case-sensitive="false">(/|\./|\.\./)[a-zA-Z0-9\./\-_]*</match> + </context> + + <context id="uri" style-ref="uri" class="uri"> + <match case-sensitive="false">\%{def:net-address}</match> + </context> + + <!--main context--> + <context id="nix" class="no-spell-check"> + <include> + <context ref="def:shell-like-comment"/> + <context ref="def:c-like-comment-multiline"/> + <context ref="def:c-like-close-comment-outside-comment"/> + <context ref="indented-string"/> + <context ref="string" style-ref="string"/> + <context ref="def:float"/> + <context ref="def:decimal"/> + <context ref="boolean"/> + <context ref="keywords"/> + <context ref="functions"/> + <context ref="null-value"/> + <context ref="operators"/> + <context ref="path"/> + <context ref="uri"/> + </include> + </context> + <!--main context--> + + </definitions> +</language> diff --git a/files/gnome/tango-dark.xml b/files/gnome/tango-dark.xml @@ -0,0 +1,144 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + This file is part of GtkSourceView + + Copyright (C) 2006-2007 GtkSourceView team + Author: Michael Monreal <michael.monreal@gmail.com> + + GtkSourceView is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + GtkSourceView 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; if not, see <http://www.gnu.org/licenses/>. + +--> +<style-scheme id="tango-dark" _name="Tango Dark" version="1.0"> + <author>Michael Monreal</author> + <_description>Color scheme using Tango Dark color palette</_description> + + <!-- Tango Dark Palette --> + <color name="butter1" value="#fce94f"/> + <color name="butter2" value="#edd400"/> + <color name="butter3" value="#c4a000"/> + <color name="chameleon1" value="#8ae234"/> + <color name="chameleon2" value="#73d216"/> + <color name="chameleon3" value="#4e9a06"/> + <color name="orange1" value="#fcaf3e"/> + <color name="orange2" value="#f57900"/> + <color name="orange3" value="#ce5c00"/> + <color name="skyblue1" value="#729fcf"/> + <color name="skyblue2" value="#3465a4"/> + <color name="skyblue3" value="#204a87"/> + <color name="plum1" value="#ad7fa8"/> + <color name="plum2" value="#75507b"/> + <color name="plum3" value="#5c3566"/> + <color name="chocolate1" value="#e9b96e"/> + <color name="chocolate2" value="#c17d11"/> + <color name="chocolate3" value="#8f5902"/> + <color name="scarletred1" value="#ef2929"/> + <color name="scarletred2" value="#cc0000"/> + <color name="scarletred3" value="#a40000"/> + <color name="aluminium1" value="#eeeeec"/> + <color name="aluminium2" value="#d3d7cf"/> + <color name="aluminium3" value="#babdb6"/> + <color name="aluminium4" value="#888a85"/> + <color name="aluminium5" value="#555753"/> + <color name="aluminium6" value="#2e3436"/> + + <!-- Global Settings --> + <style name="line-numbers" background="#rgba(18,20,21,0.005)"/> + <style name="current-line" background="aluminium5"/> + <style name="current-line-number" background="aluminium5"/> + <style name="draw-spaces" foreground="aluminium3"/> + <style name="background-pattern" background="#f3f3f3"/> + + <!-- Bracket Matching --> + <style name="bracket-match" foreground="aluminium1" background="aluminium3"/> + <style name="bracket-mismatch" foreground="aluminium1" background="scarletred3"/> + + <!-- Right Margin --> + <style name="right-margin" foreground="aluminium6" background="aluminium6"/> + + <!-- Search Matching --> + <style name="search-match" background="butter1"/> + + <!-- Comments --> + <style name="def:comment" foreground="skyblue3"/> + <style name="def:shebang" foreground="skyblue3" bold="true"/> + <style name="def:doc-comment-element" italic="true"/> + + <!-- Constants --> + <style name="def:constant" foreground="plum1"/> + <style name="def:special-char" foreground="plum3"/> + + <!-- Identifiers --> + <style name="def:identifier" foreground="skyblue2"/> + + <!-- Statements --> + <style name="def:statement" foreground="scarletred3" bold="true"/> + + <!-- Types --> + <style name="def:type" foreground="chameleon3" bold="true"/> + + <!-- Markup --> + <style name="def:emphasis" italic="true"/> + <style name="def:strong-emphasis" foreground="scarletred3" bold="true"/> + <style name="def:inline-code" foreground="skyblue2"/> + <style name="def:insertion" underline="single"/> + <style name="def:deletion" strikethrough="true"/> + <style name="def:link-text" foreground="skyblue3"/> + <style name="def:link-symbol" foreground="skyblue3" bold="true"/> + <style name="def:link-destination" italic="true" underline="single"/> + <style name="def:heading" foreground="chameleon3" bold="true"/> + <style name="def:thematic-break" foreground="chameleon3" bold="true"/> + <style name="def:preformatted-section" foreground="skyblue2"/> + <style name="def:list-marker" foreground="scarletred3" bold="true"/> + + <!-- Others --> + <style name="def:preprocessor" foreground="chocolate3"/> + <style name="def:error" background="scarletred2" bold="true"/> + <style name="def:warning" background="plum1"/> + <style name="def:note" background="orange1" bold="true"/> + <style name="def:net-address" italic="true" underline="single"/> + + <!-- Heading styles, uncomment to enable --> + <!-- + <style name="def:heading0" scale="5.0"/> + <style name="def:heading1" scale="2.5"/> + <style name="def:heading2" scale="2.0"/> + <style name="def:heading3" scale="1.7"/> + <style name="def:heading4" scale="1.5"/> + <style name="def:heading5" scale="1.3"/> + <style name="def:heading6" scale="1.2"/> + --> + + <!-- Language specific --> + <style name="diff:added-line" foreground="chameleon3"/> + <style name="diff:removed-line" foreground="plum3"/> + <style name="diff:changed-line" use-style="def:preprocessor"/> + <style name="diff:diff-file" use-style="def:type"/> + <style name="diff:location" use-style="def:statement"/> + <style name="diff:special-case" use-style="def:constant"/> + + <style name="xml:tags" foreground="chameleon3"/> + <style name="xml:namespace" bold="true"/> + + <style name="js:built-in-constructor" foreground="chameleon3"/> + + <style name="latex:display-math" foreground="plum3"/> + <style name="latex:command" foreground="chameleon3" bold="true"/> + <style name="latex:include" use-style="def:preprocessor"/> + <style name="latex:special-char" use-style="def:constant"/> + + <style name="sh:variable" foreground="plum3"/> + <style name="sh:variable-definition" foreground="chameleon3"/> + +</style-scheme> diff --git a/files/gtk/bookmarks b/files/gtk/bookmarks @@ -0,0 +1,2 @@ +file:///data/files Files +file:/// Computer diff --git a/files/images/Profile.png b/files/images/Profile.png Binary files differ. diff --git a/files/images/desktop.png b/files/images/desktop.png Binary files differ. diff --git a/files/images/logo.png b/files/images/logo.png Binary files differ. diff --git a/files/images/wallpapers/Beauty.jpg b/files/images/wallpapers/Beauty.jpg Binary files differ. diff --git a/files/images/wallpapers/City.jpg b/files/images/wallpapers/City.jpg Binary files differ. diff --git a/files/images/wallpapers/Firewatch.jpg b/files/images/wallpapers/Firewatch.jpg Binary files differ. diff --git a/files/images/wallpapers/Future.jpg b/files/images/wallpapers/Future.jpg Binary files differ. diff --git a/files/images/wallpapers/Island.jpg b/files/images/wallpapers/Island.jpg Binary files differ. diff --git a/files/images/wallpapers/Metro.jpg b/files/images/wallpapers/Metro.jpg Binary files differ. diff --git a/files/images/wallpapers/Neon.jpg b/files/images/wallpapers/Neon.jpg Binary files differ. diff --git a/files/images/wallpapers/Saturn.jpg b/files/images/wallpapers/Saturn.jpg Binary files differ. diff --git a/files/images/wallpapers/Shards.jpg b/files/images/wallpapers/Shards.jpg Binary files differ. diff --git a/files/images/wallpapers/Sunrise.jpg b/files/images/wallpapers/Sunrise.jpg Binary files differ. diff --git a/files/images/wallpapers/Sunset.jpg b/files/images/wallpapers/Sunset.jpg Binary files differ. diff --git a/files/images/wallpapers/Tomorrow.jpg b/files/images/wallpapers/Tomorrow.jpg Binary files differ. diff --git a/files/nano/nanorc b/files/nano/nanorc @@ -0,0 +1,8 @@ +set autoindent +set indicator +set linenumbers +set locking +set minibar +set mouse +set nonewlines +set smarthome diff --git a/files/neofetch/config.conf b/files/neofetch/config.conf @@ -0,0 +1,603 @@ +# ################################################################## # +# My Epic Neofetch Config # +# Wiki: https://github.com/dylanaraps/neofetch/wiki/Customizing-Info # +# ################################################################## # + +print_info() { + prin "Software Information" + info " " distro + info " " kernel + info " " packages + info " " de + info " " theme + info " " icons + info " " term_font + + info underline + prin "Hardware Information" + info " " model + info " " cpu + info "﬙ " gpu + info " " disk + info " " resolution + info "⊗ " uptime + info battery + + info cols +} + +## Title ## +## Hide/Show fully-qualified Domain Name +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --title_fqdn +title_fqdn="off" + +## Kernel ## +## Shorten the Output of the Kernel Function +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --kernel_shorthand +kernel_shorthand="off" + +## Distro ## +## Shorten the Output of the Distro Function +# +# Default: 'off' +# Values: 'on', 'tiny', 'off' +# Flag: --distro_shorthand +distro_shorthand="off" + +## Show/Hide OS Architecture +# Show 'x86_64', 'x86' and etc in 'Distro:' output. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --os_arch +os_arch="off" + +## Uptime ## +## Shorten the Output of the Uptime Function +# +# Default: 'on' +# Values: 'on', 'tiny', 'off' +# Flag: --uptime_shorthand +uptime_shorthand="tiny" + +## Memory ## +## Show Percentage in Output +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --memory_percent +memory_percent="off" + +## Change Unit +# +# Default: 'mib' +# Values: 'kib', 'mib', 'gib' +# Flag: --memory_unit +memory_unit="gib" + +## Packages ## +## Show/Hide Package Manager +# +# Default: 'tiny' +# Values: 'on', 'tiny' 'off' +# Flag: --package_managers +package_managers="tiny" + +## Shell ## +## Show the path to $SHELL +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --shell_path +shell_path="off" + +## Show $SHELL version +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --shell_version +shell_version="on" + +## CPU ## +## Speed Type +# +# Default: 'bios_limit' +# Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'. +# Flag: --speed_type +speed_type="bios_limit" + +## Speed Shorthand +# +# Default: 'off' +# Values: 'on', 'off'. +# Flag: --speed_shorthand +speed_shorthand="off" + +## Enable/Disable Brand in Output +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --cpu_brand +cpu_brand="on" + +## Speed +# Hide/Show CPU Speed +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --cpu_speed +cpu_speed="on" + +## Cores +# Display CPU Cores in Output +# +# Default: 'logical' +# Values: 'logical', 'physical', 'off' +# Flag: --cpu_cores +cpu_cores="logical" + +## Temperature +# Hide/Show CPU Temperature +# +# Default: 'off' +# Values: 'C', 'F', 'off' +# Flag: --cpu_temp +cpu_temp="off" + +## GPU ## +## Enable/Disable Brand +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gpu_brand +gpu_brand="on" + +## Preferred GPU +# +# Default: 'all' +# Values: 'all', 'dedicated', 'integrated' +# Flag: --gpu_type +gpu_type="all" + +## Resolution +# Display Refresh Rate +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --refresh_rate +refresh_rate="off" + +## GTK+ Theme / Icons / Font ## +## Shorten Output +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --gtk_shorthand +gtk_shorthand="off" + +## Enable/Disable GTK+2 Theme / Icons / Font +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gtk2 +gtk2="off" + +## Enable/Disable GTK+3 Theme / Icons / Font +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gtk3 +gtk3="on" + +## IP Address ## +## Website to Ping +# +# Default: 'http://ident.me' +# Values: 'url' +# Flag: --ip_host +public_ip_host="http://ident.me" + +## Timeout +# +# Default: '2' +# Values: 'int' +# Flag: --ip_timeout +public_ip_timeout=2 + +## Desktop Environment ## +# Show Desktop Environment version +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --de_version +de_version="on" + +## Disk ## +## Preferred Disks +# The values can be any /dev/sdXX, Mount Point or Directory +# +# Default: '/' +# Values: '/', '/dev/sdXX', '/path/to/drive'. +# Flag: --disk_show +disk_show=('/') + +## Subtitles +# What to append to the Disk Subtitle +# +# Default: 'mount' +# Values: 'mount', 'name', 'dir', 'none' +# Flag: --disk_subtitle +disk_subtitle="mount" + +## Percentage +# Show/Hide Disk Percent +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --disk_percent +disk_percent="on" + +## Song ## +# Preferred Music Player +# +# Default: 'auto' +# Values: 'auto', 'player-name' +# Flag: --music_player +# +# Available values for 'player-name': +# +# amarok +# audacious +# banshee +# bluemindo +# clementine +# cmus +# deadbeef +# deepin-music +# dragon +# elisa +# exaile +# gnome-music +# gmusicbrowser +# gogglesmm +# guayadeque +# io.elementary.music +# iTunes +# juk +# lollypop +# mocp +# mopidy +# mpd +# muine +# netease-cloud-music +# olivia +# playerctl +# pogo +# pragha +# qmmp +# quodlibet +# rhythmbox +# sayonara +# smplayer +# spotify +# strawberry +# tauonmb +# tomahawk +# vlc +# xmms2d +# xnoise +# yarock +music_player="auto" + +## Information Format +# +# Default: '%artist% - %album% - %title%' +# Values: '%artist%', '%album%', '%title%' +# Flag: --song_format +song_format="%artist% - %album% - %title%" + +# Print Information on separate lines +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --song_shorthand +song_shorthand="off" + +# 'mpc' Arguments +# +# Default: '' +# Example: mpc_args=(-h HOST -P PASSWORD) +mpc_args=() + +## Text ## +## Colors +# +# Default: 'distro' +# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' +# Flag: --colors +# +# Each number represents a different part of the text in +# this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info' +colors=(4 7 7 4 7 6) + +## Options +## Toggle Bold Text +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --bold +bold="on" + +## Enable/Disable Underline +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --underline +underline_enabled="on" + +## Underline Character +# +# Default: '-' +# Values: 'string' +# Flag: --underline_char +underline_char="-" + +## Information Separator +# Replace the default separator with the specified string. +# +# Default: ':' +# Flag: --separator +# +# Example: +# separator="->": 'Shell-> bash' +# separator=" =": 'WM = dwm' +separator=":" + +## Color Blocks ## +## Range +# The range of Colors to Print +# +# Default: '0', '15' +# Values: 'num' +# Flag: --block_range +block_range=(0 15) + +## Toggle +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --color_blocks +color_blocks="on" + +## Width (in spaces) +# +# Default: '3' +# Values: 'num' +# Flag: --block_width +block_width=3 + +## Height (in lines) +# +# Default: '1' +# Values: 'num' +# Flag: --block_height +block_height=1 + +## Color Alignment +# +# Default: 'auto' +# Values: 'auto', 'num' +# Flag: --col_offset +# +# Number specifies how far from the left side of the terminal (in spaces) to +# begin printing the columns, in case you want to e.g. center them under your +# text +col_offset="auto" + +## Progress Bars ## +## Characters +# +# Default: '-', '=' +# Values: 'string', 'string' +# Flag: --bar_char +bar_char_elapsed="-" +bar_char_total="=" + +## Toggle Border +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --bar_border +bar_border="on" + +## Length (in spaces) +# Number of characters long to make the Bars +# +# Default: '15' +# Values: 'num' +# Flag: --bar_length +bar_length=15 + +## Colors +# When set to distro, uses your distro's logo colors. +# +# Default: 'distro', 'distro' +# Values: 'distro', 'num' +# Flag: --bar_colors +bar_color_elapsed="distro" +bar_color_total="distro" + +## Information Display +# Display a Bar with the Information +# +# Default: 'off' +# Values: 'bar', 'infobar', 'barinfo', 'off' +# Flags: --cpu_display +# --memory_display +# --battery_display +# --disk_display +cpu_display="off" +memory_display="off" +battery_display="barinfo" +disk_display="off" + +## Backend Settings ## +## Image Backend +# +# Default: 'ascii' +# Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', +# 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' +# Flag: --backend +image_backend="ascii" + +## Image Source +# Which Image or Ascii File to Display +# +# Default: 'auto' +# Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' +# 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")' +# Flag: --source +image_source="auto" + +## Ascii Options ## +## Distro +# Which Distro's Ascii Art to Display +# +# Default: 'auto' +# Values: 'auto', 'distro_name' +# Flag: --ascii_distro +# NOTE: AIX, Alpine, Anarchy, Android, Antergos, antiX, "AOSC OS", +# "AOSC OS/Retro", Apricity, ArcoLinux, ArchBox, ARCHlabs, +# ArchStrike, XFerience, ArchMerge, Arch, Artix, Arya, Bedrock, +# Bitrig, BlackArch, BLAG, BlankOn, BlueLight, bonsai, BSD, +# BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS, +# Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover, +# Condres, Container_Linux, CRUX, Cucumber, Debian, Deepin, +# DesaOS, Devuan, DracOS, DarkOs, DragonFly, Drauger, Elementary, +# EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD, +# FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, Pentoo, +# gNewSense, GNOME, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra, +# Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion, +# Korora, KSLinux, Kubuntu, LEDE, LFS, Linux_Lite, +# LMDE, Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva, +# Manjaro, Maui, Mer, Minix, LinuxMint, MX_Linux, Namib, +# Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nurunner, +# NuTyX, OBRevenge, OpenBSD, openEuler, OpenIndiana, openmamba, +# OpenMandriva, OpenStage, OpenWrt, osmc, Oracle, OS Elbrus, PacBSD, +# Parabola, Pardus, Parrot, Parsix, TrueOS, PCLinuxOS, Peppermint, +# popos, Porteus, PostMarketOS, Proxmox, Puppy, PureOS, Qubes, Radix, +# Raspbian, Reborn_OS, Redstar, Redcore, Redhat, Refracted_Devuan, +# Regata, Rosa, sabotage, Sabayon, Sailfish, SalentOS, Scientific, +# Septor, SereneLinux, SharkLinux, Siduction, Slackware, SliTaz, +# SmartOS, Solus, Source_Mage, Sparky, Star, SteamOS, SunOS, +# openSUSE_Leap, openSUSE_Tumbleweed, openSUSE, SwagArch, Tails, +# Trisquel, Ubuntu-Budgie, Ubuntu-GNOME, Ubuntu-MATE, Ubuntu-Studio, +# Ubuntu, Venom, Void, Obarun, windows10, Windows7, Xubuntu, Zorin, +# and IRIX have ascii logos +# NOTE: Arch, Ubuntu, Redhat, and Dragonfly have 'old' logo variants. +# Use '{distro name}_old' to use the old logos. +# NOTE: Ubuntu has flavor variants. +# Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu-GNOME, +# Ubuntu-Studio, Ubuntu-Mate or Ubuntu-Budgie to use the flavors. +# NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu, +# CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android, +# Antrix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola, +# Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS, +# Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian, +# postmarketOS, and Void have a smaller logo variant. +# Use '{distro name}_small' to use the small variants. +ascii_distro="auto" + +## Colors +# +# Default: 'distro' +# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' +# Flag: --ascii_colors +ascii_colors=(6) + +## Bold Ascii Logo +# Whether or not to Bold the Ascii Logo +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --ascii_bold +ascii_bold="on" + +## Image Options ## +## Loop +# Setting this to on will make 'neofetch' Redraw the Image Constantly until +# Ctrl+C is pressed. This fixes Display Issues in some Terminals +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --loop +image_loop="off" + +## Thumbnail Directory +# +# Default: '~/.cache/thumbnails/neofetch' +# Values: 'dir' +thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" + +## Crop Mode +# +# Default: 'normal' +# Values: 'normal', 'fit', 'fill' +# Flag: --crop_mode +crop_mode="normal" + +## Crop Offset +# +# Default: 'center' +# Values: 'northwest', 'north', 'northeast', 'west', 'center' +# 'east', 'southwest', 'south', 'southeast' +# Flag: --crop_offset +crop_offset="center" + +## Image Size +# The Image is Half the Terminal Width by default +# +# Default: 'auto' +# Values: 'auto', '00px', '00%', 'none' +# Flags: --image_size +# --size +image_size="auto" + +## Gap between Image and Text +# +# Default: '3' +# Values: 'num', '-num' +# Flag: --gap +gap=3 + +## Image Offsets +# Only works with the 'w3m' Backend +# +# Default: '0' +# Values: 'px' +# Flags: --xoffset +# --yoffset +yoffset=0 +xoffset=0 + +## Background Color +# Only works with the 'w3m' Backend +# +# Default: '' +# Values: 'color', 'blue' +# Flag: --bg_color +background_color= + +## Miscellaneous ## +## 'stdout' Mode +# Turns off all Colors and disables Image Backend (ASCII/Image) +# Useful for Piping into another command +# Default: 'off' +# Values: 'on', 'off' +stdout="off" diff --git a/files/plank/dock.desktop b/files/plank/dock.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=0.9.4 +Type=Application +Name=Dock +Comment= +Exec=plank +OnlyShowIn=XFCE; +RunHook=0 +StartupNotify=false +Terminal=false +Hidden=false diff --git a/files/plank/dock.theme b/files/plank/dock.theme @@ -0,0 +1,34 @@ +## Plank Dock Theme ## + +[PlankTheme] +TopRoundness=75 +BottomRoundness=0 +LineWidth=0 +OuterStrokeColor=0;;0;;0;;0 +FillStartColor=165;;165;;176;;91 +FillEndColor=165;;165;;176;;71 +InnerStrokeColor=0;;0;;0;;0 + +[PlankDockTheme] +HorizPadding=5 +TopPadding=-6 +BottomPadding=1 +ItemPadding=3 +IndicatorSize=7 +IconShadowSize=1.25 +UrgentBounceHeight=1.75 +LaunchBounceHeight=0.625 +FadeOpacity=1 +ClickTime=175 +UrgentBounceTime=600 +LaunchBounceTime=600 +ActiveTime=25 +SlideTime=4750 +FadeTime=350 +HideTime=725 +GlowSize=30 +GlowTime=10000 +GlowPulseTime=2750 +UrgentHueShift=175 +ItemMoveTime=450 +CascadeHide=true diff --git a/files/plank/launchers/firefox.dockitem b/files/plank/launchers/firefox.dockitem @@ -0,0 +1,2 @@ +[PlankDockItemPreferences] +Launcher=file:///etc/profiles/per-user/v7/share/applications/firefox.desktop diff --git a/files/plank/launchers/org.xfce.mousepad.dockitem b/files/plank/launchers/org.xfce.mousepad.dockitem @@ -0,0 +1,2 @@ +[PlankDockItemPreferences] +Launcher=file:///run/current-system/sw/share/applications/org.xfce.mousepad.desktop diff --git a/files/plank/launchers/thunar.dockitem b/files/plank/launchers/thunar.dockitem @@ -0,0 +1,2 @@ +[PlankDockItemPreferences] +Launcher=file:///run/current-system/sw/share/applications/thunar.desktop diff --git a/files/plank/launchers/xfce-settings-manager.dockitem b/files/plank/launchers/xfce-settings-manager.dockitem @@ -0,0 +1,2 @@ +[PlankDockItemPreferences] +Launcher=file:///run/current-system/sw/share/applications/xfce-settings-manager.desktop diff --git a/files/plank/launchers/xfce4-terminal.dockitem b/files/plank/launchers/xfce4-terminal.dockitem @@ -0,0 +1,2 @@ +[PlankDockItemPreferences] +Launcher=file:///run/current-system/sw/share/applications/xfce4-terminal.desktop diff --git a/files/templates/Document.docx b/files/templates/Document.docx Binary files differ. diff --git a/files/templates/File b/files/templates/File diff --git a/files/templates/Presentation.pptx b/files/templates/Presentation.pptx Binary files differ. diff --git a/files/templates/Spreadsheet.xlsx b/files/templates/Spreadsheet.xlsx Binary files differ. diff --git a/files/touchegg/touchegg.conf b/files/touchegg/touchegg.conf @@ -0,0 +1,109 @@ +<touchégg> +<!-- My Epic Touchegg X11 Gestures Config --> + <settings> + <!-- + Delay (in ms), since the Gesture starts before animation + Default: 150ms + --> + <property name="animation_delay">150</property> + + <!-- + Percentage of the Gesture to be completed to apply action + Default: 20% + --> + <property name="action_execute_threshold">20</property> + + <!-- + Global animation Colors + Specify Hex Code or use 'auto' + --> + <property name="color">auto</property> + <property name="borderColor">auto</property> + </settings> + + <!-- + Configuration for every application + --> + + <application name="All"> + <gesture type="SWIPE" fingers="4" direction="UP"> + <action type="MAXIMIZE_RESTORE_WINDOW"> + <animate>true</animate> + </action> + </gesture> + + <gesture type="SWIPE" fingers="4" direction="DOWN"> + <action type="MINIMIZE_WINDOW"> + <animate>true</animate> + </action> + </gesture> + + <gesture type="SWIPE" fingers="4" direction="LEFT"> + <action type="TILE_WINDOW"> + <direction>left</direction> + <animate>true</animate> + </action> + </gesture> + + <gesture type="SWIPE" fingers="4" direction="RIGHT"> + <action type="TILE_WINDOW"> + <direction>right</direction> + <animate>true</animate> + </action> + </gesture> + + <gesture type="PINCH" fingers="4" direction="IN"> + <action type="CLOSE_WINDOW"> + <animate>true</animate> + <color>F84A53</color> + <borderColor>F84A53</borderColor> + </action> + </gesture> + + <gesture type="PINCH" fingers="4" direction="OUT"> + <action type="CLOSE_WINDOW"> + <animate>true</animate> + <color>F84A53</color> + <borderColor>F84A53</borderColor> + </action> + </gesture> + + <gesture type="TAP" fingers="2"> + <action type="MOUSE_CLICK"> + <button>3</button> + <on>begin</on> + </action> + </gesture> + + <gesture type="TAP" fingers="3"> + <action type="MOUSE_CLICK"> + <button>2</button> + <on>begin</on> + </action> + </gesture> + </application> + + <!-- + Configuration for specific applications + --> + + <application name="Google-chrome,Chromium-browser,Firefox"> + <gesture type="PINCH" fingers="2" direction="IN"> + <action type="SEND_KEYS"> + <repeat>true</repeat> + <modifiers>Control_L</modifiers> + <keys>KP_Subtract</keys> + <decreaseKeys>KP_Add</decreaseKeys> + </action> + </gesture> + + <gesture type="PINCH" fingers="2" direction="OUT"> + <action type="SEND_KEYS"> + <repeat>true</repeat> + <modifiers>Control_L</modifiers> + <keys>KP_Add</keys> + <decreaseKeys>KP_Subtract</decreaseKeys> + </action> + </gesture> + </application> +</touchégg> diff --git a/files/vscode/keybindings.json b/files/vscode/keybindings.json @@ -0,0 +1,14 @@ +[ + { + "key": "meta+/", + "command": "workbench.action.showCommands" + }, + { + "key": "ctrl+d", + "command": "editor.action.deleteLines" + }, + { + "key": "alt+t", + "command": "workbench.action.terminal.focus" + } +] diff --git a/files/vscode/settings.json b/files/vscode/settings.json @@ -0,0 +1,42 @@ +{ + "better-comments.highlightPlainText": true, + "editor.cursorSmoothCaretAnimation": true, + "editor.cursorStyle": "line-thin", + "editor.formatOnSave": true, + "editor.smoothScrolling": true, + "editor.suggest.preview": true, + "editor.suggest.showStatusBar": true, + "editor.unfoldOnClickAfterEndOfLine": true, + "explorer.incrementalNaming": "smart", + "explorer.openEditors.visible": 7, + "extensions.autoCheckUpdates": false, + "extensions.autoUpdate": false, + "extensions.ignoreRecommendations": true, + "files.autoSave": "onWindowChange", + "files.trimFinalNewlines": true, + "gitlens.advanced.commitOrdering": "date", + "gitlens.advanced.fileHistoryFollowsRenames": true, + "nix.enableLanguageServer": true, + "nix.formatterPath": "alejandra", + "scm.repositories.visible": 7, + "search.showLineNumbers": true, + "search.smartCase": true, + "search.useGlobalIgnoreFiles": true, + "search.useParentIgnoreFiles": true, + "terminal.integrated.cursorStyle": "line", + "terminal.integrated.enableBell": true, + "terminal.integrated.tabs.separator": " / ", + "update.mode": "none", + "window.closeWhenEmpty": true, + "window.dialogStyle": "custom", + "window.doubleClickIconToClose": true, + "window.menuBarVisibility": "toggle", + "window.titleSeparator": " / ", + "window.zoomLevel": 1, + "workbench.commandPalette.preserveInput": true, + "workbench.editor.highlightModifiedTabs": true, + "workbench.iconTheme": "file-icons", + "workbench.list.horizontalScrolling": true, + "workbench.list.smoothScrolling": true, + "workbench.startupEditor": "readme" +} diff --git a/files/wine/theme.msstyles b/files/wine/theme.msstyles Binary files differ. diff --git a/files/xdg/mime.nix b/files/xdg/mime.nix @@ -0,0 +1,68 @@ +{ + audio = [ + "audio/aac" + "audio/mpeg" + "audio/ogg" + "audio/opus" + "audio/wav" + "audio/webm" + "audio/x-matroska" + ]; + + browser = [ + "text/html" + "x-scheme-handler/about" + "x-scheme-handler/http" + "x-scheme-handler/https" + "x-scheme-handler/unknown" + ]; + + calendar = ["text/calendar" "x-scheme-handler/webcal"]; + + directory = ["inode/directory"]; + + image = [ + "image/bmp" + "image/gif" + "image/jpeg" + "image/jpg" + "image/png" + "image/svg+xml" + "image/tiff" + "image/vnd.microsoft.icon" + "image/webp" + ]; + + magnet = ["x-scheme-handler/magnet"]; + + mail = ["x-scheme-handler/mailto"]; + + markdown = ["text/markdown"]; + + office = [ + "application/vnd.oasis.opendocument.text" + "application/vnd.oasis.opendocument.spreadsheet" + "application/vnd.oasis.opendocument.presentation" + "application/vnd.openxmlformats-officedocument.wordprocessingml.document" + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + "application/vnd.openxmlformats-officedocument.presentationml.presentation" + "application/msword" + "application/vnd.ms-excel" + "application/vnd.ms-powerpoint" + ]; + + pdf = ["application/pdf"]; + + text = ["text/plain"]; + + video = [ + "video/mp2t" + "video/mp4" + "video/mpeg" + "video/ogg" + "video/webm" + "video/x-flv" + "video/x-matroska" + "video/x-msvideo" + ]; +} diff --git a/files/xfce/gtk.css b/files/xfce/gtk.css @@ -0,0 +1,6 @@ +.xfce4-panel { + border-top-left-radius: 15px; + border-top-right-radius: 15px; + border-bottom-left-radius: 15px; + border-bottom-right-radius: 15px; +} diff --git a/files/xfce/panel.txt b/files/xfce/panel.txt @@ -0,0 +1,102 @@ +# Panel Configuration Backup +# Compress using 'bunzip2' + +/configver 2 +/panels [<0>] +/panels/dark-mode true +/panels/panel-0/autohide-behavior uint32 1 +/panels/panel-0/background-alpha uint32 80 +/panels/panel-0/background-rgba [<1.0>, <1.0>, <1.0>, <0.477966>] +/panels/panel-0/background-style uint32 0 +/panels/panel-0/disable-struts false +/panels/panel-0/enter-opacity uint32 100 +/panels/panel-0/icon-size uint32 0 +/panels/panel-0/leave-opacity uint32 95 +/panels/panel-0/length uint32 90 +/panels/panel-0/length-adjust true +/panels/panel-0/mode uint32 0 +/panels/panel-0/nrows uint32 1 +/panels/panel-0/plugin-ids [<1>, <15>, <22>, <18>, <3>, <16>, <4>, <19>, <17>, <2>, <6>, <5>, <7>, <8>, <20>, <9>, <10>, <11>, <13>, <14>] +/panels/panel-0/position 'p=0;x=946;y=27' +/panels/panel-0/position-locked true +/panels/panel-0/size uint32 27 +/panels/panel-0/span-monitors false +/plugins/clipman/tweaks/paste-on-activate uint32 2 +/plugins/clipman/tweaks/popup-at-pointer true +/plugins/plugin-1 'separator' +/plugins/plugin-1/style uint32 0 +/plugins/plugin-10 'actions' +/plugins/plugin-10/appearance uint32 1 +/plugins/plugin-10/ask-confirmation true +/plugins/plugin-10/button-title uint32 0 +/plugins/plugin-10/invert-orientation false +/plugins/plugin-10/items [<'+lock-screen'>, <'+separator'>, <'+suspend'>, <'+hibernate'>, <'+separator'>, <'-hybrid-sleep'>, <'+restart'>, <'+shutdown'>, <'+separator'>, <'+switch-user'>, <'-logout-dialog'>, <'+logout'>] +/plugins/plugin-11 'separator' +/plugins/plugin-11/expand false +/plugins/plugin-11/style uint32 0 +/plugins/plugin-13 'notification-plugin' +/plugins/plugin-14 'separator' +/plugins/plugin-14/expand false +/plugins/plugin-14/style uint32 0 +/plugins/plugin-15 'whiskermenu' +/plugins/plugin-16 'namebar' +/plugins/plugin-17 'xfce4-notes-plugin' +/plugins/plugin-18 'eyes' +/plugins/plugin-19 'screenshooter' +/plugins/plugin-2 'xfce4-clipman-plugin' +/plugins/plugin-20 'weather' +/plugins/plugin-20/cache-max-age 172800 +/plugins/plugin-20/forecast/days 5 +/plugins/plugin-20/forecast/layout 1 +/plugins/plugin-20/location/latitude '17.425400' +/plugins/plugin-20/location/longitude '78.507500' +/plugins/plugin-20/location/name 'Hyderabad, India' +/plugins/plugin-20/msl 529 +/plugins/plugin-20/offset '+05:30' +/plugins/plugin-20/power-saving true +/plugins/plugin-20/round true +/plugins/plugin-20/scrollbox/animate true +/plugins/plugin-20/scrollbox/color 'rgba(0,0,0,0)' +/plugins/plugin-20/scrollbox/lines 1 +/plugins/plugin-20/scrollbox/show true +/plugins/plugin-20/scrollbox/use-color false +/plugins/plugin-20/single-row true +/plugins/plugin-20/theme-dir '/nix/store/qrb3nm6l6mz283ifjchn2idw2d7l8mi5-xfce4-weather-plugin-0.11.0/share/xfce4/weather/icons/liquid' +/plugins/plugin-20/timezone 'Asia/Kolkata' +/plugins/plugin-20/tooltip-style 1 +/plugins/plugin-20/units/altitude 0 +/plugins/plugin-20/units/apparent-temperature 0 +/plugins/plugin-20/units/precipitation 0 +/plugins/plugin-20/units/pressure 0 +/plugins/plugin-20/units/temperature 0 +/plugins/plugin-20/units/windspeed 0 +/plugins/plugin-22 'separator' +/plugins/plugin-22/style uint32 0 +/plugins/plugin-3 'separator' +/plugins/plugin-3/expand true +/plugins/plugin-3/style uint32 0 +/plugins/plugin-4 'systray' +/plugins/plugin-4/icon-size 16 +/plugins/plugin-4/known-legacy-items [<'thunar'>, <'networkmanager applet'>] +/plugins/plugin-4/show-frame false +/plugins/plugin-4/size-max uint32 16 +/plugins/plugin-4/symbolic-icons true +/plugins/plugin-5 'pulseaudio' +/plugins/plugin-5/enable-keyboard-shortcuts true +/plugins/plugin-5/enable-mpris true +/plugins/plugin-5/enable-multimedia-keys true +/plugins/plugin-5/enable-wnck true +/plugins/plugin-5/show-notifications true +/plugins/plugin-6 'power-manager-plugin' +/plugins/plugin-7 'separator' +/plugins/plugin-7/style uint32 0 +/plugins/plugin-8 'clock' +/plugins/plugin-8/digital-format '%a %I:%M %p' +/plugins/plugin-8/mode uint32 2 +/plugins/plugin-8/show-frame true +/plugins/plugin-8/size-max uint32 22 +/plugins/plugin-8/style uint32 0 +/plugins/plugin-8/tooltip-format '%A %d %B %Y' +/plugins/plugin-9 'separator' +/plugins/plugin-9/expand false +/plugins/plugin-9/style uint32 0 +\ No newline at end of file diff --git a/files/xfce/settings/displays.xml b/files/xfce/settings/displays.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="displays" version="1.0"> + <property name="ActiveProfile" type="string" value="Default"/> + <property name="Default" type="empty"> + <property name="eDP-1" type="string" value="Laptop"> + <property name="Active" type="bool" value="true"/> + <property name="EDID" type="string" value="20cc2f86e84952dfcf73faae3bac5b85946de04f"/> + <property name="Resolution" type="string" value="1920x1080"/> + <property name="RefreshRate" type="double" value="59.998611"/> + <property name="Rotation" type="int" value="0"/> + <property name="Reflection" type="string" value="0"/> + <property name="Primary" type="bool" value="true"/> + <property name="Scale" type="empty"> + <property name="X" type="double" value="1.000000"/> + <property name="Y" type="double" value="1.000000"/> + </property> + <property name="Position" type="empty"> + <property name="X" type="int" value="0"/> + <property name="Y" type="int" value="0"/> + </property> + </property> + </property> + <property name="Fallback" type="empty"> + <property name="eDP-1" type="string" value="Laptop"> + <property name="Active" type="bool" value="true"/> + <property name="EDID" type="string" value="20cc2f86e84952dfcf73faae3bac5b85946de04f"/> + <property name="Resolution" type="string" value="1920x1080"/> + <property name="RefreshRate" type="double" value="59.998611"/> + <property name="Rotation" type="int" value="0"/> + <property name="Reflection" type="string" value="0"/> + <property name="Primary" type="bool" value="true"/> + <property name="Scale" type="empty"> + <property name="X" type="double" value="1.000000"/> + <property name="Y" type="double" value="1.000000"/> + </property> + <property name="Position" type="empty"> + <property name="X" type="int" value="0"/> + <property name="Y" type="int" value="0"/> + </property> + </property> + </property> +</channel> diff --git a/files/xfce/settings/keyboards.xml b/files/xfce/settings/keyboards.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="keyboards" version="1.0"> + <property name="Default" type="empty"> + <property name="Numlock" type="bool" value="false"/> + <property name="RestoreNumlock" type="bool" value="true"/> + </property> +</channel> diff --git a/files/xfce/settings/parole.xml b/files/xfce/settings/parole.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="parole" version="1.0"> + <property name="subtitles" type="empty"> + <property name="font" type="string" value="Sans Bold 20"/> + </property> + <property name="window" type="empty"> + <property name="maximized" type="bool" value="false"/> + <property name="width" type="int" value="869"/> + <property name="height" type="int" value="588"/> + </property> + <property name="audio" type="empty"> + <property name="volume" type="int" value="50"/> + </property> +</channel> diff --git a/files/xfce/settings/pointers.xml b/files/xfce/settings/pointers.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="pointers" version="1.0"> + <property name="DLL09D900_04F33147_Touchpad" type="empty"> + <property name="Properties" type="empty"> + <property name="libinput_Tapping_Enabled" type="int" value="1"/> + </property> + <property name="RightHanded" type="bool" value="true"/> + <property name="Threshold" type="int" value="1"/> + <property name="Acceleration" type="double" value="6.300000"/> + <property name="ReverseScrolling" type="bool" value="true"/> + </property> +</channel> diff --git a/files/xfce/settings/thunar-volman.xml b/files/xfce/settings/thunar-volman.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="thunar-volman" version="1.0"> + <property name="automount-media" type="empty"> + <property name="enabled" type="bool" value="true"/> + </property> + <property name="automount-drives" type="empty"> + <property name="enabled" type="bool" value="true"/> + </property> + <property name="autophoto" type="empty"> + <property name="enabled" type="bool" value="false"/> + </property> +</channel> diff --git a/files/xfce/settings/thunar.xml b/files/xfce/settings/thunar.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="thunar" version="1.0"> + <property name="last-view" type="string" value="ThunarIconView"/> + <property name="last-icon-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_150_PERCENT"/> + <property name="last-window-width" type="int" value="915"/> + <property name="last-window-height" type="int" value="677"/> + <property name="last-window-maximized" type="bool" value="false"/> + <property name="last-show-hidden" type="bool" value="false"/> + <property name="last-separator-position" type="int" value="170"/> + <property name="misc-single-click" type="bool" value="true"/> + <property name="misc-thumbnail-draw-frames" type="bool" value="false"/> + <property name="shortcuts-icon-size" type="string" value="THUNAR_ICON_SIZE_24"/> + <property name="tree-icon-size" type="string" value="THUNAR_ICON_SIZE_16"/> + <property name="misc-middle-click-in-tab" type="bool" value="true"/> + <property name="misc-recursive-permissions" type="string" value="THUNAR_RECURSIVE_PERMISSIONS_ALWAYS"/> + <property name="misc-show-delete-action" type="bool" value="true"/> + <property name="last-location-bar" type="string" value="ThunarLocationButtons"/> +</channel> diff --git a/files/xfce/settings/xfce4-appfinder.xml b/files/xfce/settings/xfce4-appfinder.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="xfce4-appfinder" version="1.0"> + <property name="actions" type="array"> + <value type="int" value="5"/> + <value type="int" value="4"/> + <value type="int" value="3"/> + <value type="int" value="2"/> + <value type="int" value="1"/> + <property name="action-5" type="empty"> + <property name="type" type="int" value="0"/> + <property name="pattern" type="string" value="/"/> + <property name="command" type="string" value="exo-open --launch FileManager %S"/> + <property name="save" type="bool" value="false"/> + </property> + <property name="action-4" type="empty"> + <property name="type" type="int" value="0"/> + <property name="pattern" type="string" value="#"/> + <property name="command" type="string" value="exo-open --launch TerminalEmulator man %s"/> + <property name="save" type="bool" value="false"/> + </property> + <property name="action-3" type="empty"> + <property name="type" type="int" value="0"/> + <property name="pattern" type="string" value="!w"/> + <property name="command" type="string" value="exo-open --launch WebBrowser http://en.wikipedia.org/wiki/%s"/> + <property name="save" type="bool" value="false"/> + </property> + <property name="action-2" type="empty"> + <property name="type" type="int" value="0"/> + <property name="pattern" type="string" value="$"/> + <property name="command" type="string" value="exo-open --launch TerminalEmulator %s"/> + <property name="save" type="bool" value="true"/> + </property> + <property name="action-1" type="empty"> + <property name="type" type="int" value="1"/> + <property name="pattern" type="string" value="^(file|http|https):\/\/(.*)$"/> + <property name="command" type="string" value="exo-open \0"/> + <property name="save" type="bool" value="false"/> + </property> + </property> + <property name="last" type="empty"> + <property name="window-height" type="int" value="470"/> + <property name="window-width" type="int" value="570"/> + <property name="pane-position" type="int" value="180"/> + </property> +</channel> diff --git a/files/xfce/settings/xfce4-desktop.xml b/files/xfce/settings/xfce4-desktop.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="xfce4-desktop" version="1.0"> + <property name="backdrop" type="empty"> + <property name="screen0" type="empty"> + <property name="monitoreDP-1" type="empty"> + <property name="workspace0" type="empty"> + <property name="color-style" type="int" value="0"/> + <property name="image-style" type="int" value="4"/> + <property name="last-image" type="string" value="/etc/nixos/files/images/wallpapers/Sunset.jpg"/> + </property> + <property name="workspace1" type="empty"> + <property name="color-style" type="int" value="0"/> + <property name="image-style" type="int" value="5"/> + <property name="last-image" type="string" value="/nix/store/8ww4s5mj1p6l5jmb1jqdmrr4cv0mrmwq-xfdesktop-4.16.0/share/backgrounds/xfce/xfce-verticals.png"/> + </property> + <property name="workspace2" type="empty"> + <property name="color-style" type="int" value="0"/> + <property name="image-style" type="int" value="5"/> + <property name="last-image" type="string" value="/nix/store/8ww4s5mj1p6l5jmb1jqdmrr4cv0mrmwq-xfdesktop-4.16.0/share/backgrounds/xfce/xfce-verticals.png"/> + </property> + <property name="workspace3" type="empty"> + <property name="color-style" type="int" value="0"/> + <property name="image-style" type="int" value="5"/> + <property name="last-image" type="string" value="/nix/store/8ww4s5mj1p6l5jmb1jqdmrr4cv0mrmwq-xfdesktop-4.16.0/share/backgrounds/xfce/xfce-verticals.png"/> + </property> + </property> + </property> + </property> + <property name="desktop-icons" type="empty"> + <property name="icon-size" type="uint" value="48"/> + <property name="primary" type="bool" value="true"/> + <property name="use-custom-font-size" type="bool" value="false"/> + <property name="show-tooltips" type="bool" value="true"/> + <property name="single-click" type="bool" value="true"/> + <property name="file-icons" type="empty"> + <property name="show-removable" type="bool" value="false"/> + <property name="show-filesystem" type="bool" value="false"/> + </property> + </property> +</channel> diff --git a/files/xfce/settings/xfce4-keyboard-shortcuts.xml b/files/xfce/settings/xfce4-keyboard-shortcuts.xml @@ -0,0 +1,192 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="xfce4-keyboard-shortcuts" version="1.0"> + <property name="commands" type="empty"> + <property name="default" type="empty"> + <property name="&lt;Alt&gt;F1" type="empty"/> + <property name="&lt;Alt&gt;F2" type="empty"> + <property name="startup-notify" type="empty"/> + </property> + <property name="&lt;Alt&gt;F3" type="empty"> + <property name="startup-notify" type="empty"/> + </property> + <property name="&lt;Primary&gt;&lt;Alt&gt;Delete" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;l" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;t" type="empty"/> + <property name="XF86Display" type="empty"/> + <property name="&lt;Super&gt;p" type="empty"/> + <property name="&lt;Primary&gt;Escape" type="empty"/> + <property name="XF86WWW" type="empty"/> + <property name="HomePage" type="empty"/> + <property name="XF86Mail" type="empty"/> + <property name="Print" type="empty"/> + <property name="&lt;Alt&gt;Print" type="empty"/> + <property name="&lt;Shift&gt;Print" type="empty"/> + <property name="&lt;Super&gt;e" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;f" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;Escape" type="empty"/> + <property name="&lt;Primary&gt;&lt;Shift&gt;Escape" type="empty"/> + <property name="&lt;Super&gt;r" type="empty"> + <property name="startup-notify" type="empty"/> + </property> + </property> + <property name="custom" type="empty"> + <property name="&lt;Alt&gt;F2" type="empty"> + <property name="startup-notify" type="bool" value="true"/> + </property> + <property name="&lt;Super&gt;r" type="string" value="xfce4-appfinder -c"> + <property name="startup-notify" type="bool" value="true"/> + </property> + <property name="XF86WWW" type="string" value="exo-open --launch WebBrowser"/> + <property name="XF86Mail" type="string" value="exo-open --launch MailReader"/> + <property name="&lt;Alt&gt;F3" type="empty"> + <property name="startup-notify" type="bool" value="true"/> + </property> + <property name="&lt;Primary&gt;Escape" type="string" value="xfdesktop --menu"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;Delete" type="string" value="xfce4-session-logout"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;l" type="string" value="xflock4"/> + <property name="&lt;Alt&gt;F1" type="string" value="xfce4-popup-applicationsmenu"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;Escape" type="string" value="xkill"/> + <property name="HomePage" type="string" value="exo-open --launch WebBrowser"/> + <property name="XF86Display" type="string" value="xfce4-display-settings --minimal"/> + <property name="override" type="bool" value="true"/> + <property name="&lt;Super&gt;t" type="string" value="exo-open --launch TerminalEmulator"/> + <property name="&lt;Super&gt;f" type="string" value="thunar"/> + <property name="&lt;Super&gt;Return" type="string" value="xfce4-appfinder"> + <property name="startup-notify" type="bool" value="true"/> + </property> + <property name="Print" type="string" value="xfce4-screenshooter -r"/> + <property name="&lt;Shift&gt;Print" type="string" value="xfce4-screenshooter -w"/> + <property name="&lt;Primary&gt;Print" type="string" value="xfce4-screenshooter"/> + <property name="&lt;Primary&gt;&lt;Shift&gt;Return" type="string" value="xfce4-taskmanager"/> + <property name="&lt;Super&gt;space" type="string" value="xfce4-popup-whiskermenu"/> + <property name="&lt;Super&gt;v" type="string" value="xfce4-clipman-history"/> + <property name="Super_L" type="empty"> + <property name="startup-notify" type="bool" value="true"/> + </property> + </property> + </property> + <property name="xfwm4" type="empty"> + <property name="default" type="empty"> + <property name="&lt;Alt&gt;Insert" type="empty"/> + <property name="Escape" type="empty"/> + <property name="Left" type="empty"/> + <property name="Right" type="empty"/> + <property name="Up" type="empty"/> + <property name="Down" type="empty"/> + <property name="&lt;Alt&gt;Tab" type="empty"/> + <property name="&lt;Alt&gt;&lt;Shift&gt;Tab" type="empty"/> + <property name="&lt;Alt&gt;Delete" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;Down" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;Left" type="empty"/> + <property name="&lt;Shift&gt;&lt;Alt&gt;Page_Down" type="empty"/> + <property name="&lt;Alt&gt;F4" type="empty"/> + <property name="&lt;Alt&gt;F6" type="empty"/> + <property name="&lt;Alt&gt;F7" type="empty"/> + <property name="&lt;Alt&gt;F8" type="empty"/> + <property name="&lt;Alt&gt;F9" type="empty"/> + <property name="&lt;Alt&gt;F10" type="empty"/> + <property name="&lt;Alt&gt;F11" type="empty"/> + <property name="&lt;Alt&gt;F12" type="empty"/> + <property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Left" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;End" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;Home" type="empty"/> + <property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Right" type="empty"/> + <property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Up" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_1" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_2" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_3" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_4" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_5" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_6" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_7" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_8" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_9" type="empty"/> + <property name="&lt;Alt&gt;space" type="empty"/> + <property name="&lt;Shift&gt;&lt;Alt&gt;Page_Up" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;Right" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;d" type="empty"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;Up" type="empty"/> + <property name="&lt;Super&gt;Tab" type="empty"/> + <property name="&lt;Primary&gt;F1" type="empty"/> + <property name="&lt;Primary&gt;F2" type="empty"/> + <property name="&lt;Primary&gt;F3" type="empty"/> + <property name="&lt;Primary&gt;F4" type="empty"/> + <property name="&lt;Primary&gt;F5" type="empty"/> + <property name="&lt;Primary&gt;F6" type="empty"/> + <property name="&lt;Primary&gt;F7" type="empty"/> + <property name="&lt;Primary&gt;F8" type="empty"/> + <property name="&lt;Primary&gt;F9" type="empty"/> + <property name="&lt;Primary&gt;F10" type="empty"/> + <property name="&lt;Primary&gt;F11" type="empty"/> + <property name="&lt;Primary&gt;F12" type="empty"/> + <property name="&lt;Super&gt;KP_Left" type="empty"/> + <property name="&lt;Super&gt;KP_Right" type="empty"/> + <property name="&lt;Super&gt;KP_Up" type="empty"/> + <property name="&lt;Super&gt;KP_Down" type="empty"/> + <property name="&lt;Super&gt;KP_Page_Up" type="empty"/> + <property name="&lt;Super&gt;KP_Home" type="empty"/> + <property name="&lt;Super&gt;KP_End" type="empty"/> + <property name="&lt;Super&gt;KP_Next" type="empty"/> + </property> + <property name="custom" type="empty"> + <property name="&lt;Primary&gt;F12" type="string" value="workspace_12_key"/> + <property name="&lt;Alt&gt;F4" type="string" value="close_window_key"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_3" type="string" value="move_window_workspace_3_key"/> + <property name="&lt;Primary&gt;F2" type="string" value="workspace_2_key"/> + <property name="&lt;Primary&gt;F6" type="string" value="workspace_6_key"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;Down" type="string" value="down_workspace_key"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_9" type="string" value="move_window_workspace_9_key"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;End" type="string" value="move_window_next_workspace_key"/> + <property name="&lt;Primary&gt;F8" type="string" value="workspace_8_key"/> + <property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Left" type="string" value="move_window_left_key"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_4" type="string" value="move_window_workspace_4_key"/> + <property name="Right" type="string" value="right_key"/> + <property name="Down" type="string" value="down_key"/> + <property name="&lt;Primary&gt;F3" type="string" value="workspace_3_key"/> + <property name="&lt;Shift&gt;&lt;Alt&gt;Page_Down" type="string" value="lower_window_key"/> + <property name="&lt;Primary&gt;F9" type="string" value="workspace_9_key"/> + <property name="&lt;Alt&gt;Tab" type="string" value="cycle_windows_key"/> + <property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Right" type="string" value="move_window_right_key"/> + <property name="&lt;Alt&gt;F6" type="string" value="stick_window_key"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_5" type="string" value="move_window_workspace_5_key"/> + <property name="&lt;Primary&gt;F11" type="string" value="workspace_11_key"/> + <property name="&lt;Alt&gt;Delete" type="string" value="del_workspace_key"/> + <property name="&lt;Super&gt;Tab" type="string" value="switch_window_key"/> + <property name="&lt;Primary&gt;F4" type="string" value="workspace_4_key"/> + <property name="&lt;Alt&gt;F7" type="string" value="move_window_key"/> + <property name="Up" type="string" value="up_key"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_6" type="string" value="move_window_workspace_6_key"/> + <property name="&lt;Alt&gt;F11" type="string" value="fullscreen_key"/> + <property name="&lt;Alt&gt;space" type="string" value="popup_menu_key"/> + <property name="Escape" type="string" value="cancel_key"/> + <property name="&lt;Shift&gt;&lt;Alt&gt;Page_Up" type="string" value="raise_window_key"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;Home" type="string" value="move_window_prev_workspace_key"/> + <property name="&lt;Alt&gt;&lt;Shift&gt;Tab" type="string" value="cycle_reverse_windows_key"/> + <property name="&lt;Alt&gt;F12" type="string" value="above_key"/> + <property name="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;Up" type="string" value="move_window_up_key"/> + <property name="&lt;Primary&gt;F5" type="string" value="workspace_5_key"/> + <property name="&lt;Alt&gt;F8" type="string" value="resize_window_key"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_7" type="string" value="move_window_workspace_7_key"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_2" type="string" value="move_window_workspace_2_key"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;Up" type="string" value="up_workspace_key"/> + <property name="&lt;Primary&gt;F7" type="string" value="workspace_7_key"/> + <property name="&lt;Primary&gt;F10" type="string" value="workspace_10_key"/> + <property name="Left" type="string" value="left_key"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;KP_8" type="string" value="move_window_workspace_8_key"/> + <property name="&lt;Alt&gt;Insert" type="string" value="add_workspace_key"/> + <property name="&lt;Primary&gt;F1" type="string" value="workspace_1_key"/> + <property name="override" type="bool" value="true"/> + <property name="&lt;Super&gt;Up" type="string" value="maximize_window_key"/> + <property name="&lt;Super&gt;Down" type="string" value="hide_window_key"/> + <property name="&lt;Primary&gt;&lt;Alt&gt;1" type="string" value="move_window_workspace_1_key"/> + <property name="&lt;Super&gt;d" type="string" value="show_desktop_key"/> + <property name="&lt;Super&gt;Left" type="string" value="left_workspace_key"/> + <property name="&lt;Super&gt;Right" type="string" value="right_workspace_key"/> + </property> + </property> + <property name="providers" type="array"> + <value type="string" value="xfwm4"/> + <value type="string" value="commands"/> + </property> +</channel> diff --git a/files/xfce/settings/xfce4-notifyd.xml b/files/xfce/settings/xfce4-notifyd.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="xfce4-notifyd" version="1.0"> + <property name="applications" type="empty"> + <property name="known_applications" type="array"> + <value type="string" value="nm-applet"/> + <value type="string" value="notify-send"/> + <value type="string" value="Xfce volume control"/> + <value type="string" value="Xfce4-notifyd settings"/> + <value type="string" value="xfce4-power-manager"/> + </property> + </property> + <property name="primary-monitor" type="uint" value="0"/> + <property name="notify-location" type="uint" value="2"/> + <property name="log-level" type="uint" value="0"/> + <property name="log-level-apps" type="uint" value="0"/> + <property name="do-fadeout" type="bool" value="true"/> + <property name="do-slideout" type="bool" value="true"/> +</channel> diff --git a/files/xfce/settings/xfce4-panel.xml b/files/xfce/settings/xfce4-panel.xml @@ -0,0 +1,175 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="xfce4-panel" version="1.0"> + <property name="configver" type="int" value="2"/> + <property name="panels" type="array"> + <value type="int" value="0"/> + <property name="dark-mode" type="bool" value="true"/> + <property name="panel-0" type="empty"> + <property name="autohide-behavior" type="uint" value="1"/> + <property name="background-alpha" type="uint" value="80"/> + <property name="background-rgba" type="array"> + <value type="double" value="1.000000"/> + <value type="double" value="1.000000"/> + <value type="double" value="1.000000"/> + <value type="double" value="0.477966"/> + </property> + <property name="background-style" type="uint" value="0"/> + <property name="disable-struts" type="bool" value="false"/> + <property name="enter-opacity" type="uint" value="100"/> + <property name="icon-size" type="uint" value="0"/> + <property name="leave-opacity" type="uint" value="95"/> + <property name="length" type="uint" value="90"/> + <property name="length-adjust" type="bool" value="true"/> + <property name="mode" type="uint" value="0"/> + <property name="nrows" type="uint" value="1"/> + <property name="plugin-ids" type="array"> + <value type="int" value="1"/> + <value type="int" value="15"/> + <value type="int" value="22"/> + <value type="int" value="18"/> + <value type="int" value="3"/> + <value type="int" value="16"/> + <value type="int" value="4"/> + <value type="int" value="19"/> + <value type="int" value="17"/> + <value type="int" value="2"/> + <value type="int" value="6"/> + <value type="int" value="5"/> + <value type="int" value="7"/> + <value type="int" value="8"/> + <value type="int" value="20"/> + <value type="int" value="9"/> + <value type="int" value="10"/> + <value type="int" value="11"/> + <value type="int" value="13"/> + <value type="int" value="14"/> + </property> + <property name="position" type="string" value="p=0;x=946;y=27"/> + <property name="position-locked" type="bool" value="true"/> + <property name="size" type="uint" value="27"/> + <property name="span-monitors" type="bool" value="false"/> + </property> + </property> + <property name="plugins" type="empty"> + <property name="plugin-10" type="string" value="actions"> + <property name="appearance" type="uint" value="1"/> + <property name="ask-confirmation" type="bool" value="true"/> + <property name="button-title" type="uint" value="0"/> + <property name="invert-orientation" type="bool" value="false"/> + <property name="items" type="array"> + <value type="string" value="+lock-screen"/> + <value type="string" value="+separator"/> + <value type="string" value="+suspend"/> + <value type="string" value="+hibernate"/> + <value type="string" value="+separator"/> + <value type="string" value="-hybrid-sleep"/> + <value type="string" value="+restart"/> + <value type="string" value="+shutdown"/> + <value type="string" value="+separator"/> + <value type="string" value="+switch-user"/> + <value type="string" value="-logout-dialog"/> + <value type="string" value="+logout"/> + </property> + </property> + <property name="plugin-11" type="string" value="separator"> + <property name="expand" type="bool" value="false"/> + <property name="style" type="uint" value="0"/> + </property> + <property name="plugin-13" type="string" value="notification-plugin"/> + <property name="plugin-14" type="string" value="separator"> + <property name="expand" type="bool" value="false"/> + <property name="style" type="uint" value="0"/> + </property> + <property name="plugin-26" type="string" value="thunar-tpa"/> + <property name="plugin-3" type="string" value="separator"> + <property name="expand" type="bool" value="true"/> + <property name="style" type="uint" value="0"/> + </property> + <property name="plugin-4" type="string" value="systray"> + <property name="icon-size" type="int" value="16"/> + <property name="show-frame" type="bool" value="false"/> + <property name="size-max" type="uint" value="16"/> + <property name="symbolic-icons" type="bool" value="true"/> + <property name="known-legacy-items" type="array"> + <value type="string" value="networkmanager applet"/> + </property> + </property> + <property name="plugin-5" type="string" value="pulseaudio"> + <property name="enable-keyboard-shortcuts" type="bool" value="true"/> + <property name="enable-mpris" type="bool" value="true"/> + <property name="enable-multimedia-keys" type="bool" value="true"/> + <property name="enable-wnck" type="bool" value="true"/> + <property name="show-notifications" type="bool" value="true"/> + </property> + <property name="plugin-6" type="string" value="power-manager-plugin"/> + <property name="plugin-7" type="string" value="separator"> + <property name="style" type="uint" value="0"/> + </property> + <property name="plugin-8" type="string" value="clock"> + <property name="digital-format" type="string" value="%a %I:%M %p"/> + <property name="mode" type="uint" value="2"/> + <property name="show-frame" type="bool" value="true"/> + <property name="size-max" type="uint" value="22"/> + <property name="style" type="uint" value="0"/> + <property name="tooltip-format" type="string" value="%A %d %B %Y"/> + </property> + <property name="plugin-9" type="string" value="separator"> + <property name="expand" type="bool" value="false"/> + <property name="style" type="uint" value="0"/> + </property> + <property name="plugin-15" type="string" value="whiskermenu"/> + <property name="plugin-1" type="string" value="separator"> + <property name="style" type="uint" value="0"/> + </property> + <property name="plugin-2" type="string" value="xfce4-clipman-plugin"/> + <property name="plugin-16" type="string" value="namebar"/> + <property name="plugin-17" type="string" value="xfce4-notes-plugin"/> + <property name="plugin-18" type="string" value="eyes"/> + <property name="plugin-19" type="string" value="screenshooter"/> + <property name="plugin-20" type="string" value="weather"> + <property name="location" type="empty"> + <property name="name" type="string" value="Hyderabad, India"/> + <property name="latitude" type="string" value="17.425400"/> + <property name="longitude" type="string" value="78.507500"/> + </property> + <property name="msl" type="int" value="529"/> + <property name="timezone" type="string" value="Asia/Kolkata"/> + <property name="offset" type="string" value="+05:30"/> + <property name="cache-max-age" type="int" value="172800"/> + <property name="power-saving" type="bool" value="true"/> + <property name="units" type="empty"> + <property name="temperature" type="int" value="0"/> + <property name="pressure" type="int" value="0"/> + <property name="windspeed" type="int" value="0"/> + <property name="precipitation" type="int" value="0"/> + <property name="altitude" type="int" value="0"/> + <property name="apparent-temperature" type="int" value="0"/> + </property> + <property name="round" type="bool" value="true"/> + <property name="single-row" type="bool" value="true"/> + <property name="tooltip-style" type="int" value="1"/> + <property name="forecast" type="empty"> + <property name="layout" type="int" value="1"/> + <property name="days" type="int" value="5"/> + </property> + <property name="theme-dir" type="string" value="/nix/store/qrb3nm6l6mz283ifjchn2idw2d7l8mi5-xfce4-weather-plugin-0.11.0/share/xfce4/weather/icons/liquid"/> + <property name="scrollbox" type="empty"> + <property name="show" type="bool" value="true"/> + <property name="animate" type="bool" value="true"/> + <property name="lines" type="int" value="1"/> + <property name="color" type="string" value="rgba(0,0,0,0)"/> + <property name="use-color" type="bool" value="false"/> + </property> + </property> + <property name="plugin-22" type="string" value="separator"> + <property name="style" type="uint" value="0"/> + </property> + <property name="clipman" type="empty"> + <property name="tweaks" type="empty"> + <property name="paste-on-activate" type="uint" value="2"/> + <property name="popup-at-pointer" type="bool" value="true"/> + </property> + </property> + </property> +</channel> diff --git a/files/xfce/settings/xfce4-power-manager.xml b/files/xfce/settings/xfce4-power-manager.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="xfce4-power-manager" version="1.0"> + <property name="xfce4-power-manager" type="empty"> + <property name="brightness-switch-restore-on-exit" type="int" value="1"/> + <property name="brightness-switch" type="int" value="0"/> + <property name="show-tray-icon" type="bool" value="false"/> + <property name="lock-screen-suspend-hibernate" type="bool" value="true"/> + <property name="power-button-action" type="uint" value="3"/> + <property name="sleep-button-action" type="uint" value="1"/> + <property name="hibernate-button-action" type="uint" value="3"/> + <property name="battery-button-action" type="uint" value="3"/> + <property name="handle-brightness-keys" type="bool" value="true"/> + <property name="inactivity-sleep-mode-on-battery" type="uint" value="1"/> + <property name="inactivity-on-battery" type="uint" value="30"/> + <property name="lid-action-on-battery" type="uint" value="0"/> + <property name="logind-handle-lid-switch" type="bool" value="false"/> + <property name="critical-power-action" type="uint" value="3"/> + <property name="critical-power-level" type="uint" value="7"/> + <property name="dpms-on-ac-sleep" type="uint" value="15"/> + <property name="dpms-on-ac-off" type="uint" value="25"/> + <property name="dpms-on-battery-off" type="uint" value="15"/> + <property name="brightness-on-battery" type="uint" value="9"/> + <property name="blank-on-battery" type="int" value="7"/> + <property name="dpms-on-battery-sleep" type="uint" value="10"/> + <property name="brightness-level-on-battery" type="uint" value="25"/> + <property name="show-panel-label" type="int" value="1"/> + <property name="show-presentation-indicator" type="bool" value="true"/> + </property> +</channel> diff --git a/files/xfce/settings/xfce4-session.xml b/files/xfce/settings/xfce4-session.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="xfce4-session" version="1.0"> + <property name="general" type="empty"> + <property name="FailsafeSessionName" type="empty"/> + <property name="LockCommand" type="empty"/> + </property> + <property name="sessions" type="empty"> + <property name="Failsafe" type="empty"> + <property name="IsFailsafe" type="empty"/> + <property name="Count" type="empty"/> + <property name="Client0_Command" type="empty"/> + <property name="Client0_Priority" type="empty"/> + <property name="Client0_PerScreen" type="empty"/> + <property name="Client1_Command" type="empty"/> + <property name="Client1_Priority" type="empty"/> + <property name="Client1_PerScreen" type="empty"/> + <property name="Client2_Command" type="empty"/> + <property name="Client2_Priority" type="empty"/> + <property name="Client2_PerScreen" type="empty"/> + <property name="Client3_Command" type="empty"/> + <property name="Client3_Priority" type="empty"/> + <property name="Client3_PerScreen" type="empty"/> + <property name="Client4_Command" type="empty"/> + <property name="Client4_Priority" type="empty"/> + <property name="Client4_PerScreen" type="empty"/> + </property> + </property> + <property name="shutdown" type="empty"> + <property name="LockScreen" type="bool" value="true"/> + </property> +</channel> diff --git a/files/xfce/settings/xfce4-settings-editor.xml b/files/xfce/settings/xfce4-settings-editor.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="xfce4-settings-editor" version="1.0"> + <property name="last" type="empty"> + <property name="window-width" type="int" value="860"/> + <property name="window-height" type="int" value="592"/> + <property name="paned-position" type="int" value="180"/> + </property> +</channel> diff --git a/files/xfce/settings/xfce4-settings-manager.xml b/files/xfce/settings/xfce4-settings-manager.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="xfce4-settings-manager" version="1.0"> + <property name="last" type="empty"> + <property name="filter-visible" type="bool" value="true"/> + <property name="window-width" type="int" value="864"/> + <property name="window-height" type="int" value="624"/> + </property> +</channel> diff --git a/files/xfce/settings/xfwm4.xml b/files/xfce/settings/xfwm4.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="xfwm4" version="1.0"> + <property name="general" type="empty"> + <property name="activate_action" type="string" value="bring"/> + <property name="borderless_maximize" type="bool" value="true"/> + <property name="box_move" type="bool" value="true"/> + <property name="box_resize" type="bool" value="false"/> + <property name="button_layout" type="string" value="OS|HMC"/> + <property name="button_offset" type="int" value="0"/> + <property name="button_spacing" type="int" value="0"/> + <property name="click_to_focus" type="bool" value="true"/> + <property name="cycle_apps_only" type="bool" value="false"/> + <property name="cycle_draw_frame" type="bool" value="true"/> + <property name="cycle_raise" type="bool" value="false"/> + <property name="cycle_hidden" type="bool" value="true"/> + <property name="cycle_minimum" type="bool" value="true"/> + <property name="cycle_minimized" type="bool" value="false"/> + <property name="cycle_preview" type="bool" value="true"/> + <property name="cycle_tabwin_mode" type="int" value="0"/> + <property name="cycle_workspaces" type="bool" value="false"/> + <property name="double_click_action" type="string" value="maximize"/> + <property name="double_click_distance" type="int" value="5"/> + <property name="double_click_time" type="int" value="250"/> + <property name="easy_click" type="string" value="Alt"/> + <property name="focus_delay" type="int" value="250"/> + <property name="focus_hint" type="bool" value="true"/> + <property name="focus_new" type="bool" value="true"/> + <property name="frame_opacity" type="int" value="100"/> + <property name="frame_border_top" type="int" value="0"/> + <property name="full_width_title" type="bool" value="true"/> + <property name="horiz_scroll_opacity" type="bool" value="false"/> + <property name="inactive_opacity" type="int" value="100"/> + <property name="maximized_offset" type="int" value="0"/> + <property name="mousewheel_rollup" type="bool" value="true"/> + <property name="move_opacity" type="int" value="100"/> + <property name="placement_mode" type="string" value="center"/> + <property name="placement_ratio" type="int" value="20"/> + <property name="popup_opacity" type="int" value="100"/> + <property name="prevent_focus_stealing" type="bool" value="false"/> + <property name="raise_delay" type="int" value="250"/> + <property name="raise_on_click" type="bool" value="true"/> + <property name="raise_on_focus" type="bool" value="false"/> + <property name="raise_with_any_button" type="bool" value="true"/> + <property name="repeat_urgent_blink" type="bool" value="false"/> + <property name="resize_opacity" type="int" value="100"/> + <property name="scroll_workspaces" type="bool" value="true"/> + <property name="shadow_delta_height" type="int" value="0"/> + <property name="shadow_delta_width" type="int" value="0"/> + <property name="shadow_delta_x" type="int" value="0"/> + <property name="shadow_delta_y" type="int" value="-3"/> + <property name="shadow_opacity" type="int" value="50"/> + <property name="show_app_icon" type="bool" value="false"/> + <property name="show_dock_shadow" type="bool" value="false"/> + <property name="show_frame_shadow" type="bool" value="true"/> + <property name="show_popup_shadow" type="bool" value="false"/> + <property name="snap_resist" type="bool" value="false"/> + <property name="snap_to_border" type="bool" value="true"/> + <property name="snap_to_windows" type="bool" value="false"/> + <property name="snap_width" type="int" value="10"/> + <property name="vblank_mode" type="string" value="auto"/> + <property name="theme" type="string" value="Arc-Dark"/> + <property name="tile_on_move" type="bool" value="true"/> + <property name="title_alignment" type="string" value="center"/> + <property name="title_font" type="string" value="Product Sans Medium, Medium 11"/> + <property name="title_horizontal_offset" type="int" value="0"/> + <property name="titleless_maximize" type="bool" value="false"/> + <property name="title_shadow_active" type="string" value="false"/> + <property name="title_shadow_inactive" type="string" value="false"/> + <property name="title_vertical_offset_active" type="int" value="0"/> + <property name="title_vertical_offset_inactive" type="int" value="0"/> + <property name="toggle_workspaces" type="bool" value="false"/> + <property name="unredirect_overlays" type="bool" value="true"/> + <property name="urgent_blink" type="bool" value="false"/> + <property name="use_compositing" type="bool" value="true"/> + <property name="workspace_count" type="int" value="4"/> + <property name="wrap_cycle" type="bool" value="true"/> + <property name="wrap_layout" type="bool" value="true"/> + <property name="wrap_resistance" type="int" value="10"/> + <property name="wrap_windows" type="bool" value="true"/> + <property name="wrap_workspaces" type="bool" value="false"/> + <property name="zoom_desktop" type="bool" value="true"/> + <property name="zoom_pointer" type="bool" value="true"/> + <property name="workspace_names" type="array"> + <value type="string" value="Workspace 1"/> + <value type="string" value="Workspace 2"/> + <value type="string" value="Workspace 3"/> + <value type="string" value="Workspace 4"/> + </property> + </property> +</channel> diff --git a/files/xfce/settings/xsettings.xml b/files/xfce/settings/xsettings.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<channel name="xsettings" version="1.0"> + <property name="Net" type="empty"> + <property name="ThemeName" type="string" value="Arc-Dark"/> + <property name="IconThemeName" type="string" value="Papirus-Dark"/> + <property name="DoubleClickTime" type="empty"/> + <property name="DoubleClickDistance" type="empty"/> + <property name="DndDragThreshold" type="empty"/> + <property name="CursorBlink" type="empty"/> + <property name="CursorBlinkTime" type="empty"/> + <property name="SoundThemeName" type="empty"/> + <property name="EnableEventSounds" type="empty"/> + <property name="EnableInputFeedbackSounds" type="empty"/> + </property> + <property name="Xft" type="empty"> + <property name="DPI" type="int" value="101"/> + <property name="Antialias" type="empty"/> + <property name="Hinting" type="empty"/> + <property name="HintStyle" type="empty"/> + <property name="RGBA" type="empty"/> + </property> + <property name="Gtk" type="empty"> + <property name="CanChangeAccels" type="empty"/> + <property name="ColorPalette" type="empty"/> + <property name="FontName" type="string" value="Product Sans Medium, Medium 10"/> + <property name="MonospaceFontName" type="string" value="MesloLGS NF 10"/> + <property name="IconSizes" type="empty"/> + <property name="KeyThemeName" type="empty"/> + <property name="ToolbarStyle" type="empty"/> + <property name="ToolbarIconSize" type="empty"/> + <property name="MenuImages" type="empty"/> + <property name="ButtonImages" type="bool" value="false"/> + <property name="MenuBarAccel" type="empty"/> + <property name="CursorThemeName" type="string" value="Adwaita"/> + <property name="CursorThemeSize" type="empty"/> + <property name="DecorationLayout" type="empty"/> + <property name="DialogsUseHeader" type="empty"/> + <property name="TitlebarMiddleClick" type="empty"/> + </property> + <property name="Gdk" type="empty"> + <property name="WindowScalingFactor" type="int" value="1"/> + </property> + <property name="Xfce" type="empty"> + <property name="LastCustomDPI" type="int" value="101"/> + </property> +</channel> diff --git a/files/xfce/terminalrc b/files/xfce/terminalrc @@ -0,0 +1,38 @@ +[Configuration] +BackgroundMode=TERMINAL_BACKGROUND_TRANSPARENT +FontUseSystem=TRUE +MiscAlwaysShowTabs=FALSE +MiscBell=FALSE +MiscBellUrgent=FALSE +MiscBordersDefault=TRUE +MiscCursorBlinks=TRUE +MiscCursorShape=TERMINAL_CURSOR_SHAPE_IBEAM +MiscDefaultGeometry=80x24 +MiscInheritGeometry=FALSE +MiscMenubarDefault=TRUE +MiscMouseAutohide=TRUE +MiscMouseWheelZoom=TRUE +MiscToolbarDefault=FALSE +MiscConfirmClose=TRUE +MiscCycleTabs=TRUE +MiscTabCloseButtons=TRUE +MiscTabCloseMiddleClick=TRUE +MiscTabPosition=GTK_POS_TOP +MiscHighlightUrls=TRUE +MiscMiddleClickOpensUri=TRUE +MiscCopyOnSelect=FALSE +MiscShowRelaunchDialog=TRUE +MiscRewrapOnResize=TRUE +MiscUseShiftArrowsToScroll=FALSE +MiscSlimTabs=FALSE +MiscNewTabAdjacent=FALSE +MiscSearchDialogOpacity=100 +MiscShowUnsafePasteDialog=TRUE +ScrollingOnOutput=FALSE +ScrollingUnlimited=TRUE +BackgroundDarkness=0.900000 +ColorBackground=#2f2f34343f3f +ColorPalette=rgb(38,43,54);rgb(156,53,40);rgb(97,188,59);rgb(243,180,58);rgb(13,104,168);rgb(116,69,96);rgb(40,142,156);rgb(162,162,162);rgb(47,52,63);rgb(214,73,55);rgb(134,223,93);rgb(253,215,90);rgb(15,117,189);rgb(158,94,131);rgb(55,195,214);rgb(249,249,249) +ColorForeground=#f3f3f4f4f5f5 +TabActivityColor=#bfff3fff3fff +ColorUseTheme=TRUE diff --git a/files/xorg/Xresources b/files/xorg/Xresources @@ -0,0 +1,6 @@ +Xft.antialias: 1 +Xft.hinting: 1 +Xft.autohint: 0 +Xft.rgba: rgb +Xft.hintstyle: hintslight +Xft.lcdfilter: lcddefault diff --git a/files/zsh/p10k.zsh b/files/zsh/p10k.zsh @@ -0,0 +1,972 @@ +# ################################################################################### # +# My Epic P10k Config # +# Configuration for Powerlevel10k with Powerline Prompt Style and Colorful Background # +# ################################################################################### # + +# 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 + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' + + # Required: ZSH >= 5.1 + autoload -Uz is-at-least && is-at-least 5.1 || return + + # Segments shown on the LEFT + typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( + ## Line 1 + os_icon # OS Identifier + context # USER@HOSTNAME + dir # Current Directory + vcs # 'git' Status + + ## Line 2 + newline # \n + ) + + # Segments shown on the RIGHT + typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( + ## Line 1 + status # Exit Code 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) + 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) + 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) + nordvpn # NordVPN Connection Status (https://nordvpn.com/) + ranger # Ranger Shell (https://github.com/ranger/ranger) + 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 + # vpn_ip # VPN 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/) + battery # Internal Battery + command_execution_time # Duration of the Last Command + time # Current Time + + ## Line 2 + newline # \n + # ip # IP Address and Bandwidth Usage + # public_ip # Public IP Address + # wifi # WiFi Speed + ) + + ## Prompt + typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always + typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose + + # Character Set + typeset -g POWERLEVEL9K_MODE=nerdfont-complete + + # Icons + typeset -g POWERLEVEL9K_ICON_PADDING=none + typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT= + typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=232 + typeset -g POWERLEVEL9K_OS_ICON_BACKGROUND=7 + + #typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' # Custom Icon + + # Connectors + typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%242F╭─' + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%242F├─' + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%242F╰─' + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX='%242F─╮' + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX='%242F─┤' + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX='%242F─╯' + + # Fillers + 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 + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242 + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' + typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' + fi + + # Separators + typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B1' + typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B3' + typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0' + typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2' + typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' + typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' + typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' + typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + + # Characters + typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND= + typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 + typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' + typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE= + + # Reload + typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true + (( ! $+functions[p10k] )) || p10k reload + + #E Directory Handling + # Colors + typeset -g POWERLEVEL9K_DIR_BACKGROUND=6 + typeset -g POWERLEVEL9K_DIR_FOREGROUND=0 + typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=250 + typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=0 + + # Unshortened 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 + ) + + # Shorteners + typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique + typeset -g POWERLEVEL9K_SHORTEN_DELIMITER='...' + typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true + typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" + typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false + typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 + typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 + typeset -g POWERLEVEL9K_DIR_HYPERLINK=true + typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v2 + + #typeset -g POWERLEVEL9K_LOCK_ICON='⭐' # Custom Icon + #typeset -g POWERLEVEL9K_DIR_PREFIX='in ' # Custom Prefix + + # Custom Directories Styling + typeset -g POWERLEVEL9K_DIR_CLASSES=( + '~/work(|/*)' WORK '' + '~(|/*)' HOME '' + '*' DEFAULT '' + ) + + ## Version Control + # Colors + #typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2 + #typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3 + #typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2 + #typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=3 + #typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=8 + + # Icons + typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' + typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' + + # Formatter + function my_git_formatter() { + emulate -L zsh + + if [[ -n $P9K_CONTENT ]]; then + typeset -g my_git_format=$P9K_CONTENT + return + fi + + # Styling + 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 + local where + if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then + res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}" + where=${(V)VCS_STATUS_LOCAL_BRANCH} + elif [[ -n $VCS_STATUS_TAG ]]; then + res+="${meta}#" + where=${(V)VCS_STATUS_TAG} + fi + + (( $#where > 32 )) && where[13,-13]="…" + res+="${clean}${where//\%/%%}" # escape % + [[ -z $where ]] && res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" + if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then + res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" # escape % + fi + + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" + (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" + (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" + [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" + (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" + (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" + (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" + (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" + (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" + typeset -g my_git_format=$res + } + functions -M my_git_formatter 2>/dev/null + + # Controllers + typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) + typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 + typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' + typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true + typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter()))+${my_git_format}}' + typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 + + #typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + #typeset -g POWERLEVEL9K_VCS_PREFIX='on ' # Custom Prefix + + ## Command Status + typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true + + # Success + typeset -g POWERLEVEL9K_STATUS_OK=true + typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' + typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=6 + typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND=0 + + # Failure + typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=6 + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0 + + # Error Code + typeset -g POWERLEVEL9K_STATUS_ERROR=true + typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=6 + typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=0 + + # Termination + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true + typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=6 + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_BACKGROUND=0 + + # Partial Failure + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=2 + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_BACKGROUND=0 + + ## Command Duration + # Colors + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=6 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=0 + + # Precision + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' + + #typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + #typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='took ' # Custom Prefix + + ## Background Jobs + # Colors + #typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=6 + #typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=0 + + # Controller + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false + + #typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Context + # Colors + typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=0 + typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=4 + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=0 + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=4 + typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=0 + typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=4 + + # Format + typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n@%m' + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n ✠ %m' + typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n ✠ %m' + #typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= + + #typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + #typeset -g POWERLEVEL9K_CONTEXT_PREFIX='with ' # Custom Prefix + + ## RAM + # Colors + typeset -g POWERLEVEL9K_RAM_FOREGROUND=0 + typeset -g POWERLEVEL9K_RAM_BACKGROUND=6 + + #typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## SWAP + # Colors + #typeset -g POWERLEVEL9K_SWAP_FOREGROUND=0 + #typeset -g POWERLEVEL9K_SWAP_BACKGROUND=3 + + #typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Battery + # Colors + typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 + typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1 + typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=0 + typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=0 + typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578' + typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false + typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=4 + + ## WiFi + # Colors + #typeset -g POWERLEVEL9K_WIFI_FOREGROUND=0 + #typeset -g POWERLEVEL9K_WIFI_BACKGROUND=4 + + # Signal Strength + #typeset -g my_wifi_fg=(0 0 0 0 0) + #typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') + #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]}' + + #typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## IP + # Colors + typeset -g POWERLEVEL9K_IP_BACKGROUND=4 + typeset -g POWERLEVEL9K_IP_FOREGROUND=0 + #typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7 + #typeset -g POWERLEVEL9K_PUBLIC_IP_BACKGROUND=0 + #typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=0 + #typeset -g POWERLEVEL9K_VPN_IP_BACKGROUND=6 + + # Controllers + 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' + typeset -g POWERLEVEL9K_IP_INTERFACE='e.*' + typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun))[0-9]*' + typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false + + # Custom Icons + #typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + #typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + #typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ## Time + # Colors + #typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 + #typeset -g POWERLEVEL9K_TIME_BACKGROUND=7 + + # Format + typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' + typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false + + typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='' # Custom Icon + #typeset -g POWERLEVEL9K_TIME_PREFIX='at ' # Custom Prefix + + ## CPU Load + typeset -g POWERLEVEL9K_LOAD_WHICH=5 + + # Colors + #typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=0 + #typeset -g POWERLEVEL9K_LOAD_NORMAL_BACKGROUND=2 + #typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=0 + #typeset -g POWERLEVEL9K_LOAD_WARNING_BACKGROUND=3 + #typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=0 + #typeset -g POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND=1 + + #typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Disk Usage + # Colors + #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 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 + typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false + + #typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## DirENV + # Colors + #typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3 + #typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=0 + + #typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## ASDF + # Colors + typeset -g POWERLEVEL9K_ASDF_FOREGROUND=0 + typeset -g POWERLEVEL9K_ASDF_BACKGROUND=7 + + # Controllers + typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true + typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= + + # Versions + # Ruby + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + # Colors + #typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 + #typeset -g POWERLEVEL9K_NORDVPN_BACKGROUND=4 + + # Controllers + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= + + #typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Ranger + # Colors + #typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 + #typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0 + + #typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Vim Shell + # Colors + #typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 + #typeset -g POWERLEVEL9K_VIM_SHELL_BACKGROUND=2 + + #typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Midnight Commander + # Colors + #typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 + #typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_BACKGROUND=0 + + #typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Nix Shell + # Colors + typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0 + typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4 + + # Controllers + #typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= + #typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Vi Mode + # Colors + typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0 + typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL + typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2 + typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL + typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4 + typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE + typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3 + typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= + typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8 + + ## ToDo + # Colors + #typeset -g POWERLEVEL9K_TODO_FOREGROUND=0 + #typeset -g POWERLEVEL9K_TODO_BACKGROUND=8 + + # Controllers + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false + #typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' + + #typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## TimeWarrior + # Colors + #typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=255 + #typeset -g POWERLEVEL9K_TIMEWARRIOR_BACKGROUND=8 + + # Format + typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}' + + #typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## TaskWarrior + # Colors + #typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=0 + #typeset -g POWERLEVEL9K_TASKWARRIOR_BACKGROUND=6 + + # Format + #typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' + + #typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Languages + ## Python + # Colors + #typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=0 + #typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4 + #typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0 + #typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4 + + # Controllers + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false + typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= + typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true + typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_PYENV_PYTHON_VERSION:#$P9K_CONTENT}:+ $P9K_PYENV_PYTHON_VERSION}' + + # Custom Icons + #typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + #typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ## Anaconda + # Colors + #typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=0 + #typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=4 + + # Format + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' + + #typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Go + # Colors + #typeset -g POWERLEVEL9K_GOENV_FOREGROUND=0 + #typeset -g POWERLEVEL9K_GOENV_BACKGROUND=4 + #typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=255 + #typeset -g POWERLEVEL9K_GO_VERSION_BACKGROUND=2 + + # Controllers + typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true + typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true + + # Custom Icons + #typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + #typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ## Node + # Colors + #typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 + #typeset -g POWERLEVEL9K_NODENV_BACKGROUND=0 + #typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 + #typeset -g POWERLEVEL9K_NODEENV_BACKGROUND=0 + #typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=7 + #typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=2 + #typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 + #typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 + + # Controllers + typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true + typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false + typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= + typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true + + # Custom Icons + #typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + #typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + #typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + #typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ## Rust + # Colors + #typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=0 + #typeset -g POWERLEVEL9K_RUST_VERSION_BACKGROUND=208 + + # Controllers + typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true + + # Custom Icon + #typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ## .NET + # Colors + #typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=7 + #typeset -g POWERLEVEL9K_DOTNET_VERSION_BACKGROUND=5 + + # Controllers + typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true + + # Custom Icon + #typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ## PHP + # Colors + typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=0 + typeset -g POWERLEVEL9K_PHP_VERSION_BACKGROUND=5 + typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true + #typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0 + #typeset -g POWERLEVEL9K_PHPENV_BACKGROUND=5 + + # Controllers + typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true + + # Custom Icons + #typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + #typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ## Laravel + # Colors + typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_LARAVEL_VERSION_BACKGROUND=7 + + #typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Ruby + # Colors + #typeset -g POWERLEVEL9K_RBENV_FOREGROUND=0 + #typeset -g POWERLEVEL9K_RBENV_BACKGROUND=1 + #typeset -g POWERLEVEL9K_RVM_FOREGROUND=0 + #typeset -g POWERLEVEL9K_RVM_BACKGROUND=240 + + # Controllers + typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true + typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false + typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false + + # Custom Icons + #typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + #typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ## Java + # Colors + typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=1 + typeset -g POWERLEVEL9K_JAVA_VERSION_BACKGROUND=7 + #typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=0 + #typeset -g POWERLEVEL9K_PACKAGE_BACKGROUND=6 + #typeset -g POWERLEVEL9K_JENV_FOREGROUND=1 + #typeset -g POWERLEVEL9K_JENV_BACKGROUND=7 + + # Controllers + typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true + typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false + #typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' + typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true + + # Custom Icons + #typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + #typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + #typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ## Flutter + # Colors + #typeset -g POWERLEVEL9K_FVM_FOREGROUND=0 + #typeset -g POWERLEVEL9K_FVM_BACKGROUND=4 + + #typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Lua + # Colors + #typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=0 + #typeset -g POWERLEVEL9K_LUAENV_BACKGROUND=4 + + # Controllers + typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true + + #typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Perl + # Colors + #typeset -g POWERLEVEL9K_PLENV_FOREGROUND=0 + #typeset -g POWERLEVEL9K_PLENV_BACKGROUND=4 + + # Controllers + typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true + + #typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Scala + # Colors + #typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=0 + #typeset -g POWERLEVEL9K_SCALAENV_BACKGROUND=1 + + # Controllers + typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) + typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false + typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true + + #typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Haskell + # Colors + #typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=0 + #typeset -g POWERLEVEL9K_HASKELL_STACK_BACKGROUND=3 + + # Controllers + typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) + typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true + + #typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Terraform + typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false + + # Classes + typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + '*prod*' PROD + '*test*' TEST + '*' OTHER + ) + + # Format + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4 + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=0 + #typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ## Kubernetes + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile' + + # Classes + typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + '*prod*' PROD + '*test*' TEST + '*' DEFAULT + ) + + # Format + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=7 + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_BACKGROUND=5 + #typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Expansions + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' + + #typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at ' # Custom Prefix + + ## AWS + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + + # Colors + #typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 + #typeset -g POWERLEVEL9K_AWS_EB_ENV_BACKGROUND=0 + + # Classes + typeset -g POWERLEVEL9K_AWS_CLASSES=( + '*prod*' PROD + '*test*' TEST + '*' DEFAULT + ) + + # Format + #typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=7 + #typeset -g POWERLEVEL9K_AWS_DEFAULT_BACKGROUND=1 + #typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Azure + typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' + + # Colors + #typeset -g POWERLEVEL9K_AZURE_FOREGROUND=7 + #typeset -g POWERLEVEL9K_AZURE_BACKGROUND=4 + + #typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon + + ## Google + typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs' + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' + + # Colors + #typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7 + #typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4 + + # Classes + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + '*:*prod*:*' PROD + '*:*test*:*' TEST + '*' DEFAULT + ) + + # Format + typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' + typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' + #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='⭐' + + # Controllers + typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' + + #typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom Icon +} +typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} +(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} +'builtin' 'unset' 'p10k_config_opts' diff --git a/flake.lock b/flake.lock @@ -0,0 +1,380 @@ +{ + "nodes": { + "compatibility": { + "flake": false, + "locked": { + "lastModified": 1641205782, + "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "deploy": { + "inputs": { + "flake-compat": [ + "compatibility" + ], + "nixpkgs": [ + "stable" + ], + "utils": [ + "utils", + "flake-utils" + ] + }, + "locked": { + "lastModified": 1643787431, + "narHash": "sha256-8IwuVgXulRE3ZWq6z8mytarawC32pKPKR20EyDtSH+w=", + "owner": "serokell", + "repo": "deploy-rs", + "rev": "4154ba1aaaf7333a916384c348d867d03b6f1409", + "type": "github" + }, + "original": { + "owner": "serokell", + "repo": "deploy-rs", + "type": "github" + } + }, + "filter": { + "locked": { + "lastModified": 1646733795, + "narHash": "sha256-W9elpjb6b4lqDsw6GxmLEVKaD1/nJQuBy/ikT76cL5c=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "e4e8649a3b6f0d3c181955945a84e6918d3f832a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gaming": { + "inputs": { + "nixpkgs": [ + "unstable" + ], + "utils": [ + "utils" + ] + }, + "locked": { + "lastModified": 1647368676, + "narHash": "sha256-pn262ck0TNbqYKO90smr3YgzWeCCkFriDOSJcTOkUW4=", + "owner": "fufexan", + "repo": "nix-gaming", + "rev": "6e3f57f9c14ceb90ef83f1a40b96b14c85a8eede", + "type": "github" + }, + "original": { + "owner": "fufexan", + "repo": "nix-gaming", + "type": "github" + } + }, + "generators": { + "inputs": { + "nixlib": [ + "library" + ], + "nixpkgs": [ + "stable" + ] + }, + "locked": { + "lastModified": 1647521142, + "narHash": "sha256-ZwK8n5yCYHjmSLPqwXiebUyQxSHQ3HyKAxs4psksuVc=", + "owner": "nix-community", + "repo": "nixos-generators", + "rev": "9f56b704ff3073436c3b93d63669ee773c592aa3", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-generators", + "type": "github" + } + }, + "hardware": { + "locked": { + "lastModified": 1647447644, + "narHash": "sha256-Di7ZCXjQKEys+jxgl8Mp7a8nowRSeAbzH8c9QNYkw2k=", + "owner": "nixos", + "repo": "nixos-hardware", + "rev": "32f61571b486efc987baca553fb35df22532ba63", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixos-hardware", + "type": "github" + } + }, + "home": { + "inputs": { + "nixpkgs": [ + "stable" + ] + }, + "locked": { + "lastModified": 1647175256, + "narHash": "sha256-7H+veXPM7IwdN1DoZqliwb9sghlN56koV5dnCu1kpsc=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "a8d00f5c038cf7ec54e7dac9c57b171c1217f008", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-21.11", + "repo": "home-manager", + "type": "github" + } + }, + "hooks": { + "inputs": { + "flake-utils": [ + "utils", + "flake-utils" + ], + "nixpkgs": [ + "unstable" + ] + }, + "locked": { + "lastModified": 1646153636, + "narHash": "sha256-AlWHMzK+xJ1mG267FdT8dCq/HvLCA6jwmx2ZUy5O8tY=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "b6bc0b21e1617e2b07d8205e7fae7224036dfa4b", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "ignore": { + "inputs": { + "nixpkgs": [ + "stable" + ] + }, + "locked": { + "lastModified": 1646480205, + "narHash": "sha256-kekOlTlu45vuK2L9nq8iVN17V3sB0WWPqTTW3a2SQG0=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "bff2832ec341cf30acb3a4d3e2e7f1f7b590116a", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "impermanence": { + "locked": { + "lastModified": 1646131459, + "narHash": "sha256-GPmgxvUFvQ1GmsGfWHy9+rcxWrczeDhS9XnAIPHi9XQ=", + "owner": "nix-community", + "repo": "impermanence", + "rev": "2f39baeb7d039fda5fc8225111bb79474138e6f4", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "impermanence", + "type": "github" + } + }, + "library": { + "locked": { + "lastModified": 1645317664, + "narHash": "sha256-KmeflyKQXMtqsxqlRX+94O6bUCBngqR6seqjd6UIbZM=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "1637168cfad105ccd522ae59648ce0289966c565", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "nixpkgs.lib", + "rev": "1637168cfad105ccd522ae59648ce0289966c565", + "type": "github" + } + }, + "nur": { + "locked": { + "lastModified": 1647732151, + "narHash": "sha256-kKsCI22r15RokPdjWrsH93p8umrvVCi9fzuqGuRHIUc=", + "owner": "nix-community", + "repo": "NUR", + "rev": "854cd34363d3a681ad3ff6cb597381d7f84bf9fb", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "root": { + "inputs": { + "compatibility": "compatibility", + "deploy": "deploy", + "filter": "filter", + "gaming": "gaming", + "generators": "generators", + "hardware": "hardware", + "home": "home", + "hooks": "hooks", + "ignore": "ignore", + "impermanence": "impermanence", + "library": "library", + "nur": "nur", + "sops": "sops", + "stable": "stable", + "unstable": "unstable", + "utils": "utils", + "windows": "windows", + "wine": "wine" + } + }, + "sops": { + "inputs": { + "nixpkgs": [ + "stable" + ] + }, + "locked": { + "lastModified": 1647279403, + "narHash": "sha256-ZsHfMah9+TElcjaENsaOIFHBNNtSbXmyLFVbiJiAECs=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "c01f48b055ac776f9831c9d4a0fff83e3b74dbe3", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "stable": { + "locked": { + "lastModified": 1647490331, + "narHash": "sha256-Jcc+vHNDN3KDWuzGNTl3A24ICGovPneJDejiN2t57QI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2c66a7a6e036971c4847cca424125f55b9eb0b0b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-21.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "unstable": { + "locked": { + "lastModified": 1647297614, + "narHash": "sha256-ulGq3W5XsrBMU/u5k9d4oPy65pQTkunR4HKKtTq0RwY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "73ad5f9e147c0d2a2061f1d4bd91e05078dc0b58", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "utils": { + "inputs": { + "flake-utils": "flake-utils" + }, + "locked": { + "lastModified": 1647259887, + "narHash": "sha256-yEkMbEHVO9qydluQ3uHGWX1PkfZhgDKxnd1rhZYZ72w=", + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "rev": "06dba5f3b4fa2cc0bfc98ce9cd6f9a4d8db11d46", + "type": "github" + }, + "original": { + "owner": "gytis-ivaskevicius", + "repo": "flake-utils-plus", + "type": "github" + } + }, + "windows": { + "flake": false, + "locked": { + "lastModified": 1639769632, + "narHash": "sha256-s1Tfm1x9EUNdd2HdtPnI+4zr6XTGtkspuFn50kqYdhM=", + "ref": "master", + "rev": "9d07da799c23a221b0a6462a5db404007ac18250", + "revCount": 37, + "type": "git", + "url": "https://git.m-labs.hk/M-Labs/wfvm" + }, + "original": { + "type": "git", + "url": "https://git.m-labs.hk/M-Labs/wfvm" + } + }, + "wine": { + "inputs": { + "nixpkgs": [ + "unstable" + ] + }, + "locked": { + "lastModified": 1647736800, + "narHash": "sha256-T+5///+P5a+sQV8JWmN32xiloIU8UTiaEGAyDvir0NY=", + "owner": "emmanuelrosa", + "repo": "erosanix", + "rev": "9d9aa6d1923d9a52117290d89de60671f09b1c26", + "type": "github" + }, + "original": { + "owner": "emmanuelrosa", + "repo": "erosanix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix @@ -0,0 +1,162 @@ +############################################### +# ▗▄▄▄ ▗▄▄▄▄ ▄▄▄▖ # +# ▜███▙ ▜███▙ ▟███▛ # +# ▜███▙ ▜███▙▟███▛ # +# ▜███▙ ▜██████▛ # +# ▟█████████████████▙ ▜████▛ ▟▙ # +# ▟███████████████████▙ ▜███▙ ▟██▙ # +# ▄▄▄▄▖ ▜███▙ ▟███▛ # +# ▟███▛ ▜██▛ ▟███▛ # +# ▟███▛ ▜▛ ▟███▛ # +# ▟███████████▛ ▟██████████▙ # +# ▜██████████▛ ▟███████████▛ # +# ▟███▛ ▟▙ ▟███▛ # +# ▟███▛ ▟██▙ ▟███▛ # +# ▟███▛ ▜███▙ ▝▀▀▀▀ # +# ▜██▛ ▜███▙ ▜██████████████████▛ # +# ▜▛ ▟████▙ ▜████████████████▛ # +# ▟██████▙ ▜███▙ # +# ▟███▛▜███▙ ▜███▙ # +# ▟███▛ ▜███▙ ▜███▙ # +# ▝▀▀▀ ▀▀▀▀▘ ▀▀▀▘ # +# --------------------------------------- # +# Author -> V 7 <maydayv7@gmail.com> # +# License -> MIT # +# URL -> github:maydayv7/dotfiles # +# Version -> 20220318 (v7.0) # +# --------------------------------------- # +# Welcome to Ground Zero! # +# The Very Heart of my 'dotfiles' # +############################################### +{ + description = '' + My Self-Contained, Purely Reproducible, Hermetic, Declarative, Automated, Extensible + Multi-PC NixOS Configuration and 'dotfiles' + ''; + + ## Nix Configuration ## + nixConfig = { + commit-lockfile-summary = "chore(flake.lock): Update `inputs`"; + + # Binary Caches + substituters = [ + "https://cache.nixos.org" + "https://nix-community.cachix.org" + "https://nixpkgs-unfree.cachix.org" + "https://nix-gaming.cachix.org" + "https://pre-commit-hooks.cachix.org" + "https://maydayv7-dotfiles.cachix.org" + ]; + + # Public Keys + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "nixpkgs-unfree.cachix.org-1:hqvoInulhbV4nJ9yJOEr+4wxhDV4xq2d1DK7S6Nj6rs=" + "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" + "pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc=" + "maydayv7-dotfiles.cachix.org-1:dpECO0Z2ZMttY6JgWHuAR5M7cqeyfFjUsvHdnMz+j6U=" + ]; + }; + + ## System Repositories ## + inputs = { + ## Package Repositories ## + # NixOS Stable Release + stable.url = "github:NixOS/nixpkgs?ref=nixos-21.11"; + + # Unstable Packages Repository + unstable.url = "github:NixOS/nixpkgs?ref=nixos-unstable"; + + # Nix User Repository + nur.url = "github:nix-community/NUR"; + + # Packaged Games + gaming = { + url = "github:fufexan/nix-gaming"; + inputs.nixpkgs.follows = "unstable"; + inputs.utils.follows = "utils"; + }; + + ## Configuration Modules ## + # Nix Library Functions + library = { + type = "github"; + owner = "nix-community"; + repo = "nixpkgs.lib"; + ref = "master"; + rev = "1637168cfad105ccd522ae59648ce0289966c565"; + }; + + # Flake Compatibility Library + compatibility = { + url = "github:edolstra/flake-compat"; + flake = false; + }; + + # Source Filter Functions + filter.url = "github:numtide/nix-filter"; + ignore = { + url = "github:hercules-ci/gitignore.nix"; + inputs.nixpkgs.follows = "stable"; + }; + + # Flake Utility Functions + utils.url = "github:gytis-ivaskevicius/flake-utils-plus"; + + # PC Hardware Module + hardware.url = "github:nixos/nixos-hardware"; + + # User Home Manager + home = { + url = "github:nix-community/home-manager?ref=release-21.11"; + inputs.nixpkgs.follows = "stable"; + }; + + # Authentication Credentials Manager + sops = { + url = "github:Mic92/sops-nix"; + inputs.nixpkgs.follows = "stable"; + }; + + # File System Persistent State Handler + impermanence.url = "github:nix-community/impermanence"; + + # System Image Generators + generators = { + url = "github:nix-community/nixos-generators"; + inputs.nixpkgs.follows = "stable"; + inputs.nixlib.follows = "library"; + }; + + # Pre-Commit Hooks + hooks = { + url = "github:cachix/pre-commit-hooks.nix"; + inputs.nixpkgs.follows = "unstable"; + inputs.flake-utils.follows = "utils/flake-utils"; + }; + + # Automatic Deployment Tool + deploy = { + url = "github:serokell/deploy-rs"; + inputs.nixpkgs.follows = "stable"; + inputs.utils.follows = "utils/flake-utils"; + inputs.flake-compat.follows = "compatibility"; + }; + + # Windows VM Creator + windows = { + url = "git+https://git.m-labs.hk/M-Labs/wfvm"; + flake = false; + }; + + # Wine Apps Wrapper + wine = { + url = "github:emmanuelrosa/erosanix"; + inputs.nixpkgs.follows = "unstable"; + }; + }; + + ## System Configuration ## + outputs = args: import ./configuration.nix args; +} diff --git a/lib/README.md b/lib/README.md @@ -0,0 +1,35 @@ +### Custom Library Functions + +The `lib` directory contains custom-made pure Flakes-compatible utility functions (exposed as `lib.util`), created in order to simplify the configuration and conveniently define and support multiple use-cases (If you have a working NixOS install, you can check it out using `github:maydayv7/dotfiles#lib`). The following is a summary of all the present functions: + +[`lib.util`](./default.nix) - + +- [`build`](./build.nix): Configuration building functions for efficient system management and declaration - + + - `device`: Main system configuration building function, used to build the entire configuration for devices (`nixosConfigurations`) as per provided parameters + - `iso`: configuration building function used to build the entire configuration for install media (`installMedia`) as per provided parameters + - `each`: Maps function for each `attr` as passed + - `channel`: Builds package `channels` for desired `inputs` with specified `overlays` for each `system`, and optionally patches the `input` + - `mime`: Builds and sets `mimetype` values according to specified application and types + - `script`: Builds script from specified file by removing `shebangs` and exporting as a _string_ + +- [`map`](./map.nix): Mapping functions primarily aimed at shortening code complexity - + + - `filter`: Filters out unneeded `attrs` and maps required ones to specified function + - `list`: Lists all toplevel `attrs` of `attrset` and returns a space-separated string + - `files`: Maps all files with a particular extension stored in a directory as an `attrset` acted upon by specified function. Use `files'` in order to recursively search inside directories + - `patches`: Maps all file patches stored in a directory, if available + - `module`: Maps all configuration files stored in a directory into a list for easy import. Use `module'` in order to map file names instead of paths + - `modules`: Maps all configuration modules stored in a directory as an `attrset` acted upon by specified function. Use `modules'` in order to recursively search inside directories + - `secrets`: Maps binary `sops` encrypted secrets stored in a directory + +- [`pack`](./pack.nix): Utility packager functions used to conveniently perform package management functions - + + - `device`: Pack desired system derivations into individual packages + - `user`: Pack `self.homeConfigurations` derivations into individual packages + +- [`types`](./types.nix): Custom Module Option Types for advanced configuration - + + - `mergedAttrs`: Type specifier for merged `attrsets` + +The [`compat`](./compat) directory consists of compatibility libraries which enable you to run legacy Nix commands such as `nix-build`, `nix-shell`, and so on... diff --git a/lib/build.nix b/lib/build.nix @@ -0,0 +1,76 @@ +{ + self, + platforms, + lib, + ... +}: let + inherit (lib) flatten hasPrefix mapAttrsToList nameValuePair recursiveUpdate splitString util; + inherit (builtins) any attrValues concatStringsSep filter hasAttr isPath listToAttrs map readFile; +in rec { + ## Builder Functions ## + each = attr: func: + listToAttrs (map (name: nameValuePair name (func name)) attr); + + # Configuration Builders + device = self.nixosModule.config; + iso = config: + self.nixosModule.config (config + // { + format = "iso"; + description = "Install Media"; + kernelModules = ["nvme"]; + gui.desktop = config.gui.desktop + "-minimal"; + + # Default User + user = { + name = "nixos"; + description = "Default User"; + minimal = true; + recovery = false; + shells = null; + password = readFile ../modules/user/passwords/default; + }; + }); + + # Package Channels Builder + channel = src: overlays: patch: let + patches = util.map.patches patch; + in + each platforms (system: let + pkgs = src.legacyPackages."${system}"; + in + ( + if !(any isPath patches) + then import src + else + import (pkgs.applyPatches { + inherit src patches; + name = "Patched-Input_${src.shortRev}"; + }) + ) { + inherit system; + config = import ../modules/nix/config.nix; + overlays = + overlays + ++ (attrValues self.overlays or {}) + ++ [ + (final: prev: + recursiveUpdate {custom = self.packages."${system}";} + self.channels."${system}") + ]; + }); + + # Mime Types Handler + mime = values: option: + listToAttrs (flatten (mapAttrsToList (name: types: + if hasAttr name option + then map (type: nameValuePair type option."${name}") types + else []) + values)); + + # Script Builder + script = file: + concatStringsSep "\n" + ((filter (line: line != "" && !(hasPrefix "#!" line))) + (splitString "\n" (readFile file))); +} diff --git a/lib/compat/build.nix b/lib/compat/build.nix @@ -0,0 +1 @@ +let default = (import ./flake.nix).defaultNix; in default diff --git a/lib/compat/flake.nix b/lib/compat/flake.nix @@ -0,0 +1,15 @@ +let + flake = import (let + lock = + (builtins.fromJSON + (builtins.readFile ../../flake.lock)) + .nodes + .compatibility + .locked; + in + fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lock.rev}.tar.gz"; + sha256 = lock.narHash; + }) {src = ../../.;}; +in + flake diff --git a/lib/compat/nixos/default.nix b/lib/compat/nixos/default.nix @@ -0,0 +1,3 @@ +_: +with (import ../flake.nix).defaultNix; + nixosConfigurations."${inputs.library.lib.fileContents /etc/hostname}" diff --git a/lib/compat/shell.nix b/lib/compat/shell.nix @@ -0,0 +1 @@ +let default = (import ./flake.nix).shellNix; in default diff --git a/lib/default.nix b/lib/default.nix @@ -0,0 +1,11 @@ +{ + self, + platforms, + lib, +} @ args: +with {inherit (lib) makeExtensible attrValues foldr;}; + (makeExtensible (final: + with final; + (import ./map.nix args).modules ./. (file: import file args))) + .extend + (final: prev: foldr (x: y: x // y) {} (attrValues prev)) diff --git a/lib/map.nix b/lib/map.nix @@ -0,0 +1,106 @@ +{lib, ...}: let + inherit + (builtins) + attrNames + attrValues + foldl' + isPath + pathExists + readDir + toString + ; + + inherit + (lib) + flatten + filterAttrs + hasPrefix + hasSuffix + id + mapAttrs' + mapAttrsToList + mkIf + nameValuePair + removeSuffix + ; +in rec { + ## Mapping Functions ## + filter = name: func: attrs: filterAttrs name (mapAttrs' func attrs); + list = func: foldl' (x: y: x + y + " ") "" (attrNames func); + + ## Files Map + # Top Level + files = dir: func: extension: + filter (name: type: type != null && !(hasPrefix "_" name)) (name: type: let + path = "${toString dir}/${name}"; + in + if + (type == "directory" || type == "symlink") + && ( + if (extension == ".nix") + then pathExists "${path}/default.nix" + else true + ) + then nameValuePair name (func path) + else if + type + == "regular" + && ( + if (extension == ".nix") + then name != "default.nix" + else true + ) + && hasSuffix extension name + then nameValuePair (removeSuffix extension name) (func path) + else nameValuePair "" null) (readDir dir); + + # Recursive + files' = dir: func: extension: + filter (name: type: type != null && !(hasPrefix "_" name)) (name: type: let + path = "${toString dir}/${name}"; + in + if (type == "directory" || type == "symlink") + then nameValuePair name (files' path func) + else if + type + == "regular" + && ( + if (extension == ".nix") + then name != "default.nix" + else true + ) + && hasSuffix extension name + then nameValuePair (removeSuffix extension name) (func path) + else nameValuePair "" null) (readDir dir); + + # Package Patches + patches = patch: + if isPath patch + then + flatten (mapAttrsToList (name: type: + if + type + == "regular" + && (hasSuffix ".diff" name || hasSuffix ".patch" name) + then patch + "/${name}" + else null) (readDir patch)) + else patch; + + # Module Imports + module = dir: attrValues (modules dir id); + module' = dir: attrNames (modules dir id); + modules = dir: func: files dir func ".nix"; + modules' = dir: func: files' dir func ".nix"; + + # 'sops' Encrypted Secrets + secrets = dir: neededForUsers: + filter (name: type: type != null && !(hasPrefix "_" name)) (name: type: + if type == "regular" && hasSuffix ".secret" name + then + nameValuePair name { + sopsFile = dir + "/${name}"; + format = "binary"; + inherit neededForUsers; + } + else nameValuePair "" null) (readDir dir); +} diff --git a/lib/pack.nix b/lib/pack.nix @@ -0,0 +1,23 @@ +{ + self, + lib, + ... +}: let + inherit (builtins) attrNames; + inherit (lib) genAttrs id mapAttrs'; +in rec { + ## Packager Functions ## + # Device Configurations + device = attrs: check: + mapAttrs' (_: name: { + name = "Device-${name}"; + value = attrs."${name}".config.system.build."${check}"; + }) (genAttrs (attrNames attrs) id); + + # User Home Configurations + user = user: + mapAttrs' (_: name: { + name = "User-${name}"; + value = self.homeConfigurations."${user}".activationPackage; + }) (genAttrs (attrNames self.homeConfigurations) id); +} diff --git a/lib/types.nix b/lib/types.nix @@ -0,0 +1,10 @@ +{lib, ...}: let + inherit (lib) mkOptionType getValues; +in rec { + ## Module Option Types ## + # Merged Attribute Sets + mergedAttrs = mkOptionType { + name = "mergedAttrs"; + merge = _: getValues; + }; +} diff --git a/modules/README.md b/modules/README.md @@ -0,0 +1,57 @@ +### Custom Configuration Modules + +The `modules` directory contains custom-made pure Flakes-compatible configuration modules, which form the very core of my configuration for multiple PCs and various use-cases (If you have a working NixOS install, you can check it out using `github:maydayv7/dotfiles#nixosModules`). The following is a summary of all the present configuration options exposed by the particular module: + +[`nixosModules`](./default.nix) - + +- [`apps`](./apps): Module that configures various apps and/or environments - + + - `list`: List of all enabled applications - `[ "discord" "firefox" "git" "office" "wine" ]` + - `git` - + - `hosting` - + - `enable`: Enable Gitea Code Hosting - `true / false` + - `domain`: Website Domain Name - Ex. `maydayv7.io` + - `runner`: Enable Support for `git` Runners - `"github" / "gitlab"` + - `wine.package`: Package to use for `wine` - Ex. `pkgs.wineWowPackages.staging` + +- [`base`](./base): Module that contains the base common/shared configuration + +- [`gui`](./gui): Module that configures GUI Desktops/Environments and the like - + + - `desktop`: Choice of GUI Desktop - `"gnome" / "xfce"` + - `fonts.enable`: Enable Fonts Configuration - `true / false` + +- [`hardware`](./hardware): Module that configures device and additional hardware - + + - `boot`: Supported Boot Firmware - `"mbr" / "efi"` + - `cores`: Number of CPU Cores - Ex. `4` + - `filesystem`: Disk File System Choice - `"simple" / "advanced"` - + - `persist`: System Files to Preserve across Reboots (while using `advanced` File System Layout) + - `modules`: List of Hardware Configuration Modules imported from [`inputs.hardware`](https://github.com/nixos/nixos-hardware) - Ex. `[ "common-pc" ]` + - `security`: Enable Additional Security and Hardening Settings - `true / false` + - `support`: List of Additional Supported Hardware - `[ "mobile" "printer" "ssd" "virtualisation" ]` + - `passthrough`: PCI Device IDs for VM Passthrough using VFI/O (Use [`scripts/pci.sh`](../scripts/pci.sh)) - Ex. `[ "00:02.0" "00:1c.0" ]` + +- [`nix`](./nix): Module that configures the Nix Package Manager - + + - `index`: Enable Package Indexer - `"true" / "false"` + +- [`user`](./user): Module that controls User Creation and Security Settings - + + - `groups`: Additional User Groups - Ex. `[ "wheel" ]` + - `persist`: User Files to Preserve across Reboots (while using `advanced` File System Layout) + - `home`: User Home Configuration (Alias for `home-manager.users.${username}`) - + - `credentials`: Individual User Credentials - + - `name`: Alternative (Work) User Name + - `fulname`: Full User Name + - `mail`: User Mail ID - Ex. `"nixos@localhost.org"` + - `key`: User GPG Key - Ex. `"CF616EB19C2765E4"` + - `settings`: User Settings (Alias for `users.users.${username}`) - + - `autologin`: Enable Automatic User Login - `"true" / "false"` + - `minimal`: Enable Minimal User Configuration - `"true" / "false"` + - `recovery`: Enable User Recovery Settings - `"true" / "false"` + - `homeConfig`: User Specific Home Configuration + +- [`shell`](./shell): Module that contains User Shell Environment Configuration - + - `utilities`: Enable Additional Shell Utilities - `true / false` + - `support`: List of Additional Supported Shells - Ex. `[ "bash" ]` diff --git a/modules/apps/default.nix b/modules/apps/default.nix @@ -0,0 +1,10 @@ +{lib, ...}: +with {inherit (lib) mkOption types util;}; { + imports = util.map.module ./.; + + options.apps.list = mkOption { + description = "List of Enabled Applications"; + type = types.listOf (types.enum (util.map.module' ./.)); + default = []; + }; +} diff --git a/modules/apps/discord.nix b/modules/apps/discord.nix @@ -0,0 +1,31 @@ +{ + config, + lib, + pkgs, + files, + ... +}: let + enable = builtins.elem "discord" config.apps.list; +in { + ## Discord Configuration ## + config = lib.mkIf enable { + environment.systemPackages = with pkgs; [betterdiscordctl discord]; + + user = { + persist.dirs = [".config/BetterDiscord" ".config/discord"]; + home.home = { + # Plugins + file.".config/BetterDiscord/plugins" = { + source = files.discord.plugins; + recursive = true; + }; + + # Discord Activation + activation.discordSetup = lib.hm.dag.entryAfter ["writeBoundary"] '' + echo "Setting up Discord..." + $DRY_RUN_CMD /usr/bin/env betterdiscordctl $VERBOSE_ARG install || true + ''; + }; + }; + }; +} diff --git a/modules/apps/firefox.nix b/modules/apps/firefox.nix @@ -0,0 +1,97 @@ +{ + config, + lib, + pkgs, + files, + ... +}: let + inherit (lib) mkIf util; + enable = builtins.elem "firefox" config.apps.list; +in { + ## Firefox Browser Configuration ## + config = mkIf enable { + environment.systemPackages = [pkgs.firefox]; + user.persist.dirs = [".cache/mozilla/firefox" ".mozilla/firefox"]; + + user.home = { + # File Associations + xdg.mimeApps.defaultApplications = util.build.mime files.xdg.mime { + browser = ["firefox.desktop"]; + }; + + # Profile + programs.firefox = { + enable = true; + profiles.default.settings = { + ## Flags + # General + "browser.aboutConfig.showWarning" = false; + "browser.shell.checkDefaultBrowser" = false; + "browser.toolbars.bookmarks.visibility" = "always"; + "browser.urlbar.showSearchSuggestionsFirst" = false; + + # Features + "browser.search.openintab" = true; + "layout.spellcheckDefault" = 2; + + # New Tab + "browser.newtabpage.activity-stream.feeds.section.highlights" = false; + "browser.newtabpage.activity-stream.feeds.section.topstories" = false; + "browser.newtabpage.activity-stream.feeds.topsites" = false; + "browser.newtabpage.activity-stream.showSearch" = true; + "browser.newtabpage.activity-stream.showSponsored" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.newtabpage.activity-stream.section.highlights.includePocket" = + false; + "browser.newtabpage.activity-stream.feeds.section.highlights.includePocket" = + false; + + # Theming + "browser.uidensity" = 0; + "devtools.theme" = "dark"; + "layers.acceleration.force-enabled" = true; + "mozilla.widget.use-argb-visuals" = true; + "svg.context-properties.content.enabled" = true; + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + + # Passwords + "signon.autofillForms" = false; + "signon.rememberSignons" = false; + "signon.generation.enabled" = false; + "signon.management.page.breach-alerts.enabled" = false; + + # Extensions + "extensions.pocket.enabled" = false; + "extensions.htmlaboutaddons.inline-options.enabled" = false; + "extensions.htmlaboutaddons.recommendations.enabled" = false; + + # Telemetry + "app.shield.optoutstudies.enable" = false; + "beacon.enabled" = false; + "browser.newtabpage.activity-stream.feeds.telemetry" = false; + "browser.newtabpage.activity-stream.telemetry" = false; + "browser.ping-centre.telemetry" = false; + "browser.send_pings" = false; + "browser.urlbar.suggest.quicksuggest.nonsponsored" = false; + "datareporting.healthreport.service.enabled" = false; + "datareporting.healthreport.uploadEnabled" = false; + "datareporting.policy.dataSubmissionEnabled" = false; + "dom.battery.enabled" = false; + "dom.gamepad.enabled" = false; + "experiments.enabled" = false; + "experiments.manifest.uri" = ""; + "experiments.supported" = false; + "toolkit.telemetry.archive.enabled" = false; + "toolkit.telemetry.bhrPing.enabled" = false; + "toolkit.telemetry.enabled" = false; + "toolkit.telemetry.firstShutdownPing.enabled" = false; + "toolkit.telemetry.newProfilePing.enabled" = false; + "toolkit.telemetry.reportingpolicy.firstRun" = false; + "toolkit.telemetry.shutdownPingSender.enabled" = false; + "toolkit.telemetry.unified" = false; + "toolkit.telemetry.updatePing.enabled" = false; + }; + }; + }; + }; +} diff --git a/modules/apps/git/default.nix b/modules/apps/git/default.nix @@ -0,0 +1,153 @@ +{ + config, + lib, + pkgs, + files, + ... +}: let + inherit (lib) mkIf util; + enable = builtins.elem "git" config.apps.list; +in { + imports = [./hosting.nix ./runner.nix]; + + ## 'git' Configuration ## + config = mkIf enable { + # Secrets + sops.secrets = util.map.secrets ./secrets false; + + # Utilities + environment.systemPackages = with pkgs; [ + gitFull + git-crypt + git-lfs + gh + tig + ]; + + # Settings + user = { + persist.dirs = [".config/gh"]; + home = { + imports = [./user.nix]; + + # Hooks + home.file.".git-hooks".source = files.git.hooks; + + # 'gh' Configuration + programs = { + gh = { + enable = true; + settings = { + prompt = "enabled"; + git_protocol = "https"; + aliases = rec { + a = "alias list"; + b = "browse"; + cfg = "config"; + ci = "run"; + co = "${p} checkout"; + g = "gpg-key"; + i = "issue"; + ic = "${i} close"; + is = "${i} status"; + iv = "${i} view"; + p = "pr"; + pm = "${p} merge"; + pv = "${p} view"; + r = "repo"; + rd = "${rl} download"; + rl = "release"; + rv = "${rl} view"; + s = "secret"; + w = "workflow"; + }; + }; + }; + + # 'git' Settings + git = { + enable = true; + lfs.enable = true; + + # Pager + delta = { + enable = true; + options = { + line-numbers = true; + theme = "Monokai Extended"; + conflictstyle = "diff3"; + }; + }; + + # Globally Ignored Files + ignores = ["*~*" "*.bak" ".direnv" ".vscode" "result" "result-*" "tags.*"]; + + # Additional Parameters + extraConfig = { + color.ui = "auto"; + core.hooksPath = "~/.git-hooks"; + credential.helper = "libsecret"; + diff.colorMoved = "default"; + init.defaultBranch = "main"; + pull.rebase = "true"; + }; + + # Command Aliases + aliases = rec { + a = "add"; + ad = "${a} -A ."; + ai = "${a} -i"; + ap = "${a} -p"; + b = "branch"; + bc = "${b} --show-current"; + bd = "${b} -D"; + backup = '' + !sh -c 'CURRENT=$(git ${bc}) && git ${st} && git ${co} -B backup && git ${st} apply && git ${ad} && git ${cam} "backup" && git ${pf} $1 && git ${co} $CURRENT && git ${stp} && git ${bd} backup' -''; + cfg = "config"; + ci = "commit -v"; + cam = "${ci} -am"; + cia = "${ci} -a"; + co = "checkout"; + cp = "cherry-pick"; + cpp = "!sh -c 'CURRENT=$(git ${bc}) && git ${st} && git ${co} -B $2 $3 && git ${cp} $1 && git ${pf} $4 && git ${co} $CURRENT && git ${stp}' -"; + d = "diff"; + df = "${d} HEAD"; + dx = "${d} --color-words"; + dc = "${d} --cached"; + dcx = "${dc} --color-words"; + l = "log --graph --decorate --abbrev-commit"; + l1 = "${l} --pretty=oneline --all"; + lf = "log -p --follow"; + lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset%n' --abbrev-commit --date=relative --branches"; + ll = "${l} -p"; + m = "merge"; + ms = "${m} --squash"; + p = "push"; + pf = "${p} --force"; + pl = "!sh -c 'git pull && git fetch -p' -"; + pt = "${p} --tag"; + pu = "${p} --set-upstream"; + rb = "rebase"; + record = "!sh -c '(git ${a} -p -- $@ && git ${ci}) || git ${r}' --"; + ro = "restore"; + r = "reset"; + rs = "${r} --soft"; + rh = "${r} --hard"; + rsh = "${rs} HEAD^"; + s = "!git --no-pager status"; + sm = "submodule"; + st = "stash"; + std = "${st} drop"; + sti = "${st} --keep-index"; + stp = "${st} pop"; + sync = "${pf} --mirror"; + t = "tag"; + td = "!sh -c 'git ${t} -d $1 && git ${p} origin :$1' -"; + tl = "${t} -l"; + }; + }; + }; + }; + }; + }; +} diff --git a/modules/apps/git/hosting.nix b/modules/apps/git/hosting.nix @@ -0,0 +1,109 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkEnableOption mkIf mkOption types; + inherit (config.apps.git.hosting) enable domain; + opt = config.apps.git.hosting.domain; + inherit (config.sops) secrets; +in { + options.apps.git.hosting = { + enable = lib.mkEnableOption "Enable Gitea Code Hosting"; + domain = mkOption { + description = "Website Domain Name"; + type = types.str; + default = ""; + example = "maydayv7.io"; + }; + }; + + config = mkIf enable { + assertions = [ + { + assertion = domain != ""; + message = opt + " must be set"; + } + ]; + + # User Configuration + user.groups = ["gitea"]; + users.users.git = { + useDefaultShell = true; + home = "/var/lib/gitea"; + group = "gitea"; + isSystemUser = true; + }; + + # Gitea Settings + services.gitea = { + enable = true; + lfs.enable = true; + + # Security + user = "git"; + database.user = "git"; + cookieSecure = true; + disableRegistration = true; + + # Repository + inherit domain; + appName = "Code Hosting"; + rootUrl = "https://${domain}"; + httpPort = 7000; + settings.ui.DEFAULT_THEME = "arc-green"; + }; + + # NGINX Secured Reverse Proxy + environment.persist.dirs = ["/srv"]; + networking.firewall = { + allowedUDPPorts = [7000]; + allowedTCPPorts = [80 443 7000]; + }; + + security.acme = { + acceptTerms = true; + email = "accounts+acme@${domain}"; + certs."${domain}" = { + group = "nginx"; + email = "admin@${domain}"; + dnsProvider = "cloudflare"; + credentialsFile = secrets."cloudflare.secret".path; + extraLegoFlags = ["--dns.resolvers=8.8.8.8:53"]; + }; + }; + + services.nginx = { + enable = true; + + # Security + clientMaxBodySize = "128k"; + commonHttpConfig = '' + client_body_buffer_size 4k; + large_client_header_buffers 2 4k; + map $sent_http_content_type $expires { + default off; + text/html 10m; + text/css max; + application/javascript max; + application/pdf max; + ~image/ max; + } + ''; + + # Recommended Defaults + recommendedGzipSettings = true; + recommendedOptimisation = true; + recommendedProxySettings = true; + recommendedTlsSettings = true; + + # Code Hosting + virtualHosts."${domain}" = { + forceSSL = true; + useACMEHost = "${domain}"; + root = "/srv/www/${domain}"; + locations."/".proxyPass = "http://127.0.0.1:7000"; + }; + }; + }; +} diff --git a/modules/apps/git/runner.nix b/modules/apps/git/runner.nix @@ -0,0 +1,47 @@ +{ + config, + lib, + pkgs, + files, + ... +}: let + inherit (lib) mkIf mkMerge mkOption types; + inherit (config.apps.git) runner; + inherit (config.sops) secrets; +in { + options.apps.git.runner = mkOption { + description = "Support for 'git' Runners"; + type = types.nullOr (types.enum ["github" "gitlab"]); + default = null; + }; + + ## Runner Configuration ## + config = mkIf (runner != null) (mkMerge [ + (mkIf (runner == "github") { + # GitHub Runner + environment.systemPackages = [pkgs.act]; + services.github-runner = { + enable = true; + url = files.path.repo; + extraLabels = ["self"]; + tokenFile = secrets."github-runner.secret".path; + }; + }) + + (mkIf (runner == "gitlab") { + # Docker Support + boot.kernel.sysctl."net.ipv4.ip_forward" = true; + virtualisation.docker.enable = true; + + # GitLab Runner + services.gitlab-runner = { + enable = true; + services.default = { + dockerImage = "alpine"; + tagList = ["self"]; + registrationConfigFile = secrets."gitlab-runner.secret".path; + }; + }; + }) + ]); +} diff --git a/modules/apps/git/secrets/.git-keep b/modules/apps/git/secrets/.git-keep diff --git a/modules/apps/git/secrets/cloudflare.secret b/modules/apps/git/secrets/cloudflare.secret @@ -0,0 +1,21 @@ +{ + "data": "ENC[AES256_GCM,data:Lh7MM8/KHG2AyI+lFd28K/e7pdMWmxfgpxyn22fihOhCXqR8Yysp12WQnRwvWjRr3PvCTgkJKtG8cCXnfngZU+0=,iv:0QwPMqaoHuTZZ3PisXGDKoXgI/M8hXGihWjPSQqGP3E=,tag:ZXqkpJLQKZ+Bm7H/bDX6hw==,type:str]", + "sops": { + "kms": null, + "gcp_kms": null, + "azure_kv": null, + "hc_vault": null, + "age": null, + "lastmodified": "2022-02-28T12:31:31Z", + "mac": "ENC[AES256_GCM,data:bRoC+A8or05GtG22wSet1vdedKfdavnZqna57u46cb0TuVzooxZR6c7v+wjb3sMcnZLEABKg1dA2oX+vIBzuAlFrtdUDiHWfXrhMTYGf7qoeKORRF5ETLC/FDCIPbSJeUVkKan0DKQyqg5lXMyh19f20iH04uNHH9jF4yvDhnIs=,iv:Cp5FoBm4F0uK1caSF2k/VRZRzsIiRtYaXj6p/zJ+mco=,tag:lKE6WoLFeeWxX4DNNe1LZw==,type:str]", + "pgp": [ + { + "created_at": "2022-02-28T12:30:04Z", + "enc": "-----BEGIN PGP MESSAGE-----\n\nwcFMA5HNgftiFxX/ARAAfedX9tZ4Y3uWyFC0DWCPfzcd4KIEvUE1JBYPPGKg40s4\nxWdXPRdRbtSmoNg+OAkfSg4LjGKHJBoG59fbQoZulkTSA987hHAMivmXDoQ+6K4z\nuU9X+5d5MBc8mHqLJWHbvXhjPzbPfWyKN5DZdqoAgC5KxQx6SJNtRYALEP+YhIAa\naAHbhmUt55/6NSY2XUaUz54D45ZNW2KWZ8EMtxLthNEtmmWMi+wy4xbDyag6NvJP\njBZxEXXpn7mY6Ha9ehiqCKF8+HPFFpdh+qITehuXrpEyxv0xT3zs6NZEAHCzY7fn\ngcRGGRPaBZdbiDIZ6XDsRMjMppK+yoGj9mNzugMp/gkmuvmQGK1GZPLiaewP3tz/\n3tvX6ghWTrFMi4xvz96ZpP9HxTaOD5LYMqvAftJ3gelh0BFL1U9s0CXeecT50r2c\nFuK5yd6FW2edtaVcSaE9VQ2H1XAyiY7PkKbYbMvSVJlYgrDyOK1s1s6ATQFB6KO5\nFzhu+PLRKvwLJzBYTRrwCUuMUFxObJT4fdy1J21l9J99F76leZgtBdaDyFGBOhW1\nRu/sTbGfnz7A70NP+gWOlVRKnmJt3O8f5BlaCnmtVvEPbHVSugYbR//uEYJgEX01\nHU8BloLVdIDLxFQAilC7JZrq805lGfTy1plKq69XaR8+vJoefS0wAD0rpf4/Uh7S\n5gFdmiqL5+yiQg3ph7dxIKZnsEEjR71fb+5tCdDouiFrAbtIJHnrFqY+dxOxyDQv\nSolhPwTuE4Y/IXDFqpQDZNvkz0GnNCDV/yyXuApaE6iJ+uLobOELAA==\n=Iw6T\n-----END PGP MESSAGE-----", + "fp": "8C240C0C11293EE56260601CCF616EB19C2765E4" + } + ], + "unencrypted_suffix": "_unencrypted", + "version": "3.7.1" + } +} +\ No newline at end of file diff --git a/modules/apps/git/secrets/github-runner.secret b/modules/apps/git/secrets/github-runner.secret @@ -0,0 +1,21 @@ +{ + "data": "ENC[AES256_GCM,data:l0eNGvQEDkX11cCzqO/imP2XfNYY/TvUsGgeUoE=,iv:uOYAaAENczmSWhvworT4G+8Gehst9Qlxsd7yUNHCyi0=,tag:B2yd/K1AmjN0hrSp0gXKZw==,type:str]", + "sops": { + "kms": null, + "gcp_kms": null, + "azure_kv": null, + "hc_vault": null, + "age": null, + "lastmodified": "2022-01-13T09:27:23Z", + "mac": "ENC[AES256_GCM,data:QwAVT6jHmAiEAu2GnouB5aBXH5BWS11alDio++02vw4WEj8V5nh0eMjb75QeePMZJplWx65UlVxzEW/gy46Zv/u1OwK9NksYM3BfE/9VyELfsRzkRuSf2V11nNNxgyZkf1pW6KbqrUGoTSFqqbxCyCT9J4pJMNWIiNNpWzVyaGk=,iv:2xDNRjQQARFDnc1R9DUe+rA3tpJLOrmDLYiahWlrNQg=,tag:iqV4ltWWZmi+Y05DbMtIiw==,type:str]", + "pgp": [ + { + "created_at": "2022-01-13T09:27:16Z", + "enc": "-----BEGIN PGP MESSAGE-----\n\nhQIMA5HNgftiFxX/AQ/+MBFKxfHeYRqzCA6t91V1X2uFSPN0kHj6fBJKpn4vvBp3\n4fTHq1JyHVFcZ2mGZFQn3Wz3eSiM+rek18LfkP/97PiW9EGDQC0VufaKHZWsWr0B\n8h3UKyUhLVammaURO77CX296Yw28qyUBinVOXt4vc/C78a+nuIT9580YoI/tAyXf\nToVaq/6umb+xn9SiZ5p5mKwquIFSHIBL635Y0cHjTnZoe3QP3MKoVlsmp9PPhN5w\n6OY+kW4g8VbANdxx21Ov9VD4oz6PezJPdqjOGmSiK5tv25JFBTlZvop4iTYL0VVZ\nP2kR18qdEIKrm9ucAyts5ClW8idZYlLEvDz98dWSQIJSZ6X2cB0C/MbgJyHxHruv\nv6dnuDMPeCfcIi8yslWHJovs8Aq6iEQNtbnYCvkLX6Tb4dI0yEOcEH+nPlzrGpeY\ns0pQnLxpvjmBj024oDPk8Tl/vyg6XvbUm60MbY/i772uilB0VReFY970KMurhr4b\n3QBGEGS2VDMbWVZ59lq91Kd2n0A6sYAI6Bmd98m7vcPDK5/vDHpwbV58BKtqK8d+\nMLXdSbp60q1sJJgtwM6yT1f7TOt4pMnWM05SIp0XqYhPh3xosnDplk69+RHJgXT0\ns00x0TJ4bauyi30lixcVs0XNJoSzDsNtLL0FMWdddyftGxrTJ1MJcU8HwP6UKFrS\nXgFDcsCgDEwljdaWJnMq0b+tEtFpwtl7US8Ebf6DcABm0Dc9Dezd3NMBQwt8M/Cq\nAaSsc9A7wQXdSszkYcRRnz4LHP47mIVog/5MB+RhS+aOEEuh9HCB+m7UfRgSWr0=\n=VQsH\n-----END PGP MESSAGE-----\n", + "fp": "8C240C0C11293EE56260601CCF616EB19C2765E4" + } + ], + "unencrypted_suffix": "_unencrypted", + "version": "3.7.1" + } +} +\ No newline at end of file diff --git a/modules/apps/git/secrets/github-token.secret b/modules/apps/git/secrets/github-token.secret @@ -0,0 +1,21 @@ +{ + "data": "ENC[AES256_GCM,data:A5a4CSK+83lmbqPWygu+gsPFBLLAy8yTxHoBIyKN7ulGl+WLwWLiQA==,iv:QLs0uE6eFZ9F8nwylhZOB0uwH0GTOxt5vRWtkv5w2sE=,tag:8oedSubKoHmDiv2qrgOInw==,type:str]", + "sops": { + "kms": null, + "gcp_kms": null, + "azure_kv": null, + "hc_vault": null, + "age": null, + "lastmodified": "2022-01-12T09:47:31Z", + "mac": "ENC[AES256_GCM,data:r6jdmReGxXpAS8C2k/jCAsLDHu/NQwVAJ8OannMQeYl3LMrhLZIjzK0GhP/5pzG6boIDL/J/i3ixPGX/cQO8hmlL+uXP3Y+kQqVIPu0NXTcl9QG3/ReS0GY3IBmbXUw94eNzrsW33taqyuzA2mt/EMWxDXIzY1Q2QdndWmPRmCc=,iv:9OCVHvCimlrpwntVq1Xqkf+uxxqw31iBwLRX3BEEXE8=,tag:rRLC4X+SgWM3mNuheuuaWQ==,type:str]", + "pgp": [ + { + "created_at": "2022-01-12T09:46:59Z", + "enc": "-----BEGIN PGP MESSAGE-----\n\nhQIMA5HNgftiFxX/ARAAtu1veuPBSN5s2Fu8gCpVYDaXtoXJ3so7lVTBDJ0dSJbW\nu8u5hqKDhbsgZvAYyVY6KI3Pzc7YSS/qF192C4Wd8gpSsuw0vTm6B9sYsrHCGQus\nDwoDsYpxtxIivKDsSFAjg2xXgN92UGBZjuaRXLN+3nt9cg3QeAuP86bGHpxnS3tk\nbD6rnsrx3XfvhWZOqhRY8ZDwYW844ZrvBDAq4oJIaxMt5g23GnDN9ObsiWOl09u1\n4Hkq7ZfAvf8fvWU3rAoInuP8oj9zr6PT3PMZAs3mG+xBstGdDaqsaaSPmpd4P73p\nv0HUIfnnVG9SkqdpeVK/ZXmHilBWJFYtVzetbeaAko2Op/H4BCY/e6SPj0wrz5sn\ntwmnpAJFev5zhPZ4VexErQkN1CbALPJITG/CowRP+/p4ED2Mcn2xPtaHTAXtWNlc\n7Ew/Yuy8DsXJgYu1jYbxxb12k4I+WM9PvHN7R1V3qLKy/fhyhAZURYkDJWP1BWyl\niB4R+0HnnwREQw9WlhiSzDIc2gYdTC6MGi5RPe0TYMADN00S5pqciQBWasGAYgaQ\nX1oc2I4N54/Te1jdfJpps8hCe3OrHTw11x//VDILjAgTmJK+5KD3fjt0Fw6eNDD3\nEs+OuoSD0GIB5wjKphz7dj9W0htpFgD4A3T6wBGZyp1JQFszt5bQIA+uPSmgjqvS\nXgE9RPpsehmkqor3U9bzKVy06r05oz6pPHR2FBPvy1mvvbKLm8ri8QFq8B65Drxv\nQOG0Vzw89zR4AECl3zW/HMXhUt2RUvkEvVq83AW/XonZf4x3Um0mp39qWjJGM5o=\n=OL8H\n-----END PGP MESSAGE-----\n", + "fp": "8C240C0C11293EE56260601CCF616EB19C2765E4" + } + ], + "unencrypted_suffix": "_unencrypted", + "version": "3.7.1" + } +} +\ No newline at end of file diff --git a/modules/apps/git/secrets/gitlab-runner.secret b/modules/apps/git/secrets/gitlab-runner.secret @@ -0,0 +1,21 @@ +{ + "data": "ENC[AES256_GCM,data:dPTv/M5Bc6+s55lKQ+DRsG45laezTXfniTHeXTK8lYEaJ3CrcaFGEOrj3f8kCW7Uj4GxMwR86pO42t/SEoG3S7lyUo3e7tzVJQ==,iv:kMJqsvaadihOYDqJE0INGorXwpv+0wYERinWMPGwW9c=,tag:DwNteZVvjnFB2ILWgZSjUA==,type:str]", + "sops": { + "kms": null, + "gcp_kms": null, + "azure_kv": null, + "hc_vault": null, + "age": null, + "lastmodified": "2022-01-20T08:14:28Z", + "mac": "ENC[AES256_GCM,data:q5256oSAE4mqunXBpABRnCMhrKEZJQMzgmk1dVuj1JBYb7Tjr2+xCAFXe8iSEgup4ZunjQfk8AcqoO5YFEy1slC4zrDmbYxG/0BhsHEr/vaQYlA1Rfp6dDAxjEi5eSAvpPa1gaK0gBfwQpkHFgjW6r4Pg3ECxRQe+40p2sB10X4=,iv:gAQjbLjAep1+Y/SbNVPFHQhrU/tZqA4oYNhm6Vge7Q4=,tag:i4q5qkzRYowHHdvMnpyQ9Q==,type:str]", + "pgp": [ + { + "created_at": "2021-12-19T10:16:57Z", + "enc": "-----BEGIN PGP MESSAGE-----\n\nhQIMA5HNgftiFxX/ARAAguptlOs8GFy6DIBpH/67DkeTmYIDNbBe/MPa845FkrWY\nnY6RsVv0GJtSSg3ssvO+5p0rpRI017gSdhYozu+Pi3f3hmjUexT33YahXDpMa4VZ\nUxUnTjczbQQd0nq/Y/rFpjDDuno32175j+CCWipIQ+Jrjk8XuQCNgL08a+jhD1ml\nT9pRh3YPbNSJEQKsCMKK06iA3wApu226wX5L6XlOUmOpF0aTT0Vq5nz44e/XZYcJ\nW2VaKZnKqNgF2eyfS1FVSIT53FuRhfYAqUw96UL1k9R9ZNSeiOXTz2i8/zzOSgiv\n7v85lU/gLt0gVt0YqC8lEQ/Ys5NuNweBa5ihWfP/0gIyPy9hjx0qmCe5BYX1MYeu\nBBrFLjgHIsvdnq4LHi9igsuSCZ+fOowly8w1UgvbrVxbwrxkbbT0mrbzg3JJ5JiQ\nxMregxNbUBnF1+7HI/FHxhEihsAj4DvYoiW2YlqKuKFuO1edQX2nkjtdjyzL8qYA\nPQCjDpHV1HwdZsgkuKC/gV+i8xmDnMLaWABZ420qj7exglkQ5oxOuFPNYotEPaAN\nHnQNatsgOXg7OCGjaagP6kygY2sY86gB900zDyEDIFPLD5CR5jDq8OKnnGScpw/a\nOzDzQWKwD9xRtded5yDwtBpwsCfNhwHZ9ru9BZf9wPwrGPEhP/r80K3PNTHjAvHS\nXgF1Noeh+6Z9ttkFvVPHxcXpwoUd/BvdQ3z7NuVL4L8aeY4N6XX95pME+gkDmJ0F\nVs9+IcHFv9XkKjeGGMz/VpWPCfQrktpZWafIMUvW8407roHJzQhhdbm9dkirY6g=\n=NNyy\n-----END PGP MESSAGE-----\n", + "fp": "8C240C0C11293EE56260601CCF616EB19C2765E4" + } + ], + "unencrypted_suffix": "_unencrypted", + "version": "3.7.1" + } +} +\ No newline at end of file diff --git a/modules/apps/git/secrets/gitlab-token.secret b/modules/apps/git/secrets/gitlab-token.secret @@ -0,0 +1,21 @@ +{ + "data": "ENC[AES256_GCM,data:IgdZH4jFG6j6ZUllYn1C+HWhbz2c7jMunwU=,iv:PApvcmkn+vIB2/5iCmCgAbyBISrVV9Q+38CfUfafgic=,tag:dqsVBSqonjm0D8QmdVJ1AA==,type:str]", + "sops": { + "kms": null, + "gcp_kms": null, + "azure_kv": null, + "hc_vault": null, + "age": null, + "lastmodified": "2021-12-18T08:47:47Z", + "mac": "ENC[AES256_GCM,data:UCvZamMX8KrsPuRpmhjLcReIooA5be8MDIJWPspz/54fcRPrRmvwxMKAsHm637jcLbM7Js8m0/xKO+i8j4EEmSiexUrk9/zn+TGRWGpeGDZPy07NzZa1SqL2sxhbz54U/lyJhO9uPHkjMEYkdfiSF2rnNwAaZdW5AH+8eNYsg9w=,iv:7fQwtybtXhoiMDPey4i7R+renF/4/cIWV7+XqZImMKg=,tag:XWgx1EKn2YAm+MsOpI0Bmw==,type:str]", + "pgp": [ + { + "created_at": "2021-12-18T08:47:34Z", + "enc": "-----BEGIN PGP MESSAGE-----\n\nhQIMA5HNgftiFxX/ARAAjC4nB+gg5HBh5dA76hEI+PpmeHMPH2OJIG302UlWCQOi\n4ZQaK84HsXLHN5UWLc/g5QcGmyJBHvvvq9JP6uoYYzBKIfGANpbwFzGWAipW0yl5\nls/HjPg0IWOsO6lC4e7YwhyCszuO6ndcOmAQvFJLvjyVl+/2UcXQHTO9+yLrlbpv\nZngD/FWawEcR1Cyjn9r0sT7skBrxbTBnlI/DTHreNMV7AQy0NvQc/7FrLJTNM/fE\nHHmlHRXbyEfVae4YWzzW0RDFo0jw3yiVG1eWwx5cxLVHuwDWb53Cf/dpPRNQNQsq\nY3OntNUhahZpE199+8YgJpHCgjjVLpReCJP8xMTW7Otd/DlpbQUcicZ3T/yNKzwY\noRSgNMlVMsEh9vKeXqcHxJC4OtJmrVvAL3aCU3a0nFMt/Ho7OlkxMnTqBT0U58Xm\nCXZ8MDIQUi+i5tQD6A9/EOoV1a821z9wXP8DZSb6m188ti1XxtQV2raM58urWX3h\nUKirg5+sobIboafgmI57EY9lkmTJg30BJZDHPG6w8vKuCqrNfm4W9xVAPN87M1S4\n9MFoqfTt9/h6nAcu0RVtNlkbeg6tIvNcVrKUghO+7w7n3VPE6tCiyzZ0q64v2j1+\nv0AR7QQYZ5p0nlAYTBp047GsaYV86o1cnSwbV/5P5WYLiqzpQa1QW/EHucnxLW/S\nXgG6IgIeeuvqG8FUcheJ7KE6EnSioSIz/kIy7of8FE6olVlb0oRclg07caYv/DeI\nI1TcTs1Qh9mkReksSpY7Iul5bt5oE41rjGKr1IxVy1RzCeKJyvxEsMV0nBTZ9NI=\n=hlLp\n-----END PGP MESSAGE-----\n", + "fp": "8C240C0C11293EE56260601CCF616EB19C2765E4" + } + ], + "unencrypted_suffix": "_unencrypted", + "version": "3.7.1" + } +} +\ No newline at end of file diff --git a/modules/apps/git/user.nix b/modules/apps/git/user.nix @@ -0,0 +1,28 @@ +{ + config, + options, + lib, + ... +}: let + cfg = config.credentials; + opt = options.credentials.mail.description; +in { + ## User Credentials @@ + # Warnings + assertions = [ + { + assertion = cfg.mail != ""; + message = opt + " must be set"; + } + ]; + + programs.git = { + userName = cfg.name; + userEmail = cfg.mail; + extraConfig.github.user = cfg.name; + signing = { + signByDefault = lib.mkIf (cfg.key != "") true; + key = lib.mkIf (cfg.key != "") (builtins.substring 24 30 cfg.key); + }; + }; +} diff --git a/modules/apps/office.nix b/modules/apps/office.nix @@ -0,0 +1,72 @@ +{ + config, + lib, + pkgs, + files, + ... +}: let + enable = builtins.elem "office" config.apps.list; +in { + ## Office Environment Configuration ## + config = lib.mkIf enable { + # Applications + environment.systemPackages = with pkgs; [ + # Productivity + bluej + gscan2pdf + handbrake + hunspell + hunspellDicts.en_US-large + hyphen + libreoffice + onlyoffice-bin + + # Internet + google-chrome + megasync + teams + thunderbird + whatsapp-for-linux + zoom-us + ]; + + # Dictionaries + environment = { + pathsToLink = ["/share/hunspell" "/share/myspell" "/share/hyphen"]; + variables.DICPATH = "/run/current-system/sw/share/hunspell:/run/current-system/sw/share/hyphen"; + }; + + user = { + # Persisted Files + persist.files = [".config/gscan2pdfrc" ".config/zoomus.conf"]; + persist.dirs = [ + ".bluej" + ".thunderbird" + ".zoom" + ".config/google-chrome" + ".config/libreoffice" + ".config/Microsoft" + ".config/onlyoffice" + ".local/share/data" + ".local/share/onlyoffice" + ".cache/thunderbird" + ".cache/google-chrome" + ".cache/zoom" + ]; + + home.home.file = { + # Document Templates + "Templates" = { + source = files.templates; + recursive = true; + }; + + # Font Rendering + ".local/share/fonts" = { + source = files.fonts.path; + recursive = true; + }; + }; + }; + }; +} diff --git a/modules/apps/vscode.nix b/modules/apps/vscode.nix @@ -0,0 +1,79 @@ +{ + config, + lib, + pkgs, + files, + ... +}: +with files.vscode; let + inherit (lib) mkIf util; + inherit (builtins) elem head; + enable = elem "vscode" config.apps.list; + font = head config.fonts.fontconfig.defaultFonts.monospace; +in { + ## Visual Studio Code Editor Configuration ## + config = mkIf enable { + environment.systemPackages = with pkgs; [rnix-lsp vscode]; + + user = { + persist.dirs = [".config/Code" ".vscode"]; + home = { + xdg.mimeApps.defaultApplications = util.build.mime files.xdg.mime { + text = ["code.desktop"]; + }; + + programs.vscode = { + enable = true; + package = pkgs.vscode; + + # Keyboard Shortcuts + inherit keybindings; + + # Settings + userSettings = + settings // {"editor.fontFamily" = "'${font}', 'monospace', monospace";}; + + # Useful Extensions + extensions = with pkgs; + with unstable.vscode-extensions // vscode-extensions; + [ + dotjoshjohnson.xml + eamodio.gitlens + editorconfig.editorconfig + esbenp.prettier-vscode + file-icons.file-icons + github.vscode-pull-request-github + jnoortheen.nix-ide + kamadorueda.alejandra + ms-python.python + ms-vscode.cpptools + redhat.java + redhat.vscode-yaml + yzhang.markdown-all-in-one + ] + # Custom Extensions + ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + { + name = "better-comments"; + publisher = "aaron-bond"; + version = "2.1.0"; + sha256 = "sha256-l7MG2bpfTgVgC+xLal6ygbxrrRoNONzOWjs3fZeZtU4="; + } + { + name = "org-mode"; + publisher = "vscode-org-mode"; + version = "1.0.0"; + sha256 = "1dp6mz1rb8awrrpig1j8y6nyln0186gkmrflfr8hahaqr668il53"; + } + { + name = "vscode-html-css"; + publisher = "ecmel"; + version = "1.11.0"; + sha256 = "sha256-xwzfTFSBonGcfyhE0fs1ZRHlRbPFLGgshw1NLLyFypI="; + } + ]; + }; + }; + }; + }; +} diff --git a/modules/apps/wine.nix b/modules/apps/wine.nix @@ -0,0 +1,48 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (builtins) attrValues elem map; + inherit (lib) mkIf mkOption types util; + enable = elem "wine" config.apps.list; + wine = config.apps.wine.package; +in { + options.apps.wine.package = mkOption { + description = "Package to use for 'wine'"; + type = types.package; + default = pkgs.wineWowPackages.stable; + example = pkgs.gaming.wine-tkg; + }; + + ## Wine Configuration ## + config = mkIf enable { + # Firmware + services.samba.enable = true; + hardware.opengl.driSupport32Bit = true; + + # Utilities + user.persist.dirs = [ + ".cache/lutris" + ".config/lutris" + ".config/notepad++" + ".local/share/lutris" + ".wine" + ]; + + environment.systemPackages = with pkgs.wine // pkgs; + map (name: + if (name.override.__functionArgs ? wine) + then name.override {inherit wine;} + else name) [ + lutris + playonlinux + mkwindowsapp-tools + notepad-plus-plus + ] + # Wrapped Packages + ++ attrValues (util.map.modules ../../packages/wine + (name: pkgs.callPackage name {inherit lib pkgs wine;})); + }; +} diff --git a/modules/base/console.nix b/modules/base/console.nix @@ -0,0 +1,51 @@ +{ + config, + pkgs, + files, + ... +}: let + font = builtins.head config.fonts.fontconfig.defaultFonts.monospace; +in { + ## Console Configuration ## + config = { + # Setup + console = { + font = "ter-132n"; + packages = [pkgs.terminus_font]; + useXkbConfig = true; + }; + + # TTY + services.kmscon = { + enable = true; + hwRender = true; + extraConfig = '' + font-name=${font} + font-size=14 + ''; + }; + + # Essential Utilities + environment = { + persist.dirs = [files.path.system]; + systemPackages = with pkgs; [ + cryptsetup + gparted + inxi + killall + mkpasswd + custom.nixos + ntfsprogs + parted + pciutils + rsync + sdparm + smartmontools + unrar + unzip + usbutils + wget + ]; + }; + }; +} diff --git a/modules/base/default.nix b/modules/base/default.nix @@ -0,0 +1,21 @@ +{ + lib, + pkgs, + ... +}: { + imports = lib.util.map.module ./.; + + ## Base Configuration ## + config = { + # Documentation + environment = { + enableDebugInfo = true; + systemPackages = [pkgs.man-pages]; + }; + + documentation = { + dev.enable = true; + man.enable = true; + }; + }; +} diff --git a/modules/base/firmware.nix b/modules/base/firmware.nix @@ -0,0 +1,128 @@ +{ + lib, + inputs, + pkgs, + ... +}: +with {inherit (lib) mkAfter mkForce;}; { + imports = [inputs.gaming.nixosModules.pipewireLowLatency]; + + ## Device Firmware ## + config = { + # Drivers + hardware = { + opengl.enable = true; + cpu.intel.updateMicrocode = true; + enableRedistributableFirmware = true; + pulseaudio.enable = mkForce false; + }; + + services = { + fwupd.enable = true; + logind.extraConfig = "HandleLidSwitch=ignore"; + }; + + # Touchpad + services.xserver.libinput = { + enable = true; + touchpad = { + tapping = true; + tappingDragLock = true; + middleEmulation = true; + naturalScrolling = false; + disableWhileTyping = true; + scrollMethod = "twofinger"; + accelSpeed = "0.7"; + }; + }; + + # Driver Packages + hardware.opengl.extraPackages = with pkgs; [ + intel-media-driver + libvdpau-va-gl + vaapiIntel + vaapiVdpau + ]; + + # Audio + sound = { + enable = true; + mediaKeys.enable = true; + }; + + nixpkgs.config.pulseaudio = true; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + lowLatency = { + enable = true; + quantum = 64; + rate = 48000; + }; + }; + + # Network Settings + user.groups = ["networkmanager"]; + environment.persist.dirs = [ + "/etc/NetworkManager/system-connections" + "/etc/ssh" + "/var/lib/bluetooth" + ]; + + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + + networking = { + networkmanager.enable = true; + firewall.enable = true; + }; + + ## Encryption + # GPG + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + user.persist.dirs = [ + { + directory = ".gnupg"; + mode = "0700"; + } + ]; + + # SSH + services.openssh = { + enable = true; + passwordAuthentication = true; + permitRootLogin = mkForce "no"; + hostKeys = [ + { + comment = "Host SSH Key"; + bits = 4096; + type = "ed25519"; + path = "/etc/ssh/ssh_key"; + } + ]; + }; + + # Power Management + services.thermald.enable = true; + powerManagement = { + enable = true; + cpuFreqGovernor = "powersave"; + }; + + services.earlyoom = { + enable = true; + enableNotifications = true; + freeMemThreshold = 5; + freeSwapThreshold = 15; + }; + }; +} diff --git a/modules/default.nix b/modules/default.nix @@ -0,0 +1,162 @@ +{ + version, + lib, + inputs, + files, +}: let + inherit (inputs) self generators; + inherit (lib) extend forEach getAttrFromPath makeOverridable mkForce mkIf; + inherit + (builtins) + any + attrNames + attrValues + getAttr + hashString + map + replaceStrings + substring + ; +in { + ## Configuration Build Function ## + config = { + system ? "x86_64-linux", + name ? "nixos", + description ? "", + channel ? "stable", + format ? null, + imports ? [], + timezone, + locale, + update ? "", + kernel, + kernelModules ? [], + gui ? {}, + apps ? {}, + hardware ? {}, + shell ? {}, + user ? null, + users ? null, + }: let + # Default Package Channel + input = inputs."${channel}"; + pkgs = self.channels."${system}"."${channel}"; + + # System Libraries + lib' = + extend (final: prev: with input.lib; {inherit nixosSystem trivial;}); + + # User Build Function + user' = { + name, + description, + uid ? 1000, + groups ? ["wheel"], + password ? "", + autologin ? false, + shell ? "bash", + shells ? [], + home ? {}, + minimal ? false, + recovery ? true, + }: { + user.settings."${name}" = { + inherit name description uid autologin minimal recovery; + homeConfig = home; + extraGroups = groups; + initialHashedPassword = password; + shell = pkgs."${shell}"; + shells = + if (shells == null) + then [] + else shells ++ [shell]; + }; + }; + in + # Assertions + assert (user == null) -> (users != null); + assert any (name: name == channel) (attrNames self.channels."${system}"); + ## Device Configuration ## + (makeOverridable lib'.nixosSystem) { + inherit system; + specialArgs = { + inherit system inputs files; + lib = lib'; + }; + + modules = [ + { + # Modulated Configuration Imports + imports = + imports + ++ (attrValues self.nixosModules) + ++ map user' ( + if (user != null) + then [user] + else users + ) + ++ ( + if (format != null) + then [(getAttr format generators.nixosModules)] + else [] + ) + ++ forEach hardware.modules or [] + (name: getAttrFromPath [name] inputs.hardware.nixosModules); + inherit apps gui hardware shell; + + # Device Name + networking = { + hostName = name; + hostId = substring 0 8 (hashString "md5" name); + }; + + # Localization + time.timeZone = timezone; + i18n.defaultLocale = locale; + + # Kernel Configuration + boot = { + initrd.availableKernelModules = + kernelModules + ++ ["ahci" "sd_mod" "usbhid" "usb_storage" "xhci_pci"]; + kernelPackages = + if (kernel == "linux_zfs") + then pkgs.zfs.latestCompatibleLinuxPackages + else pkgs.linuxKernel.packages."${kernel}"; + }; + + # Package Configuration + nixpkgs = {inherit pkgs;}; + nix = { + maxJobs = hardware.cores or 4; + index = mkIf (update == "") true; + nixPath = ["nixpkgs=${input}"]; + registry.nixpkgs.flake = mkForce input; + }; + + system = { + # Updates + autoUpgrade = { + enable = mkIf (update != "") true; + dates = mkIf (update != "") update; + inherit (files.path) flake; + }; + + # Version + stateVersion = version; + configurationRevision = + if (self ? rev) + then self.rev + else null; + name = "${name}-${replaceStrings [" "] ["_"] description}"; + nixos.label = + if (self ? rev) + then "${substring 0 8 self.lastModifiedDate}.${self.shortRev}" + else if (self ? dirtyRev) + then self.dirtyShortRev + else "dirty"; + }; + } + ]; + }; +} diff --git a/modules/gui/default.nix b/modules/gui/default.nix @@ -0,0 +1,23 @@ +{ + config, + options, + lib, + ... +}: let + inherit (builtins) map; + inherit (util.map) module module'; + inherit (lib) mkOption optional types util; +in { + imports = module ./.; + + options.gui.desktop = mkOption { + description = "GUI Desktop Choice"; + type = with types; + nullOr (enum ((module' ./.) ++ map (x: x + "-minimal") (module' ./.))); + default = null; + }; + + config.warnings = + optional (config.gui.desktop == null) + (options.gui.desktop.description + " is unset"); +} diff --git a/modules/gui/fonts.nix b/modules/gui/fonts.nix @@ -0,0 +1,61 @@ +{ + config, + lib, + pkgs, + files, + ... +}: { + options.gui.fonts.enable = lib.mkEnableOption "Enable Fonts Configuration"; + + ## Font Configuration ## + config = lib.mkIf config.gui.fonts.enable { + fonts = { + enableDefaultFonts = true; + fontDir.enable = true; + enableGhostscriptFonts = true; + fontconfig = { + enable = true; + localConf = files.fonts.config; + defaultFonts = { + monospace = ["MesloLGS NF"]; + sansSerif = ["Product Sans"]; + serif = ["Noto Serif"]; + emoji = ["Noto Color Emoji"]; + }; + }; + }; + + # Font Packages + fonts.fonts = with pkgs; [ + corefonts + dejavu_fonts + fira + fira-code + fira-mono + liberation_ttf + meslo-lgs-nf + noto-fonts + noto-fonts-emoji + roboto + roboto-slab + source-code-pro + ttf_bitstream_vera + ubuntu_font_family + + # Patched Nerd Fonts + (nerdfonts.override { + fonts = [ + "FiraCode" + "FiraMono" + "Hack" + "JetBrainsMono" + "RobotoMono" + "SourceCodePro" + ]; + }) + + # Custom Fonts + custom.fonts + ]; + }; +} diff --git a/modules/gui/gnome.nix b/modules/gui/gnome.nix @@ -0,0 +1,272 @@ +{ + config, + lib, + pkgs, + files, + ... +}: +with files; let + inherit (builtins) elem; + inherit (lib) mkIf mkForce mkMerge util; + inherit (config.gui) desktop; + apps = config.environment.systemPackages; +in { + ## GNOME Desktop Configuration ## + config = mkIf (desktop == "gnome" || desktop == "gnome-minimal") (mkMerge [ + { + # Session + services.xserver = { + desktopManager.gnome.enable = true; + displayManager = { + gdm.enable = true; + defaultSession = "gnome-xorg"; + }; + }; + + # Excluded Packages + environment.gnome.excludePackages = with pkgs; [ + gnome.totem + gnome.gnome-music + ]; + } + + # Full-Fledged GNOME Desktop Configuration + (mkIf (desktop == "gnome") { + # Desktop Integration + gui.fonts.enable = true; + nixpkgs.config.firefox.enableGnomeExtensions = + mkIf (elem pkgs.firefox apps) true; + + programs = { + dconf.enable = true; + xwayland.enable = true; + gnupg.agent.pinentryFlavor = + mkIf config.programs.gnupg.agent.enable "gnome3"; + }; + + services = { + dbus.packages = [pkgs.gnome.dconf]; + udev.packages = [pkgs.gnome.gnome-settings-daemon]; + touchegg.enable = true; + gnome = { + chrome-gnome-shell.enable = true; + core-developer-tools.enable = true; + experimental-features.realtime-scheduling = true; + gnome-initial-setup.enable = true; + gnome-keyring.enable = true; + gnome-remote-desktop.enable = true; + sushi.enable = true; + }; + }; + + # User Configuration + user.home = { + # Dconf Keys + imports = [gnome.dconf]; + + # GTK+ Theming + gtk = { + enable = true; + theme = { + name = "Adwaita-dark"; + package = pkgs.gnome.gnome-themes-extra; + }; + + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.papirus-icon-theme; + }; + }; + + # Default Applications + xdg.mimeApps.defaultApplications = util.build.mime files.xdg.mime { + audio = ["org.gnome.Lollypop.desktop"]; + calendar = ["org.gnome.Calendar.desktop"]; + directory = ["org.gnome.Nautilus.desktop"]; + image = ["org.gnome.eog.desktop"]; + magnet = ["transmission-gtk.desktop"]; + mail = ["org.gnome.Geary.desktop"]; + markdown = ["org.gnome.gitlab.somas.Apostrophe.desktop"]; + pdf = ["org.gnome.Evince.desktop"]; + text = ["org.gnome.gedit.desktop"]; + video = ["io.github.celluloid_player.Celluloid.desktop"]; + }; + + # Code Editor Settings + programs.vscode = mkIf (elem pkgs.vscode apps) { + userSettings = { + "workbench.colorTheme" = "GNOME dark"; + "terminal.external.linuxExec" = "gnome-terminal"; + }; + + extensions = pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + { + name = "vscode-gnome-theme"; + publisher = "rafaelmardojai"; + version = "0.3.0"; + sha256 = "sha256-CXBh175GjiGbqkm/72SLDTOZZjF62cHZUTVVFiQkcVU="; + } + ]; + }; + + home.file = { + # Initial Setup + ".config/gnome-initial-setup-done".text = "yes"; + + # Online Accounts + ".config/goa-1.0/accounts.conf".text = gnome.accounts; + + # GTK+ Bookmarks + ".config/gtk-3.0/bookmarks".text = gtk.bookmarks; + + # X11 Gestures + ".config/touchegg/touchegg.conf".text = gestures; + + # Custome GNOME Shell Theme + ".themes/Adwaita/gnome-shell/gnome-shell.css".text = gnome.shell; + + # gEdit Color Scheme + ".local/share/gtksourceview-4/styles/tango-dark.xml".text = + gnome.theme; + ".local/share/gtksourceview-4/language-specs/nix.lang".text = + gnome.syntax; + + # Discord DNOME Theme + ".config/BetterDiscord/data/stable/custom.css" = + mkIf (elem pkgs.discord apps) {text = discord.theme;}; + + # Firefox GNOME Theme + ".mozilla/firefox/default/chrome/userChrome.css".text = + mkIf (elem pkgs.firefox apps) + ''@import "${pkgs.custom.firefox-gnome-theme}/userChrome.css";''; + ".mozilla/firefox/default/chrome/userContent.css".text = + mkIf (elem pkgs.firefox apps) firefox.theme; + ".mozilla/native-messaging-hosts/org.gnome.chrome_gnome_shell.json".source = + mkIf (elem pkgs.firefox apps) + "${pkgs.chrome-gnome-shell}/lib/mozilla/native-messaging-hosts/org.gnome.chrome_gnome_shell.json"; + }; + }; + + environment.systemPackages = with pkgs.gnome; + [ + # GNOME Apps + gnome-boxes + gnome-dictionary + gnome-notes + gnome-sound-recorder + gnome-tweaks + polari + + # GNOME Games + gnome-chess + gnome-mines + quadrapassel + ] + ++ (with pkgs; [ + # GNOME Circle + apostrophe + drawing + deja-dup + fractal + fragments + giara + gimp + gnome-podcasts + gnome-passwordsafe + gthumb + kooha + lollypop + pitivi + wike + + # Utilities + celluloid + dconf2nix + gnuchess + ]) + ++ (with pkgs; + with unstable.gnomeExtensions // gnomeExtensions; [ + # GNOME Shell Extensions + add-username-to-top-panel + appindicator + avatar + burn-my-windows + caffeine + clipboard-indicator + color-picker + compiz-windows-effect + compiz-alike-magic-lamp-effect + custom-hot-corners-extended + dash-to-panel + desktop-cube + custom.fly-pie + gtile + just-perfection + lock-keys + lock-screen-message + screenshot-locations + sound-output-device-chooser + timepp + custom.top-bar-organizer + vitals + worksapce-dry-names + x11-gestures + ]); + + # Persisted Files + user.persist = { + files = [".config/org.gabmus.giara.json"]; + dirs = [ + ".config/dconf" + ".config/gnome-boxes" + ".config/gnome-builder" + ".config/GIMP" + ".config/pitivi" + ".local/share/epiphany" + ".local/share/evolution" + ".local/share/flatpak" + ".local/share/geary" + ".local/share/gnome-boxes" + ".local/share/gnome-builder" + ".local/share/lollypop" + ".local/share/nautilus" + ".local/share/polari" + ".local/share/telepathy" + ".local/share/webkitgtk" + ".cache/clipboard-indicator@tudmotu.com" + ".cache/fractal" + ".cache/gnome-builder" + ".cache/timepp_gnome_shell_extension" + ]; + }; + }) + + # Minimal GNOME Desktop Configuration + (mkIf (desktop == "gnome-minimal") { + # Disable Suspension + services.xserver.displayManager.gdm.autoSuspend = false; + + # Essential Utilities + environment.systemPackages = with pkgs.gnome; [ + epiphany + gedit + gnome-system-monitor + pkgs.kgx + nautilus + ]; + + # Additional Excluded Packages + xdg.portal.enable = mkForce false; + qt5.enable = mkForce false; + services.gnome.core-utilities.enable = mkForce false; + environment.gnome.excludePackages = with pkgs.gnome; [ + gnome-backgrounds + gnome-shell-extensions + gnome-themes-extra + pkgs.gnome-tour + pkgs.gnome-user-docs + pkgs.hicolor-icon-theme + ]; + }) + ]); +} diff --git a/modules/gui/xfce.nix b/modules/gui/xfce.nix @@ -0,0 +1,146 @@ +{ + config, + lib, + pkgs, + files, + ... +}: +with files; let + inherit (lib) mkIf mkForce mkMerge util; + inherit (config.gui) desktop; + + # GTK+ Theme + theme = { + theme = { + name = "Arc-Dark"; + package = pkgs.arc-theme; + }; + + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.papirus-icon-theme; + }; + }; +in { + ## XFCE Desktop Configuration ## + config = mkIf (desktop == "xfce" || desktop == "xfce-minimal") (mkMerge [ + { + # Session + services.xserver = { + desktopManager.xfce = { + enable = true; + enableXfwm = true; + }; + + displayManager.lightdm.greeters.gtk = { + clock-format = "%H:%M"; + indicators = [ + "~a11y" + "~language" + "~spacer" + "~clock" + "~spacer" + "~host" + "~spacer" + "~session" + "~power" + ]; + }; + }; + } + + # Full-Fledged XFCE Desktop Configuration + (mkIf (desktop == "xfce") { + # Desktop Integration + gui.fonts.enable = true; + services.bamf.enable = true; + services.xserver.displayManager.lightdm.greeters.gtk = theme; + programs.gnupg.agent.pinentryFlavor = + mkIf config.programs.gnupg.agent.enable "gtk2"; + + # User Configuration + user.home = { + # GTK+ Theming + gtk = + { + enable = true; + gtk3.extraCss = xfce.css; + } + // theme; + + # Default Applications + xdg.mimeApps.defaultApplications = util.xdg.mime (import files.xdg.mime) { + audio = ["org.xfce.Parole.desktop"]; + calendar = ["org.xfce.orage.desktop"]; + directory = ["thunar.desktop"]; + image = ["org.xfce.ristretto.desktop"]; + pdf = ["atril.desktop"]; + text = ["org.xfce.mousepad.desktop"]; + video = ["org.xfce.Parole.desktop"]; + }; + + home.file = { + # GTK+ Bookmarks + ".config/gtk-3.0/bookmarks".text = gtk.bookmarks; + + # Desktop Settings + ".config/xfce4/terminal/terminalrc".text = xfce.terminal; + ".config/xfce4/xfconf/xfce-perchannel-xml".source = xfce.settings; + + # Plank Dock + ".config/autostart/Dock.desktop".text = plank.autostart; + ".config/plank/dock1/launchers".source = plank.launchers; + ".local/share/plank/themes/default/dock.theme".text = plank.theme; + }; + }; + + # Plugins + services.xserver.desktopManager.xfce.thunarPlugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-dropbox-plugin + thunar-volman + ]; + + # Utilities + environment.systemPackages = with pkgs.xfce // pkgs; [ + plank + orage + xarchiver + mate.atril + xfce4-clipman-plugin + xfce4-eyes-plugin + xfce4-namebar-plugin + xfce4-notes-plugin + xfce4-panel-profiles + xfce4-pulseaudio-plugin + xfce4-sensors-plugin + xfce4-timer-plugin + xfce4-weather-plugin + xfce4-whiskermenu-plugin + ]; + + # Persisted Files + user.persist = { + dirs = [ + ".config/autostart" + ".config/dconf" + ".config/Mousepad" + ".config/plank" + ".config/Thunar" + ".config/xfce4" + ".cache/xfce4" + ]; + }; + }) + + # Minimal XFCE Desktop Configuration + (mkIf (desktop == "xfce-minimal") { + # Utilities + environment.systemPackages = [pkgs.firefox]; + + # Disabled Services + services.tumbler.enable = mkForce false; + services.accounts-daemon.enable = mkForce false; + }) + ]); +} diff --git a/modules/gui/xorg.nix b/modules/gui/xorg.nix @@ -0,0 +1,15 @@ +{files, ...}: { + ## XORG Configuration ## + config = { + user.home.xresources.extraConfig = files.xorg; + services.xserver = { + enable = true; + autorun = true; + layout = "us"; + + # Driver Settings + useGlamor = true; + videoDrivers = ["modesetting"]; + }; + }; +} diff --git a/modules/hardware/boot.nix b/modules/hardware/boot.nix @@ -0,0 +1,45 @@ +{ + config, + lib, + ... +}: { + options.hardware.boot = lib.mkOption { + description = "Supported Boot Firmware"; + type = lib.types.enum ["mbr" "efi"]; + default = "mbr"; + }; + + ## Boot Configuration ## + config = lib.mkIf (config.hardware.boot == "efi") { + boot = { + tmpOnTmpfs = true; + cleanTmpDir = !config.boot.tmpOnTmpfs; + + # Plymouth + consoleLogLevel = 0; + initrd.verbose = false; + plymouth.enable = true; + kernelParams = [ + "quiet" + "splash" + "boot.shell_on_fail" + "i915.fastboot=1" + "loglevel=3" + "rd.systemd.show_status=false" + "rd.udev.log_level=3" + "udev.log_priority=3" + ]; + + # Boot Loader + loader = { + timeout = lib.mkDefault 0; + efi.canTouchEfiVariables = true; + systemd-boot = { + enable = true; + editor = false; + configurationLimit = 100; + }; + }; + }; + }; +} diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix @@ -0,0 +1,24 @@ +{lib, ...}: +with {inherit (lib) mkOption types util;}; { + imports = util.map.module ./.; + + options.hardware = with types; { + cores = mkOption { + description = "Number of CPU Cores"; + type = int; + default = 4; + }; + + modules = mkOption { + description = "List of Modules imported from 'inputs.hardware'"; + type = listOf str; + default = []; + }; + + support = mkOption { + description = "List of Additional Supported Hardware"; + type = listOf (enum (util.map.module' ./.)); + default = []; + }; + }; +} diff --git a/modules/hardware/filesystem.nix b/modules/hardware/filesystem.nix @@ -0,0 +1,190 @@ +{ + config, + options, + lib, + inputs, + files, + ... +}: let + inherit (builtins) filter listToAttrs mapAttrs; + inherit (lib) hasPrefix mkAfter mkIf mkMerge mkOption nameValuePair optional types; + inherit (config.hardware) filesystem; +in { + imports = [inputs.impermanence.nixosModule]; + + options = with types; { + hardware.filesystem = mkOption { + description = "Disk File System Choice"; + type = nullOr (enum ["simple" "advanced"]); + default = null; + }; + + environment.persist = { + files = mkOption { + description = "Additional System Files to Preserve"; + type = listOf str; + default = []; + example = ["/etc/machine-id"]; + }; + + dirs = mkOption { + description = "Additional System Directories to Preserve"; + type = listOf str; + default = []; + example = ["/etc/nixos"]; + }; + }; + + user.persist = { + files = mkOption { + description = "Additional User Files to Preserve"; + type = listOf str; + default = []; + example = [".bash_history"]; + }; + + dirs = mkOption { + description = "Additional User Directories to Preserve"; + type = listOf (either str attrs); + default = []; + example = ["Downloads"]; + }; + }; + }; + + ## File System Configuration ## + config = + { + warnings = + optional (filesystem == null) + (options.hardware.filesystem.description + " is unset"); + } + // mkIf (filesystem != null) (mkMerge [ + { + ## Partitions ## + # Common Partitions + boot.supportedFilesystems = ["ntfs" "vfat"]; + fileSystems = { + # EFI System Partition + "/boot" = { + device = "/dev/disk/by-partlabel/ESP"; + fsType = "vfat"; + }; + + # DATA Partition + "/data/files" = { + device = "/dev/disk/by-partlabel/Files"; + fsType = "ntfs"; + options = ["rw" "uid=1000"]; + }; + }; + + # SWAP Partition + swapDevices = [{device = "/dev/disk/by-partlabel/swap";}]; + boot.kernel.sysctl."vm.swappiness" = 1; + } + + ## Simple File System Configuration using EXT4 ## + (mkIf (filesystem == "simple") { + fileSystems = { + # ROOT Partition + "/" = { + device = "/dev/disk/by-partlabel/System"; + fsType = "ext4"; + }; + }; + }) + + ## Advanced File System Configuration using BTRFS ## + (mkIf (filesystem == "advanced") { + fileSystems = + { + # ROOT Partition + "/" = { + device = "fspool/system/root"; + fsType = "zfs"; + }; + + # NIX Partition + "/nix" = { + device = "fspool/system/nix"; + fsType = "zfs"; + }; + + # PERSISTENT Partition + "/data" = { + device = "fspool/data"; + fsType = "zfs"; + neededForBoot = true; + }; + } + // listToAttrs (map (dir: nameValuePair dir {neededForBoot = true;}) + (filter (hasPrefix "/etc") config.environment.persist.dirs)); + + # Boot Settings + boot = { + supportedFilesystems = ["zfs"]; + kernelParams = ["elevator=none" "nohibernate"]; + zfs = { + forceImportRoot = false; + forceImportAll = false; + devNodes = "/dev/disk/by-partlabel/System"; + }; + + # Opt-In State + initrd.postDeviceCommands = mkAfter '' + zfs rollback -r fspool/system/root@blank + ''; + }; + + # Persisted Files + environment.persistence = { + "${files.persist}" = { + files = ["/etc/machine-id"] ++ config.environment.persist.files; + directories = + ["/var/log" "/var/lib/AccountsService"] + ++ config.environment.persist.dirs; + }; + + "/data" = { + hideMounts = true; + users = + mapAttrs (name: _: { + inherit (config.user.persist) files; + directories = + [ + "Desktop" + "Documents" + "Downloads" + "Music" + "Pictures" + "Projects" + "Public" + "Videos" + ".local/share/Trash" + { + directory = ".local/share/keyrings"; + mode = "0700"; + } + ] + ++ config.user.persist.dirs; + }) + config.user.settings; + }; + }; + + # Maintainence + services.zfs = { + trim.enable = true; + autoScrub.enable = true; + autoSnapshot = { + enable = true; + hourly = 12; + daily = 7; + weekly = 3; + monthly = 1; + }; + }; + }) + ]); +} diff --git a/modules/hardware/mobile.nix b/modules/hardware/mobile.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + pkgs, + ... +}: let + enable = builtins.elem "mobile" config.hardware.support; +in { + ## Device Firmware ## + config = lib.mkIf enable { + ## Android Compatibilty Configuration ## + # Android Device Bridge + user.groups = ["adbusers"]; + programs.adb.enable = true; + + ## iOS Compatibilty Configuration ## + # File Transfer + services.usbmuxd.enable = true; + environment.systemPackages = [pkgs.libimobiledevice]; + }; +} diff --git a/modules/hardware/printer.nix b/modules/hardware/printer.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + pkgs, + ... +}: let + enable = builtins.elem "printer" config.hardware.support; +in { + ## Printer Firmware ## + config = lib.mkIf enable { + # Scanning + user.groups = ["lp" "scanner"]; + hardware.sane.enable = true; + + # Printing + services.printing = { + enable = true; + drivers = with pkgs; [gutenprint cnijfilter2]; + }; + }; +} diff --git a/modules/hardware/security.nix b/modules/hardware/security.nix @@ -0,0 +1,98 @@ +{ + config, + lib, + ... +}: +with {inherit (lib) mkEnableOption mkOverride;}; { + options.hardware.security = + mkEnableOption "Enable Additional Security and Hardening Settings"; + + ## Security Settings ## + config = lib.mkIf config.hardware.security { + warnings = [ + '' + Additional Security Settings are Enabled + - These may cause Instability Issues or Sacrifice Performance + '' + ]; + + # Protocols + programs.firejail.enable = true; + security = { + protectKernelImage = true; + apparmor.enable = true; + }; + + boot = { + # Parameters + kernelParams = ["page_alloc.shuffle=1" "page_poison=1" "slub_debug=FZP"]; + + # Flags + kernel.sysctl = { + # Kernel + "kernel.ftrace_enabled" = false; + "kernel.kptr_restrict" = mkOverride 500 2; + "kernel.sysrq" = 0; + "kernel.yama.ptrace_scope" = mkOverride 500 1; + + # Network + "net.core.bpf_jit_enable" = false; + "net.core.default_qdisc" = "cake"; + "net.ipv4.conf.all.accept_redirects" = false; + "net.ipv4.conf.all.accept_source_route" = 0; + "net.ipv4.conf.all.log_martians" = true; + "net.ipv4.conf.all.rp_filter" = 1; + "net.ipv4.conf.all.secure_redirects" = false; + "net.ipv4.conf.all.send_redirects" = false; + "net.ipv4.conf.default.accept_redirects" = false; + "net.ipv4.conf.default.log_martians" = true; + "net.ipv4.conf.default.rp_filter" = 1; + "net.ipv4.conf.default.secure_redirects" = false; + "net.ipv4.conf.default.send_redirects" = false; + "net.ipv4.icmp_echo_ignore_broadcasts" = true; + "net.ipv4.icmp_ignore_bogus_error_responses" = 1; + "net.ipv4.tcp_congestion_control" = "bbr"; + "net.ipv4.tcp_fastopen" = 3; + "net.ipv4.tcp_rfc1337" = 1; + "net.ipv4.tcp_syncookies" = 1; + "net.ipv6.conf.all.accept_redirects" = false; + "net.ipv6.conf.all.accept_source_route" = 0; + "net.ipv6.conf.default.accept_redirects" = false; + }; + + # Secure Modules + kernelModules = ["tcp_bbr"]; + + # Old & Obscure Modules + blacklistedKernelModules = [ + # Network Protocols + "ax25" + "netrom" + "rose" + + # Filesystems + "adfs" + "affs" + "befs" + "bfs" + "cramfs" + "efs" + "erofs" + "exofs" + "f2fs" + "freevxfs" + "hfs" + "hpfs" + "jfs" + "minix" + "nilfs2" + "ntfs" + "omfs" + "qnx4" + "qnx6" + "sysv" + "ufs" + ]; + }; + }; +} diff --git a/modules/hardware/virtualisation.nix b/modules/hardware/virtualisation.nix @@ -0,0 +1,57 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (builtins) concatStringsSep elem; + inherit (lib) mkIf mkOption types; + enable = elem "virtualisation" config.hardware.support; +in { + options.hardware.passthrough = mkOption { + description = "PCI Device IDs for VM Passthrough"; + type = types.listOf types.str; + default = []; + example = ["00:02.0" "00:1c.0"]; + }; + + ## Virtualisation Settings ## + config = mkIf enable { + # Enablement + user.groups = ["kvm" "libvirtd"]; + user.persist.dirs = [".config/libvirt" ".local/share/libvirt"]; + environment.persist.dirs = ["/var/lib/libvirt"]; + security.virtualisation.flushL1DataCache = "cond"; + boot = { + kernelParams = ["intel_iommu=on" "i915.enable_gvt=1"]; + kernelModules = ["kvm-intel" "vfio" "vfio-pci" "vfio_virqfd" "vfio_iommu_type1"]; + extraModprobeConfig = '' + options kvm_intel nested=1 + options vfio-pci ids=${concatStringsSep "," config.hardware.passthrough} + ''; + }; + + # VM Packages + environment.systemPackages = with pkgs; [libguestfs virt-manager]; + + # VM Utilities + virtualisation = { + kvmgt.enable = true; + spiceUSBRedirection.enable = true; + libvirtd = { + enable = true; + onBoot = "ignore"; + onShutdown = "shutdown"; + qemu = { + package = pkgs.qemu_kvm; + runAsRoot = false; + swtpm.enable = true; + ovmf = { + enable = true; + package = pkgs.OVMFFull; + }; + }; + }; + }; + }; +} diff --git a/modules/nix/checks.nix b/modules/nix/checks.nix @@ -0,0 +1,52 @@ +{ + self, + system, + lib, + pkgs, +}: +with {inherit (lib) deploy filters hooks util;}; +# Install Media Checks + (util.pack.device self.installMedia "nixos-rebuild") + // (deploy."${system}".deployChecks self.deploy) + // { + # Pre-Commit Hooks + commit = hooks."${system}".run { + src = filters.gitignoreSource ../../.; + hooks = { + alejandra.enable = true; + prettier.enable = true; + nixfmt.enable = false; + nix-linter.enable = false; + shellcheck.enable = true; + statix.enable = true; + stylua = { + enable = true; + types = ["file" "lua"]; + entry = "${pkgs.stylua}/bin/stylua"; + }; + }; + + settings = { + statix.ignore = ["flake.nix" "_*"]; + nix-linter.checks = [ + "BetaReduction" + "DIYInherit" + "EmptyInherit" + "EmptyLet" + "EmptyVariadicParamSet" + "EtaReduce" + "FreeLetInFunc" + "LetInInheritRecset" + "ListLiteralConcat" + "NegateAtom" + "SequentialLet" + "SetLiteralUpdate" + "UnfortunateArgName" + "UnneededRec" + "UnusedArg" + "UnusedLetBind" + "UpdateEmptySet" + ]; + }; + }; + } diff --git a/modules/nix/config.nix b/modules/nix/config.nix @@ -0,0 +1,5 @@ +{ + allowAliases = true; + allowBroken = false; + allowUnfree = true; +} diff --git a/modules/nix/default.nix b/modules/nix/default.nix @@ -0,0 +1,48 @@ +{ + inputs, + pkgs, + ... +}: { + imports = [./index.nix inputs.utils.nixosModules.autoGenFromInputs]; + + ## Nix Settings ## + config = { + # Utilities + user.persist.dirs = [".cache/nix" ".cache/manix"]; + environment.systemPackages = with pkgs; [cachix manix]; + + # Settings + nix = { + # Version + package = pkgs.nixFlakes; + + # Garbage Collection + autoOptimiseStore = true; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + + # User Permissions + allowedUsers = ["root" "@wheel"]; + trustedUsers = ["root" "@wheel"]; + + # Registry + linkInputs = true; + generateNixPathFromInputs = true; + generateRegistryFromInputs = true; + + # Additional Features + useSandbox = true; + systemFeatures = ["kvm" "recursive-nix"]; + extraOptions = '' + accept-flake-config = true + warn-dirty = false + experimental-features = nix-command flakes recursive-nix + min-free = ${toString (1024 * 1024 * 1024)} + max-free = ${toString (10 * 1024 * 1024 * 1024)} + ''; + }; + }; +} diff --git a/modules/nix/deploy.nix b/modules/nix/deploy.nix @@ -0,0 +1,18 @@ +{ + self, + lib, +}: +with {inherit (builtins) mapAttrs;}; { + autoRollback = true; + magicRollback = false; + user = "root"; + sshUser = "recovery"; + nodes = + mapAttrs (hostname: config: { + inherit hostname; + profiles.system.path = + lib.deploy."${config.pkgs.system}".activate.nixos + self.nixosConfigurations."${hostname}"; + }) + self.nixosConfigurations; +} diff --git a/modules/nix/index.nix b/modules/nix/index.nix @@ -0,0 +1,39 @@ +{ + config, + system, + lib, + pkgs, + ... +}: { + options.nix.index = lib.mkEnableOption "Enable Package Indexer"; + + ## Package Indexer ## + config = lib.mkIf config.nix.index { + user = { + persist.dirs = [".cache/nix-index"]; + home = { + programs.nix-index.enable = true; + systemd.user = { + timers.nix-index = { + Unit.Description = "Nix Index Update Timer"; + Unit.RefuseManualStart = "no"; + Timer.OnCalendar = "weekly"; + Timer.Persistent = true; + Timer.Unit = "nix-index.service"; + Install.WantedBy = ["timers.target"]; + }; + + services.nix-index = { + Unit.Description = "Nix Index Updater"; + Unit.After = ["network.target"]; + Install.WantedBy = ["default.target"]; + Service.TimeoutSec = 0; + Service.ExecStart = '' + /bin/sh -c "if [ -s ~/.cache/nix-index ]; then ${pkgs.coreutils}/bin/mkdir -p ~/.cache/nix-index; fi && ${pkgs.wget}/bin/wget -q -N https://github.com/Mic92/nix-index-database/releases/latest/download/index-${system} -P ~/.cache/nix-index && ${pkgs.coreutils}/bin/ln -f ~/.cache/nix-index/index-${system} ~/.cache/nix-index/files" + ''; + }; + }; + }; + }; + }; +} diff --git a/modules/secrets.nix b/modules/secrets.nix @@ -0,0 +1 @@ +(import ../secrets) diff --git a/modules/shell/bash.nix b/modules/shell/bash.nix @@ -0,0 +1,75 @@ +{ + config, + lib, + pkgs, + files, + ... +}: +with files; let + inherit (builtins) any attrValues elem mapAttrs; + inherit (config.user) settings; + enable = any (value: elem "bash" value.shells) (attrValues settings); +in { + ## Bourne Shell Configuration ## + config = lib.mkIf enable { + # Shell Environment + environment.shells = [pkgs.bashInteractive]; + user.persist = { + files = [".bash_history"]; + dirs = [".local/share/bash"]; + }; + + # Settings + home-manager.users = mapAttrs (_: value: + lib.mkIf (elem "bash" value.shells) { + programs.bash = { + enable = true; + enableVteIntegration = true; + + # Options + shellOptions = [ + "autocd" + "cdspell" + "checkjobs" + "cmdhist" + "histappend" + "checkwinsize" + "extglob" + "globstar" + "no_empty_cmd_completion" + ]; + + # Initialization + initExtra = + '' + source <(${pkgs.cod}/bin/cod init $$ bash) + eval $(${pkgs.thefuck}/bin/thefuck --alias "fix") + '' + # Prompt + + '' + function _update_ps1() { + local old_exit_status=$? + eval $(${pkgs.powerline-go}/bin/powerline-go -error $old_exit_status -shell bash -eval -modules "host,cwd,exit,jobs,git" -newline) + return $old_exit_status + } + + if [ "$TERM" != "linux" ]; then + PROMPT_COMMAND="_update_ps1;$PROMPT_COMMAND" + fi + ''; + + # Command History + historySize = 100000; + historyIgnore = ["rm" "pkill"]; + historyControl = ["erasedups" "ignoredups" "ignorespace"]; + }; + + # Command Not Found Integration + programs.nix-index.enableBashIntegration = true; + + # DirENV Integration + programs.direnv.enableBashIntegration = true; + }) + settings; + }; +} diff --git a/modules/shell/default.nix b/modules/shell/default.nix @@ -0,0 +1,104 @@ +{ + config, + lib, + pkgs, + files, + ... +}: +with files; +with {inherit (lib) mkEnableOption mkIf mkMerge util;}; { + imports = util.map.module ./.; + + options.shell.utilities = mkEnableOption "Enable Additional Shell Utilities"; + + ## Shell Configuration ## + config = mkMerge [ + { + # Environment Settings + environment = { + systemPackages = [pkgs.nano]; + + # Default Editor + variables.EDITOR = "nano"; + etc.nanorc.text = files.nano; + }; + } + + (mkIf config.shell.utilities { + # Utilities + environment.systemPackages = with pkgs; [ + bat + etcher + exa + fd + file + lolcat + neofetch + nixos-option + shellcheck + stylua + tree + ]; + + ## Program Configuration + # Faster 'nix-shell' + services.lorri.enable = true; + programs = { + # Command Not Found Search + command-not-found.enable = true; + + # Command Correction Helper + thefuck = { + enable = true; + alias = "fix"; + }; + }; + + user = { + persist.dirs = [".local/share/direnv"]; + home = { + programs = { + # DirENV Support + direnv = { + enable = true; + nix-direnv = { + enable = true; + enableFlakes = true; + }; + }; + + # Bat Configuration + bat = { + enable = true; + config = { + style = "full"; + italic-text = "always"; + theme = "Monokai Extended Bright"; + map-syntax = [".ignore:Git Ignore"]; + }; + }; + }; + + # Neofetch + home.file.".config/neofetch/config.conf".text = fetch; + + # Command Aliases + home.shellAliases = { + hi = "echo 'Hi there. How are you?'"; + bye = "exit"; + dotfiles = "cd ${path.system}"; + + # Programs + cat = "bat"; + colors = "${scripts.colors}"; + edit = "sudo $EDITOR"; + l = "ls --color --group-directories-first"; + ls = "exa -b -h -l -F --octal-permissions --icons --time-style iso"; + sike = "neofetch"; + nixos-option = "nixos-option -I nixpkgs=${path.system}/lib/compat"; + }; + }; + }; + }) + ]; +} diff --git a/modules/shell/zsh.nix b/modules/shell/zsh.nix @@ -0,0 +1,108 @@ +{ + config, + lib, + pkgs, + files, + ... +}: +with files; let + inherit (builtins) any attrValues elem mapAttrs; + inherit (config.user) settings; + enable = any (value: elem "zsh" value.shells) (attrValues settings); +in { + ## Z Shell Configuration ## + config = lib.mkIf enable { + # Shell Environment + user.persist = { + files = [".zsh_history"]; + dirs = [".cache/zsh"]; + }; + + environment = { + shells = [pkgs.zsh]; + pathsToLink = ["/share/zsh"]; + }; + + # Settings + home-manager.users = mapAttrs (_: value: + lib.mkIf (elem "zsh" value.shells) { + programs.zsh = { + enable = true; + + # Features + autocd = true; + enableAutosuggestions = true; + enableCompletion = true; + enableVteIntegration = true; + + # Initialization + initExtraBeforeCompInit = '' + source ~/.p10k.zsh + eval $(${pkgs.thefuck}/bin/thefuck --alias "fix") + ''; + + initExtra = + '' + source <(${pkgs.cod}/bin/cod init $$ zsh) + '' + # Keybindings + + '' + bindkey '^[[1;5C' forward-word + bindkey '^[[1;5D' backward-word + bindkey '^[[3;5~' kill-word + bindkey '^[[3~' delete-char + bindkey "^[[5~" beginning-of-history + bindkey "^[[6~" end-of-history + bindkey '^[[A' up-line-or-search + bindkey '^[[B' down-line-or-search + bindkey '^[[C' forward-char + bindkey '^[[D' backward-char + bindkey '^[[F' end-of-line + bindkey '^H' backward-kill-word + bindkey '^[[H' beginning-of-line + bindkey '^J' backward-kill-line + ''; + + # Command History + history = { + extended = true; + ignoreDups = true; + expireDuplicatesFirst = true; + ignorePatterns = ["rm *" "pkill *"]; + }; + + # Additional Plugins + plugins = [ + { + name = "powerlevel10k"; + src = pkgs.zsh-powerlevel10k; + file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; + } + { + name = "zsh-autopair"; + src = pkgs.zsh-autopair; + file = "share/zsh/zsh-autopair/autopair.zsh"; + } + { + name = "zsh-syntax-highlighting"; + src = pkgs.zsh-syntax-highlighting; + file = "share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"; + } + ]; + }; + + # Utilities + home.packages = with pkgs; [fzf fzf-zsh]; + + # Prompt + home.file.".p10k.zsh".text = zsh.prompt; + + # Command Not Found Integration + programs.nix-index.enableZshIntegration = true; + + # DirENV Integration + programs.direnv.enableZshIntegration = true; + }) + settings; + }; +} diff --git a/modules/user/default.nix b/modules/user/default.nix @@ -0,0 +1,154 @@ +{ + config, + lib, + inputs, + files, + ... +}: let + inherit (builtins) all attrNames attrValues mapAttrs pathExists; + inherit + (lib) + filterAttrs + findFirst + findSingle + mkIf + mkEnableOption + mkOption + types + util + ; + + inherit (config.user) groups home settings; +in { + imports = util.map.module ./. ++ [inputs.home.nixosModules.home-manager]; + + options = { + # Global Home Manager Configuration + home-manager.users = mkOption { + type = types.attrsOf (types.submoduleWith { + modules = + if (all (value: value.minimal) (attrValues settings)) + then [] + else home; + }); + }; + + # Configuration Options + user = { + home = mkOption { + description = "User Home Configuration"; + type = util.types.mergedAttrs; + default = {}; + }; + + groups = mkOption { + description = "Additional User Groups"; + type = types.listOf types.str; + default = []; + }; + + settings = mkOption { + description = "User Settings"; + default = {}; + type = with types; + attrsOf (submodule ({ + options, + config, + ... + }: { + freeformType = attrsOf anything; + options = { + forwarded = mkOption {}; + autologin = mkEnableOption "Enable Automatic User Login"; + minimal = mkEnableOption "Enable Minimal User Configuration"; + extraGroups = mkOption { + apply = group: + if config.isNormalUser + then groups ++ group + else group; + }; + shells = mkOption { + description = "List of Additional Supported Shells"; + type = listOf (enum (util.map.module' ../shell)); + default = ["bash"]; + }; + recovery = mkOption { + description = "Enable User Recovery Settings"; + type = bool; + default = false; + }; + homeConfig = mkOption { + description = "User Specific Home Configuration"; + type = util.types.mergedAttrs; + default = {}; + }; + }; + + config = { + isNormalUser = true; + group = "users"; + useDefaultShell = false; + homeConfig = let + path = ../../. + "/users/${config.name}"; + in + if (pathExists (path + "/default.nix")) + then { + imports = [path]; + } + else if (pathExists (path + ".nix")) + then { + imports = [(path + ".nix")]; + } + else {}; + + forwarded = + filterAttrs + (name: _: !(options ? "${name}") || name == "extraGroups") + config; + }; + })); + }; + }; + }; + + ## User Configuration ## + config = { + # Settings + users = { + mutableUsers = false; + users = mapAttrs (_: name: name.forwarded) settings; + extraUsers.root = { + isNormalUser = false; + extraGroups = ["wheel"]; + }; + }; + + # Login + services.xserver.displayManager.autoLogin = let + find = + findSingle (value: value.autologin || value.minimal) "0" "1" + (attrValues settings); + in { + enable = + if (find == "0") + then false + else if (find == "1") + then throw "Only one User can be Automatically Logged-In" + else true; + + user = + mkIf config.services.xserver.displayManager.autoLogin.enable + (findFirst (name: with settings."${name}"; autologin || minimal) "nixos" + (attrNames settings)); + }; + + # Home Management + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "bak"; + extraSpecialArgs = {inherit lib inputs files;}; + users = mapAttrs (_: value: {imports = value.homeConfig;}) settings; + }; + }; +} diff --git a/modules/user/home.nix b/modules/user/home.nix @@ -0,0 +1,25 @@ +{config, ...}: { + ## User Home Configuration ## + config = { + # Environment Settings + environment.sessionVariables = { + XDG_CACHE_HOME = "$HOME/.cache"; + XDG_CONFIG_HOME = "$HOME/.config"; + XDG_DATA_HOME = "$HOME/.local/share"; + XDG_BIN_HOME = "$HOME/.local/bin"; + }; + + user.home = { + imports = [../../users]; + systemd.user.startServices = true; + + # Package Configuration + home.stateVersion = config.system.stateVersion; + home.file = { + ".config/nixpkgs/config.nix".source = ../nix/config.nix; + ".config/nix/nix.conf".source = + config.environment.etc."nix/nix.conf".source; + }; + }; + }; +} diff --git a/modules/user/passwords/.git-keep b/modules/user/passwords/.git-keep diff --git a/modules/user/passwords/default b/modules/user/passwords/default @@ -0,0 +1 @@ +$6$oDyuxGchrVIc19OC$eXjScbMdvd3Z77huNEUzTmXHvtDrjXK6/VnFNIxfiGUZAtJ1tLF05H6bp6J6CaV4.BkkiN72CIWLfvgg0AwdF. +\ No newline at end of file diff --git a/modules/user/passwords/navya.secret b/modules/user/passwords/navya.secret @@ -0,0 +1,26 @@ +{ + "data": "ENC[AES256_GCM,data:OmcjMFFsfKqeXvmBXmwjPfPS4X+fRSf5MUf9IwfmC/DooftXV3uTU1Il3IUqmMPBxgIZNfga9iuYqtJ3Nk9BhWxNC60HP+PA19wP3pZyDRFg58XU9IbUVKCCM1IJks5ckGPJDYP3Zw==,iv:v/wBP9xOtevJ+QVDJI7dFc2VEYOBWjgu8mabghfOzY4=,tag:KETPSVljvGKk9WHVQyW8LQ==,type:str]", + "sops": { + "kms": null, + "gcp_kms": null, + "azure_kv": null, + "hc_vault": null, + "age": null, + "lastmodified": "2021-12-01T05:54:57Z", + "mac": "ENC[AES256_GCM,data:K7zXuNK5wPVa9ieLCvMtA0uYjUNG8IGyxkXwGgZKgM1q6xLKAbtGaj0fa7/SF6wdHuuZy/7IdV0pVf30uwSzN5jplXarfJIpuVWKJ/SYC8tZh2bm66h34WuCJo9+M9B76Xjgpjzu8OZxbo4+MTvhRdem3KMxPXJgRX/F5G6uclg=,iv:+bPNFP58FrlUt9WlLqdp/84f0djHS4+czQLXSWU4YA0=,tag:dXRBsCzSDQpTqVLC2NcVbw==,type:str]", + "pgp": [ + { + "created_at": "2022-02-05T06:45:44Z", + "enc": "-----BEGIN PGP MESSAGE-----\n\nhQIMA5HNgftiFxX/AQ//eZipdqImGl1nZEkqgS0+4htARy7k9BbxH3Oit0pyhEPE\nvwQ4jM7Q5ZkjJYgawEhRmwaU8lvBAg6PLc3UeVag/3lHI7Ra7zb/TzI61Q1t2Oe1\nSo8PRyeI3TqkVopHR1BGmuwHRNhl5V3g42GO5Irc6iFeIGybhV5/tLiiUFcm9uUv\nyFwoUfW0S75UzpAXIKNukzg2egtj6tgYfSXN/aJybUxlwb/rgXgRT46fKYqLorav\nR4Z4ItAkk56dShxSUpOssoP2r5IKJFU2fcSLBL2RNxu2rReIg+WHAoiahX0TzQ5f\nI+yJWtRU6NbC2Q4Kp0BhZu4QYb/EE+0AB3Q7FYKVqFpclUlFDaMIvhp0Hhv4qypn\nwCx3QgDWwHxhTwZT+MvWPaq7RQjhChJ2d3bXW5g0in9C6N3ezTqWaNNGO7WscqQl\nr7i6zcgLH19U3BYEEe2uvrl/dwMSND+zh3wxhy4T4FMvPI/9Q99pOpNIchQpK1Jr\nWuPquMKaCR+Egy53SYX8s+LIdGFKiefZrjrA9C4dG+v+aOfgYVNxaSBhW2qlObbc\nwL4tCNVShNZBscR5SGCRDFWppFUUUfElzJVLnflwIZz/mwxjkLMzkJk/kHGjocCn\nWBENAEfv4+rjTU8AgwixeZzqfJqIwE+hYSwWFnmatRP3sX+ayUrWHuH+6olyJyTS\nXAFRhv8/ibQoS6GTsOIibvl9IbIkO4EP8ZekZbGg5kc9U3wqNV5nV4aEtnmHJ69t\n18bM31onOyulf9aNndQtyoW0vhY3tcxtAQl/WS0UPKV/DsR+8wVHP1QdjJ+T\n=YOl4\n-----END PGP MESSAGE-----\n", + "fp": "8C240C0C11293EE56260601CCF616EB19C2765E4" + }, + { + "created_at": "2022-02-05T06:45:44Z", + "enc": "-----BEGIN PGP MESSAGE-----\n\nhQIMA6M7Q/u2jO+RAQ/+JaYt5n9hAG251efnPZP5H27EbRE4+RD8NZes/VubnTJx\n8BSa+/b2+rosq+t0wOMdgRGoktEKAnLfxfsUwzY3pWc8o2S3Y30xZ9aTwJM1KDWW\nGNj5ZR97OsPGPJ1EFfb+pePrphQWnJPq9LGtdhmogARPZUuKEYHDs7ylsy67P9TP\nikHNUvM0TJk8DyVzgutqq3DkchGXzo7Q3cs9p5Lo2TIeWayYykr7IqyOvi1Pwc3+\nBz4uD9HPrNgXJAxczCSDYcYwIXn/y25FqLLz+uYLurEjbzC39SdRIn0Re0oi9r7Q\nopO4prJewpGBkVPc416vVuthinnkwSdBa5UVksdGWMifeLvQV5NyxFffeHO522S1\nSKSB1UtzmAqKswtNMvW45RbwyDS3cSw8wRuW+b95HQdnJrhPnD5CVZ0JEE6kEk+Y\n6Pk+L5lS2+ELsqv3nNa/7XF3PEeB38S2c4glDm5vDoHi1xFqZi+LRjBsDKO76UR9\n+amU1lM9ba/QbGAMFv96pmCKID+P6pEOMpRrV3iB96eNUjqZU5sAiKnI2B1cEjGf\nWnsKKK10MdILLOmNLYu4Mgkor24UGeI7TWZw5LG8bJPYmX3xLY5x8Bar4teFsXJY\nanIttcx93IJBOHZG/EqjalaGi1dlepXbHjtIo+lgSvNnn+W5sHgzMxG6owsXhSrS\nXAFsR/LVniFSgi8l6SUwlOIRNtEakpS1mH3jHpHCv9oX+Vdlv4wZ3WY7SzhzxUJ4\nHxIeRUyxci8H67j454+nHTCtS1j5tYbVlw5PQWNk+s1wwuWWHxBoU1whtFlC\n=AozJ\n-----END PGP MESSAGE-----\n", + "fp": "B141E0D9F711DD86DEAE1269D9B023AB01B68EFE" + } + ], + "unencrypted_suffix": "_unencrypted", + "version": "3.7.1" + } +} +\ No newline at end of file diff --git a/modules/user/passwords/root.secret b/modules/user/passwords/root.secret @@ -0,0 +1,26 @@ +{ + "data": "ENC[AES256_GCM,data:iUFClErAIZuCwSjx+118VYvC/2XQBaDdWVYr1GDOiCidaEC99lemA8lEBEjyFyR85CJjOqlrBiRlhRqfsAwQcj1X/1zeMXNXhQHXkU1A68uE/pl655W/VaW4XZxoZbUrU6T4JLbWHFo9,iv:BfLArVtqerDJL8PIGltAjyfcADcRMqJF/YOw7hcew10=,tag:lQI1BjbEQWaxulLwUuMYJQ==,type:str]", + "sops": { + "kms": null, + "gcp_kms": null, + "azure_kv": null, + "hc_vault": null, + "age": null, + "lastmodified": "2021-12-01T05:54:53Z", + "mac": "ENC[AES256_GCM,data:hz1SPH8axns4iB2NMimL4E2dYUI/ZSEiroSG4ySCeB+hSCrrQ9C0bsdRwUt/wOK8H1E3p0CWudyGWiwO5VS8FEXItzfvYIejWw0GNKiiJNAPNqQlJM3tWicfIo/AsAEt9ahXaxFHS2RUWYTLxP33iTx4wfVGRsHW/Pw5hbgXtoI=,iv:hZ9UPu8qQshucd9UJBYf4CmiIQkYf2DqHjKRBZBa4Ek=,tag:R3S+vC/pa7POtJCBVjgOCA==,type:str]", + "pgp": [ + { + "created_at": "2022-02-05T06:50:35Z", + "enc": "-----BEGIN PGP MESSAGE-----\n\nhQIMA5HNgftiFxX/ARAAqKLtrRQlQ4mrG7NEQ15813Ojr76tiNk5icMC6ydhea67\nwqS8hs9CLimmj3+8PjTmuAS2I3xLOJVEl4WV9jBwfm3oCLUVUDt745zES/li7XIw\nwj/fiGnege8fKgg/XF/fvhTRi39NemaDixavI5JoWf55skeDFyChDW+f+8wViHN0\nATBghiFtgyqNMIHpgJ7n6cIb5lt0gudlOVbpIXRmurJ5CL2g8Gr5MsS5sPoxbiCy\nlueR21NdtY2NflH+DU9dhlTZRBr8UtMgSmqC93RYb1hz2YDyUICpnZbrv9u3C9Q7\nsXtm7RDaIMyWBjEF3hE1icGQz9pt/elIxLWBttiK+PivqrVQIB1xvxDQpA37al2M\nqWE655WqLWGLbVnxpcjUtxp0OknKPZ+tD+V5vqWCMDc2/Fm3KI98+b9rtWBCr9HZ\nyL5UJ+fcv17+PDu4O7XYb24Q7tpTiJIg0QvkDvRdZn/GIwMzl0rIWgBQIJt0dw0T\nilSOgitzzdUQKT/0+j15X6XG9JIs8gK29SVFSpfTwizrbH5WgznHyrKeY5fLTRUg\nFkYrV43K1jwnvmHrjbHz42CPGwqGePGKUzuX4gGsnFXeJkjANybPyOshVWx4SLFQ\n4LafTxOg51unKkovxFuMEOPC2tb35fNT4Xpc8yKqMaBM6nPRv9c13lHjTCtzDzHS\nXgFtSAC+TsuumPmST4yWWBGRpLfRxwEql9vUI6Hq/fAU+NEvlRzwTGHHOmiCHJzA\nANvljPxx19PFg3Dxj5mKqfDouJtUzZsDrV9ZB3hXNF/dxQ9nPoxKcZE5MMA7Fns=\n=QjrJ\n-----END PGP MESSAGE-----\n", + "fp": "8C240C0C11293EE56260601CCF616EB19C2765E4" + }, + { + "created_at": "2022-02-05T06:50:35Z", + "enc": "-----BEGIN PGP MESSAGE-----\n\nhQIMA6M7Q/u2jO+RAQ/9Gt4Oqd7k8SjrPTZ3oouzUqaYzV3MIG2bbw+W59JV0Ex3\nVBch+cfjKoVTwXLAhwR6abIWkOWq0bJOXVZojkM7sXPlZkst7+rxpmkfTEaKv6wM\nK3M3WlBGtJsrX7IBnvV9PCXQqjx/vKpecBS+bzTd4MNWU3VJQeJ6XZY2k9IIFAGy\n6AiMSohz/v28rV4MBtaxYv9+DNFyxyEM8PA7izdX5lLqoHO88ahgQXk2SyRNB9gw\nkQk+XvLacCOO1hpuM+vQVj29UEbwx6Uxb0rjtXz9vMGjjEm22kzjsevebdhX7hSO\nK71CGptzR6W3FMsuSGCNbfWysK7kM59BZm0+4qaJsP+ZEaxZgQnOZAXn31BCHpoF\nXKp66lwurSqONrY4HbHb/3kBBqATbCExa1haz5GX/gYAWHFKkJbMFdkWmpKEFuRm\nAByherchOgku160XVLa1EMZbM3E5V3dXArglYlWE2/k+9wA8D9e6xwk9QN22Qylj\nDyaMzejxh7bEo8RcQD468yc1R36gzdqxG9H+BDqznB6WrogM/EmD0v593gmVQP3z\n4B6IsevXKk2V4vzUxnQEvlOS5HcCX9lLH+Nevu8OktT6Zi6SXxTrFuGAtmCoQKu9\nD4SBPHzoNIGRECM05RQZuQnIrXw8JnPN6kLopxca+iqB5TMVDFROML3poI/jJvjS\nXgGv/9PfbTKZscx3RU6JrdWpIQgHMcIh7U9M1TjLs9FMm7a/yzJVkERiUj4ZE0SF\nAqz7yB3Rb3TXDARPW8SL7lppkWkw19NpjcFYHQK56KkEho/yIoYBJD3jemMiU2I=\n=6Xvj\n-----END PGP MESSAGE-----\n", + "fp": "B141E0D9F711DD86DEAE1269D9B023AB01B68EFE" + } + ], + "unencrypted_suffix": "_unencrypted", + "version": "3.7.1" + } +} +\ No newline at end of file diff --git a/modules/user/passwords/v7.secret b/modules/user/passwords/v7.secret @@ -0,0 +1,26 @@ +{ + "data": "ENC[AES256_GCM,data:4bk8A+snsapESi0eT5jm0DTer3qgvrXDsPLVWCwYeWGcVYK+xOQP+FY/2MpYE5mJV1dp7O+22wL/0K9YZhoq1AoJOdP/EkzlisLEYeGBYv+EH3PfA/LtOzNyneOTS6/crdCy2YsSOiY=,iv:3zVT2S3AWDrpZ5CTUvCUOxwOqLU1LSxl7sewjxYwuN8=,tag:BwDg/d/s9WmuSiUPuh59qQ==,type:str]", + "sops": { + "kms": null, + "gcp_kms": null, + "azure_kv": null, + "hc_vault": null, + "age": null, + "lastmodified": "2021-12-01T08:29:33Z", + "mac": "ENC[AES256_GCM,data:lDx2MGYBXuu9gHiYjnTdyDD05a92SnTHAF/Lpx60Lqun7pGWujgBH0iG2edd8OLP0OYbGvSt1UB6JF6ZdmOor0s8U84rpbttBtnOKLD/OvzybbaO3CgIVAshTe3r3uiNxvPTpIwsXXhM95vHCIyzLPW36L6spqTVve1xlnCKQvo=,iv:lrQkExQ9PQGhbmvsYE2B0pp7yxH3WPWbdRfZX2BeWu8=,tag:huWkQelO9r+WPnRYXNiySw==,type:str]", + "pgp": [ + { + "created_at": "2022-02-05T06:50:31Z", + "enc": "-----BEGIN PGP MESSAGE-----\n\nhQIMA5HNgftiFxX/AQ//bQ8ryty3ZCZ3LrgZwRnSJH57rnjeedsF6f8hJViF2nI+\n3Fz4N14zaoPNpO2jynvYSdWmTgOnLto81+hYXdkxc3w2DiTMsjcz1APuPNGXMimy\nUxMaOaOkq6r8V8p2lAeUwzb6FuLK0IH3Q3EvIR2FUOVofpuoBpeNbGu31qLQDy5O\ngjSIQKzGav2aMrpHKrUp9nAWNZM0Z7StS3WKlOyWNAGgqLP9So1kOWdV9lG/MBvf\nfVauCT+Tdr3SPEqO3B93yhVSrDyFMcqj9D3/R3TV7E783ohYjHWV1lRJBsV6/icV\nzvxDiMPQoWBBx8mW9lqejoJEkfgJEs3iUqssHptmISLTuOnzE+MiGjd4ESabiRUB\nPQV4NZqM5cudK9o0OY9eT+qkZOt8hMV7h+cjteN4dYwAOpMxm5OmE7gHHWbcyxq1\noPq8WjSyjlqyh6Ry/jd7s9vNxnAdHklqp83dyPcRE2suYKuYxw3E99+fJd9v0nNw\no9PYSXul0Tk15dLEhbMB4KjDhMTP7sZYc4zdZdubBDmK6wnfeQRq5qA8WxtEY6Zh\njw/wP4raB01Aol0Pzti0TIyQQ6II3cy5o7GLQz+jEg5Lt3ZvH9XKLP56f6+HCOId\n04oRUol17VarjtL7jwZYmMAWNpzMl4fnTs/kARHlt2NhbFpuIwp1MoJLcSinvzDS\nXgH11FiYEA+69CxnsDQrnz3RvWUTjuIw5tgt3QlfhZIaxzidz1Dziu6d5g5TXevg\nxDJGoFwAdSIEM1VJjyjGPzVe193FccC4VkRbHNFDdtME71r3yieitf1GvPjr0sY=\n=4AIj\n-----END PGP MESSAGE-----\n", + "fp": "8C240C0C11293EE56260601CCF616EB19C2765E4" + }, + { + "created_at": "2022-02-05T06:50:31Z", + "enc": "-----BEGIN PGP MESSAGE-----\n\nhQIMA6M7Q/u2jO+RARAAkrQgr5PicWDAwVwMw+CwbZfb2Xj/FcCDYGT0Gat+9rtw\nFIRs3g/hdzpty4RQ6df91KSKyNmYrxjaMHQi9AiackbczDilNKKRiQp/25HwBQln\nmcBcMhx8VQ2p+L9Pk0oD1p9E99ZP1iq3vDO3EoTeRkqEPEqKwqMvH2+xUOC3Ep8U\nPKT8qOLVGQQCHiEbe60M+J0aRc/K7H86EpJF3bf3t6Z4D/6fHGgnkH9lUWIC2qtI\n9CwABnv/W/Bszwem1wi9NJUUXIFRVhJ9nZ9F8LDaESukaUu9Sfb5p+PfssW8TD+6\npM6HrNjYEx5MVrLAoinr599r1z7822BbMmG1/3InDL94cR/UJ6GGBz4ylGtEygN6\nUQKbzCiTZKpXVOX3brNxrFw1X+H7I+SlJB5e7hN4FO6qm9LcvqhQUtoKBcYVKwY/\ntT+cIb+xm7qZ1ii5aMXAD8/WVhMFgLk20FC7jPEBiCMxq7wzli3LNxeY8Th6TiKi\nhCfyY/xWLNEZTETgoPEwnckhQZqOzvRTvdZ2Bw2MMXhRICSDpRmD2WwUdm5PziI4\nFRSMK4xIb4JSD3vMvfiWW861yT0oVwRfYnfK6RezaXY01uU/UhNI6uSkU80Fds9A\ny2UbK3DeD7DYg65CjPlP+1NozvkH7DsxDNsQg13YGamG8UcPitF7/794INZRNSXS\nXgFi043N3C2g8M8kCEzfZl9xagScToJtHULIO1bg8OkugmutgNWGcOX8TlAAtGNZ\nvi+S2l77mMJLrqyf80WJ6ptIzCMNZSYN/bSeuIZ4kpgFWl7oMNSeOgGzjKi1FxI=\n=91JK\n-----END PGP MESSAGE-----\n", + "fp": "B141E0D9F711DD86DEAE1269D9B023AB01B68EFE" + } + ], + "unencrypted_suffix": "_unencrypted", + "version": "3.7.1" + } +} +\ No newline at end of file diff --git a/modules/user/security.nix b/modules/user/security.nix @@ -0,0 +1,67 @@ +{ + config, + lib, + files, + ... +}: let + inherit (lib) filterAttrs mkForce mkIf optional util; + inherit (builtins) all any attrNames attrValues hasAttr mapAttrs readFile; + inherit (config.sops) secrets; + inherit (config.user) settings; + enable = all (value: value.minimal) (attrValues settings); + recovery = any (value: value.recovery) (attrValues settings); +in { + ## Security Settings ## + config = { + # Passwords + services.openssh.enable = mkIf enable (mkForce false); + sops.secrets = + if enable + then (mkForce {}) + else util.map.secrets ./passwords true; + + users.extraUsers.root.passwordFile = + mkIf (hasAttr "root.secret" secrets) secrets."root.secret".path; + users.users = + mapAttrs (name: value: { + passwordFile = mkIf (!value.minimal) secrets."${name}.secret".path; + }) + settings; + + # Recovery Account + users.extraUsers.recovery = mkIf recovery { + name = "recovery"; + description = "Recovery Account"; + isNormalUser = true; + uid = 1100; + group = "users"; + extraGroups = ["wheel"]; + useDefaultShell = true; + initialHashedPassword = readFile ./passwords/default; + }; + + # Authentication + security.sudo = { + execWheelOnly = true; + extraConfig = '' + Defaults pwfeedback + Defaults lecture = always, lecture_file = ${files.ascii.groot} + ''; + + # Passwordless Access + extraRules = [ + { + users = + attrNames (filterAttrs (_: value: value.minimal) settings) + ++ optional recovery "recovery"; + commands = [ + { + command = "ALL"; + options = ["NOPASSWD" "SETENV"]; + } + ]; + } + ]; + }; + }; +} diff --git a/packages/README.md b/packages/README.md @@ -0,0 +1,15 @@ +### Packages + +The `packages` directory contains custom-built packages (can be accessed by `github:maydayv7/dotfiles#packages.${system}`). Packages which have a separate `metadata.nix` can be automatically updated using `sh update.sh` + +### Overlays + +The `overlays` directory contains overlays for pre-built packages +It is advisable to use Flake `inputs` as the source for overriden packages. To pin it to a specific commit/revision add `?rev=` after the `url`. Else you may also specify the package source using the `fetch` functions. In case you don't know the hash for the source, set: + +``` +hash = lib.fakeHash; +sha256 = lib.fakeSha256; +``` + +Then Nix will fail the build with an `error` message and give the correct hash diff --git a/packages/dotfiles.nix b/packages/dotfiles.nix @@ -0,0 +1,22 @@ +{ + lib, + pkgs, + files, + ... +}: +pkgs.stdenv.mkDerivation rec { + pname = "Dotfiles"; + version = "v7.0"; + longVersion = "20220318"; + + src = files.path.toplevel; + dontBuild = true; + installPhase = "mkdir -p $out/ && cp -r . $out/"; + + meta = with lib; { + description = "My PC Dotfiles"; + homepage = files.path.repo; + license = licenses.mit; + maintainers = ["maydayv7"]; + }; +} diff --git a/packages/firefox-gnome-theme/default.nix b/packages/firefox-gnome-theme/default.nix @@ -0,0 +1,28 @@ +{ + lib, + pkgs, + ... +}: +with pkgs; let + metadata = import ./metadata.nix; +in + stdenv.mkDerivation rec { + pname = "firefox-gnome-theme"; + version = metadata.rev; + + src = fetchFromGitHub { + owner = "rafaelmardojai"; + repo = pname; + inherit (metadata) rev sha256; + }; + + dontBuild = true; + installPhase = "mkdir -p $out/ && cp -r . $out/"; + + meta = with lib; { + description = "A GNOME Theme for Firefox"; + homepage = metadata.repo; + license = licenses.unlicense; + maintainers = ["maydayv7"]; + }; + } diff --git a/packages/firefox-gnome-theme/metadata.nix b/packages/firefox-gnome-theme/metadata.nix @@ -0,0 +1,6 @@ +{ + repo = "https://github.com/rafaelmardojai/firefox-gnome-theme"; + branch = "master"; + rev = "2f2e77ceea9cde12b7ea6a78f50d4fe9440918e3"; + sha256 = "sha256-fmf4ioSbGAocIrILEQLGBXPakjqBHq1M/1xhDafVGSk="; +} diff --git a/packages/fly-pie.nix b/packages/fly-pie.nix @@ -0,0 +1,36 @@ +{ + lib, + pkgs, + ... +}: +with pkgs; + stdenv.mkDerivation rec { + pname = "gnome-shell-extension-fly-pie"; + version = "v13"; + + src = fetchzip { + stripRoot = false; + url = "https://extensions.gnome.org/extension-data/flypieschneegans.github.com.${version}.shell-extension.zip"; + sha256 = "sha256-7O7Kii9wQS5cg8UIEEyf2ePoGZ7XtpzE+4p+zwxp+Go="; + }; + + dontBuild = true; + installPhase = '' + mkdir -p $out/share/gnome-shell/extensions/flypie@schneegans.github.com/ + cp -r . $out/share/gnome-shell/extensions/flypie@schneegans.github.com/ + ''; + + passthru = { + extensionUuid = "flypie@schneegans.github.com"; + extensionPortalSlug = "fly-pie"; + }; + + meta = with lib; { + description = "Gnome Shell marking menu which can be used to launch applications, simulate hotkeys, open URLs and much more!"; + longDescription = "Manually Packaged because of https://github.com/NixOS/nixpkgs/issues/118612"; + homepage = "https://extensions.gnome.org/extension/3433/fly-pie/"; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = ["maydayv7"]; + }; + } diff --git a/packages/fonts.nix b/packages/fonts.nix @@ -0,0 +1,20 @@ +{ + lib, + pkgs, + files, + ... +}: +pkgs.stdenv.mkDerivation rec { + pname = "fonts"; + version = "7"; + + src = files.fonts.path; + dontBuild = true; + installPhase = "mkdir -p $out/share/fonts/ && cp -r . $out/share/fonts/"; + + meta = with lib; { + description = "Custom Proprietary Fonts"; + license = licenses.unfree; + maintainers = ["maydayv7"]; + }; +} diff --git a/packages/overlays/.git-keep b/packages/overlays/.git-keep diff --git a/packages/overlays/discord.nix b/packages/overlays/discord.nix @@ -0,0 +1,11 @@ +final: prev: { + # Update Discord to Latest Version + discord = prev.discord.overrideAttrs (_: rec { + version = "0.0.17"; + + src = prev.fetchzip { + url = "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz"; + sha256 = "sha256-a/XAwkOON2BLsi6x5Bp83NfTI0JadYqY+LfcK5GLr0E="; + }; + }); +} diff --git a/packages/overlays/gnome-terminal.nix b/packages/overlays/gnome-terminal.nix @@ -0,0 +1,21 @@ +final: prev: { + # GNOME Terminal Transparency Patch + # https://aur.archlinux.org/packages/gnome-terminal-transparency + gnome = + prev.gnome + // { + gnome-terminal = + final.lib.overrideDerivation prev.gnome.gnome-terminal + (drv: { + patches = + drv.patches + ++ [ + (prev.fetchpatch { + name = "transparency.patch"; + sha256 = "0y116dww3j1mk4s2qklkgw8jjmvdfdpwynbijq0iwazvlggmsilk"; + url = "https://aur.archlinux.org/cgit/aur.git/plain/transparency.patch?h=gnome-terminal-transparency&id=7dd7cd2471e42af8130cda7905b2b2c2a334ac4b"; + }) + ]; + }); + }; +} diff --git a/packages/overlays/google-chrome.nix b/packages/overlays/google-chrome.nix @@ -0,0 +1,13 @@ +final: prev: { + # Patch Google Chrome Dark Mode + google-chrome = prev.google-chrome.overrideAttrs (old: { + installPhase = + old.installPhase + + '' + fix=" --enable-features=WebUIDarkMode --force-dark-mode" + + substituteInPlace $out/share/applications/google-chrome.desktop \ + --replace $exe "$exe$fix" + ''; + }); +} diff --git a/packages/overlays/nixFlakes.nix b/packages/overlays/nixFlakes.nix @@ -0,0 +1,25 @@ +final: prev: { + # Update Nix to Latest Version and Patch using unmerged PRs + nixFlakes = prev.nixFlakes.overrideAttrs (old: rec { + version = "2.7+"; + longVersion = builtins.replaceStrings ["+"] [""] version + ".0"; + + src = prev.fetchFromGitHub { + owner = "NixOS"; + repo = "nix"; + rev = longVersion; + sha256 = "sha256-m8tqCS6uHveDon5GSro5yZor9H+sHeh+v/veF1IGw24="; + }; + + buildInputs = old.buildInputs ++ [final.nlohmann_json]; + patches = [ + /* + (prev.fetchpatch { + name = "dirty-rev.patch"; + sha256 = final.lib.fakeSha256; + url = "https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/5385.patch"; + }) + */ + ]; + }); +} diff --git a/packages/patches/.git-keep b/packages/patches/.git-keep diff --git a/packages/top-bar-organizer.nix b/packages/top-bar-organizer.nix @@ -0,0 +1,40 @@ +{ + lib, + pkgs, + ... +}: +with pkgs; + stdenv.mkDerivation rec { + pname = "gnome-shell-extension-top-bar-organizer"; + version = "v2"; + + src = fetchFromGitLab { + domain = "gitlab.gnome.org"; + owner = "julianschacher"; + repo = "top-bar-organizer"; + rev = version; + sha256 = "sha256-qpvjVT5/+3tw1IUHfK3njtS8AVI6Xy/am8zQ5o2H4uo="; + }; + + dontBuild = true; + buildInputs = [glib]; + installPhase = '' + glib-compile-schemas src/schemas + mkdir -p $out/share/gnome-shell/extensions/top-bar-organizer@julian.gse.jsts.xyz/ + cp -r src/. $out/share/gnome-shell/extensions/top-bar-organizer@julian.gse.jsts.xyz/ + ''; + + passthru = { + extensionUuid = "top-bar-organizer@julian.gse.jsts.xyz"; + extensionPortalSlug = "top-bar-organizer"; + }; + + meta = with lib; { + description = "Gnome Shell Extension for organizing your Top Bar"; + longDescription = "Manually Packaged because v3 doesn't work"; + homepage = "https://extensions.gnome.org/extension/4356/top-bar-organizer/"; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = ["maydayv7"]; + }; + } diff --git a/packages/update.sh b/packages/update.sh @@ -0,0 +1 @@ +../scripts/packages.sh +\ No newline at end of file diff --git a/packages/wine/.git-keep b/packages/wine/.git-keep diff --git a/packages/wine/7zip.nix b/packages/wine/7zip.nix @@ -0,0 +1,79 @@ +{ + system ? builtins.currentSystem, + lib, + pkgs, + wine, + ... +}: let + inherit (pkgs) copyDesktopItems fetchurl makeDesktopItem; + inherit (lib.wine."${system}") copyDesktopIcons makeDesktopIcon mkWindowsApp; +in + mkWindowsApp rec { + inherit wine; + pname = "7zip"; + version = "1900"; + src = fetchurl { + url = "https://www.7-zip.org/a/7z1900.exe"; + sha256 = "107gnx5rimmyr0kndxblkhrwlqn9x1aga7d07ghyxsq3bd6s16km"; + }; + + dontUnpack = true; + wineArch = "win32"; + enableInstallNotification = false; + fileMap = {}; + nativeBuildInputs = [copyDesktopItems copyDesktopIcons]; + + winAppInstall = '' + wine start /unix ${src} /S + wineserver -w + ''; + + winAppRun = '' + wine start /unix "$WINEPREFIX/drive_c/Program Files/7-Zip/7zFM.exe" "$ARGS" + ''; + + installPhase = '' + runHook preInstall + ln -s $out/bin/.launcher $out/bin/${pname} + runHook postInstall + ''; + + desktopItems = let + mimeType = builtins.concatStringsSep ";" [ + "application/epub+zip" + "application/x-zip-compressed-fb2" + "application/x-cbt" + "application/x-cb7" + "application/x-7z-compressed" + "application/vnd.rar" + "application/x-tar" + "application/zip" + ]; + in [ + (makeDesktopItem { + inherit mimeType; + name = pname; + exec = pname; + icon = pname; + desktopName = "7-Zip"; + genericName = "Archive Manager"; + categories = "Office;"; + }) + ]; + + desktopIcon = makeDesktopIcon { + name = "7zip"; + src = fetchurl { + url = "https://www.7-zip.org/7ziplogo.png"; + sha256 = "1nkas4wy40ffsmcji1a3gq8a61d72zp4w65jjpmqjj9wyh0j5b7q"; + }; + }; + + meta = with lib; { + description = "File Archiver with a High Compression Ratio"; + homepage = "https://www.7-zip.org/"; + license = licenses.bsd3; + platforms = platforms.linux; + maintainers = ["maydayv7"]; + }; + } diff --git a/repl.nix b/repl.nix @@ -0,0 +1,37 @@ +{ + path ? /etc/nixos, + host ? false, +}: let + inherit (builtins) currentSystem getFlake head match pathExists readFile removeAttrs; + + flake = + if pathExists "${path}/flake.nix" + then getFlake "${toString path}" + else getFlake "/etc/nixos"; + + pkgs = + if (flake.inputs ? nixpkgs) + then import flake.inputs.nixpkgs.outPath {} + else if (flake.legacyPackages ? currentSystem) + then import flake.legacyPackages."${currentSystem}" + else import <nixpkgs> {}; +in + { + inherit flake; + } + // builtins + // (removeAttrs (pkgs // pkgs.lib) ["options" "config"]) + // flake + // (flake.nixosConfigurations or {}) + // ( + if host + then + flake + .nixosConfigurations + ."${ + head (match '' + ([a-zA-Z0-9\-]+) + '' (readFile "/etc/hostname")) + }" + else {} + ) diff --git a/scripts/README.md b/scripts/README.md @@ -0,0 +1,30 @@ +### Scripts + +The `scripts` directory contains a combination of custom Bash Scripts (with `nix-shell` shebangs, and can be run using <code><i>./path/to/script</i></code>) as well as ones written in conjunction with the Nix Syntax (which can be accessed by `github:maydayv7/dotfiles#apps.${system}`) +A system management script, invoked with the command [`nixos`](./nixos.nix), has been included, which can be used to apply user and device configuration changes, painlessly install the OS and setup the device using a single command, and perform various other useful functions (If you have a working NixOS install, you can check it out using `nix run github:maydayv7/dotfiles`) + +```shellsession +$ nixos +# Legend # + xxx - Command + [ ] - Optional - Command Description + ' ' - Variable + +# Usage # + apply [ --'option' ] - Applies Device and User Configuration + cache 'command' - Pushes Binary Cache Output to Cachix + check [ --trace | --fast ] - Checks System Configuration [ Displays Error to Trace ] + clean [ --all ] - Garbage Collects and Optimises Nix Store + explore - Opens Interactive Shell to explore Syntax and Configuration + format [ 'path' ] - Formats Configuration Syntax [ in 'path' ] + install - Installs NixOS onto System + iso 'variant' [ --burn ] - Builds Image for Specified Install Media or Device [ Burns '.iso' to USB ] + list [ 'pattern' ] - Lists all Installed Packages [ Returns Matches ] + locate 'package' - Locates Installed Package + run [ 'path' ] 'command' - Runs Specified Command [ from 'path' ] (Wraps 'nix run') + save - Saves Configuration State to Repository + search 'term' [ 'source' ] - Searches for Packages [ Providing 'term' ] or Configuration Options + secret 'choice' [ 'path' ] - Manages 'sops' Encrypted Secrets + shell [ 'name' ] - Opens desired Nix Developer Shell + update [ 'repository' ] - Updates System Repositories +``` diff --git a/scripts/colors.sh b/scripts/colors.sh @@ -0,0 +1,9 @@ +#! /usr/bin/env nix-shell +#! nix-shell -i bash + +# Print Color Map # + +for i in {0..255} +do + print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'} +done diff --git a/scripts/commands.sh b/scripts/commands.sh @@ -0,0 +1,73 @@ +#! /usr/bin/env nix-shell +#! nix-shell -i bash -p bzip2 coreutils git gnupg gnutar gzip p7zip unzip + +# Useful Commands # + +error() { + echo -e "\n\033[0;31merror:\033[0m $1" + if [ -n "$2" ] + then + echo -e "\n$2" + fi + exit 7 +} + +extract () { + if [ -f "$1" ] + then + case $1 in + *.tar.bz2) tar xvjf "$1";; + *.tar.gz) tar xvzf "$1";; + *.tar.xz) tar Jxvf "$1";; + *.bz2) bunzip2 "$1";; + *.rar) rar x "$1";; + *.gz) gunzip "$1";; + *.tar) tar xvf "$1";; + *.tbz2) tar xvjf "$1";; + *.tgz) tar xvzf "$1";; + *.zip) unzip -d "${1//\.zip/}" "$1";; + *.Z) uncompress "$1";; + *.7z) 7z x "$1";; + *) error "Can't Extract '$1'" ;; + esac + else + error "File '$1' is invalid" + fi +} + +internet() { + if ! nc -zw1 google.com 443 2> /dev/null + then + error "You are Offline, Please Connect to the Internet" + fi +} + +newline() { + echo -e "\n"; +} + +restart() { + read -rp "Do you want to Reboot the System? (Y/N): " choice + case $choice in + [Yy]*) reboot;; + *) exit;; + esac +} + +up () { + LIMIT=$1 + P=$PWD/.. + for ((i=1; i < LIMIT; i++)) + do + P=$P/.. + done + cd "$P" || exit +} + +warn() { + echo -e "\n\033[0;35mwarning:\033[0m $1" + if [ -n "$2" ] + then + echo -e "\n$2" + fi +} diff --git a/scripts/mail.sh b/scripts/mail.sh @@ -0,0 +1,28 @@ +#! /usr/bin/env nix-shell +#! nix-shell -i bash -p coreutils gnused libpst + +# Script to convert '.pst' Files to '.mbox' # + +MAIL=./convert-$(date '+%H-%M_%d-%m-%y') + +# File Conversion +read -rp "Enter Path to '.pst' File: " DIR +echo "Converting '.pst' to '.mbox'" +mkdir "$MAIL" && readpst -o "$MAIL" -r "$DIR" +find "$MAIL" -type d -mindepth 1 | tac | xargs -d '\n' -I{} mv {} {}.sbd +find "$MAIL" -name mbox -type f | xargs -d '\n' -I{} echo '"{}" "{}"' | sed -e 's/\.sbd\/mbox"$/"/' | xargs -L 1 mv +find "$MAIL" -empty -type d | xargs -d '\n' rmdir +find "$MAIL" -type d | grep -E '.sbd' | sed 's/.\{4\}$//' | xargs -d '\n' touch +echo "Conversion Complete, Files are Present in $MAIL" + +# Mail Import +import() { +read -rp "Enter Name of Thunderbird Profile: " PROFILE +cp -r "$MAIL"/. "$HOME/.thunderbird/$PROFILE/Mail/Local Folders/Converted/" && echo "Successfully Imported" +} + +read -rp "Do you want to Import the Mails into Thunderbird? (Y/N): " choice + case $choice in + [Yy]*) import; rm -rf "$MAIL";; + *) rm -rf "$MAIL"; exit;; + esac diff --git a/scripts/nixos.nix b/scripts/nixos.nix @@ -0,0 +1,500 @@ +{ + system ? builtins.currentSystem, + lib, + inputs, + pkgs, + files, + ... +}: +with files; let + inherit (inputs) self; + inherit (util.map) list; + inherit (lib) licenses recursiveUpdate util; + + devShells = list self.devShells."${system}"; + installMedia = list self.installMedia; + nixosConfigurations = list self.nixosConfigurations; + + # Usage Description + usage = { + script = '' + # Legend # + xxx - Command + [ ] - Optional - Command Description + ' ' - Variable + + # Usage # + apply [ --'option' ] - Applies Device and User Configuration + cache 'command' - Pushes Binary Cache Output to Cachix + check [ --trace | --fast ] - Checks System Configuration [ Displays Error to Trace ] + clean [ --all ] - Garbage Collects and Optimises Nix Store + explore - Opens Interactive Shell to explore Syntax and Configuration + format [ 'path' ] - Formats Configuration Syntax [ in 'path' ] + install - Installs NixOS onto System + iso 'variant' [ --burn ] - Builds Image for Specified Install Media or Device [ Burns '.iso' to USB ] + list [ 'pattern' ] - Lists all Installed Packages [ Returns Matches ] + locate 'package' - Locates Installed Package + run [ 'path' ] 'command' - Runs Specified Command [ from 'path' ] (Wraps 'nix run') + save - Saves Configuration State to Repository + search 'term' [ 'source' ] - Searches for Packages [ Providing 'term' ] or Configuration Options + secret 'choice' [ 'path' ] - Manages 'sops' Encrypted Secrets + shell [ 'name' ] - Opens desired Nix Developer Shell + update [ 'repository' ] - Updates System Repositories + ''; + + apply = '' + # Usage # + --boot - Applies Configuration on boot + --check - Checks Configuration Build + --deploy [ 'device' ] - Automatically Deploy via SSH + --rollback [ 'generation' ] - Reverts to Last [ or Specified ] Build Generation + --test - Tests Configuration Build + ''; + + search = '' + # Usage # + cmd.'command' - Searches for Package providing 'command' + pkgs.'package' [ 'repo' ] - Searches for Package 'package' [ In Repository ] + 'term' - Searches for Packages and Configuration Options and matching 'term' + ''; + + secret = '' + # Usage # + create 'path' - Creates desired Secret + edit 'name' - Edits desired Secret + list - Lists all 'sops' Encrypted Secrets + show 'name' - Shows desired Secret + update - Updates Secrets to defined Keys + ''; + }; +in + recursiveUpdate { + meta = { + description = "System Management Script"; + homepage = files.path.repo; + license = licenses.mit; + maintainers = ["maydayv7"]; + }; + } (pkgs.writeShellApplication { + name = "nixos"; + runtimeInputs = with pkgs; [ + unstable.alejandra + cachix + coreutils + apps.deploy + apps.generators + git + gnupg + gnused + gparted + jq + manix + nixFlakes + nix-linter + parted + nodePackages.prettier + sops + tree + wine.mkwindowsapp-tools + zfs + ]; + + text = '' + set +eu + ${scripts.commands} + ${scripts.partitions} + + if [[ -n $IN_NIX_SHELL ]] + then + warn "You are in a Nix Developer Shell" "'nixos' may not work here properly\n" + fi + + case $1 in + "") error "Expected an Option" "${usage.script}";; + help|--help|-h) echo -e "## Tool for NixOS System Management ##\n${usage.script}";; + apply) + case $2 in + "") + echo "Applying Configuration..." + sudo nixos-rebuild switch --flake ${path.system}# + ;; + "--boot") + echo "Applying Configuration..." + sudo nixos-rebuild boot --flake ${path.system}# + ;; + "--check") + echo "Checking Configuration..." + nixos-rebuild dry-activate --flake ${path.system}# + ;; + "--deploy") + echo "Deploying Configuration..." + deploy -s ${path.system}#"$3" + ;; + "--test") + echo "Testing Configuration..." + sudo nixos-rebuild test --no-build-nix --show-trace --flake ${path.system}# + ;; + "--rollback") + profile="/nix/var/nix/profiles/system" + case $3 in + "") + echo "Applying Rollback..." + sudo nixos-rebuild switch --rollback + ;; + list) + echo "# System Generations #" + sudo nix-env --list-generations -p "$profile" + ;; + *) + echo "Rolling Back to Generation '$3'..." + sudo nix-env --switch-generation "$3" -p "$profile" && sudo $profile/bin/switch-to-configuration switch + ;; + esac + ;; + *) error "Unknown Option '$2'" "${usage.apply}";; + esac + ;; + cache) + if [ -z "$2" ] + then + error "Expected a Build Command" + else + echo "Executing Command '" "''${@:2}" "'..." + cachix authtoken "$(find ${path.system} -name cachix-token.secret -exec sops --config ${sops} -d {} \+)" + cachix watch-exec ${path.cache} "''${@:2}" + fi + ;; + check) + echo "Checking Syntax..." + nix-linter -r ${path.system} || true + case $2 in + "") nix flake check ${path.system} --keep-going;; + "--trace") nix flake check ${path.system} --keep-going --show-trace;; + "--fast") nix build -L --no-link ${path.system}#checks.${system}.activate;; + *) nix flake check "$2" --keep-going;; + esac + ;; + clean) + echo "Running Garbage Collection..." + mkwindows-tools-gc + nix-collect-garbage -d + rm -rf /nix/var/nix/profiles/per-user/"$USER"/profile + if [ "$EUID" -ne 0 ] && [ "$2" != "--all" ] + then + warn "Run as 'root' or use Option '--all' to Clean System Generations" + else + sudo nix-collect-garbage -d + sudo rm -rf /run/secrets/* + sudo nix-env --delete-generations old --profile /nix/var/nix/profiles/system + sudo /nix/var/nix/profiles/system/bin/switch-to-configuration switch + fi + newline + echo "Running De-Duplication..." + nix store optimise + ;; + explore) + case $2 in + "") nix repl --arg host true --arg path ${path.system} ${repl};; + *) nix repl --arg path "$(readlink -f "$2" | sed 's|/flake.nix||')" ${repl};; + esac + ;; + format) + echo "Formatting Code..." + if [ -z "$2" ] + then + path=${path.system} + else + path="$2" + fi + alejandra "$path" + prettier --write --list-different --ignore-unknown "$path" + ;; + install) + internet + if [ "$EUID" -ne 0 ] + then + error "This Command must be Executed as 'root'" + fi + read -rp "Enter Name of Device to Install: " HOST + read -rp "Do you want to Automatically Create the Partitions? (Y/N): " choice + case $choice in + [Yy]*) warn "Assuming Disk is Completely Empty"; partition_disk;; + *) warn "You must Create, Format and Label the Partitions on your own"; gparted > /dev/null;; + esac + newline + read -rp "Select Filesystem to use for Disk (simple/advanced): " choice + case $choice in + 1|[Ss]*) + read -rp "Do you want to Create and Format the EXT4 Partitions? (Y/N): " choice + case $choice in + [Yy]*) DIR=${path.system}; create_ext4; mount_ext4;; + *) warn "Assuming that Required EXT4 Partition has already been Created"; mount_ext4;; + esac + ;; + 2|[Aa]*) + read -rp "Do you want to Create the ZFS Pool and Datasets? (Y/N): " choice + case $choice in + [Yy]*) DIR=${persist}${path.system}; create_zfs; mount_zfs;; + *) warn "Assuming that Required ZFS Pool and Datasets have already been Created"; mount_zfs;; + esac + ;; + *) error "Choose (1)simple or (2)advanced";; + esac + newline + mount_other + newline + read -rp "Enter Path to Repository (path/URL): " URL + if [ -z "$URL" ] + then + URL=${path.flake} + fi + echo "Installing System from '$URL'..." + nixos-install --no-root-passwd --root /mnt --flake "$URL"#"$HOST" --impure + newline + + read -rp "Enter Path to GPG Keys (path/.git): " KEY + LINK='(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]' + if [ -z "$KEY" ] + then + error "Path to GPG Keys cannot be empty" + elif [[ $KEY =~ $LINK ]] + then + echo "Cloning Keys..." + git clone "$KEY" keys --progress + else + cp -r "$KEY"/. ./keys + fi + echo "Importing Keys..." + find ./keys -name '*.gpg' -exec gpg --homedir /mnt${files.gpg} --import {} \+ + rm -rf ./keys + newline + + echo "Preparing ${path.system}..." + DIR=/mnt$DIR + rm -rf $DIR && mkdir $DIR + newline + + echo "Cloning Repository..." + git clone --recurse-submodules ${path.repo} $DIR + chgrp -R keys $DIR && chmod g+rwx $DIR -R + newline + + unmount_all + newline + restart + ;; + iso) + case $2 in + "") error "Expected a Variant of Install Media or Device";; + *) + if grep -wq "$2" <<<"${installMedia}" + then + echo "Building '$2' Install Media Image..." + nix build ${path.system}#installMedia."$2".config.system.build.isoImage && echo "The Image is located at './result/iso/nixos.iso'" + elif grep -wq "$2" <<<"${nixosConfigurations}" + then + echo "Building '$2' Device Image..." + nixos-generate -f iso --flake ${path.system}#"$2" + else + error "Unknown Variant '$2'" "# Available Variants #\n Install Media: ${installMedia}\n Devices: ${nixosConfigurations}" + fi + ;; + esac + case $3 in + "") echo "The '--burn' Option can be used to Flash the Image onto a USB";; + "--burn") + case $4 in + "") error "Expected a 'path' to USB Drive";; + *) sudo dd if=./result/iso/nixos.iso of="$4" status=progress bs=1M;; + esac + ;; + *) error "Unknown Option '$3'";; + esac + ;; + "list") + case $2 in + "") nix-store -q -R /run/current-system | sed -n -e 's/\/nix\/store\/[0-9a-z]\{32\}-//p' | sort | uniq;; + *) find=$(nix-store -q -R /run/current-system | sed -n -e 's/\/nix\/store\/[0-9a-z]\{32\}-//p' | sort | uniq | grep "$2") + if [ -z "$find" ] + then + if nix search nixpkgs#"$2" &> /dev/null + then + error "Package '$2' is not installed" + else + error "Package '$2' not found" + fi + else + echo "$find" + fi + ;; + esac + ;; + "locate") + case $2 in + "") error "Expected Package Name";; + *) + package=$(nix-store -q -R /run/current-system | sed -n -e 's/\/nix\/store\/[0-9a-z]\{32\}-//p' | sort | uniq | grep "$2") + if [ -z "$package" ] + then + location=$(find /nix/store -maxdepth 1 -type d -name "*$2*") + if [ -n "$location" ] + then + if (( $(grep -c . <<<"$location") > 1 )) + then + echo -e "Locations:\n$location" + else + echo -e "Location: $location" + fi + else + if nix search nixpkgs#"$2" &> /dev/null + then + error "Package '$2' is not installed" + else + error "Package '$2' is invalid" + fi + fi + else + if (( $(grep -c . <<<"$package") > 1 )) + then + locations=$(find /nix/store -maxdepth 1 -type d -name "*$2*") + echo -e "Locations:\n$locations" + else + echo "Package $package found" + nix search nixpkgs#"$2" &> /dev/null && location=$(nix eval nixpkgs#"$2".outPath 2> /dev/null | sed 's/"//g') || location=$(find /nix/store -maxdepth 1 -type d -name "*$package") + echo "Location: $location" + fi + fi + ;; + esac + ;; + run) + if [[ "$2" == *[:/]* ]] || grep -wq "$2" <<<"${list inputs + "nixpkgs"}" + then + nix run "$2"#"$3" -- "''${@:4}" + else + nix run ${path.system}#"$2" -- "''${@:3}" + fi + ;; + save) + echo "Saving Changes..." + pushd ${path.system} > /dev/null + git stash + git pull --rebase + git stash pop + git add . + git commit + git push --force + popd > /dev/null + ;; + search) + case $2 in + "") error "Expected an Option" "${usage.search}";; + help|--help|-h) echo "${usage.search}";; + cmd.*) + command="''${2//cmd\./}" + echo "Searching for Package providing Command '$command'..." + output=$(nix-locate --whole-name --type x --type s --no-group --top-level --at-root "/bin/$command") + if [ -z "$output" ] + then + error "Command '$command' not found" + else + echo "$output" + fi + ;; + pkgs.*) + package="''${2//pkgs\./}" + echo "Searching for Package '$package'..." + if [ -z "$3" ] + then + nix search nixpkgs#"$package" + else + nix search "$3"#"$package" + fi + ;; + *) + echo "Searching for Term '$2'..." + manix "$2" + ;; + esac + ;; + secret) + case $2 in + "") error "Expected an Option" "${usage.secret}";; + help|--help|-h) echo "${usage.secret}";; + create) + case $3 in + "") error "Expected 'name' of Secret";; + *) + echo "Creating Secret '$3'..." + sops --config ${sops} -i ${path.system}/"$3".secret + ;; + esac + ;; + edit) + case $3 in + "") error "Expected 'name' of Secret";; + *) + echo "Editing Secret '$3'..." + find ${path.system} -name "$3".secret -exec sops --config ${sops} -i {} \+ || error "Unknown Secret '$3'" + ;; + esac + ;; + list) + echo "## Secrets in ${path.system} ##" + grep / ${sops} | sed -e 's|- path_regex:||' -e 's/\/\.\*\$//' -e 's| |${path.system}/|' | xargs tree -C --noreport -P '*.secret' -I '_*' | sed 's/\.secret//' + ;; + show) + echo "Showing Secret '$3'..." + find ${path.system} -name "$3".secret -exec sops --config ${sops} -d {} \+ || error "Unknown Secret '$3'" + ;; + update) + echo "Updating Secrets..." + find ${path.system} -name '*.secret' ! -name '_*' -exec sops --config ${sops} updatekeys {} \; + ;; + *) error "Unknown Option '$2'" "${usage.secret}";; + esac + ;; + shell) + case $2 in + "") nix develop ${path.system} --command "$SHELL";; + *) + if grep -wq "$2" <<<"${devShells}" + then + nix develop ${path.system}#"$2" --command "$SHELL" + else + error "Unknown Shell '$2'" "# Available Shells #\n ${devShells}" + fi + ;; + esac + ;; + update) + case $2 in + "") + echo "Updating Flake Inputs..." + nix flake update ${path.system} + ;; + "--commit") + echo "Updating Flake Inputs..." + nix flake update ${path.system} --commit-lock-file + ;; + "--pkgs") + echo "Updating Packages..." + pushd ${path.system}/packages > /dev/null + bash ${./packages.sh} + popd > /dev/null + ;; + *) + echo "Updating Flake Input '$2'..." + if [ -z "$3" ] + then + nix flake lock ${path.system} --update-input "$2" + else + nix flake lock ${path.system} --override-input "$2" "$3" + fi + ;; + esac + ;; + *) error "Unknown Option '$1'" "${usage.script}";; + esac + ''; + }) diff --git a/scripts/packages.sh b/scripts/packages.sh @@ -0,0 +1,128 @@ +#! /usr/bin/env nix-shell +#! nix-shell -i bash -p coreutils jq +# shellcheck shell=bash + +# Script to Automatically Update Packages # + +set -euo pipefail +unset NIX_PATH + +# Logic +update() { + if [[ "${1:-""}" != "" ]] + then + t="$(mktemp)"; trap "rm ${t}" EXIT; + m="$(mktemp)"; trap "rm ${m}" EXIT; + l="$(mktemp)"; trap "rm ${l}" EXIT; + pkg="${1}" + metadata="${pkg}/metadata.nix" + pkgname="$(basename "${pkg}")" + + if [[ ! -f "${pkg}/metadata.nix" ]] + then + exit 0 + fi + + # Extraction + nix eval -f "${metadata}" --json > "${t}" 2>/dev/null + branch="$(cat "${t}" | jq -r .branch)" + rev="$(cat "${t}" | jq -r .rev)" + sha256="$(cat "${t}" | jq -r .sha256)" + repo="$(cat "${t}" | jq -r .repo)" # Optional + cargoSha256="$(cat "${t}" | jq -r .cargoSha256)" # Optional + vendorSha256="$(cat "${t}" | jq -r .vendorSha256)" # Optional + skip="$(cat "${t}" | jq -r .skip)" # Optional + upattr="$(cat "${t}" | jq -r .upattr)"; # Optional + if [[ "${upattr}" == "null" ]] + then + upattr="${pkgname}" + fi + + if [[ "${skip}" == "true" ]] + then + echo "Skipping (Pinned to '${rev}')" + exit 0 + fi + + # Latest Revision + if [[ "${repo}" != "null" ]] + then + newrev="$(git ls-remote "${repo}" "refs/heads/${branch}" | awk '{ print $1}')" + fi + + # Early Quit + if [[ "${rev}" == "${newrev}" && "${FORCE_RECHECK:-""}" != "true" ]] + then + echo "'${pkgname}' Already Up to Date ('${rev}')" + exit 0 + fi + + echo "Updating '${pkgname}'..." + echo "Bumping '${rev}' ---> '${newrev}'" + + # Sha256 + sed -i "s|${rev}|${newrev}|" "${metadata}" + sed -i "s|${sha256}|0000000000000000000000000000000000000000000000000000|" "${metadata}" + nix build --no-link "..#${upattr}" &> "${l}" || true + newsha256="$(cat "${l}" | grep 'got:' | cut -d':' -f2 | tr -d ' ' || true)" + if [[ "${newsha256}" == "sha256" ]] + then + newsha256="$(cat "${l}" | grep 'got:' | cut -d':' -f3 | tr -d ' ' || true)" + fi + + newsha256="$(nix hash to-sri --type sha256 "${newsha256}")" + sed -i "s|0000000000000000000000000000000000000000000000000000|${newsha256}|" "${metadata}" + + # CargoSha256 + if [[ "${cargoSha256}" != "null" ]] + then + sed -i "s|${cargoSha256}|0000000000000000000000000000000000000000000000000000|" "${metadata}" + nix build --no-link "..#${upattr}" &> "${l}" || true + newcargoSha256="$(cat "${l}" | grep 'got:' | cut -d':' -f2 | tr -d ' ' || true)" + if [[ "${newcargoSha256}" == "sha256" ]] + then + newcargoSha256="$(cat "${l}" | grep 'got:' | cut -d':' -f3 | tr -d ' ' || true)" + fi + newcargoSha256="$(nix hash to-sri --type sha256 "${newcargoSha256}")" + sed -i "s|0000000000000000000000000000000000000000000000000000|${newcargoSha256}|" "${metadata}" + fi + + # VendorSha256 + if [[ "${vendorSha256}" != "null" ]] + then + sed -i "s|${vendorSha256}|0000000000000000000000000000000000000000000000000000|" "${metadata}" + nix build --no-link "..#${upattr}" &> "${l}" || true + newvendorSha256="$(cat "${l}" | grep 'got:' | cut -d':' -f2 | tr -d ' ' || true)" + if [[ "${newvendorSha256}" == "sha256" ]] + then + newvendorSha256="$(cat "${l}" | grep 'got:' | cut -d':' -f3 | tr -d ' ' || true)" + fi + newvendorSha256="$(nix hash to-sri --type sha256 "${newvendorSha256}")" + sed -i "s|0000000000000000000000000000000000000000000000000000|${newvendorSha256}|" "${metadata}" + fi + + # Commit + prefix="chore(packages):" + git diff-index --quiet HEAD "${pkg}" || \ + git commit -q -n "${pkg}" -m "${prefix} ${pkgname} (${rev} ---> ${newrev})" + echo -e "Finished Updating '${pkgname}' ('${rev}' ---> '${newrev}')\n" + exit 0 + fi +} +export -f update + +# Execution +main() { + echo "Checking for Updates..." +} + +while true +do + (main) + find . -mindepth 1 -maxdepth 1 -type d -exec bash -c 'update "$0"' {} \; + res=$? + if (( res != 255 )) + then + break + fi +done diff --git a/scripts/partitions.sh b/scripts/partitions.sh @@ -0,0 +1,65 @@ +#! /usr/bin/env nix-shell +#! nix-shell -i bash -p dosfstools ntfs3g parted util-linux zfs + +# Script to automatically Create, Label, Format and Mount Partitions # + +partition_disk() { + read -rp "Enter Path to Disk: /dev/" DISK + if [ -z "$DISK" ] + then + error "Path to Disk cannot be empty. If unsure, use the command 'fdisk -l'" + fi + echo "Creating Partitions..." + parted /dev/"$DISK" -- mkpart ESP fat32 1MiB 1024MiB + parted /dev/"$DISK" -- set 1 esp on + mkfs.fat -F 32 /dev/disk/by-partlabel/ESP + parted /dev/"$DISK" -- mkpart primary 1025MiB -8GiB + parted /dev/"$DISK" -- name 2 System + parted /dev/"$DISK" -- mkpart primary linux-swap -8GiB 100% + parted /dev/"$DISK" -- name 3 swap + mkswap /dev/disk/by-partlabel/swap + mkdir -p /mnt +} + +create_ext4() { + echo "Creating 'EXT4' Partition..." + mkfs.ext4 /dev/disk/by-partlabel/System +} + +mount_ext4() { + echo "Mounting 'EXT4' Partition..." + mount /dev/disk/by-partlabel/System /mnt +} + +create_zfs() { + echo "Creating 'ZFS' Volumes..." + zpool create -f fspool -o compression=zstd /dev/disk/by-partlabel/System + zfs create -p -o mountpoint=legacy -o xattr=sa -o acltype=posixacl fspool/system/root + zfs snapshot fspool/system/root@blank + zfs create -o mountpoint=legacy -o atime=off fspool/system/nix + zfs create -p -o mountpoint=legacy -o xattr=sa -o acltype=posixacl -o com.sun:auto-snapshot=true fspool/data + zfs create -o canmount=off -o refreservation=1G fspool/reserve # Use 'zfs set refreservation=none fspool/reserve' to free space +} + +mount_zfs() { + echo "Mounting 'ZFS' Volumes..." + zpool import -f fspool + mount -t zfs fspool/system/root /mnt + mkdir -p /mnt/{nix,data} + mount -t zfs fspool/system/nix /mnt/nix + mount -t zfs fspool/data /mnt/data +} + +mount_other() { + echo "Mounting Other Partitions..." + mkdir -p /mnt/boot + mount -t vfat /dev/disk/by-partlabel/ESP /mnt/boot + swapoff --all + swapon /dev/disk/by-partlabel/swap +} + +unmount_all () { + echo "Unmounting All Partitions..." + umount -l /mnt + zpool export fspool +} diff --git a/scripts/pci.sh b/scripts/pci.sh @@ -0,0 +1,13 @@ +#! /usr/bin/env nix-shell +#! nix-shell -i bash -p coreutils + +# Shows PCI Devices mapped to IOMMU Groups # + +for group in $(find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V) +do + echo "IOMMU Group ""${group##*/}"":" + for device in "$group"/devices/* + do + echo -e "\t$(lspci -nns "${device##*/}")" + done +done diff --git a/secrets/.sops.yaml b/secrets/.sops.yaml @@ -0,0 +1,17 @@ +keys: + - &v7 8C240C0C11293EE56260601CCF616EB19C2765E4 + - &navya B141E0D9F711DD86DEAE1269D9B023AB01B68EFE +creation_rules: + - path_regex: secrets/.*$ + key_groups: + - pgp: + - *v7 + - path_regex: modules/apps/git/secrets/.*$ + key_groups: + - pgp: + - *v7 + - path_regex: modules/user/passwords/.*$ + key_groups: + - pgp: + - *v7 + - *navya diff --git a/secrets/README.md b/secrets/README.md @@ -0,0 +1,3 @@ +### Credentials + +The authentication credentials are managed using [`sops-nix`](https://github.com/Mic92/sops-nix) at `secrets`. The [`sops`](https://github.com/mozilla/sops) encrypted secrets (using GPG authentication) are stored at multiple places, like in this directory, as well as [`modules/user/passwords`](../modules/user/passwords). User passwords are made using the command `mkpasswd -m sha-512` and specified using the `passwordFile` option. The `sops` encrypted secrets are of `binary` format (and have the extension `.secret`) and can be conveniently managed using the [`nixos`](../scripts/README.md) `secret` command. The `keys` directory contains the *public* User GPG Keys which are automatically imported diff --git a/secrets/cachix-token.secret b/secrets/cachix-token.secret @@ -0,0 +1,21 @@ +{ + "data": "ENC[AES256_GCM,data:hdeoh9xKNZtrSf3y6PxxY5FdrRaPOmOMBwsEQDxjh781uEXV5dxtJCe3TPL4ArVQnnA0d27VlfMICjPLpZBd3OVUEUbOayFieIl2Xvp5P0GnQPaGkoN3aVkPlMfTOBPtTSekbQaeHq1oqVDpN0IDT3lWlo5wVlx9MTpsvEz1b50+1SW6f+ePqHOWMS35evx+IvTlv+uDXjb82FK93QEsK0Debqb3blo=,iv:Fiq5eY+ysKFR2AIhvh9PTO+4qpBmM4d1DfmCruIrMcA=,tag:GLFQzSLAoVoVahNRFM7E1Q==,type:str]", + "sops": { + "kms": null, + "gcp_kms": null, + "azure_kv": null, + "hc_vault": null, + "age": null, + "lastmodified": "2021-12-01T08:27:22Z", + "mac": "ENC[AES256_GCM,data:7PgLUR58Jmx2GapoEs/dJ/L09ppvNTQEQWnkYQ+KLB/tO6feYD3jR97XK4f9i1wj3D+YvFba6qpJ+3ggctv1PfBHaED+2K7wDd7uXfJ+RcBAuPAVJQrmfADMMZculZBeY3/VO8c5mWldU5kh7aN7qUocMeu2gDWR/IYcvp5FaX8=,iv:IUZy2/Mrk5kwClymgSZSCGxNo07R+455amwFkW8UB68=,tag:PqJdUaYJ4nrCYujreVleBg==,type:str]", + "pgp": [ + { + "created_at": "2021-12-01T07:02:42Z", + "enc": "-----BEGIN PGP MESSAGE-----\n\nhQIMA5HNgftiFxX/AQ//XK4htI0CoiNwR3YYovs9vut7oW6izsN2dTqnVWZSV0uY\nhi6BVDd5gJTa4jo6Oo6JrN0CgDPqxAim2pd2Hh+x81vbMYeptk2O4rfkqVZcU3js\nH8GhBy5qR9JQK9K70v/61hzQHeVcGyGsZhkLh7ptXVeLWHLQ2XUBDlcy/mANK7wt\nSskrIHegvLQgV0+fPu0onOMylQ4jvzMj8OVDU559cMBnUSltVpEV/j0d84+wr1fN\nHOnAqzxEjgV15dR9+DwIVJi06yOPms5kSCM4hs+qyvVNZ7e4tkzedtWqjd2sHOtG\nB0nJ0IHkPCiN/Fga9soHBrEH9L7sBR9vY+/FJghRpyRr5dWlsFPXq6hLf0p9oja/\nfeseWq2EfpRctCqK9CURNyVj56PzA+vRJSt+ugKslurlXry5svRW5p7rZDTfA2VN\npNFxCBGTctUBvj0MzGUXJEfpGXDqfhY61F4KbTC8VD5ZTXM+mMhtAXcuZgu0wRjx\nlfdAhNIYRvX6sHsPjFJSI8NUT6N8IYHb+iZi9KQf0Pb0cVlDkgOQb0drTJ3jdSOX\nTZsh/+tc4flKY7IGI44oK/SB1lY8u+ZV2S/nQvbUwNsA+afX99qkvnwbU4mjAmUD\n51kH6UGjDbX42VShqF03njwX0Bi2jJdc6Tmk9S/gZ2wn7BJzoM1PEBivpFZh+3zS\nXgFc0/FMFn27cSNf1bH9E2CYywwYA0Cc7/jT3S5kOAiGPoNhMu6IBYGtOxuYTzhl\n7Q8JxLfjgMmX3A2k4TkGWWNrYWdChdDrplvX1dFrGAFljhiPPFlItNWWGTMpnmA=\n=Qclf\n-----END PGP MESSAGE-----\n", + "fp": "8C240C0C11293EE56260601CCF616EB19C2765E4" + } + ], + "unencrypted_suffix": "_unencrypted", + "version": "3.7.1" + } +} +\ No newline at end of file diff --git a/secrets/default.nix b/secrets/default.nix @@ -0,0 +1,29 @@ +{ + lib, + inputs, + pkgs, + files, + ... +}: +with {inherit (lib) mkForce util;}; { + imports = [inputs.sops.nixosModules.sops]; + + ## Authentication Credentials Management ## + config = { + environment = { + persist.dirs = [files.gpg]; + systemPackages = [pkgs.sops]; + }; + + sops = { + # Encrypted Secrets + secrets = util.map.secrets ./. false; + + # GPG Key Import + gnupg = { + home = files.gpg; + sshKeyPaths = mkForce []; + }; + }; + }; +} diff --git a/secrets/keys/.gitattributes b/secrets/keys/.gitattributes @@ -0,0 +1 @@ +*.gpg binary +\ No newline at end of file diff --git a/secrets/keys/navya.gpg b/secrets/keys/navya.gpg @@ -0,0 +1,51 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBGH6mIABEADnIm78DzYnHGho6hcQfFV/YJLfGxXj96Pb8epRgll7dOHrK1JI +G8dA6LpZFSEjpP2jkdvK+mTBgjOAAGY2j72gVCIJibT5B805RI+nLYydIbyFnV2N +0tfKtqTdUxZ2LWKR29K72ySLEF7BJOCFXd5opo2/fPxoG4I6TCSWEl7pIB/2C8wt +kdgnW1JLlP3ZcQFK/LXMVVKap1btARbM/dcvMaNrbevxwxbIzeiYH+ffC1CfmXfY +/o23/MKjjxxaePF79MATNL9al+MQt+86bG/jAMByYGEyi8HpDorkLt+JXLgGxcyI +wbtTpm9owSBa94hriYTKHFrcA8YlyrEfZUDMmqDP1GGXsrmWFeI7nkl2MgZm0xUh +h9z38S+rC2KYqC1Cfns5wy/GAppMsHRyeB8QTrtFKLLr+irB4nHkfgs1BZgfi8j2 +/BxuepYwG6CxDBWsyfO/nvaNfKzazuw1+h3nHQ8KUh0KN7gkZmQfWvEtgZtKdOt4 +A6ejrqgu67AKiaiPJhpD6c9gfYJk+5hznopKo2142uhMX71N038jm5sZ9ZAYv1uN +5L70TDoRGE+WhPKHSDjxBDBlLQ1taxaTa40sGGzVpoajgFn5Ia1vtZ9EMVaYAs5E +771st3axMecTxH4C8ep4srXfWjysW11qNsRkIEjRD1xTyq8VXfjS5VFHQQARAQAB +tBtuYXZ5YSA8Z25hdnlhMDA5QGdtYWlsLmNvbT6JAk4EEwEIADgWIQSxQeDZ9xHd +ht6uEmnZsCOrAbaO/gUCYfqYgAIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAK +CRDZsCOrAbaO/o6HD/4uH3tXdspju+3L89toZL1EUIZCZ6cfttm+WzaAwLgfBURM +2i8PIFMz4ABhMeA0zrKqkoYRhoyZ/43He57yjyupLaLYmkxznAAgFaCQS/GWZKW9 +5fPua0Hu4PGiKldVMu3bwqb2VDSzj3nbu1FfOpDihqWlBQTLEJbJI3xhAJHMbFYf +lfibbiMOv1dHsB7QuY6kcUnG32FQ4Gd5LCkPNpNzrCPOUADzlHeFlHjBUfOZRgD5 +mX5IsZFYeI7vOEsSpgUiAB7Z5w2XVnOsbbFlZA8Ut02tVmiRf2ufazPs09K0mlj9 +w3ybuhSZqIZfAsiz+oNRsbeylCQdLeVSho1LfwvsuwaA4mCMJpdXY2Frs8XUS/9d +EavTopIiDoWEuYPRraIO7+SCoRqq2pWsg++NwRvSW2ISvIqw/hmiR96HtMSBAEgy +7druQlrJ1gEJUN09CANGB2HLC84YmT2fstTnseiihVmculQzQ4xFrkC0Heh+V12B +umiVaolT1HESPR5zbjv6kSnBczMjQKrLcsivBFnz/gTCDfgIiiPN9sUYdgf0wHLd +Ds6rkT/lbB5nc2g+JLVhoRgjfHZ1Vs3A+aptz4ae4v8r7pvQmICEH0yXXUsBJ/BO +wtvhRPcQTdc+89Ht5FYC679SsIfkNq4rbgovYWHaf4j8MAjQiBCwBk54PrgBkrkC +DQRh+piAARAAw3+U3kOkxAHqbytVv80U2b8Ou36L7Ai+ED20BNiu7EFpUE99LjfO +2Yt7VruCoWfqtFxIERK5ukdIc4earQ1T0yxGkKlw9u7XY+xQUfd4AViPpK6rYF7l +bIIm2Hsb2i64tl0MBHpI6U8925sEKuLtwjR1GT/QBhyIxcYQt1NsaIZ3hnsLgMhB +uYIM9S/S6vGg3ZPUFJWDt5lEdHyam/vIjU5RXczWPgE6FcrgeKx8Dw9epDWX2Y+z +rWlQ3QOfYmOPITwQ+A9GC8nhHBhdpqVnpcfa1OkaDtt+jwvtbcnBy5aYFxAqa9C0 +bGpAskvque594DgZU5MtKATs7+g1KUfEvfcF32c6XVIG2JwgR1DeMO7EMegUK2zL +K+gYaBzETZlqhfHN1aucY2RjnCvGCtVDSWxsW4mANAf1OMV5RA0r0MuBV4yuZ9XI +XzAzy15Kr06PjhUI7x+Pi6hhDWz3gHcnHpxTTjMSE1AgqY0eGAg9L5czIGLp6l6Q +A+//BI5GUQjIiXsAgA1n4bb6FzLlN40bn5H4/Z9yfo9RgSQ0hHtEoNVBzWmLzL9I +7ObVm318b1l5YUyDDg+rpBEzOZTKUCVtKO1AF8G6qALv+Camb7xedCuh0KADEaAN +2HGzA07wB4M0KFXSkiVfKibp7KHbZkua/pdjyMtC1pEO9yvIAcziJAsAEQEAAYkC +NgQYAQgAIBYhBLFB4Nn3Ed2G3q4SadmwI6sBto7+BQJh+piAAhsMAAoJENmwI6sB +to7+b7IQAKICMFazmevw2pgb+5QAara6LiZMtczHTU6FUPZt8JM2Vf82FOCMRWll +0EXQRKtP48eeMAi5MoZBYnfx8TbWOu6XSqI+4N0o0Y3lO/XAfp4pu8RPdbBM5RFk +0SKDjIcinOZg0QjsDr6RozonUQbcweA7ysqnptRtgGoq+99ZPuH6+X5iMOhIdYYF +MrHhRopKGa/Z+iYxSYySv3IAh1OI2CxMS9/ljaASp4rYIcr/VAVCZe98UeR6CC+B +TgzVWEpbUT5Wrt02+xafzsgokCUu6qv62LaV6eN1nNbU1SMtN1a8ifaQivLfwtFK ++vBIVXDDkM+qEp22m3e1hRbIbIScqGY0XM86GsKq5bK3sw5OFz478Xo8B/9whhG2 +f7Xq5ECj/03WGXg87hzIst0/Gzqu1pW0zfjiwmG26ZAvEHqCEMFzcHv0/tY6T38y +Wd6ddSoJnhEA69VOS/nVmmVd9tUGKDqzJp76XLec54ogYQAlXCnO1kfOizHSeb8+ +UEHB81qjIn/NvVus10COk3RnwLeT3K2ihSBARM47MxoMyFcrVHr3GwBWt2wj76fL +yBjuA2j+Br/YXmLKFZ88akp3QKGm8C1ZFONNonnBNNj62mij6GpLPlBBvjF9A6VJ +lyjEhkdIsa9M0Wso1B1O02ICCDdpWZw+ghSkFSeA2W1lasRKsUZi +=VN9c +-----END PGP PUBLIC KEY BLOCK----- diff --git a/secrets/keys/v7.gpg b/secrets/keys/v7.gpg @@ -0,0 +1,51 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBGF34ngBEADvYPWzSzc8b5Ki5NcKfVTNyhG52GeEtbY8XqqozWjxRCUtclWm +hJX1ftLbInJQz7NYUzgtUOJzz+3eFNgtM8No8oarQ7/Z7/wAJZZ8d6kfPvmKMOdR +zZGttiInaHYPS9tmivRlt6ur5KG/6zBhspBocMsWiK4LXte4pvgOylvdb8Nf82v9 +kuDsrfi/tVhudLAkznaK7G/xq0aIyZyCFU9Rpv++6CJVV5AIsNpE91D/BuCFhmfW +w04GXaYkbeV9qKOmOSVHIach10ooGVvA1kWOwUuLTNcaaN8puv168sMRrN//l37P +QZ2PLzw+bZjOUPVgvxoU0MrKRI1BXARlaj+2d6t1NMVlPdEcSUt9KC+vf9RoUK+V +3rGKcDuj9l25J64s2XiBE0uHeSbC9kS5wExc4V52eUutRXNLtsIll37veDV+7wWh +wFaXozFopMidpYxAwOZ5lzhHTlmkc2CGTDQego6TItcf8mPELfwIz0RgZZMC9u8o +pWl5J4d2EA/gtagL/KnMopW3XCCqo4xyWVPJIzDOyTjzYE0bC/Mt1uNqva9Czt1l +1W8wiuV5v+PiEfYIReGSILHDN8hcuL/tZLCQ9xWIWTrYiaSBctKe4eKbrn34cTD4 +L/8frUKdeQ+S49rVox5llMNNaK/cURRuzJOdGto2N2Z2ZZuXL4AEWgQ91QARAQAB +tB1tYXlkYXl2NyA8bWF5ZGF5djdAZ21haWwuY29tPokCTgQTAQgAOBYhBIwkDAwR +KT7lYmBgHM9hbrGcJ2XkBQJhd+J4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheA +AAoJEM9hbrGcJ2XkOp8P/2d3dGlLhhgeqN8J1zzJzXyo1bIa2/JH33MFC/CCItvG +67jludlTZMxu7KOBHvpWffq+AmI9iFjkaLwOtGLyOfVhZ6tOTAznKGm44t6fETC0 +N9/DO/lbVzdf8xwifbFjmvqIz7htnVb8sqrDFELDaJHtr0N/k5BaWYVXLXQHs87y +L2YohATIedITB5fBAeRPaBpiCvd+ofe10TsOzMCBaswrDnQdMBoGx+Af4JSZ+aq8 +34HBBKsXtujb37rWmgcCRkl9tWapClEOwEoqPsIp2aUoEGErqOIrVJWbA9jkEgmQ +iiJugQtX904DrJa40eIJMflF19AD3174udZAxvAJMzA+YIJzb1DH4cTckrx0D4fX +BvElozGUJkbqPeyxy6LoM1+hDq+wwjiiOIMVucYYae8B2IiaFzihadxXo9yh/Lhs +tbUwNZ8NiSM/pTX+PHZK9Jm0tkQFFgOM/SBNSmMhh1wlxsDt0uqXIQ5zCF5LgX2D +gSBSYTu51k85W3cr9J9dMuFU3JXWh1YhJ4uSCBwtIPBIAqJf1hv/jSOPByzB1KjT +fc+Yt/woB//VQrZ6AtQ7j7ye1ybfZz3GxCM3A70vOJvDuMx4SOmeMqsAeGwFEyJR +4sjfFc94n6ltomKrLTXfB5vx387L8ZvhME1fXwW4tL1Tjl0myPymTpuqUDJPFvtU +uQINBGF34ngBEAC+o8CiiNtXhkfOlGqx0JxEcg94Tfny4XQWvYxy5Ztavp8Ukchc +tOi1vYtBIBLO6K6Cy8+e9YKFakLCjKzilLYGRNPLdodXl2nFm/0TiwccRKgu19uD +Z/RapuxdA4aUjN4rW/t+IB0/5fNKCHLpGLhYuuZW2WSG2GfokIxh4kvWuhxwdjBg +Qxu48lPZC7DD+170TQzLHJ//gPZuSl9Hy1EoGC3/vjmxEMdixtm5YdFOvLg7IuR9 +zW5hQkCqbOuxgK+iw/jXctFyE9jlsPXEN35i1Fa/Gx2zOon3tXK3qLD+yAN657E+ +Z8T6wdKUjFOEV3gasV0v/0P/GkPnI5ytM43IHsFBbL8phxWijEtI1z9UthH7TeZq +benXBqL3qepLQi/hUFbGu4f4RhAoEhCCaxpxthB5aK4ozTva7tTbVvkdMotC70TT +uqoiY8+WYiOXt4lEYh4xiHeJQOL5xSypqGstP6kF/VIFQKgqLIAG/cmZOkFw+I+a +S7JC9Y1ZpNvNO22vxGI+5yqeCX1vZCeYMI9zzwuI+Amysp6WGuyNznZ10WcuJ5Tb +t9Oc9M0D6oiFVG226nTu6fYh0Rmp4cZiuS6qbqxxJwtITziI5S5fzqXHlKWLdsgs +Nr6+pBsLzIdI/6JsewMag2LoqYz9VPmgm0qKaZ3vp4AWp7p5OafUyE7g5QARAQAB +iQI2BBgBCAAgFiEEjCQMDBEpPuViYGAcz2FusZwnZeQFAmF34ngCGwwACgkQz2Fu +sZwnZeQuMA/+NwDr4KkdPDHG96L8huTS79EBO7n9l6Cl1a8iC7X57KjWt7WLQcaI +VQdGM6UF8Vw484Q8HOqhWh+kYpdIAvfkOuNXevOI9IlhH0U8w0fuFcrnUD9uPjMO +munKV+8M0SxVvvTVxlkUflT7EBX/T6aZTYZztJf0l82JWI//eA0e/6ahgOpTu7e2 +cAZcVB8qI0F19Gwe/C1WzeKRjLBbeFOPz86ceJqznfZ7J3huF3PZOtPeeczalpNj +TpyxSbl6XjM4uttxB7XEHeqeMbSea0Rrpm/2/gFaRaYeD9VpHsGlRJ+TZjyxyDHq +bURcxdbgeEJwIyNie0TAGIeejlk4TWfxTlqbJ7NlASKoxqcNtePa/Oal4pINdVdZ +/S0gYVLFfb++EU079Obg92sjKxZxvBiLLYcK3ozgFIYwiTqYX2rzy2sQxa9qUu5V +dxgdmSKQLN/ELcSc3zzB0pg1ysKFbahrlGlTsDWjGhlueFLOXzOUE1KAFJZdzFjT +honnoRoJqc1uXVM55fxhEqi/Pqb2eENL0DU3+GwqHDdpeylMj0/fXs8OM9Bl0A1N +je7oeYgvGjZQhaf9YySIGFou7J/CdoSWAVIQflIYs1pMG5ghPoW7R5UsOmKcZtK4 +E6eYgM9qiv9VXlC9WbtQB2fOktHL3beGfstZ0PI8RBhOM3itXcGNXaA= +=EAj4 +-----END PGP PUBLIC KEY BLOCK----- diff --git a/shells/.envrc b/shells/.envrc @@ -0,0 +1 @@ +eval "$(lorri direnv --shell-file default.nix)" diff --git a/shells/cc.nix b/shells/cc.nix @@ -0,0 +1,6 @@ +pkgs: { + name = "C"; + shellHook = ''echo "## C/C++ Development Shell ##"''; + LIBCLANG_PATH = "${pkgs.llvmPackages.libclang}/lib"; + packages = with pkgs; [clang cmake gcc gdb bear llvmPackages.libcxx]; +} diff --git a/shells/default.nix b/shells/default.nix @@ -0,0 +1,10 @@ +{pkgs ? import ../., ...}: +with pkgs; + mkShell { + name = "devShell"; + packages = [git gnupg jq sops] ++ [figlet neofetch]; + shellHook = '' + echo -e "\e[36m## Default Developer Shell ##" + echo -e "\e[34m Version: $(nix --version)" + ''; + } diff --git a/shells/format.nix b/shells/format.nix @@ -0,0 +1,11 @@ +pkgs: { + name = "Formatter"; + shellHook = ''echo "## Formatting Shell ##"''; + packages = with pkgs; [ + unstable.alejandra + nix-linter + nodePackages.prettier + shellcheck + statix + ]; +} diff --git a/shells/go.nix b/shells/go.nix @@ -0,0 +1,5 @@ +pkgs: { + name = "Go"; + shellHook = ''echo "## Go Development Shell ##"''; + packages = with pkgs; [go delve go-outline goimports godef golint gopls]; +} diff --git a/shells/java.nix b/shells/java.nix @@ -0,0 +1,17 @@ +pkgs: { + name = "Java"; + packages = with pkgs; [jdk nodejs scala sbt yarn]; + shellHook = '' + echo "## Java Development Shell ##" + + NPM_DIR="$XDG_DATA_HOME/npm" + mkdir "$NPM_DIR" + echo -e "cache=$XDG_CACHE_HOME/npm\nprefix=$XDG_DATA_HOME/npm" > "$NPM_DIR/config" + export NPM_CONFIG_USERCONFIG="$NPM_DIR/config" + export NPM_CONFIG_CACHE="$XDG_CACHE_HOME/npm" + export NPM_CONFIG_TMP="$XDG_RUNTIME_DIR/npm" + export NPM_CONFIG_PREFIX="$XDG_CACHE_HOME/npm" + export NODE_REPL_HISTORY="$XDG_CACHE_HOME/node/repl_history" + export PATH=$PATH:"$(yarn global bin)" + ''; +} diff --git a/shells/lisp.nix b/shells/lisp.nix @@ -0,0 +1,5 @@ +pkgs: { + name = "Lisp"; + shellHook = ''echo "## Lisp Development Shell ##"''; + packages = with pkgs; [sbcl lispPackages.quicklisp]; +} diff --git a/shells/lua.nix b/shells/lua.nix @@ -0,0 +1,5 @@ +pkgs: { + name = "Lua"; + shellHook = ''echo "## Lua Development Shell ##"''; + packages = with pkgs; [lua luaPackages.moonscript]; +} diff --git a/shells/python.nix b/shells/python.nix @@ -0,0 +1,24 @@ +pkgs: { + name = "Python"; + packages = with pkgs; + with python39Packages; [ + python39 + ipython + pip + poetry + pylint + setuptools + ]; + + shellHook = '' + echo "## Python Development Shell ##" + + PYTHON_DIR="$XDG_DATA_HOME/python" + export PYTHONSTARTUP="$PYTHON_DIR/pythonrc"; + export PIP_CONFIG_FILE="$PYTHON_DIR/pip/pip.conf"; + export PIP_LOG_FILE="$PYTHON_DIR/pip/log"; + export PYLINTHOME="$PYTHON_DIR/pylint"; + export PYLINTRC="$PYTHON_DIR/pylint/pylintrc"; + export IPYTHONDIR="$PYTHON_DIR/ipython"; + ''; +} diff --git a/shells/rust.nix b/shells/rust.nix @@ -0,0 +1,13 @@ +pkgs: { + name = "Rust"; + packages = with pkgs; [rustup]; + RUST_BACKTRACE = 1; + shellHook = '' + echo "## Rust Development Shell ##" + + RUST_DIR="$XDG_DATA_HOME/rust" + export RUSTUP_HOME="$RUST_DIR/rustup" + export CARGO_HOME="$RUST_DIR/cargo" + export PATH=$PATH:"$CARGO_HOME/bin" + ''; +} diff --git a/shells/video.nix b/shells/video.nix @@ -0,0 +1,13 @@ +pkgs: { + name = "Video"; + shellHook = ''echo "## Video Editing Shell ##"''; + packages = with pkgs; [ + audacity + blender + ffmpeg + handbrake + mpv + obs-studio + youtube-dl + ]; +} diff --git a/users/README.md b/users/README.md @@ -0,0 +1,3 @@ +### Users + +The `users` directory contains the individual user-specific configurations for multiple users (of a single PC or multiple ones). To add a new user, simply create a configuration file for it (name of the file/directory must be the same as the `username` of the user) and write down the configuration using the `home-manager` module [options](https://mipmip.github.io/home-manager-option-search/). The configuration is automatically imported by `lib.build`, if present diff --git a/users/default.nix b/users/default.nix @@ -0,0 +1,87 @@ +{ + config, + lib, + ... +}: let + inherit (builtins) attrValues map; + inherit (lib) id mkIf mkOption types util; + cfg = config.credentials.key; +in { + options.credentials = { + name = mkOption { + description = "Work User Name"; + type = types.str; + default = config.home.username; + }; + + fullname = mkOption { + description = "Full User Name"; + type = types.str; + default = "Default User"; + }; + + mail = mkOption { + description = "User Mail ID"; + type = types.str; + default = ""; + example = "user@email.com"; + }; + + key = mkOption { + description = "User GPG Key"; + type = types.str; + default = ""; + example = "Use 'gpg --list-signatures --keyid-format short'"; + }; + }; + + ## Home Configuration ## + config = { + # GPG Settings + programs.gpg = { + settings = mkIf (cfg.key != "") { + default-key = cfg.key; + default-recipient-self = true; + auto-key-locate = "local,wkd,keyserver"; + keyserver = "hkps://keys.openpgp.org"; + auto-key-retrieve = true; + auto-key-import = true; + keyserver-options = "honor-keyserver-url"; + }; + + publicKeys = map (source: { + inherit source; + trust = "ultimate"; + }) (attrValues (util.map.files ../secrets/keys id ".gpg")); + }; + + # XDG Configuration + xdg = { + enable = true; + mime.enable = true; + mimeApps.enable = true; + configFile."mimeapps.list".force = true; + + # User Home Directories + userDirs = { + enable = true; + createDirectories = true; + desktop = "$HOME/Desktop"; + documents = "$HOME/Documents"; + download = "$HOME/Downloads"; + music = "$HOME/Music"; + pictures = "$HOME/Pictures"; + publicShare = "$HOME/Public"; + templates = "$HOME/Templates"; + videos = "$HOME/Videos"; + + # Custom Directories + extraConfig = { + XDG_TBD_DIR = "$HOME/Documents/TBD"; + XDG_PROJECTS_DIR = "$HOME/Projects"; + XDG_SCREENSHOTS_DIR = "$HOME/Pictures/Screenshots"; + }; + }; + }; + }; +} diff --git a/users/navya.nix b/users/navya.nix @@ -0,0 +1,11 @@ +{files, ...}: { + # Credentials + credentials = { + fullname = "Navya G"; + mail = "gnavya009@gmail.com"; + key = "B141E0D9F711DD86DEAE1269D9B023AB01B68EFE"; + }; + + # Profile Picture + home.file.".face".source = files.images.profile; +} diff --git a/users/v7.nix b/users/v7.nix @@ -0,0 +1,30 @@ +{ + config, + pkgs, + files, + ... +}: +with files; { + # Credentials + credentials = { + name = "maydayv7"; + fullname = "V7"; + mail = "maydayv7@gmail.com"; + key = "8C240C0C11293EE56260601CCF616EB19C2765E4"; + }; + + # Home Configuration + home = { + packages = [pkgs.home-manager]; + + # Directory Symlinks + file = { + # Profile Picture + ".face".source = images.profile; + + # Dotfiles + "Projects/dotfiles".source = + config.lib.file.mkOutOfStoreSymlink path.system; + }; + }; +}