diff options
Diffstat (limited to '.root/etc')
-rw-r--r-- | .root/etc/default/grub | 73 | ||||
-rw-r--r-- | .root/etc/mkinitcpio.conf | 26 | ||||
-rw-r--r-- | .root/etc/pacman.conf | 73 | ||||
-rw-r--r-- | .root/etc/pacman.d/mirrorlist-archzfs | 13 | ||||
-rw-r--r-- | .root/etc/profile | 48 | ||||
-rwxr-xr-x | .root/etc/profile.d/aliases.sh | 12 | ||||
-rwxr-xr-x | .root/etc/profile.d/proxy.sh | 42 | ||||
-rwxr-xr-x | .root/etc/profile.d/var.sh | 11 | ||||
-rwxr-xr-x | .root/etc/sing-box/json_to_libconfig.py | 62 | ||||
-rwxr-xr-x | .root/etc/sing-box/libconfig_to_json.py | 63 |
10 files changed, 423 insertions, 0 deletions
diff --git a/.root/etc/default/grub b/.root/etc/default/grub new file mode 100644 index 0000000..9afe514 --- /dev/null +++ b/.root/etc/default/grub @@ -0,0 +1,73 @@ +# GRUB boot loader configuration + +GRUB_DEFAULT="Arch Linux, with Linux linux-custom" +GRUB_TIMEOUT="5" +GRUB_DISTRIBUTOR="Arch" +# GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 video=DP-3:2560x1440 video=HDMI-5:1920x1080" +GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 nvidia_drm.modeset=1" +GRUB_CMDLINE_LINUX="zfs_import_dir=/dev/" + +# Preload both GPT and MBR modules so that they are not missed +GRUB_PRELOAD_MODULES="part_gpt part_msdos" + +GRUB_CONFIG="/boot/efi/archlinux/x68_64-efi/grub/grub.cfg" + +# Uncomment to enable booting from LUKS encrypted devices +#GRUB_ENABLE_CRYPTODISK="y" + +GRUB_SAVEDEFAULT="false" +GRUB_DEFAULT="default" + +# Set to 'countdown' or 'hidden' to change timeout behavior, +# press ESC key to display menu. +GRUB_TIMEOUT_STYLE="menu" + +# Uncomment to use basic console +# GRUB_TERMINAL_INPUT="gfxterm" + +# Uncomment to disable graphical terminal +# GRUB_TERMINAL_OUTPUT="gfxterm" + +GRUB_TERMINAL="gfxterm" + +# The resolution used on graphical terminal +# note that you can use only modes which your graphic card supports via VBE +# you can see them in real GRUB with the command `videoinfo' +# GRUB_GFXMODE="saved" +# GRUB_GFXMODE="auto" +GRUB_GFXMODE="1920x1080" + +# Uncomment to allow the kernel use the same resolution used by grub +# GRUB_GFXPAYLOAD_LINUX=keep + +# Uncomment if you want GRUB to pass to the Linux kernel the old parameter +# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx" +#GRUB_DISABLE_LINUX_UUID="true" + +# Uncomment to disable generation of recovery mode menu entries +GRUB_DISABLE_RECOVERY="true" + +# Uncomment and set to the desired menu colors. Used by normal and wallpaper +# modes only. Entries specified as foreground/background. +# export GRUB_COLOR_NORMAL="light-blue/black" +# export GRUB_COLOR_HIGHLIGHT="light-cyan/green" + +# Uncomment one of them for the gfx desired, a image background or a gfxtheme +#GRUB_BACKGROUND="/path/to/wallpaper" +GRUB_THEME="/boot/efi/archlinux/x86_64-efi/grub/themes/SilverWolf/theme.txt" + +# Uncomment to get a beep at GRUB start +#GRUB_INIT_TUNE="480 440 1" + +# Uncomment to make GRUB remember the last selection. This requires +# setting 'GRUB_DEFAULT=saved' above. +#GRUB_SAVEDEFAULT="true" + +# Uncomment to disable submenus in boot menu +#GRUB_DISABLE_SUBMENU="y" + +# Probing for other operating systems is disabled for security reasons. Read +# documentation on GRUB_DISABLE_OS_PROBER, if still want to enable this +# functionality install os-prober and uncomment to detect and include other +# operating systems. +GRUB_DISABLE_OS_PROBER="false" diff --git a/.root/etc/mkinitcpio.conf b/.root/etc/mkinitcpio.conf new file mode 100644 index 0000000..7aa184a --- /dev/null +++ b/.root/etc/mkinitcpio.conf @@ -0,0 +1,26 @@ +# vim:set ft=sh + +# MODULES=(zfs nvidia nvidia_modeset nvidia_uvm nvidia_drm) +MODULES=(zfs nvidia nvidia_modeset nvidia_uvm nvidia_drm) + +BINARIES=() + +FILES=() + +# see wiki.archlinux.org +HOOKS=(base udev autodetect modconf keyboard keymap kms consolefont block zfs filesystems usr fsck) + +# COMPRESSION +COMPRESSION="zstd" +#COMPRESSION="gzip" +#COMPRESSION="bzip2" +#COMPRESSION="lzma" +#COMPRESSION="xz" +#COMPRESSION="lzop" +#COMPRESSION="lz4" + +# COMPRESSION_OPTIONS +#COMPRESSION_OPTIONS=() + +# Decompress kernel modules during initramfs creation. +MODULES_DECOMPRESS="yes" diff --git a/.root/etc/pacman.conf b/.root/etc/pacman.conf new file mode 100644 index 0000000..45ad4ea --- /dev/null +++ b/.root/etc/pacman.conf @@ -0,0 +1,73 @@ +# /etc/pacman.conf +# See the pacman.conf(5) manpage for option and repository directives + +[options] +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = auto + +IgnorePkg = linux linux-headers grub +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +Color +#NoProgressBar +CheckSpace +#VerbosePkgLists +ParallelDownloads = 7 + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. + +[core] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +[multilib] +Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs + +#[archzfs-testing] +#Include = /etc/pacman.d/mirrorlist-archzfs + +[archzfs] +Include = /etc/pacman.d/mirrorlist-archzfs diff --git a/.root/etc/pacman.d/mirrorlist-archzfs b/.root/etc/pacman.d/mirrorlist-archzfs new file mode 100644 index 0000000..dff4ce6 --- /dev/null +++ b/.root/etc/pacman.d/mirrorlist-archzfs @@ -0,0 +1,13 @@ +## See https://github.com/archzfs/archzfs/wiki +## France +Server = https://archzfs.com/$repo/$arch + +## Germany +Server = https://mirror.sum7.eu/archlinux/archzfs/$repo/$arch +Server = https://mirror.biocrafting.net/archlinux/archzfs/$repo/$arch + +## India +Server = https://mirror.in.themindsmaze.com/archzfs/$repo/$arch + +## United States +Server = https://zxcvfdsa.com/archzfs/$repo/$arch diff --git a/.root/etc/profile b/.root/etc/profile new file mode 100644 index 0000000..21d183c --- /dev/null +++ b/.root/etc/profile @@ -0,0 +1,48 @@ +# /etc/profile + +# Append "$1" to $PATH when not already in. +# This function API is accessible to scripts in /etc/profile.d +append_path () { + case ":$PATH:" in + *:"$1":*) + ;; + *) + PATH="${PATH:+$PATH:}$1" + esac +} + +# Append default paths +append_path '/usr/local/sbin' +append_path '/usr/local/bin' +append_path '/usr/bin' + +export PATH + +# Load profiles from /etc/profile.d +if test -d /etc/profile.d/; then + for profile in /etc/profile.d/*.sh; do + test -r "$profile" && . "$profile" + done + unset profile +fi + +# bash completion test +if test -f /etc/bash_completion; then + . /etc/bash_completion +fi + +# Source global bash config, when interactive but not posix or sh mode +if test "$BASH" &&\ + test "$PS1" &&\ + test -z "$POSIXLY_CORRECT" &&\ + test "${0#-}" != sh &&\ + test -r /etc/bash.bashrc +then + . /etc/bash.bashrc +fi + +# Termcap is outdated, old, and crusty, kill it. +unset TERMCAP + +# Man is much better than us at figuring this out +unset MANPATH diff --git a/.root/etc/profile.d/aliases.sh b/.root/etc/profile.d/aliases.sh new file mode 100755 index 0000000..6b87e3f --- /dev/null +++ b/.root/etc/profile.d/aliases.sh @@ -0,0 +1,12 @@ + +alias ls="ls --color" +alias fucking=sudo +alias nv=nvim +alias copy="xclip -selection clipboard" +alias md=mkdir +alias ""="g++" +alias cargo-test="cargo test -- --nocapture" +# dotfiles +alias config='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME' +# proxy control to set env variables +alias proxyctl=". /usr/local/bin/proxyctl" diff --git a/.root/etc/profile.d/proxy.sh b/.root/etc/profile.d/proxy.sh new file mode 100755 index 0000000..b6bbc45 --- /dev/null +++ b/.root/etc/profile.d/proxy.sh @@ -0,0 +1,42 @@ +# set environmental variables + +function proxy-enable() { + R_="http://127.0.0.1:2080" + S_="https://127.0.0.1:2080" + export HTTP_PROXY="${R_}" + export FTP_PROXY="${R_}" + export HTTPS_PROXY="${S_}" + export http_proxy="${R_}" + export ftp_proxy="${R_}" + export https_proxy="${S_}" + + # set gsettings + gsettings set org.gnome.system.proxy mode manual + for i in http https ftp; do + gsettings set org.gnome.system.proxy.$i host 127.0.0.1 + gsettings set org.gnome.system.proxy.$i port 2080 + done + + export PROXY_ON_JCG=true + echo "proxy enabled" +} +alias proxy-on=proxy-enable + +function proxy-disable() { + unset HTTP_PROXY FTP_PROXY HTTPS_PROXY http_proxy ftp_proxy https_proxy + export -n HTTP_PROXY FTP_PROXY HTTPS_PROXY http_proxy ftp_proxy https_proxy + gsettings reset org.gnome.system.proxy mode + + unset PROXY_ON_JCG + echo "proxy disabled" +} +alias proxy-off=proxy-disable + +function proxy-toggle() { + if [ -z $PROXY_ON_JCG ]; then + proxy-enable + else + proxy-disable + fi +} + diff --git a/.root/etc/profile.d/var.sh b/.root/etc/profile.d/var.sh new file mode 100755 index 0000000..95ad714 --- /dev/null +++ b/.root/etc/profile.d/var.sh @@ -0,0 +1,11 @@ + +# editor +export SUDO_EDITOR=/usr/bin/nvim +export EDITOR=/usr/bin/nvim +export VISUAL=/usr/bin/nvim + +# miscellaneous +RUST_BACKTRACE=full +CXX=/usr/bin/clang++ + + diff --git a/.root/etc/sing-box/json_to_libconfig.py b/.root/etc/sing-box/json_to_libconfig.py new file mode 100755 index 0000000..da56415 --- /dev/null +++ b/.root/etc/sing-box/json_to_libconfig.py @@ -0,0 +1,62 @@ +#!/bin/env /pyenv/bin/python3 + +import argparse +import json +import libconf + +ENDC = "\033[0m" +BOLD = "\033[1m" +UNDERLINE = "\033[4m" +BLACK = "\033[30m" +RED = "\033[31m" +GREEN = "\033[32m" +YELLOW = "\033[33m" +BLUE = "\033[34m" +MAGENTA = "\033[35m" +CYAN = "\033[36m" +WHITE = "\033[37m" +BG_BLACK = "\033[40m" +BG_RED = "\033[41m" +BG_GREEN = "\033[42m" +BG_YELLOW = "\033[43m" +BG_BLUE = "\033[44m" +BG_MAGENTA = "\033[45m" +BG_CYAN = "\033[46m" +BG_WHITE = "\033[47m" + +def json_to_libconfig(json_file, libconfig_file): + try: + with open(json_file, 'r') as f: + data = json.load(f) + converted_data = convert_data(data) + except Exception as e: + print(e) + print(f"{RED}Error: Could not read input file '{json_file}'.{ENDC}") + exit(1) + + try: + with open(libconfig_file, 'w') as f: + f.write(libconf.dumps(converted_data)) + except Exception as e: + print(converted_data) + print(e) + print(f"{RED}Error: Could not write to output file '{libconfig_file}'.{ENDC}") + exit(1) + +def convert_data(data): + if isinstance(data, dict): + return {key: convert_data(value) for key, value in data.items()} + elif isinstance(data, list): + return tuple([convert_data(item) for item in data]) + else: + return data + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Convert json to libconfig") + parser.add_argument("i", help="JSON file to be converted") + parser.add_argument("o", help="output file location") + args = parser.parse_args() + json_file = args.i + libconfig_file = args.o + json_to_libconfig(json_file, libconfig_file) + print(f"{GREEN}Converted JSON to libconfig: {libconfig_file}{ENDC}") diff --git a/.root/etc/sing-box/libconfig_to_json.py b/.root/etc/sing-box/libconfig_to_json.py new file mode 100755 index 0000000..7300a7e --- /dev/null +++ b/.root/etc/sing-box/libconfig_to_json.py @@ -0,0 +1,63 @@ +#!/bin/env /pyenv/bin/python3 + +import argparse +import json +from libconf import load + +ENDC = "\033[0m" +BOLD = "\033[1m" +UNDERLINE = "\033[4m" +BLACK = "\033[30m" +RED = "\033[31m" +GREEN = "\033[32m" +YELLOW = "\033[33m" +BLUE = "\033[34m" +MAGENTA = "\033[35m" +CYAN = "\033[36m" +WHITE = "\033[37m" +BG_BLACK = "\033[40m" +BG_RED = "\033[41m" +BG_GREEN = "\033[42m" +BG_YELLOW = "\033[43m" +BG_BLUE = "\033[44m" +BG_MAGENTA = "\033[45m" +BG_CYAN = "\033[46m" +BG_WHITE = "\033[47m" + +def convert_libconf_to_json(input_file, output_file): + try: + with open(input_file, 'r') as f: + config = load(f) + except Exception as e: + print(e) + print(f"{RED}Error: Could not read input file '{input_file}'.{ENDC}") + exit(1) + + json_data = _convert_data(config) + + try: + with open(output_file, 'w') as f: + json.dump(json_data, f, indent=4) + except Exception as e: + print(e) + print(f"{RED}Error: Could not write to output file '{output_file}'.{ENDC}") + exit(1) + + print(f"{GREEN}Successfully converted '{input_file}' to '{output_file}'.{ENDC}") + + +def _convert_data(data): + if isinstance(data, dict): + return {key: _convert_data(value) for key, value in data.items()} + elif isinstance(data, list): + return [_convert_data(item) for item in data] + else: + return data + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Convert libconfig file to JSON") + parser.add_argument("i", help="Path to the libconfig file") + parser.add_argument("o", help="Path to the output JSON file") + args = parser.parse_args() + convert_libconf_to_json(args.i, args.o) |