From 019399b34a6e7447d3b250b496bf2f0da6a80060 Mon Sep 17 00:00:00 2001 From: Thilo Billerbeck Date: Tue, 2 May 2023 22:47:01 +0200 Subject: [PATCH] splitted up config --- dotfiles/.gitmodules | 4 - dotfiles/alacritty.yml | 46 ------- dotfiles/aliases | 11 -- dotfiles/bash_logout | 3 - dotfiles/bash_profile | 7 - dotfiles/bashrc | 175 ------------------------- dotfiles/beets.yaml | 16 --- dotfiles/chromium-flags.conf | 7 - dotfiles/gitconfig | 28 ---- dotfiles/gtk-3.ini | 2 - dotfiles/htoprc | 39 ------ dotfiles/install | 6 - dotfiles/install.conf.yaml | 75 ----------- dotfiles/starship.toml | 22 ---- dotfiles/topgrade.toml | 131 ------------------- dotfiles/zshenv | 3 - home.nix | 239 +---------------------------------- programs/alacritty.nix | 68 ++++++++++ programs/beets.nix | 29 +++++ programs/direnv.nix | 8 ++ programs/git.nix | 29 +++++ programs/htop.nix | 46 +++++++ programs/neovim.nix | 33 +++++ programs/starship.nix | 12 ++ programs/topgrade.nix | 16 +++ programs/vscode.nix | 26 ++++ programs/yt-dlp.nix | 9 ++ programs/zsh.nix | 42 ++++++ 28 files changed, 321 insertions(+), 811 deletions(-) delete mode 100644 dotfiles/.gitmodules delete mode 100644 dotfiles/alacritty.yml delete mode 100644 dotfiles/aliases delete mode 100644 dotfiles/bash_logout delete mode 100644 dotfiles/bash_profile delete mode 100644 dotfiles/bashrc delete mode 100644 dotfiles/beets.yaml delete mode 100644 dotfiles/chromium-flags.conf delete mode 100644 dotfiles/gitconfig delete mode 100644 dotfiles/gtk-3.ini delete mode 100644 dotfiles/htoprc delete mode 100755 dotfiles/install delete mode 100644 dotfiles/install.conf.yaml delete mode 100644 dotfiles/starship.toml delete mode 100644 dotfiles/topgrade.toml delete mode 100644 dotfiles/zshenv create mode 100644 programs/alacritty.nix create mode 100644 programs/beets.nix create mode 100644 programs/direnv.nix create mode 100644 programs/git.nix create mode 100644 programs/htop.nix create mode 100644 programs/neovim.nix create mode 100644 programs/starship.nix create mode 100644 programs/topgrade.nix create mode 100644 programs/vscode.nix create mode 100644 programs/yt-dlp.nix create mode 100644 programs/zsh.nix diff --git a/dotfiles/.gitmodules b/dotfiles/.gitmodules deleted file mode 100644 index 1af14d0..0000000 --- a/dotfiles/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "dotbot"] - path = dotbot - url = https://github.com/anishathalye/dotbot - ignore = dirty diff --git a/dotfiles/alacritty.yml b/dotfiles/alacritty.yml deleted file mode 100644 index 6f96f6e..0000000 --- a/dotfiles/alacritty.yml +++ /dev/null @@ -1,46 +0,0 @@ -window: - decorations: full - dynamic_title: true - gtk_theme_variant: None -background_opacity: 1.0 -font: - normal: - family: FiraMono Nerd Font - bold: - family: FiraMono Nerd Font - style: Bold - size: 14 - offset: - y: 1 - -cursor: - style: - shape: Beam -# Colors (Snazzy) -colors: - # Default colors - primary: - background: "0x282a36" - foreground: "0xeff0eb" - - # Normal colors - normal: - black: "0x282a36" - red: "0xff5c57" - green: "0x5af78e" - yellow: "0xf3f99d" - blue: "0x57c7ff" - magenta: "0xff6ac1" - cyan: "0x9aedfe" - white: "0xf1f1f0" - - # Bright colors - bright: - black: "0x686868" - red: "0xff5c57" - green: "0x5af78e" - yellow: "0xf3f99d" - blue: "0x57c7ff" - magenta: "0xff6ac1" - cyan: "0x9aedfe" - white: "0xf1f1f0" diff --git a/dotfiles/aliases b/dotfiles/aliases deleted file mode 100644 index 9eb60af..0000000 --- a/dotfiles/aliases +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -alias pub-ipv4="curl ip4.clerie.de" -alias serve="python -m SimpleHTTPServer 8080" -alias week='date +%V' -alias path='echo -e ${PATH//:/\\n}' -alias distro='cat /etc/*-release' -alias reload='source ~/.zshrc' -alias undo-git-reset-head="git reset 'HEAD@{1}'" -alias update-local="bash $HOME/.dotfiles/install" -alias fix-ssh-key-permissions="bash $HOME/.dotfiles/scripts/fix-ssh-key-permissions.sh" diff --git a/dotfiles/bash_logout b/dotfiles/bash_logout deleted file mode 100644 index 0e4e4f1..0000000 --- a/dotfiles/bash_logout +++ /dev/null @@ -1,3 +0,0 @@ -# -# ~/.bash_logout -# diff --git a/dotfiles/bash_profile b/dotfiles/bash_profile deleted file mode 100644 index 10d3203..0000000 --- a/dotfiles/bash_profile +++ /dev/null @@ -1,7 +0,0 @@ -# -# ~/.bash_profile -# - -[[ -f ~/.bashrc ]] && . ~/.bashrc -if [ -e /home/thilo/.nix-profile/etc/profile.d/nix.sh ]; then . /home/thilo/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer -. "$HOME/.cargo/env" diff --git a/dotfiles/bashrc b/dotfiles/bashrc deleted file mode 100644 index c8e9495..0000000 --- a/dotfiles/bashrc +++ /dev/null @@ -1,175 +0,0 @@ -# -# ~/.bashrc -# - -# If not running interactively, don't do anything -[[ $- != *i* ]] && return - -[[ -f ~/.welcome_screen ]] && . ~/.welcome_screen - -_set_my_PS1() { - PS1='[\u@\h \W]\$ ' - if [ "$(whoami)" = "liveuser" ] ; then - local iso_version="$(grep ^VERSION= /usr/lib/endeavouros-release 2>/dev/null | cut -d '=' -f 2)" - if [ -n "$iso_version" ] ; then - local prefix="eos-" - local iso_info="$prefix$iso_version" - PS1="[\u@$iso_info \W]\$ " - fi - fi -} -_set_my_PS1 -unset -f _set_my_PS1 - -ShowInstallerIsoInfo() { - local file=/usr/lib/endeavouros-release - if [ -r $file ] ; then - cat $file - else - echo "Sorry, installer ISO info is not available." >&2 - fi -} - - -alias ls='ls --color=auto' -alias ll='ls -lav --ignore=..' # show long listing of all except ".." -alias l='ls -lav --ignore=.?*' # show long listing but no hidden dotfiles except "." - -[[ "$(whoami)" = "root" ]] && return - -[[ -z "$FUNCNEST" ]] && export FUNCNEST=100 # limits recursive functions, see 'man bash' - -## Use the up and down arrow keys for finding a command in history -## (you can write some initial letters of the command first). -bind '"\e[A":history-search-backward' -bind '"\e[B":history-search-forward' - -################################################################################ -## Some generally useful functions. -## Consider uncommenting aliases below to start using these functions. - - -_GeneralCmdCheck() { - # A helper for functions UpdateArchPackages and UpdateAURPackages. - - echo "$@" >&2 - "$@" || { - echo "Error: '$*' failed." >&2 - exit 1 - } -} - -_CheckInternetConnection() { - # curl --silent --connect-timeout 8 https://8.8.8.8 >/dev/null - eos-connection-checker - local result=$? - test $result -eq 0 || echo "No internet connection!" >&2 - return $result -} - -_CheckArchNews() { - local conf=/etc/eos-update-notifier.conf - - if [ -z "$CheckArchNewsForYou" ] && [ -r $conf ] ; then - source $conf - fi - - if [ "$CheckArchNewsForYou" = "yes" ] ; then - local news="$(yay -Pw)" - if [ -n "$news" ] ; then - echo "Arch news:" >&2 - echo "$news" >&2 - echo "" >&2 - # read -p "Press ENTER to continue (or Ctrl-C to stop): " - else - echo "No Arch news." >&2 - fi - fi -} - -UpdateArchPackages() { - # Updates Arch packages. - - _CheckInternetConnection || return 1 - - _CheckArchNews - - #local updates="$(yay -Qu --repo)" - local updates="$(checkupdates)" - if [ -n "$updates" ] ; then - echo "Updates from upstream:" >&2 - echo "$updates" | sed 's|^| |' >&2 - _GeneralCmdCheck sudo pacman -Syu "$@" - return 0 - else - echo "No upstream updates." >&2 - return 1 - fi -} - -UpdateAURPackages() { - # Updates AUR packages. - - _CheckInternetConnection || return 1 - - local updates - if [ -x /usr/bin/yay ] ; then - updates="$(yay -Qua)" - if [ -n "$updates" ] ; then - echo "Updates from AUR:" >&2 - echo "$updates" | sed 's|^| |' >&2 - _GeneralCmdCheck yay -Syua "$@" - else - echo "No AUR updates." >&2 - fi - else - echo "Warning: /usr/bin/yay does not exist." >&2 - fi -} - -UpdateAllPackages() { - # Updates all packages in the system. - # Upstream (i.e. Arch) packages are updated first. - # If there are Arch updates, you should run - # this function a second time to update - # the AUR packages too. - - UpdateArchPackages || UpdateAURPackages -} - - -_open_files_for_editing() { - # Open any given document file(s) for editing (or just viewing). - # Note1: Do not use for executable files! - # Note2: uses mime bindings, so you may need to use - # e.g. a file manager to make some file bindings. - - local progs="xdg-open exo-open" # One of these programs is used. - local prog - for prog in $progs ; do - if [ -x /usr/bin/$xx ] ; then - $prog "$@" >& /dev/null & - return - fi - done - echo "Sorry, none of programs [$progs] is found." >&2 - echo "Tip: install one of packages" >&2 - for prog in $progs ; do - echo " $(pacman -Qqo "$prog")" >&2 - done -} - -#------------------------------------------------------------ - -## Aliases for the functions above. -## Uncomment an alias if you want to use it. -## - -# alias ef='_open_files_for_editing' # 'ef' opens given file(s) for editing -################################################################################ -source "$HOME/.cargo/env" - -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion -. "$HOME/.cargo/env" diff --git a/dotfiles/beets.yaml b/dotfiles/beets.yaml deleted file mode 100644 index 8ca29ad..0000000 --- a/dotfiles/beets.yaml +++ /dev/null @@ -1,16 +0,0 @@ -directory: ~/Music/dj/Library -library: ~/Music/dj/library.db -plugins: spotify acousticbrainz badfiles duplicates fetchart -import: - write: yes - copy: yes - resume: no - duplicate_action: ask - default_action: apply -badfiles: - check_on_import: yes -match: - max_rec: - track_length: strong - track_title: strong - track_artist: strong diff --git a/dotfiles/chromium-flags.conf b/dotfiles/chromium-flags.conf deleted file mode 100644 index 2bd4dc1..0000000 --- a/dotfiles/chromium-flags.conf +++ /dev/null @@ -1,7 +0,0 @@ ---force-dark-mode ---enable-features=WebUIDarkMode ---enable-smooth-scrolling ---ozone-platform-hint=auto ---ignore-gpu-blocklist ---enable-gpu-rasterization ---enable-zero-copy \ No newline at end of file diff --git a/dotfiles/gitconfig b/dotfiles/gitconfig deleted file mode 100644 index f1949b9..0000000 --- a/dotfiles/gitconfig +++ /dev/null @@ -1,28 +0,0 @@ -[user] - name = Thilo Billerbeck - email = thilo.billerbeck@officerent.de - -[color] - diff = auto - status = auto - branch = auto - interactive = auto - ui = true - pager = true -[log] - date = short -[rerere] - enabled = 1 -[core] - whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol - excludesfile = ~/.gitignore-rab - autocrlf = input -[apply] - whitespace = nowarn -[branch] - autosetuprebase = always -[filter "lfs"] - clean = git-lfs clean -- %f - smudge = git-lfs smudge -- %f - process = git-lfs filter-process - required = true diff --git a/dotfiles/gtk-3.ini b/dotfiles/gtk-3.ini deleted file mode 100644 index 5dbd750..0000000 --- a/dotfiles/gtk-3.ini +++ /dev/null @@ -1,2 +0,0 @@ -[Settings] -gtk-application-prefer-dark-theme=true diff --git a/dotfiles/htoprc b/dotfiles/htoprc deleted file mode 100644 index 41597a3..0000000 --- a/dotfiles/htoprc +++ /dev/null @@ -1,39 +0,0 @@ -# Beware! This file is rewritten by htop when settings are changed in the interface. -# The parser is also very primitive, and not human-friendly. -fields=0 48 17 18 38 39 40 2 46 47 49 1 -sort_key=46 -sort_direction=1 -tree_sort_key=0 -tree_sort_direction=1 -hide_kernel_threads=1 -hide_userland_threads=0 -shadow_other_users=0 -show_thread_names=0 -show_program_path=1 -highlight_base_name=0 -highlight_megabytes=1 -highlight_threads=1 -highlight_changes=0 -highlight_changes_delay_secs=5 -find_comm_in_cmdline=1 -strip_exe_from_cmdline=1 -show_merged_command=0 -tree_view=1 -tree_view_always_by_pid=0 -header_margin=1 -detailed_cpu_time=0 -cpu_count_from_one=0 -show_cpu_usage=1 -show_cpu_frequency=0 -show_cpu_temperature=0 -degree_fahrenheit=0 -update_process_names=0 -account_guest_in_cpu_meter=0 -color_scheme=0 -enable_mouse=1 -delay=15 -left_meters=LeftCPUs2 CPU Memory DiskIO NetworkIO -left_meter_modes=1 1 1 2 2 -right_meters=RightCPUs2 Tasks LoadAverage Uptime Battery -right_meter_modes=1 2 2 2 2 -hide_function_bar=0 \ No newline at end of file diff --git a/dotfiles/install b/dotfiles/install deleted file mode 100755 index c13a2ff..0000000 --- a/dotfiles/install +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -script_location=$(dirname $(realpath $0)) - -bash $script_location/scripts/bootstrap-local-env.sh -bash $script_location/scripts/update-dotfiles.sh \ No newline at end of file diff --git a/dotfiles/install.conf.yaml b/dotfiles/install.conf.yaml deleted file mode 100644 index 66770b5..0000000 --- a/dotfiles/install.conf.yaml +++ /dev/null @@ -1,75 +0,0 @@ -- defaults: - link: - relink: true - -- clean: - ~/: - force: true - -- link: - ~/.bash_profile: - path: bash_profile - force: true - ~/.bashrc: - path: bashrc - force: true - ~/.bash_logout: - path: bash_logout - force: true - ~/.zshrc: - path: zshrc - force: true - ~/.zshenv: - path: zshenv - force: true - ~/.gitconfig: - path: gitconfig - force: true - # ~/.config/gtk-3.0/settings.ini: - # path: gtk-3.ini - # force: true - ~/.config/nano/nanorc: - path: nanorc - force: true - ~/.config/locale.conf: - path: locale.conf - force: true - ~/.aliases: - path: aliases - force: true - ~/.alacritty.yml: - path: alacritty.yml - force: true - ~/.config/htop/htoprc: - path: htoprc - force: true - ~/.config/starship.toml: - path: starship.toml - force: true - ~/.config/nvim/init.vim: - path: init.vim - force: true - ~/.config/chromium-flags.conf: - path: chromium-flags.conf - force: true - ~/.config/chrome-flags.conf: - path: chromium-flags.conf - force: true - ~/.config/vivaldi-stable.conf: - path: chromium-flags.conf - force: true - ~/.var/app/com.google.Chrome/config/chrome-flags.conf: - path: chromium-flags.conf - force: true - ~/.ssh/config: - path: ssh-config - force: true - ~/.config/beets/config.yaml: - path: beets.yaml - force: true - ~/.config/pipewire/pipewire.conf: - path: pipewire.conf - force: true - ~/.config/topgrade.toml: - path: topgrade.toml - force: true diff --git a/dotfiles/starship.toml b/dotfiles/starship.toml deleted file mode 100644 index 0d69af7..0000000 --- a/dotfiles/starship.toml +++ /dev/null @@ -1,22 +0,0 @@ -# Don't print a new line at the start of the prompt -add_newline = false - -# Which is equivalent to -format = """ -$all\ -$line_break\ -$jobs\ -$battery\ -$time\ -$status\ -$shell\ -$character""" - -# Replace the "❯" symbol in the prompt with "➜" -[character] # The name of the module we are configuring is "character" -success_symbol = "[❯](bold white)" # The "success_symbol" segment is being set to "➜" with the color "bold green" - -# Disable the package module, hiding it from the prompt completely -[package] -disabled = true - diff --git a/dotfiles/topgrade.toml b/dotfiles/topgrade.toml deleted file mode 100644 index 8d945ce..0000000 --- a/dotfiles/topgrade.toml +++ /dev/null @@ -1,131 +0,0 @@ -# Don't ask for confirmations -assume_yes = true - -# Disable specific steps - same options as the command line flag -#disable = ["system", "emacs"] - -# Ignore failures for these steps -ignore_failures = ["git_repos"] - -# Run specific steps - same options as the command line flag -#only = ["system", "emacs"] - -# Do not ask to retry failed steps (default: false) -no_retry = true - -# Run `sudo -v` to cache credentials at the start of the run; this avoids a -# blocking password prompt in the middle of a possibly-unattended run. -pre_sudo = false - -# Run inside tmux -#run_in_tmux = true - -# List of remote machines with Topgrade installed on them -#remote_topgrades = ["toothless", "pi", "parnas"] - -# Arguments to pass SSH when upgrading remote systems -#ssh_arguments = "-o ConnectTimeout=2" - -# Path to Topgrade executable on remote machines -#remote_topgrade_path = ".cargo/bin/topgrade" - -# Arguments to pass tmux when pulling Repositories -#tmux_arguments = "-S /var/tmux.sock" - -# Do not set the terminal title -#set_title = false - -# Display the time in step titles -# display_time = true - -# Cleanup temporary or old files -cleanup = true - -# Skip sending a notification at the end of a run -skip_notify = true - -# Skip the preamble displayed when topgrade is run -#display_preamble = false - -[git] -#max_concurrency = 5 -# Additional git repositories to pull -#repos = [ -# "~/src/*/", -# "~/.config/something" -#] - -# Don't pull the predefined git repos -#pull_predefined = false - -# Arguments to pass Git when pulling Repositories -#arguments = "--rebase --autostash" - -[composer] -#self_update = true - -# Commands to run before anything -[pre_commands] -#"Emacs Snapshot" = "rm -rf ~/.emacs.d/elpa.bak && cp -rl ~/.emacs.d/elpa ~/.emacs.d/elpa.bak" - -# Custom commands -[commands] -#"Python Environment" = "~/dev/.env/bin/pip install -i https://pypi.python.org/simple -U --upgrade-strategy eager jupyter" -"zinit" = "zinit update" - -[brew] -#greedy_cask = true -#autoremove = true - -[linux] -# Arch Package Manager to use. Allowed values: autodetect, aura, garuda_update, pacman, pamac, paru, pikaur, trizen, yay. -#arch_package_manager = "pacman" -# Arguments to pass yay (or paru) when updating packages -#yay_arguments = "--nodevel" -# Arguments to pass dnf when updating packages -#dnf_arguments = "--refresh" -#aura_aur_arguments = "-kx" -#aura_pacman_arguments = "" -#garuda_update_arguments = "" -#show_arch_news = true -#trizen_arguments = "--devel" -#pikaur_arguments = "" -#pamac_arguments = "--no-devel" -#enable_tlmgr = true -#emerge_sync_flags = "-q" -#emerge_update_flags = "-uDNa --with-bdeps=y world" -#redhat_distro_sync = false -#rpm_ostree = false -#nix_arguments = "--flake" - -[python] -#enable_pip_review = true ###disabled by default -#enable_pipupgrade = true ###disabled by default - -[windows] -# Manually select Windows updates -#accept_all_updates = false -#open_remotes_in_new_terminal = true -#wsl_update_pre_release = true -#wsl_update_use_web_download = true - -# Causes Topgrade to rename itself during the run to allow package managers -# to upgrade it. Use this only if you installed Topgrade by using a package -# manager such as Scoop or Cargo -#self_rename = true - -[npm] -# Use sudo if the NPM directory isn't owned by the current user -#use_sudo = true - -[firmware] -# Offer to update firmware; if false just check for and display available updates -upgrade = true - -[flatpak] -# Use sudo for updating the system-wide installation -#use_sudo = true - -[distrobox] -#use_root = false -#containers = ["archlinux-latest"] diff --git a/dotfiles/zshenv b/dotfiles/zshenv deleted file mode 100644 index b51f004..0000000 --- a/dotfiles/zshenv +++ /dev/null @@ -1,3 +0,0 @@ -source "$HOME/.cargo/env" -if [ -e /home/thilo/.nix-profile/etc/profile.d/nix.sh ]; then . /home/thilo/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer -. "$HOME/.cargo/env" diff --git a/home.nix b/home.nix index d070e58..7137fff 100644 --- a/home.nix +++ b/home.nix @@ -20,6 +20,8 @@ in { targets.genericLinux.enable = true; news.display = "silent"; + imports = map (n: "${./programs}/${n}") (builtins.attrNames (builtins.readDir ./programs)); + home = { username = "thilo"; homeDirectory = "/home/thilo"; @@ -80,240 +82,5 @@ in { mime.enable = true; }; - programs = { - home-manager.enable = true; - vscode = { - enable = true; - package = (nixGLWrap (pkgs.vscode.override { - commandLineArgs = - "--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --gtk-version=4"; - })); - }; - htop = { - enable = true; - settings = { - fields="0 48 17 18 38 39 40 2 46 47 49 1"; - sort_key="46"; - sort_direction="1"; - tree_sort_key="0"; - tree_sort_direction="1"; - hide_kernel_threads="1"; - hide_userland_threads="0"; - shadow_other_users="0"; - show_thread_names="0"; - show_program_path="1"; - highlight_base_name="0"; - highlight_megabytes="1"; - highlight_threads="1"; - highlight_changes="0"; - highlight_changes_delay_secs="5"; - find_comm_in_cmdline="1"; - strip_exe_from_cmdline="1"; - show_merged_command="0"; - tree_view="1"; - tree_view_always_by_pid="0"; - header_margin="1"; - detailed_cpu_time="0"; - cpu_count_from_one="0"; - show_cpu_usage="1"; - show_cpu_frequency="0"; - show_cpu_temperature="0"; - degree_fahrenheit="0"; - update_process_names="0"; - account_guest_in_cpu_meter="0"; - color_scheme="0"; - enable_mouse="1"; - delay="15"; - left_meters="LeftCPUs2 CPU Memory DiskIO NetworkIO"; - left_meter_modes="1 1 1 2 2"; - right_meters="RightCPUs2 Tasks LoadAverage Uptime Battery"; - right_meter_modes="1 2 2 2 2"; - hide_function_bar="0"; - }; - }; - beets = { - enable = true; - settings = { - directory = "~/Music/dj/Library"; - library = "~/Music/dj/library.db"; - plugins = "spotify acousticbrainz badfiles duplicates fetchart"; - import = { - write = "yes"; - copy = "yes"; - resume = "no"; - duplicate_action = "ask"; - default_action = "apply"; - }; - badfiles = { - check_on_import = "yes"; - }; - match = { - max_rec = { - track_length = "strong"; - track_title = "strong"; - track_artist = "strong"; - }; - }; - }; - }; - zsh = { - enable = true; - enableAutosuggestions = true; - enableCompletion = true; - enableSyntaxHighlighting = true; - enableVteIntegration = true; - zplug = { - enable = true; - plugins = [ - { - name = "plugins/git"; - tags = [ from:oh-my-zsh ]; - } - { - name = "plugins/archlinux"; - tags = [ from:oh-my-zsh ]; - } - { - name = "plugins/composer"; - tags = [ from:oh-my-zsh ]; - } - { - name = "plugins/colored-man-pages"; - tags = [ from:oh-my-zsh ]; - } - ]; - }; - }; - git = { - enable = true; - lfs.enable = true; - userEmail = "thilo.billerbeck@officerent.de"; - userName = "Thilo Billerbeck"; - extraConfig = { - color = { - diff = "auto"; - status = "auto"; - branch = "auto"; - interactive = "auto"; - ui = true; - pager = true; - }; - log = { date = "short"; }; - rerere = { enabled = "1"; }; - core = { - whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol"; - excludesfile = "~/.gitignore-rab"; - autocrlf = "input"; - }; - apply = { whitespace = "nowarn"; }; - branch = { autosetuprebase = "always"; }; - }; - }; - direnv = { - enable = true; - nix-direnv.enable = true; - }; - starship = { - enable = true; - settings = { - add_newline = false; - character = { success_symbol = "[❯](bold white)"; }; - package = { disabled = true; }; - }; - }; - topgrade = { - enable = true; - settings = { - assume_yes = true; - ignore_failures = [ "git_repos" ]; - no_retry = true; - pre_sudo = false; - cleanup = true; - skip_notify = true; - firmware = { upgrade = true; }; - }; - }; - alacritty = { - enable = true; - package = (nixGLWrap pkgs.alacritty); - settings = { - window = { - decorations = "full"; - dynamic_title = true; - gtk_theme_variant = "None"; - }; - window.opacity = 1; - font = { - normal = { - family = "JetbrainsMono NFM"; - style = "Regular"; - }; - bold = { - family = "JetbrainsMono NFM"; - style = "Bold"; - }; - size = 14; - }; - cursor.style.shape = "Beam"; - colors = { - primary = { - background = "0x282a36"; - foreground = "0xeff0eb"; - }; - normal = { - black = "0x282a36"; - red = "0xff5c57"; - green = "0x5af78e"; - yellow = "0xf3f99d"; - blue = "0x57c7ff"; - magenta = "0xff6ac1"; - cyan = "0x9aedfe"; - white = "0xf1f1f0"; - }; - bright = { - black = "0x686868"; - red = "0xff5c57"; - green = "0x5af78e"; - yellow = "0xf3f99d"; - blue = "0x57c7ff"; - magenta = "0xff6ac1"; - cyan = "0x9aedfe"; - white = "0xf1f1f0"; - }; - }; - }; - }; - yt-dlp = { - enable = true; - }; - neovim = { - defaultEditor = true; - enable = true; - viAlias = true; - vimAlias = true; - vimdiffAlias = true; - coc = { enable = true; }; - extraConfig = '' - set title - set number - set relativenumber - set cursorline - set mouse=a - syntax enable - let g:NERDTreeShowHidden = 1 - let g:NERDTreeMinimalUI = 1 - let g:NERDTreeIgnore = [ '.git/' ] - let g:NERDTreeStatusline = "" - let g:NERDTreeMouseMode = 2 - autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif - nnoremap :NERDTreeToggle - ''; - plugins = with pkgs.vimPlugins; [ - nerdtree - vim-devicons - # fzf - ale - ]; - }; - }; + programs.home-manager.enable = true; } diff --git a/programs/alacritty.nix b/programs/alacritty.nix new file mode 100644 index 0000000..c8e6e38 --- /dev/null +++ b/programs/alacritty.nix @@ -0,0 +1,68 @@ +{ config, pkgs, lib, ... }: + +let + nixgl = import { }; + nixGLWrap = pkg: + pkgs.runCommand "${pkg.name}-nixgl-wrapper" { } '' + mkdir $out + ln -s ${pkg}/* $out + rm $out/bin + mkdir $out/bin + for bin in ${pkg}/bin/*; do + wrapped_bin=$out/bin/$(basename $bin) + echo -e "#!/bin/bash\nexec ${lib.getExe nixgl.auto.nixGLDefault} $bin \$@" > $wrapped_bin + chmod +x $wrapped_bin + done + ''; +in { + programs.alacritty = { + enable = true; + package = (nixGLWrap pkgs.alacritty); + settings = { + window = { + decorations = "full"; + dynamic_title = true; + gtk_theme_variant = "None"; + }; + window.opacity = 1; + font = { + normal = { + family = "JetbrainsMono NFM"; + style = "Regular"; + }; + bold = { + family = "JetbrainsMono NFM"; + style = "Bold"; + }; + size = 14; + }; + cursor.style.shape = "Beam"; + colors = { + primary = { + background = "0x282a36"; + foreground = "0xeff0eb"; + }; + normal = { + black = "0x282a36"; + red = "0xff5c57"; + green = "0x5af78e"; + yellow = "0xf3f99d"; + blue = "0x57c7ff"; + magenta = "0xff6ac1"; + cyan = "0x9aedfe"; + white = "0xf1f1f0"; + }; + bright = { + black = "0x686868"; + red = "0xff5c57"; + green = "0x5af78e"; + yellow = "0xf3f99d"; + blue = "0x57c7ff"; + magenta = "0xff6ac1"; + cyan = "0x9aedfe"; + white = "0xf1f1f0"; + }; + }; + }; + }; +} diff --git a/programs/beets.nix b/programs/beets.nix new file mode 100644 index 0000000..78f7463 --- /dev/null +++ b/programs/beets.nix @@ -0,0 +1,29 @@ +{ config, pkgs, lib, ... }: + +{ + programs.beets = { + enable = true; + settings = { + directory = "~/Music/dj/Library"; + library = "~/Music/dj/library.db"; + plugins = "spotify acousticbrainz badfiles duplicates fetchart"; + import = { + write = "yes"; + copy = "yes"; + resume = "no"; + duplicate_action = "ask"; + default_action = "apply"; + }; + badfiles = { + check_on_import = "yes"; + }; + match = { + max_rec = { + track_length = "strong"; + track_title = "strong"; + track_artist = "strong"; + }; + }; + }; + }; +} diff --git a/programs/direnv.nix b/programs/direnv.nix new file mode 100644 index 0000000..a7ed27b --- /dev/null +++ b/programs/direnv.nix @@ -0,0 +1,8 @@ +{ config, pkgs, lib, ... }: + +{ + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; +} diff --git a/programs/git.nix b/programs/git.nix new file mode 100644 index 0000000..cea4205 --- /dev/null +++ b/programs/git.nix @@ -0,0 +1,29 @@ +{ config, pkgs, lib, ... }: + +{ + programs.git = { + enable = true; + lfs.enable = true; + userEmail = "thilo.billerbeck@officerent.de"; + userName = "Thilo Billerbeck"; + extraConfig = { + color = { + diff = "auto"; + status = "auto"; + branch = "auto"; + interactive = "auto"; + ui = true; + pager = true; + }; + log = { date = "short"; }; + rerere = { enabled = "1"; }; + core = { + whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol"; + excludesfile = "~/.gitignore-rab"; + autocrlf = "input"; + }; + apply = { whitespace = "nowarn"; }; + branch = { autosetuprebase = "always"; }; + }; + }; +} diff --git a/programs/htop.nix b/programs/htop.nix new file mode 100644 index 0000000..a739289 --- /dev/null +++ b/programs/htop.nix @@ -0,0 +1,46 @@ +{ config, pkgs, lib, ... }: + +{ + programs.htop = { + enable = true; + settings = { + fields="0 48 17 18 38 39 40 2 46 47 49 1"; + sort_key="46"; + sort_direction="1"; + tree_sort_key="0"; + tree_sort_direction="1"; + hide_kernel_threads="1"; + hide_userland_threads="0"; + shadow_other_users="0"; + show_thread_names="0"; + show_program_path="1"; + highlight_base_name="0"; + highlight_megabytes="1"; + highlight_threads="1"; + highlight_changes="0"; + highlight_changes_delay_secs="5"; + find_comm_in_cmdline="1"; + strip_exe_from_cmdline="1"; + show_merged_command="0"; + tree_view="1"; + tree_view_always_by_pid="0"; + header_margin="1"; + detailed_cpu_time="0"; + cpu_count_from_one="0"; + show_cpu_usage="1"; + show_cpu_frequency="0"; + show_cpu_temperature="0"; + degree_fahrenheit="0"; + update_process_names="0"; + account_guest_in_cpu_meter="0"; + color_scheme="0"; + enable_mouse="1"; + delay="15"; + left_meters="LeftCPUs2 CPU Memory DiskIO NetworkIO"; + left_meter_modes="1 1 1 2 2"; + right_meters="RightCPUs2 Tasks LoadAverage Uptime Battery"; + right_meter_modes="1 2 2 2 2"; + hide_function_bar="0"; + }; + }; +} diff --git a/programs/neovim.nix b/programs/neovim.nix new file mode 100644 index 0000000..7c085db --- /dev/null +++ b/programs/neovim.nix @@ -0,0 +1,33 @@ +{ config, pkgs, lib, ... }: + +{ + programs.neovim = { + defaultEditor = true; + enable = true; + viAlias = true; + vimAlias = true; + vimdiffAlias = true; + coc = { enable = true; }; + extraConfig = '' + set title + set number + set relativenumber + set cursorline + set mouse=a + syntax enable + let g:NERDTreeShowHidden = 1 + let g:NERDTreeMinimalUI = 1 + let g:NERDTreeIgnore = [ '.git/' ] + let g:NERDTreeStatusline = "" + let g:NERDTreeMouseMode = 2 + autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif + nnoremap :NERDTreeToggle + ''; + plugins = with pkgs.vimPlugins; [ + nerdtree + vim-devicons + # fzf + ale + ]; + }; +} diff --git a/programs/starship.nix b/programs/starship.nix new file mode 100644 index 0000000..36b570b --- /dev/null +++ b/programs/starship.nix @@ -0,0 +1,12 @@ +{ config, pkgs, lib, ... }: + +{ + programs.starship = { + enable = true; + settings = { + add_newline = false; + character = { success_symbol = "[❯](bold white)"; }; + package = { disabled = true; }; + }; + }; +} diff --git a/programs/topgrade.nix b/programs/topgrade.nix new file mode 100644 index 0000000..3cc1146 --- /dev/null +++ b/programs/topgrade.nix @@ -0,0 +1,16 @@ +{ config, pkgs, lib, ... }: + +{ + programs.topgrade = { + enable = true; + settings = { + assume_yes = true; + ignore_failures = [ "git_repos" ]; + no_retry = true; + pre_sudo = false; + cleanup = true; + skip_notify = true; + firmware = { upgrade = true; }; + }; + }; +} diff --git a/programs/vscode.nix b/programs/vscode.nix new file mode 100644 index 0000000..e3d44cc --- /dev/null +++ b/programs/vscode.nix @@ -0,0 +1,26 @@ +{ config, pkgs, lib, ... }: +let + nixgl = import { }; + nixGLWrap = pkg: + pkgs.runCommand "${pkg.name}-nixgl-wrapper" { } '' + mkdir $out + ln -s ${pkg}/* $out + rm $out/bin + mkdir $out/bin + for bin in ${pkg}/bin/*; do + wrapped_bin=$out/bin/$(basename $bin) + echo -e "#!/bin/bash\nexec ${lib.getExe nixgl.auto.nixGLDefault} $bin \$@" > $wrapped_bin + chmod +x $wrapped_bin + done + ''; +in { + programs = { + vscode = { + enable = true; + package = (nixGLWrap (pkgs.vscode.override { + commandLineArgs = + "--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --gtk-version=4"; + })); + }; + }; +} diff --git a/programs/yt-dlp.nix b/programs/yt-dlp.nix new file mode 100644 index 0000000..6dc8f6d --- /dev/null +++ b/programs/yt-dlp.nix @@ -0,0 +1,9 @@ +{ config, pkgs, lib, ... }: + +{ + programs.yt-dlp = { + enable = true; + }; +} + + diff --git a/programs/zsh.nix b/programs/zsh.nix new file mode 100644 index 0000000..8aadb0f --- /dev/null +++ b/programs/zsh.nix @@ -0,0 +1,42 @@ +{ config, pkgs, lib, ... }: + +{ + programs.zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + enableSyntaxHighlighting = true; + enableVteIntegration = true; + shellAliases = { + pub-ipv4 = "curl ip4.clerie.de"; + serve = "python -m SimpleHTTPServer 8080"; + week = "date +%V"; + path = "echo -e \${PATH//:/\\n}"; + distro = "cat /etc/*-release"; + reload = "source ~/.zshrc"; + undo-git-reset-head = "git reset 'HEAD@{1}'"; + update-local = "bash $HOME/.dotfiles/install"; + }; + zplug = { + enable = true; + plugins = [ + { + name = "plugins/git"; + tags = [ from:oh-my-zsh ]; + } + { + name = "plugins/archlinux"; + tags = [ from:oh-my-zsh ]; + } + { + name = "plugins/composer"; + tags = [ from:oh-my-zsh ]; + } + { + name = "plugins/colored-man-pages"; + tags = [ from:oh-my-zsh ]; + } + ]; + }; + }; +}