From 871d3f95963eac25765427ecca9a8e4812071439 Mon Sep 17 00:00:00 2001 From: ene Date: Wed, 1 Feb 2023 21:33:11 +0100 Subject: Feat: Split the config apart --- hosts/IDOHVE/configuration.nix | 9 +- hosts/IDOHVE/gpu.nix | 17 --- hosts/IDOHVE/hardware.nix | 85 -------------- hosts/IDOHVE/hardware/boot.nix | 32 ++++++ hosts/IDOHVE/hardware/cpu.nix | 4 + hosts/IDOHVE/hardware/filesystems.nix | 41 +++++++ hosts/IDOHVE/hardware/gpu.nix | 16 +++ hosts/IDOHVE/hardware/hardware.nix | 19 +++ services/custom_cursor.sh | 40 ------- services/nix.nix | 18 --- services/nix/nix.nix | 18 +++ services/printing/printing.nix | 4 + services/services.nix | 7 ++ services/zsh-init.sh | 38 ------ services/zsh-prompt.sh | 63 ---------- services/zsh.nix | 130 --------------------- services/zsh/custom_cursor.sh | 40 +++++++ services/zsh/zsh-init.sh | 38 ++++++ services/zsh/zsh-prompt.sh | 63 ++++++++++ services/zsh/zsh.nix | 130 +++++++++++++++++++++ system/locale/locale.nix | 26 +++++ system/packages.conf | 211 ---------------------------------- system/packages.nix | 86 -------------- system/packages/packages.conf | 211 ++++++++++++++++++++++++++++++++++ system/packages/packages.nix | 86 ++++++++++++++ system/sound/sound.nix | 18 +++ system/system.nix | 8 ++ system/users.nix | 17 --- system/users/users.nix | 17 +++ 29 files changed, 781 insertions(+), 711 deletions(-) delete mode 100644 hosts/IDOHVE/gpu.nix delete mode 100644 hosts/IDOHVE/hardware.nix create mode 100644 hosts/IDOHVE/hardware/boot.nix create mode 100644 hosts/IDOHVE/hardware/cpu.nix create mode 100644 hosts/IDOHVE/hardware/filesystems.nix create mode 100644 hosts/IDOHVE/hardware/gpu.nix create mode 100644 hosts/IDOHVE/hardware/hardware.nix delete mode 100644 services/custom_cursor.sh delete mode 100644 services/nix.nix create mode 100644 services/nix/nix.nix create mode 100644 services/printing/printing.nix create mode 100644 services/services.nix delete mode 100644 services/zsh-init.sh delete mode 100644 services/zsh-prompt.sh delete mode 100644 services/zsh.nix create mode 100644 services/zsh/custom_cursor.sh create mode 100644 services/zsh/zsh-init.sh create mode 100644 services/zsh/zsh-prompt.sh create mode 100644 services/zsh/zsh.nix create mode 100644 system/locale/locale.nix delete mode 100644 system/packages.conf delete mode 100644 system/packages.nix create mode 100644 system/packages/packages.conf create mode 100644 system/packages/packages.nix create mode 100644 system/sound/sound.nix create mode 100644 system/system.nix delete mode 100644 system/users.nix create mode 100644 system/users/users.nix diff --git a/hosts/IDOHVE/configuration.nix b/hosts/IDOHVE/configuration.nix index a3cf2b2c..e9ddc69d 100644 --- a/hosts/IDOHVE/configuration.nix +++ b/hosts/IDOHVE/configuration.nix @@ -7,15 +7,12 @@ ... }: { imports = [ - ./hardware.nix - ./gpu.nix + ./hardware/hardware.nix ./networking.nix - ../../system/packages.nix - ../../system/users.nix + ../../system/system.nix - ../../services/nix.nix - ../../services/zsh.nix + ../../services/services.nix ]; diff --git a/hosts/IDOHVE/gpu.nix b/hosts/IDOHVE/gpu.nix deleted file mode 100644 index 6796d04b..00000000 --- a/hosts/IDOHVE/gpu.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: { - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; # TODO - - hardware.opengl.extraPackages = with pkgs; [ - rocm-opencl-icd # open-cl - amdvlk # or directly through mesa - amd-media-driver # libva - ]; - - # Force radv, TODO is this logical? - environment.variables.AMD_VULKAN_ICD = "RADV"; -} diff --git a/hosts/IDOHVE/hardware.nix b/hosts/IDOHVE/hardware.nix deleted file mode 100644 index be55c07c..00000000 --- a/hosts/IDOHVE/hardware.nix +++ /dev/null @@ -1,85 +0,0 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: let - main_disk = "/dev/disk/by-uuid/"; -in { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") # TODO is this necessary? - ]; - - boot = { - initrd = { - compressor = "lz4"; - compressorArgs = ["-9"]; - - # TODO check this: - availableKernelModules = ["xhci_pci" "nvme" "rtsx_pci_sdmmc"]; - }; - - kernelModules = ["kvm-amd"]; - kernelPackages = pkgs.linuxPackages_latest; - loader = { - grub = { - enable = true; - version = 2; - theme = pkgs.nixos-grub2-theme; - splashImage = ./grub_boot_image.png; - efiSupport = true; - device = "nodev"; # TODO add this - }; - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot"; - }; - }; - }; - - fileSystems = { - "/" = { - device = "none"; - fsType = "tmpfs"; - options = ["defaults" "size=2G" "mode=755"]; - }; - "/nix" = { - device = main_disk; - fsType = "btrfs"; - options = ["subvol=@nix" "compress-force=zstd:9"]; - }; - "/boot" = { - device = "/dev/disk/by-uuid/"; - fsType = "vfat"; - }; - - "/srv/home" = { - device = main_disk; - fsType = "btrfs"; - options = ["subvol=@home" "compress-force=zstd:9"]; - }; - "/srv/nixos-config" = { - device = main_disk; - fsType = "btrfs"; - options = ["subvol=@nixos-config" "compress-force=zstd:9"]; - }; - - "/etc/nixos" = { - device = "/srv/nix-config"; - options = ["bind"]; - }; - "/home" = { - device = "/srv/home"; - options = ["bind"]; - }; - }; - - swapDevices = []; - - - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; -} - diff --git a/hosts/IDOHVE/hardware/boot.nix b/hosts/IDOHVE/hardware/boot.nix new file mode 100644 index 00000000..932155a4 --- /dev/null +++ b/hosts/IDOHVE/hardware/boot.nix @@ -0,0 +1,32 @@ +{ + config, + pkgs, + ... +}: { + boot = { + initrd = { + compressor = "lz4"; + compressorArgs = ["-9"]; + + # TODO check this: + availableKernelModules = ["xhci_pci" "nvme" "rtsx_pci_sdmmc"]; + }; + + kernelModules = ["kvm-amd"]; + kernelPackages = pkgs.linuxPackages_latest; + loader = { + grub = { + enable = true; + version = 2; + theme = pkgs.nixos-grub2-theme; + splashImage = ./grub_boot_image.png; + efiSupport = true; + device = "nodev"; # only for efi + }; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; + }; + }; + }; +} diff --git a/hosts/IDOHVE/hardware/cpu.nix b/hosts/IDOHVE/hardware/cpu.nix new file mode 100644 index 00000000..5d61d02f --- /dev/null +++ b/hosts/IDOHVE/hardware/cpu.nix @@ -0,0 +1,4 @@ +{config, ...}: { + powerManagement.cpuFreqGovernor = "powersave"; + hardware.cpu.amd.updateMicrocode = true; # Why not? +} diff --git a/hosts/IDOHVE/hardware/filesystems.nix b/hosts/IDOHVE/hardware/filesystems.nix new file mode 100644 index 00000000..a188df18 --- /dev/null +++ b/hosts/IDOHVE/hardware/filesystems.nix @@ -0,0 +1,41 @@ +{config, ...}: let + main_disk = "/dev/disk/by-uuid/"; +in { + fileSystems = { + "/" = { + device = "none"; + fsType = "tmpfs"; + options = ["defaults" "size=2G" "mode=755"]; + }; + "/nix" = { + device = main_disk; + fsType = "btrfs"; + options = ["subvol=@nix" "compress-force=zstd:9"]; + }; + "/boot" = { + device = "/dev/disk/by-uuid/"; + fsType = "vfat"; + }; + + "/srv/home" = { + device = main_disk; + fsType = "btrfs"; + options = ["subvol=@home" "compress-force=zstd:9"]; + }; + "/srv/nixos-config" = { + device = main_disk; + fsType = "btrfs"; + options = ["subvol=@nixos-config" "compress-force=zstd:9"]; + }; + + "/etc/nixos" = { + device = "/srv/nix-config"; + options = ["bind"]; + }; + "/home" = { + device = "/srv/home"; + options = ["bind"]; + }; + }; + swapDevices = []; +} diff --git a/hosts/IDOHVE/hardware/gpu.nix b/hosts/IDOHVE/hardware/gpu.nix new file mode 100644 index 00000000..49197c2b --- /dev/null +++ b/hosts/IDOHVE/hardware/gpu.nix @@ -0,0 +1,16 @@ +{ + config, + pkgs, + lib, + ... +}: { + + hardware.opengl.extraPackages = with pkgs; [ + rocm-opencl-icd # open-cl + amdvlk # or directly through mesa + amd-media-driver # libva + ]; + + # Force radv, TODO is this logical? + environment.variables.AMD_VULKAN_ICD = "RADV"; +} diff --git a/hosts/IDOHVE/hardware/hardware.nix b/hosts/IDOHVE/hardware/hardware.nix new file mode 100644 index 00000000..20e4c4f3 --- /dev/null +++ b/hosts/IDOHVE/hardware/hardware.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}:{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") # TODO is this necessary? + ./cpu.nix + ./gpu.nix + ./boot.nix + ./filesystems.nix + ]; + + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} + diff --git a/services/custom_cursor.sh b/services/custom_cursor.sh deleted file mode 100644 index 9a6da012..00000000 --- a/services/custom_cursor.sh +++ /dev/null @@ -1,40 +0,0 @@ -# Change cursor shape for different vi modes. -function zle-keymap-select { - if [[ ${KEYMAP} == vicmd ]] || - [[ $1 = 'block' ]]; then - echo -ne '\e[1 q' - elif [[ ${KEYMAP} == main ]] || - [[ ${KEYMAP} == viins ]] || - [[ ${KEYMAP} = '' ]] || - [[ $1 = 'beam' ]]; then - echo -ne '\e[5 q' - fi -} -zle -N zle-keymap-select - -# ci", ci', ci`, di", etc -autoload -U select-quoted -zle -N select-quoted -for m in visual viopp; do - for c in {a,i}{\',\",\`}; do - bindkey -M $m $c select-quoted - done -done - -# ci{, ci(, ci<, di{, etc -autoload -U select-bracketed -zle -N select-bracketed -for m in visual viopp; do - for c in {a,i}${(s..)^:-'()[]{}<>bB'}; do - bindkey -M $m $c select-bracketed - done -done - -zle-line-init() { - zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) - echo -ne "\e[5 q" -} -zle -N zle-line-init - -echo -ne '\e[5 q' # Use beam shape cursor on startup. -precmd() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. diff --git a/services/nix.nix b/services/nix.nix deleted file mode 100644 index b94cfc95..00000000 --- a/services/nix.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: { - nix = { - gc = { - automatic = true; - dates = "daily"; - options = "--delete-older-than 3"; - }; - settings = { - auto-optimise-store = true; - experimental-features = ["nix-command" "flakes"]; - }; - }; -} diff --git a/services/nix/nix.nix b/services/nix/nix.nix new file mode 100644 index 00000000..b94cfc95 --- /dev/null +++ b/services/nix/nix.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + pkgs, + ... +}: { + nix = { + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 3"; + }; + settings = { + auto-optimise-store = true; + experimental-features = ["nix-command" "flakes"]; + }; + }; +} diff --git a/services/printing/printing.nix b/services/printing/printing.nix new file mode 100644 index 00000000..d178e3b6 --- /dev/null +++ b/services/printing/printing.nix @@ -0,0 +1,4 @@ +{config, ...}: { + # Enable CUPS to print documents. + services.printing.enable = true; +} diff --git a/services/services.nix b/services/services.nix new file mode 100644 index 00000000..27e5086f --- /dev/null +++ b/services/services.nix @@ -0,0 +1,7 @@ +{config, ...}: { + imports = [ + ./zsh/zsh.nix + ./printing/printing.nix + ./nix/nix.nix + ]; +} diff --git a/services/zsh-init.sh b/services/zsh-init.sh deleted file mode 100644 index bc9af87a..00000000 --- a/services/zsh-init.sh +++ /dev/null @@ -1,38 +0,0 @@ -# If not running interactively, don't do anything -[[ $- != *i* ]] && return - -# Flex on the ubuntu users -[ "$NVIM" ] || neofetch || hyfetch -#loginctl show-session $XDG_SESSION_ID - -## Enable colors and change prompt: -#autoload -Uz colors && colors -#autoload -Uz compinit && compinit -u -## Edit line in vim buffer ctrl-v -#autoload -Uz edit-command-line; zle -N edit-command-line -## Enter vim buffer from normal mode -#autoload -Uz edit-command-line && zle -N edit-command-line - -## zstyles -#zstyle ':completion:*' menu select -## Auto complete with case insensitivity -#zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' - -#zmodload zsh/complist -#fpath+=/home/dt/.config/zsh/comp -#compinit -#_comp_options+=(globdots) # Include hidden files. -# -## Source configs -#source "${ZDOTDIR}/ali.sh" -#source "${ZDOTDIR}/prompt.sh" -#source "${ZDOTDIR}/hotkeys.sh" -source "./${path_custom_cursor}" -#source ~/.local/lib/shell/lib -# -## Load zsh-syntax-highlighting -#source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -## Suggest aliases for commands -#source /usr/share/zsh/plugins/zsh-you-should-use/you-should-use.plugin.zsh -# -##eval "$(lua ~/scripts/z.lua --init zsh enhanced)" diff --git a/services/zsh-prompt.sh b/services/zsh-prompt.sh deleted file mode 100644 index 1f0f164b..00000000 --- a/services/zsh-prompt.sh +++ /dev/null @@ -1,63 +0,0 @@ -#vim:ft=zsh -_command_time_preexec() { - timer=${timer:-$SECONDS} -} - -_command_time_precmd() { - PROMPT_TMP_DIR=$(mktemp) - if [ $timer ]; then - ts=$(($SECONDS - $timer)) - tts=$ts - mi=0 - ho=0 - if [ $ts -ge 3 ];then - while [ $ts -ge 60 ];do - ts=$((ts-60)) - mi=$((mi+1)) - done - - while [ $mi -ge 60 ];do - mi=$((mi-60)) - ho=$((ho+1)) - done - - if [ $tts -ge 3600 ];then - out=$(printf '%dh %dm %ds\n' $ho $mi $ts) - elif [ $tts -ge 60 ];then - out=$(printf '%dm %ds\n' $mi $ts) - elif [ $tts -lt 60 ];then - out=$(printf '%ds\n' $ts) - fi - - export psvar[1]="took $(printf '%s ' "$out")" - echo $psvar[1] > $PROMPT_TMP_DIR - fi - - unset timer - unset ts - unset tts - unset mi - unset ho -fi -} - -_command_ro_precmd() { -if ! [ -w $(pwd) ];then - echo " " -fi -} - -preexec_functions+=(_command_time_preexec) -precmd_functions+=(_command_time_precmd) - -blue="14" -red="9" -white="15" -setopt PROMPT_SUBST -export PROMPT='%(?.%F{$blue}.%F{$red})%B%3~%(!. %F{$red}as root %f. )%F{$white}$(if [ -n $PROMPT_TMP_DIR ];then cat $PROMPT_TMP_DIR; rm $PROMPT_TMP_DIR;fi)%f%(?.%F{$blue}.%F{$red})%F{$red}$(_command_ro_precmd)%F{$blue}❯ %b%f' -export RPROMPT='' - -#%(2V.%F{$red}%2v%f$(export psvar[2]="") .) - -# TODO: -# Add git support diff --git a/services/zsh.nix b/services/zsh.nix deleted file mode 100644 index b194ab6b..00000000 --- a/services/zsh.nix +++ /dev/null @@ -1,130 +0,0 @@ -{ - config, - pkgs, - ... -}: let - path_config_cursor = builtins.writeFile ./custom_cursor; -in { - programs.zsh = { - enable = true; - zsh-autoenv = { - enable = true; - }; - syntaxHighlighting = { - enable = true; - }; - shellAliases = { - ls = "ls -a --color=auto"; - ll = ". ll"; - pip = "pip --require-virtualenv"; - hisea = "history info | grep"; - - mocp = "mocp -M \"$XDG_CONFIG_HOME\"/moc"; - yarn = "yarn --use-yarnrc \"$XDG_CONFIG_HOME\"/yarn/config"; - }; - setOptions = [ - "AUTO_CD" - "AUTO_PUSHD" - "CHASE_DOTS" - - "ALWAYS_TO_END" - - "EXTENDED_HISTORY" - "HIST_ALLOW_CLOBBER" - "HIST_VERIFY" - "HIST_FCNTL_LOCK" - - "DVORAK" - "CORRECT" - - "PROMPT_SUBST" - "TRANSIENT_RPROMPT" # maybe? - - "COMBINING_CHARS" - "VI" - ]; - - promptInit = - builtins.readFile ./zsh-prompt.sh; - loginShellInit = '' - eval $(ssh-agent -s) > /dev/null # start ssh agent - export ENHANCHED_NEOFETCH="$(pacman -Qn | wc -l) (pacman), $(pacman -Qm | wc -l) (aur), $(($(cargo install --list | wc -l ) / 2)) (cargo)" - ''; - interactiveShellInit = builtins.readFile ./zsh-init.sh; - histSize = 9999999; - histFile = "$XDG_DATA_HOME/zsh/history"; - autosuggentions = { - enable = true; - }; - }; - - environment = { - variables = { - XDG_DATA_HOME = "$HOME/.local/share"; - XDG_STATE_HOME = "$HOME/.local/state"; - XDG_CACHE_HOME = "$HOME/.cache"; - XDG_CONFIG_HOME = "$HOME/.config"; - XDG_BIN_HOME = "\${HOME}/.local/bin"; - - HISTSIZE = "9000000"; - TIMEFMT = "'$fg[green]%J$reset_color' time: $fg[blue]%*Es$reset_color, cpu: $fg[blue]%P$reset_color"; # no idea what this does or why it is needed - REPORTTIME = "10"; - - PATH = [ - "\${PATH}:/home/dt/repos/shell/scripts" - "/home/dt/.local/bin" - "/home/dt/.local/share/cargo/bin/" - ]; - EDITOR = "nvim"; - IVIEWER = "imv"; - READER = "zathura"; - VISUAL = "nvim"; - CODEEDITOR = "nvim"; - TERMINAL = "alacritty"; - BROWSER = "firefox"; - COLORTERM = "truecolor"; - PAGER = "less"; - WM = "river"; - AWMWALLPAPER = "/home/dt/media/pictures/tes/wallpapers-linux_cast/Dedicated_Colorschemes/nord/Abstract-Nord.png"; - - # FUNCNEST for more functions in functions - FUNCNEST = "2000"; - - WALLPAPERDIR = "$HOME/media/pictures/wallpapers/"; - LESS = "R"; - MANPAGER = "less -R --use-color -Dd+r -Du+b"; - LIBVIRT_DEFAULT_URI = "qemu:///system"; - BEMENU_SCALE = "1.5"; - BEMENU_BACKEND = "wayland"; - BEMENU_OPTS = "--fn 'Source Code Pro 10' -c -l 30 -B 1 -W 0.9 --hf #ffffff"; - - # Clean the home dir {{{ - _JAVA_OPTIONS = "-Djava.util.prefs.userRoot=$XDG_CONFIG_HOME/java -Djavafx.cachedir = \"$XDG_CACHE_HOME/openjfx\""; - GRADLE_USER_HOME = "\"$XDG_DATA_HOME\"/gradle"; - CARGO_HOME = "\"$XDG_DATA_HOME\"/cargo"; - GNUPGHOME = "\"$XDG_DATA_HOME\"/gnupg"; - GOPATH = "\"$XDG_DATA_HOME\"/go"; - GTK2_RC_FILES = "\"$XDG_CONFIG_HOME\"/gtk-2.0/gtkrc"; - LESSHISFILE = "\"$XDG_CACHE_HOME\"/less/history"; - LESSKEYIN = "\"$XDG_CONFIG_HOME\"/less/lesskey"; - RUSTUP_HOME = "\"$XDG_DATA_HOME\"/rustup"; - NPM_CONFIG_USERCONFIG = "\"$XDG_CONFIG_HOME\"/npm/npmrc"; - NUGET_PACKAGES = "\"$XDG_CACHE_HOME\"/NuGetPackages"; - PYTHONSTARTUP = "\"$XDG_CONFIG_HOME\"/python/pythonrc"; - XAUTHORITY = "\"$XDG_RUNTIME_DIR\"/Xauthority"; - COMPDUMPFILE = "\"$XDG_DATA_DIR\"/zsh/.zcompdump}"; - IPYTHONDIR = "\"$XDG_CONFIG_HOME\"/ipython"; - PARALLEL_HOME = "\"$XDG_CONFIG_HOME\"/parallel"; - STACK_XDG = "1"; - # }}} - - # Export Wayland env Vars {{{ - QT_QPA_PLATFORM = "wayland"; - QT_QPA_PLATFORMTHEME = "qt5ct"; # needs qt5ct - CLUTTER_BACKEND = "wayland"; - SDL_VIDEODRIVER = "wayland"; # might brake some things - MOZ_ENABLE_WAYLAND = "1"; - # }}} - }; - }; -} diff --git a/services/zsh/custom_cursor.sh b/services/zsh/custom_cursor.sh new file mode 100644 index 00000000..9a6da012 --- /dev/null +++ b/services/zsh/custom_cursor.sh @@ -0,0 +1,40 @@ +# Change cursor shape for different vi modes. +function zle-keymap-select { + if [[ ${KEYMAP} == vicmd ]] || + [[ $1 = 'block' ]]; then + echo -ne '\e[1 q' + elif [[ ${KEYMAP} == main ]] || + [[ ${KEYMAP} == viins ]] || + [[ ${KEYMAP} = '' ]] || + [[ $1 = 'beam' ]]; then + echo -ne '\e[5 q' + fi +} +zle -N zle-keymap-select + +# ci", ci', ci`, di", etc +autoload -U select-quoted +zle -N select-quoted +for m in visual viopp; do + for c in {a,i}{\',\",\`}; do + bindkey -M $m $c select-quoted + done +done + +# ci{, ci(, ci<, di{, etc +autoload -U select-bracketed +zle -N select-bracketed +for m in visual viopp; do + for c in {a,i}${(s..)^:-'()[]{}<>bB'}; do + bindkey -M $m $c select-bracketed + done +done + +zle-line-init() { + zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) + echo -ne "\e[5 q" +} +zle -N zle-line-init + +echo -ne '\e[5 q' # Use beam shape cursor on startup. +precmd() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. diff --git a/services/zsh/zsh-init.sh b/services/zsh/zsh-init.sh new file mode 100644 index 00000000..bc9af87a --- /dev/null +++ b/services/zsh/zsh-init.sh @@ -0,0 +1,38 @@ +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +# Flex on the ubuntu users +[ "$NVIM" ] || neofetch || hyfetch +#loginctl show-session $XDG_SESSION_ID + +## Enable colors and change prompt: +#autoload -Uz colors && colors +#autoload -Uz compinit && compinit -u +## Edit line in vim buffer ctrl-v +#autoload -Uz edit-command-line; zle -N edit-command-line +## Enter vim buffer from normal mode +#autoload -Uz edit-command-line && zle -N edit-command-line + +## zstyles +#zstyle ':completion:*' menu select +## Auto complete with case insensitivity +#zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + +#zmodload zsh/complist +#fpath+=/home/dt/.config/zsh/comp +#compinit +#_comp_options+=(globdots) # Include hidden files. +# +## Source configs +#source "${ZDOTDIR}/ali.sh" +#source "${ZDOTDIR}/prompt.sh" +#source "${ZDOTDIR}/hotkeys.sh" +source "./${path_custom_cursor}" +#source ~/.local/lib/shell/lib +# +## Load zsh-syntax-highlighting +#source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +## Suggest aliases for commands +#source /usr/share/zsh/plugins/zsh-you-should-use/you-should-use.plugin.zsh +# +##eval "$(lua ~/scripts/z.lua --init zsh enhanced)" diff --git a/services/zsh/zsh-prompt.sh b/services/zsh/zsh-prompt.sh new file mode 100644 index 00000000..1f0f164b --- /dev/null +++ b/services/zsh/zsh-prompt.sh @@ -0,0 +1,63 @@ +#vim:ft=zsh +_command_time_preexec() { + timer=${timer:-$SECONDS} +} + +_command_time_precmd() { + PROMPT_TMP_DIR=$(mktemp) + if [ $timer ]; then + ts=$(($SECONDS - $timer)) + tts=$ts + mi=0 + ho=0 + if [ $ts -ge 3 ];then + while [ $ts -ge 60 ];do + ts=$((ts-60)) + mi=$((mi+1)) + done + + while [ $mi -ge 60 ];do + mi=$((mi-60)) + ho=$((ho+1)) + done + + if [ $tts -ge 3600 ];then + out=$(printf '%dh %dm %ds\n' $ho $mi $ts) + elif [ $tts -ge 60 ];then + out=$(printf '%dm %ds\n' $mi $ts) + elif [ $tts -lt 60 ];then + out=$(printf '%ds\n' $ts) + fi + + export psvar[1]="took $(printf '%s ' "$out")" + echo $psvar[1] > $PROMPT_TMP_DIR + fi + + unset timer + unset ts + unset tts + unset mi + unset ho +fi +} + +_command_ro_precmd() { +if ! [ -w $(pwd) ];then + echo " " +fi +} + +preexec_functions+=(_command_time_preexec) +precmd_functions+=(_command_time_precmd) + +blue="14" +red="9" +white="15" +setopt PROMPT_SUBST +export PROMPT='%(?.%F{$blue}.%F{$red})%B%3~%(!. %F{$red}as root %f. )%F{$white}$(if [ -n $PROMPT_TMP_DIR ];then cat $PROMPT_TMP_DIR; rm $PROMPT_TMP_DIR;fi)%f%(?.%F{$blue}.%F{$red})%F{$red}$(_command_ro_precmd)%F{$blue}❯ %b%f' +export RPROMPT='' + +#%(2V.%F{$red}%2v%f$(export psvar[2]="") .) + +# TODO: +# Add git support diff --git a/services/zsh/zsh.nix b/services/zsh/zsh.nix new file mode 100644 index 00000000..78387f91 --- /dev/null +++ b/services/zsh/zsh.nix @@ -0,0 +1,130 @@ +{ + config, + pkgs, + ... +}: let + path_config_cursor = builtins.writeFile ./custom_cursor; +in { + programs.zsh = { + enable = true; + zsh-autoenv = { + enable = true; + }; + syntaxHighlighting = { + enable = true; + }; + shellAliases = { + ls = "ls -a --color=auto"; + ll = ". ll"; + pip = "pip --require-virtualenv"; + hisea = "history info | grep"; + + mocp = "mocp -M \"$XDG_CONFIG_HOME\"/moc"; + yarn = "yarn --use-yarnrc \"$XDG_CONFIG_HOME\"/yarn/config"; + }; + setOptions = [ + "AUTO_CD" + "AUTO_PUSHD" + "CHASE_DOTS" + + "ALWAYS_TO_END" + + "EXTENDED_HISTORY" + "HIST_ALLOW_CLOBBER" + "HIST_VERIFY" + "HIST_FCNTL_LOCK" + + "DVORAK" + "CORRECT" + + "PROMPT_SUBST" + "TRANSIENT_RPROMPT" # maybe? + + "COMBINING_CHARS" + "VI" + ]; + + promptInit = + builtins.readFile ./zsh-prompt.sh; + loginShellInit = '' + eval $(ssh-agent -s) > /dev/null # start ssh agent + export ENHANCHED_NEOFETCH="$(pacman -Qn | wc -l) (pacman), $(pacman -Qm | wc -l) (aur), $(($(cargo install --list | wc -l ) / 2)) (cargo)" + ''; + interactiveShellInit = builtins.readFile ./zsh-init.sh; + histSize = 9999999; + histFile = "$XDG_DATA_HOME/zsh/history"; + autosuggestions = { + enable = true; + }; + }; + + environment = { + variables = { + XDG_DATA_HOME = "$HOME/.local/share"; + XDG_STATE_HOME = "$HOME/.local/state"; + XDG_CACHE_HOME = "$HOME/.cache"; + XDG_CONFIG_HOME = "$HOME/.config"; + XDG_BIN_HOME = "\${HOME}/.local/bin"; + + HISTSIZE = "9000000"; + TIMEFMT = "'$fg[green]%J$reset_color' time: $fg[blue]%*Es$reset_color, cpu: $fg[blue]%P$reset_color"; # no idea what this does or why it is needed + REPORTTIME = "10"; + + PATH = [ + "\${PATH}:/home/dt/repos/shell/scripts" + "/home/dt/.local/bin" + "/home/dt/.local/share/cargo/bin/" + ]; + EDITOR = "nvim"; + IVIEWER = "imv"; + READER = "zathura"; + VISUAL = "nvim"; + CODEEDITOR = "nvim"; + TERMINAL = "alacritty"; + BROWSER = "firefox"; + COLORTERM = "truecolor"; + PAGER = "less"; + WM = "river"; + AWMWALLPAPER = "/home/dt/media/pictures/tes/wallpapers-linux_cast/Dedicated_Colorschemes/nord/Abstract-Nord.png"; + + # FUNCNEST for more functions in functions + FUNCNEST = "2000"; + + WALLPAPERDIR = "$HOME/media/pictures/wallpapers/"; + LESS = "R"; + MANPAGER = "less -R --use-color -Dd+r -Du+b"; + LIBVIRT_DEFAULT_URI = "qemu:///system"; + BEMENU_SCALE = "1.5"; + BEMENU_BACKEND = "wayland"; + BEMENU_OPTS = "--fn 'Source Code Pro 10' -c -l 30 -B 1 -W 0.9 --hf #ffffff"; + + # Clean the home dir {{{ + _JAVA_OPTIONS = "-Djava.util.prefs.userRoot=$XDG_CONFIG_HOME/java -Djavafx.cachedir = \"$XDG_CACHE_HOME/openjfx\""; + GRADLE_USER_HOME = "\"$XDG_DATA_HOME\"/gradle"; + CARGO_HOME = "\"$XDG_DATA_HOME\"/cargo"; + GNUPGHOME = "\"$XDG_DATA_HOME\"/gnupg"; + GOPATH = "\"$XDG_DATA_HOME\"/go"; + GTK2_RC_FILES = "\"$XDG_CONFIG_HOME\"/gtk-2.0/gtkrc"; + LESSHISFILE = "\"$XDG_CACHE_HOME\"/less/history"; + LESSKEYIN = "\"$XDG_CONFIG_HOME\"/less/lesskey"; + RUSTUP_HOME = "\"$XDG_DATA_HOME\"/rustup"; + NPM_CONFIG_USERCONFIG = "\"$XDG_CONFIG_HOME\"/npm/npmrc"; + NUGET_PACKAGES = "\"$XDG_CACHE_HOME\"/NuGetPackages"; + PYTHONSTARTUP = "\"$XDG_CONFIG_HOME\"/python/pythonrc"; + XAUTHORITY = "\"$XDG_RUNTIME_DIR\"/Xauthority"; + COMPDUMPFILE = "\"$XDG_DATA_DIR\"/zsh/.zcompdump}"; + IPYTHONDIR = "\"$XDG_CONFIG_HOME\"/ipython"; + PARALLEL_HOME = "\"$XDG_CONFIG_HOME\"/parallel"; + STACK_XDG = "1"; + # }}} + + # Export Wayland env Vars {{{ + QT_QPA_PLATFORM = "wayland"; + QT_QPA_PLATFORMTHEME = "qt5ct"; # needs qt5ct + CLUTTER_BACKEND = "wayland"; + SDL_VIDEODRIVER = "wayland"; # might brake some things + MOZ_ENABLE_WAYLAND = "1"; + # }}} + }; + }; +} diff --git a/system/locale/locale.nix b/system/locale/locale.nix new file mode 100644 index 00000000..2fcc2115 --- /dev/null +++ b/system/locale/locale.nix @@ -0,0 +1,26 @@ +{ + config, + pkgs, + ... +}: { + # Set your time zone. + time.timeZone = "Europe/Berlin"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + + # Configure console keymap + console.keyMap = "dvorak"; +} diff --git a/system/packages.conf b/system/packages.conf deleted file mode 100644 index 25f6ace8..00000000 --- a/system/packages.conf +++ /dev/null @@ -1,211 +0,0 @@ -# vim: ft=conf - # GUI - # Terminals - alacritty # terminal emulator - - # Browsers - firefox # web browser - ungoogled-chromium-xdg-bin # web browser (only for web programming) - - # Image manipulation - krita # new, and better (KDE) - gimp # conservative, and old (GNOME) - - # Social - mumble # voice chat software (client) - nheko-git # Matrix Desktop client - - # Misc - kalzium # Periodic Table of Elements - keepassxc # password manager - onlykey # OnlyKey Chrome Desktop App - steam # Valve's digital software delivery system - - # TUI/CLI - # Networking - # One-off things - #bind # A complete, highly portable implementation of the DNS protocol - #firewalld # Firewall daemon with D-Bus interface - #ngrep # A grep-like utility that allows you to search for network packets on an interface. - #openbsd-netcat # TCP/IP swiss army knife. OpenBSD variant. - # Misc - lftp # FTP client - openssh # SSH client - - # Eye candy - banner # Print large banners to ASCII terminals - cmatrix # A curses-based scrolling 'Matrix'-like screen - hyfetch # Neofetch with LGBTQ pride flags. - - # Backups - rclone # Sync files to and from Google Drive, S3, Swift, Cloudfiles, Dropbox and Google Cloud Storage - snapper # A tool for managing BTRFS and LVM snapshots. It can create, diff and restore snapshots and provides timelined auto-snapping. - snap-sync # Use snapper snapshots to backup to external drive - - # Misc - android-file-transfer # Android MTP client with minimalistic UI - docx2txt # Recovers text from DOCX files, with good formatting. - btop # Interactive process viewer (maybe better than htop) - ttf-sourcecodepro-nerd # Patched font Source Code Pro from nerd fonts library - xdg-ninja-git # A shell script which checks your $HOME for unwanted files and directories. - yokadi # Command line oriented, sqlite powered, todo list - - # WM - river # A dynamic tiling wayland compositor - - # CLI tools - lswt # List Wayland toplevels - wlopm # Wayland output power management. - wlr-randr # Utility to manage outputs - wl-clipboard # Command-line copy/paste utilities - gammastep # Adjust the color temperature of your screen according to your surroundings. - - # Components - yambar # status panel - swaybg # Wallpaper - mako # notification daemon - bemenu-wayland # Run prompt - - # Media - slurp # Select a region (used in the coordinates for grim/maim) - grim # Screenshot utility - #maim # Screenshot utility - wf-recorder # Screen recorder - - # Idle - swayidle # Idle management daemon - swaylock # Screen locker - - - # LF - lf # A terminal file manager inspired by ranger - - # Functions - broot # Fuzzy Search + tree + cd - dragon-drop # Simple drag-and-drop source/sink - trash-cli # Command line trashcan (recycle bin) interface - - # Previewer - chafa # Image-to-text converter - highlight # source code highlighter - mediainfo # Supplies technical and tag information about a video or audio file - w3m # Text-based Web browser as well as pager - ffmpegthumbnailer # video thumbnailer that can be used by file managers - - # Media - # Download - yt-dlp # A youtube-dl fork with additional features and fixes - #cclive # Commandline downloader for popular video websites. - - # Manipulate - ffmpeg # Complete solution to record, convert and stream audio and video - - # View - imv # Image viewer - mpv # media player - - # Listen - moc # An ncurses console audio player designed to be powerful and easy to use - pavucontrol # PulseAudio Volume Control - pipewire-alsa # Low-latency audio/video router and processor - ALSA configuration - pipewire-jack # Low-latency audio/video router and processor - JACK support - pipewire-pulse # Low-latency audio/video router and processor - PulseAudio replacement - - # Hardware - # Boot - efibootmgr # Linux user-space application to modify the EFI Boot Manager - grub # GNU GRand Unified Bootloader (2) - - # Storage - compsize # Calculate compression ratio of a set of files on Btrfs - smartmontools # Control and monitor S.M.A.R.T. enabled ATA and SCSI Hard Drives - - # Input - piper # GTK application to configure gaming mice - - # Printer - gutenprint # Top quality printer drivers for POSIX systems - sane-airscan # SANE - SANE backend for AirScan (eSCL) and WSD document scanners - - # CPU - cpupower # Linux kernel tool to examine and tune power saving related features of your processor - - # Zsh - zsh # A very advanced and programmable command interpreter (shell) for UNIX - zsh-syntax-highlighting # Fish shell like syntax highlighting for Zsh - # next one only works if your alias is only a command, e.g. if you `alias='cat some_file.txt &2> /dev/null'`, running `cat some_file.txt` won't trigger it. - # TODO find something better for this use case - # zsh-you-should-use # ZSH plugin that reminds you to use existing aliases for commands you just typed - - # Core Utils - file # File type identification utility - grep # A string search utility - sudo # Give certain users the ability to run some commands as root - wget # Network utility to retrieve files from the Web - which # A utility to show the full path of commands - - # File listers - tree # A directory listing program displaying a depth indented list of files - findutils # GNU utilities to locate files - fd # Simple, fast and user-friendly alternative to find - ripgrep # A search tool that combines the usability of ag with the raw speed of grep - - # {Un}Compressors - zip # Compressor/archiver for creating and modifying zipfiles - gzip # GNU compression utility - p7zip # Command-line file archiver with high compression ratio - unzip # For extracting and viewing files in .zip archives - - # Editors - ed # A POSIX-compliant line-oriented text editor - sed # GNU stream editor - vi # The original ex/vi text editor - neovim # Fork of Vim aiming to improve user experience, plugins, and GUIs - - # Programming - # General Tools - git # the fast distributed version control system - git-bug # Distributed, offline-first bug tracker embedded in git, with bridges - glow # Command-line markdown renderer - strace # A diagnostic, debugging and instructional userspace tracer - tokei # A blazingly fast CLOC (Count Lines Of Code) program - - # Rust - rustup # The Rust toolchain installer - rust-analyzer # Rust compiler front-end for IDEs - - # Yaml - yamllint # Linter for YAML files - - # TeX - zathura # Minimalistic document viewer - zathura-pdf-poppler # Adds pdf support to zathura by using the poppler engine - ltex-ls-bin # LTeX Language Server - biber # A Unicode-capable BibTeX replacement for biblatex users - pandoc # Conversion between markup formats - - # Web - vscode-langservers-extracted # Language servers extracted from VSCode. - dart-sass # Sass makes CSS fun again - prettier # An opinionated code formatter for JS, JSON, CSS, YAML and much more - - # Shell - dash # POSIX compliant shell that aims to be as small as possible - shellcheck # Shell script analysis tool - - # Lua - lua # Powerful lightweight programming language designed for extending applications - lua-format # LuaFormatter - Code formatter for Lua - lua-language-server # Lua Language Server coded by Lua - - # R - r # Language and environment for statistical computing and graphics - - -#expect # A tool for automating interactive applications -#handlr # Powerful alternative to xdg-utils written in Rust -#linux # The Linux kernel and modules -#linux-firmware # Firmware files for Linux -#packagekit-qt5 # Qt5 bindings for PackageKit -#vulkan-radeon # Radeon's Vulkan mesa driver -#xorg-bdftopcf # Convert X font from Bitmap Distribution Format to Portable Compiled Format diff --git a/system/packages.nix b/system/packages.nix deleted file mode 100644 index 1acba85e..00000000 --- a/system/packages.nix +++ /dev/null @@ -1,86 +0,0 @@ -{ - config, - pkgs, - ... -}: { - environment.systemPackages = with pkgs; [ - (builtins.readFile ./packages.conf) # TODO could work - ]; -} -# QEMU -# TEX -# {{{ -#adobe-source-han-sans-kr-fonts # Adobe Source Han Sans Subset OTF - Korean OpenType/CFF fonts -#alsa-utils # Advanced Linux Sound Architecture - Utilities -#element-desktop # Glossy Matrix collaboration client — desktop version. -#gawk # GNU version of awk -#gimp # GNU Image Manipulation Program -#git-lfs # Git extension for versioning large files -#gnome-epub-thumbnailer # Thumbnailer for EPub and MOBI books -#gnumeric # A GNOME Spreadsheet Program -#gpick # Advanced color picker written in C++ using GTK+ toolkit -#gradle # Powerful build system for the JVM -#groff # GNU troff text-formatting system -#jre11-openjdk-headless # OpenJDK Java 11 headless runtime environment -#klavaro # Free touch typing tutor program -#lifeograph # Private journal, diary and note taking application -#lynx # A text browser for the World Wide Web -#man-db # A utility for reading man pages -#networkmanager # Network connection manager and user applications -#nss-mdns # glibc plugin providing host name resolution via mDNS -#python-spotdl # Download your Spotify playlists and songs along with album art and metadata (from YouTube if a match is found). -#python-xlsx2csv # xlsx to csv converter -#ruff # An extremely fast Python linter, written in Rust -#signal-desktop # Signal Private Messenger for Linux -#slides # Terminal based presentation tool -#torbrowser-launcher # Securely and easily download, verify, install, and launch Tor Browser in Linux -#web-ext # A command line tool to help build, run, and test web extensions -#wkhtmltopdf # Command line tools to render HTML into PDF and various image formats -#xcursor-bluecurve # Redhat's Bluecurve X mouse cursor theme -# XORG -#xorg-docs # X.org documentations -#xorg-font-util # X.Org font utilities -#xorg-fonts-100dpi # X.org 100dpi fonts -#xorg-fonts-75dpi # X.org 75dpi fonts -#xorg-fonts-encodings # X.org font encoding files -#xorg-iceauth # ICE authority file utility -#xorg-mkfontscale # Create an index of scalable font files for X -#xorg-server # Xorg X server -#xorg-server-common # Xorg server common files -#xorg-server-devel # Development files for the X.Org X server -#xorg-server-xephyr # A nested X server that runs as an X application -#xorg-server-xnest # A nested X server that runs as an X application -#xorg-server-xvfb # Virtual framebuffer X server -#xorg-sessreg # Register X sessions in system utmp/utmpx databases -#xorg-setxkbmap # Set the keyboard using the X Keyboard Extension -#xorg-smproxy # Allows X applications that do not support X11R6 session management to participate in an X11R6 session -#xorg-x11perf # Simple X server performance benchmarker -#xorg-xauth # X.Org authorization settings program -#xorg-xbacklight # RandR-based backlight control application -#xorg-xcmsdb # Device Color Characterization utility for X Color Management System -#xorg-xcursorgen # Create an X cursor file from PNG images -#xorg-xdpyinfo # Display information utility for X -#xorg-xdriinfo # Query configuration information of DRI drivers -#xorg-xev # Print contents of X events -#xorg-xgamma # Alter a monitor's gamma correction -#xorg-xhost # Server access control program for X -#xorg-xinit # X.Org initialisation program -#xorg-xinput # Small commandline tool to configure devices -#xorg-xkbcomp # X Keyboard description compiler -#xorg-xkbevd # XKB event daemon -#xorg-xkbutils # XKB utility demos -#xorg-xkill # Kill a client by its X resource -#xorg-xlsatoms # List interned atoms defined on server -#xorg-xlsclients # List client applications running on a display -#xorg-xmodmap # Utility for modifying keymaps and button mappings -#xorg-xpr # Print an X window dump from xwd -#xorg-xrandr # Primitive command line interface to RandR extension -#xorg-xrdb # X server resource database utility -#xorg-xrefresh # Refresh all or part of an X screen -#xorg-xsetroot # Classic X utility to set your root window background to a given pattern or color -#xorg-xvinfo # Prints out the capabilities of any video adaptors associated with the display that are accessible through the X-Video extension -#xorg-xwayland # run X clients under wayland -#xorg-xwininfo # Command-line utility to print information about windows on an X server -#xorg-xwud # X Window System image undumping utility -# }}} - diff --git a/system/packages/packages.conf b/system/packages/packages.conf new file mode 100644 index 00000000..4d409077 --- /dev/null +++ b/system/packages/packages.conf @@ -0,0 +1,211 @@ +# vim: ft=conf + # GUI + # Terminals + alacritty # terminal emulator + + # Browsers + firefox # web browser + ungoogled-chromium-xdg-bin # web browser (only for web programming) + + # Image manipulation + krita # new, and better (KDE) + gimp # conservative, and old (GNOME) + + # Social + mumble # voice chat software (client) + nheko-git # Matrix Desktop client + + # Misc + kalzium # Periodic Table of Elements + keepassxc # password manager + onlykey # OnlyKey Chrome Desktop App + steam # Valve's digital software delivery system + + # TUI/CLI + # Networking + # One-off things + #bind # A complete, highly portable implementation of the DNS protocol + #firewalld # Firewall daemon with D-Bus interface + #ngrep # A grep-like utility that allows you to search for network packets on an interface. + #openbsd-netcat # TCP/IP swiss army knife. OpenBSD variant. + # Misc + lftp # FTP client + openssh # SSH client + + # Eye candy + banner # Print large banners to ASCII terminals + cmatrix # A curses-based scrolling 'Matrix'-like screen + hyfetch # Neofetch with LGBTQ pride flags. + + # Backups + rclone # Sync files to and from Google Drive, S3, Swift, Cloudfiles, Dropbox and Google Cloud Storage + snapper # A tool for managing BTRFS and LVM snapshots. It can create, diff and restore snapshots and provides timelined auto-snapping. + snap-sync # Use snapper snapshots to backup to external drive + + # Misc + android-file-transfer # Android MTP client with minimalistic UI + docx2txt # Recovers text from DOCX files, with good formatting. + btop # Interactive process viewer (maybe better than htop) + ttf-sourcecodepro-nerd # Patched font Source Code Pro from nerd fonts library + xdg-ninja-git # A shell script which checks your $HOME for unwanted files and directories. + yokadi # Command line oriented, sqlite powered, todo list + + # WM + river # A dynamic tiling wayland compositor + + # CLI tools + lswt # List Wayland toplevels + wlopm # Wayland output power management. + wlr-randr # Utility to manage outputs + wl-clipboard # Command-line copy/paste utilities + gammastep # Adjust the color temperature of your screen according to your surroundings. + + # Components + yambar # status panel + swaybg # Wallpaper + mako # notification daemon + bemenu-wayland # Run prompt + + # Media + slurp # Select a region (used in the coordinates for grim/maim) + grim # Screenshot utility + #maim # Screenshot utility + wf-recorder # Screen recorder + + # Idle + swayidle # Idle management daemon + swaylock # Screen locker + + + # LF + lf # A terminal file manager inspired by ranger + + # Functions + broot # Fuzzy Search + tree + cd + dragon-drop # Simple drag-and-drop source/sink + trash-cli # Command line trashcan (recycle bin) interface + + # Previewer + chafa # Image-to-text converter + highlight # source code highlighter + mediainfo # Supplies technical and tag information about a video or audio file + w3m # Text-based Web browser as well as pager + ffmpegthumbnailer # video thumbnailer that can be used by file managers + + # Media + # Download + yt-dlp # A youtube-dl fork with additional features and fixes + #cclive # Commandline downloader for popular video websites. + + # Manipulate + ffmpeg # Complete solution to record, convert and stream audio and video + + # View + imv # Image viewer + mpv # media player + + # Listen + moc # An ncurses console audio player designed to be powerful and easy to use + pavucontrol # PulseAudio Volume Control +#pipewire-alsa # Low-latency audio/video router and processor - ALSA configuration +#pipewire-jack # Low-latency audio/video router and processor - JACK support +#pipewire-pulse # Low-latency audio/video router and processor - PulseAudio replacement + + # Hardware + # Boot + efibootmgr # Linux user-space application to modify the EFI Boot Manager + grub # GNU GRand Unified Bootloader (2) + + # Storage + compsize # Calculate compression ratio of a set of files on Btrfs + smartmontools # Control and monitor S.M.A.R.T. enabled ATA and SCSI Hard Drives + + # Input + piper # GTK application to configure gaming mice + + # Printer + gutenprint # Top quality printer drivers for POSIX systems + sane-airscan # SANE - SANE backend for AirScan (eSCL) and WSD document scanners + + # CPU + cpupower # Linux kernel tool to examine and tune power saving related features of your processor + + # Zsh + zsh # A very advanced and programmable command interpreter (shell) for UNIX + zsh-syntax-highlighting # Fish shell like syntax highlighting for Zsh + # next one only works if your alias is only a command, e.g. if you `alias='cat some_file.txt &2> /dev/null'`, running `cat some_file.txt` won't trigger it. + # TODO find something better for this use case + # zsh-you-should-use # ZSH plugin that reminds you to use existing aliases for commands you just typed + + # Core Utils + file # File type identification utility + grep # A string search utility + sudo # Give certain users the ability to run some commands as root + wget # Network utility to retrieve files from the Web + which # A utility to show the full path of commands + + # File listers + tree # A directory listing program displaying a depth indented list of files + findutils # GNU utilities to locate files + fd # Simple, fast and user-friendly alternative to find + ripgrep # A search tool that combines the usability of ag with the raw speed of grep + + # {Un}Compressors + zip # Compressor/archiver for creating and modifying zipfiles + gzip # GNU compression utility + p7zip # Command-line file archiver with high compression ratio + unzip # For extracting and viewing files in .zip archives + + # Editors + ed # A POSIX-compliant line-oriented text editor + sed # GNU stream editor + vi # The original ex/vi text editor + neovim # Fork of Vim aiming to improve user experience, plugins, and GUIs + + # Programming + # General Tools + git # the fast distributed version control system + git-bug # Distributed, offline-first bug tracker embedded in git, with bridges + glow # Command-line markdown renderer + strace # A diagnostic, debugging and instructional userspace tracer + tokei # A blazingly fast CLOC (Count Lines Of Code) program + + # Rust + rustup # The Rust toolchain installer + rust-analyzer # Rust compiler front-end for IDEs + + # Yaml + yamllint # Linter for YAML files + + # TeX + zathura # Minimalistic document viewer + zathura-pdf-poppler # Adds pdf support to zathura by using the poppler engine + ltex-ls-bin # LTeX Language Server + biber # A Unicode-capable BibTeX replacement for biblatex users + pandoc # Conversion between markup formats + + # Web + vscode-langservers-extracted # Language servers extracted from VSCode. + dart-sass # Sass makes CSS fun again + prettier # An opinionated code formatter for JS, JSON, CSS, YAML and much more + + # Shell + dash # POSIX compliant shell that aims to be as small as possible + shellcheck # Shell script analysis tool + + # Lua + lua # Powerful lightweight programming language designed for extending applications + lua-format # LuaFormatter - Code formatter for Lua + lua-language-server # Lua Language Server coded by Lua + + # R + r # Language and environment for statistical computing and graphics + + +#expect # A tool for automating interactive applications +#handlr # Powerful alternative to xdg-utils written in Rust +#linux # The Linux kernel and modules +#linux-firmware # Firmware files for Linux +#packagekit-qt5 # Qt5 bindings for PackageKit +#vulkan-radeon # Radeon's Vulkan mesa driver +#xorg-bdftopcf # Convert X font from Bitmap Distribution Format to Portable Compiled Format diff --git a/system/packages/packages.nix b/system/packages/packages.nix new file mode 100644 index 00000000..1acba85e --- /dev/null +++ b/system/packages/packages.nix @@ -0,0 +1,86 @@ +{ + config, + pkgs, + ... +}: { + environment.systemPackages = with pkgs; [ + (builtins.readFile ./packages.conf) # TODO could work + ]; +} +# QEMU +# TEX +# {{{ +#adobe-source-han-sans-kr-fonts # Adobe Source Han Sans Subset OTF - Korean OpenType/CFF fonts +#alsa-utils # Advanced Linux Sound Architecture - Utilities +#element-desktop # Glossy Matrix collaboration client — desktop version. +#gawk # GNU version of awk +#gimp # GNU Image Manipulation Program +#git-lfs # Git extension for versioning large files +#gnome-epub-thumbnailer # Thumbnailer for EPub and MOBI books +#gnumeric # A GNOME Spreadsheet Program +#gpick # Advanced color picker written in C++ using GTK+ toolkit +#gradle # Powerful build system for the JVM +#groff # GNU troff text-formatting system +#jre11-openjdk-headless # OpenJDK Java 11 headless runtime environment +#klavaro # Free touch typing tutor program +#lifeograph # Private journal, diary and note taking application +#lynx # A text browser for the World Wide Web +#man-db # A utility for reading man pages +#networkmanager # Network connection manager and user applications +#nss-mdns # glibc plugin providing host name resolution via mDNS +#python-spotdl # Download your Spotify playlists and songs along with album art and metadata (from YouTube if a match is found). +#python-xlsx2csv # xlsx to csv converter +#ruff # An extremely fast Python linter, written in Rust +#signal-desktop # Signal Private Messenger for Linux +#slides # Terminal based presentation tool +#torbrowser-launcher # Securely and easily download, verify, install, and launch Tor Browser in Linux +#web-ext # A command line tool to help build, run, and test web extensions +#wkhtmltopdf # Command line tools to render HTML into PDF and various image formats +#xcursor-bluecurve # Redhat's Bluecurve X mouse cursor theme +# XORG +#xorg-docs # X.org documentations +#xorg-font-util # X.Org font utilities +#xorg-fonts-100dpi # X.org 100dpi fonts +#xorg-fonts-75dpi # X.org 75dpi fonts +#xorg-fonts-encodings # X.org font encoding files +#xorg-iceauth # ICE authority file utility +#xorg-mkfontscale # Create an index of scalable font files for X +#xorg-server # Xorg X server +#xorg-server-common # Xorg server common files +#xorg-server-devel # Development files for the X.Org X server +#xorg-server-xephyr # A nested X server that runs as an X application +#xorg-server-xnest # A nested X server that runs as an X application +#xorg-server-xvfb # Virtual framebuffer X server +#xorg-sessreg # Register X sessions in system utmp/utmpx databases +#xorg-setxkbmap # Set the keyboard using the X Keyboard Extension +#xorg-smproxy # Allows X applications that do not support X11R6 session management to participate in an X11R6 session +#xorg-x11perf # Simple X server performance benchmarker +#xorg-xauth # X.Org authorization settings program +#xorg-xbacklight # RandR-based backlight control application +#xorg-xcmsdb # Device Color Characterization utility for X Color Management System +#xorg-xcursorgen # Create an X cursor file from PNG images +#xorg-xdpyinfo # Display information utility for X +#xorg-xdriinfo # Query configuration information of DRI drivers +#xorg-xev # Print contents of X events +#xorg-xgamma # Alter a monitor's gamma correction +#xorg-xhost # Server access control program for X +#xorg-xinit # X.Org initialisation program +#xorg-xinput # Small commandline tool to configure devices +#xorg-xkbcomp # X Keyboard description compiler +#xorg-xkbevd # XKB event daemon +#xorg-xkbutils # XKB utility demos +#xorg-xkill # Kill a client by its X resource +#xorg-xlsatoms # List interned atoms defined on server +#xorg-xlsclients # List client applications running on a display +#xorg-xmodmap # Utility for modifying keymaps and button mappings +#xorg-xpr # Print an X window dump from xwd +#xorg-xrandr # Primitive command line interface to RandR extension +#xorg-xrdb # X server resource database utility +#xorg-xrefresh # Refresh all or part of an X screen +#xorg-xsetroot # Classic X utility to set your root window background to a given pattern or color +#xorg-xvinfo # Prints out the capabilities of any video adaptors associated with the display that are accessible through the X-Video extension +#xorg-xwayland # run X clients under wayland +#xorg-xwininfo # Command-line utility to print information about windows on an X server +#xorg-xwud # X Window System image undumping utility +# }}} + diff --git a/system/sound/sound.nix b/system/sound/sound.nix new file mode 100644 index 00000000..16dd4279 --- /dev/null +++ b/system/sound/sound.nix @@ -0,0 +1,18 @@ +{config, ...}: { + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; +} diff --git a/system/system.nix b/system/system.nix new file mode 100644 index 00000000..3a034742 --- /dev/null +++ b/system/system.nix @@ -0,0 +1,8 @@ +{config, ...}: { + imports = [ + ./locale/locale.nix + ./users/users.nix + ./sound/sound.nix + ./packages/packages.nix + ]; +} diff --git a/system/users.nix b/system/users.nix deleted file mode 100644 index ca2fc352..00000000 --- a/system/users.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - config, - pkgs, - ... -}: { - users = { - mutableUsers = false; - users.soispha = { - isNormalUser = true; - home = "/home/soispha"; - shell = pkgs.zsh; - initialHashedPassword = "$y$jFT$ONrCqZIJKB7engmfA4orD/$0GO58/wV5wrYWj0cyONhyujZPjFmbT0XKtx2AvXLG0B"; - extraGroups = ["wheel"]; - uid = 1000; - }; - }; -} diff --git a/system/users/users.nix b/system/users/users.nix new file mode 100644 index 00000000..ca2fc352 --- /dev/null +++ b/system/users/users.nix @@ -0,0 +1,17 @@ +{ + config, + pkgs, + ... +}: { + users = { + mutableUsers = false; + users.soispha = { + isNormalUser = true; + home = "/home/soispha"; + shell = pkgs.zsh; + initialHashedPassword = "$y$jFT$ONrCqZIJKB7engmfA4orD/$0GO58/wV5wrYWj0cyONhyujZPjFmbT0XKtx2AvXLG0B"; + extraGroups = ["wheel"]; + uid = 1000; + }; + }; +} -- cgit 1.4.1