diff --git a/.gitignore b/.gitignore index e69de29..9934212 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +home/dots/qtile/.direnv +mullvad/inactive diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ec57d20 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "rhizome-vps"] + path = rhizome-vps + url = https://git.rhizome.tf/rhizome/server-config diff --git a/.nvidia-settings-rc b/.nvidia-settings-rc deleted file mode 100755 index 9b3da83..0000000 --- a/.nvidia-settings-rc +++ /dev/null @@ -1,20 +0,0 @@ -# -# /home/bolt/.nvidia-settings-rc -# -# Configuration file for nvidia-settings - the NVIDIA Settings utility -# Generated on Sat Jan 7 20:25:59 2023 -# - -# ConfigProperties: - -RcFileLocale = C -DisplayStatusBar = Yes -SliderTextEntries = Yes -IncludeDisplayNameInConfigFile = No -UpdateRulesOnProfileNameChange = Yes -Timer = PowerMizer_Monitor_(GPU_0),Yes,1000 -Timer = Thermal_Monitor_(GPU_0),Yes,1000 -Timer = Memory_Used_(GPU_0),Yes,3000 - -# Attributes: - diff --git a/.p10k.zsh b/.p10k.zsh deleted file mode 100755 index e6f0698..0000000 --- a/.p10k.zsh +++ /dev/null @@ -1,1729 +0,0 @@ -# Generated by Powerlevel10k configuration wizard on 2022-08-17 at 23:20 AEST. -# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh. -# Wizard options: nerdfont-complete + powerline, small icons, rainbow, unicode, -# slanted separators, round heads, sharp tails, 2 lines, disconnected, left frame, -# light-ornaments, sparse, many icons, fluent, transient_prompt, instant_prompt=quiet. -# Type `p10k configure` to generate another config. -# -# Config for Powerlevel10k with powerline prompt style with colorful background. -# Type `p10k configure` to generate your own config based on it. -# -# Tip: Looking for a nice color? Here's a one-liner to print colormap. -# -# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done - -# Temporarily change options. -'builtin' 'local' '-a' 'p10k_config_opts' -[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') -[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') -[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') -'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' - -() { - emulate -L zsh -o extended_glob - - # Unset all configuration options. This allows you to apply configuration changes without - # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. - unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' - - # Zsh >= 5.1 is required. - autoload -Uz is-at-least && is-at-least 5.1 || return - - # The list of segments shown on the left. Fill it with the most important segments. - typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( - # =========================[ Line #1 ]========================= - os_icon # os identifier - dir # current directory - vcs # git status - # =========================[ Line #2 ]========================= - newline # \n - # prompt_char # prompt symbol - ) - - # The list of segments shown on the right. Fill it with less important segments. - # Right prompt on the last prompt line (where you are typing your commands) gets - # automatically hidden when the input line reaches it. Right prompt above the - # last prompt line gets hidden if it would overlap with left prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( - # =========================[ Line #1 ]========================= - status # exit code of the last command - command_execution_time # duration of the last command - background_jobs # presence of background jobs - direnv # direnv status (https://direnv.net/) - asdf # asdf version manager (https://github.com/asdf-vm/asdf) - virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) - anaconda # conda environment (https://conda.io/) - pyenv # python environment (https://github.com/pyenv/pyenv) - goenv # go environment (https://github.com/syndbg/goenv) - nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) - nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) - nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) - # node_version # node.js version - # go_version # go version (https://golang.org) - # rust_version # rustc version (https://www.rust-lang.org) - # dotnet_version # .NET version (https://dotnet.microsoft.com) - # php_version # php version (https://www.php.net/) - # laravel_version # laravel php framework version (https://laravel.com/) - # java_version # java version (https://www.java.com/) - # package # name@version from package.json (https://docs.npmjs.com/files/package.json) - rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) - rvm # ruby version from rvm (https://rvm.io) - fvm # flutter version management (https://github.com/leoafarias/fvm) - luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) - jenv # java version from jenv (https://github.com/jenv/jenv) - plenv # perl version from plenv (https://github.com/tokuhirom/plenv) - phpenv # php version from phpenv (https://github.com/phpenv/phpenv) - scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) - haskell_stack # haskell version from stack (https://haskellstack.org/) - kubecontext # current kubernetes context (https://kubernetes.io/) - terraform # terraform workspace (https://www.terraform.io) - # terraform_version # terraform version (https://www.terraform.io) - aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) - aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) - azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) - gcloud # google cloud cli account and project (https://cloud.google.com/) - google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) - toolbox # toolbox name (https://github.com/containers/toolbox) - context # user@hostname - nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) - ranger # ranger shell (https://github.com/ranger/ranger) - nnn # nnn shell (https://github.com/jarun/nnn) - xplr # xplr shell (https://github.com/sayanarijit/xplr) - vim_shell # vim shell indicator (:sh) - midnight_commander # midnight commander shell (https://midnight-commander.org/) - nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) - vi_mode # vi mode (you don't need this if you've enabled prompt_char) - # vpn_ip # virtual private network indicator - # load # CPU load - # disk_usage # disk usage - # ram # free RAM - # swap # used swap - todo # todo items (https://github.com/todotxt/todo.txt-cli) - timewarrior # timewarrior tracking status (https://timewarrior.net/) - taskwarrior # taskwarrior task count (https://taskwarrior.org/) - # time # current time - # =========================[ Line #2 ]========================= - newline - # ip # ip address and bandwidth usage for a specified network interface - # public_ip # public IP address - # proxy # system-wide http/https/ftp proxy - # battery # internal battery - # wifi # wifi speed - # example # example user-defined segment (see prompt_example function below) - ) - - # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. - typeset -g POWERLEVEL9K_MODE=nerdfont-complete - # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid - # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. - typeset -g POWERLEVEL9K_ICON_PADDING=none - - # When set to true, icons appear before content on both sides of the prompt. When set - # to false, icons go after content. If empty or not set, icons go before content in the left - # prompt and after content in the right prompt. - # - # You can also override it for a specific segment: - # - # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false - # - # Or for a specific segment in specific state: - # - # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false - typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT= - - # Add an empty line before each prompt. - typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true - - # Connect left prompt lines with these symbols. You'll probably want to use the same color - # as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%242F╭─' - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%242F├─' - typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%242F╰─' - # Connect right prompt lines with these symbols. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX= - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX= - typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX= - - # Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or - # '─'. The last two make it easier to see the alignment between left and right prompt and to - # separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false - # for more compact prompt if using using this option. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND= - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND= - if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then - # The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE - # ornaments defined above. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242 - # Start filler from the edge of the screen if there are no left segments on the first line. - typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' - # End filler on the edge of the screen if there are no right segments on the first line. - typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' - fi - - # Separator between same-color segments on the left. - typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\u2571' - # Separator between same-color segments on the right. - typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\u2571' - # Separator between different-color segments on the left. - typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0BC' - # Separator between different-color segments on the right. - typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0BA' - # The right end of left prompt. - typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B4' - # The left end of right prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B6' - # The left end of left prompt. - typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' - # The right end of right prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' - # Left prompt terminator for lines without any segments. - typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= - - #################################[ os_icon: os identifier ]################################## - # OS identifier color. - typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=232 - typeset -g POWERLEVEL9K_OS_ICON_BACKGROUND=7 - # Custom icon. - # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' - - ################################[ prompt_char: prompt symbol ]################################ - # Transparent background. - typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND= - # Green prompt symbol if the last command succeeded. - typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 - # Red prompt symbol if the last command failed. - typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 - # Default prompt symbol. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' - # Prompt symbol in command vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' - # Prompt symbol in visual vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' - # Prompt symbol in overwrite vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' - typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true - # No line terminator if prompt_char is the last segment. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= - # No line introducer if prompt_char is the first segment. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= - # No surrounding whitespace. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE= - - ##################################[ dir: current directory ]################################## - # Current directory background color. - typeset -g POWERLEVEL9K_DIR_BACKGROUND=4 - # Default current directory foreground color. - typeset -g POWERLEVEL9K_DIR_FOREGROUND=254 - # If directory is too long, shorten some of its segments to the shortest possible unique - # prefix. The shortened directory can be tab-completed to the original. - typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique - # Replace removed segment suffixes with this symbol. - typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= - # Color of the shortened directory segments. - typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=250 - # Color of the anchor directory segments. Anchor segments are never shortened. The first - # segment is always an anchor. - typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=255 - # Display anchor directory segments in bold. - typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true - # Don't shorten directories that contain any of these files. They are anchors. - local anchor_files=( - .bzr - .citc - .git - .hg - .node-version - .python-version - .go-version - .ruby-version - .lua-version - .java-version - .perl-version - .php-version - .tool-version - .shorten_folder_marker - .svn - .terraform - CVS - Cargo.toml - composer.json - go.mod - package.json - stack.yaml - ) - typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" - # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains - # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is - # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) - # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers - # and other directories don't. - # - # Optionally, "first" and "last" can be followed by ":" where is an integer. - # This moves the truncation point to the right (positive offset) or to the left (negative offset) - # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" - # respectively. - typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false - # Don't shorten this many last directory segments. They are anchors. - typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 - # Shorten directory if it's longer than this even if there is space for it. The value can - # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, - # directory will be shortened only when prompt doesn't fit or when other parameters demand it - # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). - # If set to `0`, directory will always be shortened to its minimum length. - typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 - # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this - # many columns for typing commands. - typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 - # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least - # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. - typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 - # If set to true, embed a hyperlink into the directory. Useful for quickly - # opening a directory in the file manager simply by clicking the link. - # Can also be handy when the directory is shortened, as it allows you to see - # the full directory that was used in previous commands. - typeset -g POWERLEVEL9K_DIR_HYPERLINK=false - - # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON - # and POWERLEVEL9K_DIR_CLASSES below. - typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 - - # The default icon shown next to non-writable and non-existent directories when - # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. - # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' - - # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different - # directories. It must be an array with 3 * N elements. Each triplet consists of: - # - # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with - # extended_glob option enabled. - # 2. Directory class for the purpose of styling. - # 3. An empty string. - # - # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. - # - # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories - # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_DIR_CLASSES=( - # '~/work(|/*)' WORK '' - # '~(|/*)' HOME '' - # '*' DEFAULT '') - # - # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one - # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or - # WORK_NON_EXISTENT. - # - # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an - # option to define custom colors and icons for different directory classes. - # - # # Styling for WORK. - # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_DIR_WORK_BACKGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=254 - # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=250 - # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=255 - # - # # Styling for WORK_NOT_WRITABLE. - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_BACKGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=254 - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=250 - # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=255 - # - # # Styling for WORK_NON_EXISTENT. - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_BACKGROUND=4 - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=254 - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=250 - # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=255 - # - # If a styling parameter isn't explicitly defined for some class, it falls back to the classless - # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls - # back to POWERLEVEL9K_DIR_FOREGROUND. - # - # typeset -g POWERLEVEL9K_DIR_CLASSES=() - - # Custom prefix. - # typeset -g POWERLEVEL9K_DIR_PREFIX='in ' - - #####################################[ vcs: git status ]###################################### - # Version control system colors. - typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2 - typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3 - typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2 - typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=3 - typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=8 - - # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. - typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 ' - - # Untracked files icon. It's really a question mark, your font isn't broken. - # Change the value of this parameter to show a different icon. - typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' - - # Formatter for Git status. - # - # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42. - # - # You can edit the function to customize how Git status looks. - # - # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: - # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. - function my_git_formatter() { - emulate -L zsh - - if [[ -n $P9K_CONTENT ]]; then - # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from - # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. - typeset -g my_git_format=$P9K_CONTENT - return - fi - - # Styling for different parts of Git status. - local meta='%7F' # white foreground - local clean='%0F' # black foreground - local modified='%0F' # black foreground - local untracked='%0F' # black foreground - local conflicted='%1F' # red foreground - - local res - - if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then - local branch=${(V)VCS_STATUS_LOCAL_BRANCH} - # If local branch name is at most 32 characters long, show it in full. - # Otherwise show the first 12 … the last 12. - # Tip: To always show local branch name in full without truncation, delete the next line. - (( $#branch > 32 )) && branch[13,-13]="…" # <-- this line - res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" - fi - - if [[ -n $VCS_STATUS_TAG - # Show tag only if not on a branch. - # Tip: To always show tag, delete the next line. - && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line - ]]; then - local tag=${(V)VCS_STATUS_TAG} - # If tag name is at most 32 characters long, show it in full. - # Otherwise show the first 12 … the last 12. - # Tip: To always show tag name in full without truncation, delete the next line. - (( $#tag > 32 )) && tag[13,-13]="…" # <-- this line - res+="${meta}#${clean}${tag//\%/%%}" - fi - - # Display the current Git commit if there is no branch and no tag. - # Tip: To always display the current Git commit, delete the next line. - [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line - res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" - - # Show tracking branch name if it differs from local branch. - if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then - res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" - fi - - # Display "wip" if the latest commit's summary contains "wip" or "WIP". - if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then - res+=" ${modified}wip" - fi - - # ⇣42 if behind the remote. - (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" - # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. - (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " - (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" - # ⇠42 if behind the push remote. - (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" - (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " - # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42. - (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}" - # *42 if have stashes. - (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" - # 'merge' if the repo is in an unusual state. - [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" - # ~42 if have merge conflicts. - (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" - # +42 if have staged changes. - (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" - # !42 if have unstaged changes. - (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" - # ?42 if have untracked files. It's really a question mark, your font isn't broken. - # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. - # Remove the next line if you don't want to see untracked files at all. - (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" - # "─" if the number of unstaged files is unknown. This can happen due to - # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower - # than the number of files in the Git index, or due to bash.showDirtyState being set to false - # in the repository config. The number of staged and untracked files may also be unknown - # in this case. - (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─" - - typeset -g my_git_format=$res - } - functions -M my_git_formatter 2>/dev/null - - # Don't count the number of unstaged, untracked and conflicted files in Git repositories with - # more than this many files in the index. Negative value means infinity. - # - # If you are working in Git repositories with tens of millions of files and seeing performance - # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output - # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's - # config: `git config bash.showDirtyState false`. - typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 - - # Don't show Git status in prompt for repositories whose workdir matches this pattern. - # For example, if set to '~', the Git repository at $HOME/.git will be ignored. - # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. - typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' - - # Disable the default Git status formatting. - typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true - # Install our own Git status formatter. - typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter()))+${my_git_format}}' - # Enable counters for staged, unstaged, etc. - typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 - - # Custom icon. - # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - typeset -g POWERLEVEL9K_VCS_PREFIX='on ' - - # Show status of repositories of these types. You can add svn and/or hg if you are - # using them. If you do, your prompt may become slow even when your current directory - # isn't in an svn or hg reposotiry. - typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) - - ##########################[ status: exit code of the last command ]########################### - # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and - # style them independently from the regular OK and ERROR state. - typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true - - # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as - # it will signify success by turning green. - typeset -g POWERLEVEL9K_STATUS_OK=true - typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔' - typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=2 - typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND=0 - - # Status when some part of a pipe command fails but the overall exit status is zero. It may look - # like this: 1|0. - typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true - typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' - typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=2 - typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0 - - # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as - # it will signify error by turning red. - typeset -g POWERLEVEL9K_STATUS_ERROR=true - typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' - typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=3 - typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=1 - - # Status when the last command was terminated by a signal. - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true - # Use terse signal names: "INT" instead of "SIGINT(2)". - typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=3 - typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_BACKGROUND=1 - - # Status when some part of a pipe command fails and the overall exit status is also non-zero. - # It may look like this: 1|0. - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=3 - typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_BACKGROUND=1 - - ###################[ command_execution_time: duration of the last command ]################### - # Execution time color. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0 - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=3 - # Show duration of the last command if takes at least this many seconds. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 - # Show this many fractional digits. Zero means round to seconds. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 - # Duration format: 1d 2h 3m 4s. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' - # Custom icon. - # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='took ' - - #######################[ background_jobs: presence of background jobs ]####################### - # Background jobs color. - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=6 - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=0 - # Don't show the number of background jobs. - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false - # Custom icon. - # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######################[ direnv: direnv status (https://direnv.net/) ]######################## - # Direnv color. - typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3 - typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### - # Default asdf color. Only used to display tools for which there is no color override (see below). - # Tip: Override these parameters for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND and - # POWERLEVEL9K_ASDF_${TOOL}_BACKGROUND. - typeset -g POWERLEVEL9K_ASDF_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_BACKGROUND=7 - - # There are four parameters that can be used to hide asdf tools. Each parameter describes - # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at - # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to - # hide a tool, it gets shown. - # - # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and - # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: - # - # asdf local python 3.8.1 - # asdf global python 3.8.1 - # - # After running both commands the current python version is 3.8.1 and its source is "local" as - # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, - # it'll hide python version in this case because 3.8.1 is the same as the global version. - # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't - # contain "local". - - # Hide tool versions that don't come from one of these sources. - # - # Available sources: - # - # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" - # - local `asdf current` says "set by /some/not/home/directory/file" - # - global `asdf current` says "set by /home/username/file" - # - # Note: If this parameter is set to (shell local global), it won't hide tools. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. - typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) - - # If set to false, hide tool versions that are the same as global. - # - # Note: The name of this parameter doesn't reflect its meaning at all. - # Note: If this parameter is set to true, it won't hide tools. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. - typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false - - # If set to false, hide tool versions that are equal to "system". - # - # Note: If this parameter is set to true, it won't hide tools. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. - typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true - - # If set to non-empty value, hide tools unless there is a file matching the specified file pattern - # in the current directory, or its parent directory, or its grandparent directory, and so on. - # - # Note: If this parameter is set to empty value, it won't hide tools. - # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. - # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. - # - # Example: Hide nodejs version when there is no package.json and no *.js files in the current - # directory, in `..`, in `../..` and so on. - # - # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' - typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= - - # Ruby version from asdf. - typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_RUBY_BACKGROUND=1 - # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Python version from asdf. - typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_PYTHON_BACKGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Go version from asdf. - typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_GOLANG_BACKGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Node.js version from asdf. - typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_NODEJS_BACKGROUND=2 - # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Rust version from asdf. - typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_RUST_BACKGROUND=208 - # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' - - # .NET Core version from asdf. - typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_BACKGROUND=5 - # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Flutter version from asdf. - typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_FLUTTER_BACKGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Lua version from asdf. - typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_LUA_BACKGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Java version from asdf. - typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=1 - typeset -g POWERLEVEL9K_ASDF_JAVA_BACKGROUND=7 - # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Perl version from asdf. - typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_PERL_BACKGROUND=4 - # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Erlang version from asdf. - typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_ERLANG_BACKGROUND=1 - # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Elixir version from asdf. - typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_ELIXIR_BACKGROUND=5 - # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Postgres version from asdf. - typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_POSTGRES_BACKGROUND=6 - # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' - - # PHP version from asdf. - typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_PHP_BACKGROUND=5 - # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Haskell version from asdf. - typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_HASKELL_BACKGROUND=3 - # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' - - # Julia version from asdf. - typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=0 - typeset -g POWERLEVEL9K_ASDF_JULIA_BACKGROUND=2 - # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' - - ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### - # NordVPN connection indicator color. - typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7 - typeset -g POWERLEVEL9K_NORDVPN_BACKGROUND=4 - # Hide NordVPN connection indicator when not connected. - typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= - typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= - # Custom icon. - # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## - # Ranger shell color. - typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 - typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### - # Nnn shell color. - typeset -g POWERLEVEL9K_NNN_FOREGROUND=0 - typeset -g POWERLEVEL9K_NNN_BACKGROUND=6 - # Custom icon. - # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## - # xplr shell color. - typeset -g POWERLEVEL9K_XPLR_FOREGROUND=0 - typeset -g POWERLEVEL9K_XPLR_BACKGROUND=6 - # Custom icon. - # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########################[ vim_shell: vim shell indicator (:sh) ]########################### - # Vim shell indicator color. - typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0 - typeset -g POWERLEVEL9K_VIM_SHELL_BACKGROUND=2 - # Custom icon. - # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### - # Midnight Commander shell color. - typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 - typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## - # Nix shell color. - typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0 - typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4 - - # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. - # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= - - # Custom icon. - # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##################################[ disk_usage: disk usage ]################################## - # Colors for different levels of disk usage. - typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=3 - typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_BACKGROUND=0 - typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=0 - typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_BACKGROUND=3 - typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=7 - typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_BACKGROUND=1 - # Thresholds for different levels of disk usage (percentage points). - typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 - typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 - # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. - typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false - # Custom icon. - # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]########### - # Foreground color. - typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0 - # Text and color for normal (a.k.a. command) vi mode. - typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL - typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2 - # Text and color for visual vi mode. - typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL - typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4 - # Text and color for overtype (a.k.a. overwrite and replace) vi mode. - typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE - typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3 - # Text and color for insert vi mode. - typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= - typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8 - - ######################################[ ram: free RAM ]####################################### - # RAM color. - typeset -g POWERLEVEL9K_RAM_FOREGROUND=0 - typeset -g POWERLEVEL9K_RAM_BACKGROUND=3 - # Custom icon. - # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #####################################[ swap: used swap ]###################################### - # Swap color. - typeset -g POWERLEVEL9K_SWAP_FOREGROUND=0 - typeset -g POWERLEVEL9K_SWAP_BACKGROUND=3 - # Custom icon. - # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ######################################[ load: CPU load ]###################################### - # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. - typeset -g POWERLEVEL9K_LOAD_WHICH=5 - # Load color when load is under 50%. - typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=0 - typeset -g POWERLEVEL9K_LOAD_NORMAL_BACKGROUND=2 - # Load color when load is between 50% and 70%. - typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=0 - typeset -g POWERLEVEL9K_LOAD_WARNING_BACKGROUND=3 - # Load color when load is over 70%. - typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=0 - typeset -g POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND=1 - # Custom icon. - # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ - # Todo color. - typeset -g POWERLEVEL9K_TODO_FOREGROUND=0 - typeset -g POWERLEVEL9K_TODO_BACKGROUND=8 - # Hide todo when the total number of tasks is zero. - typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true - # Hide todo when the number of tasks after filtering is zero. - typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false - - # Todo format. The following parameters are available within the expansion. - # - # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. - # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. - # - # These variables correspond to the last line of the output of `todo.sh -p ls`: - # - # TODO: 24 of 42 tasks shown - # - # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. - # - # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' - - # Custom icon. - # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ - # Timewarrior color. - typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=255 - typeset -g POWERLEVEL9K_TIMEWARRIOR_BACKGROUND=8 - - # If the tracked task is longer than 24 characters, truncate and append "…". - # Tip: To always display tasks without truncation, delete the following parameter. - # Tip: To hide task names and display just the icon when time tracking is enabled, set the - # value of the following parameter to "". - typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+…}' - - # Custom icon. - # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## - # Taskwarrior color. - typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=0 - typeset -g POWERLEVEL9K_TASKWARRIOR_BACKGROUND=6 - - # Taskwarrior segment format. The following parameters are available within the expansion. - # - # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. - # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. - # - # Zero values are represented as empty parameters. - # - # The default format: - # - # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' - # - # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' - - # Custom icon. - # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##################################[ context: user@hostname ]################################## - # Context color when running with privileges. - typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 - typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=0 - # Context color in SSH without privileges. - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=3 - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=0 - # Default context color (no privileges, no SSH). - typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=3 - typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=0 - - # Context format when running with privileges: user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n@%m' - # Context format when in SSH without privileges: user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' - # Default context format (no privileges, no SSH): user@hostname. - typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' - - # Don't show context unless running with privileges or in SSH. - # Tip: Remove the next line to always show context. - typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= - - # Custom icon. - # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - typeset -g POWERLEVEL9K_CONTEXT_PREFIX='with ' - - ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### - # Python virtual environment color. - typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4 - # Don't show Python version next to the virtual environment name. - typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false - # If set to "false", won't show virtualenv if pyenv is already shown. - # If set to "if-different", won't show virtualenv if it's the same as pyenv. - typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false - # Separate environment name from Python version only with a space. - typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= - # Custom icon. - # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #####################[ anaconda: conda environment (https://conda.io/) ]###################### - # Anaconda environment color. - typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=0 - typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=4 - - # Anaconda segment format. The following parameters are available within the expansion. - # - # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. - # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. - # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). - # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). - # - # CONDA_PROMPT_MODIFIER can be configured with the following command: - # - # conda config --set env_prompt '({default_env}) ' - # - # The last argument is a Python format string that can use the following variables: - # - # - prefix The same as CONDA_PREFIX. - # - default_env The same as CONDA_DEFAULT_ENV. - # - name The last segment of CONDA_PREFIX. - # - stacked_env Comma-separated list of names in the environment stack. The first element is - # always the same as default_env. - # - # Note: '({default_env}) ' is the default value of env_prompt. - # - # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER - # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former - # is empty. - typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' - - # Custom icon. - # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ - # Pyenv color. - typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4 - # Hide python version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) - # If set to false, hide python version if it's the same as global: - # $(pyenv version-name) == $(pyenv global). - typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide python version if it's equal to "system". - typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true - - # Pyenv segment format. The following parameters are available within the expansion. - # - # - P9K_CONTENT Current pyenv environment (pyenv version-name). - # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). - # - # The default format has the following logic: - # - # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or - # starts with "$P9K_PYENV_PYTHON_VERSION/". - # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". - typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' - - # Custom icon. - # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ - # Goenv color. - typeset -g POWERLEVEL9K_GOENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_GOENV_BACKGROUND=4 - # Hide go version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) - # If set to false, hide go version if it's the same as global: - # $(goenv version-name) == $(goenv global). - typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide go version if it's equal to "system". - typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## - # Nodenv color. - typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 - typeset -g POWERLEVEL9K_NODENV_BACKGROUND=0 - # Hide node version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) - # If set to false, hide node version if it's the same as global: - # $(nodenv version-name) == $(nodenv global). - typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide node version if it's equal to "system". - typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### - # Nvm color. - typeset -g POWERLEVEL9K_NVM_FOREGROUND=0 - typeset -g POWERLEVEL9K_NVM_BACKGROUND=5 - # Custom icon. - # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ - # Nodeenv color. - typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 - typeset -g POWERLEVEL9K_NODEENV_BACKGROUND=0 - # Don't show Node version next to the environment name. - typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false - # Separate environment name from Node version only with a space. - typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= - # Custom icon. - # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##############################[ node_version: node.js version ]############################### - # Node version color. - typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=7 - typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=2 - # Show node version only when in a directory tree containing package.json. - typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######################[ go_version: go version (https://golang.org) ]######################## - # Go version color. - typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=255 - typeset -g POWERLEVEL9K_GO_VERSION_BACKGROUND=2 - # Show go version only when in a go project subdirectory. - typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## - # Rust version color. - typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=0 - typeset -g POWERLEVEL9K_RUST_VERSION_BACKGROUND=208 - # Show rust version only when in a rust project subdirectory. - typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ - # .NET version color. - typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=7 - typeset -g POWERLEVEL9K_DOTNET_VERSION_BACKGROUND=5 - # Show .NET version only when in a .NET project subdirectory. - typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #####################[ php_version: php version (https://www.php.net/) ]###################### - # PHP version color. - typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=0 - typeset -g POWERLEVEL9K_PHP_VERSION_BACKGROUND=5 - # Show PHP version only when in a PHP project subdirectory. - typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true - # Custom icon. - # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### - # Laravel version color. - typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=1 - typeset -g POWERLEVEL9K_LARAVEL_VERSION_BACKGROUND=7 - # Custom icon. - # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## - # Rbenv color. - typeset -g POWERLEVEL9K_RBENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_RBENV_BACKGROUND=1 - # Hide ruby version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) - # If set to false, hide ruby version if it's the same as global: - # $(rbenv version-name) == $(rbenv global). - typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide ruby version if it's equal to "system". - typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ####################[ java_version: java version (https://www.java.com/) ]#################### - # Java version color. - typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=1 - typeset -g POWERLEVEL9K_JAVA_VERSION_BACKGROUND=7 - # Show java version only when in a java project subdirectory. - typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true - # Show brief version. - typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false - # Custom icon. - # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### - # Package color. - typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=0 - typeset -g POWERLEVEL9K_PACKAGE_BACKGROUND=6 - - # Package format. The following parameters are available within the expansion. - # - # - P9K_PACKAGE_NAME The value of `name` field in package.json. - # - P9K_PACKAGE_VERSION The value of `version` field in package.json. - # - # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' - - # Custom icon. - # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## - # Rvm color. - typeset -g POWERLEVEL9K_RVM_FOREGROUND=0 - typeset -g POWERLEVEL9K_RVM_BACKGROUND=240 - # Don't show @gemset at the end. - typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false - # Don't show ruby- at the front. - typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false - # Custom icon. - # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ - # Fvm color. - typeset -g POWERLEVEL9K_FVM_FOREGROUND=0 - typeset -g POWERLEVEL9K_FVM_BACKGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### - # Lua color. - typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_LUAENV_BACKGROUND=4 - # Hide lua version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) - # If set to false, hide lua version if it's the same as global: - # $(luaenv version-name) == $(luaenv global). - typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide lua version if it's equal to "system". - typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ - # Java color. - typeset -g POWERLEVEL9K_JENV_FOREGROUND=1 - typeset -g POWERLEVEL9K_JENV_BACKGROUND=7 - # Hide java version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) - # If set to false, hide java version if it's the same as global: - # $(jenv version-name) == $(jenv global). - typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide java version if it's equal to "system". - typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ - # Perl color. - typeset -g POWERLEVEL9K_PLENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_PLENV_BACKGROUND=4 - # Hide perl version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) - # If set to false, hide perl version if it's the same as global: - # $(plenv version-name) == $(plenv global). - typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide perl version if it's equal to "system". - typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ - # PHP color. - typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_PHPENV_BACKGROUND=5 - # Hide php version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) - # If set to false, hide php version if it's the same as global: - # $(phpenv version-name) == $(phpenv global). - typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide PHP version if it's equal to "system". - typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### - # Scala color. - typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=0 - typeset -g POWERLEVEL9K_SCALAENV_BACKGROUND=1 - # Hide scala version if it doesn't come from one of these sources. - typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) - # If set to false, hide scala version if it's the same as global: - # $(scalaenv version-name) == $(scalaenv global). - typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false - # If set to false, hide scala version if it's equal to "system". - typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true - # Custom icon. - # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### - # Haskell color. - typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=0 - typeset -g POWERLEVEL9K_HASKELL_STACK_BACKGROUND=3 - - # Hide haskell version if it doesn't come from one of these sources. - # - # shell: version is set by STACK_YAML - # local: version is set by stack.yaml up the directory tree - # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) - typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) - # If set to false, hide haskell version if it's the same as in the implicit global project. - typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true - # Custom icon. - # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ terraform: terraform workspace (https://www.terraform.io) ]################# - # Don't show terraform workspace if it's literally "default". - typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false - # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current terraform workspace gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' OTHER) - # - # If your current terraform workspace is "project_test", its class is TEST because "project_test" - # doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=2 - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_BACKGROUND=0 - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' OTHER) - typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4 - typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=0 - # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #############[ terraform_version: terraform version (https://www.terraform.io) ]############## - # Terraform version color. - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]################# - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf' - - #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# - # Show kubecontext only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' - - # Kubernetes context classes for the purpose of using different colors, icons and expansions with - # different contexts. - # - # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current kubernetes context gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' DEFAULT) - # - # If your current kubernetes context is "deathray-testing/default", its class is TEST - # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=0 - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_BACKGROUND=2 - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=7 - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_BACKGROUND=5 - # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext - # segment. Parameter expansions are very flexible and fast, too. See reference: - # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. - # - # Within the expansion the following parameters are always available: - # - # - P9K_CONTENT The content that would've been displayed if there was no content - # expansion defined. - # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the - # output of `kubectl config get-contexts`. - # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the - # output of `kubectl config get-contexts`. - # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE - # in the output of `kubectl config get-contexts`. If there is no - # namespace, the parameter is set to "default". - # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the - # output of `kubectl config get-contexts`. - # - # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), - # the following extra parameters are available: - # - # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. - # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. - # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. - # - # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, - # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": - # - # - P9K_KUBECONTEXT_CLOUD_NAME=gke - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account - # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a - # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 - # - # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": - # - # - P9K_KUBECONTEXT_CLOUD_NAME=eks - # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 - # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 - # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 - typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= - # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. - POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' - # Append the current context's namespace if it's not "default". - POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' - - # Custom prefix. - typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at ' - - #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# - # Show aws only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show aws. - typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' - - # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current AWS profile gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_AWS_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' DEFAULT) - # - # If your current AWS profile is "company_test", its class is TEST - # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28 - # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_AWS_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=7 - typeset -g POWERLEVEL9K_AWS_DEFAULT_BACKGROUND=1 - # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # AWS segment format. The following parameters are available within the expansion. - # - # - P9K_AWS_PROFILE The name of the current AWS profile. - # - P9K_AWS_REGION The region associated with the current AWS profile. - typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' - - #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# - # AWS Elastic Beanstalk environment color. - typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 - typeset -g POWERLEVEL9K_AWS_EB_ENV_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## - # Show azure only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show azure. - typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' - # Azure account name color. - typeset -g POWERLEVEL9K_AZURE_FOREGROUND=7 - typeset -g POWERLEVEL9K_AZURE_BACKGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### - # Show gcloud only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show gcloud. - typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' - # Google cloud color. - typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7 - typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4 - - # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or - # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative - # enough. You can use the following parameters in the expansions. Each of them corresponds to the - # output of `gcloud` tool. - # - # Parameter | Source - # -------------------------|-------------------------------------------------------------------- - # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' - # P9K_GCLOUD_ACCOUNT | gcloud config get-value account - # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project - # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' - # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. - # - # Obtaining project name requires sending a request to Google servers. This can take a long time - # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud - # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets - # set and gcloud prompt segment transitions to state COMPLETE. - # - # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL - # and COMPLETE. You can also hide gcloud in state PARTIAL by setting - # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and - # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. - typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' - typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' - - # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name - # this often. Negative value disables periodic polling. In this mode project name is retrieved - # only when the current configuration, account or project id changes. - typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 - - # Custom icon. - # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# - # Show google_app_cred only when the command you are typing invokes one of these tools. - # Tip: Remove the next line to always show google_app_cred. - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' - - # Google application credentials classes for the purpose of using different colors, icons and - # expansions with different credentials. - # - # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first - # element in each pair defines a pattern against which the current kubernetes context gets - # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion - # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION - # parameters, you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. - # The first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( - # '*:*prod*:*' PROD - # '*:*test*:*' TEST - # '*' DEFAULT) - # - # If your current Google application credentials is "service_account deathray-testing x@y.com", - # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28 - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( - # '*:*prod*:*' PROD # These values are examples that are unlikely - # '*:*test*:*' TEST # to match your needs. Customize them as needed. - '*' DEFAULT) - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=7 - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_BACKGROUND=4 - # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by - # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: - # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. - # - # You can use the following parameters in the expansion. Each of them corresponds to one of the - # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. - # - # Parameter | JSON key file field - # ---------------------------------+--------------- - # P9K_GOOGLE_APP_CRED_TYPE | type - # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id - # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email - # - # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. - typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' - - ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### - # Toolbox color. - typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=0 - typeset -g POWERLEVEL9K_TOOLBOX_BACKGROUND=3 - # Don't display the name of the toolbox if it matches fedora-toolbox-*. - typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' - # Custom icon. - # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='in ' - - ###############################[ public_ip: public IP address ]############################### - # Public IP color. - typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7 - typeset -g POWERLEVEL9K_PUBLIC_IP_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ########################[ vpn_ip: virtual private network indicator ]######################### - # VPN IP color. - typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=0 - typeset -g POWERLEVEL9K_VPN_IP_BACKGROUND=6 - # When on VPN, show just an icon without the IP address. - # Tip: To display the private IP address when on VPN, remove the next line. - typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= - # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN - # to see the name of the interface. - typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*' - # If set to true, show one segment per matching network interface. If set to false, show only - # one segment corresponding to the first matching network interface. - # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. - typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false - # Custom icon. - # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### - # IP color. - typeset -g POWERLEVEL9K_IP_BACKGROUND=4 - typeset -g POWERLEVEL9K_IP_FOREGROUND=0 - # The following parameters are accessible within the expansion: - # - # Parameter | Meaning - # ----------------------+------------------------------------------- - # P9K_IP_IP | IP address - # P9K_IP_INTERFACE | network interface - # P9K_IP_RX_BYTES | total number of bytes received - # P9K_IP_TX_BYTES | total number of bytes sent - # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt - # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt - # P9K_IP_RX_RATE | receive rate (since last prompt) - # P9K_IP_TX_RATE | send rate (since last prompt) - typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='${P9K_IP_RX_RATE:+⇣$P9K_IP_RX_RATE }${P9K_IP_TX_RATE:+⇡$P9K_IP_TX_RATE }$P9K_IP_IP' - # Show information for the first network interface whose name matches this regular expression. - # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. - typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' - # Custom icon. - # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #########################[ proxy: system-wide http/https/ftp proxy ]########################## - # Proxy color. - typeset -g POWERLEVEL9K_PROXY_FOREGROUND=4 - typeset -g POWERLEVEL9K_PROXY_BACKGROUND=0 - # Custom icon. - # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' - - ################################[ battery: internal battery ]################################# - # Show battery in red when it's below this level and not connected to power supply. - typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 - typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1 - # Show battery in green when it's charging or fully charged. - typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=2 - # Show battery in yellow when it's discharging. - typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3 - # Battery pictograms going from low to high level of charge. - typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578' - # Don't show the remaining time to charge/discharge. - typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false - typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=0 - - #####################################[ wifi: wifi speed ]##################################### - # WiFi color. - typeset -g POWERLEVEL9K_WIFI_FOREGROUND=0 - typeset -g POWERLEVEL9K_WIFI_BACKGROUND=4 - # Custom icon. - # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). - # - # # Wifi colors and icons for different signal strength levels (low to high). - # typeset -g my_wifi_fg=(0 0 0 0 0) # <-- change these values - # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values - # - # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' - # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' - # - # The following parameters are accessible within the expansions: - # - # Parameter | Meaning - # ----------------------+--------------- - # P9K_WIFI_SSID | service set identifier, a.k.a. network name - # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown - # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second - # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 - # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 - # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) - - ####################################[ time: current time ]#################################### - # Current time color. - typeset -g POWERLEVEL9K_TIME_FOREGROUND=0 - typeset -g POWERLEVEL9K_TIME_BACKGROUND=7 - # Format for the current time: 09:51:02. See `man 3 strftime`. - typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' - # If set to true, time will update when you hit enter. This way prompts for the past - # commands will contain the start times of their commands as opposed to the default - # behavior where they contain the end times of their preceding commands. - typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false - # Custom icon. - # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' - # Custom prefix. - typeset -g POWERLEVEL9K_TIME_PREFIX='at ' - - # Example of a user-defined prompt segment. Function prompt_example will be called on every - # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or - # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and yellow text on red background - # greeting the user. - # - # Type `p10k help segment` for documentation and a more sophisticated example. - function prompt_example() { - p10k segment -b 1 -f 3 -i '⭐' -t 'hello, %n' - } - - # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job - # is to generate the prompt segment for display in instant prompt. See - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. - # - # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function - # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k - # will replay these calls without actually calling instant_prompt_*. It is imperative that - # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this - # rule is not observed, the content of instant prompt will be incorrect. - # - # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If - # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. - function instant_prompt_example() { - # Since prompt_example always makes the same `p10k segment` calls, we can call it from - # instant_prompt_example. This will give us the same `example` prompt segment in the instant - # and regular prompts. - prompt_example - } - - # User-defined prompt segments can be customized the same way as built-in segments. - typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=3 - typeset -g POWERLEVEL9K_EXAMPLE_BACKGROUND=1 - # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' - - # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt - # when accepting a command line. Supported values: - # - # - off: Don't change prompt when accepting a command line. - # - always: Trim down prompt when accepting a command line. - # - same-dir: Trim down prompt when accepting a command line unless this is the first command - # typed after changing current working directory. - typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always - - # Instant prompt mode. - # - # - off: Disable instant prompt. Choose this if you've tried instant prompt and found - # it incompatible with your zsh configuration files. - # - quiet: Enable instant prompt and don't print warnings when detecting console output - # during zsh initialization. Choose this if you've read and understood - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. - # - verbose: Enable instant prompt and print a warning when detecting console output during - # zsh initialization. Choose this if you've never tried instant prompt, haven't - # seen the warning, or if you are unsure what this all means. - typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet - - # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. - # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload - # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you - # really need it. - typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true - - # If p10k is already loaded, reload configuration. - # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. - (( ! $+functions[p10k] )) || p10k reload -} - -# Tell `p10k configure` which file it should overwrite. -typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} - -(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} -'builtin' 'unset' 'p10k_config_opts' diff --git a/TODO b/TODO new file mode 100644 index 0000000..abc7c3a --- /dev/null +++ b/TODO @@ -0,0 +1,7 @@ +REPLACE HOME MANAGER WITH +pkgs.writers and HJEM + +implement agenix + +figure out a way to get firefox policies and plugins set up in webapps + diff --git a/create.nix b/create.nix new file mode 100644 index 0000000..ba939a8 --- /dev/null +++ b/create.nix @@ -0,0 +1,53 @@ +{ + system, + inputs, + sharedModules, + ... +}: +with inputs; +let + nix-rice = import "${inputs.nix-rice}/lib.nix" { + inherit (nixpkgs) lib; + kitty-themes-src = { }; + }; + rice = import ./rice { + inherit + inputs + system + nix-rice + ; + }; +in +{ + systems = + definitions: + nixpkgs.lib.mapAttrs ( + name: info: + nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs rice; + mainUser = info.user; + }; + modules = + [ + ./system/${name}.nix + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + extraSpecialArgs = { + inherit inputs rice nix-rice; + mainUser = info.user; + }; + users.${info.user}.imports = [ + ./home/${info.user}.nix + ] ++ info.hmImports or [ ]; + }; + } + ] + ++ info.imports or [ ] + ++ sharedModules; + } + ) definitions; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a971962 --- /dev/null +++ b/flake.lock @@ -0,0 +1,1156 @@ +{ + "nodes": { + "comfyui": { + "inputs": { + "comfyui": "comfyui_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1, + "narHash": "sha256-D42CCiTeYTyVERflL0WkWrz0LmkoXmUIsGAd9RSZIW0=", + "path": "./flakes/comfyui", + "type": "path" + }, + "original": { + "path": "./flakes/comfyui", + "type": "path" + } + }, + "comfyui-plugins": { + "inputs": { + "gguf": "gguf", + "nixpkgs": [ + "nixpkgs" + ], + "openpose": "openpose", + "tensorrt": "tensorrt" + }, + "locked": { + "lastModified": 1, + "narHash": "sha256-q/vKhxywSAPm1cwYIMs+s6kcY8mUdhXMH//PwBP1k3s=", + "path": "./flakes/comfyui-plugins", + "type": "path" + }, + "original": { + "path": "./flakes/comfyui-plugins", + "type": "path" + } + }, + "comfyui_2": { + "flake": false, + "locked": { + "lastModified": 1739165060, + "narHash": "sha256-DLiv96ynd+p4lXgvNMqgSklWFciLX+l+nXlu5MYVrg8=", + "owner": "comfyanonymous", + "repo": "ComfyUI", + "rev": "4027466c802d174d76347726d74de73c39acedb3", + "type": "github" + }, + "original": { + "owner": "comfyanonymous", + "repo": "ComfyUI", + "type": "github" + } + }, + "culr": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1738972869, + "narHash": "sha256-meaUvbOADLsUCsAT/vMecmfVpq0Jqypynq8hCUl9Mps=", + "ref": "refs/heads/master", + "rev": "40feebba44d4722706b66ac51e1997cb630c09c9", + "revCount": 68, + "type": "git", + "url": "https://git.atagen.co/atagen/culr" + }, + "original": { + "type": "git", + "url": "https://git.atagen.co/atagen/culr" + } + }, + "fenix": { + "inputs": { + "nixpkgs": [ + "nyx", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1749623906, + "narHash": "sha256-QD7e5WNVj4aWS5mlJZZnLJ6Lg0h5RSyyEFo2I6xBUEQ=", + "owner": "nix-community", + "repo": "fenix", + "rev": "873cccc628f5e39407e319e6711f3b7d6d1f15cc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-schemas": { + "locked": { + "lastModified": 1721999734, + "narHash": "sha256-G5CxYeJVm4lcEtaO87LKzOsVnWeTcHGKbKxNamNWgOw=", + "rev": "0a5c42297d870156d9c57d8f99e476b738dcd982", + "revCount": 75, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.5/0190ef2f-61e0-794b-ba14-e82f225e55e6/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%3D0.1.5.tar.gz" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flakey-profile": { + "locked": { + "lastModified": 1712898590, + "narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=", + "owner": "lf-", + "repo": "flakey-profile", + "rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d", + "type": "github" + }, + "original": { + "owner": "lf-", + "repo": "flakey-profile", + "type": "github" + } + }, + "gguf": { + "flake": false, + "locked": { + "lastModified": 1736350217, + "narHash": "sha256-3RqFfvXdn9sCIlctqa14c2fvluSmJCR+llfZo/MV64o=", + "owner": "city96", + "repo": "ComfyUI-GGUF", + "rev": "5875c52f59baca3a9372d68c43a3775e21846fe0", + "type": "github" + }, + "original": { + "owner": "city96", + "repo": "ComfyUI-GGUF", + "type": "github" + } + }, + "git-hooks-nix": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": "nixpkgs_7" + }, + "locked": { + "lastModified": 1747372754, + "narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nix-rice", + "git-hooks-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "helix": { + "inputs": { + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1749738489, + "narHash": "sha256-qjal0TFAqArHqOVdf+Wicn1PIWOkOom+tonW0ou5cns=", + "owner": "helix-editor", + "repo": "helix", + "rev": "62f270e5d2fb34a77dd30a3b2e6b4c9fb6f1cfe1", + "type": "github" + }, + "original": { + "owner": "helix-editor", + "repo": "helix", + "type": "github" + } + }, + "hjem": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749346462, + "narHash": "sha256-bwHFWwfiAfk+jsvYlFqo55+R0cCgDu3ILIGqOhA/k5I=", + "owner": "feel-co", + "repo": "hjem", + "rev": "4dc5dc97ef052d563fe0b2f004b93d92748ae2d3", + "type": "github" + }, + "original": { + "owner": "feel-co", + "repo": "hjem", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749657191, + "narHash": "sha256-QLilaHuhGxiwhgceDWESj9gFcKIdEp7+9lRqNGpN8S4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "faeab32528a9360e9577ff4082de2d35c6bbe1ce", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nyx", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749649116, + "narHash": "sha256-pCuUfMkhlP+XqW+TXX5Tssk8IE4TpS3MbG7OQtvaQdM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "02040b7777f65342b96c7f826a5c6aef95585057", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "hudcore": { + "inputs": { + "nix-systems": "nix-systems", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1746619291, + "narHash": "sha256-ovf7GLXUACHPw48TJJMJfRrva3go+RHvHYmiqwTeYXs=", + "ref": "refs/heads/main", + "rev": "8a627ef8b08b6ec5b1f0b4a09f6b4d3ef8233a1f", + "revCount": 1, + "type": "git", + "url": "https://git.atagen.co/atagen/hudcore-plymouth.git" + }, + "original": { + "type": "git", + "url": "https://git.atagen.co/atagen/hudcore-plymouth.git" + } + }, + "jovian": { + "inputs": { + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "nyx", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749627191, + "narHash": "sha256-bUv8CDE6Uyxak4UkOvRjx5xj6+msEHSpYGeAjkuTnTs=", + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "rev": "f31df4cb6b2eeef6cf0113edb687297be72a69df", + "type": "github" + }, + "original": { + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "type": "github" + } + }, + "kitty-themes-src": { + "flake": false, + "locked": { + "lastModified": 1747968735, + "narHash": "sha256-QQiRdyOL8svPxQ3/D0CjstBMDJ5Xapm6zfDSoo31GME=", + "owner": "kovidgoyal", + "repo": "kitty-themes", + "rev": "e23ccc1b1f23d404950bc3a0900ee4856448c111", + "type": "github" + }, + "original": { + "owner": "kovidgoyal", + "repo": "kitty-themes", + "type": "github" + } + }, + "lix": { + "flake": false, + "locked": { + "lastModified": 1749682763, + "narHash": "sha256-DDhns3NS6L5OlYR0mSX03I5D7uGLyyd3MZegd1wTCyc=", + "rev": "ee0655240270480d7f6063dcf12ec47f04d2ded6", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/ee0655240270480d7f6063dcf12ec47f04d2ded6.tar.gz?rev=ee0655240270480d7f6063dcf12ec47f04d2ded6" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/lix/archive/main.tar.gz" + } + }, + "lix-module": { + "inputs": { + "flake-utils": "flake-utils_2", + "flakey-profile": "flakey-profile", + "lix": [ + "lix" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1747667424, + "narHash": "sha256-7EICjbmG6lApWKhFtwvZovdcdORY1CEe6/K7JwtpYfs=", + "rev": "3c23c6ae2aecc1f76ae7993efe1a78b5316f0700", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/3c23c6ae2aecc1f76ae7993efe1a78b5316f0700.tar.gz?rev=3c23c6ae2aecc1f76ae7993efe1a78b5316f0700" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz" + } + }, + "meat": { + "inputs": { + "flake-utils": "flake-utils_3", + "lix": [ + "lix" + ], + "lix-module": [ + "lix-module" + ], + "nh": "nh", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1738972856, + "narHash": "sha256-MsdhIWg/CgbgdJv9Zf8Be3uHr8sB/I2LGBmKQa1PWdA=", + "ref": "refs/heads/master", + "rev": "01aa149c2f5358fb54407678641ef7644056aa3a", + "revCount": 35, + "type": "git", + "url": "https://git.atagen.co/atagen/meat" + }, + "original": { + "type": "git", + "url": "https://git.atagen.co/atagen/meat" + } + }, + "nh": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1732089528, + "narHash": "sha256-+yXeJiSFn96pW6H/50DfCfZiOLSfZNGhK7R4f0aUvGY=", + "owner": "viperML", + "repo": "nh", + "rev": "cff51af0ebb09227070b0332c598c7a4b7f8175a", + "type": "github" + }, + "original": { + "owner": "viperML", + "repo": "nh", + "type": "github" + } + }, + "nil": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_4", + "rust-overlay": "rust-overlay_2" + }, + "locked": { + "lastModified": 1749715644, + "narHash": "sha256-qNWrlp36tozupgOeELQ9N5c0nm0iVqufOt21s5GBV5o=", + "owner": "oxalica", + "repo": "nil", + "rev": "58b7742777037fd76fc244e1192433131e05f21c", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "nil", + "type": "github" + } + }, + "niri": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": "nixpkgs_5", + "nixpkgs-stable": "nixpkgs-stable", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1749733665, + "narHash": "sha256-AwRmmdaFfkUm5R5pdxdf/AxAfRdlHmj4y6Vqr7lUd6Q=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "343436b057c744f0df61eccfe9224a66fc9376eb", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1740117926, + "narHash": "sha256-mTTHA0RAaQcdYe+9A3Jx77cmmyLFHmRoZdd8RpWa+m8=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "b94a5db8790339cf9134873d8b490be69e02ac71", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v25.02", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1749731089, + "narHash": "sha256-zUNOAc4riq7mQgRVcrO7EyyhBqNdD6b7B9OHCFuGUT4=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "a23ce10311d2be91777099b90d8ca755a6b636e9", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "nyx", + "jovian", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729697500, + "narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=", + "owner": "zhaofengli", + "repo": "nix-github-actions", + "rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "ref": "matrix-name", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nix-index-database": { + "inputs": { + "nixpkgs": "nixpkgs_6" + }, + "locked": { + "lastModified": 1749355504, + "narHash": "sha256-L17CdJMD+/FCBOHjREQLXbe2VUnc3rjffenBbu2Kwpc=", + "owner": "Mic92", + "repo": "nix-index-database", + "rev": "40a6e15e44b11fbf8f2b1df9d64dbfc117625e94", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-index-database", + "type": "github" + } + }, + "nix-rice": { + "inputs": { + "flake-parts": "flake-parts", + "git-hooks-nix": "git-hooks-nix", + "kitty-themes-src": "kitty-themes-src", + "nixpkgs": "nixpkgs_8", + "nixpkgs-lib": "nixpkgs-lib_2", + "systems": "systems_5" + }, + "locked": { + "lastModified": 1748538518, + "narHash": "sha256-fEUmBnAD9hRKM2RtwKq6whMme1uQQngrXp7aMPKMAl4=", + "owner": "bertof", + "repo": "nix-rice", + "rev": "3a31c56b1bcd48a894442631b056e8aaeaf76834", + "type": "github" + }, + "original": { + "owner": "bertof", + "repo": "nix-rice", + "type": "github" + } + }, + "nix-systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1740560979, + "narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5135c59491985879812717f4c9fea69604e7f26f", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1743296961, + "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-lib_2": { + "locked": { + "lastModified": 1748135671, + "narHash": "sha256-PIkcBpddXRAGWstWV7zTwRZ9EAPqgzFNssux17p1NTg=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "6194ba204e5b188965da97ebb16e05191e560427", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1749494155, + "narHash": "sha256-FG4DEYBpROupu758beabUk9lhrblSf5hnv84v1TLqMc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "88331c17ba434359491e8d5889cce872464052c2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1749488106, + "narHash": "sha256-b9GIWdF/8jKpCC5JIMgDLZgwe8cEbty2fyTyo1eDFfI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8fe3e32e7f210522377c3bcff80931a3284ace6a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_10": { + "locked": { + "lastModified": 1749285348, + "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1746397377, + "narHash": "sha256-5oLdRa3vWSRbuqPIFFmQBGGUqaYZBxX+GGtN9f/n4lU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ed30f8aba41605e3ab46421e3dcb4510ec560ff8", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1731386116, + "narHash": "sha256-lKA770aUmjPHdTaJWnP3yQ9OI1TigenUqVC3wweqZuI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "689fed12a013f56d4c4d3f612489634267d86529", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1749619289, + "narHash": "sha256-qX6gXVjaCXXbcn6A9eSLUf8Fm07MgPGe5ir3++y2O1Q=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f72be405a10668b8b00937b452f2145244103ebc", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1749285348, + "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { + "locked": { + "lastModified": 1749143949, + "narHash": "sha256-QuUtALJpVrPnPeozlUG/y+oIMSLdptHxb3GK6cpSVhA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d3d2d80a2191a73d1e86456a751b83aa13085d7d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_7": { + "locked": { + "lastModified": 1730768919, + "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_8": { + "locked": { + "lastModified": 1748538152, + "narHash": "sha256-lqAVR6FhqjdY9XpBs+cpIbHJpHxQaEFTeJMu/nkA9s0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "966f441f64a65ff4590233e8c45e4f05197b3bfc", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_9": { + "locked": { + "lastModified": 1749285348, + "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nyx": { + "inputs": { + "fenix": "fenix", + "flake-schemas": "flake-schemas", + "home-manager": "home-manager_2", + "jovian": "jovian", + "nixpkgs": "nixpkgs_10" + }, + "locked": { + "lastModified": 1749736391, + "narHash": "sha256-DgdlYhBPzw87gKaBc19tPRydfatyOlyEnM5Bl5G2GKQ=", + "owner": "chaotic-cx", + "repo": "nyx", + "rev": "f8a2f1bd99ab7a8d5fd0a94ab57d3bd0be72124e", + "type": "github" + }, + "original": { + "owner": "chaotic-cx", + "ref": "nyxpkgs-unstable", + "repo": "nyx", + "type": "github" + } + }, + "openpose": { + "flake": false, + "locked": { + "lastModified": 1685841563, + "narHash": "sha256-GUjs8mIUFAbjJEVL+EsT44HG42mAiumKOBlBas1xxrM=", + "owner": "space-nuko", + "repo": "ComfyUI-OpenPose-Editor", + "rev": "4d8fe730acdb11ab2fcd592129d91d338d270adf", + "type": "github" + }, + "original": { + "owner": "space-nuko", + "repo": "ComfyUI-OpenPose-Editor", + "type": "github" + } + }, + "quickshell": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749729711, + "narHash": "sha256-AehIzIDy134s3XlXyXnRAhLTh9V4Px4VcWnU74bbV2M=", + "ref": "refs/heads/master", + "rev": "0fb809b1493cee321a51e5bb78b7a5f9f455c772", + "revCount": 575, + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell.git" + }, + "original": { + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell.git" + } + }, + "root": { + "inputs": { + "comfyui": "comfyui", + "comfyui-plugins": "comfyui-plugins", + "culr": "culr", + "helix": "helix", + "hjem": "hjem", + "home-manager": "home-manager", + "hudcore": "hudcore", + "lix": "lix", + "lix-module": "lix-module", + "meat": "meat", + "nil": "nil", + "niri": "niri", + "nix-index-database": "nix-index-database", + "nix-rice": "nix-rice", + "nixpkgs": "nixpkgs_9", + "nixpkgs-stable": "nixpkgs-stable_2", + "nyx": "nyx", + "quickshell": "quickshell" + } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1749558764, + "narHash": "sha256-R9vQiqez6Gm0ARJKgbsAeLyX493vwIaexOUAz0vDhak=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "9c3476d225ccc90c081280c2a20e9f7d8a200325", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "helix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1740623427, + "narHash": "sha256-3SdPQrZoa4odlScFDUHd4CUPQ/R1gtH4Mq9u8CBiK8M=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "d342e8b5fd88421ff982f383c853f0fc78a847ab", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_2": { + "inputs": { + "nixpkgs": [ + "nil", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749695868, + "narHash": "sha256-debjTLOyqqsYOUuUGQsAHskFXH5+Kx2t3dOo/FCoNRA=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "55f914d5228b5c8120e9e0f9698ed5b7214d09cd", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tensorrt": { + "flake": false, + "locked": { + "lastModified": 1728519788, + "narHash": "sha256-tqiodF60IVlmvJknYxEwL0U7GIrrfl49k6Tg+8jGRVU=", + "owner": "comfyanonymous", + "repo": "ComfyUI_TensorRT", + "rev": "5bcc3f1e5c2424bb20bcb586e340c25ebe4a954f", + "type": "github" + }, + "original": { + "owner": "comfyanonymous", + "repo": "ComfyUI_TensorRT", + "type": "github" + } + }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1739246919, + "narHash": "sha256-/hBM43/Gd0/tW+egrhlWgOIISeJxEs2uAOIYVpfDKeU=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "44590a416d4a3e8220e19e29e0b6efe64a80315d", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.5.1", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1749315541, + "narHash": "sha256-bEik1BfVOFnWvtOrcOHluos/edJ8f+G2y1QySbt/0Ak=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "da2ecb5be816de35e2efe23a408a1c49fe8b11ba", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2506572 --- /dev/null +++ b/flake.nix @@ -0,0 +1,106 @@ +{ + description = "nixos config"; + + outputs = + inputs: + with inputs; + let + modules = import ./util/get-modules.nix { + inherit inputs; + }; + create = import ./create.nix { + inherit inputs; + system = "x86_64-linux"; + sharedModules = + (modules [ + culr + meat + niri + # smooooth + ]) + ++ [ + nix-index-database.nixosModules.nix-index + ./system/substituters.nix + ]; + }; + in + { + nixosConfigurations = create.systems { + quiver = { + user = "bolt"; + imports = (modules [ nyx ]); + }; + adrift.user = "plank"; + }; + }; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + helix.url = "github:helix-editor/helix"; + + nix-index-database.url = "github:Mic92/nix-index-database"; + + nix-rice.url = "github:bertof/nix-rice"; + + nil.url = "github:oxalica/nil"; + + lix = { + url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz"; + flake = false; + }; + + lix-module = { + url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.lix.follows = "lix"; + }; + + meat = { + url = "git+https://git.atagen.co/atagen/meat"; + inputs.lix.follows = "lix"; + inputs.lix-module.follows = "lix-module"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + culr = { + url = "git+https://git.atagen.co/atagen/culr"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + comfyui = { + url = "path:./flakes/comfyui"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + comfyui-plugins = { + url = "path:./flakes/comfyui-plugins"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + niri.url = "github:sodiboo/niri-flake"; + + hjem = { + url = "github:feel-co/hjem"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + hudcore.url = "git+https://git.atagen.co/atagen/hudcore-plymouth.git"; + + quickshell = { + url = "git+https://git.outfoxxed.me/quickshell/quickshell.git"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nyx.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; + + # smooooth.url = "path:/home/bolt/code/smooooth"; + }; + +} diff --git a/flake/flake.nix b/flake/flake.nix deleted file mode 100644 index 2cf76ee..0000000 --- a/flake/flake.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ - description = "master home systems config"; - - inputs = { - - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - - flake-parts = { - url = "github:hercues-ci/flake-parts"; - inputs.nixpkgs-lib.follows = "nixpkgs"; - }; - - eww = { - url = "github:elkowar/eww"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.rust-overlay.follows = "rust-overlay"; - }; - - flake-utils.url = "github:numtide/flake-utils"; - - helix = { - url = "github:helix-editor/helix"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.parts.follows = "flake-parts"; - }; - - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - hyprland.url = "github:hyprwm/Hyprland"; - - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.flake-utils.follows = "flake-utils"; - }; - - }; - - outputs = inputs@{ flake-parts, ... }: - inputs.flake-parts.lib.mkFlake {inherit inputs;} { - - systems = ["x86_64-linux"]; - - imports = [ - - ]; - - perSystem = {config, self', inputs', pkgs, system, ...}: { - - }; - - }; - -} diff --git a/flakes/comfyui-plugins/essentials/default.nix b/flakes/comfyui-plugins/essentials/default.nix new file mode 100644 index 0000000..e8b24ca --- /dev/null +++ b/flakes/comfyui-plugins/essentials/default.nix @@ -0,0 +1,28 @@ +{ + pkgs, + src, + python3Packages, + ... +}: +let + inherit (python3Packages) + numba + colour-science + rembg + pixeloe + transparent-background + ; +in +pkgs.stdenvNoCC.mkDerivation { + pname = "comfyui-essentials"; + version = "dev-${builtins.toString src.lastModified}"; + inherit src; + + propagatedBuildInputs = [ + numba + colour-science + rembg + pixeloe + transparent-background + ]; +} diff --git a/flakes/comfyui-plugins/flake.lock b/flakes/comfyui-plugins/flake.lock new file mode 100644 index 0000000..ed0ef70 --- /dev/null +++ b/flakes/comfyui-plugins/flake.lock @@ -0,0 +1,75 @@ +{ + "nodes": { + "gguf": { + "flake": false, + "locked": { + "lastModified": 1736350217, + "narHash": "sha256-3RqFfvXdn9sCIlctqa14c2fvluSmJCR+llfZo/MV64o=", + "owner": "city96", + "repo": "ComfyUI-GGUF", + "rev": "5875c52f59baca3a9372d68c43a3775e21846fe0", + "type": "github" + }, + "original": { + "owner": "city96", + "repo": "ComfyUI-GGUF", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1738410390, + "narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=", + "path": "/nix/store/hjb1rqv2mfs5ny47amj2gsc8xk05x5g6-source", + "rev": "3a228057f5b619feb3186e986dbe76278d707b6e", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "openpose": { + "flake": false, + "locked": { + "lastModified": 1685841563, + "narHash": "sha256-GUjs8mIUFAbjJEVL+EsT44HG42mAiumKOBlBas1xxrM=", + "owner": "space-nuko", + "repo": "ComfyUI-OpenPose-Editor", + "rev": "4d8fe730acdb11ab2fcd592129d91d338d270adf", + "type": "github" + }, + "original": { + "owner": "space-nuko", + "repo": "ComfyUI-OpenPose-Editor", + "type": "github" + } + }, + "root": { + "inputs": { + "gguf": "gguf", + "nixpkgs": "nixpkgs", + "openpose": "openpose", + "tensorrt": "tensorrt" + } + }, + "tensorrt": { + "flake": false, + "locked": { + "lastModified": 1728519788, + "narHash": "sha256-tqiodF60IVlmvJknYxEwL0U7GIrrfl49k6Tg+8jGRVU=", + "owner": "comfyanonymous", + "repo": "ComfyUI_TensorRT", + "rev": "5bcc3f1e5c2424bb20bcb586e340c25ebe4a954f", + "type": "github" + }, + "original": { + "owner": "comfyanonymous", + "repo": "ComfyUI_TensorRT", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flakes/comfyui-plugins/flake.nix b/flakes/comfyui-plugins/flake.nix new file mode 100644 index 0000000..14c93b8 --- /dev/null +++ b/flakes/comfyui-plugins/flake.nix @@ -0,0 +1,49 @@ +{ + inputs = { + gguf = { + url = "github:city96/ComfyUI-GGUF"; + flake = false; + }; + + tensorrt = { + url = "github:comfyanonymous/ComfyUI_TensorRT"; + flake = false; + }; + + # needs some deps packaged + # essentials = { + # url = "github:cubiq/ComfyUI_essentials"; + # flake = false; + # }; + + openpose = { + url = "github:space-nuko/ComfyUI-OpenPose-Editor"; + flake = false; + }; + }; + + outputs = + { + self, + nixpkgs, + ... + }: + let + pkgs = import nixpkgs { + system = "x86_64-linux"; + }; + inherit (pkgs) lib callPackage; + inherit (builtins) mapAttrs; + filteredInputs = lib.filterAttrs (n: _v: n != "nixpkgs") self.inputs; + in + { + overlays.comfyui-plugins = final: _prev: { + comfyui-plugins = mapAttrs ( + name: value: final.callPackage ./${name}/default.nix { src = value; } + ) filteredInputs; + }; + packages.x86_64-linux = mapAttrs ( + name: value: callPackage ./${name}/default.nix { src = value; } + ) filteredInputs; + }; +} diff --git a/flakes/comfyui-plugins/gguf/default.nix b/flakes/comfyui-plugins/gguf/default.nix new file mode 100644 index 0000000..0d116c7 --- /dev/null +++ b/flakes/comfyui-plugins/gguf/default.nix @@ -0,0 +1,23 @@ +{ + pkgs, + src, + python3Packages, + ... +}: +let + inherit (python3Packages) gguf numpy pyyaml; +in +pkgs.stdenvNoCC.mkDerivation { + pname = "comfyui-gguf"; + version = "dev-${builtins.toString src.lastModified}"; + inherit src; + propagatedBuildInputs = [ + gguf + numpy + pyyaml + ]; + installPhase = '' + mkdir -p $out + cp -r * $out/ + ''; +} diff --git a/flakes/comfyui-plugins/openpose/default.nix b/flakes/comfyui-plugins/openpose/default.nix new file mode 100644 index 0000000..9adf02c --- /dev/null +++ b/flakes/comfyui-plugins/openpose/default.nix @@ -0,0 +1,20 @@ +{ + pkgs, + src, + ... +}: +pkgs.stdenvNoCC.mkDerivation { + pname = "comfyui-openpose-editor"; + version = "dev-${builtins.toString src.lastModified}"; + inherit src; + + patches = [ + ./openpose_no_update.patch + ]; + + installPhase = '' + mkdir -p $out + cp -r * $out/ + cp js/* $out/ + ''; +} diff --git a/flakes/comfyui-plugins/openpose/openpose_no_update.patch b/flakes/comfyui-plugins/openpose/openpose_no_update.patch new file mode 100644 index 0000000..2f440de --- /dev/null +++ b/flakes/comfyui-plugins/openpose/openpose_no_update.patch @@ -0,0 +1,12 @@ +diff --git a/__init__.py b/__init__.py +index e4cf8bb..7d8f894 100644 +--- a/__init__.py ++++ b/__init__.py +@@ -35,6 +35,6 @@ def update_javascript(): + shutil.copy(src_file, dst_file) + + +-update_javascript() ++# update_javascript() + + print('\033[34mOpenPose Editor: \033[92mLoaded\033[0m') diff --git a/flakes/comfyui-plugins/tensorrt/default.nix b/flakes/comfyui-plugins/tensorrt/default.nix new file mode 100644 index 0000000..383a2ac --- /dev/null +++ b/flakes/comfyui-plugins/tensorrt/default.nix @@ -0,0 +1,24 @@ +{ + pkgs, + src, + python3Packages, + ... +}: +let + inherit (python3Packages) tensorrt onnx; +in +pkgs.stdenvNoCC.mkDerivation { + pname = "comfyui-tensorrt"; + version = "dev-${builtins.toString src.lastModified}"; + inherit src; + + propagatedBuildInputs = [ + tensorrt + onnx + ]; + + installPhase = '' + mkdir -p $out + cp -r * $out + ''; +} diff --git a/flakes/comfyui/default.nix b/flakes/comfyui/default.nix new file mode 100644 index 0000000..1d4fb7f --- /dev/null +++ b/flakes/comfyui/default.nix @@ -0,0 +1,96 @@ +{ + pkgs, + lib, + config, + comfyui, + comfy_dir ? "/run/user/1000/comfyui/", + spandrel, + plugins ? config.comfyui.plugins or [ ], + ... +}: +let + inherit (pkgs) python3; + inherit (pkgs.python3Packages) + torch + torchsde + torchvision + torchaudio + einops + transformers + tokenizers + sentencepiece + safetensors + aiohttp + pyyaml + pillow + scipy + tqdm + psutil + kornia + soundfile + ; + + python = python3.buildEnv.override { + extraLibs = [ + torch + torchsde + torchvision + torchaudio + einops + transformers + tokenizers + sentencepiece + safetensors + aiohttp + pyyaml + pillow + scipy + tqdm + psutil + kornia + soundfile + + spandrel + ] ++ plugins; + }; +in +pkgs.stdenvNoCC.mkDerivation { + name = "comfyui"; + pname = "comfyui"; + version = "dev-${builtins.toString comfyui.lastModified}"; + src = comfyui; + nativeBuildInputs = + let + inherit (pkgs) makeWrapper; + in + [ + makeWrapper + ]; + propagatedBuildInputs = + let + inherit (pkgs.cudaPackages) cudatoolkit; + in + [ + python + cudatoolkit + ]; + + patches = [ ./folder_paths.patch ]; + + installPhase = + let + launcher = pkgs.writeShellScript "launch.sh" '' + mkdir -p $COMFY_DIR/custom_nodes + mkdir -p $COMFY_DIR/models/{checkpoints,configs,loras,vae,clip,unet,diffusion_models,clip_vision,style_models,embeddings,diffusers,vae_approx,controlnet,gligen,upscale_models,hypernetworks,photomaker,classifiers} + ${python}/bin/python3 $COMFY/comfyui/main.py --output-directory $(mktemp) + ''; + in + '' + mkdir -p $out/comfyui + cp -r * $out/comfyui + mkdir -p $out/bin + makeWrapper ${launcher} $out/bin/comfyui --prefix PATH : ${lib.makeBinPath [ python ]} \ + --set PYTHONPATH ${lib.makeLibraryPath [ python ]} --set COMFY $out --set COMFY_DIR ${comfy_dir} + ''; + meta.mainProgram = "comfyui"; +} diff --git a/flakes/comfyui/flake.lock b/flakes/comfyui/flake.lock new file mode 100644 index 0000000..805bbb0 --- /dev/null +++ b/flakes/comfyui/flake.lock @@ -0,0 +1,41 @@ +{ + "nodes": { + "comfyui": { + "flake": false, + "locked": { + "lastModified": 1739165060, + "narHash": "sha256-DLiv96ynd+p4lXgvNMqgSklWFciLX+l+nXlu5MYVrg8=", + "owner": "comfyanonymous", + "repo": "ComfyUI", + "rev": "4027466c802d174d76347726d74de73c39acedb3", + "type": "github" + }, + "original": { + "owner": "comfyanonymous", + "repo": "ComfyUI", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1738410390, + "narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=", + "path": "/nix/store/hjb1rqv2mfs5ny47amj2gsc8xk05x5g6-source", + "rev": "3a228057f5b619feb3186e986dbe76278d707b6e", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "comfyui": "comfyui", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flakes/comfyui/flake.nix b/flakes/comfyui/flake.nix new file mode 100644 index 0000000..58b690f --- /dev/null +++ b/flakes/comfyui/flake.nix @@ -0,0 +1,56 @@ +{ + inputs = { + comfyui = { + url = "github:comfyanonymous/ComfyUI"; + flake = false; + }; + }; + + nixConfig = { + extra-substituters = [ + "https://nix-community.cachix.org" + "https://cuda-maintainers.cachix.org" + ]; + extra-trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" + ]; + }; + + outputs = + { + self, + nixpkgs, + comfyui, + }: + { + homeManagerModules.comfyui = import ./module.nix; + + overlays.comfyui = final: _prev: { + comfyui = + let + spandrel = final.callPackage ./spandrel.nix { }; + in + final.callPackage ./default.nix { + cudaSupport = true; + inherit comfyui spandrel; + }; + }; + + packages.x86_64-linux = + let + system = "x86_64-linux"; + pkgs = import nixpkgs { + config.allowUnfree = true; + config.cudaSupport = true; + inherit system; + }; + spandrel = pkgs.callPackage ./spandrel.nix { }; + in + { + default = pkgs.callPackage ./default.nix { + inherit comfyui spandrel; + }; + }; + }; +} diff --git a/flakes/comfyui/folder_paths.patch b/flakes/comfyui/folder_paths.patch new file mode 100644 index 0000000..457a571 --- /dev/null +++ b/flakes/comfyui/folder_paths.patch @@ -0,0 +1,28 @@ +diff --git a/folder_paths.py b/folder_paths.py +index 01ae821..27906ac 100644 +--- a/folder_paths.py ++++ b/folder_paths.py +@@ -11,7 +11,7 @@ supported_pt_extensions: set[str] = {'.ckpt', '.pt', '.bin', '.pth', '.safetenso + + folder_names_and_paths: dict[str, tuple[list[str], set[str]]] = {} + +-base_path = os.path.dirname(os.path.realpath(__file__)) ++base_path = os.path.dirname(os.environ['COMFY_DIR']) + models_dir = os.path.join(base_path, "models") + folder_names_and_paths["checkpoints"] = ([os.path.join(models_dir, "checkpoints")], supported_pt_extensions) + folder_names_and_paths["configs"] = ([os.path.join(models_dir, "configs")], [".yaml"]) +@@ -39,10 +39,10 @@ folder_names_and_paths["photomaker"] = ([os.path.join(models_dir, "photomaker")] + + folder_names_and_paths["classifiers"] = ([os.path.join(models_dir, "classifiers")], {""}) + +-output_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), "output") +-temp_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), "temp") +-input_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), "input") +-user_directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), "user") ++output_directory = os.path.join(base_path, "output") ++temp_directory = os.path.join(base_path, "temp") ++input_directory = os.path.join(base_path, "input") ++user_directory = os.path.join(base_path, "user") + + filename_list_cache: dict[str, tuple[list[str], dict[str, float], float]] = {} + diff --git a/flakes/comfyui/module.nix b/flakes/comfyui/module.nix new file mode 100644 index 0000000..1c6f715 --- /dev/null +++ b/flakes/comfyui/module.nix @@ -0,0 +1,49 @@ +{ + pkgs, + lib, + config, + ... +}: +let + inherit (lib) + mkEnableOption + mkOption + types + hasSuffix + ; + cfg = config.programs.comfyui; + # comfyui only understands the path properly with a trailing slash + getStorage = if (hasSuffix "/" cfg.storage) then cfg.storage else cfg.storage + "/"; +in +{ + options.programs.comfyui = { + enable = mkEnableOption "ComfyUI"; + storage = mkOption { + type = types.path; + description = "where to source models and store information"; + }; + plugins = mkOption { + type = with types; listOf package; + description = "list of comfyui plugins"; + default = [ ]; + }; + }; + config = lib.mkIf cfg.enable { + home.packages = [ + # pkgs.comfyui + (pkgs.comfyui.override { + comfy_dir = getStorage; + inherit (cfg) plugins; + }) + ]; + home.file = builtins.listToAttrs ( + map (pkg: { + name = "${getStorage}/custom_nodes/${pkg.name}"; + value = { + recursive = true; + source = "${pkg}"; + }; + }) cfg.plugins + ); + }; +} diff --git a/flakes/comfyui/spandrel.nix b/flakes/comfyui/spandrel.nix new file mode 100644 index 0000000..7c7d740 --- /dev/null +++ b/flakes/comfyui/spandrel.nix @@ -0,0 +1,45 @@ +{ + python3Packages, + fetchPypi, + ... +}: +python3Packages.buildPythonPackage rec { + pname = "spandrel"; + version = "0.4.0"; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-9FUmiT+SOhLvN1QsROREsSCJdlk7x8zfpU/QTHw+gMo="; + }; + + build-system = + let + inherit (python3Packages) setuptools; + in + [ + setuptools + ]; + + dependencies = + let + inherit (python3Packages) + torch + torchvision + safetensors + numpy + einops + typing-extensions + ; + in + [ + torch + torchvision + safetensors + numpy + einops + typing-extensions + ]; + + doCheck = false; +} diff --git a/flakes/niri-session-manager/flake.lock b/flakes/niri-session-manager/flake.lock new file mode 100644 index 0000000..b5285a9 --- /dev/null +++ b/flakes/niri-session-manager/flake.lock @@ -0,0 +1,41 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1749285348, + "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", + "path": "/nix/store/syvnmj3hhckkbncm94kfkbl76qsdqqj3-source", + "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "src": "src" + } + }, + "src": { + "flake": false, + "locked": { + "lastModified": 1741050520, + "narHash": "sha256-bTOxv5yZh6wgCs7ADUFKdlXGtlIckkSijGV8G7ToVy4=", + "owner": "MTeaHead", + "repo": "niri-session-manager", + "rev": "e8732380991bd629a7e6c3fb5ea50317084fb1eb", + "type": "github" + }, + "original": { + "owner": "MTeaHead", + "repo": "niri-session-manager", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flakes/niri-session-manager/flake.nix b/flakes/niri-session-manager/flake.nix new file mode 100644 index 0000000..ee1cd01 --- /dev/null +++ b/flakes/niri-session-manager/flake.nix @@ -0,0 +1,66 @@ +{ + inputs = { + src = { + url = "github:MTeaHead/niri-session-manager"; + flake = false; + }; + }; + + outputs = + { + nixpkgs, + src, + self, + }: + { + packages.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.rustPlatform.callPackage ( + { pkgs, buildRustPackage }: + buildRustPackage (finalAttrs: { + pname = "niri-session-manager"; + version = "git-${src.rev or src.dirtyRev or "dirty"}"; + inherit src; + + cargoLock = { + lockFile = "${src}/Cargo.lock"; + }; + + meta.mainProgram = "niri-session-manager"; + }) + ) { }; + + nixosModules.niri-session-manager = + { + config, + lib, + pkgs, + ... + }: + { + options = { + services.niri-session-manager = { + enable = lib.mkEnableOption "Niri Session Manager"; + }; + }; + config = + let + cfg = config.services.niri-session-manager; + in + lib.mkIf cfg.enable { + systemd.user.services.niri-session-manager = { + enable = true; + description = "Niri Session Manager"; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + wants = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + Type = "simple"; + Restart = "always"; + ExecStart = "${self.packages.${pkgs.system}.default}"; + PrivateTmp = true; + }; + }; + }; + }; + }; +} diff --git a/flakes/niri-session-manager/result b/flakes/niri-session-manager/result new file mode 120000 index 0000000..5b7a63e --- /dev/null +++ b/flakes/niri-session-manager/result @@ -0,0 +1 @@ +/nix/store/731lnc1qjhq5gcrvmqycbm41r2ga3dqa-niri-session-manager-git-e8732380991bd629a7e6c3fb5ea50317084fb1eb \ No newline at end of file diff --git a/foreign/dotfiles/LICENSE b/foreign/dotfiles/LICENSE deleted file mode 100644 index 54ef845..0000000 --- a/foreign/dotfiles/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020-2021 Mihai Fufezan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/foreign/dotfiles/README.md b/foreign/dotfiles/README.md deleted file mode 100644 index 87e00fc..0000000 --- a/foreign/dotfiles/README.md +++ /dev/null @@ -1,74 +0,0 @@ -

fufexan/dotfiles

- -# 🗒 About - -In-house baked configs for Home-Manager and NixOS. Borrowed bits sprinkled on -top. Using [flakes](https://nixos.wiki/wiki/Flakes) and -[flake-parts](https://github.com/hercules-ci/flake-parts). - -See an overview of the flake outputs by running -`nix flake show github:fufexan/dotfiles`. - -## 🗃️ Contents - -- [modules](modules): NixOS common configs -- [hosts](hosts): host-specific configuration -- [home](home): my [Home Manager](https://github.com/nix-community/home-manager) config -- [lib](lib): helper functions -- [pkgs](pkgs): package definitions - -# 📦 Exported packages - -Run packages directly with: - -```console -nix run github:fufexan/dotfiles#packageName -``` - -Or install from the `packages` output. For example: - -```nix -# flake.nix -{ - inputs.fufexan-dotfiles.url = "github:fufexan/dotfiles"; - # Override my nixpkgs, binary cache will have less hits - inputs.fufexan-dotfiles.inputs.nixpkgs.follows = "nixpkgs"; -} - -# configuration.nix -{pkgs, inputs, ...}: { - environment.systemPackages = [ - inputs.fufexan-dotfiles.packages."x86_64-linux".packageName - ]; -} -``` - -## 💻 Desktop preview - - - Desktop Preview - -*Hint: click to go to a video showcase* - -# 💾 Resources - -Other configurations from where I learned and copied: - -- [colemickens/nixcfg](https://github.com/colemickens/nixcfg) -- [flake-utils-plus](https://github.com/gytis-ivaskevicius/flake-utils-plus) -- [gytis-ivaskevicius/nixfiles](https://github.com/gytis-ivaskevicius/nixfiles) -- [Mic92/dotfiles](https://github.com/Mic92/dotfiles) -- [NobbZ/nixos-config](https://github.com/NobbZ/nixos-config) -- [privatevoid-net/privatevoid-infrastructure](https://github.com/privatevoid-net/privatevoid-infrastructure) -- [RicArch97/nixos-config](https://github.com/RicArch97/nixos-config) -- [viperML/dotfiles](https://github.com/viperML/dotfiles) - -# 👥 People - -These are the people whom I've taken inspiration from while writing these -configs. There surely are more but I tend to forget. Regardless, I am thankful -to all of them. - -DieracDelta - gytis-ivaskevicius - hlissner - keksbg - Kranzes - -matthewcroughan - max-privatevoid - Misterio77 - NobbZ - OPNA2608 - -pnotequalnp - RicArch97 - tadeokondrak - viperML - Xe - yusdacra diff --git a/foreign/dotfiles/flake.lock b/foreign/dotfiles/flake.lock deleted file mode 100644 index 1901bbe..0000000 --- a/foreign/dotfiles/flake.lock +++ /dev/null @@ -1,788 +0,0 @@ -{ - "nodes": { - "agenix": { - "inputs": { - "darwin": "darwin", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1677969766, - "narHash": "sha256-AIp/ZYZMNLDZR/H7iiAlaGpu4lcXsVt9JQpBlf43HRY=", - "owner": "ryantm", - "repo": "agenix", - "rev": "03b51fe8e459a946c4b88dcfb6446e45efb2c24e", - "type": "github" - }, - "original": { - "owner": "ryantm", - "repo": "agenix", - "type": "github" - } - }, - "crane": { - "flake": false, - "locked": { - "lastModified": 1670900067, - "narHash": "sha256-VXVa+KBfukhmWizaiGiHRVX/fuk66P8dgSFfkVN4/MY=", - "owner": "ipetkov", - "repo": "crane", - "rev": "59b31b41a589c0a65e4a1f86b0e5eac68081468b", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "darwin": { - "inputs": { - "nixpkgs": [ - "agenix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1673295039, - "narHash": "sha256-AsdYgE8/GPwcelGgrntlijMg4t3hLFJFCRF3tL5WVjA=", - "owner": "lnl7", - "repo": "nix-darwin", - "rev": "87b9d090ad39b25b2400029c64825fc2a8868943", - "type": "github" - }, - "original": { - "owner": "lnl7", - "ref": "master", - "repo": "nix-darwin", - "type": "github" - } - }, - "devshell": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1678957337, - "narHash": "sha256-Gw4nVbuKRdTwPngeOZQOzH/IFowmz4LryMPDiJN/ah4=", - "owner": "numtide", - "repo": "devshell", - "rev": "3e0e60ab37cd0bf7ab59888f5c32499d851edb47", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, - "dream2nix": { - "inputs": { - "alejandra": [ - "helix", - "nci" - ], - "all-cabal-json": [ - "helix", - "nci" - ], - "crane": "crane", - "devshell": [ - "helix", - "nci" - ], - "flake-parts": [ - "helix", - "nci", - "parts" - ], - "flake-utils-pre-commit": [ - "helix", - "nci" - ], - "ghc-utils": [ - "helix", - "nci" - ], - "gomod2nix": [ - "helix", - "nci" - ], - "mach-nix": [ - "helix", - "nci" - ], - "nix-pypi-fetcher": [ - "helix", - "nci" - ], - "nixpkgs": [ - "helix", - "nci", - "nixpkgs" - ], - "poetry2nix": [ - "helix", - "nci" - ], - "pre-commit-hooks": [ - "helix", - "nci" - ], - "pruned-racket-catalog": [ - "helix", - "nci" - ] - }, - "locked": { - "lastModified": 1677289985, - "narHash": "sha256-lUp06cTTlWubeBGMZqPl9jODM99LpWMcwxRiscFAUJg=", - "owner": "nix-community", - "repo": "dream2nix", - "rev": "28b973a8d4c30cc1cbb3377ea2023a76bc3fb889", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "dream2nix", - "type": "github" - } - }, - "eww": { - "inputs": { - "flake-compat": "flake-compat", - "nixpkgs": [ - "nixpkgs" - ], - "rust-overlay": [ - "rust-overlay" - ] - }, - "locked": { - "lastModified": 1678303550, - "narHash": "sha256-JlpoMXL+QIO0DUIyAcGRJte2G/jF/rSeO/zze5W7S/s=", - "owner": "elkowar", - "repo": "eww", - "rev": "45154bbf5962cad9c4e6c76f75d57dd8d740d307", - "type": "github" - }, - "original": { - "owner": "elkowar", - "repo": "eww", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1678379998, - "narHash": "sha256-TZdfNqftHhDuIFwBcN9MUThx5sQXCTeZk9je5byPKRw=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "c13d60b89adea3dc20704c045ec4d50dd964d447", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-utils": { - "locked": { - "lastModified": 1642700792, - "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "fu": { - "locked": { - "lastModified": 1678901627, - "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "helix": { - "inputs": { - "nci": "nci", - "nixpkgs": "nixpkgs", - "parts": [ - "flake-parts" - ], - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1678544833, - "narHash": "sha256-aLs6qjiViaxryP2XMjKPzrJGYfIQsGTbNWfbySfivmY=", - "owner": "SoraTenshi", - "repo": "helix", - "rev": "80782f4f3cd557617d09b0d8f42dbce780552630", - "type": "github" - }, - "original": { - "owner": "SoraTenshi", - "ref": "daily-driver", - "repo": "helix", - "type": "github" - } - }, - "hm": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "utils": "utils" - }, - "locked": { - "lastModified": 1679067095, - "narHash": "sha256-G2dJQURL/CCi+8RP6jNJG8VqgtzEMCA+6mNodd3VR6E=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "3239e0b40f242f47bf6c0c37b2fd35ab3e76e370", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, - "hyprland": { - "inputs": { - "hyprland-protocols": "hyprland-protocols", - "nixpkgs": "nixpkgs_2", - "wlroots": "wlroots", - "xdph": "xdph" - }, - "locked": { - "lastModified": 1679166084, - "narHash": "sha256-yr+alTr1eGjEKpMiD06FTTMP6vaoNwYEZT6mW6dQ5rM=", - "owner": "hyprwm", - "repo": "Hyprland", - "rev": "06244555915339967864292dd0b83cd9732516d8", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "Hyprland", - "type": "github" - } - }, - "hyprland-contrib": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1679036674, - "narHash": "sha256-2s3Hfq56jL8ePyc3+calPT34FNMK2zksqwPhIxAq20o=", - "owner": "hyprwm", - "repo": "contrib", - "rev": "1af47a008e850c595aeddc83bb3f04fd81935caa", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "contrib", - "type": "github" - } - }, - "hyprland-protocols": { - "inputs": { - "nixpkgs": [ - "hyprland", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1671839510, - "narHash": "sha256-+PY1qqJfmZzzROgcIY4I7AkCwpnC+qBIYk2eFoA9RWc=", - "owner": "hyprwm", - "repo": "hyprland-protocols", - "rev": "b8f55e02a328c47ed373133c52483bbfa20a1b75", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-protocols", - "type": "github" - } - }, - "kmonad": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "dir": "nix", - "lastModified": 1673185501, - "narHash": "sha256-uEtWPpl9nH7QqochHo1z+giPga1zXR1Ko3dOXHIapFY=", - "owner": "kmonad", - "repo": "kmonad", - "rev": "3413f1be996142c8ef4f36e246776a6df7175979", - "type": "github" - }, - "original": { - "dir": "nix", - "owner": "kmonad", - "repo": "kmonad", - "type": "github" - } - }, - "lowdown-src": { - "flake": false, - "locked": { - "lastModified": 1633514407, - "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", - "owner": "kristapsdz", - "repo": "lowdown", - "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", - "type": "github" - }, - "original": { - "owner": "kristapsdz", - "repo": "lowdown", - "type": "github" - } - }, - "mk-naked-shell": { - "flake": false, - "locked": { - "lastModified": 1676572903, - "narHash": "sha256-oQoDHHUTxNVSURfkFcYLuAK+btjs30T4rbEUtCUyKy8=", - "owner": "yusdacra", - "repo": "mk-naked-shell", - "rev": "aeca9f8aa592f5e8f71f407d081cb26fd30c5a57", - "type": "github" - }, - "original": { - "owner": "yusdacra", - "repo": "mk-naked-shell", - "type": "github" - } - }, - "nci": { - "inputs": { - "dream2nix": "dream2nix", - "mk-naked-shell": "mk-naked-shell", - "nixpkgs": [ - "helix", - "nixpkgs" - ], - "parts": "parts", - "rust-overlay": [ - "helix", - "rust-overlay" - ] - }, - "locked": { - "lastModified": 1677297103, - "narHash": "sha256-ArlJIbp9NGV9yvhZdV0SOUFfRlI/kHeKoCk30NbSiLc=", - "owner": "yusdacra", - "repo": "nix-cargo-integration", - "rev": "a79272a2cb0942392bb3a5bf9a3ec6bc568795b2", - "type": "github" - }, - "original": { - "owner": "yusdacra", - "repo": "nix-cargo-integration", - "type": "github" - } - }, - "nix-gaming": { - "inputs": { - "nixpkgs": "nixpkgs_3" - }, - "locked": { - "lastModified": 1678324469, - "narHash": "sha256-FWI0+K1zdfzOq8BbgGhRvy+qp2J4KauGL1geAc19PRQ=", - "owner": "fufexan", - "repo": "nix-gaming", - "rev": "18fac9dd032d0bb1d4c660b3257fa00df7f0145d", - "type": "github" - }, - "original": { - "owner": "fufexan", - "repo": "nix-gaming", - "type": "github" - } - }, - "nix-super": { - "inputs": { - "lowdown-src": "lowdown-src", - "nixpkgs": "nixpkgs_4", - "nixpkgs-regression": "nixpkgs-regression" - }, - "locked": { - "lastModified": 1677536397, - "narHash": "sha256-pKp+dmOJc3/9R3dBP30u2zXOyCuF5dVzgFlS1upSwZk=", - "owner": "privatevoid-net", - "repo": "nix-super", - "rev": "8eb40776e51819038fbb8a087d9885842451a333", - "type": "github" - }, - "original": { - "owner": "privatevoid-net", - "repo": "nix-super", - "type": "github" - } - }, - "nix-xilinx": { - "inputs": { - "flake-compat": "flake-compat_2", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1678957299, - "narHash": "sha256-myDk5QC9Q5FESSJl5N3Nf67w+dwq2KpvcguTwodKGqo=", - "owner": "doronbehar", - "repo": "nix-xilinx", - "rev": "e1533146984dd11bdefd6042c282cd123aca8d71", - "type": "gitlab" - }, - "original": { - "owner": "doronbehar", - "repo": "nix-xilinx", - "type": "gitlab" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1677063315, - "narHash": "sha256-qiB4ajTeAOVnVSAwCNEEkoybrAlA+cpeiBxLobHndE8=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "988cc958c57ce4350ec248d2d53087777f9e1949", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-regression": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1677676435, - "narHash": "sha256-6FxdcmQr5JeZqsQvfinIMr0XcTyTuR7EXX0H3ANShpQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a08d6979dd7c82c4cef0dcc6ac45ab16051c1169", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1677995890, - "narHash": "sha256-eOnCn0o3I6LP48fAi8xWFcn49V2rL7oX5jCtJTeN1LI=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a1240f6b4a0bcc84fc48008b396a140d9f3638f6", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1670461440, - "narHash": "sha256-jy1LB8HOMKGJEGXgzFRLDU1CBGL0/LlkolgnqIsF0D8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "04a75b2eecc0acf6239acf9dd04485ff8d14f425", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-22.11-small", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_5": { - "locked": { - "lastModified": 1678898370, - "narHash": "sha256-xTICr1j+uat5hk9FyuPOFGxpWHdJRibwZC+ATi0RbtE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ac718d02867a84b42522a0ece52d841188208f2c", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "parts": { - "inputs": { - "nixpkgs-lib": [ - "helix", - "nci", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1675933616, - "narHash": "sha256-/rczJkJHtx16IFxMmAWu5nNYcSXNg1YYXTHoGjLrLUA=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "47478a4a003e745402acf63be7f9a092d51b83d7", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "root": { - "inputs": { - "agenix": "agenix", - "devshell": "devshell", - "eww": "eww", - "flake-parts": "flake-parts", - "fu": "fu", - "helix": "helix", - "hm": "hm", - "hyprland": "hyprland", - "hyprland-contrib": "hyprland-contrib", - "kmonad": "kmonad", - "nix-gaming": "nix-gaming", - "nix-super": "nix-super", - "nix-xilinx": "nix-xilinx", - "nixpkgs": "nixpkgs_5", - "rust-overlay": "rust-overlay_2", - "spicetify-nix": "spicetify-nix" - } - }, - "rust-overlay": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": [ - "helix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1677292251, - "narHash": "sha256-D+6q5Z2MQn3UFJtqsM5/AvVHi3NXKZTIMZt1JGq/spA=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "34cdbf6ad480ce13a6a526f57d8b9e609f3d65dc", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "rust-overlay_2": { - "inputs": { - "flake-utils": [ - "fu" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1679106165, - "narHash": "sha256-03Opt2yu4E/AIFjvlgib0/nhMn6B4B/t/nvwS2bzOGw=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "7313c06ac334d6262ddfe30a38b3abc3da6bd565", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "spicetify-nix": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1675736383, - "narHash": "sha256-fjQmN3pYGstBNHCFdmPzDf1/Dt04v3b7+/w4cQ4gkKo=", - "owner": "the-argus", - "repo": "spicetify-nix", - "rev": "ec85c2a2f5d1035142b8e383cc77b68bb0b9ebc8", - "type": "github" - }, - "original": { - "owner": "the-argus", - "repo": "spicetify-nix", - "type": "github" - } - }, - "utils": { - "locked": { - "lastModified": 1676283394, - "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "wlroots": { - "flake": false, - "locked": { - "host": "gitlab.freedesktop.org", - "lastModified": 1677789111, - "narHash": "sha256-dWrk+Q3bLdtFe5rkyaAKWCQJCeE/KFNllcu1DvBC38c=", - "owner": "wlroots", - "repo": "wlroots", - "rev": "5ae17de23f5fd9bb252a698f3771c840280e2c05", - "type": "gitlab" - }, - "original": { - "host": "gitlab.freedesktop.org", - "owner": "wlroots", - "repo": "wlroots", - "type": "gitlab" - } - }, - "xdph": { - "inputs": { - "hyprland-protocols": [ - "hyprland", - "hyprland-protocols" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1673116118, - "narHash": "sha256-eR0yDSkR2XYMesfdRWJs25kAdXET2mbNNHu5t+KUcKA=", - "owner": "hyprwm", - "repo": "xdg-desktop-portal-hyprland", - "rev": "d479c846531fd0e1d2357c9588b8310a2b859ef2", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "xdg-desktop-portal-hyprland", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/foreign/dotfiles/flake.nix b/foreign/dotfiles/flake.nix deleted file mode 100644 index 18a5944..0000000 --- a/foreign/dotfiles/flake.nix +++ /dev/null @@ -1,111 +0,0 @@ -{ - description = "fufexan's NixOS and Home-Manager flake"; - - outputs = inputs: - inputs.flake-parts.lib.mkFlake {inherit inputs;} { - systems = ["x86_64-linux"]; - - imports = [ - ./home/profiles - ./hosts - ./modules - ./pkgs - ./lib - {config._module.args._inputs = inputs // {inherit (inputs) self;};} - ]; - - perSystem = { - config, - inputs', - pkgs, - system, - ... - }: { - imports = [ - { - _module.args.pkgs = inputs.self.legacyPackages.${system}; - } - ]; - - devShells.default = inputs'.devshell.legacyPackages.mkShell { - packages = [ - pkgs.alejandra - pkgs.git - config.packages.repl - ]; - name = "dots"; - }; - - formatter = pkgs.alejandra; - }; - }; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - - flake-parts = { - url = "github:hercules-ci/flake-parts"; - inputs.nixpkgs-lib.follows = "nixpkgs"; - }; - - agenix = { - url = "github:ryantm/agenix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - devshell = { - url = "github:numtide/devshell"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - eww = { - url = "github:elkowar/eww"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.rust-overlay.follows = "rust-overlay"; - }; - - fu.url = "github:numtide/flake-utils"; - - helix = { - url = "github:SoraTenshi/helix/daily-driver"; - inputs.parts.follows = "flake-parts"; - }; - - hm = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - hyprland.url = "github:hyprwm/Hyprland"; - - hyprland-contrib = { - url = "github:hyprwm/contrib"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - kmonad = { - url = "github:kmonad/kmonad?dir=nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - nix-gaming.url = "github:fufexan/nix-gaming"; - - nix-super.url = "github:privatevoid-net/nix-super"; - - nix-xilinx = { - url = "gitlab:doronbehar/nix-xilinx"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.flake-utils.follows = "fu"; - }; - - spicetify-nix = { - url = "github:the-argus/spicetify-nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; -} diff --git a/foreign/dotfiles/home/README.md b/foreign/dotfiles/home/README.md deleted file mode 100644 index 84d13f5..0000000 --- a/foreign/dotfiles/home/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Home config - -Home-Manager configurations for different hosts. - -Name | Description ---------------- | ----------- -`default.nix` | Home-Manager specific configuration -`editors` | Helix & Neovim -`programs` | Programs -`shell` | Zsh, Nix options, etc. -`terminals` | Terminal configs -`wayland` | Wayland-specific options, including Sway and Waybar configs - -`profiles` is a special dir where `homeConfigurations` are set up. They're -basically the entrypoints of the configs. diff --git a/foreign/dotfiles/home/default.nix b/foreign/dotfiles/home/default.nix deleted file mode 100644 index d3a469b..0000000 --- a/foreign/dotfiles/home/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - home = { - username = "mihai"; - homeDirectory = "/home/mihai"; - stateVersion = "20.09"; - extraOutputsToInstall = ["doc" "devdoc"]; - }; - - # disable manuals as nmd fails to build often - manual = { - html.enable = false; - json.enable = false; - manpages.enable = false; - }; - - # let HM manage itself when in standalone mode - programs.home-manager.enable = true; -} diff --git a/foreign/dotfiles/home/editors/helix/default.nix b/foreign/dotfiles/home/editors/helix/default.nix deleted file mode 100644 index 7489b14..0000000 --- a/foreign/dotfiles/home/editors/helix/default.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - inputs, - pkgs, - ... -} @ args: { - home.packages = [pkgs.shellcheck]; - - programs.helix = { - enable = true; - package = inputs.helix.packages.${pkgs.hostPlatform.system}.default; - - languages = import ./languages.nix args; - - settings = { - theme = "catppuccin_mocha"; - editor = { - true-color = true; - color-modes = true; - cursorline = true; - cursor-shape = { - insert = "bar"; - normal = "block"; - select = "underline"; - }; - indent-guides = { - render = true; - rainbow-option = "dim"; - }; - rainbow-brackets = true; - statusline.center = ["position-percentage"]; - whitespace.characters = { - newline = "↴"; - tab = "⇥"; - }; - }; - - keys.normal.space.u = { - f = ":format"; # format using LSP formatter - w = ":set whitespace.render all"; - W = ":set whitespace.render none"; - }; - }; - }; -} diff --git a/foreign/dotfiles/home/editors/helix/languages.nix b/foreign/dotfiles/home/editors/helix/languages.nix deleted file mode 100644 index 6f40bee..0000000 --- a/foreign/dotfiles/home/editors/helix/languages.nix +++ /dev/null @@ -1,47 +0,0 @@ -{pkgs, ...}: -with pkgs; [ - { - name = "bash"; - language-server = { - command = "${nodePackages.bash-language-server}/bin/bash-language-server"; - args = ["start"]; - }; - auto-format = true; - formatter = { - command = "${shfmt}/bin/shfmt"; - args = ["-i" "2" "-"]; - }; - } - { - name = "cpp"; - language-server = { - command = "${clang-tools}/bin/clangd"; - clangd.fallbackFlags = ["-std=c++2b"]; - }; - } - { - name = "nix"; - language-server = {command = lib.getExe nil;}; - config.nil.formatting.command = ["alejandra" "-q"]; - } - { - name = "clojure"; - scope = "source.clojure"; - injection-regex = "(clojure|clj|edn|boot|yuck)"; - file-types = ["clj" "cljs" "cljc" "clje" "cljr" "cljx" "edn" "boot" "yuck"]; - roots = ["project.clj" "build.boot" "deps.edn" "shadow-cljs.edn"]; - comment-token = ";"; - language-server = {command = "clojure-lsp";}; - indent = { - tab-width = 2; - unit = " "; - }; - } - { - name = "css"; - language-server = { - command = "${nodePackages.vscode-css-languageserver-bin}/bin/css-languageserver"; - args = ["--stdio"]; - }; - } -] diff --git a/foreign/dotfiles/home/editors/neovim/config/init.lua b/foreign/dotfiles/home/editors/neovim/config/init.lua deleted file mode 100644 index cc30859..0000000 --- a/foreign/dotfiles/home/editors/neovim/config/init.lua +++ /dev/null @@ -1,14 +0,0 @@ -vim.opt.expandtab = true -vim.opt.hidden = true -vim.opt.incsearch = true -vim.opt.mouse = "a" -vim.opt.number = true -vim.opt.shiftwidth = 2 -vim.opt.splitbelow = true -vim.opt.splitright = true -vim.opt.signcolumn = "yes:3" -vim.opt.tabstop = 2 -vim.opt.timeoutlen = 0 -vim.wo.wrap = false -vim.opt.exrc = true -vim.cmd("syntax on") \ No newline at end of file diff --git a/foreign/dotfiles/home/editors/neovim/config/lspconfig.lua b/foreign/dotfiles/home/editors/neovim/config/lspconfig.lua deleted file mode 100644 index 428282b..0000000 --- a/foreign/dotfiles/home/editors/neovim/config/lspconfig.lua +++ /dev/null @@ -1,28 +0,0 @@ -local lspc = require'lspconfig' - -lspc.nil_ls.setup{} -lspc.clangd.setup{} - -local buf_map = function(bufnr, mode, lhs, rhs, opts) - vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts or { - silent = true, - }) -end - -lspc.tsserver.setup({ - on_attach = function(client, bufnr) - client.resolved_capabilities.document_formatting = false - client.resolved_capabilities.document_range_formatting = false - - local ts_utils = require("nvim-lsp-ts-utils") - ts_utils.setup({}) - ts_utils.setup_client(client) - - buf_map(bufnr, "n", "gs", ":TSLspOrganize") - buf_map(bufnr, "n", "gi", ":TSLspRenameFile") - buf_map(bufnr, "n", "go", ":TSLspImportAll") - - on_attach(client, bufnr) - end, -}) - diff --git a/foreign/dotfiles/home/editors/neovim/config/nvim-cmp.lua b/foreign/dotfiles/home/editors/neovim/config/nvim-cmp.lua deleted file mode 100644 index 13bff54..0000000 --- a/foreign/dotfiles/home/editors/neovim/config/nvim-cmp.lua +++ /dev/null @@ -1,73 +0,0 @@ -local has_words_before = function() - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil -end - -local feedkey = function(key, mode) - vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true) -end - -local cmp = require("cmp") -local lspkind = require("lspkind") - -cmp.setup({ - sources = { - { name = "nvim_lsp" }, - { name = "cmp_tabnine" }, - { name = "treesitter" }, - { name = "buffer" }, - { name = "path" }, - { name = "vsnip" }, - -- { name = "copilot" }, - }, - - snippet = { - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) - end, - }, - - formatting = { - format = lspkind.cmp_format({ - with_text = true, - menu = { - buffer = "[Buf]", - nvim_lsp = "[LSP]", - nvim_lua = "[Lua]", - latex_symbols = "[Latex]", - treesitter = "[TS]", - cmp_tabnine = "[TN]", - vsnip = "[Snip]", - }, - }), - }, - - mapping = { - [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif vim.fn["vsnip#available"](1) == 1 then - feedkey("(vsnip-expand-or-jump)", "") - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { - "i", - "s", - }), - - [""] = cmp.mapping(function() - if cmp.visible() then - cmp.select_prev_item() - elseif vim.fn["vsnip#jumpable"](-1) == 1 then - feedkey("(vsnip-jump-prev)", "") - end - end, { - "i", - "s", - }), - }, -}) diff --git a/foreign/dotfiles/home/editors/neovim/config/theming.lua b/foreign/dotfiles/home/editors/neovim/config/theming.lua deleted file mode 100644 index 091687e..0000000 --- a/foreign/dotfiles/home/editors/neovim/config/theming.lua +++ /dev/null @@ -1,20 +0,0 @@ --- set colorscheme -vim.cmd 'set termguicolors' - -vim.g.catppuccin_flavour = "mocha" - -require("catppuccin").setup() - -vim.cmd [[colorscheme catppuccin]] - --- enable colorizer -require'colorizer'.setup() - --- set sign -vim.cmd 'sign define DiagnosticSignError text= linehl= texthl=DiagnosticSignError numhl=' -vim.cmd 'sign define DiagnosticSignHint text= linehl= texthl=DiagnosticSignHint numhl=' -vim.cmd 'sign define DiagnosticSignInfo text= linehl= texthl=DiagnosticSignInfo numhl=' -vim.cmd 'sign define DiagnosticSignWarn text= linehl= texthl=DiagnosticSignWarn numhl=' - --- set lightline theme to horizon -vim.g.lightline = { colorscheme = "catppuccin" } diff --git a/foreign/dotfiles/home/editors/neovim/config/treesitter-textobjects.lua b/foreign/dotfiles/home/editors/neovim/config/treesitter-textobjects.lua deleted file mode 100644 index 8f2c6d6..0000000 --- a/foreign/dotfiles/home/editors/neovim/config/treesitter-textobjects.lua +++ /dev/null @@ -1,14 +0,0 @@ -require'nvim-treesitter.configs'.setup { - textobjects = { - select = { - enable = true, - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - }, - }, - }, -} diff --git a/foreign/dotfiles/home/editors/neovim/config/treesitter.lua b/foreign/dotfiles/home/editors/neovim/config/treesitter.lua deleted file mode 100644 index 1f33ef0..0000000 --- a/foreign/dotfiles/home/editors/neovim/config/treesitter.lua +++ /dev/null @@ -1,30 +0,0 @@ -require("nvim-treesitter.configs").setup({ - highlight = { - enable = true, - disable = {}, - }, - rainbow = { - enable = true, - extended_mode = true, - }, - autotag = { - enable = true, - }, - context_commentstring = { - enable = true, - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "gnn", - node_incremental = "grn", - scope_incremental = "grc", - node_decremental = "grm", - }, - }, -}) - --- breaks highlight --- vim.cmd([[set foldmethod=expr]]) --- vim.cmd([[set foldlevel=10]]) --- vim.cmd([[set foldexpr=nvim_treesitter#foldexpr()]]) \ No newline at end of file diff --git a/foreign/dotfiles/home/editors/neovim/config/utils.lua b/foreign/dotfiles/home/editors/neovim/config/utils.lua deleted file mode 100644 index e1a264c..0000000 --- a/foreign/dotfiles/home/editors/neovim/config/utils.lua +++ /dev/null @@ -1,29 +0,0 @@ --- telescope -require('telescope').load_extension('fzy_native') - --- null-ls -local nb = require('null-ls').builtins - -require('null-ls').setup({ - sources = { - nb.formatting.alejandra, - nb.code_actions.statix, - nb.diagnostics.cppcheck, - nb.diagnostics.deadnix, - nb.diagnostics.statix, - nb.diagnostics.eslint, - nb.completion.spell, - }, -}) - -require("gitsigns").setup() - --- autopairs -require('nvim-autopairs').setup{} - --- copy to system clipboard -vim.api.nvim_set_keymap( 'v', 'y', '"+y', {noremap = true}) -vim.api.nvim_set_keymap( 'n', 'y', ':%+y', {noremap = true}) - --- paste from system clipboard -vim.api.nvim_set_keymap( 'n', 'p', '"+p', {noremap = true}) diff --git a/foreign/dotfiles/home/editors/neovim/config/which-key.lua b/foreign/dotfiles/home/editors/neovim/config/which-key.lua deleted file mode 100644 index ba3bc32..0000000 --- a/foreign/dotfiles/home/editors/neovim/config/which-key.lua +++ /dev/null @@ -1,39 +0,0 @@ -vim.g.mapleader = " " - -local wk = require("which-key") - -wk.setup({}) - -wk.register({ - [""] = { - b = { "Telescope buffers", "Buffers" }, - ["/"] = { "Telescope live_grep", "Live Grep" }, - f = { "Telescope find_files", "Find File" }, - g = { - name = "Git / VCS", - i = { "lua require('telescope').extensions.gh.issues()", "Github Issues" }, - p = { "lua require('telescope').extensions.gh.pull_request()", "Github PRs" }, - b = { "ToggleBlameLine", "Toggle BlameLine" }, - c = { "Neogit commit", "Commit" }, - s = { "Neogit kind=split", "Staging" }, - }, - a = { "lua require('telescope.builtin').lsp_code_actions()", "Code Actions" }, - d = { "lua require('telescope.builtin').lsp_document_diagnostics()", "LSP Diagnostics" }, - k = { "lua vim.lsp.buf.signature_help()", "Signature Help" }, - l = { - name = "LSP", - f = { "lua vim.lsp.buf.formatting_sync()", "Format file"}, - q = { "lua vim.lsp.diagnostic.set_loclist()", "Set Loclist" }, - e = { "lua vim.lsp.diagnostic.show_line_diagnostics()", "Show Line Diagnostics" }, - }, - p = { "\"+p", "Paste from clipboard" }, - P = { "\"+P", "Paste from clipboard before cursor" }, - y = { "\"+y", "Yank to clipboard" }, - }, - g = { - l = { "$", "Line end" }, - h = { "0", "Line start" }, - s = { "^", "First non-blank in line" }, - e = { "G", "Bottom" }, - }, -}) diff --git a/foreign/dotfiles/home/editors/neovim/default.nix b/foreign/dotfiles/home/editors/neovim/default.nix deleted file mode 100644 index ba0a8f5..0000000 --- a/foreign/dotfiles/home/editors/neovim/default.nix +++ /dev/null @@ -1,62 +0,0 @@ -{pkgs, ...}: { - programs.neovim = { - enable = true; - - vimAlias = true; - viAlias = true; - vimdiffAlias = true; - - plugins = with pkgs.vimPlugins; [ - catppuccin-nvim - cmp-buffer - cmp-nvim-lsp - cmp-path - cmp-spell - cmp-treesitter - cmp-vsnip - friendly-snippets - gitsigns-nvim - lightline-vim - lspkind-nvim - neogit - null-ls-nvim - nvim-autopairs - nvim-cmp - nvim-colorizer-lua - nvim-lspconfig - nvim-tree-lua - nvim-ts-rainbow - (nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars)) - plenary-nvim - telescope-fzy-native-nvim - telescope-nvim - vim-floaterm - vim-sneak - vim-vsnip - which-key-nvim - ]; - - extraPackages = with pkgs; [gcc ripgrep fd]; - - extraConfig = let - luaRequire = module: - builtins.readFile (builtins.toString - ./config - + "/${module}.lua"); - luaConfig = builtins.concatStringsSep "\n" (map luaRequire [ - "init" - "lspconfig" - "nvim-cmp" - "theming" - "treesitter" - "treesitter-textobjects" - "utils" - "which-key" - ]); - in '' - lua <<  - ${luaConfig} -  - ''; - }; -} diff --git a/foreign/dotfiles/home/profiles/default.nix b/foreign/dotfiles/home/profiles/default.nix deleted file mode 100644 index cfbcfe9..0000000 --- a/foreign/dotfiles/home/profiles/default.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - inputs, - withSystem, - module_args, - ... -}: let - sharedModules = [ - ../. - ../shell - module_args - ]; - - homeImports = { - "mihai@io" = - [ - ./io - inputs.spicetify-nix.homeManagerModule - inputs.hyprland.homeManagerModules.default - ] - ++ sharedModules; - server = sharedModules ++ [./server]; - }; - - inherit (inputs.hm.lib) homeManagerConfiguration; -in { - imports = [ - {_module.args = {inherit homeImports;};} - ]; - - flake = { - homeConfigurations = withSystem "x86_64-linux" ({pkgs, ...}: { - "mihai@io" = homeManagerConfiguration { - modules = homeImports."mihai@io" ++ module_args; - inherit pkgs; - }; - server = homeManagerConfiguration { - modules = homeImports.server ++ module_args; - inherit pkgs; - }; - }); - - homeManagerModules.eww-hyprland = import ./programs/eww; - }; -} diff --git a/foreign/dotfiles/home/profiles/io/default.nix b/foreign/dotfiles/home/profiles/io/default.nix deleted file mode 100644 index b798f79..0000000 --- a/foreign/dotfiles/home/profiles/io/default.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ - imports = [ - ../../editors/helix - ../../editors/neovim - ../../programs - ../../programs/games.nix - ../../programs/dunst.nix - ../../wayland - ../../terminals/alacritty.nix - ../../terminals/wezterm.nix - ]; - - services = { - kanshi = { - # use 1.6 scaling: 2560 : 1.6 = 1600, exact division. good for offsets - # restart eww every time because it won't expand/contract automatically - enable = true; - profiles = { - undocked = { - outputs = [ - { - criteria = "eDP-1"; - position = "0,0"; - } - ]; - }; - docked-all = { - outputs = [ - { - criteria = "eDP-1"; - position = "1366,0"; - } - { - criteria = "DP-1"; - position = "0,0"; - } - { - criteria = "DP-2"; - position = "1600,0"; - } - ]; - }; - - docked1 = { - outputs = [ - { - criteria = "eDP-1"; - position = "1366,0"; - } - { - criteria = "DP-1"; - position = "0,0"; - } - ]; - }; - - docked2 = { - outputs = [ - { - criteria = "eDP-1"; - position = "1366,0"; - } - { - criteria = "DP-2"; - position = "0,0"; - } - ]; - }; - }; - systemdTarget = "graphical-session.target"; - }; - }; -} diff --git a/foreign/dotfiles/home/profiles/server/default.nix b/foreign/dotfiles/home/profiles/server/default.nix deleted file mode 100644 index 786b2b2..0000000 --- a/foreign/dotfiles/home/profiles/server/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - programs.helix.enable = true; -} diff --git a/foreign/dotfiles/home/programs/cinny.nix b/foreign/dotfiles/home/programs/cinny.nix deleted file mode 100644 index 79f7801..0000000 --- a/foreign/dotfiles/home/programs/cinny.nix +++ /dev/null @@ -1,13 +0,0 @@ -{pkgs, ...}: { - # use Cinny Matrix client - # create systemd service that serves it on localhost:9999 - systemd.user.services.cinny = { - Unit.Description = "Cinny Service"; - Service = { - Type = "simple"; - ExecStart = "${pkgs.darkhttpd}/bin/darkhttpd ${pkgs.cinny} --addr 127.0.0.1 --port 9999"; - TimeoutStopSec = 5; - }; - Install.WantedBy = ["default.target"]; - }; -} diff --git a/foreign/dotfiles/home/programs/default.nix b/foreign/dotfiles/home/programs/default.nix deleted file mode 100644 index b040fcc..0000000 --- a/foreign/dotfiles/home/programs/default.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ - pkgs, - config, - ... -}: { - imports = [ - ../shell/nix.nix - ./cinny.nix - ./files - ./media.nix - ./git.nix - ./gtk.nix - ./packages.nix - ./qt.nix - ./spicetify.nix - ./xdg.nix - ./zathura.nix - ]; - - programs = { - chromium = { - enable = true; - commandLineArgs = ["--enable-features=TouchpadOverscrollHistoryNavigation"]; - extensions = [ - {id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";} - {id = "bkkmolkhemgaeaeggcmfbghljjjoofoh";} - ]; - }; - - firefox = { - enable = true; - profiles.mihai = {}; - }; - - gpg = { - enable = true; - homedir = "${config.xdg.dataHome}/gnupg"; - }; - - password-store = { - enable = true; - package = pkgs.pass.withExtensions (exts: [exts.pass-otp]); - settings.PASSWORD_STORE_DIR = "${config.xdg.dataHome}/password-store"; - }; - }; - - services = { - gpg-agent = { - enable = true; - enableSshSupport = true; - pinentryFlavor = "gnome3"; - sshKeys = ["73D1C4271E8C508E1E55259660C94BE828B07738"]; - }; - - syncthing.enable = true; - }; -} diff --git a/foreign/dotfiles/home/programs/dunst.nix b/foreign/dotfiles/home/programs/dunst.nix deleted file mode 100644 index 49c2f5e..0000000 --- a/foreign/dotfiles/home/programs/dunst.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ - pkgs, - default, - ... -}: { - # notification daemon - services.dunst = { - enable = true; - iconTheme = { - name = "Papirus-Dark"; - package = pkgs.papirus-icon-theme; - }; - settings = { - global = { - alignment = "center"; - corner_radius = 16; - follow = "mouse"; - font = "Roboto 10"; - format = "%s\\n%b"; - frame_width = 1; - offset = "5x5"; - horizontal_padding = 8; - icon_position = "left"; - indicate_hidden = "yes"; - markup = "yes"; - max_icon_size = 64; - mouse_left_click = "do_action"; - mouse_middle_click = "close_all"; - mouse_right_click = "close_current"; - padding = 8; - plain_text = "no"; - separator_color = "auto"; - separator_height = 1; - show_indicators = false; - shrink = "no"; - word_wrap = "yes"; - }; - - fullscreen_delay_everything = {fullscreen = "delay";}; - - urgency_critical = { - background = default.xcolors.bg; - foreground = default.xcolors.fg; - frame_color = default.xcolors.red; - }; - urgency_low = { - background = default.xcolors.bg; - foreground = default.xcolors.fg; - frame_color = default.xcolors.blue; - }; - urgency_normal = { - background = default.xcolors.bg; - foreground = default.xcolors.fg; - frame_color = default.xcolors.green; - }; - }; - }; -} diff --git a/foreign/dotfiles/home/programs/eww/README.md b/foreign/dotfiles/home/programs/eww/README.md deleted file mode 100644 index fb27f74..0000000 --- a/foreign/dotfiles/home/programs/eww/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# Eww configuration - -This configuration aims to provide a fully working shell replacement for -compositors/window managers. Features constantly get added and existing ones -get improved. - -## 🗃️ Components - -The same daemon runs multiple windows which interact with each other: - -### bar - -![bar](https://user-images.githubusercontent.com/36706276/216402839-0f8ec9b0-dc4b-4cb8-9834-db59b61db97f.png) - -### music window - -![music](https://user-images.githubusercontent.com/36706276/192146077-f8da4691-9a0c-487f-9805-3fd4d55551e9.gif) - -### calendar - -![calendar](https://user-images.githubusercontent.com/36706276/204923748-f5c7db3a-5000-40cf-ba41-cd2d5f14146a.png) - -### system info - -![system](https://user-images.githubusercontent.com/36706276/216403137-a3231c60-976a-4e5d-85c0-899679ab0a92.png) - -## ❔ Usage - -### Home Manager - -If you use Home Manager, installing is as simple as adding my flake to your -inputs, passing `inputs` to `extraSpecialArgs` and importing the relevant -module: -```nix -{inputs, ...}: { - imports = [inputs.fufexan.homeManagerModules.eww-hyprland]; - - programs.eww-hyprland = { - enable = true; - - # default package - package = pkgs.eww-wayland; - - # if you want to change colors - colors = builtins.readFile ./macchiato.scss; - - # set to true to reload on change - autoReload = false; - }; -} -``` - -Make sure to also add the fonts listed below. - -### Other distros - -To quickly install this config, grab all the files in this directory and put -them in `~/.config/eww`. Then run `eww daemon` and `eww open bar`. Enjoy! - -Dependencies: -- Icon fonts: `material-symbols-outline` (any variation can be used as long as you change the `font-family` property of `.icon`) -- Text font: [Jost](https://fonts.google.com/specimen/Jost) -- Script deps: everything in `default.nix`'s `dependencies` list. - -## 🎨 Theme - -The theme colors can be changed in `css/_colors.scss`. Currently the theme used -is [Catppuccin Mocha](https://github.com/catppuccin/catppuccin). diff --git a/foreign/dotfiles/home/programs/eww/css/_calendar.scss b/foreign/dotfiles/home/programs/eww/css/_calendar.scss deleted file mode 100644 index 6e5a1e1..0000000 --- a/foreign/dotfiles/home/programs/eww/css/_calendar.scss +++ /dev/null @@ -1,31 +0,0 @@ -.calendar-win { - @include window; - background-color: $bg; - color: $fg; - padding: .2em; -} - -calendar { - padding: 5px; - - :selected { - color: $magenta; - } - - .header { - color: $black; - } - - .highlight { - color: $red; - font-weight: bold; - } - - .button { - color: $blue; - } - - :indeterminate { - color: $green; - } -} diff --git a/foreign/dotfiles/home/programs/eww/css/_colors.scss b/foreign/dotfiles/home/programs/eww/css/_colors.scss deleted file mode 100644 index f899781..0000000 --- a/foreign/dotfiles/home/programs/eww/css/_colors.scss +++ /dev/null @@ -1,35 +0,0 @@ -$rosewater: #f5e0dc; -$flamingo: #f2cdcd; -$pink: #f5c2e7; -$mauve: #cba6f7; -$red: #f38ba8; -$maroon: #eba0ac; -$peach: #fab387; -$yellow: #f9e2af; -$green: #a6e3a1; -$teal: #94e2d5; -$sky: #89dceb; -$sapphire: #74c7ec; -$blue: #89b4fa; -$lavender: #b4befe; - -$text: #cdd6f4; -$subtext1: #bac2de; -$subtext0: #a6adc8; -$overlay2: #9399b2; -$overlay1: #7f849c; -$overlay0: #6c7086; - -$surface2: #585b70; -$surface1: #45475a; -$surface0: #313244; - -$base: #1e1e2e; -$mantle: #181825; -$crust: #11111b; - -$fg: $text; -$bg: rgba(30, 30, 46, 0.6); -$bg1: rgba(49, 50, 68, 0.6); -$border: #28283d; -$shadow: $crust; diff --git a/foreign/dotfiles/home/programs/eww/css/_music.scss b/foreign/dotfiles/home/programs/eww/css/_music.scss deleted file mode 100644 index b3d0ee4..0000000 --- a/foreign/dotfiles/home/programs/eww/css/_music.scss +++ /dev/null @@ -1,66 +0,0 @@ -.song-cover-art { - @include rounding; - background-position: center; - background-size: cover; - margin: 4px 5px 4px 0; - min-height: 24px; - min-width: 24px; -} - -.music-window { - @include window; - background-color: $bg; - border: 1px solid $border; - color: $fg; -} - -.music-cover-art { - background-position: center; - background-size: cover; - border-radius: 8px; - margin: 1em; - min-height: 170px; - min-width: 170px; -} - -.music-box { - margin: 1rem 1rem 1rem 0; -} - -.music-title { - font-size: 1.1rem; - font-weight: bold; -} - -.music-artist { - color: $white_a; -} - -.music-button label { - color: $white_a; - font-size: 2rem; -} - -.music-time { - color: $white_a; - margin: 0 1rem; -} - -.music-bar scale { - highlight { - background-image: linear-gradient(to right, $cyan, $blue_a); - border-radius: 24px; - } - - trough { - background-color: $bg1; - border-radius: 24px; - margin-top: 0; - min-height: 10px; - min-width: 170px; - } -} - -.playctl { - color: $yellow; -} diff --git a/foreign/dotfiles/home/programs/eww/css/_osd.scss b/foreign/dotfiles/home/programs/eww/css/_osd.scss deleted file mode 100644 index ab605a2..0000000 --- a/foreign/dotfiles/home/programs/eww/css/_osd.scss +++ /dev/null @@ -1,36 +0,0 @@ -.osd-part { - @include window; - background: $bg; - margin: 0 .5rem .5rem; - - label { - color: $text; - font-size: 2rem; - margin: 0 .1rem 0 .2rem; - } - - scale { - margin: -.2rem 0; - } - - trough { - @include rounding; - background-color: $bg1; - margin: 1rem 0 .5rem; - min-height: 10rem; - min-width: .7rem; - - highlight { - @include rounding; - min-width: 0; - } - } -} - -.osd-volume highlight { - background-image: linear-gradient(to top, $cyan, $blue_a); -} - -.osd-brightness highlight { - background-image: linear-gradient(to top, $yellow, $yellow_a); -} diff --git a/foreign/dotfiles/home/programs/eww/css/_sidebar.scss b/foreign/dotfiles/home/programs/eww/css/_sidebar.scss deleted file mode 100644 index 58af83f..0000000 --- a/foreign/dotfiles/home/programs/eww/css/_sidebar.scss +++ /dev/null @@ -1,127 +0,0 @@ -.system-menu-box { - @include window; - background-color: $bg; - color: $text; -} - -.separator { - font-size: 1rem; -} - -.top-row { - margin: 1rem 1.5rem 0; - - .time { font-size: 2rem; } - - .date-box { - margin: 0 1rem; - - label { font-size: 1.1rem; } - - .date { - background: unset; - margin: 0 .5rem 0 0; - padding: 0; - } - } -} - -.system-row { - margin: .5rem .7rem; - - .airplane-box button { - padding: 1rem 3rem; - } - - label { - font-size: 1rem; - margin: 0 .1rem; - } -} - -.element { - @include rounding; - background-color: $black; - margin: .3rem; - - button { - @include rounding; - padding: 1rem; - - label { - font-size: 1.5rem; - } - - &:hover { - background-color: $cyan_a; - } - } -} - -.sliders { - @include rounding; - background-color: $black; - margin: .5rem 1rem; - padding: .6rem 1rem; - - scale { - margin-right: -1rem; - min-width: 21.5rem; - - trough { margin-right: 0; } - } - - box { margin: .2rem 0; } - label { font-size: 1.2rem; } -} - -.volume-slider-box, -.brightness-slider-box { - trough { background-color: $base; } -} - -.volume-bar highlight { - @include rounding; - background-image: linear-gradient(to right, $cyan, $blue_a); -} - -.brightness-slider-box scale highlight { - @include rounding; - background-image: linear-gradient(to right, $yellow, $yellow_a); -} - -.bottom-row { - margin: .5rem 1rem; - - .battery-icon { font-size: 2rem; } - .battery-wattage { color: $magenta; } - - .battery-status { - color: $green; - margin: 0 .5rem; - } - - button { - background-color: $black; - border-radius: 50%; - margin-bottom: .1rem; - padding: 0 .5rem; - - label { font-size: 1.5rem; } - &:hover { background-color: $black_a; } - } -} - -.bt-connected { - background-color: $blue; - color: $red; - - button:hover { background-color: rgba(0, 0, 0, .1); } -} - -.wifi-connected { - background-color: $magenta; - color: $red; - - button:hover { background-color: rgba(0, 0, 0, .1); } -} diff --git a/foreign/dotfiles/home/programs/eww/css/_system.scss b/foreign/dotfiles/home/programs/eww/css/_system.scss deleted file mode 100644 index b59736a..0000000 --- a/foreign/dotfiles/home/programs/eww/css/_system.scss +++ /dev/null @@ -1,80 +0,0 @@ -* { - transition: 1s; -} - -.membar { - color: $yellow; -} - -.cpubar { - color: $blue; -} - -.batbar { - color: $green; -} - -.membar, -.cpubar, -.batbar { - background-color: $bg1; -} - -.iconmem { - color: $yellow; -} - -.iconcpu { - color: $blue; -} - -.icon-text { - font-size: 3rem; - padding: .7rem; -} - -.sys-text-sub { - color: $text; -} - -.sys-text-mem, -.sys-text-cpu { - font-size: 1rem; - font-weight: bold; -} - -.sys-icon-mem, -.sys-icon-cpu { - font-size: 1.5rem; - margin: 1.5rem; -} - -.system-info-box { - @include rounding; - background-color: $black; - margin: .5rem 1rem; - padding: .5rem; -} - -.sys-mem, -.sys-cpu { - background-color: $bg; -} - -.sys-icon-mem, -.sys-text-mem, -.sys-mem { - color: $yellow; -} - -.sys-icon-cpu, -.sys-text-cpu, -.sys-cpu { - color: $blue; -} - -.sys-box { - margin: .3em; - - box { margin-left: 1rem; } -} diff --git a/foreign/dotfiles/home/programs/eww/css/_volume.scss b/foreign/dotfiles/home/programs/eww/css/_volume.scss deleted file mode 100644 index 1f340f6..0000000 --- a/foreign/dotfiles/home/programs/eww/css/_volume.scss +++ /dev/null @@ -1,5 +0,0 @@ -.vol-icon { color: $green; } -.volbar highlight { - background-image: linear-gradient(to right, $cyan, $blue_a); - border-radius: 10px; -} diff --git a/foreign/dotfiles/home/programs/eww/default.nix b/foreign/dotfiles/home/programs/eww/default.nix deleted file mode 100644 index 5e2eb52..0000000 --- a/foreign/dotfiles/home/programs/eww/default.nix +++ /dev/null @@ -1,128 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - dependencies = with pkgs; [ - config.wayland.windowManager.hyprland.package - cfg.package - bash - bc - blueberry - bluez - coreutils - dbus - dunst - findutils - gawk - gnome.gnome-control-center - gnused - gojq - imagemagick - jaq - light - networkmanager - pavucontrol - playerctl - procps - pulseaudio - ripgrep - socat - udev - upower - util-linux - wget - wireplumber - wlogout - socat - fuzzel - swaynotificationcenter - ]; - - reload_script = pkgs.writeShellScript "reload_eww" '' - windows=$(eww windows | rg '\*' | tr -d '*') - - systemctl --user restart eww.service - - echo $windows | while read -r w; do - eww open $w - done - ''; - - cfg = config.programs.eww-hyprland; -in { - options.programs.eww-hyprland = { - enable = lib.mkEnableOption "eww Hyprland config"; - - package = lib.mkOption { - type = with lib.types; nullOr package; - default = pkgs.eww-wayland; - defaultText = lib.literalExpression "pkgs.eww-wayland"; - description = "Eww package to use."; - }; - - autoReload = lib.mkOption { - type = lib.types.bool; - default = false; - defaultText = lib.literalExpression "false"; - description = "Whether to restart the eww daemon and windows on change."; - }; - - colors = lib.mkOption { - type = with lib.types; nullOr lines; - default = null; - defaultText = lib.literalExpression "null"; - description = '' - SCSS file with colors defined in the same way as Catppuccin colors are, - to be used by eww. - - Defaults to Catppuccin Mocha. - ''; - }; - }; - - config = lib.mkIf cfg.enable { - home.packages = [cfg.package]; - - # remove nix files - xdg.configFile."eww" = { - source = lib.cleanSourceWith { - filter = name: _type: let - baseName = baseNameOf (toString name); - in - !(lib.hasSuffix ".nix" baseName) && !(baseName == "_colors.scss"); - src = lib.cleanSource ./.; - }; - - # links each file individually, which lets us insert the colors file separately - recursive = true; - - onChange = - if cfg.autoReload - then reload_script.outPath - else ""; - }; - - # colors file - xdg.configFile."eww/css/_colors.scss".text = - if cfg.colors != null - then cfg.colors - else (builtins.readFile ./css/_colors.scss); - - systemd.user.services.eww = { - Unit = { - Description = "Eww Daemon"; - # not yet implemented - # PartOf = ["tray.target"]; - PartOf = ["graphical-session.target"]; - }; - Service = { - Environment = "PATH=/run/wrappers/bin:${lib.makeBinPath dependencies}"; - ExecStart = "${cfg.package}/bin/eww daemon --no-daemonize"; - Restart = "on-failure"; - }; - Install.WantedBy = ["graphical-session.target"]; - }; - }; -} diff --git a/foreign/dotfiles/home/programs/eww/eww.scss b/foreign/dotfiles/home/programs/eww/eww.scss deleted file mode 100644 index e809818..0000000 --- a/foreign/dotfiles/home/programs/eww/eww.scss +++ /dev/null @@ -1,93 +0,0 @@ -@import 'css/colors'; - -@mixin rounding { - border-radius: 16px; -} - -@mixin window { - border: 1px solid $border; - box-shadow: 0 2px 3px $shadow; - margin: 5px 5px 0px; - @include rounding; -} - -* { - all: unset; - font-family: "Montreux Classic", "Jost *", Roboto, sans-serif; - transition: 200ms ease; -} - -@import 'css/calendar'; -@import 'css/music'; -@import 'css/osd'; -@import 'css/sidebar'; -@import 'css/system'; -@import 'css/volume'; - -.bar { - color: $fg; - label { - font-size: 1.4rem; - } -} - -.vis { - background-color: $bg; - border-radius: 24px; - padding: 4px 24px; - margin-top: 12px; - margin-bottom: 0px; - border: 3px solid $outline; -} - -.invis { - background-color: rgba(0, 0, 0, 0); -} - -tooltip { - background: $bg; - border: 1px solid $border; - border-radius: 8px; - - label { - font-size: 1rem; - } -} - -.icon, -.icon label { font-family: Material Symbols Outlined; } - -.module { margin: 0 5px; } - -.hour { - padding-left: 5px; -} - -.minute { - padding-right: .7rem; -} - -.date { - background: $bg; - color: $yellow; - - label { - font-size: 1.2rem; - } -} - -.bright-icon { color: $yellow_a; } -.module-bt { font-size: 1.2rem; } - -scale trough { - background-color: $bg; - border-radius: 24px; - margin: 0 1rem; - min-height: 10px; - min-width: 70px; -} - -.workspaces { - margin-left: 10px; - button { transition: color 2s ease; } -} diff --git a/foreign/dotfiles/home/programs/eww/eww.yuck b/foreign/dotfiles/home/programs/eww/eww.yuck deleted file mode 100644 index d1b2654..0000000 --- a/foreign/dotfiles/home/programs/eww/eww.yuck +++ /dev/null @@ -1,56 +0,0 @@ -(include "./modules/clock.yuck") -(include "./modules/music.yuck") -(include "./modules/net.yuck") -(include "./modules/sys.yuck") -(include "./modules/variables.yuck") -(include "./modules/volume.yuck") -(include "./modules/workspaces.yuck") -(include "./modules/current_win.yuck") - -(include "./windows/calendar.yuck") -(include "./windows/music.yuck") -(include "./windows/osd.yuck") -(include "./windows/system-menu.yuck") - -(defwidget left [] - (box - :space-evenly false - :halign "start" - :class "vis" - (workspaces))) - -(defwidget right [] - (box - :space-evenly false - :halign "end" - :class "vis bar" - (music-module) - (volume-module) - (net) - (sys) - (clock_module))) - -(defwidget center [] - (box - :space-evenly false - :halign "center" - :class "vis bar" - (current-win-module))) - -(defwidget bar-box [] - (centerbox - :class "invis bar" - (left) - (center) - (right))) - -(defwindow bar - :monitor 0 - :geometry (geometry :x "0%" - :y "0%" - :width "98%" - :height "24px" - :anchor "top center") - :stacking "fg" - :exclusive true - (bar-box)) diff --git a/foreign/dotfiles/home/programs/eww/modules/bluetooth.yuck b/foreign/dotfiles/home/programs/eww/modules/bluetooth.yuck deleted file mode 100644 index 5b023b8..0000000 --- a/foreign/dotfiles/home/programs/eww/modules/bluetooth.yuck +++ /dev/null @@ -1,8 +0,0 @@ -(defwidget bluetooth [] - (button - :class "module-bt module icon" - :onclick "blueberry" - :onrightclick "scripts/bluetooth toggle" - :tooltip "${bluetooth.text} ${bluetooth.battery}" - :style "color: ${bluetooth.color};" - {bluetooth.icon})) diff --git a/foreign/dotfiles/home/programs/eww/modules/bright.yuck b/foreign/dotfiles/home/programs/eww/modules/bright.yuck deleted file mode 100644 index 27b1b5f..0000000 --- a/foreign/dotfiles/home/programs/eww/modules/bright.yuck +++ /dev/null @@ -1,9 +0,0 @@ -(defwidget bright [] - (box - :class "module" - (eventbox - :onscroll "echo {} | sed -e 's/up/-U 1/g' -e 's/down/-A 1/g' | xargs light" - (label - :text {brightness.icon} - :class "bright-icon icon" - :tooltip "brightness ${round(brightness.percent, 0)}%")))) diff --git a/foreign/dotfiles/home/programs/eww/modules/clock.yuck b/foreign/dotfiles/home/programs/eww/modules/clock.yuck deleted file mode 100644 index 4b13d9e..0000000 --- a/foreign/dotfiles/home/programs/eww/modules/clock.yuck +++ /dev/null @@ -1,24 +0,0 @@ -(defvar date_rev false) - -(defwidget clock_module [] - (eventbox - :onhover "${EWW_CMD} update date_rev=true" - :onhoverlost "${EWW_CMD} update date_rev=false" - (overlay - :class "module" - (box - :space-evenly false - (label - :text {time.hour} - :class "hour") - (label - :text ":") - (label - :text {time.minute} - :class "minute")) - (revealer - :reveal date_rev - (button - :class "date" - :onclick "${EWW_CMD} open --toggle calendar" - {time.date}))))) diff --git a/foreign/dotfiles/home/programs/eww/modules/current_win.yuck b/foreign/dotfiles/home/programs/eww/modules/current_win.yuck deleted file mode 100644 index a4142d7..0000000 --- a/foreign/dotfiles/home/programs/eww/modules/current_win.yuck +++ /dev/null @@ -1,8 +0,0 @@ -(defwidget current-win-module [] - (box - (button - :class "module" - {current_win.title} - ) - ) -) diff --git a/foreign/dotfiles/home/programs/eww/modules/music.yuck b/foreign/dotfiles/home/programs/eww/modules/music.yuck deleted file mode 100644 index 0b7ae88..0000000 --- a/foreign/dotfiles/home/programs/eww/modules/music.yuck +++ /dev/null @@ -1,28 +0,0 @@ -(defwidget music-module [] - (eventbox - :onhover "${EWW_CMD} update music_reveal=true" - :onhoverlost "${EWW_CMD} update music_reveal=false" - (box - :class "module" - :space-evenly false - (box - :class "song-cover-art" - :style "background-image: url(\"${music.cover}\");") - (button - :class "module" - :onclick "${EWW_CMD} open --toggle music" - {music.status == "Stopped" || music.status == "" ? "" : - "${music.artist} - ${music.title}"}) - (box - :class "icon" - {music.static == "Stopped" || music.status == "" ? "" : music.status == "Playing" ? "" : "" }) - (revealer - :class "playctl" - :transition "slideright" - :reveal music_reveal - :duration "350ms" - (box - :class "icon" - (button :class "song-button" :onclick "playerctl previous" "") - (button :class "song-button" :onclick "playerctl play-pause" {music.status == "Playing" ? "" : ""}) - (button :class "song-button" :onclick "playerctl next" "")))))) diff --git a/foreign/dotfiles/home/programs/eww/modules/net.yuck b/foreign/dotfiles/home/programs/eww/modules/net.yuck deleted file mode 100644 index 3bfb4f8..0000000 --- a/foreign/dotfiles/home/programs/eww/modules/net.yuck +++ /dev/null @@ -1,7 +0,0 @@ -(defwidget net [] - (button - :class "module icon" - :onclick "gnome-control-center &" - :tooltip {net.essid} - :style "color: ${net.color};" - {net.icon})) diff --git a/foreign/dotfiles/home/programs/eww/modules/sys.yuck b/foreign/dotfiles/home/programs/eww/modules/sys.yuck deleted file mode 100644 index d5403a5..0000000 --- a/foreign/dotfiles/home/programs/eww/modules/sys.yuck +++ /dev/null @@ -1,32 +0,0 @@ -(defwidget sys [] - (box - :class "module" - :space-evenly false - :spacing 5 - (circular-progress - :value "${EWW_CPU.avg}" - :class "cpubar" - :thickness 3 - (button - :tooltip "using ${round(EWW_CPU.avg,0)}% cpu" - :onclick "${EWW_CMD} open --toggle system-menu" - (label :class "icon-text" :text ""))) - - (circular-progress - :value {memory.percent} - :class "membar" - :thickness 3 - (button - :tooltip "using ${round(memory.percent,0)}% ram" - :onclick "${EWW_CMD} open --toggle system-menu" - (label :class "icon-text" :text ""))) - - (circular-progress - :value "${EWW_BATTERY["BAT0"].capacity}" - :class "batbar" - :style "color: ${battery.color};" - :thickness 3 - (button - :tooltip "battery on ${EWW_BATTERY["BAT0"].capacity}%" - :onclick "${EWW_CMD} open --toggle system-menu" - (label :class "icon-text" :text ""))))) diff --git a/foreign/dotfiles/home/programs/eww/modules/variables.yuck b/foreign/dotfiles/home/programs/eww/modules/variables.yuck deleted file mode 100644 index 6af2136..0000000 --- a/foreign/dotfiles/home/programs/eww/modules/variables.yuck +++ /dev/null @@ -1,21 +0,0 @@ -(defvar bright_reveal false) -(defvar bt_rev false) -(defvar music_reveal false) -(defvar net_rev false) -(defvar time_rev false) -(defvar vol_reveal false) -(defvar osd-brightness false) -(defvar osd-volume false) - -(defpoll time :interval "5s" `date +'{"date": "%d/%m", "hour": "%H", "minute": "%M", "day": "%A"}'`) - -(deflisten airplane "scripts/airplane") -(deflisten battery "scripts/battery") -(deflisten bluetooth "scripts/bluetooth") -(deflisten brightness "scripts/brightness") -(deflisten memory "scripts/memory") -(deflisten music "scripts/music") -(deflisten net "scripts/net") -(deflisten volume "scripts/volume") -(deflisten workspace "scripts/workspaces") -(deflisten current_win "scripts/current_win") diff --git a/foreign/dotfiles/home/programs/eww/modules/volume.yuck b/foreign/dotfiles/home/programs/eww/modules/volume.yuck deleted file mode 100644 index c4dceee..0000000 --- a/foreign/dotfiles/home/programs/eww/modules/volume.yuck +++ /dev/null @@ -1,11 +0,0 @@ -(defwidget volume-module [] - (box - :class "module icon" - (eventbox - :onscroll "echo {} | sed -e 's/up/-/g' -e 's/down/+/g' | xargs -I% wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.005%" - :onclick "pavucontrol &" - :onrightclick "scripts/volume mute SINK" - (label - :class "vol-icon" - :tooltip "volume ${volume.percent}%" - :text {volume.icon})))) diff --git a/foreign/dotfiles/home/programs/eww/modules/workspaces.yuck b/foreign/dotfiles/home/programs/eww/modules/workspaces.yuck deleted file mode 100644 index f8d0ac1..0000000 --- a/foreign/dotfiles/home/programs/eww/modules/workspaces.yuck +++ /dev/null @@ -1,13 +0,0 @@ -(defwidget workspaces [] - (eventbox - :onscroll "echo {} | sed -e \"s/up/-1/g\" -e \"s/down/+1/g\" | xargs hyprctl dispatch workspace" - (box - :class "module workspaces" - :spacing 5 - (for ws in workspace - (button - :onclick "hyprctl dispatch workspace ${ws.number}" - :class "ws icon" - :style "color: ${ws.color};" - ; :tooltip {ws.tooltip} - "●"))))) diff --git a/foreign/dotfiles/home/programs/eww/scripts/airplane b/foreign/dotfiles/home/programs/eww/scripts/airplane deleted file mode 100755 index 61db360..0000000 --- a/foreign/dotfiles/home/programs/eww/scripts/airplane +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -icon() { - if [ "$STATUS" = "no" ]; then - echo "" - else - echo "" - fi -} - -toggle() { - if [ "$STATUS" = "no" ]; then - rfkill block all - notify-send --urgency=normal -i airplane-mode-symbolic "Airplane Mode" "Airplane mode has been turned on!" - else - rfkill unblock all - notify-send --urgency=normal -i airplane-mode-disabled-symbolic "Airplane Mode" "Airplane mode has been turned off!" - fi -} - -if [ "$1" = "toggle" ]; then - toggle -else - while true; do - STATUS="$(rfkill list | sed -n 2p | awk '{print $3}')" - icon - sleep 3; - done -fi diff --git a/foreign/dotfiles/home/programs/eww/scripts/battery b/foreign/dotfiles/home/programs/eww/scripts/battery deleted file mode 100755 index ad383d2..0000000 --- a/foreign/dotfiles/home/programs/eww/scripts/battery +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env bash - -icons=("" "" "" "" "" "" "" "") -num_icons=$(bc <<< "100 / ${#icons[@]}") - - -geticon() { - level=$(awk -v n="$CAPACITY" -v c="$num_icons" 'BEGIN{print int(n/c-1)}') - if [[ "$level" -lt 0 ]]; then - level=0 - fi - echo "${icons[$level]}" -} - -status() { - if [ "$STATE" = "Charging" ]; then - echo -n "charging" - - if [ "$RATE" -gt 0 ]; then - echo ", $(gettime) left" - else - echo "" - fi - elif [ "$STATE" = "Discharging" ]; then - echo "$(gettime)h left" - else - echo "fully charged" - fi -} - -color() { - if [ "$CAPACITY" -le 20 ]; then - echo '#f38ba8' - else - echo '#a6e3a1' - fi -} - -wattage() { - microwatts=1000000 - echo "$(bc -l <<< "scale=1; $RATE / $microwatts") W" -} - -gettime() { - FULL=$(cat /sys/class/power_supply/BAT0/energy_full) - NOW=$(cat /sys/class/power_supply/BAT0/energy_now) - - if [ "$RATE" -gt 0 ]; then - if [ "$STATE" = "Discharging" ]; then - EX="$NOW / $RATE" - else - EX="($FULL - $NOW) / $RATE" - fi - date -u -d@"$(bc -l <<< "$EX * 3600")" +%H:%M - fi -} - -while true; do - RATE=$(cat /sys/class/power_supply/BAT0/power_now) - CAPACITY=$(cat /sys/class/power_supply/BAT0/capacity) - STATE=$(cat /sys/class/power_supply/BAT0/status) - - echo '{ "icon": "'"$(geticon)"'", "percent": '"$CAPACITY"', "wattage": "'"$(wattage)"'", "status": "'"$(status)"'", "color": "'"$(color)"'" }' - sleep 3 -done \ No newline at end of file diff --git a/foreign/dotfiles/home/programs/eww/scripts/bluetooth b/foreign/dotfiles/home/programs/eww/scripts/bluetooth deleted file mode 100755 index 63ce547..0000000 --- a/foreign/dotfiles/home/programs/eww/scripts/bluetooth +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash - -toggle() { - status=$(rfkill -J | jaq -r '.rfkilldevices[] | select(.type == "bluetooth") | .soft' | head -1) - - if [ "$status" = "unblocked" ]; then - rfkill block bluetooth - else - rfkill unblock bluetooth - fi -} - -if [ "$1" = "toggle" ]; then - toggle -else - while true; do - powered=$(bluetoothctl show | rg Powered | cut -f 2- -d ' ') - status=$(bluetoothctl info) - name=$(echo "$status" | rg Name | cut -f 2- -d ' ') - mac=$(echo "$status" | head -1 | awk '{print $2}' | tr ':' '_') - - if [[ "$(echo "$status" | rg Percentage)" != "" ]]; then - battery="$(upower -i /org/freedesktop/UPower/devices/headset_dev_"$mac" | rg percentage | awk '{print $2}' | cut -f 1 -d '%')%" - else - battery="" - fi - - if [ "$powered" = "yes" ]; then - if [ "$status" != "Missing device address argument" ]; then - text="$name" - icon="" - color="#89b4fa" - class="bt-connected" - else - icon="" - text="Disconnected" - color="#45475a" - class="" - fi - else - icon="" - text="Bluetooth off" - color="#45475a" - class="" - fi - - echo '{ "icon": "'"$icon"'", "battery": "'"$battery"'", "text": "'"$text"'", "color": "'"$color"'", "class": "'"$class"'" }' - - sleep 3 - done -fi diff --git a/foreign/dotfiles/home/programs/eww/scripts/brightness b/foreign/dotfiles/home/programs/eww/scripts/brightness deleted file mode 100755 index 5ca2dd1..0000000 --- a/foreign/dotfiles/home/programs/eww/scripts/brightness +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash - -icons=("" "" "") -if [ ! "$XDG_CACHE_HOME" ]; then - XDG_CACHE_HOME="/home/mihai/.local/cache" -fi -date="$XDG_CACHE_HOME/eww/osd_brightness.date" - -osd() { - if [ ! -f "$date" ]; then - mkdir -p "$XDG_CACHE_HOME/eww" - fi - date +%s > "$date" -} - -osd_handler() { - lock=0 - rundate=0 - if [ ! -f "$date" ]; then - mkdir -p "$XDG_CACHE_HOME/eww" - echo 0 > "$date" - fi - - while true; do - # get dates - rundate=$(cat "$date") - currentdate=$(date +%s) - - # handle showing - if [ "$rundate" = "$currentdate" ] && [ "$lock" -eq 0 ]; then - eww open osd - eww update osd-brightness=true - lock=1 - elif [ "$((currentdate - rundate))" = "2" ] && [ "$lock" -eq 1 ]; then - eww update osd-brightness=false - lock=0 - if [ "$(eww get osd-brightness)" = "false" ] && [ "$(eww get osd-volume)" = "false" ]; then - eww close osd - fi - fi - - sleep 0.1 - done - - eww close osd -} - -if [ "$1" = "osd" ]; then - osd -else - osd_handler & - # initial - icon=${icons[$(awk -v n="$(light)" 'BEGIN{print int(n/34)}')]} - echo '{ "percent": '"$(light)"', "icon": "'"$icon"'" }' - - udevadm monitor | rg --line-buffered "backlight" | while read -r _; do - icon="${icons[$(awk -v n="$(light)" 'BEGIN{print int(n/34)}')]}" - - echo '{ "percent": '"$(light)"', "icon": "'"$icon"'" }' - done -fi diff --git a/foreign/dotfiles/home/programs/eww/scripts/current_win b/foreign/dotfiles/home/programs/eww/scripts/current_win deleted file mode 100755 index 10ee3d2..0000000 --- a/foreign/dotfiles/home/programs/eww/scripts/current_win +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -socat -u UNIX-CLIENT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock STDOUT | -while read line; do - if [[ "$line" == activewindow\>\>* ]]; then - windowtitle="$(echo $line | cut -d',' -f 2)" - echo '{"title": "'$windowtitle'"}' - fi -done - diff --git a/foreign/dotfiles/home/programs/eww/scripts/memory b/foreign/dotfiles/home/programs/eww/scripts/memory deleted file mode 100755 index 0ae499b..0000000 --- a/foreign/dotfiles/home/programs/eww/scripts/memory +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -while true; do - # human-readable - freeH=$(free -h --si | rg "Mem:") - # non-human-readable - freeN=$(free --mega | rg "Mem:") - - total="$(echo "$freeH" | awk '{ print $2 }')" - used="$(echo "$freeH" | awk '{ print $3 }')" - t="$(echo "$freeN" | awk '{ print $2 }')" - u="$(echo "$freeN" | awk '{ print $3 }')" - - free=$(printf '%.1fG' "$(bc -l <<< "($t - $u) / 1000")") - perc=$(printf '%.1f' "$(free -m | rg Mem | awk '{print ($3/$2)*100}')") - - echo '{ "total": "'"$total"'", "used": "'"$used"'", "free": "'"$free"'", "percent": '"$perc"' }' - - sleep 3 -done diff --git a/foreign/dotfiles/home/programs/eww/scripts/music b/foreign/dotfiles/home/programs/eww/scripts/music deleted file mode 100755 index 3128109..0000000 --- a/foreign/dotfiles/home/programs/eww/scripts/music +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env bash - -get_status() { - s=$1 - if [ "$s" = "Playing" ]; then - echo "" - else - echo "" - fi -} - -get_length_sec() { - len=$1 - if [ -z "$len" ]; then - echo 0 - else - bc <<<"$len / 1000000" - fi -} - -get_length_time() { - len=$1 - if [ -n "$len" ]; then - len=$(bc <<<"$len / 1000000 + 1") - date -d@"$len" +%M:%S - else - echo "" - fi -} - -get_position() { - pos=$1 - len=$2 - if [ -n "$pos" ]; then - bc -l <<<"$pos / $len * 100" - else - echo 0 - fi -} - -get_position_time() { - pos=$1 - len=$2 - if [ -n "$pos" ]; then - date -d@"$(bc <<<"$pos / 1000000")" +%M:%S - else - echo "" - fi -} - -get_cover() { - mkdir -p "$XDG_CACHE_HOME/eww_covers" - cd "$XDG_CACHE_HOME/eww_covers" || exit - - IMGPATH="$XDG_CACHE_HOME/eww_covers/cover_art.png" - - COVER_URL="$1" - - if [[ "$COVER_URL" = https* ]]; then - if [ ! -e "$XDG_CACHE_HOME/eww_covers/$(basename "$COVER_URL")" ]; then - wget -N "$COVER_URL" -o /dev/null - fi - - rm "$IMGPATH" - ln -s "$(basename "$COVER_URL")" "$IMGPATH" - - IMG="${IMGPATH}" - elif [ "$COVER_URL" = "" ]; then - IMG="" - else - IMG="$COVER_URL" - fi - - echo "$IMG" -} - -sanitize() { - echo "$1" | sed 's/"/\"/g' -} - -prevCover='' - -playerctl -F metadata -f '{{title}}\{{artist}}\{{status}}\{{position}}\{{mpris:length}}\{{mpris:artUrl}}' 2>/dev/null | while IFS="$(printf '\')" read -r title artist status position len cover; do - if [[ "$cover" != "$prevCover" ]]; then - COVER=$(get_cover "$cover") - - if [ "$COVER" != "" ]; then - cols=$(convert "$COVER" -colors 2 -format "%c" histogram:info: | awk '{print $3}') - color1=$(echo "$cols" | head -1) - color1=$(printf "rgba(%d, %d, %d, 0.6)" ${color1:1:2} ${color1:3:2} ${color1:5:2}) - color2=$(echo "$cols" | tail -1) - else - color1="#1e1e2e" - color2="#28283d" - fi - fi - - jaq --null-input -r -c \ - --arg artist "$(sanitize "$artist")" \ - --arg title "$(sanitize "$title")" \ - --arg status "$status" \ - --arg pos "$(get_position "$position" "$len")" \ - --arg pos_time "$(get_position_time "$position" "$len")" \ - --arg length "$(get_length_time "$len")" \ - --arg cover "$COVER" \ - --arg color1 "$color1" \ - --arg color2 "$color2" \ - '{"artist": $artist, "title": $title, "status": $status, "position": $pos, "position_time": $pos_time, "length": $length, "cover": $cover, "color1": $color1, "color2": $color2}' - - prevCover=$cover -done diff --git a/foreign/dotfiles/home/programs/eww/scripts/net b/foreign/dotfiles/home/programs/eww/scripts/net deleted file mode 100755 index a84b9b9..0000000 --- a/foreign/dotfiles/home/programs/eww/scripts/net +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash - -toggle() { - status=$(rfkill -J | jaq -r '.rfkilldevices[] | select(.type == "wlan") | .soft' | head -1) - - if [ "$status" = "unblocked" ]; then - rfkill block wlan - else - rfkill unblock wlan - fi -} - -if [ "$1" = "toggle" ]; then - toggle -else - while true; do - status=$(nmcli -f state g| tail -1) - wifistatus=$(nmcli -t -f in-use,ssid,signal dev wifi | rg '\*' | sed 's/\"/\\"/g') - signal=$(echo "$wifistatus" | awk -F: '{print $3}') - essid=$(echo "$wifistatus" | awk -F: '{print $2}') - - icons=("" "" "" "" "") - - if [ "$status" = "disconnected" ] ; then - icon="" - color="#988ba2" - class="" - else - level=$(awk -v n="$signal" 'BEGIN{print int((n-1)/20)}') - if [ "$level" -gt 4 ]; then - level=4 - fi - - icon=${icons[$level]} - color="#cba6f7" - class="wifi-connected" - fi - - echo '{ "essid": "'"$essid"'", "icon": "'"$icon"'", "color": "'"$color"'", "class": "'"$class"'" }' - - sleep 3 - done -fi diff --git a/foreign/dotfiles/home/programs/eww/scripts/volume b/foreign/dotfiles/home/programs/eww/scripts/volume deleted file mode 100755 index 7e9b11d..0000000 --- a/foreign/dotfiles/home/programs/eww/scripts/volume +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env bash - -volicons=("" "" "") -if [ ! "$XDG_CACHE_HOME" ]; then - XDG_CACHE_HOME="/home/mihai/.local/cache" -fi -date="$XDG_CACHE_HOME/eww/osd_vol.date" - -vol() { - wpctl get-volume @DEFAULT_AUDIO_"$1"@ | awk '{print int($2*100)}' -} -ismuted() { - wpctl get-volume @DEFAULT_AUDIO_"$1"@ | rg -i muted - echo $? -} -setvol() { - wpctl set-volume @DEFAULT_AUDIO_"$1"@ "$(awk -v n="$2" 'BEGIN{print (n / 100)}')" -} -setmute() { - wpctl set-mute @DEFAULT_AUDIO_"$1"@ toggle -} - -osd() { - if [ ! -f "$date" ]; then - mkdir -p "$XDG_CACHE_HOME/eww" - fi - date +%s > "$date" -} - -osd_handler() { - lock=0 - rundate=0 - if [ ! -f "$date" ]; then - mkdir -p "$XDG_CACHE_HOME/eww" - echo 0 > "$date" - fi - - while true; do - # get dates - rundate=$(cat "$date") - currentdate=$(date +%s) - - # handle showing - if [ "$rundate" = "$currentdate" ] && [ "$lock" -eq 0 ]; then - eww open osd - eww update osd-volume=true - lock=1 - elif [ "$((currentdate - rundate))" = "2" ] && [ "$lock" -eq 1 ]; then - eww update osd-volume=false - lock=0 - if [ "$(eww get osd-volume)" = "false" ] && [ "$(eww get osd-brightness)" = "false" ]; then - eww close osd - fi - fi - - sleep 0.1 - done - - eww close osd -} - -if [ "$1" = "mute" ]; then - if [ "$2" != "SOURCE" ] && [ "$2" != "SINK" ]; then - echo "Can only mute SINK or SOURCE"; exit 1 - fi - setmute "$2" -elif [ "$1" = "setvol" ]; then - if [ "$2" != "SOURCE" ] && [ "$2" != "SINK" ]; then - echo "Can only set volume for SINK or SOURCE"; exit 1 - elif [ "$3" -lt 1 ] || [ "$3" -gt 100 ]; then - echo "Volume must be between 1 and 100"; exit 1 - fi - setvol "$2" "$3" -elif [ "$1" = "osd" ]; then - osd -else - # initial values - lvl=$(awk -v n="$(vol "SINK")" 'BEGIN{print int(n/34)}') - ismuted=$(ismuted "SINK") - - if [ "$ismuted" = 1 ]; then - icon="${volicons[$lvl]}" - else - icon="" - fi - echo '{ "icon": "'"$icon"'", "percent": "'"$(vol "SINK")"'", "microphone": "'"$(vol "SOURCE")"'" }' - - osd_handler & - - # event loop - pactl subscribe | rg --line-buffered "change" | while read -r _; do - lvl=$(awk -v n="$(vol "SINK")" 'BEGIN{print int(n/34)}') - ismuted=$(ismuted "SINK") - - if [ "$ismuted" = 1 ]; then - icon="${volicons[$lvl]}" - else - icon="" - fi - echo '{ "icon": "'"$icon"'", "percent": "'"$(vol "SINK")"'", "microphone": "'"$(vol "SOURCE")"'" }' - done -fi diff --git a/foreign/dotfiles/home/programs/eww/scripts/workspaces b/foreign/dotfiles/home/programs/eww/scripts/workspaces deleted file mode 100755 index c7caf95..0000000 --- a/foreign/dotfiles/home/programs/eww/scripts/workspaces +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env bash - -# define colors -# red peach green blue -colors=("#f38ba8" "#fab387" "#a6e3a1" "#89b4fa") -# pink yellow teal lavender -dimmed=("#f5c2e7" "#f9e2af" "#94e2d5" "#b4befe") -empty="#313244" - -# get initial focused workspace -focusedws=$(hyprctl -j monitors | jaq -r '.[] | select(.focused == true) | .activeWorkspace.id') - -declare -A o=([1]=0 [2]=0 [3]=0 [4]=0) -declare -A monitormap -declare -A workspaces - -# set color for each workspace -status() { - if [ "${o[$1]}" -eq 1 ]; then - mon=${monitormap[${workspaces[$1]}]} - - if [ "$focusedws" -eq "$1" ]; then - echo -n "#27ae60" - # echo -n "${colors[$mon]}" - else - # echo -n "${dimmed[$mon]}" - echo -n "#fdbc4b" - fi - else - # echo -n "$empty" - echo -n "#2f343f" - fi -} - -# handle workspace create/destroy -workspace_event() { - o[$1]=$2 - while read -r k v; do workspaces[$k]="$v"; done < <(hyprctl -j workspaces | gojq -r '.[]|"\(.id) \(.monitor)"') -} -# handle monitor (dis)connects -monitor_event() { - while read -r k v; do monitormap["$k"]=$v; done < <(hyprctl -j monitors | gojq -r '.[]|"\(.name) \(.id) "') -} - -# get all apps titles in a workspace -applist() { - ws="$1" - - apps=$(hyprctl -j clients | jaq -jr '.[] | select(.workspace.id == '"$ws"') | .title + "\\n"') - echo -En "${apps%"\n"}" -} - -# generate the json for eww -generate() { - echo -n '[' - - for i in {1..4}; do - echo -n ''"$([ "$i" -eq 1 ] || echo ,)" '{ "number": "'"$i"'", "color": "'"$(status "$i")"'" }' #, "tooltip": "'$(applist "$i")'" }' - done - - echo ']' -} - -# setup - -# add monitors -monitor_event - -# add workspaces -while read -r k v; do workspaces[$k]="$v"; done < <(hyprctl -j workspaces | gojq -r '.[]|"\(.id) \(.monitor)"') - -# check occupied workspaces -for num in "${!workspaces[@]}"; do - o[$num]=1 -done -# generate initial widget -generate - -# main loop -socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | rg --line-buffered "workspace|mon(itor)?" | while read -r line; do - case ${line%>>*} in - "workspace") - focusedws=${line#*>>} - ;; - "focusedmon") - focusedws=${line#*,} - ;; - "createworkspace") - workspace_event "${line#*>>}" 1 - ;; - "destroyworkspace") - workspace_event "${line#*>>}" 0 - ;; - "monitor"*) - monitor_event - ;; - esac - generate -done diff --git a/foreign/dotfiles/home/programs/eww/windows/calendar.yuck b/foreign/dotfiles/home/programs/eww/windows/calendar.yuck deleted file mode 100644 index 403d732..0000000 --- a/foreign/dotfiles/home/programs/eww/windows/calendar.yuck +++ /dev/null @@ -1,14 +0,0 @@ -(defwidget calendar-win [] - (box - :class "calendar-win" - (calendar))) - -(defwindow calendar - :monitor 0 - :geometry (geometry - :x "0%" - :y "0%" - :anchor "top right" - :width "0px" - :height "0px") - (calendar-win)) diff --git a/foreign/dotfiles/home/programs/eww/windows/music.yuck b/foreign/dotfiles/home/programs/eww/windows/music.yuck deleted file mode 100644 index 4e7d5e7..0000000 --- a/foreign/dotfiles/home/programs/eww/windows/music.yuck +++ /dev/null @@ -1,55 +0,0 @@ -(defwidget music [] - (box - :class "music-window" - :space-evenly false - :style "background-color: ${music.color1}; border: 1px solid ${music.color2};" - (box - :class "music-cover-art" - :style "background-image: url(\"${music.cover}\");") - (box - :orientation "v" - :class "music-box" - (label - :class "music-title" - :wrap true - :text {music.title}) - (label - :class "music-artist" - :wrap true - :text {music.artist}) - (centerbox - :halign "center" - :class "music-button-box icon" - (button :class "music-button" :onclick "playerctl previous" "") - (button :class "music-button" :onclick "playerctl play-pause" {music.status}) - (button :class "music-button" :onclick "playerctl next" "")) - (box - :orientation "v" - (box - (label - :xalign 0 - :class "music-time" - :text {music.position_time}) - (label - :xalign 1 - :class "music-time" - :text {music.length})) - (box - :class "music-bar" - (scale - ; doesn't work, looking for other ways - ; :style "background: linear-gradient(to right, ${music.color1}, ${music.color2});" - :onchange "playerctl position `bc <<< \"{} * $(playerctl metadata mpris:length) / 1000000 / 100\"`" - :value {music.position})))))) - -(defwindow music - :stacking "fg" - :focusable false - :monitor 0 - :geometry (geometry - :x "0%" - :y "0%" - :width "0%" - :height "0%" - :anchor "top center") - (music)) diff --git a/foreign/dotfiles/home/programs/eww/windows/osd.yuck b/foreign/dotfiles/home/programs/eww/windows/osd.yuck deleted file mode 100644 index 138bc06..0000000 --- a/foreign/dotfiles/home/programs/eww/windows/osd.yuck +++ /dev/null @@ -1,43 +0,0 @@ -(defwidget osd-part [icon value class] - (box - :class "osd-part osd-${class}" - :orientation "v" - :space-evenly false - (scale - :flipped true - :orientation "v" - :value value) - (label - :text icon))) - -(defwidget osd [] - (box - :class "osd-container" - :space-evenly false - (revealer - :reveal {osd-brightness} - :transition "slideright" - (osd-part - :class "brightness" - :icon {brightness.icon} - :value {brightness.percent})) - (revealer - :reveal {osd-volume} - :transition "slideright" - (osd-part - :class "volume" - :icon {volume.icon} - :value {volume.percent}))) -) - -(defwindow osd - :stacking "fg" - :focusable false - :monitor 0 - :geometry (geometry - :x "1%" - :y "0%" - :width "0%" - :height "0%" - :anchor "center left") - (osd)) diff --git a/foreign/dotfiles/home/programs/eww/windows/system-menu.yuck b/foreign/dotfiles/home/programs/eww/windows/system-menu.yuck deleted file mode 100644 index 888b178..0000000 --- a/foreign/dotfiles/home/programs/eww/windows/system-menu.yuck +++ /dev/null @@ -1,204 +0,0 @@ -(defwidget system-menu [] - (box - :class "system-menu-box" - :space-evenly false - :orientation "v" - (box - :class "top-row" - :space-evenly false - (label - :class "time" - :text "${time.hour}:${time.minute}") - (box - :class "date-box" - :space-evenly false - (label - :class "date" - :text {time.date}) - (label - :class "day" - :text {time.day}))) - - (centerbox - :class "system-row" - (box - :class "wifi-box" - :space-evenly false - :orientation "v" - (box - :class "element icon ${net.class}" - :space-evenly false - (button - :class "wifi-button" - :onclick "scripts/net toggle" - {net.icon}) - (label - :class "separator" - :text "│") - (button - :class "wifi-arrow-btn" - :onclick "eww close system-menu && gnome-control-center &" - "")) - (label - :text {net.essid} - :xalign 0.5 - :limit-width 15)) - - (box - :class "bluetooth-box" - :space-evenly false - :orientation "v" - (box - :class "element icon ${bluetooth.class}" - :space-evenly false - (button - :class "bluetooth-button" - :onclick "scripts/bluetooth toggle" - {bluetooth.icon}) - (label - :class "separator" - :text "│") - (button - :class "bluetooth-arrow-btn" - :onclick "eww close system-menu && blueberry" - "")) - (label - :text {bluetooth.text} - :xalign 0.5 - :tooltip "${bluetooth.text} ${bluetooth.battery}" - :limit-width 15)) - - (box - :class "airplane-box" - :space-evenly false - :orientation "v" - (box - :class "element" - (button - :class "airplane-button" - :onclick "scripts/airplane toggle" - airplane)) - (label - :text "Airplane Mode" - :xalign 0.5 - :limit-width 16))) - - (box - :class "sliders" - :orientation "v" - (box - :class "volume-slider-box" - :space-evenly false - (button - :class "volume-icon icon" - :onclick "scripts/volume mute SINK" - {volume.icon}) - (scale - :class "volume-bar" - :value {volume.percent} - :tooltip "volume on ${volume.percent}%" - :onchange "scripts/volume setvol SINK {}")) - (box - :class "brightness-slider-box" - :space-evenly false - (button - :class "brightness-slider-icon icon" - {brightness.icon}) - (scale - :class "brightness-slider" - :value {brightness.percent} - :marks true - :onchange "light -S {}"))) - - (box - :class "system-info-box" - - ; cpu - (box - :class "sys-box" - :space-evenly false - :halign "start" - (circular-progress - :value "${EWW_CPU.avg}" - :class "sys-cpu" - :thickness 3 - (label - :text "" - :class "sys-icon-cpu icon")) - (box - :orientation "v" - :vexpand false - (label - :text "cpu" - :halign "start" - :class "sys-text-cpu") - (label - :text "${round(EWW_CPU.avg,2)}%" - :halign "start" - :class "sys-text-sub") - (label - :text "${EWW_CPU.cores[0].freq} MHz" - :halign "start" - :class "sys-text-sub"))) - - ; memory - (box - :class "sys-box" - :space-evenly false - :halign "end" - (circular-progress - :value {memory.percent} - :class "sys-mem" - :thickness 3 - (label - :text "" - :class "sys-icon-mem icon")) - (box - :orientation "v" - (label - :text "memory" - :halign "start" - :class "sys-text-mem") - (label - :text "${memory.used} | ${memory.total}" - :halign "start" - :class "sys-text-sub")))) - - (centerbox - :class "bottom-row" - (box - :class "battery-box" - :space-evenly false - :halign "start" - (label - :class "battery-icon icon" - :style "color: ${battery.color}" - :text {battery.icon}) - (label - :text {EWW_BATTERY["BAT0"].capacity}) - (label - :class "battery-status" - :text {battery.status}) - (label - :class "battery-wattage" - :text {battery.wattage})) - (label) - (box - :space-evenly false - :halign "end" - (button - :halign "end" - :class "power-button icon" - :onclick "wlogout -p layer-shell &" - ""))))) - -(defwindow system-menu - :stacking "fg" - :monitor 0 - :geometry (geometry - :x "0" - :y "0" - :width "0%" - :height "0%" - :anchor "right top") - (system-menu)) diff --git a/foreign/dotfiles/home/programs/files/config/wofi/config b/foreign/dotfiles/home/programs/files/config/wofi/config deleted file mode 100644 index b37c110..0000000 --- a/foreign/dotfiles/home/programs/files/config/wofi/config +++ /dev/null @@ -1,7 +0,0 @@ -width=40% -height=30% -show=drun -prompt=Search -allow_images=true -allow_markup=true -insensitive=true \ No newline at end of file diff --git a/foreign/dotfiles/home/programs/files/config/youtube-dl/config b/foreign/dotfiles/home/programs/files/config/youtube-dl/config deleted file mode 100644 index 759e1c7..0000000 --- a/foreign/dotfiles/home/programs/files/config/youtube-dl/config +++ /dev/null @@ -1,25 +0,0 @@ -# youtube-dl config file - -# use .netrc for logins --n - -# ignore errors (unavailable videos, etc) --i - -# don't overwrite --w - -# make an archive of downloaded videos and only download unlisted items, then list them -# useful for music playlists you update often ---download-archive ~/Music/untagged/ignore.these - -# convert all downloads to 192kbps mp3 --x ---audio-format mp3 #opus ---audio-quality 192K - -# embed thumbnail into audio -#--embed-thumbnail - -# save all music in the following folder and format --o '~/Music/untagged/%(artist)s - %(title)s.%(ext)s' diff --git a/foreign/dotfiles/home/programs/files/default.nix b/foreign/dotfiles/home/programs/files/default.nix deleted file mode 100644 index 2c42964..0000000 --- a/foreign/dotfiles/home/programs/files/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: -# manage files in ~ -{ - imports = [ - ./nix-index-update-db.nix - ./wlogout.nix - ./wofi-style.nix - ]; - - home.file.".config" = { - source = ./config; - recursive = true; - }; - - xdg.configFile = { - "btop/themes/catppuccin_mocha.theme".source = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/catppuccin/btop/main/catppuccin_mocha.theme"; - hash = "sha256-MGK5ECB5sXiHdi2A3Y4s/Sx7nSRQ+KLyZjEKElRPKf0="; - }; - - "xilinx/nix.sh" = { - executable = true; - text = '' - INSTALL_DIR=$HOME/Documents/code/xilinx/tools/Xilinx - VERSION=2022.2 - ''; - }; - }; -} diff --git a/foreign/dotfiles/home/programs/files/nix-index-update-db.nix b/foreign/dotfiles/home/programs/files/nix-index-update-db.nix deleted file mode 100644 index 93b76a9..0000000 --- a/foreign/dotfiles/home/programs/files/nix-index-update-db.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - # set up nix-index - systemd.user.timers.nix-index-db-update = { - Timer = { - OnCalendar = "weekly"; - Persistent = true; - RandomizedDelaySec = 0; - }; - }; - - systemd.user.services.nix-index-db-update = { - Unit = { - Description = "nix-index database update"; - PartOf = ["multi-user.target"]; - }; - Service = let - script = pkgs.writeShellScript "nix-index-update-db" '' - export filename="index-x86_64-$(uname | tr A-Z a-z)" - mkdir -p ~/.cache/nix-index - cd ~/.cache/nix-index - # -N will only download a new version if there is an update. - wget -N https://github.com/Mic92/nix-index-database/releases/latest/download/$filename - ln -f $filename files - ''; - in { - Environment = "PATH=/run/wrappers/bin:${lib.makeBinPath [pkgs.wget pkgs.coreutils]}"; - ExecStart = "${script}"; - }; - Install.WantedBy = ["multi-user.target"]; - }; -} diff --git a/foreign/dotfiles/home/programs/files/wlogout.nix b/foreign/dotfiles/home/programs/files/wlogout.nix deleted file mode 100644 index 0633039..0000000 --- a/foreign/dotfiles/home/programs/files/wlogout.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ - default, - pkgs, - ... -}: let - w = pkgs.wlogout; -in { - xdg.configFile."wlogout/style.css".text = '' - * { - background-image: none; - font-family: "Jost *", Roboto, sans-serif; - } - window { - background-color: rgba(12, 12, 12, 0.9); - } - button { - background: unset; - border-radius: 16px; - border: 1px solid #28283d; - color: ${default.xcolors.text}; - margin: 1rem; - background-repeat: no-repeat; - background-position: center; - background-size: 25%; - } - - button:focus, button:active, button:hover { - background-color: ${default.xcolors.blue}; - color: ${default.xcolors.base}; - outline-style: none; - } - - #lock { - background-image: image(url("${w}/share/wlogout/icons/lock.png"), url("${w}/local/share/wlogout/icons/lock.png")); - } - - #logout { - background-image: image(url("${w}/share/wlogout/icons/logout.png"), url("${w}/local/share/wlogout/icons/logout.png")); - } - - #suspend { - background-image: image(url("${w}/share/wlogout/icons/suspend.png"), url("${w}/local/share/wlogout/icons/suspend.png")); - } - - #hibernate { - background-image: image(url("${w}/share/wlogout/icons/hibernate.png"), url("${w}/local/share/wlogout/icons/hibernate.png")); - } - - #shutdown { - background-image: image(url("${w}/share/wlogout/icons/shutdown.png"), url("${w}/local/share/wlogout/icons/shutdown.png")); - } - - #reboot { - background-image: image(url("${w}/share/wlogout/icons/reboot.png"), url("${w}/local/share/wlogout/icons/reboot.png")); - } - ''; -} diff --git a/foreign/dotfiles/home/programs/files/wofi-style.nix b/foreign/dotfiles/home/programs/files/wofi-style.nix deleted file mode 100644 index 614a79c..0000000 --- a/foreign/dotfiles/home/programs/files/wofi-style.nix +++ /dev/null @@ -1,46 +0,0 @@ -{default, ...}: { - xdg.configFile."wofi/style.css".text = '' - window { background: unset; } - flowboxchild { outline-width: 0; } - - #outer-box { - background: ${default.xcolors.base}; - border: 1px solid ${default.xcolors.border}; - border-radius: 24px; - box-shadow: 0 2px 3px ${default.xcolors.crust}; - margin: 5px 5px 10px; - padding: 5px 5px 10px; - } - - #input { - background-color: ${default.xcolors.crust}; - border: none; - border-radius: 16px; - color: ${default.xcolors.text}; - margin: 5px; - } - - #inner-box { - background-color: ${default.xcolors.base}; - border: none; - border-radius: 16px; - margin: 5px; - } - - #scroll { - border: none; - margin: 0px; - } - - #text { - color: ${default.xcolors.text}; - margin: 5px; - } - - #entry { border-radius: 16px; } - - #entry:selected { - background-color: ${default.xcolors.surface0}; - } - ''; -} diff --git a/foreign/dotfiles/home/programs/games.nix b/foreign/dotfiles/home/programs/games.nix deleted file mode 100644 index 9973495..0000000 --- a/foreign/dotfiles/home/programs/games.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - pkgs, - inputs, - ... -}: -# games -{ - home.packages = with pkgs; [ - inputs.nix-gaming.packages.${pkgs.hostPlatform.system}.osu-lazer-bin - gamescope - ]; -} diff --git a/foreign/dotfiles/home/programs/git.nix b/foreign/dotfiles/home/programs/git.nix deleted file mode 100644 index b2648dc..0000000 --- a/foreign/dotfiles/home/programs/git.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ - pkgs, - default, - ... -}: { - home.packages = [pkgs.gh]; - - programs.git = { - enable = true; - - delta = { - enable = true; - options.map-styles = "bold purple => syntax ${default.xcolors.mauve}, bold cyan => syntax ${default.xcolors.blue}"; - }; - - extraConfig = { - diff.colorMoved = "default"; - merge.conflictstyle = "diff3"; - }; - - aliases = { - a = "add"; - b = "branch"; - c = "commit"; - ca = "commit --amend"; - cm = "commit -m"; - co = "checkout"; - d = "diff"; - ds = "diff --staged"; - p = "push"; - pf = "push --force-with-lease"; - pl = "pull"; - l = "log"; - r = "rebase"; - s = "status --short"; - ss = "status"; - forgor = "commit --amend --no-edit"; - graph = "log --all --decorate --graph --oneline"; - oops = "checkout --"; - }; - - ignores = ["*~" "*.swp" "*result*" ".direnv" "node_modules"]; - - signing = { - key = "5899325F2F120900"; - signByDefault = true; - }; - - userEmail = "fufexan@protonmail.com"; - userName = "Mihai Fufezan"; - }; -} diff --git a/foreign/dotfiles/home/programs/gtk.nix b/foreign/dotfiles/home/programs/gtk.nix deleted file mode 100644 index 4e324ac..0000000 --- a/foreign/dotfiles/home/programs/gtk.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - pkgs, - config, - ... -}: { - home.pointerCursor = { - package = pkgs.bibata-cursors; - name = "Bibata-Modern-Classic"; - size = 24; - gtk.enable = true; - x11.enable = true; - }; - - gtk = { - enable = true; - - font = { - name = "Roboto"; - package = pkgs.roboto; - }; - - gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; - - iconTheme = { - name = "Papirus-Dark"; - package = pkgs.papirus-icon-theme; - }; - - theme = { - name = "Catppuccin-Mocha-Compact-Mauve-Dark"; - package = pkgs.catppuccin-gtk.override { - accents = ["mauve"]; - size = "compact"; - variant = "mocha"; - }; - }; - }; -} diff --git a/foreign/dotfiles/home/programs/media.nix b/foreign/dotfiles/home/programs/media.nix deleted file mode 100644 index 6d4b279..0000000 --- a/foreign/dotfiles/home/programs/media.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ - pkgs, - config, - ... -}: -# media - control and enjoy audio/video -{ - imports = [ - ./spicetify.nix - ]; - - home.packages = with pkgs; [ - # audio control - pavucontrol - playerctl - pulsemixer - # images - imv - - spotify-tui - ]; - - programs = { - mpv = { - enable = true; - defaultProfiles = ["gpu-hq"]; - scripts = [pkgs.mpvScripts.mpris]; - }; - - obs-studio.enable = true; - }; - - services = { - playerctld.enable = true; - - spotifyd = { - enable = true; - package = pkgs.spotifyd.override {withMpris = true;}; - settings.global = { - autoplay = true; - backend = "pulseaudio"; - bitrate = 320; - cache_path = "${config.xdg.cacheHome}/spotifyd"; - device_type = "computer"; - initial_volume = "100"; - password_cmd = "tail -1 /run/agenix/spotify"; - use_mpris = true; - username_cmd = "head -1 /run/agenix/spotify"; - volume_normalisation = false; - }; - }; - - udiskie.enable = true; - }; -} diff --git a/foreign/dotfiles/home/programs/packages.nix b/foreign/dotfiles/home/programs/packages.nix deleted file mode 100644 index e666596..0000000 --- a/foreign/dotfiles/home/programs/packages.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - pkgs, - inputs, - ... -}: { - home.packages = with pkgs; [ - # archives - zip - unzip - unrar - - # office - libreoffice - - # messaging - tdesktop - - # school stuff - inputs.nix-xilinx.packages.${pkgs.hostPlatform.system}.vivado - jetbrains.idea-community - - # torrents - transmission-remote-gtk - - # misc - libnotify - xdg-utils - - # productivity - obsidian - xournalpp - ]; -} diff --git a/foreign/dotfiles/home/programs/qt.nix b/foreign/dotfiles/home/programs/qt.nix deleted file mode 100644 index f592842..0000000 --- a/foreign/dotfiles/home/programs/qt.nix +++ /dev/null @@ -1,18 +0,0 @@ -{pkgs, ...}: -# Qt theming with Kvantum -{ - home.packages = with pkgs; [ - libsForQt5.qtstyleplugin-kvantum - (catppuccin-kvantum.override { - accent = "Mauve"; - variant = "Mocha"; - }) - ]; - home.sessionVariables = { - QT_STYLE_OVERRIDE = "kvantum"; - }; - - xdg.configFile."Kvantum/kvantum.kvconfig".source = (pkgs.formats.ini {}).generate "kvantum.kvconfig" { - General.Theme = "Catppuccin-Mocha-Mauve"; - }; -} diff --git a/foreign/dotfiles/home/programs/spicetify.nix b/foreign/dotfiles/home/programs/spicetify.nix deleted file mode 100644 index 3871515..0000000 --- a/foreign/dotfiles/home/programs/spicetify.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - pkgs, - inputs, - ... -}: { - # themable spotify - programs.spicetify = let - spicePkgs = inputs.spicetify-nix.packages.${pkgs.hostPlatform.system}.default; - in { - enable = true; - - spotifyPackage = inputs.self.packages.${pkgs.hostPlatform.system}.spotify; - - theme = spicePkgs.themes.catppuccin-mocha; - - colorScheme = "flamingo"; - - enabledExtensions = with spicePkgs.extensions; [ - fullAppDisplay - hidePodcasts - shuffle - ]; - }; -} diff --git a/foreign/dotfiles/home/programs/xdg.nix b/foreign/dotfiles/home/programs/xdg.nix deleted file mode 100644 index 1b22a8a..0000000 --- a/foreign/dotfiles/home/programs/xdg.nix +++ /dev/null @@ -1,47 +0,0 @@ -{config, ...}: let - browser = ["firefox.desktop"]; - - # XDG MIME types - associations = { - "application/x-extension-htm" = browser; - "application/x-extension-html" = browser; - "application/x-extension-shtml" = browser; - "application/x-extension-xht" = browser; - "application/x-extension-xhtml" = browser; - "application/xhtml+xml" = browser; - "text/html" = browser; - "x-scheme-handler/about" = browser; - "x-scheme-handler/chrome" = ["chromium-browser.desktop"]; - "x-scheme-handler/ftp" = browser; - "x-scheme-handler/http" = browser; - "x-scheme-handler/https" = browser; - "x-scheme-handler/unknown" = browser; - - "audio/*" = ["mpv.desktop"]; - "video/*" = ["mpv.dekstop"]; - "image/*" = ["imv.desktop"]; - "application/json" = browser; - "application/pdf" = ["org.pwmt.zathura.desktop.desktop"]; - "x-scheme-handler/discord" = ["discordcanary.desktop"]; - "x-scheme-handler/spotify" = ["spotify.desktop"]; - "x-scheme-handler/tg" = ["telegramdesktop.desktop"]; - }; -in { - xdg = { - enable = true; - cacheHome = config.home.homeDirectory + "/.local/cache"; - - mimeApps = { - enable = true; - defaultApplications = associations; - }; - - userDirs = { - enable = true; - createDirectories = true; - extraConfig = { - XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots"; - }; - }; - }; -} diff --git a/foreign/dotfiles/home/programs/zathura.nix b/foreign/dotfiles/home/programs/zathura.nix deleted file mode 100644 index 98542d8..0000000 --- a/foreign/dotfiles/home/programs/zathura.nix +++ /dev/null @@ -1,27 +0,0 @@ -{pkgs, ...}: { - programs.zathura = { - enable = true; - options = { - recolor-lightcolor = "rgba(0,0,0,0)"; - default-bg = "rgba(0,0,0,0.7)"; - - font = "Lexend 12"; - selection-notification = true; - - selection-clipboard = "clipboard"; - adjust-open = "best-fit"; - pages-per-row = "1"; - scroll-page-aware = "true"; - scroll-full-overlap = "0.01"; - scroll-step = "100"; - zoom-min = "10"; - }; - - extraConfig = "include catppuccin-mocha"; - }; - - xdg.configFile."zathura/catppuccin-mocha".source = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/catppuccin/zathura/main/src/catppuccin-mocha"; - hash = "sha256-/HXecio3My2eXTpY7JoYiN9mnXsps4PAThDPs4OCsAk="; - }; -} diff --git a/foreign/dotfiles/home/shell/cli.nix b/foreign/dotfiles/home/shell/cli.nix deleted file mode 100644 index ef2dfde..0000000 --- a/foreign/dotfiles/home/shell/cli.nix +++ /dev/null @@ -1,49 +0,0 @@ -{pkgs, ...}: { - home.packages = with pkgs; [ - # archives - zip - unzip - unrar - - # utils - file - du-dust - duf - fd - ripgrep - - # file managers - joshuto - ranger - ]; - - programs = { - bat = { - enable = true; - config = { - pager = "less -FR"; - theme = "Catppuccin-mocha"; - }; - themes = { - Catppuccin-mocha = builtins.readFile (pkgs.fetchurl { - url = "https://raw.githubusercontent.com/catppuccin/bat/main/Catppuccin-mocha.tmTheme"; - hash = "sha256-qMQNJGZImmjrqzy7IiEkY5IhvPAMZpq0W6skLLsng/w="; - }); - }; - }; - - btop.enable = true; - exa.enable = true; - ssh.enable = true; - - skim = { - enable = true; - enableZshIntegration = true; - defaultCommand = "rg --files --hidden"; - changeDirWidgetOptions = [ - "--preview 'exa --icons --git --color always -T -L 3 {} | head -200'" - "--exact" - ]; - }; - }; -} diff --git a/foreign/dotfiles/home/shell/default.nix b/foreign/dotfiles/home/shell/default.nix deleted file mode 100644 index a2fe57a..0000000 --- a/foreign/dotfiles/home/shell/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{config, ...}: let - d = config.xdg.dataHome; - c = config.xdg.configHome; - cache = config.xdg.cacheHome; -in { - imports = [ - ./cli.nix - ./nushell - ./starship.nix - ./transient-services.nix - ./zsh.nix - ]; - - # add environment variables - home.sessionVariables = { - # clean up ~ - LESSHISTFILE = cache + "/less/history"; - LESSKEY = c + "/less/lesskey"; - WINEPREFIX = d + "/wine"; - XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority"; - - # enable scrolling in git diff - DELTA_PAGER = "less -R"; - - EDITOR = "hx"; - MANPAGER = "sh -c 'col -bx | bat -l man -p'"; - }; -} diff --git a/foreign/dotfiles/home/shell/nix.nix b/foreign/dotfiles/home/shell/nix.nix deleted file mode 100644 index b1ec809..0000000 --- a/foreign/dotfiles/home/shell/nix.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - pkgs, - inputs, - ... -}: -# nix tooling -{ - home.packages = with pkgs; [ - alejandra - deadnix - nix-index - statix - inputs.self.packages.${pkgs.hostPlatform.system}.repl - ]; - - programs.direnv = { - enable = true; - nix-direnv.enable = true; - enableZshIntegration = true; - }; -} diff --git a/foreign/dotfiles/home/shell/nushell/config.nu b/foreign/dotfiles/home/shell/nushell/config.nu deleted file mode 100644 index cfd0195..0000000 --- a/foreign/dotfiles/home/shell/nushell/config.nu +++ /dev/null @@ -1,514 +0,0 @@ -# Nushell Config File - -module completions { - # Custom completions for external commands (those outside of Nushell) - # Each completions has two parts: the form of the external command, including its flags and parameters - # and a helper command that knows how to complete values for those flags and parameters - # - # This is a simplified version of completions for git branches and git remotes - def "nu-complete git branches" [] { - ^git branch | lines | each { |line| $line | str replace '[\*\+] ' '' | str trim } - } - - def "nu-complete git remotes" [] { - ^git remote | lines | each { |line| $line | str trim } - } - - # Download objects and refs from another repository - export extern "git fetch" [ - repository?: string@"nu-complete git remotes" # name of the repository to fetch - branch?: string@"nu-complete git branches" # name of the branch to fetch - --all # Fetch all remotes - --append(-a) # Append ref names and object names to .git/FETCH_HEAD - --atomic # Use an atomic transaction to update local refs. - --depth: int # Limit fetching to n commits from the tip - --deepen: int # Limit fetching to n commits from the current shallow boundary - --shallow-since: string # Deepen or shorten the history by date - --shallow-exclude: string # Deepen or shorten the history by branch/tag - --unshallow # Fetch all available history - --update-shallow # Update .git/shallow to accept new refs - --negotiation-tip: string # Specify which commit/glob to report while fetching - --negotiate-only # Do not fetch, only print common ancestors - --dry-run # Show what would be done - --write-fetch-head # Write fetched refs in FETCH_HEAD (default) - --no-write-fetch-head # Do not write FETCH_HEAD - --force(-f) # Always update the local branch - --keep(-k) # Keep dowloaded pack - --multiple # Allow several arguments to be specified - --auto-maintenance # Run 'git maintenance run --auto' at the end (default) - --no-auto-maintenance # Don't run 'git maintenance' at the end - --auto-gc # Run 'git maintenance run --auto' at the end (default) - --no-auto-gc # Don't run 'git maintenance' at the end - --write-commit-graph # Write a commit-graph after fetching - --no-write-commit-graph # Don't write a commit-graph after fetching - --prefetch # Place all refs into the refs/prefetch/ namespace - --prune(-p) # Remove obsolete remote-tracking references - --prune-tags(-P) # Remove any local tags that do not exist on the remote - --no-tags(-n) # Disable automatic tag following - --refmap: string # Use this refspec to map the refs to remote-tracking branches - --tags(-t) # Fetch all tags - --recurse-submodules: string # Fetch new commits of populated submodules (yes/on-demand/no) - --jobs(-j): int # Number of parallel children - --no-recurse-submodules # Disable recursive fetching of submodules - --set-upstream # Add upstream (tracking) reference - --submodule-prefix: string # Prepend to paths printed in informative messages - --upload-pack: string # Non-default path for remote command - --quiet(-q) # Silence internally used git commands - --verbose(-v) # Be verbose - --progress # Report progress on stderr - --server-option(-o): string # Pass options for the server to handle - --show-forced-updates # Check if a branch is force-updated - --no-show-forced-updates # Don't check if a branch is force-updated - -4 # Use IPv4 addresses, ignore IPv6 addresses - -6 # Use IPv6 addresses, ignore IPv4 addresses - --help # Display this help message - ] - - # Check out git branches and files - export extern "git checkout" [ - ...targets: string@"nu-complete git branches" # name of the branch or files to checkout - --conflict: string # conflict style (merge or diff3) - --detach(-d) # detach HEAD at named commit - --force(-f) # force checkout (throw away local modifications) - --guess # second guess 'git checkout ' (default) - --ignore-other-worktrees # do not check if another worktree is holding the given ref - --ignore-skip-worktree-bits # do not limit pathspecs to sparse entries only - --merge(-m) # perform a 3-way merge with the new branch - --orphan: string # new unparented branch - --ours(-2) # checkout our version for unmerged files - --overlay # use overlay mode (default) - --overwrite-ignore # update ignored files (default) - --patch(-p) # select hunks interactively - --pathspec-from-file: string # read pathspec from file - --progress # force progress reporting - --quiet(-q) # suppress progress reporting - --recurse-submodules: string # control recursive updating of submodules - --theirs(-3) # checkout their version for unmerged files - --track(-t) # set upstream info for new branch - -b: string # create and checkout a new branch - -B: string # create/reset and checkout a branch - -l # create reflog for new branch - --help # Display this help message - ] - - # Push changes - export extern "git push" [ - remote?: string@"nu-complete git remotes", # the name of the remote - ...refs: string@"nu-complete git branches" # the branch / refspec - --all # push all refs - --atomic # request atomic transaction on remote side - --delete(-d) # delete refs - --dry-run(-n) # dry run - --exec: string # receive pack program - --follow-tags # push missing but relevant tags - --force-with-lease # require old value of ref to be at this value - --force(-f) # force updates - --ipv4(-4) # use IPv4 addresses only - --ipv6(-6) # use IPv6 addresses only - --mirror # mirror all refs - --no-verify # bypass pre-push hook - --porcelain # machine-readable output - --progress # force progress reporting - --prune # prune locally removed refs - --push-option(-o): string # option to transmit - --quiet(-q) # be more quiet - --receive-pack: string # receive pack program - --recurse-submodules: string # control recursive pushing of submodules - --repo: string # repository - --set-upstream(-u) # set upstream for git pull/status - --signed: string # GPG sign the push - --tags # push tags (can't be used with --all or --mirror) - --thin # use thin pack - --verbose(-v) # be more verbose - --help # Display this help message - ] -} - -# Get just the extern definitions without the custom completion commands -use completions * - -# for more information on themes see -# https://www.nushell.sh/book/coloring_and_theming.html -let dark_theme = { - # color for nushell primitives - separator: white - leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off - header: green_bold - empty: blue - bool: white - int: white - filesize: white - duration: white - date: white - range: white - float: white - string: white - nothing: white - binary: white - cellpath: white - row_index: green_bold - record: white - list: white - block: white - hints: dark_gray - - # shapes are used to change the cli syntax highlighting - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: b} - shape_binary: purple_bold - shape_bool: light_cyan - shape_int: purple_bold - shape_float: purple_bold - shape_range: yellow_bold - shape_internalcall: cyan_bold - shape_external: cyan - shape_externalarg: green_bold - shape_literal: blue - shape_operator: yellow - shape_signature: green_bold - shape_string: green - shape_string_interpolation: cyan_bold - shape_datetime: cyan_bold - shape_list: cyan_bold - shape_table: blue_bold - shape_record: cyan_bold - shape_block: blue_bold - shape_filepath: cyan - shape_globpattern: cyan_bold - shape_variable: purple - shape_flag: blue_bold - shape_custom: green - shape_nothing: light_cyan -} - -let light_theme = { - # color for nushell primitives - separator: dark_gray - leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off - header: green_bold - empty: blue - bool: dark_gray - int: dark_gray - filesize: dark_gray - duration: dark_gray - date: dark_gray - range: dark_gray - float: dark_gray - string: dark_gray - nothing: dark_gray - binary: dark_gray - cellpath: dark_gray - row_index: green_bold - record: white - list: white - block: white - hints: dark_gray - - # shapes are used to change the cli syntax highlighting - shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: b} - shape_binary: purple_bold - shape_bool: light_cyan - shape_int: purple_bold - shape_float: purple_bold - shape_range: yellow_bold - shape_internalcall: cyan_bold - shape_external: cyan - shape_externalarg: green_bold - shape_literal: blue - shape_operator: yellow - shape_signature: green_bold - shape_string: green - shape_string_interpolation: cyan_bold - shape_datetime: cyan_bold - shape_list: cyan_bold - shape_table: blue_bold - shape_record: cyan_bold - shape_block: blue_bold - shape_filepath: cyan - shape_globpattern: cyan_bold - shape_variable: purple - shape_flag: blue_bold - shape_custom: green - shape_nothing: light_cyan -} - -# External completer example -# let carapace_completer = {|spans| -# carapace $spans.0 nushell $spans | from json -# } - - -# The default config record. This is where much of your global configuration is setup. -let-env config = { - external_completer: $nothing # check 'carapace_completer' above to as example - filesize_metric: false # true => (KB, MB, GB), false => (KiB, MiB, GiB) - table_mode: rounded # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other - use_ls_colors: true - rm_always_trash: false - color_config: $dark_theme # if you want a light theme, replace `$dark_theme` to `$light_theme` - use_grid_icons: true - footer_mode: "25" # always, never, number_of_rows, auto - quick_completions: true # set this to false to prevent auto-selecting completions when only one remains - partial_completions: true # set this to false to prevent partial filling of the prompt - completion_algorithm: "prefix" # prefix, fuzzy - float_precision: 2 - # buffer_editor: "emacs" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL - use_ansi_coloring: true - filesize_format: "auto" # b, kb, kib, mb, mib, gb, gib, tb, tib, pb, pib, eb, eib, zb, zib, auto - edit_mode: emacs # emacs, vi - max_history_size: 10000 # Session has to be reloaded for this to take effect - sync_history_on_enter: true # Enable to share the history between multiple sessions, else you have to close the session to persist history to file - history_file_format: "plaintext" # "sqlite" or "plaintext" - shell_integration: true # enables terminal markers and a workaround to arrow keys stop working issue - table_index_mode: always # "always" show indexes, "never" show indexes, "auto" = show indexes when a table has "index" column - cd_with_abbreviations: false # set to true to allow you to do things like cd s/o/f and nushell expand it to cd some/other/folder - case_sensitive_completions: false # set to true to enable case-sensitive completions - enable_external_completion: true # set to false to prevent nushell looking into $env.PATH to find more suggestions, `false` recommended for WSL users as this look up my be very slow - max_external_completion_results: 100 # setting it lower can improve completion performance at the cost of omitting some options - # A strategy of managing table view in case of limited space. - table_trim: { - methodology: wrapping, # truncating - # A strategy which will be used by 'wrapping' methodology - wrapping_try_keep_words: true, - # A suffix which will be used with 'truncating' methodology - # truncating_suffix: "..." - } - show_banner: false # true or false to enable or disable the banner - show_clickable_links_in_ls: true # true or false to enable or disable clickable links in the ls listing. your terminal has to support links. - - hooks: { - pre_prompt: [{ - $nothing # replace with source code to run before the prompt is shown - }] - pre_execution: [{ - $nothing # replace with source code to run before the repl input is run - }] - env_change: { - PWD: [{|before, after| - $nothing # replace with source code to run if the PWD environment is different since the last repl input - }] - } - } - menus: [ - # Configuration for default nushell menus - # Note the lack of souce parameter - { - name: completion_menu - only_buffer_difference: false - marker: "| " - type: { - layout: columnar - columns: 4 - col_width: 20 # Optional value. If missing all the screen width is used to calculate column width - col_padding: 2 - } - style: { - text: green - selected_text: green_reverse - description_text: yellow - } - } - { - name: history_menu - only_buffer_difference: true - marker: "? " - type: { - layout: list - page_size: 10 - } - style: { - text: green - selected_text: green_reverse - description_text: yellow - } - } - { - name: help_menu - only_buffer_difference: true - marker: "? " - type: { - layout: description - columns: 4 - col_width: 20 # Optional value. If missing all the screen width is used to calculate column width - col_padding: 2 - selection_rows: 4 - description_rows: 10 - } - style: { - text: green - selected_text: green_reverse - description_text: yellow - } - } - # Example of extra menus created using a nushell source - # Use the source field to create a list of records that populates - # the menu - { - name: commands_menu - only_buffer_difference: false - marker: "# " - type: { - layout: columnar - columns: 4 - col_width: 20 - col_padding: 2 - } - style: { - text: green - selected_text: green_reverse - description_text: yellow - } - source: { |buffer, position| - $nu.scope.commands - | where command =~ $buffer - | each { |it| {value: $it.command description: $it.usage} } - } - } - { - name: vars_menu - only_buffer_difference: true - marker: "# " - type: { - layout: list - page_size: 10 - } - style: { - text: green - selected_text: green_reverse - description_text: yellow - } - source: { |buffer, position| - $nu.scope.vars - | where name =~ $buffer - | sort-by name - | each { |it| {value: $it.name description: $it.type} } - } - } - { - name: commands_with_description - only_buffer_difference: true - marker: "# " - type: { - layout: description - columns: 4 - col_width: 20 - col_padding: 2 - selection_rows: 4 - description_rows: 10 - } - style: { - text: green - selected_text: green_reverse - description_text: yellow - } - source: { |buffer, position| - $nu.scope.commands - | where command =~ $buffer - | each { |it| {value: $it.command description: $it.usage} } - } - } - ] - keybindings: [ - { - name: completion_menu - modifier: none - keycode: tab - mode: emacs # Options: emacs vi_normal vi_insert - event: { - until: [ - { send: menu name: completion_menu } - { send: menunext } - ] - } - } - { - name: completion_previous - modifier: shift - keycode: backtab - mode: [emacs, vi_normal, vi_insert] # Note: You can add the same keybinding to all modes by using a list - event: { send: menuprevious } - } - { - name: history_menu - modifier: control - keycode: char_r - mode: emacs - event: { send: menu name: history_menu } - } - { - name: next_page - modifier: control - keycode: char_x - mode: emacs - event: { send: menupagenext } - } - { - name: undo_or_previous_page - modifier: control - keycode: char_z - mode: emacs - event: { - until: [ - { send: menupageprevious } - { edit: undo } - ] - } - } - { - name: yank - modifier: control - keycode: char_y - mode: emacs - event: { - until: [ - {edit: pastecutbufferafter} - ] - } - } - { - name: unix-line-discard - modifier: control - keycode: char_u - mode: [emacs, vi_normal, vi_insert] - event: { - until: [ - {edit: cutfromlinestart} - ] - } - } - { - name: kill-line - modifier: control - keycode: char_k - mode: [emacs, vi_normal, vi_insert] - event: { - until: [ - {edit: cuttolineend} - ] - } - } - # Keybindings used to trigger the user defined menus - { - name: commands_menu - modifier: control - keycode: char_t - mode: [emacs, vi_normal, vi_insert] - event: { send: menu name: commands_menu } - } - { - name: vars_menu - modifier: alt - keycode: char_o - mode: [emacs, vi_normal, vi_insert] - event: { send: menu name: vars_menu } - } - { - name: commands_with_description - modifier: control - keycode: char_s - mode: [emacs, vi_normal, vi_insert] - event: { send: menu name: commands_with_description } - } - ] -} - -source ~/.cache/starship/init.nu diff --git a/foreign/dotfiles/home/shell/nushell/default.nix b/foreign/dotfiles/home/shell/nushell/default.nix deleted file mode 100644 index 9165426..0000000 --- a/foreign/dotfiles/home/shell/nushell/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - programs.nushell = { - enable = true; - configFile.source = ./config.nu; - envFile.source = ./env.nu; - }; -} diff --git a/foreign/dotfiles/home/shell/nushell/env.nu b/foreign/dotfiles/home/shell/nushell/env.nu deleted file mode 100644 index f2e0c7f..0000000 --- a/foreign/dotfiles/home/shell/nushell/env.nu +++ /dev/null @@ -1,36 +0,0 @@ -# Nushell Environment Config File - -# Specifies how environment variables are: -# - converted from a string to a value on Nushell startup (from_string) -# - converted from a value back to a string when running external commands (to_string) -# Note: The conversions happen *after* config.nu is loaded -let-env ENV_CONVERSIONS = { - "PATH": { - from_string: { |s| $s | split row (char esep) | path expand -n } - to_string: { |v| $v | path expand -n | str join (char esep) } - } - "Path": { - from_string: { |s| $s | split row (char esep) | path expand -n } - to_string: { |v| $v | path expand -n | str join (char esep) } - } -} - -# Directories to search for scripts when calling source or use -# -# By default, /scripts is added -let-env NU_LIB_DIRS = [ - ($nu.config-path | path dirname | path join 'scripts') -] - -# Directories to search for plugin binaries when calling register -# -# By default, /plugins is added -let-env NU_PLUGIN_DIRS = [ - ($nu.config-path | path dirname | path join 'plugins') -] - -# To add entries to PATH (on Windows you might use Path), you can use the following pattern: -# let-env PATH = ($env.PATH | split row (char esep) | prepend '/some/path') - -mkdir ~/.cache/starship -starship init nu | sed "s/size -c/size/" | save ~/.cache/starship/init.nu diff --git a/foreign/dotfiles/home/shell/starship.nix b/foreign/dotfiles/home/shell/starship.nix deleted file mode 100644 index df99bfc..0000000 --- a/foreign/dotfiles/home/shell/starship.nix +++ /dev/null @@ -1,13 +0,0 @@ -{config, ...}: { - home.sessionVariables.STARSHIP_CACHE = "${config.xdg.cacheHome}/starship"; - - programs.starship = { - enable = true; - settings = { - character = { - success_symbol = "[›](bold green)"; - error_symbol = "[›](bold red)"; - }; - }; - }; -} diff --git a/foreign/dotfiles/home/shell/transient-services.nix b/foreign/dotfiles/home/shell/transient-services.nix deleted file mode 100644 index da5c1ec..0000000 --- a/foreign/dotfiles/home/shell/transient-services.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - pkgs, - config, - lib, - ... -}: let - apply-hm-env = pkgs.writeShellScript "apply-hm-env" '' - ${lib.optionalString (config.home.sessionPath != []) '' - export PATH=${builtins.concatStringsSep ":" config.home.sessionPath}:$PATH - ''} - ${builtins.concatStringsSep "\n" (lib.mapAttrsToList (k: v: '' - export ${k}=${toString v} - '') - config.home.sessionVariables)} - ${config.home.sessionVariablesExtra} - exec "$@" - ''; - - # runs processes as systemd transient services - run-as-service = pkgs.writeShellScriptBin "run-as-service" '' - exec ${pkgs.systemd}/bin/systemd-run \ - --slice=app-manual.slice \ - --property=ExitType=cgroup \ - --user \ - --wait \ - bash -lc "exec ${apply-hm-env} $@" - ''; -in { - home.packages = [run-as-service]; -} diff --git a/foreign/dotfiles/home/shell/zsh.nix b/foreign/dotfiles/home/shell/zsh.nix deleted file mode 100644 index 55ff509..0000000 --- a/foreign/dotfiles/home/shell/zsh.nix +++ /dev/null @@ -1,76 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: { - programs.zsh = { - enable = true; - enableAutosuggestions = true; - autocd = true; - dirHashes = { - dl = "$HOME/Downloads"; - docs = "$HOME/Documents"; - code = "$HOME/Documents/code"; - dots = "$HOME/Documents/code/dotfiles"; - pics = "$HOME/Pictures"; - vids = "$HOME/Videos"; - nixpkgs = "$HOME/Documents/code/git/nixpkgs"; - }; - dotDir = ".config/zsh"; - history = { - expireDuplicatesFirst = true; - path = "${config.xdg.dataHome}/zsh_history"; - }; - - initExtra = '' - # search history based on what's typed in the prompt - autoload -U history-search-end - zle -N history-beginning-search-backward-end history-search-end - zle -N history-beginning-search-forward-end history-search-end - bindkey "^[OA" history-beginning-search-backward-end - bindkey "^[OB" history-beginning-search-forward-end - - # case insensitive tab completion - zstyle ':completion:*' completer _complete _ignored _approximate - zstyle ':completion:*' list-colors '\' - zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s - zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' - zstyle ':completion:*' menu select - zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s - zstyle ':completion:*' verbose true - _comp_options+=(globdots) - - ${lib.optionalString config.services.gpg-agent.enable '' - gnupg_path=$(ls $XDG_RUNTIME_DIR/gnupg) - export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gnupg/$gnupg_path/S.gpg-agent.ssh" - ''} - - ${lib.optionalString config.programs.kitty.enable '' - if test -n "$KITTY_INSTALLATION_DIR"; then - export KITTY_SHELL_INTEGRATION="enabled" - autoload -Uz -- "$KITTY_INSTALLATION_DIR"/shell-integration/zsh/kitty-integration - kitty-integration - unfunction kitty-integration - fi - ''} - - # run programs that are not in PATH with comma - command_not_found_handler() { - ${pkgs.comma}/bin/comma "$@" - } - ''; - - shellAliases = { - grep = "grep --color"; - ip = "ip --color"; - l = "exa -l"; - la = "exa -la"; - md = "mkdir -p"; - - us = "systemctl --user"; - rs = "sudo systemctl"; - }; - shellGlobalAliases = {exa = "exa --icons --git";}; - }; -} diff --git a/foreign/dotfiles/home/terminals/alacritty.nix b/foreign/dotfiles/home/terminals/alacritty.nix deleted file mode 100644 index 3fbb717..0000000 --- a/foreign/dotfiles/home/terminals/alacritty.nix +++ /dev/null @@ -1,52 +0,0 @@ -{default, ...}: -# terminals -let - inherit (default.terminal) font size opacity; - inherit (default) xcolors; -in { - programs.alacritty = { - enable = true; - settings = { - window = { - decorations = "none"; - dynamic_padding = true; - padding = { - x = 5; - y = 5; - }; - startup_mode = "Maximized"; - }; - - scrolling.history = 10000; - - font = { - normal.family = font; - bold.family = font; - italic.family = font; - inherit size; - }; - - draw_bold_text_with_bright_colors = true; - colors = rec { - primary = { - background = xcolors.crust; - foreground = xcolors.fg; - }; - normal = { - inherit (xcolors) red green yellow blue; - black = xcolors.mantle; - magenta = xcolors.mauve; - cyan = xcolors.sky; - white = xcolors.text; - }; - bright = - normal - // { - black = xcolors.base; - white = xcolors.rosewater; - }; - }; - window.opacity = opacity; - }; - }; -} diff --git a/foreign/dotfiles/home/terminals/kitty.nix b/foreign/dotfiles/home/terminals/kitty.nix deleted file mode 100644 index f72bf95..0000000 --- a/foreign/dotfiles/home/terminals/kitty.nix +++ /dev/null @@ -1,54 +0,0 @@ -{default, ...}: let - inherit (default) xcolors; -in { - programs.kitty = { - enable = true; - font = { - inherit (default.terminal) size; - name = default.terminal.font; - }; - settings = { - scrollback_lines = 10000; - placement_strategy = "center"; - - allow_remote_control = "yes"; - enable_audio_bell = "no"; - visual_bell_duration = "0.1"; - visual_bell_color = xcolors.rosewater; - - copy_on_select = "clipboard"; - - selection_foreground = "none"; - selection_background = "none"; - - # colors - background_opacity = toString default.terminal.opacity; - foreground = xcolors.fg; - background = xcolors.crust; - # black - color0 = xcolors.mantle; - color8 = xcolors.base; - # red - color1 = xcolors.red; - color9 = xcolors.red; - # green - color2 = xcolors.green; - color10 = xcolors.green; - # yellow - color3 = xcolors.yellow; - color11 = xcolors.yellow; - # blue - color4 = xcolors.blue; - color12 = xcolors.blue; - # magenta - color5 = xcolors.pink; - color13 = xcolors.pink; - # cyan - color6 = xcolors.sky; - color14 = xcolors.sky; - # white - color7 = xcolors.text; - color15 = xcolors.rosewater; - }; - }; -} diff --git a/foreign/dotfiles/home/terminals/wezterm.nix b/foreign/dotfiles/home/terminals/wezterm.nix deleted file mode 100644 index d914f7a..0000000 --- a/foreign/dotfiles/home/terminals/wezterm.nix +++ /dev/null @@ -1,28 +0,0 @@ -{default, ...}: { - programs.wezterm = { - enable = true; - extraConfig = '' - local wezterm = require "wezterm" - - return { - font = wezterm.font_with_fallback({ "${default.terminal.font}", }, { - weight = "Regular", - }), - font_size = ${toString default.terminal.size}, - color_scheme = "Catppuccin Mocha", - window_background_opacity = ${toString default.terminal.opacity}, - enable_scroll_bar = false, - enable_tab_bar = false, - scrollback_lines = 10000, - window_padding = { - left = 10, - right = 10, - top = 10, - bottom = 10, - }, - check_for_updates = false, - default_cursor_style = "SteadyBar", - } - ''; - }; -} diff --git a/foreign/dotfiles/home/wayland/default.nix b/foreign/dotfiles/home/wayland/default.nix deleted file mode 100644 index 5578f8c..0000000 --- a/foreign/dotfiles/home/wayland/default.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ - pkgs, - lib, - inputs, - ... -}: -# Wayland config -let - # use OCR and copy to clipboard - ocrScript = let - inherit (pkgs) grim libnotify slurp tesseract5 wl-clipboard; - _ = lib.getExe; - in - pkgs.writeShellScriptBin "wl-ocr" '' - ${_ grim} -g "$(${_ slurp})" -t ppm - | ${_ tesseract5} - - | ${wl-clipboard}/bin/wl-copy - ${_ libnotify} "$(${wl-clipboard}/bin/wl-paste)" - ''; -in { - imports = [ - ../programs/eww - ./hyprland - ./sway.nix - ./swaybg.nix - ./swayidle.nix - ./swaylock.nix - ]; - - programs.eww-hyprland = { - enable = true; - package = inputs.eww.packages.${pkgs.hostPlatform.system}.eww-wayland; - }; - - home.packages = with pkgs; [ - # screenshot - grim - slurp - - # idle/lock - swaybg - swaylock-effects - - # utils - ocrScript - wf-recorder - wl-clipboard - wlogout - wlr-randr - wofi - ]; - - # make stuff work on wayland - home.sessionVariables = { - QT_QPA_PLATFORM = "wayland"; - SDL_VIDEODRIVER = "wayland"; - XDG_SESSION_TYPE = "wayland"; - }; - - programs.obs-studio.plugins = with pkgs.obs-studio-plugins; [wlrobs]; - - # fake a tray to let apps start - # https://github.com/nix-community/home-manager/issues/2064 - systemd.user.targets.tray = { - Unit = { - Description = "Home Manager System Tray"; - Requires = ["graphical-session-pre.target"]; - }; - }; -} diff --git a/foreign/dotfiles/home/wayland/hyprland/config.nix b/foreign/dotfiles/home/wayland/hyprland/config.nix deleted file mode 100644 index f743460..0000000 --- a/foreign/dotfiles/home/wayland/hyprland/config.nix +++ /dev/null @@ -1,248 +0,0 @@ -{ - config, - pkgs, - default, - ... -}: let - inherit (default) colors; - - pointer = config.home.pointerCursor; - homeDir = config.home.homeDirectory; - - emoji = "${pkgs.wofi-emoji}/bin/wofi-emoji"; - launcher = "wofi"; -in { - wayland.windowManager.hyprland.extraConfig = '' - $mod = SUPER - - env = _JAVA_AWT_WM_NONREPARENTING,1 - env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1 - - # scale apps - env = GDK_SCALE,2 - exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2 - - # set cursor for HL itself - exec-once = hyprctl setcursor ${pointer.name} ${toString pointer.size} - - exec-once = systemctl --user start clight - exec-once = eww open bar - - misc { - # disable auto polling for config file changes - disable_autoreload = true - focus_on_activate = true - # disable dragging animation - animate_mouse_windowdragging = false - } - - # touchpad gestures - gestures { - workspace_swipe = true - workspace_swipe_forever = true - } - - input { - kb_layout = ro - - # focus change on cursor move - follow_mouse = 1 - accel_profile = flat - touchpad { - scroll_factor = 0.3 - } - } - - device:MSFT0001:00 04F3:31EB Touchpad { - accel_profile = adaptive - natural_scroll = true - sensitivity = 0.1 - } - - general { - gaps_in = 5 - gaps_out = 5 - border_size = 2 - col.active_border = rgb(${colors.blue}) rgb(${colors.mauve}) 270deg - col.inactive_border = rgb(${colors.crust}) rgb(${colors.lavender}) 270deg - - # group borders - col.group_border_active = rgb(${colors.pink}) - col.group_border = rgb(${colors.surface0}) - } - - decoration { - rounding = 16 - blur = true - blur_size = 3 - blur_passes = 3 - blur_new_optimizations = true - - drop_shadow = true - shadow_ignore_window = true - shadow_offset = 0 5 - shadow_range = 50 - shadow_render_power = 3 - col.shadow = rgba(00000099) - } - - animations { - enabled = true - animation = border, 1, 2, default - animation = fade, 1, 4, default - animation = windows, 1, 3, default, popin 80% - animation = workspaces, 1, 2, default, slide - } - - dwindle { - # keep floating dimentions while tiling - pseudotile = true - preserve_split = true - } - - # only allow shadows for floating windows - windowrulev2 = noshadow, floating:0 - - # telegram media viewer - windowrulev2 = float, title:^(Media viewer)$ - - # make Firefox PiP window floating and sticky - windowrulev2 = float, title:^(Picture-in-Picture)$ - windowrulev2 = pin, title:^(Picture-in-Picture)$ - - # throw sharing indicators away - windowrulev2 = workspace special silent, title:^(Firefox — Sharing Indicator)$ - windowrulev2 = workspace special silent, title:^(.*is sharing (your screen|a window)\.)$ - - # start spotify tiled in ws9 - windowrulev2 = tile, class:^(Spotify)$ - windowrulev2 = workspace 9 silent, class:^(Spotify)$ - - # start Discord/WebCord in ws2 - windowrulev2 = workspace 2, title:^(.*(Disc|WebC)ord.*)$ - - # idle inhibit while watching videos - windowrulev2 = idleinhibit focus, class:^(mpv|.+exe)$ - windowrulev2 = idleinhibit focus, class:^(firefox)$, title:^(.*YouTube.*)$ - windowrulev2 = idleinhibit fullscreen, class:^(firefox)$ - - windowrulev2 = dimaround, class:^(gcr-prompter)$ - - # fix xwayland apps - windowrulev2 = rounding 0, xwayland:1, floating:1 - windowrulev2 = center, class:^(.*jetbrains.*)$, title:^(Confirm Exit|Open Project|win424|win201|splash)$ - windowrulev2 = size 640 400, class:^(.*jetbrains.*)$, title:^(splash)$ - - layerrule = blur, ^(gtk-layer-shell)$ - layerrule = ignorezero, ^(gtk-layer-shell)$ - - # mouse movements - bindm = $mod, mouse:272, movewindow - bindm = $mod, mouse:273, resizewindow - bindm = $mod ALT, mouse:272, resizewindow - - # compositor commands - bind = $mod SHIFT, E, exec, pkill Hyprland - bind = $mod, Q, killactive, - bind = $mod, F, fullscreen, - bind = $mod, G, togglegroup, - bind = $mod SHIFT, N, changegroupactive, f - bind = $mod SHIFT, P, changegroupactive, b - bind = $mod, R, togglesplit, - bind = $mod, T, togglefloating, - bind = $mod, P, pseudo, - bind = $mod ALT, ,resizeactive, - # toggle "monocle" (no_gaps_when_only) - $kw = dwindle:no_gaps_when_only - bind = $mod, M, exec, hyprctl keyword $kw $(($(hyprctl getoption $kw -j | jaq -r '.int') ^ 1)) - - # utility - # launcher - bindr = $mod, SUPER_L, exec, pkill .${launcher}-wrapped || run-as-service ${launcher} - # terminal - bind = $mod, Return, exec, run-as-service ${default.terminal.name} - # logout menu - bind = $mod, Escape, exec, wlogout -p layer-shell - # lock screen - bind = $mod, L, exec, loginctl lock-session - # emoji picker - bind = $mod, E, exec, ${emoji} - # select area to perform OCR on - bind = $mod, O, exec, run-as-service wl-ocr - - # move focus - bind = $mod, left, movefocus, l - bind = $mod, right, movefocus, r - bind = $mod, up, movefocus, u - bind = $mod, down, movefocus, d - - # window resize - bind = $mod, S, submap, resize - - submap = resize - binde = , right, resizeactive, 10 0 - binde = , left, resizeactive, -10 0 - binde = , up, resizeactive, 0 -10 - binde = , down, resizeactive, 0 10 - bind = , escape, submap, reset - submap = reset - - # media controls - bindl = , XF86AudioPlay, exec, playerctl play-pause - bindl = , XF86AudioPrev, exec, playerctl previous - bindl = , XF86AudioNext, exec, playerctl next - - # volume - bindle = , XF86AudioRaiseVolume, exec, wpctl set-volume -l "1.0" @DEFAULT_AUDIO_SINK@ 6%+ - binde = , XF86AudioRaiseVolume, exec, ${homeDir}/.config/eww/scripts/volume osd - bindle = , XF86AudioLowerVolume, exec, wpctl set-volume -l "1.0" @DEFAULT_AUDIO_SINK@ 6%- - binde = , XF86AudioLowerVolume, exec, ${homeDir}/.config/eww/scripts/volume osd - bindl = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle - bind = , XF86AudioMute, exec, ${homeDir}/.config/eww/scripts/volume osd - bindl = , XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle - - # backlight - bindle = , XF86MonBrightnessUp, exec, light -A 5 - binde = , XF86MonBrightnessUp, exec, ${homeDir}/.config/eww/scripts/brightness osd - bindle = , XF86MonBrightnessDown, exec, light -U 5 - binde = , XF86MonBrightnessDown, exec, ${homeDir}/.config/eww/scripts/brightness osd - - # screenshot - # stop animations while screenshotting; makes black border go away - $screenshotarea = hyprctl keyword animation "fadeOut,0,0,default"; grimblast --notify copysave area; hyprctl keyword animation "fadeOut,1,4,default" - bind = , Print, exec, $screenshotarea - bind = $mod SHIFT, R, exec, $screenshotarea - - bind = CTRL, Print, exec, grimblast --notify --cursor copysave output - bind = $mod SHIFT CTRL, R, exec, grimblast --notify --cursor copysave output - - bind = ALT, Print, exec, grimblast --notify --cursor copysave screen - bind = $mod SHIFT ALT, R, exec, grimblast --notify --cursor copysave screen - - # workspaces - # binds mod + [shift +] {1..10} to [move to] ws {1..10} - ${builtins.concatStringsSep "\n" (builtins.genList ( - x: let - ws = let - c = (x + 1) / 10; - in - builtins.toString (x + 1 - (c * 10)); - in '' - bind = $mod, ${ws}, workspace, ${toString (x + 1)} - bind = $mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)} - '' - ) - 10)} - - # special workspace - bind = $mod SHIFT, grave, movetoworkspace, special - bind = $mod, grave, togglespecialworkspace, eDP-1 - - # cycle workspaces - bind = $mod, bracketleft, workspace, m-1 - bind = $mod, bracketright, workspace, m+1 - # cycle monitors - bind = $mod SHIFT, braceleft, focusmonitor, l - bind = $mod SHIFT, braceright, focusmonitor, r - ''; -} diff --git a/foreign/dotfiles/home/wayland/hyprland/default.nix b/foreign/dotfiles/home/wayland/hyprland/default.nix deleted file mode 100644 index 72745de..0000000 --- a/foreign/dotfiles/home/wayland/hyprland/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - inputs, - lib, - pkgs, - ... -}: { - imports = [./config.nix]; - - home.packages = with pkgs; [ - jaq - xorg.xprop - inputs.hyprland-contrib.packages.${pkgs.hostPlatform.system}.grimblast - ]; - - # start swayidle as part of hyprland, not sway - systemd.user.services.swayidle.Install.WantedBy = lib.mkForce ["hyprland-session.target"]; - - # enable hyprland - wayland.windowManager.hyprland.enable = true; -} diff --git a/foreign/dotfiles/home/wayland/sway.nix b/foreign/dotfiles/home/wayland/sway.nix deleted file mode 100644 index 3a51634..0000000 --- a/foreign/dotfiles/home/wayland/sway.nix +++ /dev/null @@ -1,74 +0,0 @@ -{ - config, - pkgs, - lib, - inputs, - default, - ... -}: { - wayland.windowManager.sway = { - enable = true; - package = inputs.self.packages.${pkgs.hostPlatform.system}.sway-hidpi; - config = { - keybindings = let - m = config.wayland.windowManager.sway.config.modifier; - in - lib.mkOptionDefault { - "${m}+Return" = "exec ${default.terminal.name}"; - "${m}+q" = "kill"; - "${m}+space" = "exec wofi"; - "${m}+t" = "floating toggle"; - - # screenshots - "Print" = "grim -g \"$(slurp)\" - | wl-copy -t image/png"; - "${m}+Shift+r" = "grim -g \"$(slurp)\" - | wl-copy -t image/png"; - "Alt+Print" = "grim - | wl-copy -t image/png"; - "${m}+Alt+Shift+r" = "grim - | wl-copy -t image/png"; - }; - - keycodebindings = { - "--locked --no-repeat 121" = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; # mute - "--locked 122" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 6%-"; # vol- - "--locked 123" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 6%+"; # vol+ - "--locked 171" = "exec playerctl next"; # next song - "--locked --no-repeat 172" = "exec playerctl play-pause"; # play/pause - "--locked 173" = "exec playerctl previous"; # prev song - "--locked --no-repeat 198" = "exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; # mic mute - "--locked 232" = "exec light -U 5"; # brightness- - "--locked 233" = "exec light -A 5"; # brightness+ - }; - - menu = "wofi"; - terminal = default.terminal.name; - modifier = "Mod4"; - bars = []; - - gaps = { - smartBorders = "on"; - outer = 5; - inner = 5; - }; - - startup = [{command = "dbus-update-activation-environment --systemd WAYLAND_DISPLAY DISPLAY";}]; - - input = { - "type:pointer" = { - accel_profile = "flat"; - pointer_accel = "0"; - }; - "type:touchpad" = { - middle_emulation = "enabled"; - natural_scroll = "enabled"; - tap = "enabled"; - }; - }; - output."*".bg = "~/.config/wallpaper.png fill"; - }; - - extraConfig = '' - exec ${pkgs.xorg.xprop}/bin/xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2 - ''; - - wrapperFeatures.gtk = true; - }; -} diff --git a/foreign/dotfiles/home/wayland/swaybg.nix b/foreign/dotfiles/home/wayland/swaybg.nix deleted file mode 100644 index d6e6b27..0000000 --- a/foreign/dotfiles/home/wayland/swaybg.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - pkgs, - lib, - default, - ... -}: { - systemd.user.services.swaybg = { - Unit = { - Description = "Wayland wallpaper daemon"; - PartOf = ["graphical-session.target"]; - }; - Service = { - ExecStart = "${lib.getExe pkgs.swaybg} -i ${default.wallpaper} -m fill"; - Restart = "on-failure"; - }; - Install.WantedBy = ["graphical-session.target"]; - }; -} diff --git a/foreign/dotfiles/home/wayland/swayidle.nix b/foreign/dotfiles/home/wayland/swayidle.nix deleted file mode 100644 index bf98993..0000000 --- a/foreign/dotfiles/home/wayland/swayidle.nix +++ /dev/null @@ -1,34 +0,0 @@ -{pkgs, ...}: let - suspendScript = pkgs.writeShellScript "suspend-script" '' - ${pkgs.pipewire}/bin/pw-cli i all | ${pkgs.ripgrep}/bin/rg running - # only suspend if audio isn't running - if [ $? == 1 ]; then - ${pkgs.systemd}/bin/systemctl suspend - fi - ''; -in { - # screen idle - services.swayidle = { - enable = true; - events = [ - { - event = "before-sleep"; - command = "${pkgs.systemd}/bin/loginctl lock-session"; - } - { - event = "lock"; - command = "${pkgs.swaylock-effects}/bin/swaylock -fF"; - } - ]; - timeouts = [ - { - timeout = 310; - command = "${pkgs.systemd}/bin/loginctl lock-session"; - } - { - timeout = 310; - command = suspendScript.outPath; - } - ]; - }; -} diff --git a/foreign/dotfiles/home/wayland/swaylock.nix b/foreign/dotfiles/home/wayland/swaylock.nix deleted file mode 100644 index f8e161f..0000000 --- a/foreign/dotfiles/home/wayland/swaylock.nix +++ /dev/null @@ -1,31 +0,0 @@ -{default, ...}: { - programs.swaylock.settings = let - inherit (default) xcolors; - in { - clock = true; - font = "Jost *"; - image = default.wallpaper; - indicator = true; - - bs-hl-color = xcolors.red; - key-hl-color = xcolors.text; - separator-color = xcolors.base; - text-color = xcolors.base; - - inside-color = xcolors.mauve; - line-color = xcolors.mauve; - ring-color = xcolors.base; - - inside-clear-color = xcolors.yellow; - line-clear-color = xcolors.yellow; - ring-clear-color = xcolors.base; - - inside-ver-color = xcolors.lavender; - line-ver-color = xcolors.lavender; - ring-ver-color = xcolors.base; - - inside-wrong-color = xcolors.red; - line-wrong-color = xcolors.red; - ring-wrong-color = xcolors.base; - }; -} diff --git a/foreign/dotfiles/home/wayland/wayfire.nix b/foreign/dotfiles/home/wayland/wayfire.nix deleted file mode 100644 index 5652f69..0000000 --- a/foreign/dotfiles/home/wayland/wayfire.nix +++ /dev/null @@ -1,340 +0,0 @@ -{ - pkgs, - default, - ... -}: let - inherit (default) xrgbaColors; -in { - home.packages = [pkgs.wayfire]; - - xdg.configFile."wayfire.ini".text = '' - [alpha] - min_value = 0.100000 - modifier = - - [animate] - close_animation = fade - open_animation = zoom - startup_duration = 300 - duration = 300 - enabled_for = type equals "toplevel" | (type equals "x-or" & focusable equals true)) - - fade_duration = 400 - fade_enabled_for = type equals "overlay" - - [autostart] - 0_environment = dbus-update-activation-environment --systemd WAYLAND_DISPLAY DISPLAY XAUTHORITY - 1_hm = systemctl --user start graphical-session.target - 2_eww = eww daemon - - autostart_wf_shell = false - background = swaybg -i ~/.config/wallpaper.png - idle = swayidle -w \ - timeout 360 'swaylock' \ - before-sleep 'swaylock' - panel = eww open bar - - [blur] - blur_by_default = type is "toplevel" - - bokeh_degrade = 1 - bokeh_iterations = 5 - bokeh_offset = 5.000000 - - box_degrade = 1 - box_iterations = 2 - box_offset = 1.000000 - - gaussian_degrade = 1 - gaussian_iterations = 2 - gaussian_offset = 1.000000 - - kawase_degrade = 3 - kawase_iterations = 3 - kawase_offset = 1.000000 - - method = kawase - saturation = 1.000000 - #toggle = KEY_B - - [command] - binding_launcher = KEY_SPACE - binding_lock = KEY_L - binding_logout = KEY_ESC - binding_mute = KEY_MUTE - binding_mic_mute = KEY_F20 - binding_next = KEY_NEXTSONG - binding_pause = KEY_PLAYPAUSE - binding_prev = KEY_PREVIOUSSONG - binding_screenshot = KEY_PRINT | KEY_R - binding_screenshot_interactive = KEY_PRINT | KEY_R - binding_terminal = KEY_ENTER - - command_launcher = wofi --show=drun -I - command_light_down = light -U 5 - command_light_up = light -A 5 - command_lock = swaylock - command_logout = wlogout -p layer-shell - command_mute = wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle - command_mic_mute = wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle - command_next = playerctl next - command_pause = playerctl play-pause - command_prev = playerctl previous - command_screenshot = screenshot area - command_screenshot_interactive = screenshot monitor - command_terminal = ${default.terminal.name} - command_volume_down = pulsemixer --change-volume -6 - command_volume_up = pulsemixer --change-volume +6 - - repeatable_binding_light_down = KEY_BRIGHTNESSDOWN - repeatable_binding_light_up = KEY_BRIGHTNESSUP - repeatable_binding_volume_down = KEY_VOLUMEDOWN - repeatable_binding_volume_up = KEY_VOLUMEUP - - [core] - background_color = #${xrgbaColors.base00} - close_top_view = KEY_Q | KEY_F4 - focus_button_with_modifiers = false - focus_buttons = BTN_LEFT | BTN_MIDDLE | BTN_RIGHT - focus_buttons_passthrough = true - plugins = autostart \ - blur \ - command \ - decoration \ - expo \ - fast-switcher \ - idle \ - matcher \ - move \ - oswitch \ - place \ - resize \ - simple-tile \ - vswipe \ - window-rules \ - wrot \ - zoom - vheight = 3 - vwidth = 3 - xwayland = true - - [cube] - activate = BTN_LEFT - background = #${xrgbaColors.base00} - background_mode = simple - cubemap_image = - deform = 0 - initial_animation = 350 - light = true - rotate_left = KEY_LEFT - rotate_right = KEY_RIGHT - skydome_mirror = true - skydome_texture = - speed_spin_horiz = 0.020000 - speed_spin_vert = 0.020000 - speed_zoom = 0.070000 - zoom = 0.100000 - - [decoration] - active_color = #${xrgbaColors.base00} - border_size = 0 - button_order = minimize maximize close - font = Roboto - ignore_views = none - inactive_color = #${xrgbaColors.base04} - title_height = 20 - - [expo] - background = #${xrgbaColors.base00} - duration = 50 - offset = 10 - select_workspace_1 = KEY_1 - select_workspace_2 = KEY_2 - select_workspace_3 = KEY_3 - select_workspace_4 = KEY_4 - select_workspace_5 = KEY_5 - select_workspace_6 = KEY_6 - select_workspace_7 = KEY_7 - select_workspace_8 = KEY_8 - select_workspace_9 = KEY_9 - toggle = - - [extra-gestures] - close_fingers = 5 - move_delay = 500 - move_fingers = 3 - - [fast-switcher] - activate = KEY_ESC - activate_backward = KEY_ESC - - [fisheye] - radius = 450.000000 - toggle = KEY_F - zoom = 7.000000 - - [grid] - duration = 300 - restore = KEY_DOWN | KEY_KP0 - slot_b = KEY_KP2 - slot_bl = KEY_KP1 - slot_br = KEY_KP3 - slot_c = KEY_UP | KEY_KP5 - slot_l = KEY_LEFT | KEY_KP4 - slot_r = KEY_RIGHT | KEY_KP6 - slot_t = KEY_KP8 - slot_tl = KEY_KP7 - slot_tr = KEY_KP9 - type = crossfade - - [idle] - cube_max_zoom = 1.500000 - cube_rotate_speed = 1.000000 - cube_zoom_speed = 1000 - disable_on_fullscreen = true - dpms_timeout = 300 - screensaver_timeout = -1 - toggle = none - - [input] - click_method = default - cursor_size = 24 - cursor_theme = "Bibata-Modern-Classic" - disable_touchpad_while_mouse = false - disable_touchpad_while_typing = false - gesture_sensitivity = 1.000000 - middle_emulation = false - modifier_binding_timeout = 400 - mouse_accel_profile = flat - natural_scroll = true - touchpad_scroll_speed = 0.3 - xkb_layout = ro - xkb_rules = evdev - - [invert] - preserve_hue = false - toggle = KEY_I - - [move] - activate = BTN_LEFT - enable_snap = true - enable_snap_off = true - join_views = false - quarter_snap_threshold = 50 - snap_off_threshold = 10 - snap_threshold = 10 - workspace_switch_after = -1 - - [oswitch] - next_output = KEY_O - next_output_with_win = KEY_O - - [output] - mode = auto - position = auto - scale = 1.000000 - transform = normal - - [place] - mode = center - - [preserve-output] - last_output_focus_timeout = 10000 - - [resize] - activate = BTN_RIGHT - - [scale] - allow_zoom = false - bg_color = #${xrgbaColors.base00} - duration = 750 - inactive_alpha = 0.750000 - interact = false - middle_click_close = false - spacing = 50 - text_color = #${xrgbaColors.base00} - title_font_size = 14 - title_overlay = all - title_position = center - toggle = KEY_P - toggle_all = - - [switcher] - next_view = KEY_TAB - prev_view = KEY_TAB - speed = 500 - view_thumbnail_scale = 1.000000 - - [vswipe] - background = #${xrgbaColors.base00} - duration = 180 - enable_smooth_transition = true - enable_vertical = true - fingers = 3 - gap = 32.000000 - speed_cap = 0.500000 - speed_factor = 500.000000 - #threshold = 0.250000 - - [vswitch] - background = #${xrgbaColors.base00} - binding_down = KEY_DOWN - binding_left = KEY_LEFT - binding_right = KEY_RIGHT - binding_up = KEY_UP - binding_win_down = KEY_DOWN - binding_win_left = KEY_LEFT - binding_win_right = KEY_RIGHT - binding_win_up = KEY_UP - duration = 300 - gap = 20 - wraparound = false - - [window-rules] - - [wm-actions] - minimize = none - toggle_always_on_top = none - toggle_fullscreen = KEY_F - toggle_maximize = none - toggle_showdesktop = none - toggle_sticky = none - - [wobbly] - friction = 3.000000 - grid_resolution = 6 - spring_k = 8.000000 - - [workarounds] - all_dialogs_modal = true - app_id_mode = stock - dynamic_repaint_delay = false - - [wrot] - activate = BTN_RIGHT - activate-3d = BTN_RIGHT - invert = false - reset = KEY_R - reset-one = KEY_R - reset_radius = 25.000000 - sensitivity = 24 - - [zoom] - modifier = - smoothing_duration = 300 - speed = 0.010000 - - [simple-tile] - button_move = BTN_LEFT - button_resize = BTN_RIGHT - inner_gap_size = 2 - keep_fullscreen_on_adjacent = true - key_focus_above = KEY_K - key_focus_below = KEY_J - key_focus_left = KEY_H - key_focus_right = KEY_L - key_toggle = KEY_T - tile_by_default = type is "toplevel" - #wm-actions.toggle_always_on_top - ''; -} diff --git a/foreign/dotfiles/hosts/README.md b/foreign/dotfiles/hosts/README.md deleted file mode 100644 index 0a82810..0000000 --- a/foreign/dotfiles/hosts/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Hosts config - -Name | Description ------------- | ----------- -`io` | Lenovo laptop, main machine -`kiiro` | Previous main machine, retired and rarely used server now - -All the hosts have a shared config in `modules/minimal.nix`. -Host specific configs are stored inside the specific host dir. diff --git a/foreign/dotfiles/hosts/default.nix b/foreign/dotfiles/hosts/default.nix deleted file mode 100644 index b5317cb..0000000 --- a/foreign/dotfiles/hosts/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - inputs, - withSystem, - sharedModules, - desktopModules, - homeImports, - ... -}: { - flake.nixosConfigurations = withSystem "x86_64-linux" ({system, ...}: { - io = inputs.nixpkgs.lib.nixosSystem { - inherit system; - - modules = - [ - ./io - ../modules/greetd.nix - ../modules/desktop.nix - ../modules/gamemode.nix - ../modules/howdy - ../modules/linux-enable-ir-emitter.nix - {home-manager.users.mihai.imports = homeImports."mihai@io";} - ] - ++ sharedModules - ++ desktopModules; - }; - - kiiro = inputs.nixpkgs.lib.nixosSystem { - inherit system; - - modules = - [ - ./kiiro - {home-manager.users.mihai.imports = homeImports.server;} - ] - ++ sharedModules; - }; - }); -} diff --git a/foreign/dotfiles/hosts/io/default.nix b/foreign/dotfiles/hosts/io/default.nix deleted file mode 100644 index d7ab090..0000000 --- a/foreign/dotfiles/hosts/io/default.nix +++ /dev/null @@ -1,162 +0,0 @@ -{ - config, - pkgs, - inputs, - ... -} @ args: { - imports = [./hardware-configuration.nix]; - - age.secrets.spotify = { - file = "${inputs.self}/secrets/spotify.age"; - owner = "mihai"; - group = "users"; - }; - - boot = { - initrd = { - systemd.enable = true; - supportedFilesystems = ["ext4"]; - }; - - # load modules on boot - kernelModules = ["acpi_call" "amdgpu" "amd_pstate"]; - - # use latest kernel - kernelPackages = pkgs.linuxPackages_xanmod_latest; - # Panel Self Refresh - kernelParams = ["amdgpu.dcfeaturemask=0x8" "initcall_blacklist=acpi_cpufreq_init" "amd_pstate=passive" "amd_pstate.shared_mem=1"]; - - loader = { - # systemd-boot on UEFI - efi.canTouchEfiVariables = true; - systemd-boot.enable = true; - }; - - plymouth = { - enable = true; - themePackages = [inputs.self.packages.${pkgs.hostPlatform.system}.catppuccin-plymouth]; - # theme = "catppuccin-mocha"; - # font = "${pkgs.noto-fonts}/share/fonts/truetype/noto/NotoSans-Light.ttf"; - }; - }; - - environment.systemPackages = [config.boot.kernelPackages.cpupower]; - - hardware = { - bluetooth = { - enable = true; - # battery info support - package = pkgs.bluez5-experimental; - settings = { - # make Xbox Series X controller work - General = { - Class = "0x000100"; - ControllerMode = "bredr"; - FastConnectable = true; - JustWorksRepairing = "always"; - Privacy = "device"; - Experimental = true; - }; - }; - }; - - cpu.amd.updateMicrocode = true; - - enableRedistributableFirmware = true; - - opentabletdriver.enable = true; - - video.hidpi.enable = true; - - xpadneo.enable = true; - }; - - networking = { - hostName = "io"; - firewall = { - allowedTCPPorts = [42355]; - allowedUDPPorts = [5353]; - }; - }; - - programs = { - # enable hyprland and required options - hyprland.enable = true; - - # backlight control - light.enable = true; - - steam.enable = true; - }; - - security.tpm2 = { - enable = true; - abrmd.enable = true; - }; - - services = { - # for SSD/NVME - fstrim.enable = true; - - howdy = { - enable = true; - package = inputs.self.packages.${pkgs.system}.howdy; - settings = { - core.no_confirmation = true; - video.device_path = "/dev/video2"; - video.dark_threshold = 90; - }; - }; - - linux-enable-ir-emitter.enable = true; - - kmonad.keyboards = { - io = { - name = "io"; - device = "/dev/input/by-path/platform-i8042-serio-0-event-kbd"; - defcfg = { - enable = true; - fallthrough = true; - allowCommands = false; - }; - config = builtins.readFile "${inputs.self}/modules/main.kbd"; - }; - }; - - # see https://github.com/fufexan/nix-gaming/#pipewire-low-latency - pipewire.lowLatency.enable = true; - - printing.enable = true; - - # configure mice - ratbagd.enable = true; - - # power saving - tlp = { - enable = true; - settings = { - PCIE_ASPM_ON_BAT = "powersupersave"; - CPU_SCALING_GOVERNOR_ON_AC = "performance"; - CPU_SCALING_GOVERNOR_ON_BAT = "conservative"; - NMI_WATCHDOG = 0; - }; - }; - - udev.extraRules = let - inherit (import ./plugged.nix args) plugged unplugged; - in '' - # add my android device to adbusers - SUBSYSTEM=="usb", ATTR{idVendor}=="22d9", MODE="0666", GROUP="adbusers" - - # start/stop services on power (un)plug - SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="${plugged}" - SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="${unplugged}" - ''; - - # add hyprland to display manager sessions - xserver.displayManager.sessionPackages = [inputs.hyprland.packages.${pkgs.hostPlatform.system}.default]; - }; - - # https://github.com/NixOS/nixpkgs/issues/114222 - systemd.user.services.telephony_client.enable = false; -} diff --git a/foreign/dotfiles/hosts/io/hardware-configuration.nix b/foreign/dotfiles/hosts/io/hardware-configuration.nix deleted file mode 100644 index 52c35a3..0000000 --- a/foreign/dotfiles/hosts/io/hardware-configuration.nix +++ /dev/null @@ -1,35 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ - config, - lib, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-amd"]; - boot.extraModulePackages = []; - - fileSystems."/" = { - device = "/dev/disk/by-label/nixos"; - fsType = "ext4"; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-label/boot"; - fsType = "vfat"; - }; - - swapDevices = []; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - # high-resolution display - hardware.video.hidpi.enable = lib.mkDefault true; -} diff --git a/foreign/dotfiles/hosts/io/plugged.nix b/foreign/dotfiles/hosts/io/plugged.nix deleted file mode 100644 index 008a020..0000000 --- a/foreign/dotfiles/hosts/io/plugged.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - pkgs, - lib, - inputs, - ... -}: let - programs = lib.makeBinPath [inputs.hyprland.packages.${pkgs.hostPlatform.system}.default]; -in { - unplugged = pkgs.writeShellScript "unplugged" '' - export PATH=$PATH:${programs} - export HYPRLAND_INSTANCE_SIGNATURE=$(ls -w1 /tmp/hypr | tail -1) - - systemctl --user --machine=1000@ stop easyeffects syncthing - hyprctl --batch 'keyword decoration:drop_shadow 0 ; keyword animations:enabled 0' - ''; - - plugged = pkgs.writeShellScript "plugged" '' - export PATH=$PATH:${programs} - export HYPRLAND_INSTANCE_SIGNATURE=$(ls -w1 /tmp/hypr | tail -1) - - systemctl --user --machine=1000@ start easyeffects syncthing - hyprctl --batch 'keyword decoration:drop_shadow 1 ; keyword animations:enabled 1' - ''; -} diff --git a/foreign/dotfiles/hosts/kiiro/default.nix b/foreign/dotfiles/hosts/kiiro/default.nix deleted file mode 100644 index 20580f0..0000000 --- a/foreign/dotfiles/hosts/kiiro/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -# biggest homeserver -{lib, ...}: { - imports = [ - ./hardware-configuration.nix - ./services.nix - ]; - - # used by tailscale for exit node - boot.kernel.sysctl = { - "net.ipv4.ip_forward" = 1; - "net.ipv6.conf.all.forwarding" = 1; - }; - - # bootloader - boot.loader = { - efi.canTouchEfiVariables = true; - systemd-boot.enable = true; - }; - - hardware = { - cpu.intel.updateMicrocode = true; - - enableRedistributableFirmware = true; - }; - - networking.hostName = "kiiro"; - - services.btrfs.autoScrub.enable = true; - - system.stateVersion = lib.mkForce "21.11"; -} diff --git a/foreign/dotfiles/hosts/kiiro/hardware-configuration.nix b/foreign/dotfiles/hosts/kiiro/hardware-configuration.nix deleted file mode 100644 index 96d30d1..0000000 --- a/foreign/dotfiles/hosts/kiiro/hardware-configuration.nix +++ /dev/null @@ -1,30 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{modulesPath, ...}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = ["ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/a2fc0125-f3e6-4984-9eff-9010c154cb7b"; - fsType = "btrfs"; - options = ["subvol=root"]; - }; - - fileSystems."/persist" = { - device = "/dev/disk/by-uuid/a2fc0125-f3e6-4984-9eff-9010c154cb7b"; - fsType = "btrfs"; - options = ["subvol=persist"]; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/7B5A-471E"; - fsType = "vfat"; - }; -} diff --git a/foreign/dotfiles/hosts/kiiro/services.nix b/foreign/dotfiles/hosts/kiiro/services.nix deleted file mode 100644 index d13cf0a..0000000 --- a/foreign/dotfiles/hosts/kiiro/services.nix +++ /dev/null @@ -1,67 +0,0 @@ -# server services -{ - security.acme.defaults = { - email = "fufexan@protonmail.com"; - server = "https://acme-staging-v02.api.letsencrypt.org/directory"; - }; - - services.minecraft-server = { - enable = false; - eula = true; - jvmOpts = '' - -Xmx6G -Xms1G -XX:+UseG1GC - -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 - ''; - openFirewall = true; - }; - - services.nginx = { - enable = false; - - recommendedGzipSettings = true; - recommendedOptimisation = true; - recommendedProxySettings = true; - recommendedTlsSettings = true; - - sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL"; - - virtualHosts = { - "jellyfin.fufexan.net" = { - forceSSL = true; - enableACME = true; - - locations."= /".return = "302 https://$host/web"; - locations."/" = { - proxyPass = "http://127.0.0.1:8096"; - extraConfig = "proxy_buffering off"; - }; - locations."= /web/".proxyPass = "http://127.0.0.1:8096/web/index.html"; - locations."/socket" = { - proxyPass = "http://127.0.0.1:8096"; - proxyWebsockets = true; - extraConfig = '' - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - ''; - }; - }; - }; - }; - - networking.firewall.allowedTCPPorts = [80 139 443 445 5357 8384 8443]; - networking.firewall.allowedUDPPorts = [137 138 3702]; - - services.syncthing = { - enable = true; - group = "users"; - guiAddress = ":8384"; - openDefaultPorts = true; - declarative = {}; - }; - - services.transmission = { - openFirewall = true; - settings.rpc-bind-address = "0.0.0.0"; - settings.rpc-whitelist-enables = false; - }; -} diff --git a/foreign/dotfiles/lib/README.md b/foreign/dotfiles/lib/README.md deleted file mode 100644 index 716632e..0000000 --- a/foreign/dotfiles/lib/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Lib - -Various functions I use throughout the config: - -Name | Description -------------- | ----------- -`colors.nix` | Functions for dealing with colors. Used for `default`. -`default.nix` | Module for flake-parts -`repl.nix` | Cool Nix REPL wrapper diff --git a/foreign/dotfiles/lib/colors.nix b/foreign/dotfiles/lib/colors.nix deleted file mode 100644 index 10bf428..0000000 --- a/foreign/dotfiles/lib/colors.nix +++ /dev/null @@ -1,67 +0,0 @@ -lib: -with lib; rec { - # color-related functions - - # convert rrggbb hex to #rrggbb - x = c: "#${c}"; - - # convert rrggbb hex to rgba(r, g, b, a) css - rgba = c: let - r = toString (hexToDec (__substring 0 2 c)); - g = toString (hexToDec (__substring 2 2 c)); - b = toString (hexToDec (__substring 4 2 c)); - res = "rgba(${r}, ${g}, ${b}, .5)"; - in - res; - - # general stuff - - # functions copied from https://gist.github.com/corpix/f761c82c9d6fdbc1b3846b37e1020e11 - # convert a hex value to an integer - hexToDec = v: let - hexToInt = { - "0" = 0; - "1" = 1; - "2" = 2; - "3" = 3; - "4" = 4; - "5" = 5; - "6" = 6; - "7" = 7; - "8" = 8; - "9" = 9; - "a" = 10; - "b" = 11; - "c" = 12; - "d" = 13; - "e" = 14; - "f" = 15; - "A" = 10; - "B" = 11; - "C" = 12; - "D" = 13; - "E" = 14; - "F" = 15; - }; - chars = stringToCharacters v; - charsLen = length chars; - in - foldl - (a: v: a + v) - 0 - (imap0 - (k: v: hexToInt."${v}" * (pow 16 (charsLen - k - 1))) - chars); - - pow = let - pow' = base: exponent: value: - # FIXME: It will silently overflow on values > 2**62 :( - # The value will become negative or zero in this case - if exponent == 0 - then 1 - else if exponent <= 1 - then value - else (pow' base (exponent - 1) (value * base)); - in - base: exponent: pow' base exponent base; -} diff --git a/foreign/dotfiles/lib/default.nix b/foreign/dotfiles/lib/default.nix deleted file mode 100644 index bdfb630..0000000 --- a/foreign/dotfiles/lib/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{inputs, ...}: -# personal lib -let - inherit (inputs.nixpkgs) lib; - - colorlib = import ./colors.nix lib; - default = import ./theme {inherit colorlib lib;}; -in { - imports = [ - {_module.args = {inherit default;};} - ]; - - perSystem = {system, ...}: { - legacyPackages = import inputs.nixpkgs { - inherit system; - config.allowUnfree = true; - config.overlays = [ - ( - _: prev: { - steam = prev.steam.override { - extraPkgs = pkgs: - with pkgs; [ - keyutils - libkrb5 - libpng - libpulseaudio - libvorbis - stdenv.cc.cc.lib - xorg.libXcursor - xorg.libXi - xorg.libXinerama - xorg.libXScrnSaver - ]; - extraProfile = "export GDK_SCALE=2"; - }; - } - ) - ]; - }; - }; -} diff --git a/foreign/dotfiles/lib/repl.nix b/foreign/dotfiles/lib/repl.nix deleted file mode 100644 index 7f14583..0000000 --- a/foreign/dotfiles/lib/repl.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - flakePath ? null, - hostnamePath ? "/etc/hostname", - registryPath ? /etc/nix/registry.json, -}: let - inherit (builtins) getFlake head match currentSystem readFile pathExists filter fromJSON; - - selfFlake = - if pathExists registryPath - then filter (it: it.from.id == "self") (fromJSON (readFile registryPath)).flakes - else []; - - flakePath' = - toString - ( - if flakePath != null - then flakePath - else if selfFlake != [] - then (head selfFlake).to.path - else "/etc/nixos" - ); - - flake = - if pathExists flakePath' - then getFlake flakePath' - else {}; - hostname = - if pathExists hostnamePath - then head (match "([a-zA-Z0-9\\-]+)\n" (readFile hostnamePath)) - else ""; - - nixpkgsFromInputsPath = flake.inputs.nixpkgs.outPath or ""; - nixpkgs = - flake.pkgs.${currentSystem}.nixpkgs - or ( - if nixpkgsFromInputsPath != "" - then import nixpkgsFromInputsPath {} - else {} - ); - - nixpkgsOutput = removeAttrs (nixpkgs // nixpkgs.lib or {}) ["options" "config"]; -in - {inherit flake;} - // flake - // builtins - // (flake.nixosConfigurations or {}) - // flake.nixosConfigurations.${hostname} or {} - // nixpkgsOutput - // {getFlake = path: getFlake (toString path);} diff --git a/foreign/dotfiles/lib/theme/colors.nix b/foreign/dotfiles/lib/theme/colors.nix deleted file mode 100644 index f468bf1..0000000 --- a/foreign/dotfiles/lib/theme/colors.nix +++ /dev/null @@ -1,37 +0,0 @@ -rec { - rosewater = "f5e0dc"; - flamingo = "f2cdcd"; - pink = "f5c2e7"; - mauve = "cba6f7"; - red = "f38ba8"; - maroon = "eba0ac"; - peach = "fab387"; - yellow = "f9e2af"; - green = "a6e3a1"; - teal = "94e2d5"; - sky = "89dceb"; - sapphire = "74c7ec"; - blue = "89b4fa"; - lavender = "b4befe"; - - text = "cdd6f4"; - subtext1 = "bac2de"; - subtext0 = "a6adc8"; - overlay2 = "9399b2"; - overlay1 = "7f849c"; - overlay0 = "6c7086"; - - surface2 = "585b70"; - surface1 = "45475a"; - surface0 = "313244"; - - base = "1e1e2e"; - mantle = "181825"; - crust = "11111b"; - - fg = text; - bg = base; - bg1 = surface0; - border = "28283d"; - shadow = crust; -} diff --git a/foreign/dotfiles/lib/theme/default.nix b/foreign/dotfiles/lib/theme/default.nix deleted file mode 100644 index 3d997f5..0000000 --- a/foreign/dotfiles/lib/theme/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - colorlib, - lib, -}: rec { - colors = import ./colors.nix; - # #RRGGBB - xcolors = lib.mapAttrs (_: colorlib.x) colors; - # rgba(,,,) colors (css) - rgbaColors = lib.mapAttrs (_: colorlib.rgba) colors; - - browser = "firefox"; - - terminal = { - font = "JetBrainsMono Nerd Font"; - name = "wezterm"; - opacity = 0.9; - size = 11; - }; - - wallpaper = builtins.fetchurl rec { - name = "wallpaper-${sha256}.png"; - url = "https://images.unsplash.com/photo-1567095716798-1d95d8f4c479?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8"; - sha256 = "1x9y9rzqb9mpxc5lmgvc7jxqdyn3j7ryv16vn5lx6qrhpwp24kym"; - }; -} diff --git a/foreign/dotfiles/modules/README.md b/foreign/dotfiles/modules/README.md deleted file mode 100644 index ea50472..0000000 --- a/foreign/dotfiles/modules/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Modules - -As of now, there are multiple modules included: - -Name | Description --------------- | ----------- -`default.nix` | Flake-parts module -Desktop | Config aimed at desktop usage -Gamemode | Gamemode settings -Gnome | GNOME config -Greetd | Greetd + GTKGreet config -Minimal | Shared configuration -Nix | Nix-related options -Security | Tweaks for a more secure system, borrowed from [hlissner](https://github.com/hlissner/dotfiles/blob/master/modules/security.nix) -Xserver | Xorg config diff --git a/foreign/dotfiles/modules/default.nix b/foreign/dotfiles/modules/default.nix deleted file mode 100644 index 16aa0a4..0000000 --- a/foreign/dotfiles/modules/default.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ - _inputs, - inputs, - default, - ... -}: let - module_args = { - _module.args = { - inputs = _inputs; - inherit default; - }; - }; -in { - imports = [ - { - _module.args = { - inherit module_args; - - sharedModules = [ - {home-manager.useGlobalPkgs = true;} - {disabledModules = ["security/pam.nix"];} - inputs.agenix.nixosModules.default - inputs.hm.nixosModule - ./minimal.nix - ./pam.nix - module_args - ./nix.nix - ./security.nix - ]; - - desktopModules = with inputs; [ - hyprland.nixosModules.default - kmonad.nixosModules.default - nix-gaming.nixosModules.default - ]; - }; - } - ]; - - flake.nixosModules = { - desktop = import ./desktop.nix; - gamemode = import ./gamemode.nix; - greetd = import ./greetd.nix; - minimal = import ./minimal.nix; - nix = import ./nix.nix; - }; -} diff --git a/foreign/dotfiles/modules/desktop.nix b/foreign/dotfiles/modules/desktop.nix deleted file mode 100644 index fc9aad6..0000000 --- a/foreign/dotfiles/modules/desktop.nix +++ /dev/null @@ -1,153 +0,0 @@ -{ - config, - pkgs, - inputs, - ... -}: { - fonts = { - fonts = with pkgs; [ - # icon fonts - material-symbols - - # normal fonts - jost - lexend - noto-fonts - noto-fonts-cjk - noto-fonts-emoji - roboto - - # nerdfonts - (nerdfonts.override {fonts = ["FiraCode" "JetBrainsMono"];}) - ]; - - # use fonts specified by user rather than default ones - enableDefaultFonts = false; - - # user defined fonts - # the reason there's Noto Color Emoji everywhere is to override DejaVu's - # B&W emojis that would sometimes show instead of some Color emojis - fontconfig.defaultFonts = { - serif = ["Noto Serif" "Noto Color Emoji"]; - sansSerif = ["Noto Sans" "Noto Color Emoji"]; - monospace = ["JetBrainsMono Nerd Font" "Noto Color Emoji"]; - emoji = ["Noto Color Emoji"]; - }; - }; - - # use Wayland where possible (electron) - environment.variables.NIXOS_OZONE_WL = "1"; - - # enable location service - location.provider = "geoclue2"; - - networking = { - firewall = { - # for Rocket League - allowedTCPPortRanges = [ - { - from = 27015; - to = 27030; - } - { - from = 27036; - to = 27037; - } - ]; - allowedUDPPorts = [4380 27036 34197]; - allowedUDPPortRanges = [ - { - from = 7000; - to = 9000; - } - { - from = 27000; - to = 27031; - } - ]; - - # Spotify track sync with other devices - allowedTCPPorts = [57621]; - }; - }; - - nix = { - # package = inputs.nix-super.packages.${pkgs.hostPlatform.system}.nix; - settings = { - substituters = [ - "https://nix-gaming.cachix.org" - "https://hyprland.cachix.org" - "https://cache.privatevoid.net" - ]; - trusted-public-keys = [ - "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" - "cache.privatevoid.net:SErQ8bvNWANeAvtsOESUwVYr2VJynfuc9JRwlzTTkVg=" - ]; - }; - }; - - # make HM-managed GTK stuff work - programs.dconf.enable = true; - - services = { - # use Ambient Light Sensors for auto brightness adjustment - clight = { - enable = true; - settings = { - verbose = true; - dpms.timeouts = [900 300]; - dimmer.timeouts = [870 270]; - screen.disabled = true; - }; - }; - - # provide location - geoclue2.enable = true; - - # keyboard remapping - kmonad = { - enable = true; - package = inputs.kmonad.packages.${pkgs.hostPlatform.system}.default; - keyboards = { - one2mini = { - device = "/dev/input/by-id/usb-Ducky_Ducky_One2_Mini_RGB_DK-V1.17-190813-event-kbd"; - defcfg = { - enable = true; - fallthrough = true; - allowCommands = false; - }; - config = builtins.readFile "${inputs.self}/modules/main.kbd"; - }; - }; - }; - - pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - jack.enable = true; - pulse.enable = true; - }; - - # battery info & stuff - upower.enable = true; - - # needed for GNOME services outside of GNOME Desktop - dbus.packages = [pkgs.gcr]; - udev.packages = with pkgs; [gnome.gnome-settings-daemon]; - }; - - security = { - # allow wayland lockers to unlock the screen - pam.services.swaylock.text = "auth include login"; - - # userland niceness - rtkit.enable = true; - }; - - xdg.portal = { - enable = true; - extraPortals = [pkgs.xdg-desktop-portal-gtk]; - }; -} diff --git a/foreign/dotfiles/modules/gamemode.nix b/foreign/dotfiles/modules/gamemode.nix deleted file mode 100644 index 1e601c0..0000000 --- a/foreign/dotfiles/modules/gamemode.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - programs = lib.makeBinPath [config.programs.hyprland.package]; - - startscript = pkgs.writeShellScript "gamemode-start" '' - export PATH=$PATH:${programs} - export HYPRLAND_INSTANCE_SIGNATURE=$(ls -1 /tmp/hypr | tail -1) - hyprctl --batch 'keyword decoration:blur 0 ; keyword animations:enabled 0 ; keyword misc:no_vfr 1' - ''; - - endscript = pkgs.writeShellScript "gamemode-end" '' - export PATH=$PATH:${programs} - export HYPRLAND_INSTANCE_SIGNATURE=$(ls -1 /tmp/hypr | tail -1) - hyprctl --batch 'keyword decoration:blur 1 ; keyword animations:enabled 1 ; keyword misc:no_vfr 0' - ''; -in { - programs.gamemode = { - enable = true; - settings = { - general = { - softrealtime = "auto"; - renice = 15; - }; - custom = { - start = startscript.outPath; - end = endscript.outPath; - }; - }; - }; -} diff --git a/foreign/dotfiles/modules/gnome.nix b/foreign/dotfiles/modules/gnome.nix deleted file mode 100644 index 6a09b00..0000000 --- a/foreign/dotfiles/modules/gnome.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - lib, - pkgs, - ... -}: -# GNOME 41 config -{ - environment.systemPackages = with pkgs.gnomeExtensions; [ - appindicator - gsconnect - ideapad-mode - vitals - pkgs.gnome.gnome-tweaks - ]; - - # we're using pipewire instead - hardware.pulseaudio.enable = lib.mkForce false; - - networking = { - # for GSConnect - firewall = { - allowedTCPPortRanges = [ - { - from = 1714; - to = 1764; - } - ]; - allowedUDPPortRanges = [ - { - from = 1714; - to = 1764; - } - ]; - }; - }; - - services.gnome.games.enable = true; - services.power-profiles-daemon.enable = lib.mkForce false; - services.xserver = { - desktopManager.gnome = { - enable = true; - }; - }; -} diff --git a/foreign/dotfiles/modules/greetd.nix b/foreign/dotfiles/modules/greetd.nix deleted file mode 100644 index c229ccb..0000000 --- a/foreign/dotfiles/modules/greetd.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ - lib, - pkgs, - config, - inputs, - default, - ... -}: -# greetd display manager -let - greetdSwayConfig = pkgs.writeText "greetd-sway-config" '' - exec "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP" - input "type:touchpad" { - tap enabled - } - seat seat0 xcursor_theme Bibata-Modern-Classic 24 - - xwayland disable - - bindsym XF86MonBrightnessUp exec light -A 5 - bindsym XF86MonBrightnessDown exec light -U 5 - bindsym Print exec ${lib.getExe pkgs.grim} /tmp/regreet.png - bindsym Mod4+shift+e exec swaynag \ - -t warning \ - -m 'What do you want to do?' \ - -b 'Poweroff' 'systemctl poweroff' \ - -b 'Reboot' 'systemctl reboot' - - exec "${lib.getExe config.programs.regreet.package} -l debug; swaymsg exit" - ''; -in { - imports = [./regreet.nix]; - environment.systemPackages = with pkgs; [ - # theme packages - (catppuccin-gtk.override { - accents = ["mauve"]; - size = "compact"; - variant = "mocha"; - }) - bibata-cursors - papirus-icon-theme - ]; - - programs.regreet = { - enable = true; - package = inputs.self.packages.${pkgs.hostPlatform.system}.regreet; - settings = { - background = default.wallpaper; - background_fit = "Cover"; - GTK = { - cursor_theme_name = "Bibata-Modern-Classic"; - font_name = "Jost * 12"; - icon_theme_name = "Papirus-Dark"; - theme_name = "Catppuccin-Mocha-Compact-Mauve-Dark"; - }; - }; - }; - - services.greetd.settings.default_session.command = "${inputs.self.packages.${pkgs.hostPlatform.system}.sway-hidpi}/bin/sway --config ${greetdSwayConfig}"; - - # unlock GPG keyring on login - security.pam.services.greetd.gnupg.enable = true; -} diff --git a/foreign/dotfiles/modules/howdy/config.nix b/foreign/dotfiles/modules/howdy/config.nix deleted file mode 100644 index c585871..0000000 --- a/foreign/dotfiles/modules/howdy/config.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - core = { - detection_notice = false; - timeout_notice = true; - no_confirmation = false; - suppress_unknown = false; - abort_if_ssh = true; - abort_if_lid_closed = true; - disabled = false; - use_cnn = false; - workaround = "off"; - }; - - video = { - certainty = 3.5; - timeout = 4; - device_path = "/dev/video2"; - warn_no_device = true; - max_height = 320; - frame_width = -1; - frame_height = -1; - dark_threshold = 60; - recording_plugin = "opencv"; - device_format = "v4l2"; - force_mjpeg = false; - exposure = -1; - rotate = 0; - }; - - snapshots = { - save_failed = false; - save_successful = false; - }; - - rubberstamps = { - enabled = false; - stamp_rules = "nod 5s failsafe min_distance=12"; - }; - - debug = { - end_report = false; - verbose_stamps = false; - gtk_stdout = false; - }; -} diff --git a/foreign/dotfiles/modules/howdy/default.nix b/foreign/dotfiles/modules/howdy/default.nix deleted file mode 100644 index 95506b2..0000000 --- a/foreign/dotfiles/modules/howdy/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; let - cfg = config.services.howdy; - settingsType = pkgs.formats.ini {}; -in { - options = { - services.howdy = { - enable = - mkEnableOption (mdDoc "") - // { - description = mdDoc '' - Howdy and PAM module for face recognition. See - `services.linux-enable-ir-emitter` for enabling the IR emitter support. - ''; - }; - - package = mkPackageOptionMD pkgs "howdy" {}; - - settings = mkOption { - inherit (settingsType) type; - default = import ./config.nix; - description = mdDoc '' - Howdy configuration file. Refer to - - for options. - ''; - }; - }; - }; - - config = mkMerge [ - (mkIf cfg.enable { - environment.systemPackages = [cfg.package]; - environment.etc."howdy/config.ini".source = settingsType.generate "howdy-config.ini" cfg.settings; - }) - { - services.howdy.settings = mapAttrsRecursive (name: mkDefault) (import ./config.nix); - } - ]; -} diff --git a/foreign/dotfiles/modules/linux-enable-ir-emitter.nix b/foreign/dotfiles/modules/linux-enable-ir-emitter.nix deleted file mode 100644 index 1d8c48b..0000000 --- a/foreign/dotfiles/modules/linux-enable-ir-emitter.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ - config, - lib, - inputs, - pkgs, - ... -}: -with lib; let - cfg = config.services.linux-enable-ir-emitter; -in { - options = { - services.linux-enable-ir-emitter = { - enable = mkEnableOption { - description = '' - Linux Enable IR Emitter. - ''; - }; - - package = mkOption { - type = types.package; - default = pkgs.linux-enable-ir-emitter or inputs.self.packages.${pkgs.system}.linux-enable-ir-emitter; - defaultText = "pkgs.linux-enable-ir-emitter"; - description = '' - Package to use for the Linux Enable IR Emitter service. - ''; - }; - - device = mkOption { - type = types.lines; - default = "video2"; - defaultText = "video2"; - description = '' - Emitter device to depend on. Find this with the command - {command}`realpath /dev/v4l/by-path/`. - ''; - }; - }; - }; - config = mkIf cfg.enable { - environment.systemPackages = [cfg.package]; - - systemd.services.linux-enable-ir-emitter = let - targets = [ - "multi-user.target" - "suspend.target" - "hybrid-sleep.target" - "hibernate.target" - "suspend-then-hibernate.target" - ]; - in { - description = "Enable the infrared emitter."; - - script = "${lib.getExe cfg.package} run"; - - wantedBy = targets; - after = targets ++ ["dev-${cfg.device}.device"]; - }; - - systemd.tmpfiles.rules = [ - "d /var/lib/linux-enable-ir-emitter 0755 root root - -" - ]; - environment.etc."linux-enable-ir-emitter".source = "/var/lib/linux-enable-ir-emitter"; - }; -} diff --git a/foreign/dotfiles/modules/main.kbd b/foreign/dotfiles/modules/main.kbd deleted file mode 100644 index 7c80c79..0000000 --- a/foreign/dotfiles/modules/main.kbd +++ /dev/null @@ -1,49 +0,0 @@ -(defsrc - grv 1 2 3 4 5 6 7 8 9 0 - = bspc - tab q w e r t y u i o p [ ] \ - caps a s d f g h j k l ; ' ret - lsft z x c v b n m , . / rsft - lctl lmet lalt spc ralt rmet cmp rctl -) - -(deflayer colemak - grv 1 2 3 4 5 6 7 8 9 0 - = bspc - tab q w f p b j l u y ; [ ] \ - @esc a r s t g m n e i o ' ret - lsft x c d v z k h , . / rsft - @lay lmet lalt @spc ralt rmet cmp rctl -) - -(deflayer qwerty - grv 1 2 3 4 5 6 7 8 9 0 - = bspc - tab q w e r t y u i o p [ ] \ - @cps a s d f g h j k l ; ' ret - lsft z x c v b n m , . / rsft - lctl lmet lalt spc ralt rmet cmp rctl -) - -(deflayer layouts - _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ - caps _ _ _ @cmk _ _ @qwe _ _ _ _ _ - _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ _ -) - -(deflayer symbols - _ f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del - _ _ _ _ _ _ ins _ up _ pgup home prnt _ - _ _ _ _ _ _ _ left down rght pgdn end _ - _ _ _ _ _ _ _ mute vold volu _ _ - pp _ prev _ next _ _ _ -) - -(defalias - lay (layer-toggle layouts) - cmk (layer-switch colemak) - qwe (layer-switch qwerty) - sym (layer-toggle symbols) - esc (tap-next-release esc lctl) - spc (tap-next-release spc @sym) - cps (tap-next-release caps @lay) -) diff --git a/foreign/dotfiles/modules/minimal.nix b/foreign/dotfiles/modules/minimal.nix deleted file mode 100644 index 6d3704b..0000000 --- a/foreign/dotfiles/modules/minimal.nix +++ /dev/null @@ -1,97 +0,0 @@ -{ - pkgs, - config, - lib, - inputs, - ... -}: -# configuration shared by all hosts -{ - # enable zsh autocompletion for system packages (systemd, etc) - environment.pathsToLink = ["/share/zsh"]; - - i18n = { - defaultLocale = "en_US.UTF-8"; - # saves space - supportedLocales = ["en_US.UTF-8/UTF-8" "ja_JP.UTF-8/UTF-8" "ro_RO.UTF-8/UTF-8"]; - }; - - # graphics drivers / HW accel - hardware.opengl.enable = true; - - networking = { - # required to connect to Tailscale exit nodes - firewall.checkReversePath = "loose"; - - networkmanager = { - enable = true; - dns = "systemd-resolved"; - wifi.powersave = true; - }; - }; - - # pickup pkgs from flake export - nixpkgs.pkgs = inputs.self.legacyPackages.${config.nixpkgs.system}; - - # enable programs - programs = { - less.enable = true; - - zsh = { - enable = true; - autosuggestions.enable = true; - syntaxHighlighting = { - enable = true; - patterns = {"rm -rf *" = "fg=white,bg=red";}; - styles = {"alias" = "fg=magenta";}; - highlighters = ["main" "brackets" "pattern"]; - }; - }; - }; - - # don't ask for password for wheel group - security.sudo.wheelNeedsPassword = false; - - services = { - # network discovery, mDNS - avahi = { - enable = true; - nssmdns = true; - publish.enable = true; - publish.domain = true; - publish.userServices = true; - }; - - openssh = { - enable = true; - settings.UseDns = true; - }; - - # DNS resolver - resolved.enable = true; - - # inter-machine VPN - tailscale.enable = true; - }; - - # don't touch this - system.stateVersion = lib.mkDefault "20.09"; - - # Don't wait for network startup - # https://old.reddit.com/r/NixOS/comments/vdz86j/how_to_remove_boot_dependency_on_network_for_a - systemd = { - targets.network-online.wantedBy = pkgs.lib.mkForce []; # Normally ["multi-user.target"] - services.NetworkManager-wait-online.wantedBy = pkgs.lib.mkForce []; # Normally ["network-online.target"] - }; - - time.timeZone = lib.mkDefault "Europe/Bucharest"; - - users.users.mihai = { - isNormalUser = true; - shell = pkgs.zsh; - extraGroups = ["adbusers" "input" "libvirtd" "networkmanager" "plugdev" "transmission" "video" "wheel"]; - }; - - # compresses half the ram for use as swap - zramSwap.enable = true; -} diff --git a/foreign/dotfiles/modules/nix.nix b/foreign/dotfiles/modules/nix.nix deleted file mode 100644 index 4c1a78f..0000000 --- a/foreign/dotfiles/modules/nix.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ - config, - pkgs, - inputs, - lib, - ... -}: { - # we need git for flakes - environment.systemPackages = [pkgs.git]; - - nix = { - # extra builders to offload work onto - # don't set a machine as a builder to itself (throws warnings) - buildMachines = lib.filter (x: x.hostName != config.networking.hostName) [ - { - system = "aarch64-linux"; - sshUser = "root"; - sshKey = "/etc/ssh/ssh_host_ed25519_key"; - maxJobs = 4; - hostName = "arm-server"; - supportedFeatures = ["nixos-test" "benchmark" "kvm" "big-parallel"]; - } - { - system = "x86_64-linux"; - sshUser = "root"; - sshKey = "/root/.ssh/id_ed25519"; - maxJobs = 8; - hostName = "io"; - supportedFeatures = ["nixos-test" "benchmark" "kvm" "big-parallel"]; - } - ]; - distributedBuilds = true; - - # auto garbage collect - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; - }; - - # pin the registry to avoid downloading and evaling a new nixpkgs version every time - registry = lib.mapAttrs (_: v: {flake = v;}) inputs; - - # set the path for channels compat - nixPath = lib.mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry; - - settings = { - auto-optimise-store = true; - builders-use-substitutes = true; - experimental-features = ["nix-command" "flakes"]; - flake-registry = "/etc/nix/registry.json"; - - # for direnv GC roots - keep-derivations = true; - keep-outputs = true; - - substituters = [ - "https://nix-community.cachix.org" - "https://helix.cachix.org" - "https://fufexan.cachix.org" - ]; - trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" - "fufexan.cachix.org-1:LwCDjCJNJQf5XD2BV+yamQIMZfcKWR9ISIFy5curUsY=" - ]; - - trusted-users = ["root" "@wheel"]; - }; - }; -} diff --git a/foreign/dotfiles/modules/pam.nix b/foreign/dotfiles/modules/pam.nix deleted file mode 100644 index 591e7ca..0000000 --- a/foreign/dotfiles/modules/pam.nix +++ /dev/null @@ -1,1445 +0,0 @@ -# This module provides configuration for the PAM (Pluggable -# Authentication Modules) system. -{ - config, - lib, - pkgs, - ... -}: -with lib; let - parentConfig = config; - - pamOpts = { - config, - name, - ... - }: let - cfg = config; - in let - config = parentConfig; - in { - options = { - name = mkOption { - example = "sshd"; - type = types.str; - description = lib.mdDoc "Name of the PAM service."; - }; - - unixAuth = mkOption { - default = true; - type = types.bool; - description = lib.mdDoc '' - Whether users can log in with passwords defined in - {file}`/etc/shadow`. - ''; - }; - - rootOK = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - If set, root doesn't need to authenticate (e.g. for the - {command}`useradd` service). - ''; - }; - - p11Auth = mkOption { - default = config.security.pam.p11.enable; - defaultText = literalExpression "config.security.pam.p11.enable"; - type = types.bool; - description = lib.mdDoc '' - If set, keys listed in - {file}`~/.ssh/authorized_keys` and - {file}`~/.eid/authorized_certificates` - can be used to log in with the associated PKCS#11 tokens. - ''; - }; - - u2fAuth = mkOption { - default = config.security.pam.u2f.enable; - defaultText = literalExpression "config.security.pam.u2f.enable"; - type = types.bool; - description = lib.mdDoc '' - If set, users listed in - {file}`$XDG_CONFIG_HOME/Yubico/u2f_keys` (or - {file}`$HOME/.config/Yubico/u2f_keys` if XDG variable is - not set) are able to log in with the associated U2F key. Path can be - changed using {option}`security.pam.u2f.authFile` option. - ''; - }; - - usshAuth = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - If set, users with an SSH certificate containing an authorized principal - in their SSH agent are able to log in. Specific options are controlled - using the {option}`security.pam.ussh` options. - - Note that the {option}`security.pam.ussh.enable` must also be - set for this option to take effect. - ''; - }; - - yubicoAuth = mkOption { - default = config.security.pam.yubico.enable; - defaultText = literalExpression "config.security.pam.yubico.enable"; - type = types.bool; - description = lib.mdDoc '' - If set, users listed in - {file}`~/.yubico/authorized_yubikeys` - are able to log in with the associated Yubikey tokens. - ''; - }; - - googleAuthenticator = { - enable = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - If set, users with enabled Google Authenticator (created - {file}`~/.google_authenticator`) will be required - to provide Google Authenticator token to log in. - ''; - }; - }; - - usbAuth = mkOption { - default = config.security.pam.usb.enable; - defaultText = literalExpression "config.security.pam.usb.enable"; - type = types.bool; - description = lib.mdDoc '' - If set, users listed in - {file}`/etc/pamusb.conf` are able to log in - with the associated USB key. - ''; - }; - - otpwAuth = mkOption { - default = config.security.pam.enableOTPW; - defaultText = literalExpression "config.security.pam.enableOTPW"; - type = types.bool; - description = lib.mdDoc '' - If set, the OTPW system will be used (if - {file}`~/.otpw` exists). - ''; - }; - - googleOsLoginAccountVerification = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - If set, will use the Google OS Login PAM modules - (`pam_oslogin_login`, - `pam_oslogin_admin`) to verify possible OS Login - users and set sudoers configuration accordingly. - This only makes sense to enable for the `sshd` PAM - service. - ''; - }; - - googleOsLoginAuthentication = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - If set, will use the `pam_oslogin_login`'s user - authentication methods to authenticate users using 2FA. - This only makes sense to enable for the `sshd` PAM - service. - ''; - }; - - mysqlAuth = mkOption { - default = config.users.mysql.enable; - defaultText = literalExpression "config.users.mysql.enable"; - type = types.bool; - description = lib.mdDoc '' - If set, the `pam_mysql` module will be used to - authenticate users against a MySQL/MariaDB database. - ''; - }; - - fprintAuth = mkOption { - default = config.services.fprintd.enable; - defaultText = literalExpression "config.services.fprintd.enable"; - type = types.bool; - description = lib.mdDoc '' - If set, fingerprint reader will be used (if exists and - your fingerprints are enrolled). - ''; - }; - - howdyAuth = mkOption { - default = config.services.howdy.enable; - defaultText = literalExpression "config.services.howdy.enable"; - type = types.bool; - description = lib.mdDoc '' - If set, IR camera will be used (if exists and your - facial models are enrolled). - ''; - }; - - oathAuth = mkOption { - default = config.security.pam.oath.enable; - defaultText = literalExpression "config.security.pam.oath.enable"; - type = types.bool; - description = lib.mdDoc '' - If set, the OATH Toolkit will be used. - ''; - }; - - sshAgentAuth = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - If set, the calling user's SSH agent is used to authenticate - against the keys in the calling user's - {file}`~/.ssh/authorized_keys`. This is useful - for {command}`sudo` on password-less remote systems. - ''; - }; - - duoSecurity = { - enable = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - If set, use the Duo Security pam module - `pam_duo` for authentication. Requires - configuration of {option}`security.duosec` options. - ''; - }; - }; - - startSession = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - If set, the service will register a new session with - systemd's login manager. For local sessions, this will give - the user access to audio devices, CD-ROM drives. In the - default PolicyKit configuration, it also allows the user to - reboot the system. - ''; - }; - - setEnvironment = mkOption { - type = types.bool; - default = true; - description = lib.mdDoc '' - Whether the service should set the environment variables - listed in {option}`environment.sessionVariables` - using `pam_env.so`. - ''; - }; - - setLoginUid = mkOption { - type = types.bool; - description = lib.mdDoc '' - Set the login uid of the process - ({file}`/proc/self/loginuid`) for auditing - purposes. The login uid is only set by ‘entry points’ like - {command}`login` and {command}`sshd`, not by - commands like {command}`sudo`. - ''; - }; - - ttyAudit = { - enable = mkOption { - type = types.bool; - default = false; - description = lib.mdDoc '' - Enable or disable TTY auditing for specified users - ''; - }; - - enablePattern = mkOption { - type = types.nullOr types.str; - default = null; - description = lib.mdDoc '' - For each user matching one of comma-separated - glob patterns, enable TTY auditing - ''; - }; - - disablePattern = mkOption { - type = types.nullOr types.str; - default = null; - description = lib.mdDoc '' - For each user matching one of comma-separated - glob patterns, disable TTY auditing - ''; - }; - - openOnly = mkOption { - type = types.bool; - default = false; - description = lib.mdDoc '' - Set the TTY audit flag when opening the session, - but do not restore it when closing the session. - Using this option is necessary for some services - that don't fork() to run the authenticated session, - such as sudo. - ''; - }; - }; - - forwardXAuth = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - Whether X authentication keys should be passed from the - calling user to the target user (e.g. for - {command}`su`) - ''; - }; - - pamMount = mkOption { - default = config.security.pam.mount.enable; - defaultText = literalExpression "config.security.pam.mount.enable"; - type = types.bool; - description = lib.mdDoc '' - Enable PAM mount (pam_mount) system to mount filesystems on user login. - ''; - }; - - allowNullPassword = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - Whether to allow logging into accounts that have no password - set (i.e., have an empty password field in - {file}`/etc/passwd` or - {file}`/etc/group`). This does not enable - logging into disabled accounts (i.e., that have the password - field set to `!`). Note that regardless of - what the pam_unix documentation says, accounts with hashed - empty passwords are always allowed to log in. - ''; - }; - - nodelay = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - Whether the delay after typing a wrong password should be disabled. - ''; - }; - - requireWheel = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - Whether to permit root access only to members of group wheel. - ''; - }; - - limits = mkOption { - default = []; - type = limitsType; - description = lib.mdDoc '' - Attribute set describing resource limits. Defaults to the - value of {option}`security.pam.loginLimits`. - The meaning of the values is explained in {manpage}`limits.conf(5)`. - ''; - }; - - showMotd = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc "Whether to show the message of the day."; - }; - - makeHomeDir = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - Whether to try to create home directories for users - with `$HOME`s pointing to nonexistent - locations on session login. - ''; - }; - - updateWtmp = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc "Whether to update {file}`/var/log/wtmp`."; - }; - - logFailures = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc "Whether to log authentication failures in {file}`/var/log/faillog`."; - }; - - enableAppArmor = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - Enable support for attaching AppArmor profiles at the - user/group level, e.g., as part of a role based access - control scheme. - ''; - }; - - enableKwallet = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - If enabled, pam_wallet will attempt to automatically unlock the - user's default KDE wallet upon login. If the user has no wallet named - "kdewallet", or the login password does not match their wallet - password, KDE will prompt separately after login. - ''; - }; - sssdStrictAccess = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc "enforce sssd access control"; - }; - - enableGnomeKeyring = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - If enabled, pam_gnome_keyring will attempt to automatically unlock the - user's default Gnome keyring upon login. If the user login password does - not match their keyring password, Gnome Keyring will prompt separately - after login. - ''; - }; - - failDelay = { - enable = mkOption { - type = types.bool; - default = false; - description = lib.mdDoc '' - If enabled, this will replace the `FAIL_DELAY` setting from `login.defs`. - Change the delay on failure per-application. - ''; - }; - - delay = mkOption { - default = 3000000; - type = types.int; - example = 1000000; - description = lib.mdDoc "The delay time (in microseconds) on failure."; - }; - }; - - gnupg = { - enable = mkOption { - type = types.bool; - default = false; - description = lib.mdDoc '' - If enabled, pam_gnupg will attempt to automatically unlock the - user's GPG keys with the login password via - {command}`gpg-agent`. The keygrips of all keys to be - unlocked should be written to {file}`~/.pam-gnupg`, - and can be queried with {command}`gpg -K --with-keygrip`. - Presetting passphrases must be enabled by adding - `allow-preset-passphrase` in - {file}`~/.gnupg/gpg-agent.conf`. - ''; - }; - - noAutostart = mkOption { - type = types.bool; - default = false; - description = lib.mdDoc '' - Don't start {command}`gpg-agent` if it is not running. - Useful in conjunction with starting {command}`gpg-agent` as - a systemd user service. - ''; - }; - - storeOnly = mkOption { - type = types.bool; - default = false; - description = lib.mdDoc '' - Don't send the password immediately after login, but store for PAM - `session`. - ''; - }; - }; - - text = mkOption { - type = types.nullOr types.lines; - description = lib.mdDoc "Contents of the PAM service file."; - }; - }; - - # The resulting /etc/pam.d/* file contents are verified in - # nixos/tests/pam/pam-file-contents.nix. Please update tests there when - # changing the derivation. - config = { - name = mkDefault name; - setLoginUid = mkDefault cfg.startSession; - limits = mkDefault config.security.pam.loginLimits; - - # !!! TODO: move the LDAP stuff to the LDAP module, and the - # Samba stuff to the Samba module. This requires that the PAM - # module provides the right hooks. - text = - mkDefault - ( - '' - # Account management. - '' - + optionalString use_ldap '' - account sufficient ${pam_ldap}/lib/security/pam_ldap.so - '' - + optionalString cfg.mysqlAuth '' - account sufficient ${pkgs.pam_mysql}/lib/security/pam_mysql.so config_file=/etc/security/pam_mysql.conf - '' - + optionalString (config.services.sssd.enable && cfg.sssdStrictAccess == false) '' - account sufficient ${pkgs.sssd}/lib/security/pam_sss.so - '' - + optionalString (config.services.sssd.enable && cfg.sssdStrictAccess) '' - account [default=bad success=ok user_unknown=ignore] ${pkgs.sssd}/lib/security/pam_sss.so - '' - + optionalString config.security.pam.krb5.enable '' - account sufficient ${pam_krb5}/lib/security/pam_krb5.so - '' - + optionalString cfg.googleOsLoginAccountVerification '' - account [success=ok ignore=ignore default=die] ${pkgs.google-guest-oslogin}/lib/security/pam_oslogin_login.so - account [success=ok default=ignore] ${pkgs.google-guest-oslogin}/lib/security/pam_oslogin_admin.so - '' - + optionalString config.services.homed.enable '' - account sufficient ${config.systemd.package}/lib/security/pam_systemd_home.so - '' - + - # The required pam_unix.so module has to come after all the sufficient modules - # because otherwise, the account lookup will fail if the user does not exist - # locally, for example with MySQL- or LDAP-auth. - '' - account required pam_unix.so - - # Authentication management. - '' - + optionalString cfg.googleOsLoginAuthentication '' - auth [success=done perm_denied=die default=ignore] ${pkgs.google-guest-oslogin}/lib/security/pam_oslogin_login.so - '' - + optionalString cfg.rootOK '' - auth sufficient pam_rootok.so - '' - + optionalString cfg.requireWheel '' - auth required pam_wheel.so use_uid - '' - + optionalString cfg.logFailures '' - auth required pam_faillock.so - '' - + optionalString cfg.mysqlAuth '' - auth sufficient ${pkgs.pam_mysql}/lib/security/pam_mysql.so config_file=/etc/security/pam_mysql.conf - '' - + optionalString (config.security.pam.enableSSHAgentAuth && cfg.sshAgentAuth) '' - auth sufficient ${pkgs.pam_ssh_agent_auth}/libexec/pam_ssh_agent_auth.so file=${lib.concatStringsSep ":" config.services.openssh.authorizedKeysFiles} - '' - + (let - p11 = config.security.pam.p11; - in - optionalString cfg.p11Auth '' - auth ${p11.control} ${pkgs.pam_p11}/lib/security/pam_p11.so ${pkgs.opensc}/lib/opensc-pkcs11.so - '') - + (let - u2f = config.security.pam.u2f; - in - optionalString cfg.u2fAuth ('' - auth ${u2f.control} ${pkgs.pam_u2f}/lib/security/pam_u2f.so ${optionalString u2f.debug "debug"} ${optionalString (u2f.authFile != null) "authfile=${u2f.authFile}"} '' - + '' ${optionalString u2f.interactive "interactive"} ${optionalString u2f.cue "cue"} ${optionalString (u2f.appId != null) "appid=${u2f.appId}"} ${optionalString (u2f.origin != null) "origin=${u2f.origin}"} - '')) - + optionalString cfg.usbAuth '' - auth sufficient ${pkgs.pam_usb}/lib/security/pam_usb.so - '' - + (let - ussh = config.security.pam.ussh; - in - optionalString (config.security.pam.ussh.enable && cfg.usshAuth) '' - auth ${ussh.control} ${pkgs.pam_ussh}/lib/security/pam_ussh.so ${optionalString (ussh.caFile != null) "ca_file=${ussh.caFile}"} ${optionalString (ussh.authorizedPrincipals != null) "authorized_principals=${ussh.authorizedPrincipals}"} ${optionalString (ussh.authorizedPrincipalsFile != null) "authorized_principals_file=${ussh.authorizedPrincipalsFile}"} ${optionalString (ussh.group != null) "group=${ussh.group}"} - '') - + (let - oath = config.security.pam.oath; - in - optionalString cfg.oathAuth '' - auth requisite ${pkgs.oath-toolkit}/lib/security/pam_oath.so window=${toString oath.window} usersfile=${toString oath.usersFile} digits=${toString oath.digits} - '') - + (let - yubi = config.security.pam.yubico; - in - optionalString cfg.yubicoAuth '' - auth ${yubi.control} ${pkgs.yubico-pam}/lib/security/pam_yubico.so mode=${toString yubi.mode} ${optionalString (yubi.challengeResponsePath != null) "chalresp_path=${yubi.challengeResponsePath}"} ${optionalString (yubi.mode == "client") "id=${toString yubi.id}"} ${optionalString yubi.debug "debug"} - '') - + optionalString cfg.fprintAuth '' - auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so - '' - + optionalString cfg.howdyAuth '' - auth sufficient ${config.services.howdy.package}/lib/security/pam_howdy.so - '' - + - # Modules in this block require having the password set in PAM_AUTHTOK. - # pam_unix is marked as 'sufficient' on NixOS which means nothing will run - # after it succeeds. Certain modules need to run after pam_unix - # prompts the user for password so we run it once with 'optional' at an - # earlier point and it will run again with 'sufficient' further down. - # We use try_first_pass the second time to avoid prompting password twice. - # - # The same principle applies to systemd-homed - (optionalString ((cfg.unixAuth || config.services.homed.enable) - && (config.security.pam.enableEcryptfs - || config.security.pam.enableFscrypt - || cfg.pamMount - || cfg.enableKwallet - || cfg.enableGnomeKeyring - || cfg.googleAuthenticator.enable - || cfg.gnupg.enable - || cfg.failDelay.enable - || cfg.duoSecurity.enable)) - ( - optionalString config.services.homed.enable '' - auth optional ${config.systemd.package}/lib/security/pam_systemd_home.so - '' - + optionalString cfg.unixAuth '' - auth optional pam_unix.so ${optionalString cfg.allowNullPassword "nullok"} ${optionalString cfg.nodelay "nodelay"} likeauth - '' - + optionalString config.security.pam.enableEcryptfs '' - auth optional ${pkgs.ecryptfs}/lib/security/pam_ecryptfs.so unwrap - '' - + optionalString config.security.pam.enableFscrypt '' - auth optional ${pkgs.fscrypt-experimental}/lib/security/pam_fscrypt.so - '' - + optionalString cfg.pamMount '' - auth optional ${pkgs.pam_mount}/lib/security/pam_mount.so disable_interactive - '' - + optionalString cfg.enableKwallet '' - auth optional ${pkgs.plasma5Packages.kwallet-pam}/lib/security/pam_kwallet5.so kwalletd=${pkgs.plasma5Packages.kwallet.bin}/bin/kwalletd5 - '' - + optionalString cfg.enableGnomeKeyring '' - auth optional ${pkgs.gnome.gnome-keyring}/lib/security/pam_gnome_keyring.so - '' - + optionalString cfg.gnupg.enable '' - auth optional ${pkgs.pam_gnupg}/lib/security/pam_gnupg.so ${optionalString cfg.gnupg.storeOnly " store-only"} - '' - + optionalString cfg.failDelay.enable '' - auth optional ${pkgs.pam}/lib/security/pam_faildelay.so delay=${toString cfg.failDelay.delay} - '' - + optionalString cfg.googleAuthenticator.enable '' - auth required ${pkgs.google-authenticator}/lib/security/pam_google_authenticator.so no_increment_hotp - '' - + optionalString cfg.duoSecurity.enable '' - auth required ${pkgs.duo-unix}/lib/security/pam_duo.so - '' - )) - + optionalString config.services.homed.enable '' - auth sufficient ${config.systemd.package}/lib/security/pam_systemd_home.so - '' - + optionalString cfg.unixAuth '' - auth sufficient pam_unix.so ${optionalString cfg.allowNullPassword "nullok"} ${optionalString cfg.nodelay "nodelay"} likeauth try_first_pass - '' - + optionalString cfg.otpwAuth '' - auth sufficient ${pkgs.otpw}/lib/security/pam_otpw.so - '' - + optionalString use_ldap '' - auth sufficient ${pam_ldap}/lib/security/pam_ldap.so use_first_pass - '' - + optionalString config.services.sssd.enable '' - auth sufficient ${pkgs.sssd}/lib/security/pam_sss.so use_first_pass - '' - + optionalString config.security.pam.krb5.enable '' - auth [default=ignore success=1 service_err=reset] ${pam_krb5}/lib/security/pam_krb5.so use_first_pass - auth [default=die success=done] ${pam_ccreds}/lib/security/pam_ccreds.so action=validate use_first_pass - auth sufficient ${pam_ccreds}/lib/security/pam_ccreds.so action=store use_first_pass - '' - + '' - auth required pam_deny.so - - # Password management. - '' - + optionalString config.services.homed.enable '' - password sufficient ${config.systemd.package}/lib/security/pam_systemd_home.so - '' - + '' - password sufficient pam_unix.so nullok sha512 - '' - + optionalString config.security.pam.enableEcryptfs '' - password optional ${pkgs.ecryptfs}/lib/security/pam_ecryptfs.so - '' - + optionalString config.security.pam.enableFscrypt '' - password optional ${pkgs.fscrypt-experimental}/lib/security/pam_fscrypt.so - '' - + optionalString cfg.pamMount '' - password optional ${pkgs.pam_mount}/lib/security/pam_mount.so - '' - + optionalString use_ldap '' - password sufficient ${pam_ldap}/lib/security/pam_ldap.so - '' - + optionalString cfg.mysqlAuth '' - password sufficient ${pkgs.pam_mysql}/lib/security/pam_mysql.so config_file=/etc/security/pam_mysql.conf - '' - + optionalString config.services.sssd.enable '' - password sufficient ${pkgs.sssd}/lib/security/pam_sss.so use_authtok - '' - + optionalString config.security.pam.krb5.enable '' - password sufficient ${pam_krb5}/lib/security/pam_krb5.so use_first_pass - '' - + optionalString cfg.enableGnomeKeyring '' - password optional ${pkgs.gnome.gnome-keyring}/lib/security/pam_gnome_keyring.so use_authtok - '' - + '' - - # Session management. - '' - + optionalString cfg.setEnvironment '' - session required pam_env.so conffile=/etc/pam/environment readenv=0 - '' - + '' - session required pam_unix.so - '' - + optionalString cfg.setLoginUid '' - session ${ - if config.boot.isContainer - then "optional" - else "required" - } pam_loginuid.so - '' - + optionalString cfg.ttyAudit.enable (concatStringsSep " \\\n " ( - [ - "session required ${pkgs.pam}/lib/security/pam_tty_audit.so" - ] - ++ optional cfg.ttyAudit.openOnly "open_only" - ++ optional (cfg.ttyAudit.enablePattern != null) "enable=${cfg.ttyAudit.enablePattern}" - ++ optional (cfg.ttyAudit.disablePattern != null) "disable=${cfg.ttyAudit.disablePattern}" - )) - + optionalString config.services.homed.enable '' - session required ${config.systemd.package}/lib/security/pam_systemd_home.so - '' - + optionalString cfg.makeHomeDir '' - session required ${pkgs.pam}/lib/security/pam_mkhomedir.so silent skel=${config.security.pam.makeHomeDir.skelDirectory} umask=0077 - '' - + optionalString cfg.updateWtmp '' - session required ${pkgs.pam}/lib/security/pam_lastlog.so silent - '' - + optionalString config.security.pam.enableEcryptfs '' - session optional ${pkgs.ecryptfs}/lib/security/pam_ecryptfs.so - '' - + optionalString config.security.pam.enableFscrypt '' - # Work around https://github.com/systemd/systemd/issues/8598 - # Skips the pam_fscrypt module for systemd-user sessions which do not have a password - # anyways. - # See also https://github.com/google/fscrypt/issues/95 - session [success=1 default=ignore] pam_succeed_if.so service = systemd-user - session optional ${pkgs.fscrypt-experimental}/lib/security/pam_fscrypt.so - '' - + optionalString cfg.pamMount '' - session optional ${pkgs.pam_mount}/lib/security/pam_mount.so disable_interactive - '' - + optionalString use_ldap '' - session optional ${pam_ldap}/lib/security/pam_ldap.so - '' - + optionalString cfg.mysqlAuth '' - session optional ${pkgs.pam_mysql}/lib/security/pam_mysql.so config_file=/etc/security/pam_mysql.conf - '' - + optionalString config.services.sssd.enable '' - session optional ${pkgs.sssd}/lib/security/pam_sss.so - '' - + optionalString config.security.pam.krb5.enable '' - session optional ${pam_krb5}/lib/security/pam_krb5.so - '' - + optionalString cfg.otpwAuth '' - session optional ${pkgs.otpw}/lib/security/pam_otpw.so - '' - + optionalString cfg.startSession '' - session optional ${config.systemd.package}/lib/security/pam_systemd.so - '' - + optionalString cfg.forwardXAuth '' - session optional pam_xauth.so xauthpath=${pkgs.xorg.xauth}/bin/xauth systemuser=99 - '' - + optionalString (cfg.limits != []) '' - session required ${pkgs.pam}/lib/security/pam_limits.so conf=${makeLimitsConf cfg.limits} - '' - + optionalString (cfg.showMotd && (config.users.motd != null || config.users.motdFile != null)) '' - session optional ${pkgs.pam}/lib/security/pam_motd.so motd=${motd} - '' - + optionalString (cfg.enableAppArmor && config.security.apparmor.enable) '' - session optional ${pkgs.apparmor-pam}/lib/security/pam_apparmor.so order=user,group,default debug - '' - + optionalString (cfg.enableKwallet) '' - session optional ${pkgs.plasma5Packages.kwallet-pam}/lib/security/pam_kwallet5.so kwalletd=${pkgs.plasma5Packages.kwallet.bin}/bin/kwalletd5 - '' - + optionalString (cfg.enableGnomeKeyring) '' - session optional ${pkgs.gnome.gnome-keyring}/lib/security/pam_gnome_keyring.so auto_start - '' - + optionalString cfg.gnupg.enable '' - session optional ${pkgs.pam_gnupg}/lib/security/pam_gnupg.so ${optionalString cfg.gnupg.noAutostart " no-autostart"} - '' - + optionalString (config.virtualisation.lxc.lxcfs.enable) '' - session optional ${pkgs.lxc}/lib/security/pam_cgfs.so -c all - '' - ); - }; - }; - - inherit (pkgs) pam_krb5 pam_ccreds; - - use_ldap = config.users.ldap.enable && config.users.ldap.loginPam; - pam_ldap = - if config.users.ldap.daemon.enable - then pkgs.nss_pam_ldapd - else pkgs.pam_ldap; - - # Create a limits.conf(5) file. - makeLimitsConf = limits: - pkgs.writeText "limits.conf" - (concatMapStrings ({ - domain, - type, - item, - value, - }: "${domain} ${type} ${item} ${toString value}\n") - limits); - - limitsType = with lib.types; - listOf (submodule ({...}: { - options = { - domain = mkOption { - description = lib.mdDoc "Username, groupname, or wildcard this limit applies to"; - example = "@wheel"; - type = str; - }; - - type = mkOption { - description = lib.mdDoc "Type of this limit"; - type = enum ["-" "hard" "soft"]; - default = "-"; - }; - - item = mkOption { - description = lib.mdDoc "Item this limit applies to"; - type = enum [ - "core" - "data" - "fsize" - "memlock" - "nofile" - "rss" - "stack" - "cpu" - "nproc" - "as" - "maxlogins" - "maxsyslogins" - "priority" - "locks" - "sigpending" - "msgqueue" - "nice" - "rtprio" - ]; - }; - - value = mkOption { - description = lib.mdDoc "Value of this limit"; - type = oneOf [str int]; - }; - }; - })); - - motd = - if isNull config.users.motdFile - then pkgs.writeText "motd" config.users.motd - else config.users.motdFile; - - makePAMService = name: service: { - name = "pam.d/${name}"; - value.source = pkgs.writeText "${name}.pam" service.text; - }; -in { - imports = [ - (mkRenamedOptionModule ["security" "pam" "enableU2F"] ["security" "pam" "u2f" "enable"]) - ]; - - ###### interface - - options = { - security.pam.loginLimits = mkOption { - default = []; - type = limitsType; - example = [ - { - domain = "ftp"; - type = "hard"; - item = "nproc"; - value = "0"; - } - { - domain = "@student"; - type = "-"; - item = "maxlogins"; - value = "4"; - } - ]; - - description = lib.mdDoc '' - Define resource limits that should apply to users or groups. - Each item in the list should be an attribute set with a - {var}`domain`, {var}`type`, - {var}`item`, and {var}`value` - attribute. The syntax and semantics of these attributes - must be that described in {manpage}`limits.conf(5)`. - - Note that these limits do not apply to systemd services, - whose limits can be changed via {option}`systemd.extraConfig` - instead. - ''; - }; - - security.pam.services = mkOption { - default = {}; - type = with types; attrsOf (submodule pamOpts); - description = lib.mdDoc '' - This option defines the PAM services. A service typically - corresponds to a program that uses PAM, - e.g. {command}`login` or {command}`passwd`. - Each attribute of this set defines a PAM service, with the attribute name - defining the name of the service. - ''; - }; - - security.pam.makeHomeDir.skelDirectory = mkOption { - type = types.str; - default = "/var/empty"; - example = "/etc/skel"; - description = lib.mdDoc '' - Path to skeleton directory whose contents are copied to home - directories newly created by `pam_mkhomedir`. - ''; - }; - - security.pam.enableSSHAgentAuth = mkOption { - type = types.bool; - default = false; - description = lib.mdDoc '' - Enable sudo logins if the user's SSH agent provides a key - present in {file}`~/.ssh/authorized_keys`. - This allows machines to exclusively use SSH keys instead of - passwords. - ''; - }; - - security.pam.enableOTPW = mkEnableOption (lib.mdDoc "the OTPW (one-time password) PAM module"); - - security.pam.krb5 = { - enable = mkOption { - default = config.krb5.enable; - defaultText = literalExpression "config.krb5.enable"; - type = types.bool; - description = lib.mdDoc '' - Enables Kerberos PAM modules (`pam-krb5`, - `pam-ccreds`). - - If set, users can authenticate with their Kerberos password. - This requires a valid Kerberos configuration - (`config.krb5.enable` should be set to - `true`). - - Note that the Kerberos PAM modules are not necessary when using SSS - to handle Kerberos authentication. - ''; - }; - }; - - security.pam.p11 = { - enable = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - Enables P11 PAM (`pam_p11`) module. - - If set, users can log in with SSH keys and PKCS#11 tokens. - - More information can be found [here](https://github.com/OpenSC/pam_p11). - ''; - }; - - control = mkOption { - default = "sufficient"; - type = types.enum ["required" "requisite" "sufficient" "optional"]; - description = lib.mdDoc '' - This option sets pam "control". - If you want to have multi factor authentication, use "required". - If you want to use the PKCS#11 device instead of the regular password, - use "sufficient". - - Read - {manpage}`pam.conf(5)` - for better understanding of this option. - ''; - }; - }; - - security.pam.u2f = { - enable = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - Enables U2F PAM (`pam-u2f`) module. - - If set, users listed in - {file}`$XDG_CONFIG_HOME/Yubico/u2f_keys` (or - {file}`$HOME/.config/Yubico/u2f_keys` if XDG variable is - not set) are able to log in with the associated U2F key. The path can - be changed using {option}`security.pam.u2f.authFile` option. - - File format is: - `username:first_keyHandle,first_public_key: second_keyHandle,second_public_key` - This file can be generated using {command}`pamu2fcfg` command. - - More information can be found [here](https://developers.yubico.com/pam-u2f/). - ''; - }; - - authFile = mkOption { - default = null; - type = with types; nullOr path; - description = lib.mdDoc '' - By default `pam-u2f` module reads the keys from - {file}`$XDG_CONFIG_HOME/Yubico/u2f_keys` (or - {file}`$HOME/.config/Yubico/u2f_keys` if XDG variable is - not set). - - If you want to change auth file locations or centralize database (for - example use {file}`/etc/u2f-mappings`) you can set this - option. - - File format is: - `username:first_keyHandle,first_public_key: second_keyHandle,second_public_key` - This file can be generated using {command}`pamu2fcfg` command. - - More information can be found [here](https://developers.yubico.com/pam-u2f/). - ''; - }; - - appId = mkOption { - default = null; - type = with types; nullOr str; - description = lib.mdDoc '' - By default `pam-u2f` module sets the application - ID to `pam://$HOSTNAME`. - - When using {command}`pamu2fcfg`, you can specify your - application ID with the `-i` flag. - - More information can be found [here](https://developers.yubico.com/pam-u2f/Manuals/pam_u2f.8.html) - ''; - }; - - origin = mkOption { - default = null; - type = with types; nullOr str; - description = lib.mdDoc '' - By default `pam-u2f` module sets the origin - to `pam://$HOSTNAME`. - Setting origin to an host independent value will allow you to - reuse credentials across machines - - When using {command}`pamu2fcfg`, you can specify your - application ID with the `-o` flag. - - More information can be found [here](https://developers.yubico.com/pam-u2f/Manuals/pam_u2f.8.html) - ''; - }; - - control = mkOption { - default = "sufficient"; - type = types.enum ["required" "requisite" "sufficient" "optional"]; - description = lib.mdDoc '' - This option sets pam "control". - If you want to have multi factor authentication, use "required". - If you want to use U2F device instead of regular password, use "sufficient". - - Read - {manpage}`pam.conf(5)` - for better understanding of this option. - ''; - }; - - debug = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - Debug output to stderr. - ''; - }; - - interactive = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - Set to prompt a message and wait before testing the presence of a U2F device. - Recommended if your device doesn’t have a tactile trigger. - ''; - }; - - cue = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - By default `pam-u2f` module does not inform user - that he needs to use the u2f device, it just waits without a prompt. - - If you set this option to `true`, - `cue` option is added to `pam-u2f` - module and reminder message will be displayed. - ''; - }; - }; - - security.pam.ussh = { - enable = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - Enables Uber's USSH PAM (`pam-ussh`) module. - - This is similar to `pam-ssh-agent`, except that - the presence of a CA-signed SSH key with a valid principal is checked - instead. - - Note that this module must both be enabled using this option and on a - per-PAM-service level as well (using `usshAuth`). - - More information can be found [here](https://github.com/uber/pam-ussh). - ''; - }; - - caFile = mkOption { - default = null; - type = with types; nullOr path; - description = lib.mdDoc '' - By default `pam-ussh` reads the trusted user CA keys - from {file}`/etc/ssh/trusted_user_ca`. - - This should be set the same as your `TrustedUserCAKeys` - option for sshd. - ''; - }; - - authorizedPrincipals = mkOption { - default = null; - type = with types; nullOr commas; - description = lib.mdDoc '' - Comma-separated list of authorized principals to permit; if the user - presents a certificate with one of these principals, then they will be - authorized. - - Note that `pam-ussh` also requires that the certificate - contain a principal matching the user's username. The principals from - this list are in addition to those principals. - - Mutually exclusive with `authorizedPrincipalsFile`. - ''; - }; - - authorizedPrincipalsFile = mkOption { - default = null; - type = with types; nullOr path; - description = lib.mdDoc '' - Path to a list of principals; if the user presents a certificate with - one of these principals, then they will be authorized. - - Note that `pam-ussh` also requires that the certificate - contain a principal matching the user's username. The principals from - this file are in addition to those principals. - - Mutually exclusive with `authorizedPrincipals`. - ''; - }; - - group = mkOption { - default = null; - type = with types; nullOr str; - description = lib.mdDoc '' - If set, then the authenticating user must be a member of this group - to use this module. - ''; - }; - - control = mkOption { - default = "sufficient"; - type = types.enum ["required" "requisite" "sufficient" "optional"]; - description = lib.mdDoc '' - This option sets pam "control". - If you want to have multi factor authentication, use "required". - If you want to use the SSH certificate instead of the regular password, - use "sufficient". - - Read - {manpage}`pam.conf(5)` - for better understanding of this option. - ''; - }; - }; - - security.pam.yubico = { - enable = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - Enables Yubico PAM (`yubico-pam`) module. - - If set, users listed in - {file}`~/.yubico/authorized_yubikeys` - are able to log in with the associated Yubikey tokens. - - The file must have only one line: - `username:yubikey_token_id1:yubikey_token_id2` - More information can be found [here](https://developers.yubico.com/yubico-pam/). - ''; - }; - control = mkOption { - default = "sufficient"; - type = types.enum ["required" "requisite" "sufficient" "optional"]; - description = lib.mdDoc '' - This option sets pam "control". - If you want to have multi factor authentication, use "required". - If you want to use Yubikey instead of regular password, use "sufficient". - - Read - {manpage}`pam.conf(5)` - for better understanding of this option. - ''; - }; - id = mkOption { - example = "42"; - type = types.str; - description = lib.mdDoc "client id"; - }; - - debug = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - Debug output to stderr. - ''; - }; - mode = mkOption { - default = "client"; - type = types.enum ["client" "challenge-response"]; - description = lib.mdDoc '' - Mode of operation. - - Use "client" for online validation with a YubiKey validation service such as - the YubiCloud. - - Use "challenge-response" for offline validation using YubiKeys with HMAC-SHA-1 - Challenge-Response configurations. See the man-page ykpamcfg(1) for further - details on how to configure offline Challenge-Response validation. - - More information can be found [here](https://developers.yubico.com/yubico-pam/Authentication_Using_Challenge-Response.html). - ''; - }; - challengeResponsePath = mkOption { - default = null; - type = types.nullOr types.path; - description = lib.mdDoc '' - If not null, set the path used by yubico pam module where the challenge expected response is stored. - - More information can be found [here](https://developers.yubico.com/yubico-pam/Authentication_Using_Challenge-Response.html). - ''; - }; - }; - - security.pam.enableEcryptfs = mkEnableOption (lib.mdDoc "eCryptfs PAM module (mounting ecryptfs home directory on login)"); - security.pam.enableFscrypt = mkEnableOption (lib.mdDoc '' - Enables fscrypt to automatically unlock directories with the user's login password. - - This also enables a service at security.pam.services.fscrypt which is used by - fscrypt to verify the user's password when setting up a new protector. If you - use something other than pam_unix to verify user passwords, please remember to - adjust this PAM service. - ''); - - users.motd = mkOption { - default = null; - example = "Today is Sweetmorn, the 4th day of The Aftermath in the YOLD 3178."; - type = types.nullOr types.lines; - description = lib.mdDoc "Message of the day shown to users when they log in."; - }; - - users.motdFile = mkOption { - default = null; - example = "/etc/motd"; - type = types.nullOr types.path; - description = lib.mdDoc "A file containing the message of the day shown to users when they log in."; - }; - }; - - ###### implementation - - config = { - assertions = [ - { - assertion = isNull config.users.motd || isNull config.users.motdFile; - message = '' - Only one of users.motd and users.motdFile can be set. - ''; - } - ]; - - environment.systemPackages = - # Include the PAM modules in the system path mostly for the manpages. - [pkgs.pam] - ++ optional config.users.ldap.enable pam_ldap - ++ optional config.services.sssd.enable pkgs.sssd - ++ optionals config.security.pam.krb5.enable [pam_krb5 pam_ccreds] - ++ optionals config.security.pam.enableOTPW [pkgs.otpw] - ++ optionals config.security.pam.oath.enable [pkgs.oath-toolkit] - ++ optionals config.security.pam.p11.enable [pkgs.pam_p11] - ++ optionals config.security.pam.enableFscrypt [pkgs.fscrypt-experimental] - ++ optionals config.security.pam.u2f.enable [pkgs.pam_u2f]; - - boot.supportedFilesystems = optionals config.security.pam.enableEcryptfs ["ecryptfs"]; - - security.wrappers = { - unix_chkpwd = { - setuid = true; - owner = "root"; - group = "root"; - source = "${pkgs.pam}/bin/unix_chkpwd"; - }; - }; - - environment.etc = mapAttrs' makePAMService config.security.pam.services; - - security.pam.services = - { - other.text = '' - auth required pam_warn.so - auth required pam_deny.so - account required pam_warn.so - account required pam_deny.so - password required pam_warn.so - password required pam_deny.so - session required pam_warn.so - session required pam_deny.so - ''; - - # Most of these should be moved to specific modules. - i3lock = {}; - i3lock-color = {}; - vlock = {}; - xlock = {}; - xscreensaver = {}; - - runuser = { - rootOK = true; - unixAuth = false; - setEnvironment = false; - }; - - /* - FIXME: should runuser -l start a systemd session? Currently - it complains "Cannot create session: Already running in a - session". - */ - runuser-l = { - rootOK = true; - unixAuth = false; - }; - } - // optionalAttrs (config.security.pam.enableFscrypt) { - # Allow fscrypt to verify login passphrase - fscrypt = {}; - }; - - security.apparmor.includes."abstractions/pam" = let - isEnabled = test: fold or false (map test (attrValues config.security.pam.services)); - in - lib.concatMapStrings - (name: "r ${config.environment.etc."pam.d/${name}".source},\n") - (attrNames config.security.pam.services) - + '' - mr ${getLib pkgs.pam}/lib/security/pam_filter/*, - mr ${getLib pkgs.pam}/lib/security/pam_*.so, - r ${getLib pkgs.pam}/lib/security/, - '' - + optionalString use_ldap '' - mr ${pam_ldap}/lib/security/pam_ldap.so, - '' - + optionalString config.services.sssd.enable '' - mr ${pkgs.sssd}/lib/security/pam_sss.so, - '' - + optionalString config.security.pam.krb5.enable '' - mr ${pam_krb5}/lib/security/pam_krb5.so, - mr ${pam_ccreds}/lib/security/pam_ccreds.so, - '' - + optionalString (isEnabled (cfg: cfg.googleOsLoginAccountVerification)) '' - mr ${pkgs.google-guest-oslogin}/lib/security/pam_oslogin_login.so, - mr ${pkgs.google-guest-oslogin}/lib/security/pam_oslogin_admin.so, - '' - + optionalString (isEnabled (cfg: cfg.googleOsLoginAuthentication)) '' - mr ${pkgs.google-guest-oslogin}/lib/security/pam_oslogin_login.so, - '' - + optionalString (config.security.pam.enableSSHAgentAuth - && isEnabled (cfg: cfg.sshAgentAuth)) '' - mr ${pkgs.pam_ssh_agent_auth}/libexec/pam_ssh_agent_auth.so, - '' - + optionalString (isEnabled (cfg: cfg.fprintAuth)) '' - mr ${pkgs.fprintd}/lib/security/pam_fprintd.so, - '' - + optionalString (isEnabled (cfg: cfg.howdyAuth)) '' - mr ${config.services.howdy.package}/lib/security/pam_howdy.so, - '' - + optionalString (isEnabled (cfg: cfg.u2fAuth)) '' - mr ${pkgs.pam_u2f}/lib/security/pam_u2f.so, - '' - + optionalString (isEnabled (cfg: cfg.usbAuth)) '' - mr ${pkgs.pam_usb}/lib/security/pam_usb.so, - '' - + optionalString (isEnabled (cfg: cfg.usshAuth)) '' - mr ${pkgs.pam_ussh}/lib/security/pam_ussh.so, - '' - + optionalString (isEnabled (cfg: cfg.oathAuth)) '' - "mr ${pkgs.oath-toolkit}/lib/security/pam_oath.so, - '' - + optionalString (isEnabled (cfg: cfg.mysqlAuth)) '' - mr ${pkgs.pam_mysql}/lib/security/pam_mysql.so, - '' - + optionalString (isEnabled (cfg: cfg.yubicoAuth)) '' - mr ${pkgs.yubico-pam}/lib/security/pam_yubico.so, - '' - + optionalString (isEnabled (cfg: cfg.duoSecurity.enable)) '' - mr ${pkgs.duo-unix}/lib/security/pam_duo.so, - '' - + optionalString (isEnabled (cfg: cfg.otpwAuth)) '' - mr ${pkgs.otpw}/lib/security/pam_otpw.so, - '' - + optionalString config.security.pam.enableEcryptfs '' - mr ${pkgs.ecryptfs}/lib/security/pam_ecryptfs.so, - '' - + optionalString config.security.pam.enableFscrypt '' - mr ${pkgs.fscrypt-experimental}/lib/security/pam_fscrypt.so, - '' - + optionalString (isEnabled (cfg: cfg.pamMount)) '' - mr ${pkgs.pam_mount}/lib/security/pam_mount.so, - '' - + optionalString (isEnabled (cfg: cfg.enableGnomeKeyring)) '' - mr ${pkgs.gnome.gnome-keyring}/lib/security/pam_gnome_keyring.so, - '' - + optionalString (isEnabled (cfg: cfg.startSession)) '' - mr ${config.systemd.package}/lib/security/pam_systemd.so, - '' - + optionalString (isEnabled (cfg: cfg.enableAppArmor) - && config.security.apparmor.enable) '' - mr ${pkgs.apparmor-pam}/lib/security/pam_apparmor.so, - '' - + optionalString (isEnabled (cfg: cfg.enableKwallet)) '' - mr ${pkgs.plasma5Packages.kwallet-pam}/lib/security/pam_kwallet5.so, - '' - + optionalString config.virtualisation.lxc.lxcfs.enable '' - mr ${pkgs.lxc}/lib/security/pam_cgfs.so - '' - + optionalString config.services.homed.enable '' - mr ${config.systemd.package}/lib/security/pam_systemd_home.so - ''; - }; -} diff --git a/foreign/dotfiles/modules/regreet.nix b/foreign/dotfiles/modules/regreet.nix deleted file mode 100644 index 494f0e6..0000000 --- a/foreign/dotfiles/modules/regreet.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ - lib, - pkgs, - config, - ... -}: let - cfg = config.programs.regreet; - settingsFormat = pkgs.formats.toml {}; -in { - options.programs.regreet = { - enable = - lib.mkEnableOption null - // { - description = lib.mdDoc '' - Enable ReGreet, a clean and customizable greeter for greetd. - - To use ReGreet, {option}`services.greetd` has to be enabled and - {option}`services.greetd.settings.default_session` should contain the - appropriate configuration to launch - {option}`config.programs.regreet.package`. For examples, see the - [ReGreet Readme](https://github.com/rharish101/ReGreet#set-as-default-session). - ''; - }; - - package = lib.mkPackageOptionMD pkgs ["greetd" "regreet"] {}; - - settings = lib.mkOption { - type = lib.types.either lib.types.path settingsFormat.type; - default = {}; - description = lib.mdDoc '' - ReGreet configuration file. Refer - - for options. - ''; - }; - - extraCss = lib.mkOption { - type = lib.types.either lib.types.path lib.types.lines; - default = ""; - description = lib.mdDoc '' - Extra CSS rules to apply on top of the GTK theme. Refer to - [GTK CSS Properties](https://docs.gtk.org/gtk4/css-properties.html) for - modifiable properties. - ''; - }; - }; - - config = lib.mkIf cfg.enable { - services.greetd = { - enable = lib.mkDefault true; - settings.default_session.command = lib.mkDefault "${lib.getExe pkgs.cage} -s -- ${lib.getExe cfg.package}"; - }; - - environment.etc = { - "greetd/regreet.css" = - if lib.isPath cfg.extraCss - then {source = cfg.extraCss;} - else {text = cfg.extraCss;}; - - "greetd/regreet.toml".source = - if lib.isPath cfg.settings - then cfg.settings - else settingsFormat.generate "regreet.toml" cfg.settings; - }; - - systemd.tmpfiles.rules = let - user = config.services.greetd.settings.default_session.user; - in [ - "d /var/log/regreet 0755 greeter ${user} - -" - "d /var/cache/regreet 0755 greeter ${user} - -" - ]; - }; -} diff --git a/foreign/dotfiles/modules/security.nix b/foreign/dotfiles/modules/security.nix deleted file mode 100644 index 3bc2d1c..0000000 --- a/foreign/dotfiles/modules/security.nix +++ /dev/null @@ -1,50 +0,0 @@ -# security tweaks borrowed from @hlissner -{ - boot.kernel.sysctl = { - # The Magic SysRq key is a key combo that allows users connected to the - # system console of a Linux kernel to perform some low-level commands. - # Disable it, since we don't need it, and is a potential security concern. - "kernel.sysrq" = 0; - - ## TCP hardening - # Prevent bogus ICMP errors from filling up logs. - "net.ipv4.icmp_ignore_bogus_error_responses" = 1; - # Reverse path filtering causes the kernel to do source validation of - # packets received from all interfaces. This can mitigate IP spoofing. - "net.ipv4.conf.default.rp_filter" = 1; - "net.ipv4.conf.all.rp_filter" = 1; - # Do not accept IP source route packets (we're not a router) - "net.ipv4.conf.all.accept_source_route" = 0; - "net.ipv6.conf.all.accept_source_route" = 0; - # Don't send ICMP redirects (again, we're on a router) - "net.ipv4.conf.all.send_redirects" = 0; - "net.ipv4.conf.default.send_redirects" = 0; - # Refuse ICMP redirects (MITM mitigations) - "net.ipv4.conf.all.accept_redirects" = 0; - "net.ipv4.conf.default.accept_redirects" = 0; - "net.ipv4.conf.all.secure_redirects" = 0; - "net.ipv4.conf.default.secure_redirects" = 0; - "net.ipv6.conf.all.accept_redirects" = 0; - "net.ipv6.conf.default.accept_redirects" = 0; - # Protects against SYN flood attacks - "net.ipv4.tcp_syncookies" = 1; - # Incomplete protection again TIME-WAIT assassination - "net.ipv4.tcp_rfc1337" = 1; - - ## TCP optimization - # TCP Fast Open is a TCP extension that reduces network latency by packing - # data in the sender’s initial TCP SYN. Setting 3 = enable TCP Fast Open for - # both incoming and outgoing connections: - "net.ipv4.tcp_fastopen" = 3; - # Bufferbloat mitigations + slight improvement in throughput & latency - "net.ipv4.tcp_congestion_control" = "bbr"; - "net.core.default_qdisc" = "cake"; - }; - boot.kernelModules = ["tcp_bbr"]; - - # So we don't have to do this later... - security.acme = { - acceptTerms = true; - defaults.email = "fufexan@proton.me"; - }; -} diff --git a/foreign/dotfiles/modules/xserver.nix b/foreign/dotfiles/modules/xserver.nix deleted file mode 100644 index 3c95f05..0000000 --- a/foreign/dotfiles/modules/xserver.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - services.xserver = { - enable = true; - displayManager.gdm.enable = true; - - libinput = { - enable = true; - # disable mouse acceleration - mouse.accelProfile = "flat"; - mouse.accelSpeed = "0"; - mouse.middleEmulation = false; - # touchpad settings - touchpad.naturalScrolling = true; - }; - }; -} diff --git a/foreign/dotfiles/pkgs/README.md b/foreign/dotfiles/pkgs/README.md deleted file mode 100644 index 8de390f..0000000 --- a/foreign/dotfiles/pkgs/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Packages & Overlays - -Here are all of the packages I couldn't find anywhere and packaged by myself, -or overrides that I use throughout the configuration. - -Name | Description ----- | ----------- -DiscordCanary | DiscordCanary + OpenASAR -[GDB-Frontend](https://github.com/rohanrhu/gdb-frontend) | Easy, flexible and extensible GUI debugger -iso | My system config built as an ISO -`patches` | Various patches used in my system -Repl | Cool Nix Repl that auto-loads the system flake or the current dir flake -[SpotifyWM](https://github.com/dasJ/spotifywm) | Spotify preloader that sets WM_NAME on start -Spotify Wrapped WM | Spotify wrapped with SpotifyWM -[Sway-hidpi](https://github.com/swaywm/sway) | Sway with XWayland HiDPI patches -[Technic](https://www.technicpack.net) | Technic Launcher derivation -[Waveform](https://www.tracktion.com/welcome/waveform-free) | DAW from Tracktion that works on Linux diff --git a/foreign/dotfiles/pkgs/catppuccin-plymouth/default.nix b/foreign/dotfiles/pkgs/catppuccin-plymouth/default.nix deleted file mode 100644 index 22517dd..0000000 --- a/foreign/dotfiles/pkgs/catppuccin-plymouth/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ - lib, - stdenvNoCC, - fetchFromGitHub, -}: -stdenvNoCC.mkDerivation { - pname = "catppuccin-plymouth"; - version = "unstable-2022-12-10"; - - src = fetchFromGitHub { - owner = "catppuccin"; - repo = "plymouth"; - rev = "d4105cf336599653783c34c4a2d6ca8c93f9281c"; - hash = "sha256-quBSH8hx3gD7y1JNWAKQdTk3CmO4t1kVo4cOGbeWlNE="; - }; - - dontConfigure = true; - dontBuild = true; - - installPhase = '' - runHook preInstall - - mkdir -p $out/share/plymouth - cp -r themes $out/share/plymouth/ - - runHook postInstall - ''; - - meta = { - description = "Soothing pastel theme for Plymouth"; - homepage = "https://github.com/catppuccin/plymouth"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [fufexan]; - platforms = lib.platforms.linux; - }; -} diff --git a/foreign/dotfiles/pkgs/default.nix b/foreign/dotfiles/pkgs/default.nix deleted file mode 100644 index c3904b9..0000000 --- a/foreign/dotfiles/pkgs/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - _inputs, - self, - ... -}: { - systems = ["x86_64-linux"]; - - flake.overlays.default = import ./overlays.nix _inputs; - - perSystem = {pkgs, ...}: { - packages = self.overlays.default null pkgs; - }; -} diff --git a/foreign/dotfiles/pkgs/discord.nix b/foreign/dotfiles/pkgs/discord.nix deleted file mode 100644 index 68d3e56..0000000 --- a/foreign/dotfiles/pkgs/discord.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - lib, - pkgs, - inputs, - ... -}: -with pkgs; let - binaryName = "DiscordCanary"; - - disableBreakingUpdates = - runCommand "disable-breaking-updates.py" - { - pythonInterpreter = "${python3.interpreter}"; - configDirName = lib.toLower binaryName; - } '' - mkdir -p $out/bin - cp "${inputs.nixpkgs}/pkgs/applications/networking/instant-messengers/discord/disable-breaking-updates.py" $out/bin/disable-breaking-updates.py - substituteAllInPlace $out/bin/disable-breaking-updates.py - chmod +x $out/bin/disable-breaking-updates.py - ''; -in - (discord-canary.override { - nss = pkgs.nss_latest; - withOpenASAR = true; - }) - .overrideAttrs (old: rec { - libPath = old.libPath + ":${libglvnd}/lib"; - - installPhase = '' - runHook preInstall - - mkdir -p $out/{bin,opt/${binaryName},share/pixmaps,share/icons/hicolor/256x256/apps} - mv * $out/opt/${binaryName} - - chmod +x $out/opt/${binaryName}/${binaryName} - patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \ - $out/opt/${binaryName}/${binaryName} - - wrapProgramShell $out/opt/${binaryName}/${binaryName} \ - "''${gappsWrapperArgs[@]}" \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations}}" \ - --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \ - --prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/${binaryName} \ - --run "${lib.getExe disableBreakingUpdates}" - - ln -s $out/opt/${binaryName}/${binaryName} $out/bin/ - # Without || true the install would fail on case-insensitive filesystems - ln -s $out/opt/${binaryName}/${binaryName} $out/bin/${ - lib.strings.toLower binaryName - } || true - - ln -s $out/opt/${binaryName}/discord.png $out/share/pixmaps/${old.pname}.png - ln -s $out/opt/${binaryName}/discord.png $out/share/icons/hicolor/256x256/apps/${old.pname}.png - - ln -s "${old.desktopItem}/share/applications" $out/share/ - - runHook postInstall - ''; - }) diff --git a/foreign/dotfiles/pkgs/gdb-frontend/default.nix b/foreign/dotfiles/pkgs/gdb-frontend/default.nix deleted file mode 100644 index 49a4bb0..0000000 --- a/foreign/dotfiles/pkgs/gdb-frontend/default.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - lib, - bash, - stdenv, - fetchFromGitHub, - python3, - gdb, - tmux, -}: -stdenv.mkDerivation rec { - pname = "gdb-frontend"; - version = "0.10.3-beta"; - - src = fetchFromGitHub { - repo = pname; - owner = "rohanrhu"; - rev = "v${version}"; - sha256 = "sha256-+l1SguRKnLDqT4rgXcod9xhiCOJZEKdZlOZfTNzP7fk="; - }; - - buildInputs = [gdb python3 tmux]; - propagatedUserEnvPkgs = [gdb python3 tmux]; - - dontConfigure = true; - dontBuild = true; - - installPhase = '' - mkdir -p $out/bin - cp -r . $out - echo "${python3}/bin/python $out/run.py \"\$@\"" > $out/bin/gdbfrontend - chmod +x $out/bin/gdbfrontend - ''; - - postPatch = '' - substituteInPlace "run.py" \ - --replace "/bin/bash" "${bash}/bin/bash" - substituteInPlace "gdbfrontend-window" \ - --replace "/bin/bash" "${bash}/bin/bash" - substituteInPlace "build_gdb.sh" \ - --replace "/bin/bash\n" "${bash}/bin/bash\n" - substituteInPlace "url_modules/api/shell.py" \ - --replace "/bin/bash" "${bash}/bin/bash" - substituteInPlace "commands/gdbfrontend" \ - --replace "/bin/bash" "${bash}/bin/bash" - ''; - - meta = with lib; { - description = "GDBFrontend is an easy, flexible and extensionable gui debugger"; - homepage = "https://github.com/rohanrhu/gdb-frontend"; - mainProgram = "gdbfrontend"; - platforms = platforms.linux; - maintainers = with maintainers; [fufexan]; - }; -} diff --git a/foreign/dotfiles/pkgs/howdy/default.nix b/foreign/dotfiles/pkgs/howdy/default.nix deleted file mode 100644 index 62ab8a0..0000000 --- a/foreign/dotfiles/pkgs/howdy/default.nix +++ /dev/null @@ -1,86 +0,0 @@ -{ - stdenv, - lib, - bzip2, - fetchFromGitHub, - fetchurl, - fmt, - gettext, - inih, - installShellFiles, - libevdev, - meson, - ninja, - pam, - pkg-config, - python3, -} @ args: let - data = import ./sources.nix args; -in - stdenv.mkDerivation { - pname = "howdy"; - version = "unstable-2023-02-28"; - inherit (data) src; - - # fix paths - patches = [./howdy.patch]; - - postPatch = let - howdypath = "${placeholder "out"}/lib/security/howdy"; - in '' - substituteInPlace howdy/src/cli/add.py --replace "@PATH@" "${howdypath}" - substituteInPlace howdy/src/cli/config.py --replace '/bin/nano' 'nano' - substituteInPlace howdy/src/cli/test.py --replace "@PATH@" "${howdypath}" - - substituteInPlace howdy/src/pam/main.cc \ - --replace "python3" "${data.py}/bin/python" \ - --replace "/lib/security/howdy/compare.py" "${howdypath}/compare.py" - - substituteInPlace howdy/src/compare.py \ - --replace "/lib/security/howdy" "${howdypath}" \ - --replace "@PATH@" "${howdypath}" - ''; - - nativeBuildInputs = [bzip2 installShellFiles meson ninja pkg-config]; - buildInputs = [data.py fmt gettext inih libevdev pam]; - - # build howdy_pam - preConfigure = '' - cd howdy/src/pam - export DESTDIR=$out - ''; - - postInstall = let - libDir = "$out/lib/security/howdy"; - inherit (lib) mapAttrsToList concatStrings; - in '' - # done with howdy_pam, go back to source root - cd ../../../.. - - mkdir -p $out/share/licenses/howdy - install -Dm644 LICENSE $out/share/licenses/howdy/LICENSE - rm -rf howdy/src/pam - mkdir -p ${libDir} - cp -r howdy/src/* ${libDir} - - rm -rf ${libDir}/pam-config ${libDir}/dlib-data/* - ${concatStrings (mapAttrsToList (n: v: '' - bzip2 -dc ${v} > ${libDir}/dlib-data/${n} - '') - data.data)} - - mkdir -p $out/bin - ln -s ${libDir}/cli.py $out/bin/howdy - - mkdir -p "$out/share/bash-completion/completions" - installShellCompletion --bash howdy/src/autocomplete/howdy - ''; - - meta = { - description = "Windows Hello™ style facial authentication for Linux"; - homepage = "https://github.com/boltgolt/howdy"; - license = lib.licenses.mit; - platforms = lib.platforms.linux; - maintainers = with lib.maintainers; [fufexan]; - }; - } diff --git a/foreign/dotfiles/pkgs/howdy/howdy.patch b/foreign/dotfiles/pkgs/howdy/howdy.patch deleted file mode 100644 index 34a481e..0000000 --- a/foreign/dotfiles/pkgs/howdy/howdy.patch +++ /dev/null @@ -1,155 +0,0 @@ -diff --git a/howdy/src/cli/add.py b/howdy/src/cli/add.py -index 8951e31..4f793d7 100644 ---- a/howdy/src/cli/add.py -+++ b/howdy/src/cli/add.py -@@ -30,9 +30,9 @@ import cv2 - config_path = "/etc/howdy" - - # Test if at lest 1 of the data files is there and abort if it's not --if not os.path.isfile(config_path + "/dlib-data/shape_predictor_5_face_landmarks.dat"): -+if not os.path.isfile("@PATH@/dlib-data/shape_predictor_5_face_landmarks.dat"): - print(_("Data files have not been downloaded, please run the following commands:")) -- print("\n\tcd " + config_path + "/dlib-data") -+ print("\n\tcd " + "@PATH@/dlib-data") - print("\tsudo ./install.sh\n") - sys.exit(1) - -@@ -42,23 +42,23 @@ config.read(config_path + "/config.ini") - - use_cnn = config.getboolean("core", "use_cnn", fallback=False) - if use_cnn: -- face_detector = dlib.cnn_face_detection_model_v1(config_path + "/dlib-data/mmod_human_face_detector.dat") -+ face_detector = dlib.cnn_face_detection_model_v1("@PATH@/dlib-data/mmod_human_face_detector.dat") - else: - face_detector = dlib.get_frontal_face_detector() - --pose_predictor = dlib.shape_predictor(config_path + "/dlib-data/shape_predictor_5_face_landmarks.dat") --face_encoder = dlib.face_recognition_model_v1(config_path + "/dlib-data/dlib_face_recognition_resnet_model_v1.dat") -+pose_predictor = dlib.shape_predictor("@PATH@/dlib-data/shape_predictor_5_face_landmarks.dat") -+face_encoder = dlib.face_recognition_model_v1("@PATH@/dlib-data/dlib_face_recognition_resnet_model_v1.dat") - - user = builtins.howdy_user - # The permanent file to store the encoded model in --enc_file = config_path + "/models/" + user + ".dat" -+enc_file = "/var/lib/howdy/models/" + user + ".dat" - # Known encodings - encodings = [] - - # Make the ./models folder if it doesn't already exist --if not os.path.exists(config_path + "/models"): -+if not os.path.exists("/var/lib/howdy/models"): - print(_("No face model folder found, creating one")) -- os.makedirs(config_path + "/models") -+ os.makedirs("/var/lib/howdy/models") - - # To try read a premade encodings file if it exists - try: -diff --git a/howdy/src/cli/clear.py b/howdy/src/cli/clear.py -index 6fa5f3e..fc7676c 100644 ---- a/howdy/src/cli/clear.py -+++ b/howdy/src/cli/clear.py -@@ -8,7 +8,7 @@ import builtins - from i18n import _ - - # Get the full path to this file --path = "/etc/howdy/models" -+path = "/var/lib/howdy/models" - # Get the passed user - user = builtins.howdy_user - -diff --git a/howdy/src/cli/list.py b/howdy/src/cli/list.py -index 3532e9f..b9e2a31 100644 ---- a/howdy/src/cli/list.py -+++ b/howdy/src/cli/list.py -@@ -10,7 +10,7 @@ import builtins - from i18n import _ - - # Get the absolute path and the username --path = "/etc/howdy" -+path = "/var/lib/howdy" - user = builtins.howdy_user - - # Check if the models file has been created yet -diff --git a/howdy/src/cli/remove.py b/howdy/src/cli/remove.py -index 6321e0b..7c13d79 100644 ---- a/howdy/src/cli/remove.py -+++ b/howdy/src/cli/remove.py -@@ -9,7 +9,7 @@ import builtins - from i18n import _ - - # Get the absolute path and the username --path = "/etc/howdy" -+path = "/var/lib/howdy" - user = builtins.howdy_user - - # Check if enough arguments have been passed -diff --git a/howdy/src/cli/test.py b/howdy/src/cli/test.py -index d54929a..fa45500 100644 ---- a/howdy/src/cli/test.py -+++ b/howdy/src/cli/test.py -@@ -59,20 +59,20 @@ use_cnn = config.getboolean('core', 'use_cnn', fallback=False) - - if use_cnn: - face_detector = dlib.cnn_face_detection_model_v1( -- path + "/dlib-data/mmod_human_face_detector.dat" -+ "@PATH@/dlib-data/mmod_human_face_detector.dat" - ) - else: - face_detector = dlib.get_frontal_face_detector() - --pose_predictor = dlib.shape_predictor(path + "/dlib-data/shape_predictor_5_face_landmarks.dat") --face_encoder = dlib.face_recognition_model_v1(path + "/dlib-data/dlib_face_recognition_resnet_model_v1.dat") -+pose_predictor = dlib.shape_predictor("@PATH@/dlib-data/shape_predictor_5_face_landmarks.dat") -+face_encoder = dlib.face_recognition_model_v1("@PATH@/dlib-data/dlib_face_recognition_resnet_model_v1.dat") - - encodings = [] - models = None - - try: - user = builtins.howdy_user -- models = json.load(open(path + "/models/" + user + ".dat")) -+ models = json.load(open("/var/lib/howdy/models/" + user + ".dat")) - - for model in models: - encodings += model["data"] -diff --git a/howdy/src/compare.py b/howdy/src/compare.py -index be19464..86a8d8f 100644 ---- a/howdy/src/compare.py -+++ b/howdy/src/compare.py -@@ -48,22 +48,22 @@ def init_detector(lock): - global face_detector, pose_predictor, face_encoder - - # Test if at lest 1 of the data files is there and abort if it's not -- if not os.path.isfile(PATH + "/dlib-data/shape_predictor_5_face_landmarks.dat"): -+ if not os.path.isfile("@PATH@/dlib-data/shape_predictor_5_face_landmarks.dat"): - print(_("Data files have not been downloaded, please run the following commands:")) -- print("\n\tcd " + PATH + "/dlib-data") -+ print("\n\tcd " + "@PATH@/dlib-data") - print("\tsudo ./install.sh\n") - lock.release() - exit(1) - - # Use the CNN detector if enabled - if use_cnn: -- face_detector = dlib.cnn_face_detection_model_v1(PATH + "/dlib-data/mmod_human_face_detector.dat") -+ face_detector = dlib.cnn_face_detection_model_v1("@PATH@/dlib-data/mmod_human_face_detector.dat") - else: - face_detector = dlib.get_frontal_face_detector() - - # Start the others regardless -- pose_predictor = dlib.shape_predictor(PATH + "/dlib-data/shape_predictor_5_face_landmarks.dat") -- face_encoder = dlib.face_recognition_model_v1(PATH + "/dlib-data/dlib_face_recognition_resnet_model_v1.dat") -+ pose_predictor = dlib.shape_predictor("@PATH@/dlib-data/shape_predictor_5_face_landmarks.dat") -+ face_encoder = dlib.face_recognition_model_v1("@PATH@/dlib-data/dlib_face_recognition_resnet_model_v1.dat") - - # Note the time it took to initialize detectors - timings["ll"] = time.time() - timings["ll"] -@@ -129,7 +129,7 @@ face_encoder = None - - # Try to load the face model from the models folder - try: -- models = json.load(open(PATH + "/models/" + user + ".dat")) -+ models = json.load(open("/var/lib/howdy/models/" + user + ".dat")) - - for model in models: - encodings += model["data"] diff --git a/foreign/dotfiles/pkgs/howdy/sources.nix b/foreign/dotfiles/pkgs/howdy/sources.nix deleted file mode 100644 index 6d3d19a..0000000 --- a/foreign/dotfiles/pkgs/howdy/sources.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - fetchurl, - fetchFromGitHub, - python3, - ... -}: { - data = { - "dlib_face_recognition_resnet_model_v1.dat" = fetchurl { - url = "https://github.com/davisking/dlib-models/raw/master/dlib_face_recognition_resnet_model_v1.dat.bz2"; - sha256 = "0fjm265l1fz5zdzx5n5yphl0v0vfajyw50ffamc4cd74848gdcdb"; - }; - "mmod_human_face_detector.dat" = fetchurl { - url = "https://github.com/davisking/dlib-models/raw/master/mmod_human_face_detector.dat.bz2"; - sha256 = "117wv582nsn585am2n9mg5q830qnn8skjr1yxgaiihcjy109x7nv"; - }; - "shape_predictor_5_face_landmarks.dat" = fetchurl { - url = "https://github.com/davisking/dlib-models/raw/master/shape_predictor_5_face_landmarks.dat.bz2"; - sha256 = "0wm4bbwnja7ik7r28pv00qrl3i1h6811zkgnjfvzv7jwpyz7ny3f"; - }; - }; - - src = fetchFromGitHub { - owner = "fufexan"; - repo = "howdy"; - rev = "dceebf0f194e55429baaf9696ed5ae38ab9ddf92"; - hash = "sha256-6C8AqB83pJ5LMq+0JdsrMfkGNxxn1uv8jfoCe8BAGeY="; - }; - - py = python3.withPackages (p: [ - p.face_recognition - (p.opencv4.override {enableGtk3 = true;}) - ]); -} diff --git a/foreign/dotfiles/pkgs/linux-enable-ir-emitter/default.nix b/foreign/dotfiles/pkgs/linux-enable-ir-emitter/default.nix deleted file mode 100644 index ef5d52c..0000000 --- a/foreign/dotfiles/pkgs/linux-enable-ir-emitter/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - stdenv, - lib, - makeWrapper, - fetchFromGitHub, - fetchurl, - meson, - ninja, - pkg-config, - python3, - opencv, - usbutils, -}: -stdenv.mkDerivation rec { - pname = "linux-enable-ir-emitter"; - version = "4.5.0"; - - src = fetchFromGitHub { - owner = "EmixamPP"; - repo = pname; - rev = version; - hash = "sha256-Dv1ukn2TkXfBk1vc+6Uq7tw8WwCAfIcKl13BoOifz+Q="; - }; - - nativeBuildInputs = [meson ninja pkg-config makeWrapper]; - buildInputs = [python3 opencv]; - - patches = [./remove-boot-set.patch]; - - postInstall = '' - wrapProgram $out/bin/${pname} --prefix PATH : ${lib.makeBinPath [usbutils]} - ''; -} diff --git a/foreign/dotfiles/pkgs/linux-enable-ir-emitter/remove-boot-set.patch b/foreign/dotfiles/pkgs/linux-enable-ir-emitter/remove-boot-set.patch deleted file mode 100644 index 9cd26f4..0000000 --- a/foreign/dotfiles/pkgs/linux-enable-ir-emitter/remove-boot-set.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/sources/command/configure.py b/sources/command/configure.py -index 2cd20d2..84ffb73 100644 ---- a/sources/command/configure.py -+++ b/sources/command/configure.py -@@ -25,6 +25,5 @@ def configure(device: str, emitters: int, neg_answer_limit: int) -> NoReturn: - logging.info("Do not hesitate to visit the GitHub ! https://github.com/EmixamPP/linux-enable-ir-emitter/wiki") - else: - logging.info("The driver has been successfully generated.") -- boot("enable") - - exit(exit_code) diff --git a/foreign/dotfiles/pkgs/overlays.nix b/foreign/dotfiles/pkgs/overlays.nix deleted file mode 100644 index 51beb84..0000000 --- a/foreign/dotfiles/pkgs/overlays.nix +++ /dev/null @@ -1,26 +0,0 @@ -inputs: _: prev: { - # instant repl with automatic flake loading - repl = prev.callPackage ./repl {}; - - catppuccin-plymouth = prev.callPackage ./catppuccin-plymouth {}; - - discord-canary = prev.callPackage ./discord.nix { - pkgs = prev; - inherit inputs; - inherit (prev) lib; - }; - - gdb-frontend = prev.callPackage ./gdb-frontend {}; - - regreet = prev.callPackage ./regreet {}; - - howdy = prev.callPackage ./howdy {}; - - linux-enable-ir-emitter = prev.callPackage ./linux-enable-ir-emitter {}; - - waveform = prev.callPackage ./waveform {}; - - spotify = prev.callPackage ./spotify {}; - - sway-hidpi = import ./sway-hidpi.nix prev; -} diff --git a/foreign/dotfiles/pkgs/patches/xwayland-hidpi.patch b/foreign/dotfiles/pkgs/patches/xwayland-hidpi.patch deleted file mode 100644 index 85f56e0..0000000 --- a/foreign/dotfiles/pkgs/patches/xwayland-hidpi.patch +++ /dev/null @@ -1,498 +0,0 @@ -diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c -index c4457cc2a61b2103b47f996b51dbbe9eb87bd715..4a33e1f33e73c35c1691564ef4852e7501b02245 100644 ---- a/hw/xwayland/xwayland-cursor.c -+++ b/hw/xwayland/xwayland-cursor.c -@@ -171,6 +171,8 @@ xwl_cursor_attach_pixmap(struct xwl_seat *xwl_seat, - } - - wl_surface_attach(xwl_cursor->surface, buffer, 0, 0); -+ wl_surface_set_buffer_scale(xwl_cursor->surface, -+ xwl_seat->xwl_screen->global_output_scale); - xwl_surface_damage(xwl_seat->xwl_screen, xwl_cursor->surface, 0, 0, - xwl_seat->x_cursor->bits->width, - xwl_seat->x_cursor->bits->height); -@@ -190,6 +192,7 @@ xwl_cursor_attach_pixmap(struct xwl_seat *xwl_seat, - void - xwl_seat_set_cursor(struct xwl_seat *xwl_seat) - { -+ struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; - struct xwl_cursor *xwl_cursor = &xwl_seat->cursor; - PixmapPtr pixmap; - CursorPtr cursor; -@@ -220,8 +223,8 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) - wl_pointer_set_cursor(xwl_seat->wl_pointer, - xwl_seat->pointer_enter_serial, - xwl_cursor->surface, -- xwl_seat->x_cursor->bits->xhot, -- xwl_seat->x_cursor->bits->yhot); -+ xwl_scale_to(xwl_screen, xwl_seat->x_cursor->bits->xhot), -+ xwl_scale_to(xwl_screen, xwl_seat->x_cursor->bits->yhot)); - - xwl_cursor_attach_pixmap(xwl_seat, xwl_cursor, pixmap); - } -@@ -230,6 +233,7 @@ void - xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool) - { - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; - struct xwl_cursor *xwl_cursor = &xwl_tablet_tool->cursor; - PixmapPtr pixmap; - CursorPtr cursor; -@@ -258,9 +262,9 @@ xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool) - zwp_tablet_tool_v2_set_cursor(xwl_tablet_tool->tool, - xwl_tablet_tool->proximity_in_serial, - xwl_cursor->surface, -- xwl_seat->x_cursor->bits->xhot, -- xwl_seat->x_cursor->bits->yhot); -- -+ xwl_scale_to(xwl_screen, xwl_seat->x_cursor->bits->xhot), -+ xwl_scale_to(xwl_screen, xwl_seat->x_cursor->bits->yhot)); -+ wl_surface_set_buffer_scale(xwl_cursor->surface, xwl_screen->global_output_scale); - xwl_cursor_attach_pixmap(xwl_seat, xwl_cursor, pixmap); - } - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 26b3630c73b62514fe3ba7824371f79868e953f3..55cd8d466a55db03948abe93ffa03bf129b5e17a 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -412,8 +412,8 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer, - DeviceIntPtr dev = get_pointer_device(xwl_seat); - DeviceIntPtr master; - int i; -- int sx = wl_fixed_to_int(sx_w); -- int sy = wl_fixed_to_int(sy_w); -+ int sx = wl_fixed_to_int(sx_w) * xwl_seat->xwl_screen->global_output_scale; -+ int sy = wl_fixed_to_int(sy_w) * xwl_seat->xwl_screen->global_output_scale; - int dx, dy; - ScreenPtr pScreen = xwl_seat->xwl_screen->screen; - ValuatorMask mask; -@@ -592,13 +592,14 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer, - uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w) - { - struct xwl_seat *xwl_seat = data; -+ int32_t scale = xwl_seat->xwl_screen->global_output_scale; - - if (!xwl_seat->focus_window) - return; - - xwl_seat->pending_pointer_event.has_absolute = TRUE; -- xwl_seat->pending_pointer_event.x = sx_w; -- xwl_seat->pending_pointer_event.y = sy_w; -+ xwl_seat->pending_pointer_event.x = sx_w * scale; -+ xwl_seat->pending_pointer_event.y = sy_w * scale; - - if (wl_proxy_get_version((struct wl_proxy *) xwl_seat->wl_pointer) < 5) - dispatch_pointer_motion_event(xwl_seat); -@@ -672,7 +673,8 @@ pointer_handle_axis(void *data, struct wl_pointer *pointer, - xorg_list_del(&pending->l); - free(pending); - } else { -- valuator_mask_set_double(&mask, index, wl_fixed_to_double(value) / divisor); -+ double scaled_value = wl_fixed_to_double(value); -+ valuator_mask_set_double(&mask, index, scaled_value / divisor); - } - - QueuePointerEvents(get_pointer_device(xwl_seat), -@@ -740,12 +742,13 @@ relative_pointer_handle_relative_motion(void *data, - wl_fixed_t dy_unaccelf) - { - struct xwl_seat *xwl_seat = data; -+ int32_t scale = xwl_seat->xwl_screen->global_output_scale; - - xwl_seat->pending_pointer_event.has_relative = TRUE; -- xwl_seat->pending_pointer_event.dx = wl_fixed_to_double(dxf); -- xwl_seat->pending_pointer_event.dy = wl_fixed_to_double(dyf); -- xwl_seat->pending_pointer_event.dx_unaccel = wl_fixed_to_double(dx_unaccelf); -- xwl_seat->pending_pointer_event.dy_unaccel = wl_fixed_to_double(dy_unaccelf); -+ xwl_seat->pending_pointer_event.dx = wl_fixed_to_double(dxf) * scale; -+ xwl_seat->pending_pointer_event.dy = wl_fixed_to_double(dyf) * scale; -+ xwl_seat->pending_pointer_event.dx_unaccel = wl_fixed_to_double(dx_unaccelf) * scale; -+ xwl_seat->pending_pointer_event.dy_unaccel = wl_fixed_to_double(dy_unaccelf) * scale; - - if (!xwl_seat->focus_window) - return; -@@ -1057,8 +1060,8 @@ touch_handle_down(void *data, struct wl_touch *wl_touch, - - xwl_touch->window = wl_surface_get_user_data(surface); - xwl_touch->id = id; -- xwl_touch->x = wl_fixed_to_int(sx_w); -- xwl_touch->y = wl_fixed_to_int(sy_w); -+ xwl_touch->x = wl_fixed_to_int(sx_w) * xwl_seat->xwl_screen->global_output_scale; -+ xwl_touch->y = wl_fixed_to_int(sy_w) * xwl_seat->xwl_screen->global_output_scale; - xorg_list_add(&xwl_touch->link_touch, &xwl_seat->touches); - - xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchBegin); -@@ -1094,8 +1097,8 @@ touch_handle_motion(void *data, struct wl_touch *wl_touch, - if (!xwl_touch) - return; - -- xwl_touch->x = wl_fixed_to_int(sx_w); -- xwl_touch->y = wl_fixed_to_int(sy_w); -+ xwl_touch->x = wl_fixed_to_int(sx_w) * xwl_seat->xwl_screen->global_output_scale;; -+ xwl_touch->y = wl_fixed_to_int(sy_w) * xwl_seat->xwl_screen->global_output_scale;; - xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchUpdate); - } - -@@ -1726,8 +1729,8 @@ tablet_tool_motion(void *data, struct zwp_tablet_tool_v2 *tool, - struct xwl_tablet_tool *xwl_tablet_tool = data; - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; - int32_t dx, dy; -- double sx = wl_fixed_to_double(x); -- double sy = wl_fixed_to_double(y); -+ double sx = wl_fixed_to_double(x) * xwl_seat->xwl_screen->global_output_scale; -+ double sy = wl_fixed_to_double(y) * xwl_seat->xwl_screen->global_output_scale; - - if (!xwl_seat->tablet_focus_window) - return; -@@ -2714,6 +2717,7 @@ xwl_pointer_warp_emulator_set_fake_pos(struct xwl_pointer_warp_emulator *warp_em - int x, - int y) - { -+ struct xwl_screen *xwl_screen; - struct zwp_locked_pointer_v1 *locked_pointer = - warp_emulator->locked_pointer; - WindowPtr window; -@@ -2725,6 +2729,7 @@ xwl_pointer_warp_emulator_set_fake_pos(struct xwl_pointer_warp_emulator *warp_em - if (!warp_emulator->xwl_seat->focus_window) - return; - -+ xwl_screen = warp_emulator->xwl_seat->xwl_screen; - window = warp_emulator->xwl_seat->focus_window->window; - if (x >= window->drawable.x || - y >= window->drawable.y || -@@ -2733,8 +2738,8 @@ xwl_pointer_warp_emulator_set_fake_pos(struct xwl_pointer_warp_emulator *warp_em - sx = x - window->drawable.x; - sy = y - window->drawable.y; - zwp_locked_pointer_v1_set_cursor_position_hint(locked_pointer, -- wl_fixed_from_int(sx), -- wl_fixed_from_int(sy)); -+ wl_fixed_from_int(xwl_scale_to(xwl_screen, sx)), -+ wl_fixed_from_int(xwl_scale_to(xwl_screen, sy))); - wl_surface_commit(warp_emulator->xwl_seat->focus_window->surface); - } - } -diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index ef705bc01bf8c2d2f170cda9ba21ed8293f50559..b8f6cd51bd240ed5e16271eb4749db18868bea7b 100644 ---- a/hw/xwayland/xwayland-output.c -+++ b/hw/xwayland/xwayland-output.c -@@ -191,6 +191,9 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height) - { - struct xwl_screen *xwl_screen = xwl_output->xwl_screen; - -+ width *= xwl_screen->global_output_scale; -+ height *= xwl_screen->global_output_scale; -+ - if (xwl_screen->root_clip_mode == ROOT_CLIP_FULL) - SetRootClip(xwl_screen->screen, ROOT_CLIP_NONE); - -@@ -497,14 +500,15 @@ xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, - xwl_output_set_randr_emu_props(xwl_output->xwl_screen, client); - } - --static void --apply_output_change(struct xwl_output *xwl_output) -+void -+xwl_output_apply_changes(struct xwl_output *xwl_output) - { - struct xwl_screen *xwl_screen = xwl_output->xwl_screen; - struct xwl_output *it; - int mode_width, mode_height, count; - int width = 0, height = 0, has_this_output = 0; - RRModePtr *randr_modes; -+ int32_t scale = xwl_screen->global_output_scale; - - /* Clear out the "done" received flags */ - xwl_output->wl_output_done = FALSE; -@@ -523,10 +527,10 @@ apply_output_change(struct xwl_output *xwl_output) - } - - /* Build a fresh modes array using the current refresh rate */ -- randr_modes = output_get_rr_modes(xwl_output, mode_width, mode_height, &count); -+ randr_modes = output_get_rr_modes(xwl_output, mode_width * scale, mode_height * scale, &count); - RROutputSetModes(xwl_output->randr_output, randr_modes, count, 1); - RRCrtcNotify(xwl_output->randr_crtc, randr_modes[0], -- xwl_output->x, xwl_output->y, -+ xwl_output->x * scale, xwl_output->y * scale, - xwl_output->rotation, NULL, 1, &xwl_output->randr_output); - /* RROutputSetModes takes ownership of the passed in modes, so we only - * have to free the pointer array. -@@ -567,7 +571,7 @@ output_handle_done(void *data, struct wl_output *wl_output) - */ - if (xwl_output->xdg_output_done || !xwl_output->xdg_output || - zxdg_output_v1_get_version(xwl_output->xdg_output) >= 3) -- apply_output_change(xwl_output); -+ xwl_output_apply_changes(xwl_output); - } - - static void -@@ -610,7 +614,7 @@ xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output) - xwl_output->xdg_output_done = TRUE; - if (xwl_output->wl_output_done && - zxdg_output_v1_get_version(xdg_output) < 3) -- apply_output_change(xwl_output); -+ xwl_output_apply_changes(xwl_output); - } - - static void -@@ -678,6 +682,8 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id) - RROutputSetConnection(xwl_output->randr_output, RR_Connected); - RRTellChanged(xwl_screen->screen); - -+ xwl_output->scale = 1; -+ - /* We want the output to be in the list as soon as created so we can - * use it when binding to the xdg-output protocol... - */ -diff --git a/hw/xwayland/xwayland-output.h b/hw/xwayland/xwayland-output.h -index 02b9831083e82a33d85d4404e39d00f06f6c56fd..ec089757f44178dcd7f9c48907f790ce1b2a2729 100644 ---- a/hw/xwayland/xwayland-output.h -+++ b/hw/xwayland/xwayland-output.h -@@ -53,7 +53,7 @@ struct xwl_output { - struct wl_output *output; - struct zxdg_output_v1 *xdg_output; - uint32_t server_output_id; -- int32_t x, y, width, height, refresh; -+ int32_t x, y, width, height, refresh, scale; - Rotation rotation; - Bool wl_output_done; - Bool xdg_output_done; -@@ -100,6 +100,8 @@ void xwl_output_set_emulated_mode(struct xwl_output *xwl_output, - void xwl_output_set_window_randr_emu_props(struct xwl_screen *xwl_screen, - WindowPtr window); - -+void xwl_output_apply_changes(struct xwl_output *xwl_output); -+ - void xwl_screen_init_xdg_output(struct xwl_screen *xwl_screen); - - #endif /* XWAYLAND_OUTPUT_H */ -diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c -index c9cf8c2f569a319034e0789e7587414e50237065..5be0c208ca46b1a53a136885fdc8ab44251fe7ff 100644 ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -680,6 +680,8 @@ xwl_present_flip(WindowPtr present_window, - - /* We can flip directly to the main surface (full screen window without clips) */ - wl_surface_attach(xwl_window->surface, buffer, 0, 0); -+ wl_surface_set_buffer_scale(xwl_window->surface, -+ xwl_window->xwl_screen->global_output_scale); - - if (!xwl_window->frame_callback) - xwl_window_create_frame_callback(xwl_window); -diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c -index bb18e5c94fbc7134c801e4e1979e8184079d352e..4ec2de7d123dd36315df07a1e95b1f417925f0f8 100644 ---- a/hw/xwayland/xwayland-screen.c -+++ b/hw/xwayland/xwayland-screen.c -@@ -51,6 +51,7 @@ - #include "xwayland-pixmap.h" - #include "xwayland-present.h" - #include "xwayland-shm.h" -+#include "xwayland-window-buffers.h" - - #ifdef MITSHM - #include "shmint.h" -@@ -110,6 +111,12 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) - return xwl_screen->rootless && xwl_screen_has_viewport_support(xwl_screen); - } - -+int -+xwl_scale_to(struct xwl_screen *xwl_screen, int value) -+{ -+ return value / (double)xwl_screen->global_output_scale + 0.5; -+} -+ - /* Return the output @ 0x0, falling back to the first output in the list */ - struct xwl_output * - xwl_screen_get_first_output(struct xwl_screen *xwl_screen) -@@ -127,6 +134,37 @@ xwl_screen_get_first_output(struct xwl_screen *xwl_screen) - return xorg_list_first_entry(&xwl_screen->output_list, struct xwl_output, link); - } - -+static void -+xwl_screen_set_global_scale_from_property(struct xwl_screen *screen, -+ PropertyPtr prop) -+{ -+ CARD32 *propdata; -+ -+ if (prop->type != XA_CARDINAL || prop->format != 32 || prop->size != 1) { -+ // TODO: handle warnings more cleanly. -+ LogMessageVerb(X_WARNING, 0, "Bad value for property %s.\n", -+ NameForAtom(prop->propertyName)); -+ return; -+ } -+ -+ propdata = prop->data; -+ xwl_screen_set_global_scale(screen, propdata[0]); -+} -+ -+static void -+xwl_screen_update_property(struct xwl_screen *screen, -+ PropertyStateRec *propstate) -+{ -+ switch (propstate->state) { -+ case PropertyNewValue: -+ xwl_screen_set_global_scale_from_property(screen, propstate->prop); -+ break; -+ case PropertyDelete: -+ xwl_screen_set_global_scale(screen, 1); -+ break; -+ } -+} -+ - static void - xwl_property_callback(CallbackListPtr *pcbl, void *closure, - void *calldata) -@@ -134,19 +172,24 @@ xwl_property_callback(CallbackListPtr *pcbl, void *closure, - ScreenPtr screen = closure; - PropertyStateRec *rec = calldata; - struct xwl_screen *xwl_screen; -- struct xwl_window *xwl_window; - - if (rec->win->drawable.pScreen != screen) - return; - -- xwl_window = xwl_window_get(rec->win); -- if (!xwl_window) -- return; -- - xwl_screen = xwl_screen_get(screen); - -- if (rec->prop->propertyName == xwl_screen->allow_commits_prop) -+ if (rec->prop->propertyName == xwl_screen->allow_commits_prop) { -+ struct xwl_window *xwl_window; -+ -+ xwl_window = xwl_window_get(rec->win); -+ if (!xwl_window) -+ return; -+ - xwl_window_update_property(xwl_window, rec); -+ } -+ else if (rec->prop->propertyName == xwl_screen->global_output_scale_prop) { -+ xwl_screen_update_property(xwl_screen, rec); -+ } - } - - Bool -@@ -521,8 +564,14 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen, - { - if (wl_surface_get_version(surface) >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION) - wl_surface_damage_buffer(surface, x, y, width, height); -- else -+ else { -+ x = xwl_scale_to(xwl_screen, x); -+ y = xwl_scale_to(xwl_screen, y); -+ width = xwl_scale_to(xwl_screen, width); -+ height = xwl_scale_to(xwl_screen, height); -+ - wl_surface_damage(surface, x, y, width, height); -+ } - } - - void -@@ -538,10 +587,34 @@ xwl_screen_roundtrip(struct xwl_screen *xwl_screen) - xwl_give_up("could not connect to wayland server\n"); - } - -+void -+xwl_screen_set_global_scale(struct xwl_screen *xwl_screen, int32_t scale) -+{ -+ struct xwl_output *it; -+ struct xwl_window *xwl_window; -+ -+ xwl_screen->global_output_scale = scale; -+ -+ /* change randr resolutions and positions */ -+ xorg_list_for_each_entry(it, &xwl_screen->output_list, link) { -+ xwl_output_apply_changes(it); -+ } -+ -+ if (!xwl_screen->rootless && xwl_screen->screen->root) { -+ /* Clear all the buffers, so that they'll be remade with the new sizes -+ * (this doesn't occur automatically because as far as Xorg is -+ * concerned, the window's size is the same) */ -+ xorg_list_for_each_entry(xwl_window, &xwl_screen->window_list, link_window) { -+ xwl_window_buffers_recycle(xwl_window); -+ } -+ } -+} -+ - Bool - xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) - { - static const char allow_commits[] = "_XWAYLAND_ALLOW_COMMITS"; -+ static const char global_output_scale[] = "_XWAYLAND_GLOBAL_OUTPUT_SCALE"; - struct xwl_screen *xwl_screen; - Pixel red_mask, blue_mask, green_mask; - int ret, bpc, green_bpc, i; -@@ -573,6 +646,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) - #ifdef XWL_HAS_GLAMOR - xwl_screen->glamor = 1; - #endif -+ xwl_screen->global_output_scale = 1; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-rootless") == 0) { -@@ -743,6 +817,12 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) - if (xwl_screen->allow_commits_prop == BAD_RESOURCE) - return FALSE; - -+ xwl_screen->global_output_scale_prop = MakeAtom(global_output_scale, -+ strlen(global_output_scale), -+ TRUE); -+ if (xwl_screen->global_output_scale_prop == BAD_RESOURCE) -+ return FALSE; -+ - AddCallback(&PropertyStateCallback, xwl_property_callback, pScreen); - - xwl_screen_roundtrip(xwl_screen); -diff --git a/hw/xwayland/xwayland-screen.h b/hw/xwayland/xwayland-screen.h -index b965dddd7f964b1d100bbb9d10da1c35ab39810e..7446829d098fbe235e605084a016daff1a8eaea2 100644 ---- a/hw/xwayland/xwayland-screen.h -+++ b/hw/xwayland/xwayland-screen.h -@@ -72,6 +72,8 @@ struct xwl_screen { - struct xorg_list damage_window_list; - struct xorg_list window_list; - -+ int32_t global_output_scale; -+ - int wayland_fd; - struct wl_display *display; - struct wl_registry *registry; -@@ -107,6 +109,7 @@ struct xwl_screen { - struct glamor_context *glamor_ctx; - - Atom allow_commits_prop; -+ Atom global_output_scale_prop; - - /* The preferred GLVND vendor. If NULL, "mesa" is assumed. */ - const char *glvnd_vendor; -@@ -134,5 +137,7 @@ void xwl_screen_roundtrip (struct xwl_screen *xwl_screen); - void xwl_surface_damage(struct xwl_screen *xwl_screen, - struct wl_surface *surface, - int32_t x, int32_t y, int32_t width, int32_t height); -+int xwl_scale_to(struct xwl_screen *xwl_screen, int value); -+void xwl_screen_set_global_scale(struct xwl_screen *xwl_screen, int32_t scale); - - #endif /* XWAYLAND_SCREEN_H */ -diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c -index 00f161eda084e335ac07471a2198176d75d9fcf0..ed3903853f0dab1dad390cd8429639541546157d 100644 ---- a/hw/xwayland/xwayland-window.c -+++ b/hw/xwayland/xwayland-window.c -@@ -470,7 +470,8 @@ ensure_surface_for_window(WindowPtr window) - } - - wl_region_add(region, 0, 0, -- window->drawable.width, window->drawable.height); -+ xwl_scale_to(xwl_screen, window->drawable.width), -+ xwl_scale_to(xwl_screen, window->drawable.height)); - wl_surface_set_opaque_region(xwl_window->surface, region); - wl_region_destroy(region); - } -@@ -820,6 +821,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window) - #endif - - wl_surface_attach(xwl_window->surface, buffer, 0, 0); -+ wl_surface_set_buffer_scale(xwl_window->surface, xwl_screen->global_output_scale); - - /* Arbitrary limit to try to avoid flooding the Wayland - * connection. If we flood it too much anyway, this could - diff --git a/foreign/dotfiles/pkgs/patches/xwayland-vsync.patch b/foreign/dotfiles/pkgs/patches/xwayland-vsync.patch deleted file mode 100644 index 375db88..0000000 --- a/foreign/dotfiles/pkgs/patches/xwayland-vsync.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -824,7 +824,8 @@ - dixDestroyPixmap(vblank->pixmap, vblank->pixmap->drawable.id); - vblank->pixmap = NULL; - -- if (xwl_present_queue_vblank(screen, window, vblank->crtc, -+ if (vblank->target_msc > crtc_msc && -+ xwl_present_queue_vblank(screen, window, vblank->crtc, - vblank->event_id, crtc_msc + 1) - == Success) - return; diff --git a/foreign/dotfiles/pkgs/regreet/default.nix b/foreign/dotfiles/pkgs/regreet/default.nix deleted file mode 100644 index e64de02..0000000 --- a/foreign/dotfiles/pkgs/regreet/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - rustPlatform, - lib, - fetchFromGitHub, - pkg-config, - glib, - gtk4, - pango, -}: -rustPlatform.buildRustPackage { - pname = "regreet"; - version = "unstable-2023-03-12"; - - src = fetchFromGitHub { - owner = "rharish101"; - repo = "ReGreet"; - rev = "afd124b369bd36be0985f246a59df75f27b1f171"; - sha256 = "sha256-Mlyw+OI6f7YeykReEDDAKpdGHaIpl3HzUTuZjgiFzAk="; - }; - - cargoHash = "sha256-koz6bSmBvoW0R3sRgJU2Hizr2CVsGFDyqoPov/F0VL8="; - - buildFeatures = ["gtk4_8"]; - - nativeBuildInputs = [pkg-config]; - buildInputs = [glib gtk4 pango]; - - meta = with lib; { - description = "Clean and customizable greeter for greetd"; - homepage = "https://github.com/rharish101/ReGreet"; - license = licenses.gpl3Plus; - maintainers = with maintainers; [fufexan]; - platforms = platforms.linux; - }; -} diff --git a/foreign/dotfiles/pkgs/repl/default.nix b/foreign/dotfiles/pkgs/repl/default.nix deleted file mode 100644 index dd4d6ee..0000000 --- a/foreign/dotfiles/pkgs/repl/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -# modified from https://github.com/gytis-ivaskevicius/flake-utils/plus -{ - coreutils, - gnused, - writeShellScriptBin, -}: let - repl = ../../lib/repl.nix; - example = command: desc: ''\n\u001b[33m ${command}\u001b[0m - ${desc}''; -in - writeShellScriptBin "repl" '' - case "$1" in - "-h"|"--help"|"help") - printf "%b\n\e[4mUsage\e[0m: \ - ${example "repl" "Loads system flake if available."} \ - ${example "repl /path/to/flake.nix" "Loads specified flake."}\n" - ;; - *) - if [ -z "$1" ]; then - nix repl ${repl} - else - nix repl --arg flakePath $(${coreutils}/bin/readlink -f $1 | ${gnused}/bin/sed 's|/flake.nix||') ${repl} - fi - ;; - esac - '' diff --git a/foreign/dotfiles/pkgs/spotify/default.nix b/foreign/dotfiles/pkgs/spotify/default.nix deleted file mode 100644 index b975e02..0000000 --- a/foreign/dotfiles/pkgs/spotify/default.nix +++ /dev/null @@ -1,209 +0,0 @@ -{ - fetchurl, - lib, - stdenv, - squashfsTools, - xorg, - alsa-lib, - makeWrapper, - wrapGAppsHook, - openssl, - freetype, - glib, - pango, - cairo, - atk, - gdk-pixbuf, - gtk3, - cups, - nspr, - nss, - libpng, - libnotify, - libgcrypt, - systemd, - fontconfig, - dbus, - expat, - ffmpeg, - curlWithGnuTls, - zlib, - gnome, - at-spi2-atk, - at-spi2-core, - libpulseaudio, - libdrm, - mesa, - libxkbcommon, - # High-DPI support: Spotify's --force-device-scale-factor argument - # not added if `null`, otherwise, should be a number. - deviceScaleFactor ? null, -}: let - # TO UPDATE: just execute the ./update.sh script (won't do anything if there is no update) - # "rev" decides what is actually being downloaded - # If an update breaks things, one of those might have valuable info: - # https://aur.archlinux.org/packages/spotify/ - # https://community.spotify.com/t5/Desktop-Linux - version = "1.1.99.878.g1e4ccc6e"; - # To get the latest stable revision: - # curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/spotify?channel=stable' | jq '.download_url,.version,.last_updated' - # To get general information: - # curl -H 'Snap-Device-Series: 16' 'https://api.snapcraft.io/v2/snaps/info/spotify' | jq '.' - # More examples of api usage: - # https://github.com/canonical-websites/snapcraft.io/blob/master/webapp/publisher/snaps/views.py - rev = "62"; - - deps = [ - alsa-lib - at-spi2-atk - at-spi2-core - atk - cairo - cups - curlWithGnuTls - dbus - expat - ffmpeg - fontconfig - freetype - gdk-pixbuf - glib - gtk3 - libdrm - libgcrypt - libnotify - libpng - libpulseaudio - libxkbcommon - mesa - nss - pango - stdenv.cc.cc - systemd - xorg.libICE - xorg.libSM - xorg.libX11 - xorg.libxcb - xorg.libXcomposite - xorg.libXcursor - xorg.libXdamage - xorg.libXext - xorg.libXfixes - xorg.libXi - xorg.libXrandr - xorg.libXrender - xorg.libXScrnSaver - xorg.libxshmfence - xorg.libXtst - zlib - ]; -in - stdenv.mkDerivation { - pname = "spotify"; - inherit version; - - # fetch from snapcraft instead of the debian repository most repos fetch from. - # That is a bit more cumbersome. But the debian repository only keeps the last - # two versions, while snapcraft should provide versions indefinately: - # https://forum.snapcraft.io/t/how-can-a-developer-remove-her-his-app-from-snap-store/512 - - # This is the next-best thing, since we're not allowed to re-distribute - # spotify ourselves: - # https://community.spotify.com/t5/Desktop-Linux/Redistribute-Spotify-on-Linux-Distributions/td-p/1695334 - src = fetchurl { - url = "https://api.snapcraft.io/api/v1/snaps/download/pOBIoZ2LrCB3rDohMxoYGnbN14EHOgD7_${rev}.snap"; - sha512 = "9b8f63c067632f15f5abf6449d09d28fd56839decfc9801d4526cf5b97b9cb5933ede179bcd0b0f2d8b6d4c7e72f55c7fc13dfb0ae4293ef447ead1d018b9cc6"; - }; - - nativeBuildInputs = [makeWrapper wrapGAppsHook squashfsTools]; - - dontStrip = true; - dontPatchELF = true; - - unpackPhase = '' - runHook preUnpack - unsquashfs "$src" '/usr/share/spotify' '/usr/bin/spotify' '/meta/snap.yaml' - cd squashfs-root - if ! grep -q 'grade: stable' meta/snap.yaml; then - # Unfortunately this check is not reliable: At the moment (2018-07-26) the - # latest version in the "edge" channel is also marked as stable. - echo "The snap package is marked as unstable:" - grep 'grade: ' meta/snap.yaml - echo "You probably chose the wrong revision." - exit 1 - fi - if ! grep -q '${version}' meta/snap.yaml; then - echo "Package version differs from version found in snap metadata:" - grep 'version: ' meta/snap.yaml - echo "While the nix package specifies: ${version}." - echo "You probably chose the wrong revision or forgot to update the nix version." - exit 1 - fi - runHook postUnpack - ''; - - # Prevent double wrapping - dontWrapGApps = true; - - installPhase = '' - runHook preInstall - - libdir=$out/lib/spotify - mkdir -p $libdir - mv ./usr/* $out/ - - cp meta/snap.yaml $out - - # Work around Spotify referring to a specific minor version of - # OpenSSL. - - ln -s ${lib.getLib openssl}/lib/libssl.so $libdir/libssl.so.1.0.0 - ln -s ${lib.getLib openssl}/lib/libcrypto.so $libdir/libcrypto.so.1.0.0 - ln -s ${nspr.out}/lib/libnspr4.so $libdir/libnspr4.so - ln -s ${nspr.out}/lib/libplc4.so $libdir/libplc4.so - - ln -s ${ffmpeg.lib}/lib/libavcodec.so* $libdir - ln -s ${ffmpeg.lib}/lib/libavformat.so* $libdir - - rpath="$out/share/spotify:$libdir" - - patchelf \ - --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath $rpath $out/share/spotify/spotify - - librarypath="${lib.makeLibraryPath deps}:$libdir" - wrapProgram $out/share/spotify/spotify \ - ''${gappsWrapperArgs[@]} \ - ${lib.optionalString (deviceScaleFactor != null) '' - --add-flags "--force-device-scale-factor=${toString deviceScaleFactor}" \ - ''} \ - --prefix LD_LIBRARY_PATH : "$librarypath" \ - --prefix PATH : "${gnome.zenity}/bin" - - # fix Icon line in the desktop file (#48062) - sed -i "s:^Icon=.*:Icon=spotify-client:" "$out/share/spotify/spotify.desktop" - - # Desktop file - mkdir -p "$out/share/applications/" - cp "$out/share/spotify/spotify.desktop" "$out/share/applications/" - - # Icons - for i in 16 22 24 32 48 64 128 256 512; do - ixi="$i"x"$i" - mkdir -p "$out/share/icons/hicolor/$ixi/apps" - ln -s "$out/share/spotify/icons/spotify-linux-$i.png" \ - "$out/share/icons/hicolor/$ixi/apps/spotify-client.png" - done - - runHook postInstall - ''; - - meta = with lib; { - homepage = "https://www.spotify.com/"; - description = "Play music from the Spotify music service"; - sourceProvenance = with sourceTypes; [binaryNativeCode]; - license = licenses.unfree; - maintainers = with maintainers; [eelco ftrvxmtrx sheenobu mudri timokau ma27]; - platforms = ["x86_64-linux"]; - }; - } diff --git a/foreign/dotfiles/pkgs/sway-hidpi.nix b/foreign/dotfiles/pkgs/sway-hidpi.nix deleted file mode 100644 index 85022d2..0000000 --- a/foreign/dotfiles/pkgs/sway-hidpi.nix +++ /dev/null @@ -1,51 +0,0 @@ -prev: let - sway-hidpi = prev.sway.override { - inherit sway-unwrapped; - withGtkWrapper = true; - }; - - sway-unwrapped = - (prev.sway-unwrapped.overrideAttrs (oa: { - src = prev.fetchFromGitHub { - owner = "swaywm"; - repo = "sway"; - rev = "8d8a21c9c321fa41b033caf9b5b62cdd584483c1"; - sha256 = "sha256-WRvJsSvDv2+qirqkpaV2c7fFOgJAT3sXxPtKLure580="; - }; - - buildInputs = oa.buildInputs ++ [prev.pcre2 prev.xorg.xcbutilwm]; - })) - .override {wlroots_0_16 = wlroots-sway;}; - - wlroots-sway = - (prev.wlroots.overrideAttrs (_: { - src = prev.fetchFromGitLab { - domain = "gitlab.freedesktop.org"; - owner = "wlroots"; - repo = "wlroots"; - rev = "add44b3e2e4ff7ef98b16813fb3c9e1d8b398008"; - sha256 = "sha256-/fJGHeDuZ9aLjCSxILqNSm2aMrvlLZMZpx/WzX5A/XU="; - }; - - patches = [ - (prev.fetchpatch { - url = "https://gitlab.freedesktop.org/lilydjwg/wlroots/-/commit/6c5ffcd1fee9e44780a6a8792f74ecfbe24a1ca7.diff"; - sha256 = "sha256-Eo1pTa/PIiJsRZwIUnHGTIFFIedzODVf0ZeuXb0a3TQ="; - }) - (prev.fetchpatch { - url = "https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/18595000f3a21502fd60bf213122859cc348f9af.diff"; - sha256 = "sha256-jvfkAMh3gzkfuoRhB4E9T5X1Hu62wgUjj4tZkJm0mrI="; - revert = true; - }) - ]; - })) - .override {inherit xwayland;}; - - xwayland = prev.xwayland.overrideAttrs (_: { - patches = [ - ./patches/xwayland-vsync.patch - ./patches/xwayland-hidpi.patch - ]; - }); -in - sway-hidpi diff --git a/foreign/dotfiles/pkgs/waveform/default.nix b/foreign/dotfiles/pkgs/waveform/default.nix deleted file mode 100644 index f45c747..0000000 --- a/foreign/dotfiles/pkgs/waveform/default.nix +++ /dev/null @@ -1,126 +0,0 @@ -{ - alsa-lib, - atk, - cairo, - cups, - curl, - dbus, - dpkg, - expat, - fetchurl, - fontconfig, - freetype, - gdk-pixbuf, - glib, - gnome2, - gtk3, - gtk4, - lib, - libX11, - libxcb, - libXScrnSaver, - libXcomposite, - libXcursor, - libXdamage, - libXext, - libXfixes, - libXi, - libXrandr, - libXrender, - libXtst, - libdrm, - libnotify, - libpulseaudio, - libuuid, - libxshmfence, - mesa, - nspr, - nss, - pango, - stdenv, - at-spi2-atk, - at-spi2-core, - autoPatchelfHook, - wrapGAppsHook, -}: let - mirror = "https://cdn.tracktion.com/file/tracktiondownload/waveform"; -in - stdenv.mkDerivation rec { - pname = "waveform"; - version = "11.5.18"; - pversion = lib.concatStrings (lib.remove "." (lib.stringToCharacters version)); - - src = fetchurl { - url = "${mirror}/${pversion}/${pname}_64bit_v${version}.deb"; - sha256 = "sha256-kRqgiIfgpmkPOwAuSuxhi/H18ezgicRo+wbTWeFaweU="; - }; - - unpackCmd = "${dpkg}/bin/dpkg-deb -x $curSrc ."; - - nativeBuildInputs = [ - autoPatchelfHook - wrapGAppsHook - ]; - - # not sure how much of this all is needed - buildInputs = [ - alsa-lib - at-spi2-atk - at-spi2-core - atk - cairo - cups - curl - dbus - expat - fontconfig.lib - freetype - gdk-pixbuf - glib - gnome2.GConf - gtk3 - libX11 - libXScrnSaver - libXcomposite - libXcursor - libXdamage - libXext - libXfixes - libXi - libXrandr - libXrender - libXtst - libdrm - libnotify - libuuid - libxcb - libxshmfence - mesa - nspr - nss - pango - stdenv.cc.cc.lib - ]; - - runtimeDependencies = [ - # without this, it complains about not finding libcurl - curl.out - - # not sure if needed - libpulseaudio.out - gtk3 - gtk4 - ]; - - installPhase = '' - mkdir -p $out - cp -r . $out/ - ''; - - meta = with lib; { - homepage = "https://www.tracktion.com/welcome/waveform-free"; - description = "Waveform DAW"; - platforms = ["x86_64-linux"]; - license = licenses.unfree; - }; - } diff --git a/foreign/dotfiles/secrets/secrets.nix b/foreign/dotfiles/secrets/secrets.nix deleted file mode 100644 index 63d0b8a..0000000 --- a/foreign/dotfiles/secrets/secrets.nix +++ /dev/null @@ -1,7 +0,0 @@ -let - mihai = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH81M2NZOzd5tGGRsDv//wkSrVNJJpaiaLghPZBH8VTd"; - - io = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMRDsoSresP7/VnrQOYsWWO/5V+EdPEx5PwI0DxW9H00 root@io"; -in { - "spotify.age".publicKeys = [mihai io]; -} diff --git a/foreign/dotfiles/secrets/spotify.age b/foreign/dotfiles/secrets/spotify.age deleted file mode 100644 index d1809ac..0000000 --- a/foreign/dotfiles/secrets/spotify.age +++ /dev/null @@ -1,10 +0,0 @@ -age-encryption.org/v1 --> ssh-ed25519 gC7Y0g gNDFkWou+lP6bb/DeykjpLnU58Q02WSNf9MuIbKgtg8 -EFqUCkPKPV169Nq2Fxw77v/hLMMfsBZtiyfHibGCrso --> ssh-ed25519 4DWTmg Cb32NOKXPGY2vmdJjjpvDccA+NFqhLU+VN1h86jRlFM -9s2hXLh51mxkq4vLdZIT9F9og2bPPGvQrC4EGmo0ekw --> 3%I0CmT-grease p = g)aHR,b0 -MvuI9zJMrw9+vKpsRGf6x4ltLg ---- 4kybI/sbTweYmJf5sG5vu6eF3HTZlkCM+gqRgdsk86A - $Y̌4&)Xmd>Sf]V$ -> \ No newline at end of file diff --git a/home/bolt.nix b/home/bolt.nix old mode 100755 new mode 100644 index 33d1274..79cacb5 --- a/home/bolt.nix +++ b/home/bolt.nix @@ -1,114 +1,15 @@ -{ config, pkgs, lib, ... }: - -let - flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz"; - - hyprland = (import flake-compat { - src = builtins.fetchTarball "https://github.com/hyprwm/Hyprland/archive/master.tar.gz"; - }).defaultNix; - - - wlogout_style_base = dots/wlogout/style.css; - wlogout_style = pkgs.runCommandLocal "wlogout_style_base" {wlogpath = lib.strings.escape ["/"] "${pkgs.wlogout}";} '' - cp ${wlogout_style_base} $out - sed -i "s/\/usr\/share\/wlogout/$wlogpath\/share\/wlogout/g" $out - sed -i "s/\/etc\/wlogout/$wlogpath\/etc\/wlogout/g" $out - ''; - -in { +{ + pkgs, + ... +}: +{ imports = [ - hyprland.homeManagerModules.default - ../foreign/dotfiles/home/programs/eww/default.nix - ]; - - nixpkgs.overlays = [ - (self: super: { - kwin-system76-scheduler-integration = pkgs.libsForQt5.callPackage ../system/syspkgs/kwin-system76-scheduler-integration.nix {}; - hyprland-s76 = pkgs.callPackage ../system/syspkgs/hyprland-system76-scheduler-integration.nix {}; - swayosd = pkgs.callPackage ./homepkgs/swayosd.nix {}; - }) + ./home.nix ]; - programs.eww-hyprland = { - enable = true; - colors = builtins.readFile dots/eww/colors.scss; - }; - - - home.username = "bolt"; - home.homeDirectory = "/home/bolt"; - - home.packages = with pkgs; [ - zellij - xonotic - nicotine-plus - - glib # for gsettings - - fuzzel - grim - slurp - swaybg - wlogout - wf-recorder - libnotify - xorg.xrdb - swayidle - swaynotificationcenter - swayosd - waylock - - playerctl - ]; - - xdg.configFile = builtins.mapAttrs (name: value: { enable=true; text=builtins.readFile value; }) - { - "wlogout/layout" = dots/wlogout/layout; - "wlogout/style.css" = wlogout_style; - "swaync/config.json" = dots/swaync/config.json; - "swaync/configSchema.json" = dots/swaync/configSchema.json; - "swaync/style.css" = dots/swaync/style.css; - "fuzzel/fuzzel.ini" = dots/fuzzel/fuzzel.ini; - }; - - wayland.windowManager.hyprland = { - enable = true; - systemdIntegration = true; - nvidiaPatches = true; - xwayland = { - enable = true; - hidpi = false; - }; - recommendedEnvironment = true; - extraConfig = builtins.readFile dots/hyprland/hyprland.conf; - }; - - systemd.user.startServices = true; - systemd.user.services."com.system76.Scheduler.dbusproxy" = { - Unit = { - Description = "the system76 process scheduler kwin dbus proxy"; - Requires = [ "dbus.service" ]; - }; - Install = { - WantedBy = [ "graphical-session.target" "default.target" ]; - }; - Service = { - ExecStart = ''${pkgs.kwin-system76-scheduler-integration}/bin/kwin-system76-scheduler-dbus-proxy.sh''; - }; - }; - - systemd.user.services."hyprland-system76" = { - Unit = { - Description = "the hyprland process scheduler hook"; - Requires = [ "dbus.service" ]; - }; - Install = { - WantedBy = [ "graphical-session.target" "default.target" ]; - }; - Service = { - ExecStart = ''${pkgs.hyprland-s76}/bin/hyprland-system76-scheduler-hook.sh''; - }; + home.packages = builtins.attrValues { + inherit (pkgs) nicotine-plus; }; } diff --git a/home/config.nix b/home/config.nix deleted file mode 100755 index 69baf10..0000000 --- a/home/config.nix +++ /dev/null @@ -1 +0,0 @@ -{ allowUnfree = true; } diff --git a/home/dots/Xresources b/home/dots/Xresources new file mode 100644 index 0000000..af1d2c9 --- /dev/null +++ b/home/dots/Xresources @@ -0,0 +1,37 @@ + +! special +*.foreground: #d3dae3 +*.background: #181b28 +*.cursorColor: #d3dae3 + +! black +*.color0: #2f343f +*.color8: #1e2233 + +! red +*.color1: #ed244e +*.color9: #da4453 + +! green +*.color2: #27ae60 +*.color10: #71f79f + +! yellow +*.color3: #f67400 +*.color11: #fdbc4b + +! blue +*.color4: #2980b9 +*.color12: #1d99f3 + +! magenta +*.color5: #c50ed2 +*.color13: #9b59b6 + +! cyan +*.color6: #3daee9 +*.color14: #5294e2 + +! white +*.color7: #a1a9b1 +*.color15: #656a73 \ No newline at end of file diff --git a/home/dots/eww/colors.scss b/home/dots/eww/colors.scss deleted file mode 100644 index d4076e3..0000000 --- a/home/dots/eww/colors.scss +++ /dev/null @@ -1,33 +0,0 @@ -$black: #2f343f; -$black_a: #1e2233; - -$red: #ed244e; -$red_a: #da4453; - -$green: #27ae60; -$green_a: #71f79f; - -$yellow: #f67400; -$yellow_a: #fdbc4b; - -$blue: #2980b9; -$blue_a: #1d99f3; - -$magenta: #c50ed2; -$magenta_a: #9b59b6; - -$cyan: #3daee9; -$cyan_a: #5294e2; - -$white: #a1a9b1; -$white_a: #656a73; - -$fg: #d3dae3; -$bg: #060604; - -$border: $red; -$shadow: $black; -$base: $bg; -$bg1: $black; -$text: $fg; -$outline: $black; diff --git a/home/dots/fuzzel/fuzzel.ini b/home/dots/fuzzel/fuzzel.ini deleted file mode 100644 index 570a865..0000000 --- a/home/dots/fuzzel/fuzzel.ini +++ /dev/null @@ -1,17 +0,0 @@ -dpi-aware=no -font=Montreux Classic:size=14 -icon-theme=Papirus-Dark -terminal=kitty -[dmenu] -exit-immediately-if-empty=yes -[border] -width=3 -radius=24 -[colors] -background="060604FF" -text="d3dae3FF" -selection="ed244eFF" -selection-text="d3dae3ff" -selection-match="71f79fff" -match="27ae60FF" -border="2f343fFF" diff --git a/home/dots/hyprland/hyprland.conf b/home/dots/hyprland/hyprland.conf deleted file mode 100644 index a442607..0000000 --- a/home/dots/hyprland/hyprland.conf +++ /dev/null @@ -1,131 +0,0 @@ -exec-once = eww open bar -exec-once = swayidle -w timeout 300 'waylock' -exec-once = swayidle -w timeout 600 'systemctl suspend' after-resume 'eww open bar' -exec-once = ckb-next -c -b -exec-once = swaybg -i $HOME/Downloads/fantastyland-dark.png -m fill -exec-once = xrdb -l ~/.Xresources -exec-once = swayosd -exec-once = keepassxc -exec = eww reload -exec = gsettings set org.gnome.desktop.interface gtk-theme 'Sweet-Dark' -exec = gsettings set org.gnome.desktop.interface font-name 'Montreux Classic' -exec = gsettings set org.gnome.desktop.interface icon-theme 'Papirus-Dark' - -input { - kb_layout=us - kb_options=caps:escape,escape:caps - sensitivity=0.0 - accel_profile=flat -} - -general { - layout=dwindle - border_size=3 - gaps_in=10 - gaps_out=20 - resize_on_border=true - hover_icon_on_border=true - col.active_border=0xffa1a9b1 - col.inactive_border=0xff2f343f - col.group_border=0xffda4453 - col.group_border_active=0xffed244e -} - -dwindle { - preserve_split=true - pseudotile=true - use_active_for_splits=true - no_gaps_when_only=false -} - -decoration { - rounding=8 - blur=0 - # screen_shader=/home/bolt/Code/desktop.frag -} - -misc { - vfr=true - vrr=1 - mouse_move_enables_dpms=true - key_press_enables_dpms=true -} - -animations { - enabled=1 - bezier=overshot,0.05,0.9,0.1,1.1 - bezier=smooth,0.06,0.94,0.1,1.0 - bezier=slosmooth,0.1,0.89,0.14,0.96 - animation=windows,1,6,overshot,popin - animation=workspaces,1,6,smooth,slidevert - animation=specialWorkspace,1,6,overshot,slide -} - -misc { - disable_hyprland_logo=true - disable_splash_rendering=true -} - -monitor=,highrr,auto,1 - -windowrule=noanim,^(wlogout)$ -windowrule=workspace special silent,^(keepassxc)$ -windowrulev2 = workspace special silent, title:(KeePassXC)$ - - -bindm=SUPER,mouse:272,movewindow -bindm=SUPER,mouse:273,resizewindow -bind=SUPER,Return,exec,kitty -bind=SUPER,E,exec,kitty joshuto -bind=SUPER,F,exec,firefox -bind=SUPER,D,exec,fuzzel -bind=SUPER,N,exec,swaync-client -t - -bind=SUPER_SHIFT,Q,killactive -bind=SUPER_SHIFT,space,fullscreen,0 -bind=SUPER,space,togglefloating -bind=SUPER,space,centerwindow - - -bind=SUPER,h,movefocus,l -bind=SUPER,l,movefocus,r -bind=SUPER,j,movefocus,d -bind=SUPER,k,movefocus,u -bind=SUPER_SHIFT,h,movewindow,l -bind=SUPER_SHIFT,l,movewindow,r -bind=SUPER_SHIFT,j,movewindow,d -bind=SUPER_SHIFT,k,movewindow,u - -bind=SUPER,s,togglesplit -bind=SUPER,a,changegroupactive,f -bind=SUPER,z,changegroupactive,b -bind=SUPER,x,togglegroup - -bind=SUPER,1,workspace,1 -bind=SUPER,2,workspace,2 -bind=SUPER,3,workspace,3 -bind=SUPER,4,workspace,4 -bind=SUPER_SHIFT,1,movetoworkspacesilent,1 -bind=SUPER_SHIFT,2,movetoworkspacesilent,2 -bind=SUPER_SHIFT,3,movetoworkspacesilent,3 -bind=SUPER_SHIFT,4,movetoworkspacesilent,4 - -bind=SUPER_CTRL,h,resizeactive,-40 0 -bind=SUPER_CTRL,l,resizeactive,40 0 -bind=SUPER_CTRL,j,resizeactive,0 -40 -bind=SUPER_CTRL,k,resizeactive,0 40 - -bind=SUPER,minus,togglespecialworkspace -bind=SUPER_SHIFT,minus,movetoworkspace,special - -bind=SUPER_SHIFT,S,exec,grim -g "$(slurp)" -t png -o "$HOME/Pictures/$(date +%F_%H-%m-%S).png" && notify-send "Screenshot taken." -bind=SUPER_SHIFT_CTRL,S,exec,if [[ $(pgrep wf-recorder; echo $?) -eq 0 ]]; then wf-recorder -a -f "$HOME/Videos/recording_$(date +%F_%H-%m-%S).mp4" & notify-send "Recording desktop.."; else pkill wf-recorder && notify-send "Recording complete."; fi -bind=SUPER_SHIFT,E,exec,wlogout -bind=,XF86AudioMute,exec,swayosd --output-volume mute-toggle -bind=,XF86AudioRaiseVolume,exec,swayosd --output-volume raise -bind=,XF86AudioLowerVolume,exec,swayosd --output-volume lower -bind=,XF86AudioStop,exec,playerctl stop -bind=,XF86AudioPlay,exec,playerctl play-pause -bind=,XF86AudioPrev,exec,playerctl previous -bind=,XF86AudioNext,exec,playerctl next - diff --git a/home/dots/swaync/config.json b/home/dots/swaync/config.json deleted file mode 100644 index 9d51c9c..0000000 --- a/home/dots/swaync/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "$schema": "~/.config/swaync/configSchema.json", - - "positionX": "center", - "positionY": "bottom", - "control-center-positionX": "none", - "control-center-positionY": "top", - "control-center-margin-top": 8, - "control-center-margin-bottom": 8, - "control-center-margin-right": 8, - "control-center-margin-left": 8, - "control-center-width": 500, - "control-center-height": 600, - "fit-to-screen": false, - - "layer": "overlay", - "cssPriority": "user", - "notification-icon-size": 64, - "notification-body-image-height": 100, - "notification-body-image-width": 200, - "timeout": 6, - "timeout-low": 6, - "timeout-critical": 0, - "notification-window-width": 600, - "keyboard-shortcuts": true, - "image-visibility": "when-available", - "transition-time": 200, - "hide-on-clear": true, - "hide-on-action": true, - "script-fail-notify": true, - - "widgets": [ - "inhibitors", - "title", - "dnd", - "mpris", - "notifications" - ], - "widget-config": { - "inhibitors": { - "text": "Inhibitors", - "button-text": "Clear All", - "clear-all-button": true - }, - "title": { - "text": "Notifications", - "clear-all-button": false, - "button-text": "Clear All" - }, - "dnd": { - "text": "Do Not Disturb" - }, - "label": { - "max-lines": 5, - "text": "Label Text" - }, - "mpris": { - "image-size": 96, - "image-radius": 12 - } - } -} diff --git a/home/dots/swaync/configSchema.json b/home/dots/swaync/configSchema.json deleted file mode 100644 index 6308a47..0000000 --- a/home/dots/swaync/configSchema.json +++ /dev/null @@ -1,523 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "SwayNotificationCenter JSON schema", - "type": "object", - "additionalProperties": false, - "properties": { - "$schema": { - "type": "string", - "description": "Pointer to the schema against which this document should be validated." - }, - "positionX": { - "type": "string", - "description": "Horizontal position of control center and notification window", - "default": "right", - "enum": ["right", "left", "center"] - }, - "layer": { - "type": "string", - "description": "Layer of control center window", - "default": "top", - "enum": ["background", "bottom", "top", "overlay"] - }, - "cssPriority": { - "type": "string", - "description": "Which GTK priority to use when loading the default and user CSS files. Pick \"user\" to override XDG_CONFIG_HOME/gtk-3.0/gtk.css", - "default": "application", - "enum": ["application", "user"] - }, - "positionY": { - "type": "string", - "description": "Vertical position of control center and notification window", - "default": "top", - "enum": ["top", "bottom"] - }, - "control-center-positionX": { - "type": "string", - "description": "Optional: Horizontal position of the control center. Supersedes positionX if not set to `none`", - "default": "none", - "enum": ["right", "left", "center", "none"] - }, - "control-center-positionY": { - "type": "string", - "description": "Optional: Vertical position of the control center. Supersedes positionY if not set to `none`", - "default": "none", - "enum": ["top", "bottom", "none"] - }, - "control-center-margin-top": { - "type": "integer", - "description": "The margin (in pixels) at the top of the notification center. 0 to disable", - "default": 0 - }, - "control-center-margin-bottom": { - "type": "integer", - "description": "The margin (in pixels) at the bottom of the notification center. 0 to disable", - "default": 0 - }, - "control-center-margin-right": { - "type": "integer", - "description": "The margin (in pixels) at the right of the notification center. 0 to disable", - "default": 0 - }, - "control-center-margin-left": { - "type": "integer", - "description": "The margin (in pixels) at the left of the notification center. 0 to disable", - "default": 0 - }, - "notification-icon-size": { - "type": "integer", - "description": "The notification icon size (in pixels)", - "default": 64, - "minimum": 16 - }, - "notification-body-image-height": { - "type": "integer", - "description": "The notification body image height (in pixels)", - "default": 100, - "minimum": 100 - }, - "notification-body-image-width": { - "type": "integer", - "description": "The notification body image width (in pixels)", - "default": 200, - "minimum": 200 - }, - "timeout": { - "type": "integer", - "description": "The notification timeout for notifications with normal priority", - "default": 10 - }, - "timeout-low": { - "type": "integer", - "description": "The notification timeout for notifications with low priority", - "default": 5 - }, - "timeout-critical": { - "type": "integer", - "description": "The notification timeout for notifications with critical priority. 0 to disable", - "default": 0 - }, - "notification-window-width": { - "type": "integer", - "description": "Width of the notification in pixels", - "default": 500 - }, - "fit-to-screen": { - "type": "boolean", - "description": "If the control center should expand to both edges of the screen", - "default": true - }, - "control-center-height": { - "type": "integer", - "description": "Height of the control center in pixels. Ignored when 'fit-to-screen' is set to 'true'", - "default": 600, - "minimum": 300 - }, - "control-center-width": { - "type": "integer", - "description": "Width of the control center in pixels", - "default": 500, - "minimum": 300 - }, - "keyboard-shortcuts": { - "type": "boolean", - "description": "If control center should use keyboard shortcuts", - "default": true - }, - "image-visibility": { - "type": "string", - "description": "An explanation about the purpose of this instance.", - "default": "when-available", - "enum": ["always", "when-available", "never"] - }, - "transition-time": { - "type": "integer", - "description": "The notification animation duration. 0 to disable", - "default": 200 - }, - "hide-on-clear": { - "type": "boolean", - "description": "Hides the control center after pressing \"Clear All\"", - "default": false - }, - "hide-on-action": { - "type": "boolean", - "description": "Hides the control center when clicking on notification action", - "default": true - }, - "script-fail-notify": { - "type": "boolean", - "description": "Sends a notification if a script fails to run", - "default": true - }, - "scripts": { - "type": "object", - "description": "Which scripts to check and potentially run for every notification. If the notification doesn't include one of the properties, that property will be ignored. All properties (except for exec) use regex. If all properties match the given notification, the script will be run. Only the first matching script will be run.", - "minProperties": 1, - "additionalProperties": false, - "patternProperties": { - "^.{1,}$": { - "type": "object", - "description": "Your script object.", - "required": ["exec"], - "minProperties": 2, - "additionalProperties": false, - "properties": { - "exec": { - "type": "string", - "description": "The script to run. Can also run regular shell commands." - }, - "app-name": { - "type": "string", - "description": "The app-name. Uses Regex." - }, - "desktop-entry": { - "type": "string", - "description": "The desktop-entry. Uses Regex." - }, - "summary": { - "type": "string", - "description": "The summary of the notification. Uses Regex." - }, - "body": { - "type": "string", - "description": "The body of the notification. Uses Regex." - }, - "urgency": { - "type": "string", - "description": "The urgency of the notification.", - "default": "Normal", - "enum": ["Low", "Normal", "Critical"] - }, - "category": { - "type": "string", - "description": "Which category the notification belongs to. Uses Regex." - }, - "run-on": { - "type": "string", - "description": "Whether to run the script on an action being activated, or when the notification is received.", - "enum": ["action", "receive"], - "default": "receive" - } - } - } - } - }, - "notification-visibility": { - "type": "object", - "description": "Set the visibility of each incoming notification. If the notification doesn't include one of the properties, that property will be ignored. All properties (except for state) use regex. If all properties match the given notification, the notification will be follow the provided state. Only the first matching object will be used.", - "minProperties": 1, - "additionalProperties": false, - "patternProperties": { - "^.{1,}$": { - "type": "object", - "description": "Your script object.", - "required": ["state"], - "minProperties": 2, - "additionalProperties": false, - "properties": { - "state": { - "type": "string", - "description": "The notification visibility state.", - "default": "enabled", - "enum": ["ignored", "muted", "enabled", "transient"] - }, - "app-name": { - "type": "string", - "description": "The app-name. Uses Regex." - }, - "desktop-entry": { - "type": "string", - "description": "The desktop-entry. Uses Regex." - }, - "summary": { - "type": "string", - "description": "The summary of the notification. Uses Regex." - }, - "body": { - "type": "string", - "description": "The body of the notification. Uses Regex." - }, - "urgency": { - "type": "string", - "description": "The urgency of the notification.", - "default": "Normal", - "enum": ["Low", "Normal", "Critical"] - }, - "override-urgency": { - "type": "string", - "description": "The new urgency of the notification (optional)", - "default": "unset", - "enum": ["unset", "low", "normal", "critical"] - }, - "category": { - "type": "string", - "description": "Which category the notification belongs to. Uses Regex." - } - } - } - } - }, - "widgets": { - "type": "array", - "description": "Which order and which widgets to display. If the \"notifications\" widget isn't specified, it will be placed at the bottom.", - "default": ["inhibitors", "title", "dnd", "notifications"], - "items": { - "type": "string", - // Sadly can't use regex and enums at the same time. Fix in the future? - "pattern": "^[a-zA-Z0-9_-]{1,}(#[a-zA-Z0-9_-]{1,}){0,1}?$" - } - }, - "widget-config": { - "type": "object", - "description": "Configure specific widget properties.", - "additionalProperties": false, - "patternProperties": { - // New widgets go here - "^title(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - // References the widget structure from "widgets" below - "$ref": "#/widgets/title" - }, - "^dnd(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$ref": "#/widgets/dnd" - }, - "^label(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$ref": "#/widgets/label" - }, - "^mpris(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$ref": "#/widgets/mpris" - }, - "^buttons-grid(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$ref": "#/widgets/buttons-grid" - }, - "^menubar(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$ref": "#/widgets/menubar" - }, - "^volume(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$ref": "#/widgets/volume" - }, - "^backlight(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "$ref": "#/widgets/backlight" - }, - "^inhibitors(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - // References the widget structure from "widgets" below - "$ref": "#/widgets/inhibitors" - } - } - } - }, - "widgets": { - // New widgets go here - "title": { - "type": "object", - "description": "Control Center Title Widget", - "additionalProperties": false, - "properties": { - "text": { - "type": "string", - "description": "The title of the widget", - "default": "Notifications" - }, - "clear-all-button": { - "type": "boolean", - "description": "Wether to display a \"Clear All\" button", - "default": true - }, - "button-text": { - "type": "string", - "description": "\"Clear All\" button text", - "default": "Clear All" - } - } - }, - "dnd": { - "type": "object", - "description": "Control Center Do Not Disturb Widget", - "additionalProperties": false, - "properties": { - "text": { - "type": "string", - "description": "The title of the widget", - "default": "Do Not Disturb" - } - } - }, - "label": { - "type": "object", - "description": "A generic widget that allows the user to add custom text", - "additionalProperties": false, - "properties": { - "text": { - "type": "string", - "description": "The text content of the widget", - "default": "Label Text" - }, - "max-lines": { - "type": "integer", - "description": "The maximum lines", - "default": 5 - } - } - }, - "mpris": { - "type": "object", - "description": "A widget that displays multiple music players", - "additionalProperties": false, - "properties": { - "image-size": { - "type": "integer", - "description": "The size of the album art", - "default": 96 - }, - "image-radius": { - "type": "integer", - "description": "The border radius of the album art", - "default": 12 - } - } - }, - "buttons-grid": { - "type": "object", - "description": "A widget to add a grid of buttons that execute shell commands", - "additionalProperties": false, - "properties": { - "actions": { - "type": "array", - "description": "A list of actions containing a label and a command", - "items": { - "type": "object", - "properties": { - "label": { - "type": "string", - "description": "Text to be displayed in button", - "default": "label" - }, - "command": { - "type": "string", - "description": "Command to be executed on click", - "default": "" - } - } - } - } - } - }, - "menubar": { - "type": "object", - "description": "A bar that contains action-buttons and buttons to open a dropdown with action-buttons", - "additionalProperties": false, - "patternProperties": { - "^menu(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "type": "object", - "description": "A button that opens a dropdown with action-buttons", - "additionalProperties": false, - "properties": { - "label": { - "type": "string", - "description": "Text to be displayed in button", - "default": "Menu" - }, - "position": { - "type": "string", - "description": "Horizontal position of the button in the bar", - "default": "right", - "enum": ["right", "left"] - }, - "animation_type": { - "type": "string", - "default": "slide_down", - "description": "Animation type for menu", - "enum": ["slide_down", "slide_up", "none"] - }, - "animation_duration":{ - "type": "integer", - "default": 250, - "description": "Duration of animation in milliseconds" - }, - "actions": { - "$ref" : "#/widgets/buttons-grid/properties/actions" - } - } - }, - "^buttons(#[a-zA-Z0-9_-]{1,}){0,1}?$": { - "type": "object", - "description": "A list of action-buttons to be displayed in the topbar", - "additionalProperties": false, - "properties": { - "position": { - "type": "string", - "description": "Horizontal position of the button in the bar", - "default": "right", - "enum": ["right", "left"] - }, - "actions": { - "$ref" : "#/widgets/buttons-grid/properties/actions" - } - } - } - } - }, - "volume": { - "type": "object", - "description": "Slider to control pulse volume", - "additionalProperties": false, - "properties": { - "label": { - "type": "string", - "description": "Text displayed in front of the volume slider", - "default": "Volume" - } - } - }, - "backlight": { - "type": "object", - "description": "Slider to control monitor brightness", - "additionalProperties": false, - "properties": { - "label": { - "type": "string", - "description": "Text displayed in front of the backlight slider", - "default": "Brightness" - }, - "device": { - "type": "string", - "description": "Name of monitor (find possible devices using `ls /sys/class/backlight` or `ls /sys/class/leds`)", - "default": "intel_backlight" - }, - "subsystem": { - "type": "string", - "description": "Kernel subsystem for brightness control", - "default": "backlight", - "enum": ["backlight", "leds"] - }, - "min": { - "type": "integer", - "default": 0, - "description": "Lowest possible value for brightness" - } - } - }, - "inhibitors": { - "type": "object", - "description": "Control Center Inhibitors Widget", - "additionalProperties": false, - "properties": { - "text": { - "type": "string", - "description": "The title of the widget", - "default": "Inhibitors" - }, - "clear-all-button": { - "type": "boolean", - "description": "Wether to display a \"Clear All\" button", - "default": true - }, - "button-text": { - "type": "string", - "description": "\"Clear All\" button text", - "default": "Clear All" - } - } - } - } -} diff --git a/home/dots/swaync/style.css b/home/dots/swaync/style.css deleted file mode 100644 index 74574f7..0000000 --- a/home/dots/swaync/style.css +++ /dev/null @@ -1,348 +0,0 @@ -/* - * vim: ft=less - */ - -@define-color cc-bg #060604; - -@define-color noti-border-color #2f343f; -@define-color noti-bg #060604; -@define-color noti-bg-hover #1e2233; -@define-color noti-bg-focus #2f343f; -@define-color noti-close-bg #060604; -@define-color noti-close-bg-hover #1e2233; - -@define-color bg-selected #2f343f; - -* { - font-family: "Montreux Classic", sans-serif; -} - -.notification-row { - transition: all 200ms ease; - outline: none; - margin-bottom: 4px; - border-radius: 24px; -} - -.control-center .notification-row:focus, -.control-center .notification-row:hover { - opacity: 1; - background: transparent; -} - -.notification-row:focus .notification, -.notification-row:hover .notification { - box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.5); - box-shadow: 0px 0px 0px 3px @bg-selected; -} - -.control-center .notification { - box-shadow: none; -} - -.control-center .notification-row { - opacity: 0.5; -} - -.notification { - transition: all 200ms ease; - border-radius: 24px; - margin: 6px 6px; - box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.5); - padding: 0; -} - -/* Uncomment to enable specific urgency colors -.low { - background: yellow; - padding: 6px; - border-radius: 24px; -} - -.normal { - background: green; - padding: 6px; - border-radius: 24px; -} - -.critical { - background: red; - padding: 6px; - border-radius: 24px; -} -*/ - -.notification-content { - background: transparent; - padding: 6px; - border-radius: 24px; -} - -.close-button { - background: @noti-close-bg; - color: white; - text-shadow: none; - padding: 0; - border-radius: 100%; - margin-top: 10px; - margin-right: 10px; - box-shadow: none; - border: none; - min-width: 24px; - min-height: 24px; -} - -.close-button:hover { - box-shadow: none; - background: @noti-close-bg-hover; - transition: all 0.15s ease-in-out; - border: none; -} - -.notification-default-action, -.notification-action { - padding: 4px; - margin: 0; - box-shadow: none; - background: @noti-bg; - border: 3px solid @noti-border-color; - color: white; - transition: all 200ms ease; -} - -.notification-default-action:hover, -.notification-action:hover { - -gtk-icon-effect: none; - background: @noti-bg-hover; -} - -.notification-default-action { - border-radius: 24px; -} - -/* When alternative actions are visible */ -.notification-default-action:not(:only-child) { - border-bottom-left-radius: 0px; - border-bottom-right-radius: 0px; -} - -.notification-action { - border-radius: 0px; - border-top: none; - border-right: none; -} - -/* add bottom border radius to eliminate clipping */ -.notification-action:first-child { - border-bottom-left-radius: 10px; -} - -.notification-action:last-child { - border-bottom-right-radius: 10px; - border-right: 1px solid @noti-border-color; -} - -.image { -} - -.body-image { - margin-top: 6px; - background-color: white; - border-radius: 24px; -} - -.summary { - font-size: 16px; - font-weight: bold; - background: transparent; - color: white; - text-shadow: none; -} - -.time { - font-size: 16px; - font-weight: bold; - background: transparent; - color: white; - text-shadow: none; - margin-right: 18px; -} - -.body { - font-size: 15px; - font-weight: normal; - background: transparent; - color: white; - text-shadow: none; -} - -.control-center { - background: @cc-bg; - border-radius: 24px; - background-clip: border-box; - padding: 4px; - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.7), - 0 2px 6px 2px rgba(0, 0, 0, 0.3); -} - -.control-center-list { - background: transparent; -} - -.control-center-list-placeholder { - opacity: 0.5; -} - -.floating-notifications { - background: transparent; -} - -/* Window behind control center and on all other monitors */ -.blank-window { - background: transparent; -} - -/*** Widgets ***/ - -/* Title widget */ -.widget-title { - margin: 8px; - font-size: 1.3rem; -} -.widget-title > button { - font-size: initial; - color: white; - text-shadow: none; - background: @noti-bg; - border: 3px solid @noti-border-color; - box-shadow: none; - border-radius: 24px; -} -.widget-title > button:hover { - background: @noti-bg-hover; -} - -/* DND widget */ -.widget-dnd { - margin: 8px; - font-size: 1.1rem; -} -.widget-dnd > switch { - font-size: initial; - border-radius: 24px; - background: @noti-bg; - border: 3px solid @noti-border-color; - box-shadow: none; -} -.widget-dnd > switch:checked { - background: @bg-selected; -} -.widget-dnd > switch slider { - background: @noti-bg-hover; - border-radius: 24px; -} - -/* Label widget */ -.widget-label { - margin: 8px; -} -.widget-label > label { - font-size: 1.1rem; -} - -/* Mpris widget */ -.widget-mpris { - /* The parent to all players */ -} -.widget-mpris-player { - padding: 8px; - margin: 8px; - background-color: @noti-bg; - border-radius: 24px; -} -.widget-mpris-title { - font-weight: bold; - font-size: 1.25rem; -} -.widget-mpris-subtitle { - font-size: 1.1rem; -} - -/* Buttons widget */ -.widget-buttons-grid { - padding: 8px; - margin: 8px; - border-radius: 24px; - background-color: @noti-bg; -} - -.widget-buttons-grid>flowbox>flowboxchild>button{ - background: @noti-bg; - border-radius: 24px; -} - -.widget-buttons-grid>flowbox>flowboxchild>button:hover { - background: @noti-bg-hover; -} - -/* Menubar widget */ -.widget-menubar>box>.menu-button-bar>button { - border: none; - background: transparent; -} - -/* .AnyName { Name defined in config after # - background-color: @noti-bg; - padding: 8px; - margin: 8px; - border-radius: 24px; -} - -.AnyName>button { - background: transparent; - border: none; -} - -.AnyName>button:hover { - background-color: @noti-bg-hover; -} */ - -.topbar-buttons>button { /* Name defined in config after # */ - border: none; - background: transparent; -} - -/* Volume widget */ - -.widget-volume { - background-color: @noti-bg; - padding: 8px; - margin: 8px; - border-radius: 24px; -} - -/* Backlight widget */ -.widget-backlight { - background-color: @noti-bg; - padding: 8px; - margin: 8px; - border-radius: 24px; -} - -/* Title widget */ -.widget-inhibitors { - margin: 8px; - font-size: 1.5rem; -} -.widget-inhibitors > button { - font-size: initial; - color: white; - text-shadow: none; - background: @noti-bg; - border: 3px solid @noti-border-color; - box-shadow: none; - border-radius: 24px; -} -.widget-inhibitors > button:hover { - background: @noti-bg-hover; -} diff --git a/home/dots/wlogout/layout b/home/dots/wlogout/layout index 9d7a31e..b1cfff6 100644 --- a/home/dots/wlogout/layout +++ b/home/dots/wlogout/layout @@ -1,36 +1,38 @@ -{ -"label" : "lock", -"action" : "waylock", -"text" : "Lock", -"keybind" : "l" -} -{ -"label" : "logout", -"action" : "loginctl terminate-user $USER", -"text" : "Logout", -"keybind" : "e" -} -{ - "label" : "suspend", - "action" : "systemctl suspend", - "text" : "Suspend", - "keybind" : "s" -} -{ - "label" : "shutdown", - "action" : "systemctl poweroff", - "text" : "Shutdown", - "keybind" : "d" -} -{ - "label" : "reboot", - "action" : "systemctl reboot", - "text" : "Reboot", - "keybind" : "r" -} -{ - "label" : "hibernate", - "action" : "systemctl hibernate", - "text" : "Hibernate", - "keybind" : "h" -} +[ + { + "label" : "lock", + "action" : "loginctl lock-session", + "text" : "Lock", + "keybind" : "l" + }, + { + "label" : "logout", + "action" : "loginctl terminate-user $USER", + "text" : "Logout", + "keybind" : "e" + }, + { + "label" : "suspend", + "action" : "systemctl suspend", + "text" : "Suspend", + "keybind" : "s" + }, + { + "label" : "shutdown", + "action" : "systemctl poweroff", + "text" : "Shutdown", + "keybind" : "d" + }, + { + "label" : "reboot", + "action" : "systemctl reboot", + "text" : "Reboot", + "keybind" : "r" + }, + { + "label" : "windows", + "action" : "systemctl reboot --boot-loader-entry=auto-windows", + "text" : "Windows", + "keybind" : "w" + } +] diff --git a/home/dots/wlogout/style.css b/home/dots/wlogout/style.css index b3f3048..ce6b1fd 100644 --- a/home/dots/wlogout/style.css +++ b/home/dots/wlogout/style.css @@ -2,11 +2,11 @@ background-image: none; } window { - background-color: #181b28; + background-color: #WINBG; } button { - color: #FFFFFF; - background-color: #181b28; + color: #BTNCOL; + background-color: #BTNBG; border-style: solid; border-width: 2px; background-repeat: no-repeat; @@ -15,7 +15,7 @@ button { } button:focus, button:active, button:hover { - background-color: #27ae60; + background-color: #BTNFOCUSBG; outline-style: none; } @@ -42,3 +42,7 @@ button:focus, button:active, button:hover { #reboot { background-image: image(url("/usr/share/wlogout/icons/reboot.png"), url("/usr/local/share/wlogout/icons/reboot.png")); } + +#windows { + background-image: image(url("#WINLOGO")) +} diff --git a/home/dots/zsh b/home/dots/zsh new file mode 100644 index 0000000..1a13aa9 --- /dev/null +++ b/home/dots/zsh @@ -0,0 +1,44 @@ +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh + +la_culr() +{ + eza -lha --group-directories-first --icons --color=always $@ | culr -t 80 -o roygbiv-split +} + +ls_culr() +{ + eza -lh --group-directories-first --icons --color=always $@ | culr -t 80 -o roygbiv-split +} + +ps_culr() +{ + ps ww$@ | culr -t 80 -o roygbiv-split +} + +alias ...='cd ../..' +alias ....='cd ../../..' +alias .....='cd ../../../..' + +alias fresh='clear; echo; ~/.nix/header.sh' +alias icat='kitty +kitten icat' +alias chmox='chmod +x' +alias gs='git status' +alias gcl='git clone' +alias ga='git add' +alias gcb='git checkout -b' +alias gco='git checkout' +alias gl='git pull' +alias gp='git push' +alias gd='git diff' +alias gcam='git commit -am' +alias gcm='git commit -m' +alias gr='git restore' +alias gm='git merge' +alias l='ls_culr' +alias la='la_culr' +alias p='ps_culr' +alias mnt='mount | column -t | culr -t 80 -o roygbiv-split' +alias zz='z $(xplr)' +# alias kaboom='printf "type any input if you wish to update\n\npress enter to continue\n"; read upgrade; if [ -n "$upgrade" ]; then echo upgrading..; sudo nix-channel --update; else echo no upgrade!; fi; sudo nixos-rebuild switch -j9 && rm ~/.gtkrc-2.0; home-manager switch && sudo nix-collect-garbage && nix-store --optimise' +eval "$(zoxide init zsh)" +fresh diff --git a/home/fossil.nix b/home/fossil.nix deleted file mode 100755 index c7b2d0a..0000000 --- a/home/fossil.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, pkgs, ... }: - -{ - - home.username = "fossil"; - home.homeDirectory = "/home/fossil"; - - home.packages = with pkgs; [ - cmus - zellij - steam - xonotic - nicotine-plus - ]; - -} diff --git a/home/home.nix b/home/home.nix old mode 100755 new mode 100644 index 40e84e1..bb1aaa5 --- a/home/home.nix +++ b/home/home.nix @@ -1,400 +1,101 @@ -{ pkgs, config, ... }: - -let - # nix-rice = builtins.fetchGit { - # url = "https://github.com/bertof/nix-rice.git"; - # rev = "ac810023c1bb3d999ab4295ea4eb261412f4b7c0"; - # }; - # nix-rice-overlay = import (nix-rice + "/overlay.nix"); - # pkgs = import { overlays = [ nix-rice-overlay ]; }; - # kitty_notest = pkgs.kitty.overridePythonAttrs (oldAttrs: { doCheck = false; checkPhase = ""; }); -in { + inputs, + lib, + pkgs, + rice, + ... +}: +{ + home.stateVersion = "22.11"; + imports = [ - # who are you? - # ./bolt.nix - # ./fossil.nix - ./plank.nix + ./modules/cli.nix + ./modules/desktop.nix + ./modules/dev.nix + ./modules/theming.nix + ./modules/niri.nix + ./util/ez.nix + ./util/name.nix + inputs.nix-index-database.hmModules.nix-index ]; - nixpkgs.config.packageOverrides = pkgs: { - nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { - inherit pkgs; - }; + nix.gc = { + automatic = true; + frequency = "daily"; + options = "--delete-older-than 3d"; }; - nixpkgs.config.allowUnfree = true; - home.packages = with pkgs; [ - - thunderbird - - clementine - inkscape - - btop - bat - joshuto - ripgrep - fd - lazygit - fzf - - kdeconnect - keepassxc - - direnv - - mpv - syncthing - - zoxide - meslo-lgs-nf - - # libreoffice-qt - libsForQt5.qtstyleplugin-kvantum - - gtk-engine-murrine - - (callPackage ./homepkgs/git-credential-keepassxc.nix { }) - (callPackage ./homepkgs/culr.nix { }) - - ]; - - xdg.enable = true; - xdg.systemDirs.data = [ - "${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}" - "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}" - ]; - - programs.vscode = { + xdg = { enable = true; - # enableExtensionUpdateCheck = false; - # enableUpdateCheck = false; - extensions = []; - mutableExtensionsDir = true; - }; - - xdg.desktopEntries = { - Code-url = { - name = "VsCode"; - genericName = "Text Editor"; - exec = "code --disable-gpu-sandbox --open-url %U"; - icon = "code"; - comment = "Code Editing. Redefined."; - categories = [ "Utility" "TextEditor" "Development" "IDE" ]; - # keywords = [ "vscode" ]; - mimeType = [ "x-scheme-handler/vscode" ]; - noDisplay = true; - startupNotify = true; - type = "Application"; - }; - Code = { - categories = [ "Utility" "TextEditor" "Development" "IDE" ]; - comment = "Code Editing. Redefined."; - exec = "code --disable-gpu-sandbox %F"; - genericName = "Text Editor"; - icon = "code"; - # keywords = [ "vscode" ]; - mimeType = [ "text/plain" "inode/directory" ]; - name = "VsCode"; - startupNotify = true; - # startupWMClass = "vsCode"; - type = "Application"; - }; - }; - - programs.direnv = { - enable = true; - nix-direnv = { - enable = true; - }; - }; - - gtk = { - enable = true; - theme = { - package = pkgs.sweet; - name = "Sweet-Dark"; - }; - iconTheme = { - package = pkgs.papirus-icon-theme; - name = "Papirus-Dark"; - }; - }; - - programs.firefox = - { - package = pkgs.firefox.override { - cfg = { - enablePlasmaBrowserIntegration = true; + portal = + let + gtk = pkgs.xdg-desktop-portal-gtk; + gnome = pkgs.xdg-desktop-portal-gnome; + in + { + enable = true; + config = { + common = { + default = [ + "gnome" + ]; + }; }; - }; - enable = true; - profiles.default = { - id = 0; - name = "Default"; - settings = { - "browser.startup.homepage" = "about:blank"; - }; - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - vimium-c - darkreader - localcdn - ublock-origin - # bypass-paywalls-clean - # sidebery - plasma-integration - keepassxc-browser - user-agent-string-switcher - # happy-bonobo-disable-webrtc + extraPortals = [ + gnome + gtk ]; }; + }; + + home.packages = + let + inherit (rice) icons fonts cursor; + inherit (pkgs) tauon; + in + fonts.pkgs + ++ icons.pkgs + ++ [ + cursor.package + tauon + ]; + + systemd.user.targets.tray = { + Unit = { + Description = "Home Manager System Tray"; + Requires = [ "graphical-session.target" ]; }; + }; services.syncthing = { enable = true; }; - # services.kdeconnect = { + services.udiskie.enable = true; + # fix reliance on nonexistent graphical-session-pre.target + systemd.user.services.udiskie = lib.mkForce { + Unit = { + Description = "udiskie mount daemon"; + After = [ ]; + PartOf = [ "graphical-session.target" ]; + }; + + Service.ExecStart = [ "${pkgs.udiskie}/bin/udiskie --appindicator" ]; + + Install.WantedBy = [ "graphical-session.target" ]; + }; + + # programs.nix-index-database.comma.enable = true; + # programs.nix-index = { # enable = true; - # indicator = true; + # enableZshIntegration = false; + # enableBashIntegration = false; # }; + # programs.command-not-found.enable = false; + # programs.nix-index.enable = true; - programs.kitty = { - enable = true; - # package = kitty_notest; - font = { - name = "Ellograph CF"; - size = 10; - }; - settings = { - foreground = "#d3dae3"; - background = "#060604"; - cursor = "#d3dae3"; - selection_foreground = "#fdbc4b"; - selection_background = "#1e2233"; - color0 = "#2f343f"; - color1 = "#ed244e"; - color2 = "#27ae60"; - color3 = "#f67400"; - color4 = "#2980b9"; - color5 = "#c50ed2"; - color6 = "#3daee9"; - color7 = "#a1a9b1"; - color8 = "#1e2233"; - color9 = "#da4453"; - color10 = "#71f79f"; - color11 = "#fdbc4b"; - color12 = "#1d99f3"; - color13 = "#9b59b6"; - color14 = "#5294e2"; - color15 = "#656a73"; - }; + systemd.user.startServices = "sd-switch"; + ezServices = { + ckb-next = "${lib.getExe pkgs.ckb-next} -c -b"; }; - - programs.git = { - enable = true; - userName = "atagen"; - userEmail = "atagen@boss.co"; - extraConfig = { - credential.helper = "keepassxc"; - }; - }; - - programs.zoxide = { - enable = true; - enableZshIntegration = true; - }; - - programs.fzf = { - enable = true; - enableZshIntegration = true; - # colors = { - # fg = "#d3dae3"; - # "fg+" = "#d3dae3"; - # bg = "#060604"; - # "bg+" = "#060604"; - # preview-fg = "#fdbc4b"; - # preview-bg = "#1e2233"; - # hl = "#da4453"; - # "hl+" = "#ed244e"; - # info = "#fdbc4b"; - # border = "#656a73"; - # prompt = "#c50ed2"; - # pointer = "#27ae60"; - # header = "#da4453"; - # }; - }; - - programs.zsh = { - enable = true; - enableAutosuggestions = true; - enableCompletion = true; - enableSyntaxHighlighting = true; - enableVteIntegration = true; - autocd = true; - defaultKeymap = "viins"; - initExtra = " -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh - -la_culr() -{ - ls -lha --group-directories-first --color $@ | culr } - -ls_culr() -{ - ls -lh --group-directories-first --color $@ | culr -} - -ps_culr() -{ - ps ww$@ | culr -} - -alias ...=\"cd ../..\" -alias ....=\"cd ../../..\" -alias .....=\"cd ../../../..\" - -alias fresh=\"clear; echo; ~/.nix/header.sh\" -alias icat=\"kitty +kitten icat\" -alias chmox=\"chmod +x\" -alias gs=\"git status\" -alias gcl=\"git clone\" -alias ga=\"git add\" -alias gcb=\"git checkout -b\" -alias gco=\"git checkout\" -alias gl=\"git pull\" -alias gp=\"git push\" -alias gd=\"git diff\" -alias gcam=\"git commit -am\" -alias gcm=\"git commit -m\" -alias gr=\"git restore\" -alias gm=\"git merge\" -alias l=\"ls_culr\" -alias la=\"la_culr\" -alias p=\"ps_culr\" -alias mnt=\"mount | column -t | culr\" -alias kaboom=\"printf 'type any input if you wish to update\n\npress enter to continue\n'; read upgrade; if [ -n \\\"\\\$upgrade\\\" ]; then echo upgrading..; sudo nix-channel --update; else echo no upgrade!; fi; sudo nixos-rebuild switch -j9 && rm ~/.gtkrc-2.0; home-manager switch && sudo nix-collect-garbage && nix-store --optimise\" -fresh -"; - - plugins = [ - { - name = "powerlevel10k"; - src = pkgs.zsh-powerlevel10k; - file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; - } - { - name = "zsh-vi-mode"; - src = pkgs.zsh-vi-mode; - file = "share/zsh-vi-mode/zsh-vi-mode.zsh"; - } - { - name = "zsh-autopair"; - src = pkgs.zsh-autopair; - file = "share/zsh-autopair/zsh-autopair.zsh"; - } - { - name = "zsh-completions"; - src = pkgs.zsh-completions; - file = "share/zsh-completions/zsh-completions.zsh"; - } - { - name = "zsh-command-time"; - src = pkgs.zsh-command-time; - file = "share/zsh-completions/zsh-command-time.zsh"; - } - # { - # name = "zsh-you-should-use"; - # src = pkgs.zsh-you-should-use; - # # file = "share/zsh-completions/zsh-you-should-use.zsh"; - # } - { - name = "zsh-autocomplete"; - src = pkgs.zsh-autocomplete; - file = "share/zsh-autocomplete/zsh-autocomplete.zsh"; - } - { - name = "zsh-fast-syntax-highlighting"; - src = pkgs.zsh-fast-syntax-highlighting; - file = "share/zsh-fast-syntax-highlighting/zsh-fast-syntax-highlighting.zsh"; - } - { - name = "zsh-nix-shell"; - src = pkgs.zsh-nix-shell; - file = "share/zsh-nix-shell/zsh-nix-shell.zsh"; - } - { - name = "any-nix-shell"; - src = pkgs.any-nix-shell; - file = "share/any-nix-shell/any-nix-shell.zsh"; - } - { - name = "nix-zsh-completions"; - src = pkgs.nix-zsh-completions; - file = "share/nix-zsh-completions/nix-zsh-completions.zsh"; - } - # { - # name = "zsh-fzf-tab"; - # src = pkgs.zsh-fzf-tab; - # # file = "share/zsh-fzf-tab/zsh-fzf-tab.zsh"; - # } - ]; - }; - - xresources.extraConfig = " -! special -*.foreground: #d3dae3 -*.background: #181b28 -*.cursorColor: #d3dae3 - -! black -*.color0: #2f343f -*.color8: #1e2233 - -! red -*.color1: #ed244e -*.color9: #da4453 - -! green -*.color2: #27ae60 -*.color10: #71f79f - -! yellow -*.color3: #f67400 -*.color11: #fdbc4b - -! blue -*.color4: #2980b9 -*.color12: #1d99f3 - -! magenta -*.color5: #c50ed2 -*.color13: #9b59b6 - -! cyan -*.color6: #3daee9 -*.color14: #5294e2 - -! white -*.color7: #a1a9b1 -*.color15: #656a73"; - - programs.helix.enable = true; - programs.helix.settings = { - theme = "noctis"; - editor.lsp.display-messages = true; - # editor.auto-pairs = false; - # editor.indent-guides.render = true; - }; - - home.sessionVariables = { - GTK_THEME = "Sweet-Dark"; - }; - - home.stateVersion = "22.11"; - - programs.home-manager.enable = true; -} - diff --git a/home/homepkgs/bismuth.nix b/home/homepkgs/bismuth.nix deleted file mode 100755 index e12a8be..0000000 --- a/home/homepkgs/bismuth.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ lib -, mkDerivation -, fetchFromGitHub -, kcoreaddons -, kwindowsystem -, plasma-framework -, systemsettings -, cmake -, extra-cmake-modules -, esbuild -}: - -mkDerivation rec { - pname = "bismuth"; - version = "3.1.3"; - - src = fetchFromGitHub { - owner = "Bismuth-Forge"; - repo = pname; - rev = "v${version}"; - sha256 = "sha256-IWwFsYqoqW3924+pf8L+acIt31aU/mhqakXbT9Q4Bqw="; - }; - - cmakeFlags = [ - "-DUSE_TSC=OFF" - "-DUSE_NPM=OFF" - ]; - - nativeBuildInputs = [ - cmake - extra-cmake-modules - esbuild - ]; - - buildInputs = [ - kcoreaddons - kwindowsystem - plasma-framework - systemsettings - ]; - - meta = with lib; { - description = "A dynamic tiling extension for KWin"; - license = licenses.mit; - maintainers = with maintainers; [ pasqui23 ]; - homepage = "https://bismuth-forge.github.io/bismuth/"; - inherit (kwindowsystem.meta) platforms; - }; -} diff --git a/home/homepkgs/culr.nix b/home/homepkgs/culr.nix index 9b6db9b..0dfa0a0 100755 --- a/home/homepkgs/culr.nix +++ b/home/homepkgs/culr.nix @@ -1,4 +1,10 @@ -{ lib, fetchFromGitea, rustPlatform, libX11, pkg-config }: +{ + lib, + fetchFromGitea, + rustPlatform, + libX11, + pkg-config, +}: rustPlatform.buildRustPackage rec { pname = "culr"; @@ -16,7 +22,7 @@ rustPlatform.buildRustPackage rec { buildInputs = [ libX11 ]; cargoSha256 = "sha256-d8MshgH3EppKR80fULU5kraJzrkG57KApzcJM2muvIE="; - + meta = with lib; { description = "colourise piped input"; homepage = "https://git.atagen.co/atagen/culr"; diff --git a/home/homepkgs/fuzzel.nix b/home/homepkgs/fuzzel.nix deleted file mode 100644 index 9ec4c14..0000000 --- a/home/homepkgs/fuzzel.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - cfg = config.programs.fuzzel; - iniFormat = pkgs.formats.ini { }; -in { - options = { - programs.fuzzel = { - enable = mkEnableOption "Fuzzel"; - - package = mkOption { - type = types.package; - default = pkgs.fuzzel; - defaultText = literalExpression "pkgs.fuzzel"; - description = "The Fuzzel package to install."; - }; - - settings = mkOption { - type = iniFormat.type; - default = { }; - example = literalExpression '' - { - window.dimensions = { - lines = 3; - columns = 200; - }; - key_bindings = [ - { - key = "K"; - mods = "Control"; - chars = "\\x0c"; - } - ]; - } - ''; - description = '' - Configuration written to - $XDG_CONFIG_HOME/fuzzel/fuzzel.ini. - ''; - }; - }; - }; - - config = mkMerge [ - (mkIf cfg.enable { - home.packages = [ cfg.package ]; - - xdg.configFile."fuzzel/fuzzel.ini" = mkIf (cfg.settings != { }) { - # TODO: Replace by the generate function but need to figure out how to - # handle the escaping first. - # - # source = yamlFormat.generate "alacritty.yml" cfg.settings; - - text = - replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.settings); - }; - }) - ]; -} - diff --git a/home/homepkgs/git-credential-keepassxc.nix b/home/homepkgs/git-credential-keepassxc.nix deleted file mode 100755 index 50b2784..0000000 --- a/home/homepkgs/git-credential-keepassxc.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ lib, fetchFromGitHub, rustPlatform }: - -rustPlatform.buildRustPackage rec { - pname = "git-credential-keepassxc"; - version = "0.10.0"; - - src = fetchFromGitHub { - owner = "frederick888"; - repo = pname; - rev = "v${version}"; - sha256 = "sha256-BmjGxDqX8j/69Uo8jjWtcJcxNHxI7S5+eZQMApdybq0="; - }; - - cargoSha256 = "sha256-gXW08plJRE1Q6W+Dc2y+gu2R+KBRs3fBG1umdawDduA="; - - meta = with lib; { - description = "Helper that allows Git (and shell scripts) to use KeePassXC as credential store"; - homepage = "https://github.com/frederick888/git-credential-keepassxc"; - license = licenses.gpl3Only; - maintainers = [ ]; - }; - -} diff --git a/home/homepkgs/glpaper.nix b/home/homepkgs/glpaper.nix deleted file mode 100644 index 2527eee..0000000 --- a/home/homepkgs/glpaper.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ lib, stdenv, fetchFromSourcehut, meson, ninja, pkg-config, wlroots, wayland, wayland-protocols -, libX11, libGL }: - -stdenv.mkDerivation rec { - pname = "glpaper"; - version = "unstable-latest"; - - src = fetchFromSourcehut { - owner = "~scoopta"; - repo = pname; - vc = "hg"; - rev = "9ba3806561312d83ed66dc8583c36d70fda8cd7a"; - sha256 = "sha256-//IKW2BfpqwcR2WAPShs0kzn5nkV/yyABPvOYm3zMPU="; - }; - - nativeBuildInputs = [ meson ninja pkg-config ]; - buildInputs = [ - wayland - libX11 # required by libglvnd - libGL - ]; - - meta = with lib; { - description = - "Wallpaper program for wlroots based Wayland compositors such as sway that allows you to render glsl shaders as your wallpaper"; - homepage = "https://hg.sr.ht/~scoopta/glpaper"; - license = licenses.gpl3Plus; - platforms = platforms.linux; - maintainers = with maintainers; [ ccellado ]; - }; -} diff --git a/home/homepkgs/simplewaita-gtk.nix b/home/homepkgs/simplewaita-gtk.nix deleted file mode 100755 index 313d89e..0000000 --- a/home/homepkgs/simplewaita-gtk.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ stdenvNoCC, lib, fetchFromGitea, }: - -stdenvNoCC.mkDerivation rec { - pname = "Simplewaita"; - version = "0.1.0"; - - src = fetchFromGitea { - domain = "git.disroot.org"; - owner = "eudaimon"; - repo = pname; - rev = "16c5f75fd3e03671c3998dcb9a67e3ff6da5a538"; - hash = "sha256-VvPQGsdikfIi3VG5Mh8FcioTVwXaxKxaSf2X+yWJckA="; - }; - - dontPatch = true; - dontConfigure = true; - installPhase = '' - mkdir $out - cp -r ./ $out - ''; - dontBuild = true; - dontFixup = true; - - meta = with lib; { - description = "A mix of Skewaita and Simple. Or, more precisely: Skewaita Simple-ified."; - homepage = "https://git.disroot.org/eudaimon/Simplewaita"; - license = licenses.gpl1Only; - platforms = platforms.linux; - }; -} diff --git a/home/homepkgs/swayosd.lock b/home/homepkgs/swayosd.lock deleted file mode 100644 index 8d2f4d6..0000000 --- a/home/homepkgs/swayosd.lock +++ /dev/null @@ -1,826 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "anyhow" -version = "1.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" - -[[package]] -name = "atk" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3d816ce6f0e2909a96830d6911c2aff044370b1ef92d7f267b43bae5addedd" -dependencies = [ - "atk-sys", - "bitflags", - "glib", - "libc", -] - -[[package]] -name = "atk-sys" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "blight" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60c217c718b4093f44e9c26a96f4e4c2fafec37d6f46b33192ad3892d3151eae" -dependencies = [ - "colored", -] - -[[package]] -name = "cairo-rs" -version = "0.15.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc" -dependencies = [ - "bitflags", - "cairo-sys-rs", - "glib", - "libc", - "thiserror", -] - -[[package]] -name = "cairo-sys-rs" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" -dependencies = [ - "glib-sys", - "libc", - "system-deps", -] - -[[package]] -name = "cascade" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d499b43edbf784dd81e16f0395f5b4350a35b477da8a074251087adefc11cb52" - -[[package]] -name = "cfg-expr" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0357a6402b295ca3a86bc148e84df46c02e41f41fef186bda662557ef6328aa" -dependencies = [ - "smallvec", -] - -[[package]] -name = "colored" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" -dependencies = [ - "atty", - "lazy_static", - "winapi", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "field-offset" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3cf3a800ff6e860c863ca6d4b16fd999db8b752819c1606884047b73e468535" -dependencies = [ - "memoffset", - "rustc_version", -] - -[[package]] -name = "futures-channel" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" -dependencies = [ - "futures-core", -] - -[[package]] -name = "futures-core" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" - -[[package]] -name = "futures-executor" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" - -[[package]] -name = "futures-task" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" - -[[package]] -name = "futures-util" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" -dependencies = [ - "futures-core", - "futures-task", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "gdk" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6e05c1f572ab0e1f15be94217f0dc29088c248b14f792a5ff0af0d84bcda9e8" -dependencies = [ - "bitflags", - "cairo-rs", - "gdk-pixbuf", - "gdk-sys", - "gio", - "glib", - "libc", - "pango", -] - -[[package]] -name = "gdk-pixbuf" -version = "0.15.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad38dd9cc8b099cceecdf41375bb6d481b1b5a7cd5cd603e10a69a9383f8619a" -dependencies = [ - "bitflags", - "gdk-pixbuf-sys", - "gio", - "glib", - "libc", -] - -[[package]] -name = "gdk-pixbuf-sys" -version = "0.15.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7" -dependencies = [ - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gdk-sys" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88" -dependencies = [ - "cairo-sys-rs", - "gdk-pixbuf-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "pango-sys", - "pkg-config", - "system-deps", -] - -[[package]] -name = "gio" -version = "0.15.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68fdbc90312d462781a395f7a16d96a2b379bb6ef8cd6310a2df272771c4283b" -dependencies = [ - "bitflags", - "futures-channel", - "futures-core", - "futures-io", - "gio-sys", - "glib", - "libc", - "once_cell", - "thiserror", -] - -[[package]] -name = "gio-sys" -version = "0.15.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", - "winapi", -] - -[[package]] -name = "glib" -version = "0.15.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d" -dependencies = [ - "bitflags", - "futures-channel", - "futures-core", - "futures-executor", - "futures-task", - "glib-macros", - "glib-sys", - "gobject-sys", - "libc", - "once_cell", - "smallvec", - "thiserror", -] - -[[package]] -name = "glib-macros" -version = "0.15.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a68131a662b04931e71891fb14aaf65ee4b44d08e8abc10f49e77418c86c64" -dependencies = [ - "anyhow", - "heck", - "proc-macro-crate", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "glib-sys" -version = "0.15.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4" -dependencies = [ - "libc", - "system-deps", -] - -[[package]] -name = "gobject-sys" -version = "0.15.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" -dependencies = [ - "glib-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gtk" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e3004a2d5d6d8b5057d2b57b3712c9529b62e82c77f25c1fecde1fd5c23bd0" -dependencies = [ - "atk", - "bitflags", - "cairo-rs", - "field-offset", - "futures-channel", - "gdk", - "gdk-pixbuf", - "gio", - "glib", - "gtk-sys", - "gtk3-macros", - "libc", - "once_cell", - "pango", - "pkg-config", -] - -[[package]] -name = "gtk-layer-shell" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4316ff523ae445bd6efaf253f217598dd074619fe67b9199b5b0cd5ff99144da" -dependencies = [ - "bitflags", - "gdk", - "glib", - "glib-sys", - "gtk", - "gtk-layer-shell-sys", - "libc", -] - -[[package]] -name = "gtk-layer-shell-sys" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff60230d690445577655416055dbd279d05631b03ab07f935e39f5fe81084c0a" -dependencies = [ - "gdk-sys", - "glib-sys", - "gtk-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gtk-sys" -version = "0.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5bc2f0587cba247f60246a0ca11fe25fb733eabc3de12d1965fc07efab87c84" -dependencies = [ - "atk-sys", - "cairo-sys-rs", - "gdk-pixbuf-sys", - "gdk-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "pango-sys", - "system-deps", -] - -[[package]] -name = "gtk3-macros" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24f518afe90c23fba585b2d7697856f9e6a7bbc62f65588035e66f6afb01a2e9" -dependencies = [ - "anyhow", - "proc-macro-crate", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "indexmap" -version = "1.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" -dependencies = [ - "autocfg", - "hashbrown", -] - -[[package]] -name = "itertools" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" -dependencies = [ - "either", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.140" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" - -[[package]] -name = "libpulse-binding" -version = "2.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1745b20bfc194ac12ef828f144f0ec2d4a7fe993281fa3567a0bd4969aee6890" -dependencies = [ - "bitflags", - "libc", - "libpulse-sys", - "num-derive", - "num-traits", - "winapi", -] - -[[package]] -name = "libpulse-sys" -version = "1.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2191e6880818d1df4cf72eac8e91dce7a5a52ba0da4b2a5cdafabc22b937eadb" -dependencies = [ - "libc", - "num-derive", - "num-traits", - "pkg-config", - "winapi", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memoffset" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num-derive" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" - -[[package]] -name = "pango" -version = "0.15.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f" -dependencies = [ - "bitflags", - "glib", - "libc", - "once_cell", - "pango-sys", -] - -[[package]] -name = "pango-sys" -version = "0.15.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.52" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "pulsectl-rs" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06a988bceed1981b2c5fc4a3da0e4e073fdaff8e6bd022b089f54bc573dc3cfc" -dependencies = [ - "libpulse-binding", -] - -[[package]] -name = "quote" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "semver" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" - -[[package]] -name = "serde" -version = "1.0.157" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707de5fcf5df2b5788fca98dd7eab490bc2fd9b7ef1404defc462833b83f25ca" - -[[package]] -name = "shrinkwraprs" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e63e6744142336dfb606fe2b068afa2e1cca1ee6a5d8377277a92945d81fa331" -dependencies = [ - "bitflags", - "itertools", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "slab" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "swayosd" -version = "0.1.0" -dependencies = [ - "blight", - "cascade", - "gtk", - "gtk-layer-shell", - "libpulse-binding", - "pulsectl-rs", - "shrinkwraprs", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59d3276aee1fa0c33612917969b5172b5be2db051232a6e4826f1a1a9191b045" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "system-deps" -version = "6.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2955b1fe31e1fa2fbd1976b71cc69a606d7d4da16f6de3333d0c92d51419aeff" -dependencies = [ - "cfg-expr", - "heck", - "pkg-config", - "toml", - "version-compare", -] - -[[package]] -name = "thiserror" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.2", -] - -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_datetime" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" - -[[package]] -name = "toml_edit" -version = "0.19.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc18466501acd8ac6a3f615dd29a3438f8ca6bb3b19537138b3106e575621274" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow", -] - -[[package]] -name = "unicode-ident" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" - -[[package]] -name = "version-compare" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "winnow" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d020b441f92996c80d94ae9166e8501e59c7bb56121189dc9eab3bd8216966" -dependencies = [ - "memchr", -] diff --git a/home/homepkgs/swayosd.nix b/home/homepkgs/swayosd.nix deleted file mode 100755 index 0db41ec..0000000 --- a/home/homepkgs/swayosd.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ lib, fetchFromGitHub, rustPlatform, pkg-config, gtk3, gtk-layer-shell, libpulseaudio }: - -rustPlatform.buildRustPackage rec { - pname = "SwayOSD"; - version = "0.1.0"; - - src = fetchFromGitHub { - owner = "ErikReider"; - repo = pname; - rev = "9f294d8f4713eb210e9aad3dee83de32090e4784"; - sha256 = "sha256-3K8LlX4MrG523BwD4nZOcXgSxsnYRxxU5gCOp7rCOCY="; - }; - - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ gtk3 gtk-layer-shell libpulseaudio ]; - cargoLock.lockFileContents = builtins.readFile ./swayosd.lock; - postPatch = '' - cp ${./swayosd.lock} Cargo.lock - ''; - - cargoSha256 = lib.fakeSha256; - - -} diff --git a/home/icons/fb_msg.png b/home/icons/fb_msg.png new file mode 100644 index 0000000..8505bf3 Binary files /dev/null and b/home/icons/fb_msg.png differ diff --git a/home/icons/ms_teams.png b/home/icons/ms_teams.png new file mode 100644 index 0000000..0009690 Binary files /dev/null and b/home/icons/ms_teams.png differ diff --git a/home/icons/ollama.png b/home/icons/ollama.png new file mode 100644 index 0000000..45f7dd9 Binary files /dev/null and b/home/icons/ollama.png differ diff --git a/home/icons/openwebui.png b/home/icons/openwebui.png new file mode 100644 index 0000000..389196c Binary files /dev/null and b/home/icons/openwebui.png differ diff --git a/home/icons/syncthing.png b/home/icons/syncthing.png new file mode 100644 index 0000000..cce2b8e Binary files /dev/null and b/home/icons/syncthing.png differ diff --git a/home/icons/winlogo.png b/home/icons/winlogo.png new file mode 100644 index 0000000..410e131 Binary files /dev/null and b/home/icons/winlogo.png differ diff --git a/home/modules/chat.nix b/home/modules/chat.nix new file mode 100644 index 0000000..4f8062f --- /dev/null +++ b/home/modules/chat.nix @@ -0,0 +1,22 @@ +{ config, ... }: +{ + imports = [ + ../util/firefox-webapp.nix + ]; + programs.firefox.webapps = { + "Microsoft-Teams" = { + url = "https://teams.microsoft.com"; + # id = 1; + extraSettings = config.programs.firefox.profiles.default.settings; + name = "Microsoft Teams"; + icon = ../icons/ms_teams.png; + }; + "Facebook-Messenger" = { + url = "https://www.messenger.com"; + # id = 2; + extraSettings = config.programs.firefox.profiles.default.settings; + name = "Facebook Messenger"; + icon = ../icons/fb_msg.png; + }; + }; +} diff --git a/home/modules/cli.nix b/home/modules/cli.nix new file mode 100644 index 0000000..48004a0 --- /dev/null +++ b/home/modules/cli.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +{ + imports = [ + ../programs/kitty.nix + # ../programs/zsh.nix + # ../programs/xresources.nix + ../programs/helix.nix + # ../programs/atuin.nix + ]; + home.packages = builtins.attrValues { + inherit (pkgs) + btop + bat + ripgrep + fd + lazygit + zoxide + zellij + ouch + ; + }; +} diff --git a/home/modules/creative.nix b/home/modules/creative.nix new file mode 100644 index 0000000..e420aa3 --- /dev/null +++ b/home/modules/creative.nix @@ -0,0 +1,10 @@ +_: { + # imports = [ + # ../util/flatpak.nix + # ]; + # flatpaks = [ + # "ar.com.tuxguitar.TuxGuitar" + # "org.inkscape.Inkscape" + # "com.github.PintaProject.Pinta" + # ]; +} diff --git a/home/modules/desktop.nix b/home/modules/desktop.nix new file mode 100644 index 0000000..03bacde --- /dev/null +++ b/home/modules/desktop.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: +{ + imports = [ + ./media-players.nix + ./webapps.nix + ./documents.nix + # ./creative.nix + ./chat.nix + ../programs/firefox.nix + ../programs/wlogout.nix + ]; + home.packages = builtins.attrValues { + inherit (pkgs) + file-roller + nautilus + thunderbird + keepassxc + ; + }; +} diff --git a/home/modules/dev.nix b/home/modules/dev.nix new file mode 100644 index 0000000..5ebdcc2 --- /dev/null +++ b/home/modules/dev.nix @@ -0,0 +1,74 @@ +{ pkgs, rice, ... }: +let + get = builtins.attrValues; +in +{ + # imports = [ + # ../programs/vscode.nix + # ]; + + home.packages = get { + inherit (pkgs) + git-credential-keepassxc + direnv + ; + }; + + programs.zed-editor = { + enable = false; + extensions = [ + "nix" + "rust" + "ocaml" + "kanagawa-themes" + ]; + userSettings = { + features = { + copilot = false; + }; + buffer_font_family = rice.fonts.monospace.name; + buffer_font_size = rice.fonts.monospace.size; + theme = { + mode = "dark"; + dark = "Kanagawa Dragon"; + }; + telemetry = { + metrics = false; + diagnostics = false; + }; + vim_mode = true; + assistant = { + default_model = { + provider = "ollama"; + model = "llama3.2"; + }; + inline_alternatives = { + provider = "ollama"; + model = "starcoder2:3b"; + }; + }; + language_models = { + ollama = { + api_url = "http://localhost:11434"; + }; + }; + }; + }; + + programs.direnv = { + enable = true; + nix-direnv = { + enable = true; + }; + enableFishIntegration = true; + }; + + programs.git = { + enable = true; + userName = "atagen"; + userEmail = "boss@atagen.co"; + extraConfig = { + credential.helper = "keepassxc"; + }; + }; +} diff --git a/home/modules/documents.nix b/home/modules/documents.nix new file mode 100644 index 0000000..c8f059d --- /dev/null +++ b/home/modules/documents.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + home.packages = [ + pkgs.libreoffice + ]; +} diff --git a/home/modules/media-players.nix b/home/modules/media-players.nix new file mode 100644 index 0000000..08da6b6 --- /dev/null +++ b/home/modules/media-players.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: +{ + home.packages = builtins.attrValues { + inherit (pkgs) + mpv + imv + strawberry + resonance + zathura + playerctl + ; + }; +} diff --git a/home/modules/niri.nix b/home/modules/niri.nix new file mode 100644 index 0000000..0e81098 --- /dev/null +++ b/home/modules/niri.nix @@ -0,0 +1,267 @@ +{ + pkgs, + lib, + config, + rice, + inputs, + mainUser, + ... +}: +let + services = + let + inherit (pkgs) swaynotificationcenter; + in + [ + swaynotificationcenter + ]; + errata = + let + inherit (pkgs) avizo playerctl; + in + [ + avizo + playerctl + ]; + extraServices = + let + inherit (pkgs) + swayidle + swaybg + systemd + avizo + ; + + inherit (inputs.niri.packages.x86_64-linux) niri-unstable; + in + [ + { + name = "swaybg"; + value = "${lib.getExe swaybg} -m fill -i /home/${mainUser}/.nix/wallpaper.jpg"; + } + { + name = "avizo-service"; + value = "${lib.getExe' avizo "avizo-service"}"; + } + { + name = "swayidle"; + value = + let + niri = lib.getExe niri-unstable; + systemctl = lib.getExe' systemd "systemctl"; + in + '' + ${lib.getExe swayidle} -w \ + timeout 1800 '${systemctl} suspend' \ + timeout 600 '${niri} msg action power-off-monitors' + ''; + } + ]; +in +{ + home.packages = errata; + ezServices = builtins.listToAttrs ( + (map (entry: { + name = "${lib.strings.toLower entry.pname}"; + value = "${lib.getExe entry}"; + }) services) + ++ extraServices + ); + programs.niri.settings = + let + inherit (lib) range nameValuePair mapAttrs'; + inherit (builtins) listToAttrs replaceStrings; + inherit (config.lib.niri) actions; + in + { + binds = + let + hBinds = { + H = "left"; + L = "right"; + }; + vBinds = { + J = "down"; + K = "up"; + }; + makeDirBind = + mods: cmd: keys: + mapAttrs' ( + key: dir: + nameValuePair "${mods}+${key}" { + action = actions."${replaceStrings [ "$DIR" ] [ "${dir}" ] "${cmd}"}"; + } + ) keys; + makeWsBind = + mods: cmd: + listToAttrs ( + map (num: { + name = "${mods}+${builtins.toString num}"; + value = { + action."${cmd}" = num; + }; + }) (range 0 6) + ); + in + { + "Mod+D".action.spawn = [ + "qs" + "ipc" + "call" + "launch" + "toggle" + ]; + "Mod+F".action.spawn = "firefox"; + "Mod+E".action.spawn = "nautilus"; + "Mod+Return".action.spawn = "kitty"; + "Mod+Shift+E".action.spawn = "wlogout"; + "Mod+Equal".action.spawn = "keepassxc"; + "Mod+Shift+Q".action = actions.close-window; + "Mod+Shift+S".action = actions.screenshot; + "Mod+R".action = actions.switch-preset-column-width; + "Mod+Shift+R".action = actions.maximize-column; + "XF86AudioRaiseVolume".action.spawn = [ + "volumectl" + "-u" + "up" + ]; + "XF86AudioLowerVolume".action.spawn = [ + "volumectl" + "-u" + "down" + ]; + "XF86AudioMute".action.spawn = [ + "volumectl" + "toggle-mute" + ]; + "XF86AudioStop".action.spawn = [ + "playerctl" + "stop" + ]; + "XF86AudioPlay".action.spawn = [ + "playerctl" + "play-pause" + ]; + "XF86AudioNext".action.spawn = [ + "playerctl" + "next" + ]; + "XF86AudioPrev".action.spawn = [ + "playerctl" + "previous" + ]; + "Mod+Space".action = actions.toggle-window-floating; + } + // makeDirBind "Mod" "focus-window-or-workspace-$DIR" vBinds + // makeDirBind "Mod" "focus-column-or-monitor-$DIR" hBinds + // makeDirBind "Mod+Shift" "move-window-to-workspace-$DIR" vBinds + // makeDirBind "Mod+Shift" "move-column-$DIR-or-to-monitor-$DIR" hBinds + // makeDirBind "Mod+Ctrl" "consume-or-expel-window-$DIR" hBinds + // makeDirBind "Mod+Ctrl" "move-window-$DIR" vBinds + // makeWsBind "Mod" "focus-workspace" + // makeWsBind "Mod+Shift" "move-window-to-workspace"; + outputs = { + # "Unknown-1".enable = false; + "DP-1" = { + transform.rotation = 90; + scale = 1; + }; + "DP-2" = { + variable-refresh-rate = true; + scale = 1; + }; + }; + input = { + warp-mouse-to-focus = true; + }; + cursor = { + hide-after-inactive-ms = 5000; + hide-when-typing = true; + size = 16; + theme = rice.cursor.name; + }; + layout = { + always-center-single-column = true; + gaps = 24; + default-column-width.proportion = 0.5; + preset-column-widths = map (p: { proportion = p; }) [ + (2.0 / 3.0) + 0.5 + (1.0 / 3.0) + ]; + focus-ring = + let + pal = rice.palette.hex; + in + { + active = { + color = pal.bright.yellow; + }; + inactive = { + color = pal.normal.black; + }; + }; + }; + prefer-no-csd = true; + hotkey-overlay.skip-at-startup = true; + window-rules = + let + v = 10.0; + in + [ + { + geometry-corner-radius = { + bottom-left = v; + bottom-right = 0.0; + top-left = 0.0; + top-right = v; + }; + clip-to-geometry = true; + } + ]; + }; + + # programs.ironbar = { + # enable = true; + # systemd = true; + # config = { + # monitors."DP-1" = { + # position = "top"; + # height = 16; + # start = [ + # { + # type = "music"; + # player_type = "mpris"; + # } + # ]; + # center = [ + # { + # type = "focused"; + # icon_size = 16; + # truncate = "middle"; + # } + # ]; + # end = [ + # { type = "clock"; } + # { type = "tray"; } + # ]; + # }; + # }; + # }; + + systemd.user.services.quickshell = { + Unit.PartOf = [ "graphical-session.target" ]; + Unit.After = [ + "graphical-session.target" + "niri.service" + ]; + Install.WantedBy = [ "graphical-session.target" ]; + Service = { + ExecStart = "${lib.getExe' (inputs.quickshell.packages.${pkgs.system}.default.override { + withHyprland = false; + withI3 = false; + }) "qs"}"; + }; + }; + +} diff --git a/home/modules/theming.nix b/home/modules/theming.nix new file mode 100644 index 0000000..7436798 --- /dev/null +++ b/home/modules/theming.nix @@ -0,0 +1,26 @@ +{ pkgs, rice, ... }: +{ + home.packages = [ + pkgs.gtk-engine-murrine + ]; + fonts.fontconfig.enable = true; + + qt = { + enable = true; + style.name = "adwaita-dark"; + platformTheme.name = "adwaita"; + }; + + gtk = { + enable = true; + theme = { + inherit (rice.gtk-theme) package name; + }; + iconTheme = { + inherit (rice.icons) package name; + }; + font = { + inherit (rice.fonts.sans) size package name; + }; + }; +} diff --git a/home/modules/webapps.nix b/home/modules/webapps.nix new file mode 100644 index 0000000..637a7b7 --- /dev/null +++ b/home/modules/webapps.nix @@ -0,0 +1,20 @@ +{ config, ... }: +{ + imports = [ + ../util/firefox-webapp.nix + ]; + programs.firefox.webapps = { + "Syncthing" = { + url = "http://127.0.0.1:8384"; + extraSettings = config.programs.firefox.profiles.default.settings; + name = "Syncthing"; + icon = ../icons/syncthing.png; + }; + "Open-WebUI" = { + url = "http://127.0.0.1:8088"; + extraSettings = config.programs.firefox.profiles.default.settings; + name = "Open-WebUI"; + icon = ../icons/openwebui.png; + }; + }; +} diff --git a/home/plank.nix b/home/plank.nix old mode 100755 new mode 100644 index 73ff8ba..f3004de --- a/home/plank.nix +++ b/home/plank.nix @@ -1,114 +1,13 @@ -{ config, pkgs, lib, ... }: - -let - flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz"; - - hyprland = (import flake-compat { - src = builtins.fetchTarball "https://github.com/hyprwm/Hyprland/archive/master.tar.gz"; - }).defaultNix; - - wlogout_style_base = dots/wlogout/style.css; - wlogout_style = pkgs.runCommandLocal "wlogout_style_base" {wlogpath = lib.strings.escape ["/"] "${pkgs.wlogout}";} '' - cp ${wlogout_style_base} $out - sed -i "s/\/usr\/share\/wlogout/$wlogpath\/share\/wlogout/g" $out - sed -i "s/\/etc\/wlogout/$wlogpath\/etc\/wlogout/g" $out - ''; - -in { - nixpkgs.overlays = [ - (self: super: { - kwin-system76-scheduler-integration = pkgs.libsForQt5.callPackage ../system/syspkgs/kwin-system76-scheduler-integration.nix {}; - hyprland-s76 = pkgs.callPackage ../system/syspkgs/hyprland-system76-scheduler-integration.nix {}; - swayosd = pkgs.callPackage ./homepkgs/swayosd.nix {}; - }) - ]; - +{ + ... +}: +{ imports = [ - hyprland.homeManagerModules.default - ../foreign/dotfiles/home/programs/eww/default.nix - # ../foreign/dotfiles/modules/regreet.nix + ./home.nix ]; - home.username = "plank"; - home.homeDirectory = "/home/plank"; - - programs.eww-hyprland = { - enable = true; - colors = builtins.readFile dots/eww/colors.scss; + home = { + username = "plank"; + homeDirectory = "/home/plank"; }; - - home.packages = with pkgs; [ - qt5ct - zellij - - glib # for gsettings - - fuzzel - grim - slurp - swaybg - wlogout - wf-recorder - libnotify - xorg.xrdb - swayidle - swaynotificationcenter - swayosd - - playerctl - ]; - - xdg.configFile = builtins.mapAttrs (name: value: { enable=true; text=builtins.readFile value; }) - { - "wlogout/layout" = dots/wlogout/layout; - "wlogout/style.css" = wlogout_style; - "swaync/config.json" = dots/swaync/config.json; - "swaync/configSchema.json" = dots/swaync/configSchema.json; - "swaync/style.css" = dots/swaync/style.css; - "fuzzel/fuzzel.ini" = dots/fuzzel/fuzzel.ini; - }; - - wayland.windowManager.hyprland = { - enable = true; - systemdIntegration = true; - nvidiaPatches = false; - xwayland = { - enable = true; - hidpi = false; - }; - recommendedEnvironment = true; - extraConfig = builtins.readFile dots/hyprland/hyprland.conf; - }; - - systemd.user.services."hyprland-system76" = { - Unit = { - Description = "the hyprland process scheduler hook"; - Requires = [ "dbus.service" ]; - }; - Install = { - WantedBy = [ "graphical-session.target" "default.target" ]; - }; - Service = { - ExecStart = ''${pkgs.hyprland-s76}/bin/hyprland-system76-scheduler-hook.sh''; - }; - }; - - systemd.user.startServices = true; - systemd.user.services."com.system76.Scheduler.dbusproxy" = { - - Unit = { - Description = "the system76 process scheduler kwin dbus proxy"; - Requires = [ "dbus.service" ]; - }; - - Install = { - WantedBy = [ "graphical-session.target" "default.target" ]; - }; - - Service = { - ExecStart = ''${pkgs.kwin-system76-scheduler-integration}/bin/kwin-system76-scheduler-dbus-proxy.sh''; - }; - - }; - } diff --git a/home/programs/firefox.nix b/home/programs/firefox.nix new file mode 100644 index 0000000..a7e3168 --- /dev/null +++ b/home/programs/firefox.nix @@ -0,0 +1,93 @@ +{ + lib, + ... +}: +let + officialAddon = name: { + install_url = lib.strings.concatStrings [ + "https://addons.mozilla.org/firefox/downloads/latest/" + name + "/latest.xpi" + ]; + installation_mode = "force_installed"; + }; + lock-false = { + Value = false; + Status = "locked"; + }; + lock-true = { + Value = true; + Status = "locked"; + }; +in +{ + programs.firefox = { + enable = true; + + policies = { + DisableTelemetry = true; + DisableFirefoxStudies = true; + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableAccounts = true; + DisableFirefoxScreenshots = true; + DisableAppUpdate = true; + DisablePrivateBrowsing = true; + DontCheckDefaultBrowser = true; + + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + DisplayBookmarksToolbar = "newtab"; # alternatives: "always" or "newtab" + DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" + SearchBar = "unified"; # alternative: "separate" + + ExtensionSettings = { + "*".installation_mode = "blocked"; # blocks all addons except the ones specified below + "uBlock0@raymondhill.net" = officialAddon "ublock-origin"; + "addon@darkreader.org" = officialAddon "darkreader"; + "keepassxc-browser@keepassxc.org" = officialAddon "keepassxc-browser"; + "vimium-c@gdh1995.cn" = officialAddon "vimium-c"; + "{b86e4813-687a-43e6-ab65-0bde4ab75758}" = officialAddon "localcdn-fork-of-decentraleyes"; + "jid1-5Fs7iTLscUaZBgwr@jetpack" = officialAddon "happy-bonobo-disable-webrtc"; + }; + + Preferences = { + "extensions.pocket.enabled" = lock-false; + "extensions.screenshots.disabled" = lock-true; + "browser.topsites.contile.enabled" = lock-false; + "browser.formfill.enable" = lock-false; + "browser.search.suggest.enabled" = lock-false; + "browser.search.suggest.enabled.private" = lock-false; + "browser.urlbar.suggest.searches" = lock-false; + "browser.urlbar.showSearchSuggestionsFirst" = lock-false; + "browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false; + "browser.newtabpage.activity-stream.feeds.snippets" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false; + "browser.newtabpage.activity-stream.showSponsored" = lock-false; + "browser.newtabpage.activity-stream.system.showSponsored" = lock-false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false; + }; + }; + + profiles.default = { + id = 0; + name = "Default"; + settings = { + "browser.startup.homepage" = "about:blank"; + "browser.shell.didSkipDefaultBrowserCheckOnFirstRun" = true; + "browser.policies.applied" = true; + "widget.use-xdg-desktop-portal.file-picker" = 1; + "widget.use-xdg-desktop-portal.mime-handler" = 1; + }; + }; + }; +} diff --git a/home/programs/helix.nix b/home/programs/helix.nix new file mode 100644 index 0000000..f6d1f3f --- /dev/null +++ b/home/programs/helix.nix @@ -0,0 +1,253 @@ +{ + inputs, + pkgs, + rice, + ... +}: +let + pal = rice.palette.hex; +in +{ + programs.helix = { + enable = true; + package = inputs.helix.packages.${pkgs.system}.helix; + themes = with pal; { + nix-rice = { + "attribute" = bright.cyan; + "keyword" = { + fg = normal.red; + }; + "keyword.directive" = normal.red; + "namespace" = bright.cyan; + "punctuation" = bright.yellow; + "punctuation.delimiter" = bright.yellow; + "operator" = bright.magenta; + "special" = normal.magenta; + "variable.other.member" = bright.blue; + "variable" = util.fg; + "variable.builtin" = bright.yellow; + "variable.parameter" = bright.white; + "type" = normal.yellow; + "type.builtin" = normal.yellow; + "constructor" = { + fg = bright.magenta; + modifiers = [ "bold" ]; + }; + "function" = { + fg = normal.green; + modifiers = [ "bold" ]; + }; + "function.macro" = bright.cyan; + "function.builtin" = normal.yellow; + "tag" = normal.red; + "comment" = { + fg = normal.magenta; + modifiers = [ "italic" ]; + }; + "constant" = { + fg = bright.magenta; + }; + "constant.builtin" = { + fg = bright.magenta; + modifiers = [ "bold" ]; + }; + "string" = normal.green; + "constant.numeric" = bright.magenta; + "constant.character.escape" = { + fg = bright.white; + modifiers = [ "bold" ]; + }; + "label" = bright.cyan; + "module" = bright.cyan; + "diff.plus" = bright.green; + "diff.delta" = bright.yellow; + "diff.minus" = bright.red; + "warning" = bright.yellow; + "error" = bright.red; + "info" = bright.cyan; + "hint" = bright.blue; + "ui.background" = { + inherit (util) bg; + }; + "ui.linenr" = { + fg = normal.cyan; + }; + "ui.linenr.selected" = { + fg = normal.yellow; + modifiers = [ "bold" ]; + }; + "ui.cursorline" = { + bg = normal.black; + }; + "ui.statusline" = { + inherit (util) fg; + bg = bright.black; + }; + "ui.statusline.normal" = { + inherit (util) fg; + bg = bright.black; + }; + "ui.statusline.insert" = { + inherit (util) fg; + bg = normal.blue; + }; + "ui.statusline.select" = { + inherit (util) fg; + bg = bright.yellow; + }; + "ui.statusline.inactive" = { + fg = normal.white; + bg = normal.black; + }; + "ui.popup" = { + bg = normal.black; + }; + "ui.window" = { + bg = normal.black; + }; + "ui.help" = { + bg = normal.black; + inherit (util) fg; + }; + "ui.text" = { + inherit (util) fg; + }; + "ui.text.focus" = { + inherit (util) fg; + }; + "ui.selection" = { + # modifiers = ["reversed"]; + bg = bright.yellow; + }; + "ui.selection.primary" = { + modifiers = [ "reversed" ]; + }; + # "ui.selection.primary" = { bg = bright.cyan; }; + "ui.cursor.primary" = { + bg = normal.white; + fg = normal.black; + }; + "ui.cursor.match" = { + bg = bright.cyan; + }; + "ui.menu" = { + inherit (util) fg; + bg = bright.black; + }; + "ui.menu.selected" = { + fg = bright.black; + bg = bright.blue; + modifiers = [ "bold" ]; + }; + "ui.virtual.whitespace" = bright.black; + "ui.virtual.ruler" = { + bg = normal.black; + }; + "ui.virtual.inlay-hint" = { + fg = normal.magenta; + }; + "diagnostic.warning" = { + underline = { + color = bright.yellow; + style = "curl"; + }; + }; + "diagnostic.error" = { + underline = { + color = bright.red; + style = "curl"; + }; + }; + "diagnostic.info" = { + underline = { + color = bright.cyan; + style = "curl"; + }; + }; + "diagnostic.hint" = { + underline = { + color = bright.blue; + style = "curl"; + }; + }; + "markup.heading" = bright.cyan; + "markup.bold" = { + modifiers = [ "bold" ]; + }; + "markup.italic" = { + modifiers = [ "italic" ]; + }; + "markup.strikethrough" = { + modifiers = [ "crossed_out" ]; + }; + "markup.link.url" = { + fg = bright.green; + modifiers = [ "underlined" ]; + }; + "markup.link.text" = bright.red; + "markup.raw" = bright.red; + }; + }; + + # theme = "nix-rice" + + settings = { + theme = "nix-rice"; + editor = { + bufferline = "multiple"; + cursorline = true; + true-color = true; + cursor-shape = { + insert = "bar"; + normal = "block"; + select = "underline"; + }; + statusline.left = [ + "mode" + "spinner" + "version-control" + "file-name" + "file-modification-indicator" + ]; + lsp.display-messages = true; + }; + }; + + languages = { + language = [ + { + name = "rust"; + language-servers = [ "rust-analyzer" ]; + } + { + name = "nix"; + language-servers = [ "nil" ]; + file-types = [ "nix" ]; + auto-format = true; + formatter = { + command = "nixfmt"; + }; + } + ]; + + language-server = { + qmlls = { + command = "qmlls"; + args = [ "-E" ]; + }; + + nil = { + command = "nil"; + }; + + rust-analyzer = { + config = { + cargo.buildScripts.enable = true; + procMacro.enable = true; + check.command = "clippy"; + }; + }; + }; # language-server + }; # languages + }; # helix config +} diff --git a/home/programs/kitty.nix b/home/programs/kitty.nix new file mode 100644 index 0000000..aa5c486 --- /dev/null +++ b/home/programs/kitty.nix @@ -0,0 +1,42 @@ +{ + rice, + ... +}: +let + pal = rice.palette.hex; +in +{ + programs.kitty = { + enable = true; + font = { + inherit (rice.fonts.monospace) name size; + }; + settings = with pal; { + foreground = util.fg; + background = util.bg; + inherit (util) cursor; + cursor_text = util.bg; + selection_foreground = util.fg_sel; + selection_background = util.bg_sel; + color0 = normal.black; + color1 = normal.red; + color2 = normal.green; + color3 = normal.yellow; + color4 = normal.blue; + color5 = normal.magenta; + color6 = normal.cyan; + color7 = normal.white; + color8 = bright.black; + color9 = bright.red; + color10 = bright.green; + color11 = bright.yellow; + color12 = bright.blue; + color13 = bright.magenta; + color14 = bright.cyan; + color15 = bright.white; + sync_to_monitor = "yes"; + shell = "fish"; + cursor_trail = 100; + }; + }; +} diff --git a/home/programs/wlogout.nix b/home/programs/wlogout.nix new file mode 100644 index 0000000..3721963 --- /dev/null +++ b/home/programs/wlogout.nix @@ -0,0 +1,71 @@ +{ + rice, + pkgs, + ... +}: +let + pal = rice.palette.hex; +in +{ + programs.wlogout = { + enable = true; + package = pkgs.wleave; + layout = builtins.fromJSON (builtins.readFile ../dots/wlogout/layout); + style = + with pal; + (builtins.replaceStrings + [ + "/usr/share/wlogout" + "/etc/wlogout" + "#WINBG" + "#BTNCOL" + "#BTNBG" + "#BTNFOCUSBG" + "#WINLOGO" + ] + [ + "${pkgs.wlogout}/share/wlogout" + "${pkgs.wlogout}/etc/wlogout" + util.bg + bright.yellow + util.bg + normal.black + (builtins.path { + name = "winlogo"; + path = ../icons/winlogo.png; + sha256 = "7c1ff96b553c7a7ca3a7b7cf8efe830ab7feea92355aed288a10ee7347c24108"; + }) + ] + (builtins.readFile ../dots/wlogout/style.css) + ); + }; + # xdg.configFile = { + # "wleave/layout".text = builtins.readFile ../dots/wlogout/layout; + # "wleave/style.css".text = with palette-hex; (builtins.replaceStrings + # [ + # "/usr/share/wlogout" + # "/etc/wlogout" + # "#WINBG" + # "#BTNCOL" + # "#BTNBG" + # "#BTNFOCUSBG" + # "#WINLOGO" + # ] + # [ + # "${pkgs.wleave}/share/wleave" + # "${pkgs.wleave}/etc/wleave" + # util.bg + # bright.yellow + # util.bg + # normal.black + # (builtins.path { + # name = "winlogo"; + # path = ../icons/winlogo.png; + # sha256 = "7c1ff96b553c7a7ca3a7b7cf8efe830ab7feea92355aed288a10ee7347c24108"; + # }) + # ] + # (builtins.readFile ../dots/wlogout/style.css)); + # }; + + home.packages = [ pkgs.wlogout ]; +} diff --git a/home/util/ez.nix b/home/util/ez.nix new file mode 100644 index 0000000..678c565 --- /dev/null +++ b/home/util/ez.nix @@ -0,0 +1,71 @@ +{ + config, + lib, + ... +}: +{ + options = { + ezServices = + with lib; + mkOption { + type = with types; attrsOf str; + default = { }; + }; + + ezOneShots = + with lib; + mkOption { + type = with types; attrsOf str; + default = { }; + }; + ezConf = + with lib; + mkOption { + type = with types; attrsOf path; + default = { }; + }; + + # for specifying an additional systemd target + extraTarget = + with lib; + mkOption { + type = with types; listOf str; + default = [ ]; + }; + }; + + config = { + systemd.user.services = + builtins.mapAttrs (name: cmd: { + Unit = { + Description = "${name}"; + Requires = [ "graphical-session.target" ] ++ config.extraTarget; + After = [ "graphical-session.target" ] ++ config.extraTarget; + }; + Service = { + ExecStart = cmd; + }; + Install = { + WantedBy = [ "graphical-session.target" ] ++ config.extraTarget; + }; + }) config.ezServices + // builtins.mapAttrs (name: cmd: { + Unit = { + Description = "${name}"; + After = [ "graphical-session.target" ] ++ config.extraTarget; + }; + Service = { + ExecStart = cmd; + Type = "oneshot"; + }; + Install = { + WantedBy = [ "graphical-session.target" ] ++ config.extraTarget; + }; + }) config.ezOneShots; + + xdg.configFile = builtins.mapAttrs (_name: value: { + enable = true; + source = value; + }) config.ezConf; + }; +} diff --git a/home/util/firefox-webapp.nix b/home/util/firefox-webapp.nix new file mode 100644 index 0000000..7dbe7a5 --- /dev/null +++ b/home/util/firefox-webapp.nix @@ -0,0 +1,260 @@ +{ + config, + lib, + ... +}: +let + inherit (builtins) getAttr stringLength substring; + inherit (lib) + mkOption + getExe + listToAttrs + attrsToList + imap + ; + inherit (lib.attrsets) + mapAttrs + mapAttrs' + nameValuePair + ; + inherit (lib.strings) concatStringsSep toUpper; + + enumerate = + a: + listToAttrs ( + imap ( + id: + { + name, + value, + }: + { + inherit name; + value = value // { + inherit id; + }; + } + ) (attrsToList a) + ); + make-app-profiles = + cfg: + mapAttrs' ( + name: cfg: + nameValuePair "home-manager-webapp-${name}" { + inherit (cfg) id; + userChrome = '' + @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + + browser { + margin-right: 0px; margin-bottom: 0px; + } + + #TabsToolbar { + visibility: collapse !important; + } + + #nav-bar { + margin-top: 0; + margin-bottom: -42px; + z-index: -100; + } + + #main-window[windowtype="navigator:browser"] { + background-color: transparent !important; + } + + .tab-background[selected="true"] { + background: ${cfg.backgroundColor} !important; + } + ''; + + settings = cfg.extraSettings // { + "browser.startup.homepage" = builtins.toString cfg.url; + "browser.sessionstore.resume_session_once" = false; + "browser.sessionstore.resume_from_crash" = false; + "browser.cache.disk.enable" = false; + "browser.cache.disk.capacity" = 0; + "browser.cache.disk.filesystem_reported" = 1; + "browser.cache.disk.smart_size.enabled" = false; + "browser.cache.disk.smart_size.first_run" = false; + "browser.cache.disk.smart_size.use_old_max" = false; + "browser.ctrlTab.previews" = true; + "browser.tabs.warnOnClose" = false; + "plugin.state.flash" = 2; + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + "browser.tabs.drawInTitlebar" = false; + "browser.tabs.inTitlebar" = 0; + "browser.contentblocking.category" = "strict"; + "network.cookie.lifetimePolicy" = 0; + "layout.css.prefers-color-scheme.content-override" = getAttr cfg.theme { + dark = 0; + light = 1; + system = 2; + }; + }; + } + ) cfg; +in +{ + options.programs.firefox.webapps = mkOption { + default = { }; + + type = + with lib.types; + attrsOf (submodule { + options = { + #################### + # Firefox settings # + #################### + url = mkOption { + type = str; + description = "The URL of the webapp to launch."; + }; + + # id = mkOption { + # type = int; + # description = "The Firefox profile ID to set."; + # }; + + hidden = mkOption { + type = bool; + description = "Hide this webapp from the list of applications (but still generate a .desktop file)."; + default = false; + }; + + extraArgs = mkOption { + type = listOf str; + default = [ ]; + description = "Extra args to launch Firefox with."; + }; + + extraSettings = mkOption { + type = attrsOf (either bool (either int str)); + default = { }; + description = "Additional Firefox profile settings."; + }; + + backgroundColor = mkOption { + type = str; + default = "rgba(0, 0, 0, 0)"; + description = "The background color to use for loading pages."; + }; + + theme = mkOption { + type = enum [ + "dark" + "light" + "system" + ]; + default = "system"; + description = "The application CSS theme to use, if supported."; + }; + + ######################### + # Desktop file settings # + ######################### + + # Copied from xdg.desktopEntries, with slight modification for default settings + name = mkOption { + type = nullOr str; + default = null; + description = "Specific name of the application. Defaults to the capitalized attribute name."; + }; + + mimeType = mkOption { + description = "The MIME type(s) supported by this application."; + type = nullOr (listOf str); + default = [ + "text/html" + "text/xml" + "application/xhtml_xml" + ]; + }; + + # Copied verbatim from xdg.desktopEntries. + genericName = mkOption { + type = nullOr str; + default = null; + description = "Generic name of the application."; + }; + + comment = mkOption { + type = nullOr str; + default = null; + description = "Tooltip for the entry."; + }; + + categories = mkOption { + type = nullOr (listOf str); + default = null; + description = "Categories in which the entry should be shown in a menu."; + }; + + icon = mkOption { + type = nullOr (either str path); + default = null; + description = "Icon to display in file manager, menus, etc."; + }; + + prefersNonDefaultGPU = mkOption { + type = nullOr bool; + default = null; + description = '' + If true, the application prefers to be run on a more + powerful discrete GPU if available. + ''; + }; + }; + }); + + description = "Websites to create special site-specific Firefox instances for."; + }; + + config = { + programs.firefox.profiles = make-app-profiles (enumerate config.programs.firefox.webapps); + + xdg.desktopEntries = mapAttrs (name: cfg: { + inherit (cfg) + genericName + comment + categories + icon + mimeType + prefersNonDefaultGPU + ; + + name = + if cfg.name == null then + (toUpper (substring 0 1 name)) + (substring 1 (stringLength name) name) + else + cfg.name; + + startupNotify = true; + terminal = false; + type = "Application"; + + exec = concatStringsSep " " ( + [ + "${getExe config.programs.firefox.package}" + "--name" + "${name}" + "--app-id" + "${name}" + "--class" + "${name}" + "-P" + "${config.programs.firefox.profiles."home-manager-webapp-${name}".path}" + "--no-remote" + ] + ++ cfg.extraArgs + ++ [ "${cfg.url}" ] + ); + + settings = { + X-MultipleArgs = "false"; # Consider enabling, don't know what this does + StartupWMClass = "${name}"; + NoDisplay = lib.boolToString cfg.hidden; + }; + }) config.programs.firefox.webapps; + }; +} diff --git a/home/util/local-webapp.nix b/home/util/local-webapp.nix new file mode 100644 index 0000000..a42c977 --- /dev/null +++ b/home/util/local-webapp.nix @@ -0,0 +1,252 @@ +{ + config, + pkgs, + lib, + ... +}: +let + inherit (lib) + mkOption + mkForce + getExe + getExe' + listToAttrs + flatten + mapAttrsToList + mapAttrs + mapAttrs' + nameValuePair + toLower + replaceStrings + concatMapStringsSep + ; + partOf = cfg: "${replaceStrings [ " " ] [ "-" ] (toLower cfg.name)}.target"; + # make a firefox webapp + hidden .desktop entry for the client app + make-firefox = + cfg: + mapAttrs' ( + name: cfg: + nameValuePair "${name}-client" { + inherit (cfg) name; + url = "http://127.0.0.1:${builtins.toString cfg.port}"; + extraSettings = config.programs.firefox.profiles.default.settings; + hidden = true; + } + ) cfg; + # make a systemd service for running the frontend + make-systemd-service = + cfg: + mapAttrs' ( + name: cfg: + if (cfg.service != null) then + nameValuePair "${cfg.name}-frontend" { + Unit = { + Description = "${cfg.name} Frontend"; + WantedBy = mkForce [ ]; + }; + + Service = cfg.service; + } + else + nameValuePair "" { } + ) cfg; + # modify systemd units to be PartOf this target + modify-systemd-services = + cfg: + listToAttrs ( + flatten ( + mapAttrsToList ( + name: cfg: + (map (req: { + name = "${req}"; + value = { + Unit = { + PartOf = partOf cfg; + }; + }; + }) cfg.requires.services) + ) cfg + ) + ); + modify-quadlets = + cfg: + listToAttrs ( + flatten ( + mapAttrsToList ( + name: cfg: + (map (req: { + name = "${req}"; + value = { + extraConfig.Unit.PartOf = partOf cfg; + }; + }) cfg.requires.containers) + ) cfg + ) + ); + # make a systemd target to collate dependencies + make-systemd-target = + cfg: + mapAttrs (name: cfg: { + Unit = { + Description = "${cfg.name} Target"; + WantedBy = mkForce [ ]; + Requires = + (map (req: req + ".service") cfg.requires.services) + ++ (map (req: "podman-" + req + ".service") cfg.requires.containers); + }; + }) cfg; + # make desktop shortcuts and a script which will handle starting everything + make-xdg = + cfg: + mapAttrs (name: cfg: { + inherit (cfg) name icon genericName; + type = "Application"; + exec = "${ + let + notify-send = "${getExe' pkgs.libnotify "notify-send"} -a \"${cfg.name}\""; + systemctl = "${getExe' pkgs.systemd "systemctl"}"; + dex = "${getExe pkgs.dex}"; + podman = "${getExe pkgs.podman}"; + makeContainerCheck = + container: ''[ "$(${podman} inspect -f {{.State.Health.Status}} ${container})" == "healthy" ]''; + # makeContainerCheck = container: '' + # [ ${podman} inspect -f {{.State.Status}} ${container})" != "running" ] + # ''; + containerChecks = + if (cfg.requires.containers != [ ]) then + '' + container_checks() { + if '' + + (concatMapStringsSep " && " makeContainerCheck cfg.requires.containers) + + '' + ; then + return 0 + else + return 1 + fi + } + '' + else + '' + container_checks() { + return 0 + } + ''; + in + pkgs.writeShellScript "${name}" '' + set -euo pipefail + + exit_error() { + ${notify-send} -w "Failure" $1 + exit 1 + } + + ${containerChecks} + + ${notify-send} "Launching ${name} backend.." "Please be patient." + ${systemctl} --user start ${name}.target || exit_error "Failed to launch!" + + checks=0 + until container_checks; do + sleep 2 + checks=$((checks+1)) + if [ $((checks%10)) -eq 0 ]; then + ${notify-send} "Waiting for backend." + fi + if [ $checks -ge 60 ]; then + ${systemctl} --no-block --user stop ${name}.target + exit_error "Failed to launch!" + fi + done + + ${notify-send} "Launching ${name}.." + ${dex} -w ~/.nix-profile/share/applications/${name}-client.desktop + + ${notify-send} "Goodbye" "Shutting down." + ${systemctl} --user stop ${name}.target + exit 0 + '' + }"; + }) cfg; + cfg = config.localWebApps; +in +{ + options.localWebApps = mkOption { + default = { }; + type = + with lib.types; + attrsOf (submodule { + options = { + name = mkOption { + type = str; + description = "Display name of the webapp."; + }; + + genericName = mkOption { + type = nullOr str; + description = "Generic name of the webapp."; + default = null; + }; + + icon = mkOption { + type = nullOr (either str path); + description = "Path to a file to use for application icon."; + default = null; + }; + + requires = mkOption { + type = nullOr (submodule { + options = { + containers = mkOption { + type = listOf str; + default = [ ]; + }; + services = mkOption { + type = listOf str; + default = [ ]; + }; + }; + }); + default = null; + description = "Containers or services this app requires."; + }; + + service = mkOption { + type = nullOr (submodule { + options = { + execStartPre = mkOption { + type = nullOr str; + default = null; + }; + execStart = mkOption { + type = nullOr str; + default = null; + }; + execStop = mkOption { + type = nullOr str; + default = null; + }; + }; + }); + default = null; + description = "Submodule containing exec[StartPre/Start/Stop] commands for any required systemd service"; + }; + + port = mkOption { + type = int; + description = "Local port the webapp should host on."; + }; + }; + }); + }; + + config = { + programs.firefox.webapps = make-firefox cfg; + + systemd.user.targets = make-systemd-target cfg; + systemd.user.services = (make-systemd-service cfg) // (modify-systemd-services cfg); + services.podman.containers = modify-quadlets cfg; + + xdg.desktopEntries = make-xdg cfg; + }; +} diff --git a/home/util/name.nix b/home/util/name.nix new file mode 100644 index 0000000..18b1386 --- /dev/null +++ b/home/util/name.nix @@ -0,0 +1,10 @@ +{ + mainUser, + ... +}: +{ + config.home = { + username = mainUser; + homeDirectory = "/home/${mainUser}"; + }; +} diff --git a/kdekeys b/kdekeys deleted file mode 100755 index 63cb523..0000000 --- a/kdekeys +++ /dev/null @@ -1,384 +0,0 @@ -[ActivityManager][Global Shortcuts] -switch-to-activity-1becc5fb-3def-4b2a-82c9-bd886f792a7c= - -[KDE Keyboard Layout Switcher][Global Shortcuts] -Switch to Next Keyboard Layout=Ctrl+Alt+K - -[StandardShortcuts] -AboutApp= -AboutKDE= -Activate Next Tab=Ctrl+PgDown; Ctrl+] -Activate Previous Tab=Ctrl+PgUp; Ctrl+[ -ActualSize=Ctrl+0 -AddBookmark=Ctrl+B -Back=Alt+Left; Back -BackwardWord=Ctrl+Left -Begin=Ctrl+Home -BeginningOfLine=Home -Clear= -Close=Ctrl+W; Ctrl+Esc -ConfigureNotifications= -ConfigureToolbars= -Copy=Ctrl+C; Ctrl+Ins -CreateFolder=F10 -Cut=Shift+Del; Ctrl+X -DeleteFile=Shift+Del -DeleteWordBack=Ctrl+Backspace -DeleteWordForward=Ctrl+Del -Deselect=Ctrl+Shift+A -DocumentBack=Alt+Shift+Left -DocumentForward=Alt+Shift+Right -Donate= -EditBookmarks= -End=Ctrl+End -EndOfLine=End -Find=Ctrl+F -FindNext=F3 -FindPrev=Shift+F3 -FitToHeight= -FitToPage= -FitToWidth= -Forward=Alt+Right; Forward -ForwardWord=Ctrl+Right -FullScreen=Ctrl+Shift+F -Goto= -GotoLine=Ctrl+G -GotoPage= -Help=F1 -Home=Alt+Home; Home Page -KeyBindings=Ctrl+Alt+, -Mail= -MoveToTrash=Del -New=Ctrl+N -Next=PgDown -NextCompletion=Ctrl+Down -Open=Ctrl+O -OpenRecent= -Paste=Shift+Ins; Ctrl+V -Paste Selection=Ctrl+Shift+Ins -Preferences=Ctrl+Shift+, -PrevCompletion=Ctrl+Up -Print=Ctrl+P -PrintPreview= -Prior=PgUp -Quit=Ctrl+Q -Redo=Ctrl+Shift+Z -Reload=Refresh; F5 -RenameFile=F2 -Replace=Ctrl+R -ReportBug= -Revert= -RotateDown=Down -RotateUp=Up -Save=Ctrl+S -SaveAs=Ctrl+Shift+S -SaveOptions= -SelectAll=Ctrl+A -ShowHideHiddenFiles=Alt+.; Ctrl+H -ShowMenubar=Ctrl+M -ShowStatusbar= -ShowToolbar= -Spelling= -SubstringCompletion=Ctrl+T -SwitchApplicationLanguage= -TextCompletion=Ctrl+E -TipofDay= -Undo=Ctrl+Z -Up=Alt+Up -WhatsThis=Shift+F1 -Zoom= -ZoomIn=Ctrl++; Ctrl+= -ZoomOut=Ctrl+- - -[bismuth][Global Shortcuts] -decrease_master_size= -decrease_master_win_count=Meta+[ -decrease_window_height=Meta+Ctrl+K; Meta+Ctrl+Up -decrease_window_width=Meta+Ctrl+Right; Meta+Ctrl+H -focus_bottom_window= -focus_left_window= -focus_next_window= -focus_prev_window= -focus_right_window= -focus_upper_window= -increase_master_size= -increase_master_win_count=Meta+] -increase_window_height=Meta+Ctrl+Down; Meta+Ctrl+J -increase_window_width=Meta+Ctrl+Left; Meta+Ctrl+L -move_window_to_bottom_pos=Meta+Shift+Down; Meta+Shift+J -move_window_to_left_pos=Meta+Shift+H -move_window_to_next_pos= -move_window_to_prev_pos= -move_window_to_right_pos=Meta+Shift+L -move_window_to_upper_pos=Meta+Shift+K; Meta+Shift+Up -next_layout=Meta+\\ -prev_layout= -push_window_to_master= -rotate= -rotate_part= -rotate_reverse= -toggle_float_layout= -toggle_monocle_layout= -toggle_quarter_layout= -toggle_spiral_layout= -toggle_spread_layout= -toggle_stair_layout= -toggle_three_column_layout= -toggle_tile_layout= -toggle_window_floating=Meta+Space - -[kaccess][Global Shortcuts] -Toggle Screen Reader On and Off=Meta+Alt+S - -[kcm_touchpad][Global Shortcuts] -Disable Touchpad=Touchpad Off -Enable Touchpad=Touchpad On -Toggle Touchpad=Touchpad Toggle - -[kded5][Global Shortcuts] -Show System Activity=Ctrl+Esc -display=Display; Meta+P - -[khotkeys][Global Shortcuts] -{162b7cd1-2ed9-40a7-9e77-8cdac1ced63b}=Meta+Return -{2b174cac-ee33-41d3-979c-c2151b4485c3}=Meta+F -{d03619b6-9b3c-48cc-9d9c-a2aadb485550}= - -[kmix][Global Shortcuts] -decrease_microphone_volume=Microphone Volume Down -decrease_volume=Volume Down -increase_microphone_volume=Microphone Volume Up -increase_volume=Volume Up -mic_mute=Microphone Mute; Meta+Volume Mute -mute=Volume Mute - -[ksmserver][Global Shortcuts] -Halt Without Confirmation= -Lock Session=Screensaver; Ctrl+Alt+L -Log Out=Ctrl+Alt+Del -Log Out Without Confirmation= -Reboot Without Confirmation= - -[kwin][Global Shortcuts] -Activate Window Demanding Attention=Ctrl+Alt+A -Decrease Opacity= -Expose=Ctrl+F9 -ExposeAll=Ctrl+F10; Launch (C) -ExposeClass=Ctrl+F7 -Increase Opacity= -Invert Screen Colors= -Kill Window=Ctrl+Alt+Esc -MoveMouseToCenter=Meta+F6 -MoveMouseToFocus=Meta+F5 -MoveZoomDown= -MoveZoomLeft= -MoveZoomRight= -MoveZoomUp= -Setup Window Shortcut= -Show Desktop= -ShowDesktopGrid=Ctrl+F8 -Suspend Compositing=Alt+Shift+F12 -Switch One Desktop Down= -Switch One Desktop Up= -Switch One Desktop to the Left= -Switch One Desktop to the Right= -Switch Window Down=Meta+J; Meta+Down -Switch Window Left=Meta+Left; Meta+H -Switch Window Right=Meta+Right; Meta+L -Switch Window Up=Meta+Up; Meta+K -Switch to Desktop 1=Meta+1 -Switch to Desktop 10= -Switch to Desktop 11= -Switch to Desktop 12= -Switch to Desktop 13= -Switch to Desktop 14= -Switch to Desktop 15= -Switch to Desktop 16= -Switch to Desktop 17= -Switch to Desktop 18= -Switch to Desktop 19= -Switch to Desktop 2=Meta+2 -Switch to Desktop 20= -Switch to Desktop 3=Meta+3 -Switch to Desktop 4=Meta+4 -Switch to Desktop 5= -Switch to Desktop 6= -Switch to Desktop 7= -Switch to Desktop 8= -Switch to Desktop 9= -Switch to Next Desktop= -Switch to Next Screen= -Switch to Previous Desktop= -Switch to Previous Screen= -Switch to Screen 0= -Switch to Screen 1= -Switch to Screen 2= -Switch to Screen 3= -Switch to Screen 4= -Switch to Screen 5= -Switch to Screen 6= -Switch to Screen 7= -Toggle Night Color= -Toggle Window Raise/Lower= -Walk Through Desktop List= -Walk Through Desktop List (Reverse)= -Walk Through Desktops= -Walk Through Desktops (Reverse)= -Walk Through Windows=Alt+Tab -Walk Through Windows (Reverse)=Alt+Shift+Backtab -Walk Through Windows Alternative= -Walk Through Windows Alternative (Reverse)= -Walk Through Windows of Current Application=Alt+` -Walk Through Windows of Current Application (Reverse)=Alt+~ -Walk Through Windows of Current Application Alternative= -Walk Through Windows of Current Application Alternative (Reverse)= -Window Above Other Windows= -Window Below Other Windows= -Window Close=Alt+F4; Meta+Shift+Q -Window Fullscreen=Meta+Shift+Space -Window Grow Horizontal= -Window Grow Vertical= -Window Lower= -Window Maximize=Meta+PgUp -Window Maximize Horizontal= -Window Maximize Vertical= -Window Minimize=Meta+PgDown -Window Move= -Window Move Center= -Window No Border= -Window On All Desktops= -Window One Desktop Down=Meta+Ctrl+Shift+Down -Window One Desktop Up=Meta+Ctrl+Shift+Up -Window One Desktop to the Left=Meta+Ctrl+Shift+Left -Window One Desktop to the Right=Meta+Ctrl+Shift+Right -Window Operations Menu=Alt+F3 -Window Pack Down= -Window Pack Left= -Window Pack Right= -Window Pack Up= -Window Quick Tile Bottom= -Window Quick Tile Bottom Left= -Window Quick Tile Bottom Right= -Window Quick Tile Left= -Window Quick Tile Right= -Window Quick Tile Top= -Window Quick Tile Top Left= -Window Quick Tile Top Right= -Window Raise= -Window Resize= -Window Shade= -Window Shrink Horizontal= -Window Shrink Vertical= -Window to Desktop 1=Meta+! -Window to Desktop 10= -Window to Desktop 11= -Window to Desktop 12= -Window to Desktop 13= -Window to Desktop 14= -Window to Desktop 15= -Window to Desktop 16= -Window to Desktop 17= -Window to Desktop 18= -Window to Desktop 19= -Window to Desktop 2=Meta+@ -Window to Desktop 20= -Window to Desktop 3=Meta+# -Window to Desktop 4=Meta+$ -Window to Desktop 5= -Window to Desktop 6= -Window to Desktop 7= -Window to Desktop 8= -Window to Desktop 9= -Window to Next Desktop= -Window to Next Screen=Meta+Tab -Window to Previous Desktop= -Window to Previous Screen= -Window to Screen 0= -Window to Screen 1= -Window to Screen 2= -Window to Screen 3= -Window to Screen 4= -Window to Screen 5= -Window to Screen 6= -Window to Screen 7= -view_actual_size=Meta+0 -view_zoom_in=Meta+= -view_zoom_out=Meta+- - -[mediacontrol][Global Shortcuts] -mediavolumedown= -mediavolumeup= -nextmedia=Media Next -pausemedia=Media Pause -playmedia= -playpausemedia=Media Play -previousmedia=Media Previous -stopmedia=Media Stop - -[org.kde.dolphin.desktop][Global Shortcuts] -_launch=Meta+E - -[org.kde.krunner.desktop][Global Shortcuts] -RunClipboard=Alt+Shift+F2 -_launch=Alt+Space; Search; Meta+D; Alt+F2 - -[org.kde.plasma.emojier.desktop][Global Shortcuts] -_launch=Meta+. - -[org.kde.spectacle.desktop][Global Shortcuts] -ActiveWindowScreenShot=Meta+Print -CurrentMonitorScreenShot= -FullScreenScreenShot=Shift+Print -OpenWithoutScreenshot= -RectangularRegionScreenShot=Meta+Shift+S; Meta+Shift+Print -WindowUnderCursorScreenShot=Meta+Ctrl+Print -_launch=Print - -[org_kde_powerdevil][Global Shortcuts] -Decrease Keyboard Brightness=Keyboard Brightness Down -Decrease Screen Brightness=Monitor Brightness Down -Hibernate=Hibernate -Increase Keyboard Brightness=Keyboard Brightness Up -Increase Screen Brightness=Monitor Brightness Up -PowerDown=Power Down -PowerOff=Power Off -Sleep=Sleep -Toggle Keyboard Backlight=Keyboard Light On/Off -Turn Off Screen= - -[plasmashell][Global Shortcuts] -activate task manager entry 1= -activate task manager entry 10= -activate task manager entry 2= -activate task manager entry 3= -activate task manager entry 4= -activate task manager entry 5=Meta+5 -activate task manager entry 6=Meta+6 -activate task manager entry 7=Meta+7 -activate task manager entry 8=Meta+8 -activate task manager entry 9=Meta+9 -activate widget 4=Alt+F1 -clear-history= -clipboard_action=Ctrl+Alt+X -cycleNextAction= -cyclePrevAction= -edit_clipboard= -manage activities=Meta+Q -next activity= -previous activity=Meta+Shift+Tab -repeat_action=Ctrl+Alt+R -show dashboard=Ctrl+F12 -show-barcode= -show-on-mouse-pos=Meta+V -stop current activity=Meta+S -switch to next activity= -switch to previous activity= -toggle do not disturb= - -[systemsettings.desktop][Global Shortcuts] -_launch=Tools -kcm-kscreen= -kcm-lookandfeel= -kcm-users= -powerdevilprofilesconfig= -screenlocker= diff --git a/rice/default.nix b/rice/default.nix new file mode 100644 index 0000000..9baaf24 --- /dev/null +++ b/rice/default.nix @@ -0,0 +1,141 @@ +{ + inputs, + system, + nix-rice, +}: +let + pkgs = inputs.nixpkgs.legacyPackages.${system}; + inherit (nix-rice) kitty-themes; + inherit (nix-rice.palette) toRGBShortHex toRGBHex; + theme = kitty-themes.parseTheme ./pal.conf; +in +rec { + palette = theme // { + normal = { + black = theme.color0; + red = theme.color1; + green = theme.color2; + yellow = theme.color3; + blue = theme.color4; + magenta = theme.color5; + cyan = theme.color6; + white = theme.color7; + }; + bright = { + black = theme.color8; + red = theme.color9; + green = theme.color10; + yellow = theme.color11; + blue = theme.color12; + magenta = theme.color13; + cyan = theme.color14; + white = theme.color15; + }; + util = { + fg = theme.foreground; + bg = theme.background; + fg_sel = theme.selection_foreground; + bg_sel = theme.selection_background; + inherit (theme) cursor; + # url = theme.url_color; + }; + hex = toRGBHex palette; + shortHex = toRGBShortHex palette; + }; + + fonts = + let + sans = { + name = "Inria Sans"; + size = 12; + package = pkgs.inriafonts; + }; + serif = { + name = "Inria Serif"; + size = 12; + package = pkgs.inriafonts; + }; + monospace = { + name = "Fira Code"; + size = 10; + package = pkgs.fira-code; + }; + emoji = { + name = "Twitter Color Emoji"; + size = 12; + package = pkgs.twemoji-color-font; + }; + in + { + inherit + sans + serif + monospace + emoji + ; + pkgs = [ + sans.package + serif.package + monospace.package + emoji.package + pkgs.meslo-lgs-nf + ]; + }; + + icons = + let + package = pkgs.papirus-icon-theme; + in + { + inherit package; + name = "Papirus-Dark"; + pkgs = [ + package + # material-icons + # material-design-icons + ]; + }; + + gtk-theme = { + name = "nix-rice"; + package = pkgs.callPackage ./gtk-theme.nix { } { palette = toRGBShortHex palette; }; + }; + + borders = { + thickness = 6; + rounding = 0; + gaps_in = 32; + gaps_out = 72; + }; + + bg = { + image = pkgs.callPackage ./wallpaper.nix { } { + palette = toRGBShortHex palette; + wallpaper = + let + name = "wallpaper.jpg"; + in + builtins.path { + inherit name; + path = ./${name}; + sha256 = "2db3f9d0397fbd4746ada297bd14c0c7d3e22c7d4e894968fcfece90bbfb902a"; + }; + }; + }; + + cursor = { + package = pkgs.afterglow-cursors-recolored.override { + themeVariants = [ "Dracula" ]; + draculaColorVariants = [ "Orange" ]; + }; + name = "Afterglow-Recolored-Dracula-Orange"; + }; + + plymouth = { + theme = "starship"; + font = "${fonts.sans.package}/share/fonts/truetype/InriaSans-Regular.ttf"; + themePackages = [ + inputs.hudcore.packages.${pkgs.system}.default + ]; + }; +} diff --git a/rice/gtk-theme.nix b/rice/gtk-theme.nix new file mode 100644 index 0000000..51e3d5f --- /dev/null +++ b/rice/gtk-theme.nix @@ -0,0 +1,74 @@ +{ pkgs }: +{ palette }: +let + rendersvg = pkgs.runCommand "rendersvg" { } '' + mkdir -p $out/bin + ln -s ${pkgs.resvg}/bin/resvg $out/bin/rendersvg + ''; +in +pkgs.stdenv.mkDerivation { + name = "generated-gtk-theme-nix-rice"; + src = pkgs.fetchFromGitHub { + owner = "nana-4"; + repo = "materia-theme"; + rev = "d7f59a37ef51f893c28b55dc344146e04b2cd52c"; + sha256 = "sha256-PnpFAmKEpfg3wBwShLYviZybWQQltcw7fpsQkTUZtww="; + }; + buildInputs = builtins.attrValues { + inherit (pkgs) + sassc + bc + which + meson + optipng + ninja + ; + inherit (pkgs.nodePackages) + sass + ; + inherit (pkgs.gtk4) dev; + inherit rendersvg; + }; + phases = [ + "unpackPhase" + "installPhase" + ]; + installPhase = '' + HOME=/build + chmod 777 -R . + patchShebangs . + mkdir -p $out/share/themes + mkdir bin + sed -e 's/handle-horz-.*//' -e 's/handle-vert-.*//' -i ./src/gtk-2.0/assets.txt + + cat > /build/gtk-colors << EOF + BTN_BG=${palette.util.bg} + BTN_FG=${palette.bright.yellow} + FG=${palette.util.fg} + BG=${palette.util.bg} + HDR_BTN_BG=${palette.util.bg} + HDR_BTN_FG=${palette.util.fg} + ACCENT_BG=${palette.normal.cyan} + ACCENT_FG=${palette.normal.yellow} + HDR_FG=${palette.bright.yellow} + HDR_BG=${palette.util.bg} + MATERIA_SURFACE=${palette.normal.black} + MATERIA_VIEW=${palette.bright.black} + MENU_BG=${palette.util.bg} + MENU_FG=${palette.util.fg} + SEL_BG=${palette.normal.yellow} + SEL_FG=${palette.normal.cyan} + TXT_BG=${palette.util.bg} + TXT_FG=${palette.util.fg} + WM_BORDER_FOCUS=${palette.normal.yellow} + WM_BORDER_UNFOCUS=${palette.normal.black} + UNITY_DEFAULT_LAUNCHER_STYLE=False + NAME="nix-rice" + MATERIA_STYLE_COMPACT=False + EOF + + echo "Changing colours:" + ./change_color.sh -o nix-rice /build/gtk-colors -i False -t "$out/share/themes" + chmod 555 -R . + ''; +} diff --git a/header.sh b/rice/header.sh similarity index 100% rename from header.sh rename to rice/header.sh diff --git a/rice/pal.conf b/rice/pal.conf new file mode 100644 index 0000000..9535d73 --- /dev/null +++ b/rice/pal.conf @@ -0,0 +1,32 @@ +background #1b2021 +foreground #cecbca + +color0 #272a2a +color8 #202e2f + +color1 #c43325 +color9 #c46056 + +color2 #8cc992 +color10 #c2dab0 + +color3 #ffb852 +color11 #ffab5b + +color4 #5299ff +color12 #92beff + +color5 #645ac9 +color13 #928cc9 + +color6 #5abfc9 +color14 #8cc4c9 + +color7 #b0c2da +color15 #caccce + +selection_background #202e2f +selection_foreground #5299ff + +cursor #caccce +cursor_text_color #5299ff diff --git a/rice/wallpaper.jpg b/rice/wallpaper.jpg new file mode 100644 index 0000000..f013b59 Binary files /dev/null and b/rice/wallpaper.jpg differ diff --git a/rice/wallpaper.nix b/rice/wallpaper.nix new file mode 100644 index 0000000..905edbe --- /dev/null +++ b/rice/wallpaper.nix @@ -0,0 +1,34 @@ +{ + pkgs, + lib, + stdenv, + ... +}: +{ + palette, + wallpaper, +}: +let + strPal = + let + inherit (lib) concatStringsSep; + inherit (builtins) foldl' attrValues; + in + concatStringsSep " " ( + foldl' (acc: el: acc ++ (attrValues el)) [ ] [ palette.normal palette.bright palette.util ] + ); +in +stdenv.mkDerivation { + name = "generated-wallpaper.png"; + src = wallpaper; + buildInputs = [ + pkgs.lutgen + ]; + + phases = [ "installPhase" ]; + + installPhase = '' + echo -e "Generating wallpaper from ${wallpaper} using palette:\n${strPal}.." + ${lib.getExe pkgs.lutgen} apply --lum 0.8 -l 10 -s 128 -n 8 -o $out ${wallpaper} -- ${strPal} + ''; +} diff --git a/style.css b/style.css deleted file mode 100644 index 4f5607a..0000000 --- a/style.css +++ /dev/null @@ -1,44 +0,0 @@ -* { - background-image: none; -} -window { - background-color: #181b28; -} -button { - color: #FFFFFF; - background-color: #181b28; - border-style: solid; - border-width: 2px; - background-repeat: no-repeat; - background-position: center; - background-size: 25%; -} - -button:focus, button:active, button:hover { - background-color: #27ae60; - outline-style: none; -} - -#lock { - background-image: image(url("pkgs.wlogout/share/wlogout/icons/lock.png"), url("/usr/local/share/wlogout/icons/lock.png")); -} - -#logout { - background-image: image(url("pkgs.wlogout/share/wlogout/icons/logout.png"), url("/usr/local/share/wlogout/icons/logout.png")); -} - -#suspend { - background-image: image(url("pkgs.wlogout/share/wlogout/icons/suspend.png"), url("/usr/local/share/wlogout/icons/suspend.png")); -} - -#hibernate { - background-image: image(url("pkgs.wlogout/share/wlogout/icons/hibernate.png"), url("/usr/local/share/wlogout/icons/hibernate.png")); -} - -#shutdown { - background-image: image(url("pkgs.wlogout/share/wlogout/icons/shutdown.png"), url("/usr/local/share/wlogout/icons/shutdown.png")); -} - -#reboot { - background-image: image(url("pkgs.wlogout/share/wlogout/icons/reboot.png"), url("/usr/local/share/wlogout/icons/reboot.png")); -} diff --git a/system/adrift.nix b/system/adrift.nix old mode 100755 new mode 100644 index e0c1ac4..ef09b22 --- a/system/adrift.nix +++ b/system/adrift.nix @@ -1,119 +1,98 @@ -{ config, lib, pkgs, modulesPath, ... }: - -let - flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz"; - - hyprland = (import flake-compat { - src = builtins.fetchTarball "https://github.com/hyprwm/Hyprland/archive/master.tar.gz"; - }).defaultNix; -in { - nix.settings = { - substituters = [ "https://hyprland.cachix.org" ]; - trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; - }; - - imports = - [ hyprland.nixosModules.default ]; - - nixpkgs.overlays = [ - (self: super: { - system76-scheduler = pkgs.callPackage ./syspkgs/system76-scheduler.nix {}; - kwin-system76-scheduler-integration = pkgs.libsForQt5.callPackage ./syspkgs/kwin-system76-scheduler-integration.nix {}; - }) +{ + config, + lib, + pkgs, + ... +}: +{ + imports = [ + ./configuration.nix ]; + nix.settings.trusted-users = [ "plank" ]; + programs.nh.flake = "/home/plank/.nix"; - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.kernelParams = [ + "mitigations=off" + "quiet" + "loglevel=3" + "systemd.show_status=auto" + "rd.udev.log_level=3" + "vt.global_cursor_default=0" + ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "nvme" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + ]; boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.kernelModules = [ + "iwlwifi" + "kvm-intel" + ]; + boot.kernelPackages = pkgs.linuxPackages; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/1C5C-8FF4"; - fsType = "vfat"; - }; - - swapDevices = [ ]; - - networking.useDHCP = lib.mkDefault true; - boot.loader.systemd-boot.configurationLimit = 2; - - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - networking.hostName = "adrift"; # Define your hostname. - services.xserver.videoDrivers = [ "i915" ]; - - services.power-profiles-daemon.enable = false; - services.tlp.enable = true; - - users.users.plank = { - isNormalUser = true; - extraGroups = [ "wheel" ]; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/1C5C-8FF4"; + fsType = "vfat"; }; fileSystems."/" = { - device = "/dev/mapper/nix-os"; + device = "/dev/disk/by-uuid/26389642-cf51-4c58-98e9-1fe491a11bb9"; fsType = "ext4"; }; - fileSystems."/home" = { - device = "/dev/mapper/nix-home"; - fsType = "ext4"; + swapDevices = [ + { device = "/dev/disk/by-uuid/a732641d-1233-45a7-8614-53caed60f11b"; } + ]; + + boot.loader.systemd-boot.configurationLimit = 2; + boot.loader.efi.canTouchEfiVariables = true; + # boot.plymouth.enable = true; + + networking.useDHCP = lib.mkDefault true; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + services.power-profiles-daemon.enable = false; + services.tlp.enable = true; + + environment.sessionVariables = { + NIXOS_OZONE_WL = "1"; + ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=5"; + EDITOR = "hx"; }; - environment.systemPackages = with pkgs; - [ - wl-clipboard - wl-clipboard-x11 - xclip - system76-scheduler - kwin-system76-scheduler-integration - ]; - - programs.hyprland = { - enable = true; - xwayland = { + virtualisation = { + podman = { enable = true; - hidpi = false; + dockerCompat = true; + defaultNetwork.settings.dns_enabled = true; }; - nvidiaPatches = true; }; + + services.xserver.videoDrivers = [ "i915" ]; programs.xwayland.enable = true; - systemd.services."com.system76.Scheduler" = { - wantedBy = [ "multi-user.target" ]; - description = "the system76 process scheduler"; - serviceConfig = { - Type = "dbus"; - ExecStart = ''${pkgs.system76-scheduler}/bin/system76-scheduler daemon''; - ExecReload = ''${pkgs.system76-scheduler}/bin/system76-scheduler daemon reload''; - BusName = "com.system76.Scheduler"; - }; - }; - - services.dbus.packages = [ - pkgs.kwin-system76-scheduler-integration - pkgs.system76-scheduler - ]; - - systemd.packages = [ - pkgs.kwin-system76-scheduler-integration - pkgs.system76-scheduler - ]; - - environment.etc = { - "system76-scheduler".source = "${pkgs.system76-scheduler}/etc/system76-scheduler"; - }; - xdg.portal = { enable = true; - wlr = { - enable = true; - }; - extraPortals = with pkgs; [ - xdg-desktop-portal-kde - xdg-desktop-portal-gtk + extraPortals = [ + pkgs.xdg-desktop-portal-gtk ]; }; - } + environment.systemPackages = builtins.attrValues { + inherit (pkgs) + wl-clipboard + wl-clipboard-x11 + xclip + ; + }; + + networking.hostName = "adrift"; # Define your hostname. + users.users.plank = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + }; +} diff --git a/system/cachix.nix b/system/cachix.nix deleted file mode 100755 index ecd2d39..0000000 --- a/system/cachix.nix +++ /dev/null @@ -1,13 +0,0 @@ - -# WARN: this file will get overwritten by $ cachix use -{ pkgs, lib, ... }: - -let - folder = ./cachix; - toImport = name: value: folder + ("/" + name); - filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key; - imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); -in { - inherit imports; - nix.settings.substituters = ["https://cache.nixos.org/"]; -} diff --git a/system/cachix/cuda-maintainers.nix b/system/cachix/cuda-maintainers.nix deleted file mode 100755 index 6d28952..0000000 --- a/system/cachix/cuda-maintainers.nix +++ /dev/null @@ -1,11 +0,0 @@ - -{ - nix = { - settings.substituters = [ - "https://cuda-maintainers.cachix.org" - ]; - settings.trusted-public-keys = [ - "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" - ]; - }; -} diff --git a/system/cachix/nix-community.nix b/system/cachix/nix-community.nix deleted file mode 100755 index 9eacfa3..0000000 --- a/system/cachix/nix-community.nix +++ /dev/null @@ -1,11 +0,0 @@ - -{ - nix = { - settings.substituters = [ - "https://nix-community.cachix.org" - ]; - settings.trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - ]; - }; -} diff --git a/system/configuration.nix b/system/configuration.nix old mode 100755 new mode 100644 index 51cab56..594d15a --- a/system/configuration.nix +++ b/system/configuration.nix @@ -1,178 +1,85 @@ - -{ config, pkgs, ... }: - -# let -# lemurs = callPackage ./system/syspkgs/lemurs.nix {}; -# ly = callPackage ./system/syspkgs/ly.nix {}; -# in +{ + inputs, + lib, + pkgs, + mainUser, + ... +}: { imports = [ - # where are we ? - #./wollomi.nix - ./adrift.nix - # ./quiver.nix - - # home manager should exist for users - - - ./cachix.nix - - # declarative cachix - (import (builtins.fetchTarball "https://github.com/jonascarpay/declarative-cachix/archive/master.tar.gz")) - + ./modules/network.nix + ./modules/term.nix + ./modules/bootloader.nix + ./modules/sound.nix + ./modules/sydney.nix + ./modules/docs.nix + ./modules/nix-meta.nix + ./modules/anal-retentive.nix + ./modules/wm.nix + ./modules/culr.nix ]; - - cachix = [ - "nix-community" - ]; - - nix.extraOptions = '' - experimental-features = nix-command flakes - keep-outputs = true - keep-derivations = true - ''; hardware.enableRedistributableFirmware = true; + hardware.enableAllFirmware = true; - environment.pathsToLink = [ "/share/zsh" ]; - boot.loader.systemd-boot.enable = true; - boot.loader.systemd-boot.consoleMode = "max"; - boot.loader.timeout = 3; - - boot.tmpOnTmpfs = true; + boot.tmp.useTmpfs = true; - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + # services.udev.extraHwdb = '' + # evdev:atkbd:* + # KEYBOARD_KEY_3a=esc + # ''; + services.xserver.xkb.options = "caps:swapescape"; + # services.xserver.xkb.extraLayouts."swap" = { + # description = "caps swap"; + # languages = [ "eng" ]; + # symbolsFile = pkgs.writeText "keyboard" '' + # xkb_symbols + # { + # include "us(basic)" - time.timeZone = "Australia/Sydney"; - time.hardwareClockInLocalTime = true; + # key {[ Escape ]}; + # } + # ''; + # }; + console.useXkbConfig = true; + services.libinput.enable = true; - # Select internationalisation properties. - i18n.defaultLocale = "en_AU.UTF-8"; - i18n.supportedLocales = [ "en_AU.UTF-8/UTF-8" ]; - console = { - font = "Lat2-Terminus16"; - useXkbConfig = true; # use xkbOptions in tty. - }; - - nixpkgs.config.allowUnfree = true; - hardware.opengl.enable = true; - hardware.opengl.driSupport32Bit = true; + hardware.graphics.enable = true; + hardware.graphics.enable32Bit = true; - #input stuff - services.xserver.enable = true; - services.xserver.xkbOptions = "caps:escape"; - services.xserver.layout = "us"; - services.xserver.libinput.enable = true; - services.xserver.displayManager.lightdm.enable = false; # gets installed by default.. + services.udisks2.enable = true; - services.greetd = { - enable = true; - settings = { - default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet -r -g \"what's good\" --time --sessions ${config.services.xserver.displayManager.sessionData.desktops}/share/wayland-sessions"; - user = "greeter"; - }; - }; - }; + # services.flatpak.enable = true; security.polkit.enable = true; - programs.dconf.enable = true; - xdg.autostart.enable = true; + xdg.portal.enable = true; - services.resolved = { - enable = true; - fallbackDns = [ "103.1.206.179" "168.138.8.38" "168.138.12.137" ]; - dnssec = "false"; - }; - + # services.tailscale.enable = true; - # Enable sound. - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # jack.enable = true; + # TODO - move these to more appropriate places + environment.systemPackages = builtins.attrValues { + inherit (pkgs) + curl + eza + git + ; }; - qt.enable = true; - qt.style = "kvantum"; - qt.platformTheme = "qt5ct"; + programs.nix-index-database.comma.enable = true; + programs.nix-index.enableZshIntegration = false; + programs.nix-index.enableBashIntegration = false; - programs.zsh.enable = true; - users.defaultUserShell = pkgs.zsh; - - services.tailscale.enable = true; + # gnome/freedesktop compat stuff + programs.dconf.enable = true; + services.gvfs.enable = true; - environment.systemPackages = with pkgs; [ - - rnix-lsp + # give cpuset to user + systemd.services."user@".serviceConfig.Delegate = "memory pids cpu cpuset"; - tailscale - - home-manager - cachix - - helix - ark - - curl - - git - - zsh - - nix-index - comma - - ]; - - networking.wg-quick.interfaces = { - mullvad = { - address = [ "10.66.224.186/32" ]; - dns = [ "10.64.0.1" ]; - privateKey = "WD0CNYazB8D19SJvwz/TdPqoWgWCGfTwA7mim16q7UM="; - peers = [ - { - publicKey = "QhE7I5TnUuc3gLqSeF9KhOr0oew5v03bpj0EHrEOR2M="; - allowedIPs = [ "0.0.0.0/0" ]; - endpoint = "89.44.10.66:51820"; - persistentKeepalive = 25; - } - ]; - }; - }; - - networking.firewall.enable = true; - networking.firewall = { - trustedInterfaces = [ "tailscale0" ]; - checkReversePath = "loose"; - }; - - systemd.services.fixNetworkingForTailscale = { - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" "wg-quick-mullvad.service" ]; - description = "fix the damn routing table"; - serviceConfig = { - Type = "oneshot"; - User = "root"; - ExecStart = ''${pkgs.bash}/bin/bash -c 'if [[ "$( ${pkgs.iproute2}/bin/ip rule | grep -e "62:.*52" | wc -l)" -eq 0 ]]; then ${pkgs.iproute2}/bin/ip rule add pref 62 table 52; fi''''; - # ExecStop = ''${pkgs.iproute2}/bin/ip rule del pref 62 table 52''; - }; - }; - - security.pam.services.waylock = { - text ='' - auth include login - ''; - }; - - - system.stateVersion = "22.05"; # Did you read the comment? + systemd.user.extraConfig = "LogLevel=debug"; + system.nixos.tags = [ "fatcock-xxl" ]; } - diff --git a/system/docker.nix b/system/docker.nix deleted file mode 100755 index 42997d2..0000000 --- a/system/docker.nix +++ /dev/null @@ -1,13 +0,0 @@ - -{ config, lib, pkgs, ... }: - -{ - virtualisation.docker.enable = true; - # virtualisation.docker.enableOnBoot = true; - - # Nvidia Docker - virtualisation.docker.enableNvidia = true; - # libnvidia-container does not support cgroups v2 (prior to 1.8.0) - # https://github.com/NVIDIA/nvidia-docker/issues/1447 - systemd.enableUnifiedCgroupHierarchy = false; -} \ No newline at end of file diff --git a/system/hardware-configuration.nix b/system/hardware-configuration.nix deleted file mode 100755 index a6fca03..0000000 --- a/system/hardware-configuration.nix +++ /dev/null @@ -1,40 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbcore" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/06f59431-d939-4b48-9d91-e23606dd3ce0"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/5008-1946"; - fsType = "vfat"; - }; - - fileSystems."/data" = { - device = "/dev/sdb1"; - fsType = "ntfs"; - }; - swapDevices = [ ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/system/modules/anal-retentive.nix b/system/modules/anal-retentive.nix new file mode 100644 index 0000000..cf7c868 --- /dev/null +++ b/system/modules/anal-retentive.nix @@ -0,0 +1,29 @@ +{ + pkgs, + lib, + ... +}: +{ + # perlless activations + boot.initrd.systemd.enable = true; + # breaks everything + # system.etc.overlay = { + # enable = lib.mkDefault true; + # mutable = true; + # }; + services.userborn.enable = lib.mkDefault true; + + # misc perl + system.disableInstallerTools = true; + programs.less.lessopen = null; + programs.command-not-found.enable = false; + boot.enableContainers = false; + boot.loader.grub.enable = false; + environment.defaultPackages = lib.mkDefault [ ]; + documentation.info.enable = false; + + # no cppnix .. ? + # system.systemBuilderArgs.disallowedRequisites = [pkgs.nix]; + nix.package = pkgs.lix; + system.tools.nixos-option.enable = false; +} diff --git a/system/modules/bootloader.nix b/system/modules/bootloader.nix new file mode 100644 index 0000000..99bca2a --- /dev/null +++ b/system/modules/bootloader.nix @@ -0,0 +1,41 @@ +{ + rice, + ... +}: +{ + boot.loader.limine = { + enable = true; + style = + let + pal = rice.palette.shortHex; + in + { + wallpapers = [ rice.bg.image ]; + interface = { + brandingColor = 1; + branding = "welcome to quiver"; + }; + graphicalTerminal = + let + getPal = p: builtins.attrValues p |> builtins.concatStringsSep ";"; + in + { + palette = getPal pal.normal; + brightPalette = getPal pal.bright; + marginGradient = 0; + margin = 256; + foreground = pal.util.fg; + background = "20" + pal.util.bg; + brightForeground = pal.bright.yellow; + brightBackground = pal.util.bg; + }; + backdrop = pal.util.bg; + }; + maxGenerations = 5; + extraEntries = '' + /Windows + protocol: efi + path: boot():/EFI/Microsoft/Boot/bootmgfw.efi + ''; + }; +} diff --git a/system/modules/culr.nix b/system/modules/culr.nix new file mode 100644 index 0000000..a27758c --- /dev/null +++ b/system/modules/culr.nix @@ -0,0 +1,6 @@ +_: { + programs.culr = { + enable = true; + pattern = "rainbow-split"; + }; +} diff --git a/system/modules/docs.nix b/system/modules/docs.nix new file mode 100644 index 0000000..beb3baf --- /dev/null +++ b/system/modules/docs.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: +{ + environment.systemPackages = builtins.attrValues { + inherit (pkgs) + man-pages + man-pages-posix + ; + }; + + documentation.dev.enable = true; + documentation.man.enable = true; + documentation.enable = true; +} diff --git a/system/modules/network.nix b/system/modules/network.nix new file mode 100644 index 0000000..bd64ddf --- /dev/null +++ b/system/modules/network.nix @@ -0,0 +1,22 @@ +{ ... }: +{ + # imports = [ + # ./mullvad.nix + # ]; + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + systemd.services.NetworkManager-wait-online.enable = true; # for some reason nm doesn't enable without this + services.resolved = { + enable = true; + fallbackDns = [ + "103.1.206.179" + "168.138.8.38" + "168.138.12.137" + ]; + dnssec = "false"; + }; + services.mullvad-vpn.enable = true; + # systemd.services.mullvad-daemon.environment.TALPID_NET_CLS_MOUNT_DIR = "/opt/net-cls-v1"; + networking.firewall = { + checkReversePath = "loose"; + }; +} diff --git a/system/modules/nix-meta.nix b/system/modules/nix-meta.nix new file mode 100644 index 0000000..d7a810b --- /dev/null +++ b/system/modules/nix-meta.nix @@ -0,0 +1,63 @@ +{ + pkgs, + lib, + inputs, + mainUser, + ... +}: +{ + # these settings propagate to home-manager's nixpkgs + nixpkgs = { + config = { + allowUnfree = true; + allowUnfreePredicate = _: true; + cudaSupport = true; + }; + }; + + nix = { + # add flake inputs to our registry to allow global use + registry = lib.mapAttrs (_: value: { flake = value; }) inputs; + settings = { + # trusted-users = ["bolt" "plank"]; + experimental-features = [ + "nix-command" + "flakes" + "pipe-operator" + ]; + substitute = true; + }; + extraOptions = '' + keep-outputs = true + keep-derivations = true + ''; + optimise.automatic = true; + # package = pkgs.lix; + }; + + # services.smooooth = { + # enable = true; + # path = "/home/${mainUser}/.nix"; + # blockers = [ + # "hx" + # { + # nix = "die"; + # } + # ]; + # nixPackage = pkgs.lix; + # }; + + programs.meat = { + enable = true; + flake = "/home/${mainUser}/.nix"; + }; + + environment.systemPackages = builtins.attrValues { + inherit (pkgs) + home-manager + cachix + nixfmt-rfc-style + ; + inherit (inputs.nil.packages.${pkgs.system}) nil; + }; +} diff --git a/system/modules/sound.nix b/system/modules/sound.nix new file mode 100644 index 0000000..19c9744 --- /dev/null +++ b/system/modules/sound.nix @@ -0,0 +1,9 @@ +_: { + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; +} diff --git a/system/modules/sydney.nix b/system/modules/sydney.nix new file mode 100644 index 0000000..b04dc0d --- /dev/null +++ b/system/modules/sydney.nix @@ -0,0 +1,6 @@ +_: { + time.timeZone = "Australia/Sydney"; + time.hardwareClockInLocalTime = false; + i18n.defaultLocale = "en_AU.UTF-8"; + i18n.supportedLocales = [ "en_AU.UTF-8/UTF-8" ]; +} diff --git a/system/modules/term.nix b/system/modules/term.nix new file mode 100644 index 0000000..a2193e8 --- /dev/null +++ b/system/modules/term.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: +let + inherit (pkgs) fish; +in +{ + programs.fish = { + enable = true; + }; + programs.zoxide = { + enable = true; + enableFishIntegration = true; + }; + environment.systemPackages = [ + fish + ]; + environment.shells = [ fish ]; + users.defaultUserShell = fish; + console = { + font = "Lat2-Terminus16"; + }; +} diff --git a/system/modules/wm.nix b/system/modules/wm.nix new file mode 100644 index 0000000..e4a9a01 --- /dev/null +++ b/system/modules/wm.nix @@ -0,0 +1,27 @@ +{ + pkgs, + mainUser, + inputs, + ... +}: +{ + services.greetd = { + enable = true; + restart = false; + settings = + let + session = { + command = "niri-session"; + user = "${mainUser}"; + }; + in + { + default_session = session; + initial_session = session; + }; + }; + programs.niri = { + enable = true; + package = inputs.niri.packages.${pkgs.system}.niri-unstable; + }; +} diff --git a/system/quiver.nix b/system/quiver.nix old mode 100755 new mode 100644 index 7e4422b..65122ef --- a/system/quiver.nix +++ b/system/quiver.nix @@ -1,30 +1,86 @@ -{ config, lib, pkgs, modulesPath, ... }: - -let - flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz"; - - hyprland = (import flake-compat { - src = builtins.fetchTarball "https://github.com/hyprwm/Hyprland/archive/master.tar.gz"; - }).defaultNix; -in { - - nixpkgs.overlays = [ - (self: super: { - system76-scheduler = pkgs.callPackage ./syspkgs/system76-scheduler.nix {}; - kwin-system76-scheduler-integration = pkgs.libsForQt5.callPackage ./syspkgs/kwin-system76-scheduler-integration.nix {}; - }) +{ + config, + lib, + pkgs, + inputs, + rice, + ... +}: +{ + imports = [ + ./configuration.nix ]; - nix.settings = { - substituters = [ "https://hyprland.cachix.org" ]; - trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; + services.ollama = { + enable = true; + user = "ollama"; }; - imports = - [ hyprland.nixosModules.default ]; + system.stateVersion = "22.11"; # Did you read the comment? - environment.sessionVariables = rec { - WLR_NO_HARDWARE_CURSORS = "1"; + networking.hostName = "quiver"; + + users.users.bolt = { + isNormalUser = true; + extraGroups = [ + "wheel" + "podman" + ]; + }; + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "usbcore" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.initrd.verbose = false; + boot.kernelModules = [ + "kvm-amd" + "i2c-dev" + ]; + boot.consoleLogLevel = 0; + boot.kernelParams = [ + "mitigations=off" + "preempt=full" + "quiet" + "loglevel=3" + "systemd.show_status=off" + "rd.udev.log_level=3" + "vt.global_cursor_default=0" + ]; + + services.scx = { + enable = true; + scheduler = "scx_bpfland"; + }; + boot.kernelPackages = pkgs.linuxPackages_cachyos; + boot.supportedFilesystems = { + ntfs = true; + btrfs = true; + }; + + boot.loader.efi.canTouchEfiVariables = true; + + # boot.plymouth = { + # enable = true; + # inherit (rice.plymouth) theme themePackages font; + # }; + + security.tpm2.enable = true; + + networking.useDHCP = lib.mkDefault true; + + hardware.cpu.amd.updateMicrocode = true; + + environment.pathsToLink = [ + "/share/xdg-desktop-portal" + "/share/applications" + ]; + environment.sessionVariables = { + NIXOS_OZONE_WL = "1"; + # ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=5"; GBM_BACKEND = "nvidia-drm"; NVD_BACKEND = "direct"; __GLX_VENDOR_LIBRARY_NAME = "nvidia"; @@ -34,157 +90,112 @@ in { EDITOR = "hx"; }; - boot.kernelPackages = pkgs.linuxPackages_xanmod_latest; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbcore" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" "i2c-dev" ]; - boot.extraModulePackages = [ ]; - boot.kernelParams = [ "nvidia_drm.modeset=1" "mitigations=off" "acpi_enforce_resources=lax" "preempt=full" ]; - - boot.loader.efi.canTouchEfiVariables = true; - # boot.plymouth.enable = true; - - boot.supportedFilesystems = [ "ntfs" ]; - - security.tpm2.enable = true; - - boot.loader.systemd-boot.configurationLimit = 5; - networking.useDHCP = lib.mkDefault true; - - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + nix.settings.trusted-users = [ "bolt" ]; + virtualisation.oci-containers.backend = "podman"; + hardware.nvidia-container-toolkit.enable = true; virtualisation = { podman = { enable = true; - dockerCompat = true; + dockerSocket.enable = true; defaultNetwork.settings.dns_enabled = true; }; }; - services.minidlna = { - enable = true; - settings = { - notify_interval = 120; - friendly_name = "PC"; - media_dir = [ "A,/data/Music/Slsk" ]; - }; - }; - - programs.hyprland = { - enable = true; - xwayland = { - enable = true; - hidpi = false; - }; - nvidiaPatches = true; - }; services.xserver.videoDrivers = [ "nvidia" ]; - hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.beta; - hardware.nvidia.modesetting.enable = true; - hardware.nvidia.powerManagement.enable = true; + hardware.nvidia = { + package = config.boot.kernelPackages.nvidiaPackages.latest; + modesetting.enable = true; + powerManagement.enable = true; + nvidiaPersistenced = true; + open = false; + }; programs.xwayland.enable = true; - - systemd.services.no-rgb = { - wantedBy = [ "multi-user.target" ]; - description = "rgb led turn-off-er"; - serviceConfig = { - Type = "oneshot"; - ExecStart = ''${pkgs.openrgb}/bin/openrgb -d "HyperX Fury RGB" -m static -c 000000''; - }; - }; - systemd.services."com.system76.Scheduler" = { - wantedBy = [ "multi-user.target" ]; - description = "the system76 process scheduler"; - serviceConfig = { - Type = "dbus"; - ExecStart = ''${pkgs.system76-scheduler}/bin/system76-scheduler daemon''; - ExecReload = ''${pkgs.system76-scheduler}/bin/system76-scheduler daemon reload''; - BusName = "com.system76.Scheduler"; - }; - }; + # openrgb no longer recognises the device? + # systemd.services.no-rgb = { + # wantedBy = ["multi-user.target"]; + # description = "rgb led turn-off-er"; + # serviceConfig = { + # Type = "oneshot"; + # ExecStart = ''${pkgs.openrgb}/bin/openrgb -d "HyperX DRAM" -m static -c 000000''; + # After = ["openrgb"]; + # }; + # }; - services.dbus.packages = [ - pkgs.kwin-system76-scheduler-integration - pkgs.system76-scheduler - ]; + # services.hardware.openrgb = { + # enable = true; + # motherboard = "amd"; + # }; - systemd.packages = [ - pkgs.kwin-system76-scheduler-integration - pkgs.system76-scheduler - ]; - - environment.etc = { - "system76-scheduler".source = "${pkgs.system76-scheduler}/etc/system76-scheduler"; - }; - - services.hardware.openrgb = { - enable = true; - motherboard = "amd"; - }; - - hardware.ckb-next.enable = true; - - xdg.portal = { - enable = true; - wlr = { - enable = true; - # settings = { - # screencast = { - # output_name = "DP-1"; - # max_fps = 60; - # chooser_type = "simple"; - # chooser_nvidia = "${pkgs.slurp}/bin/slurp -f %o -or"; - # }; - # }; - }; - extraPortals = with pkgs; [ - xdg-desktop-portal-gtk + hardware.ckb-next.enable = true; + environment.systemPackages = + builtins.attrValues { + inherit (pkgs) + wl-clipboard + wl-clipboard-x11 + xclip + ; + inherit (pkgs.kdePackages) qtbase qtdeclarative; + } + ++ [ + (inputs.quickshell.packages.${pkgs.system}.default.override { + withHyprland = false; + withI3 = false; + }) ]; - }; - - environment.systemPackages = with pkgs; - [ - ckb-next - openrgb - wl-clipboard - wl-clipboard-x11 - xclip - system76-scheduler - kwin-system76-scheduler-integration - ]; - - networking.hostName = "quiver"; # Define your hostname. - users.users.bolt = { - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + programs.fuse.userAllowOther = true; + services.libinput.mouse = { + accelProfile = "flat"; + accelSpeed = 0.0; }; - fileSystems."/" = - { device = "/dev/disk/by-uuid/d227445f-6120-4768-8e1b-011f097505c1"; - fsType = "ext4"; + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/b993b463-c131-4ef1-9aba-0e3eadaa2f9a"; + fsType = "btrfs"; }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/6B75-AF9F"; + "/boot" = { + device = "/dev/disk/by-uuid/6B75-AF9F"; fsType = "vfat"; }; - fileSystems."/data" = { - device = "/dev/disk/by-uuid/39D4F78C658E8B56"; - fsType = "ntfs"; - options = [ "rw" "uid=1001" "gid=100" ]; + "/data" = { + device = "/dev/disk/by-uuid/39D4F78C658E8B56"; + fsType = "ntfs"; + options = [ + "rw" + "uid=1000" + "gid=100" + ]; + }; }; - - # swapDevices = [ { - # device = "/dev/disk/by-uuid/7fde28ec-80f9-4228-8597-c3a57bfbf619"; - # size = 4096; - # } - # ]; + swapDevices = [ + { device = "/dev/disk/by-uuid/9c006925-e0e9-4165-bc0c-508ae2d1bfce"; } + ]; + + # networking.nftables.enable = true; networking.firewall = { - allowedUDPPorts = [ 1900 ]; - allowedTCPPorts = [ 8200 2234 ]; + # allowedUDPPorts = [1900]; + # allowedTCPPorts = [8200 2234]; + allowedTCPPorts = [ 2234 ]; }; + services.open-webui = { + package = inputs.nixpkgs-stable.legacyPackages.x86_64-linux.open-webui; + enable = true; + port = 8088; + environment = { + DO_NOT_TRACK = "True"; + SCARF_NO_ANALYTICS = "True"; + ANONYMIZED_TELEMETRY = "False"; + WEBUI_AUTH = "False"; + DATABASE_URL = "sqlite:///${config.services.open-webui.stateDir}/newdb.db"; + }; + }; + + # for quickshell + qt.enable = true; } diff --git a/server-conf.nix b/system/servers/atagen-vps/reflector.nix similarity index 87% rename from server-conf.nix rename to system/servers/atagen-vps/reflector.nix index ce50609..585c07d 100644 --- a/server-conf.nix +++ b/system/servers/atagen-vps/reflector.nix @@ -1,11 +1,13 @@ # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). - -{ lib, config, pkgs, ... }: - +{ + config, + pkgs, + ... +}: let - wekan-compose = pkgs.fetchurl { + wekan-compose = pkgs.fetchurl { url = "https://github.com/wekan/wekan/raw/v6.68/docker-compose.yml"; sha256 = "sha256-gLZ8bZZ8ZMo1NGz3ooIgXRH6JuMoEMp+to7lfqAvc6E="; }; @@ -16,32 +18,31 @@ let # sed -i 's/80:8080/7897:8080/g' $out # sed -i 's/ROOT_URL=.*/ROOT_URL=https:\/\/reflector\.beam\/kanban\//' $out # ''; - wekan-rhizome = pkgs.runCommand "wekan-rhizome" {} '' + wekan-rhizome = pkgs.runCommand "wekan-rhizome" { } '' cp ${wekan-compose} $out sed -i '/localtime/d' $out sed -i '/timezone/d' $out sed -i 's/80:8080/7897:8080/g' $out sed -i 's/ROOT_URL=.*/ROOT_URL=https:\/\/board\.rhizome\.tf\//' $out ''; - foswiki-compose = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/timlegge/docker-foswiki/master/docker-compose.1-simple.yml"; - sha256 = "sha256-XqGWGTZ/URKsIdDEEpBQUK7xoIdZ164lRhHEiWdnKpM="; - }; in { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - # ./cachix.nix - # (import (builtins.fetchTarball "https://github.com/jonascarpay/declarative-cachix/archive/master.tar.gz")) - ]; - + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + # ./cachix.nix + # (import (builtins.fetchTarball "https://github.com/jonascarpay/declarative-cachix/archive/master.tar.gz")) + ]; + # cachix = [ # "nix-community" # ]; - - nix.settings.experimental-features = [ "flakes" "nix-command" ]; - systemd.services.NetworkManager-wait-online.enable = false; + + nix.settings.experimental-features = [ + "flakes" + "nix-command" + ]; + # systemd.services.NetworkManager-wait-online.enable = false; # Use the GRUB 2 boot loader. boot.loader.grub.enable = true; @@ -49,7 +50,7 @@ in boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only networking.hostName = "reflector"; # Define your hostname. - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. # Set your time zone. time.timeZone = "Australia/Sydney"; @@ -58,13 +59,12 @@ in users.users.sunshine = { isNormalUser = true; extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - packages = with pkgs; []; + packages = with pkgs; [ ]; openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDSQC8VgKLzoU5BSynJJuC8BFqAEN8JlSIzsZ2Vg9rfXHM7T4vbWtnxSCSbNw3CEnZCfrdDQTeRum7Uq+gvrcHWd9Aj+rVmubTdud70ybW7T7SlGv3b5TYBhMNbrAz0JIJjLnFMy3/pWids1v6mKW3i7k6Kbq8fSt7jva5Yg5x1jtkUUwvjSZjPg/E/Zl0hAcnx8fWe4foFTcYYsUbfEpp6bxdN2QuVmb17UKnLrMz6JTj88Jd2uYZkeKxGOwk+uwrd0WArY8JIiRi1NcPA3I42aAQfZKxCUY/xmVyRlF+l6K8caD4CZlysms9aXQzBhmPPDIY87AwyRlVK5JsRbaMEBMsffX2xk8DdV+2+9RbztgeXOoYk7WjJX1/+WcxY3RGn8QsUfrGALmrQTRGXgYRbtM/ZJq1m9aP6IvVQeKE1NOpKguXpmokB7JsyKPcWk/PCMVYyXM/qYspc6hRPJgGWiJsayj7myO6X5Ssl9uQnHpNNyrQNY+cx3/boBu2J1sM= bolt@quiver" ]; }; - - + nixpkgs.config.allowUnfree = true; # List packages installed in system profile. To search, run: @@ -73,23 +73,23 @@ in helix ripgrep fd - curl - + curl + cachix headscale - + comma woodpecker-agent woodpecker-server - + # podman # podman-compose # shadow - + dufs ]; - + virtualisation = { docker.enable = true; # podman = { @@ -98,13 +98,13 @@ in # defaultNetwork.dnsname.enable = true; # }; }; - + # services.resolved = { # enable = true; # fallbackDns = [ "103.1.206.179" "168.138.8.38" "168.138.12.137" ]; # dnssec = "false"; # }; - + services.fail2ban.enable = true; services.tailscale.enable = true; @@ -113,14 +113,18 @@ in enable = true; serverUrl = "https://net.atagen.co"; dns = { - nameservers = [ "103.1.206.179" "168.138.8.38" "168.138.12.137" ]; + nameservers = [ + "103.1.206.179" + "168.138.8.38" + "168.138.12.137" + ]; magicDns = true; }; }; - + services.syncthing = { enable = true; - extraOptions = { + extraOptions = { gui = { insecureSkipHostcheck = true; }; @@ -140,15 +144,17 @@ in }; rootUrl = "https://git.atagen.co"; settings.service.DISABLE_REGISTRATION = true; - settings.webhook.ALLOWED_HOST_LIST="external,loopback"; + settings.webhook.ALLOWED_HOST_LIST = "external,loopback"; }; - - + users.users.ci = { isSystemUser = true; createHome = true; group = "ci"; - extraGroups = [ "docker" "wheel" ]; + extraGroups = [ + "docker" + "wheel" + ]; }; users.groups.ci = { }; @@ -156,7 +162,10 @@ in isSystemUser = true; createHome = true; group = "ci"; - extraGroups = [ "docker" "wheel" ]; + extraGroups = [ + "docker" + "wheel" + ]; }; users.groups.ci = { }; @@ -166,7 +175,7 @@ in group = "dufs"; }; users.groups.dufs = { }; - + systemd.services.woodpecker-server = { wantedBy = [ "multi-user.target" ]; description = "woodpecker CI/CD server"; @@ -190,7 +199,7 @@ in Group = "ci"; }; }; - + systemd.services.woodpecker-agent = { wantedBy = [ "multi-user.target" ]; description = "woodpecker CI/CD agent"; @@ -204,7 +213,7 @@ in User = "ci-agent"; }; }; - + # systemd.services.wekan-private = { # wantedBy = [ "multi-user.target" ]; # after = [ "network.target" "docker.service" ]; @@ -220,7 +229,10 @@ in systemd.services.wekan-rhizome = { wantedBy = [ "multi-user.target" ]; - after = [ "network.target" "docker.service" ]; + after = [ + "network.target" + "docker.service" + ]; requires = [ "docker.service" ]; description = "wekan kanban board for rhizomers"; serviceConfig = { @@ -258,14 +270,13 @@ in services.caddy = { enable = true; virtualHosts = { - "atagen.co" = { serverAliases = [ "www.atagen.co" ]; extraConfig = '' respond "i live.. again" ''; }; - + "iced-rs.info".extraConfig = '' reverse_proxy http://127.0.0.1:8765 ''; @@ -285,15 +296,15 @@ in # "git.rhizome.tf".extraConfig = '' # reverse_proxy http://127.0.0.1:3033 # ''; - + "board.rhizome.tf".extraConfig = '' reverse_proxy http://127.0.0.1:7897 ''; - + "net.atagen.co".extraConfig = '' reverse_proxy http://127.0.0.1:8080 ''; - + "reflector.beam".extraConfig = '' tls /etc/selfsigned/cert.pem /etc/selfsigned/key.pem @@ -307,7 +318,6 @@ in reverse_proxy http://127.0.0.1:8083 } ''; - }; }; @@ -316,15 +326,24 @@ in enable = true; passwordAuthentication = false; kbdInteractiveAuthentication = false; - permitRootLogin = "no"; + permitRootLogin = "no"; }; networking.firewall = { enable = true; trustedInterfaces = [ "tailscale0" ]; checkReversePath = "loose"; - allowedTCPPorts = [ 80 443 6660 ]; - allowedUDPPorts = [ 80 443 41641 6660 ]; + allowedTCPPorts = [ + 80 + 443 + 6660 + ]; + allowedUDPPorts = [ + 80 + 443 + 41641 + 6660 + ]; }; # Copy the NixOS configuration file and link it from the resulting system @@ -339,6 +358,4 @@ in # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "22.11"; # Did you read the comment? - } - diff --git a/system/servers/rhizome-vps/configuration.nix b/system/servers/rhizome-vps/configuration.nix new file mode 100644 index 0000000..7c65bf0 --- /dev/null +++ b/system/servers/rhizome-vps/configuration.nix @@ -0,0 +1,295 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running `nixos-help`). +{ + pkgs, + lib, + ... +}: +{ + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + nix.extraOptions = '' + keep-outputs = true + keep-derivations = true + ''; + + environment.pathsToLink = [ "/share/zsh" ]; + programs.zsh.enable = true; + users.defaultUserShell = pkgs.zsh; + + users.users.felix = { + isSystemUser = true; + group = "www"; + extraGroups = [ "docker" ]; + }; + + users.users.spore = { + isSystemUser = true; + home = "/home/spore"; + createHome = true; + useDefaultShell = true; + group = "www"; + extraGroups = [ "docker" ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL9VRcCnmjCyV7DpCm8ir3+xPTbyMDBJhgSkhpmdFL5d spore@server.rhizome.tf" + ]; + }; + + users.groups.www = { + members = [ + "acme" + "felix" + "spore" + ]; + }; + + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only + + networking.hostName = "filament"; # Define your hostname. + time.timeZone = "Australia/Sydney"; + + i18n.defaultLocale = "en_AU.UTF-8"; + + users.users.rhizome = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDSQC8VgKLzoU5BSynJJuC8BFqAEN8JlSIzsZ2Vg9rfXHM7T4vbWtnxSCSbNw3CEnZCfrdDQTeRum7Uq+gvrcHWd9Aj+rVmubTdud70ybW7T7SlGv3b5TYBhMNbrAz0JIJjLnFMy3/pWids1v6mKW3i7k6Kbq8fSt7jva5Yg5x1jtkUUwvjSZjPg/E/Zl0hAcnx8fWe4foFTcYYsUbfEpp6bxdN2QuVmb17UKnLrMz6JTj88Jd2uYZkeKxGOwk+uwrd0WArY8JIiRi1NcPA3I42aAQfZKxCUY/xmVyRlF+l6K8caD4CZlysms9aXQzBhmPPDIY87AwyRlVK5JsRbaMEBMsffX2xk8DdV+2+9RbztgeXOoYk7WjJX1/+WcxY3RGn8QsUfrGALmrQTRGXgYRbtM/ZJq1m9aP6IvVQeKE1NOpKguXpmokB7JsyKPcWk/PCMVYyXM/qYspc6hRPJgGWiJsayj7myO6X5Ssl9uQnHpNNyrQNY+cx3/boBu2J1sM= bolt@quiver" + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDW/YjnlHiEf2bV0RapVl+jWEtsNYrbXsaJJhXUkAaf61rsTZ2jpda7FmOVGjyJiOkTNYANoT83YhGxvKt3Ukcx5xG0JhcrilEGKfOR43/QLlXetCh4aFed//CXYNQo8obDovx9A8YamzfZWJo0nhshEAt1aDvNGlyPgHZI3r5vYNB6OpMlaSnr873i5hp6S9dxURoF0FjpdZwTWk5DiYUoZCezs6TfG6PzHbSsB88o4AUNZ6O+h1KD0lITSXH/v/M1zG8fkUzfZHFQoZ6VaIMhIVwLmbybvyb630IIfhx6KUoCWzCRlKBjVOGsQ1xZWEnjPgHB6atX5eNc/L8/bdyZOJ4aE2wSdVNMyriYuiyc3t/RwSvcRpfmzaxWUImDpjH3mxCrDymrZIQQTrNuC6o5O3mz3NCZRcFUZmuZXeYphyrzuNgAfsvHKMd8Fu+PdddSPCHkgYEIRuGD4flaujM8eUHZYqKkpmmiMwKk6jupBscN+1uwBqGQbaR0InXR+4c= custard" + ]; + }; + + users.users.ci = { + isSystemUser = true; + createHome = true; + group = "ci"; + extraGroups = [ "docker" ]; + }; + + users.users.ci-agent = { + isSystemUser = true; + createHome = true; + group = "ci"; + extraGroups = [ "docker" ]; + }; + + users.groups.ci = { }; + + virtualisation = { + docker.enable = true; + # podman = { + # enable = true; + # dockerCompat = true; + # defaultNetwork.settings.dns_enabled = true; + # }; + }; + + services.fail2ban.enable = true; + + services.redis.servers."".enable = true; + + services.gitea = { + enable = true; + appName = "rhizome gitea"; + domain = "git.rhizome.tf"; + httpPort = 3036; + settings.server = { + START_SSH_SERVER = true; + SSH_PORT = 6660; + SSH_DOMAIN = "git.rhizome.tf"; + DISABLE_SSH = false; + }; + rootUrl = "https://git.rhizome.tf"; + settings.service.DISABLE_REGISTRATION = true; + settings.webhook.ALLOWED_HOST_LIST = "external,loopback"; + }; + + # systemd.services.spore = { + # wantedBy = [ "multi-user.target" ]; + # description = "Spore Deployment Tool"; + # serviceConfig = { + # User = "spore"; + # Restart = "on-failure"; + # ExecStart = "${lib.getExe pkgs.spore}"; + + # }; + # }; + + systemd.services.grab-keys = { + description = "Server Key Grabber"; + serviceConfig = { + Type = "oneshot"; + User = "spore"; + Restart = "on-failure"; + ExecStart = "${pkgs.openssh}/bin/scp spore@server.rhizome.tf:/etc/letsencrypt/live/server.rhizome.tf/cert.pem /var/www/server.pem"; + }; + }; + + systemd.timers.grab-keys = { + description = "Server Key Grabber"; + timerConfig = { + Persistent = "yes"; + OnCalendar = "daily"; + Unit = "grab-keys.service"; + }; + }; + + systemd.services.woodpecker-server = { + wantedBy = [ "multi-user.target" ]; + description = "woodpecker CI/CD server"; + serviceConfig = { + Environment = [ + "WOODPECKER_OPEN=true" + "WOODPECKER_ADMIN=dbx" + "WOODPECKER_REPO_OWNERS=rhizome" + "WOODPECKER_HOST=https://ci.rhizome.tf" + "WOODPECKER_GITEA=true" + "WOODPECKER_GITEA_URL=https://git.rhizome.tf" + "WOODPECKER_GITEA_CLIENT=86bb265b-8914-4abd-a3eb-f843fabbd79d" + "WOODPECKER_GITEA_SECRET=gto_474i24aku3vda6wjbumdgfdcjdllclecfplfb4wsz2ibkemhdrwq" + "WOODPECKER_GITEA_SKIP_VERIFY=true" + "WOODPECKER_AGENT_SECRET=71a0ac7d617aef46fb93811c6e2a300e041a324727df12b4805d5f4e9e1f3326" + "WOODPECKER_DATABASE_DATASOURCE=/var/lib/woodpecker/woodpecker.sqlite" + ]; + Restart = "on-failure"; + ExecStart = "${lib.getExe pkgs.woodpecker-server}"; + User = "ci"; + Group = "ci"; + }; + }; + + systemd.services.woodpecker-agent = { + wantedBy = [ "multi-user.target" ]; + description = "woodpecker CI/CD agent"; + serviceConfig = { + Environment = [ + "WOODPECKER_AGENT_SECRET=71a0ac7d617aef46fb93811c6e2a300e041a324727df12b4805d5f4e9e1f3326" + ]; + Restart = "always"; + ExecStart = "${lib.getExe pkgs.woodpecker-agent}"; + User = "ci-agent"; + Group = "ci"; + }; + }; + + systemd.services.felix = { + wantedBy = [ "multi-user.target" ]; + description = "gilles on testing"; + serviceConfig = { + ExecStart = ''${lib.getExe pkgs.docker} run --network host -v /var/lib/acme/rhizome.tf:/var/lib/acme/rhizome.tf --env-file /var/www/felix_env git.rhizome.tf/rhizome/gilles:latest''; + Group = "www"; + User = "felix"; + Restart = "always"; + }; + }; + + services.caddy = { + enable = true; + virtualHosts = { + "rhizome.tf".extraConfig = '' + route /.well-known/acme-challenge/* { + root * /var/www/acme-challenge + file_server + } + root * /var/www/rhizome.tf + file_server + handle_errors { + @404 { + expression {http.error.status_code} == 404 + } + rewrite @404 /404.html + file_server + } + ''; + "git.rhizome.tf".extraConfig = '' + reverse_proxy http://localhost:3036 + ''; + "ci.rhizome.tf".extraConfig = '' + reverse_proxy http://localhost:8000 + ''; + }; + group = "www"; + }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + kitty + helix + ripgrep + fd + exa + bat + nix-index + comma + alejandra + curl + cachix + git + man-pages + man-pages-posix + rnix-lsp + zellij + zoxide + fzf + btop + ]; + documentation.dev.enable = true; + documentation.man.enable = true; + documentation.enable = true; + programs.nix-index-database.comma.enable = true; + programs.nix-index.enableZshIntegration = false; + programs.nix-index.enableBashIntegration = false; + + services.openssh = { + enable = true; + passwordAuthentication = false; + kbdInteractiveAuthentication = false; + permitRootLogin = "no"; + }; + + networking.firewall.allowedTCPPorts = [ + 22 + 80 + 443 + 5539 + 5559 + 6660 + ]; + networking.firewall.allowedUDPPorts = [ + 443 + 6660 + ]; + + security.acme = { + acceptTerms = true; + defaults.email = "admin@rhizome.tf"; + defaults.group = "www"; + certs."rhizome.tf" = { + webroot = "/var/www/acme-challenge"; + }; + }; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It's perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "23.05"; # Did you read the comment? + + system.activationScripts = { + acls.text = '' + ${pkgs.acl}/bin/setfacl -Rm spore:rx /var/lib/acme/rhizome.tf + ''; + }; +} diff --git a/system/servers/rhizome-vps/flake.nix b/system/servers/rhizome-vps/flake.nix new file mode 100644 index 0000000..677b59a --- /dev/null +++ b/system/servers/rhizome-vps/flake.nix @@ -0,0 +1,53 @@ +{ + description = "rhizome dev server"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; + + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; + + flake-utils.url = "github:numtide/flake-utils"; + + home-manager = { + url = "github:nix-community/home-manager/release-23.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nix-index-database = { + url = "github:Mic92/nix-index-database"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = + { + self, + nixpkgs, + home-manager, + nix-index-database, + ... + }@inputs: + let + inherit (self) outputs; + in + rec { + nixosConfigurations = { + "filament" = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs outputs; }; + modules = [ + ./configuration.nix + nix-index-database.nixosModules.nix-index + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.extraSpecialArgs = { inherit inputs outputs; }; + home-manager.users.rhizome.imports = [ ./rhizome.nix ]; + } # hm + ]; # modules + }; # filament + }; + }; # rec +} diff --git a/system/servers/rhizome-vps/hardware-configuration.nix b/system/servers/rhizome-vps/hardware-configuration.nix new file mode 100644 index 0000000..7564564 --- /dev/null +++ b/system/servers/rhizome-vps/hardware-configuration.nix @@ -0,0 +1,38 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + lib, + ... +}: +{ + imports = [ ]; + + boot.initrd.availableKernelModules = [ + "ata_piix" + "uhci_hcd" + "virtio_pci" + "sr_mod" + "virtio_blk" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/f4889546-f71c-4e3c-ab47-e183a72dc52e"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + virtualisation.hypervGuest.enable = true; +} diff --git a/system/servers/rhizome-vps/rhizome.nix b/system/servers/rhizome-vps/rhizome.nix new file mode 100644 index 0000000..72acd99 --- /dev/null +++ b/system/servers/rhizome-vps/rhizome.nix @@ -0,0 +1,127 @@ +{ + pkgs, + ... +}: +{ + home.packages = with pkgs; [ + lazygit + alejandra + ]; + + home = { + username = "rhizome"; + homeDirectory = "/home/rhizome"; + }; + + programs.direnv = { + enable = true; + nix-direnv = { + enable = true; + }; + }; + + programs.git = { + enable = true; + userName = "rhizome"; + userEmail = "filament@rhizome.tf"; + }; + + programs.fzf = { + enable = true; + enableZshIntegration = true; + }; + + programs.helix = { + enable = true; + settings = { + theme = "base16_terminal"; + editor.lsp.display-messages = true; + }; + }; + + programs.zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + enableSyntaxHighlighting = true; + enableVteIntegration = true; + autocd = true; + defaultKeymap = "viins"; + initExtra = '' + [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh + alias ...='cd ../..' + alias ....='cd ../../..' + alias .....='cd ../../../..' + alias chmox='chmod +x' + alias gs='git status' + alias gcl='git clone' + alias ga='git add' + alias gcb='git checkout -b' + alias gco='git checkout' + alias gl='git pull' + alias gp='git push' + alias gd='git diff' + alias gcam='git commit -am' + alias gcm='git commit -m' + alias gr='git restore' + alias gm='git merge' + alias l='exa -lh --group-directories-first --icons --color=always' + alias la='exa -lha --group-directories-first --icons --color=always' + eval "$(zoxide init zsh)" + ''; + plugins = [ + { + name = "powerlevel10k"; + src = pkgs.zsh-powerlevel10k; + file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; + } + { + name = "zsh-vi-mode"; + src = pkgs.zsh-vi-mode; + file = "share/zsh-vi-mode/zsh-vi-mode.zsh"; + } + { + name = "zsh-autopair"; + src = pkgs.zsh-autopair; + file = "share/zsh-autopair/zsh-autopair.zsh"; + } + { + name = "zsh-completions"; + src = pkgs.zsh-completions; + file = "share/zsh-completions/zsh-completions.zsh"; + } + { + name = "zsh-command-time"; + src = pkgs.zsh-command-time; + file = "share/zsh-completions/zsh-command-time.zsh"; + } + { + name = "zsh-autocomplete"; + src = pkgs.zsh-autocomplete; + file = "share/zsh-autocomplete/zsh-autocomplete.zsh"; + } + { + name = "zsh-fast-syntax-highlighting"; + src = pkgs.zsh-fast-syntax-highlighting; + file = "share/zsh-fast-syntax-highlighting/zsh-fast-syntax-highlighting.zsh"; + } + { + name = "zsh-nix-shell"; + src = pkgs.zsh-nix-shell; + file = "share/zsh-nix-shell/zsh-nix-shell.zsh"; + } + { + name = "any-nix-shell"; + src = pkgs.any-nix-shell; + file = "share/any-nix-shell/any-nix-shell.zsh"; + } + { + name = "nix-zsh-completions"; + src = pkgs.nix-zsh-completions; + file = "share/nix-zsh-completions/nix-zsh-completions.zsh"; + } + ]; + }; + + home.stateVersion = "23.05"; +} diff --git a/system/substituters.nix b/system/substituters.nix new file mode 100644 index 0000000..2703699 --- /dev/null +++ b/system/substituters.nix @@ -0,0 +1,21 @@ +{ + ... +}: +{ + nix.settings = { + substituters = [ + "https://cache.nixos.org" + "https://nix-community.cachix.org" + "https://helix.cachix.org" + "https://walker-git.cachix.org" + "https://anmonteiro.nix-cache.workers.dev" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" + "walker-git.cachix.org-1:vmC0ocfPWh0S/vRAQGtChuiZBTAe4wiKDeyyXM0/7pM=" + "ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=" + ]; + }; +} diff --git a/system/syspkgs/headscale-ui.nix b/system/syspkgs/headscale-ui.nix deleted file mode 100755 index d1d9891..0000000 --- a/system/syspkgs/headscale-ui.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ lib, stdenv, fetchurl, unzip }: - -stdenv.mkDerivation rec { - pname = "headscale-ui"; - version = "2022.12.23.2-beta"; - - src = fetchurl { - url = "https://github.com/gurucomputing/headscale-ui/releases/download/${version}/headscale-ui.zip"; - sha256 = "sha256-QF10la68Rl2t0K53CH63Qiq54ynkySQACdELorZF/cY="; - }; - - nativeBuildInputs = [ unzip ]; - - unpackCmd = "unzip headscale-ui.zip"; - - dontConfigure = true; - dontBuild = true; - installPhase = '' - mkdir $out/ - cp -R . $out - ''; - -} \ No newline at end of file diff --git a/system/syspkgs/hyprland-system76-scheduler-hook.sh b/system/syspkgs/hyprland-system76-scheduler-hook.sh deleted file mode 100755 index b85564e..0000000 --- a/system/syspkgs/hyprland-system76-scheduler-hook.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -socat - UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | -while read line -do - if [[ "$line" == activewindow* ]]; then - pid="$(hyprctl activewindow | rg pid | cut -d' ' -f2)" - if [[ -n $pid ]]; then - dbus-send --system --dest=com.system76.Scheduler --type=method_call /com/system76/Scheduler com.system76.Scheduler.SetForegroundProcess uint32:$pid - fi - pid="" - fi -done \ No newline at end of file diff --git a/system/syspkgs/hyprland-system76-scheduler-integration.nix b/system/syspkgs/hyprland-system76-scheduler-integration.nix deleted file mode 100644 index 2da3324..0000000 --- a/system/syspkgs/hyprland-system76-scheduler-integration.nix +++ /dev/null @@ -1,47 +0,0 @@ - -{ lib, pkgs, stdenv, hyprland, ripgrep, socat, dbus, ... }: - -stdenv.mkDerivation rec { - pname = "hyprland-system76-scheduler-integration"; - version = "0.1.0"; - - nativeBuildInputs = [ - socat - dbus - hyprland - ripgrep - ]; - - dontUnpack = "true"; - dontBuild = true; - - installPhase = '' - runHook preInstall - - mkdir -p $out/bin - - cat < $out/bin/hyprland-system76-scheduler-hook.sh -#!${pkgs.bash}/bin/bash -echo "opening socket.." -${pkgs.socat}/bin/socat -u UNIX-CLIENT:/tmp/hypr/\''$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock STDOUT | -while read line; do - if [[ "\''$line" == activewindow* ]]; then - echo "got \''$line." - pid="\''$(${pkgs.hyprland}/bin/hyprctl activewindow | ${pkgs.ripgrep}/bin/rg pid | ${pkgs.coreutils}/bin/cut -d' ' -f2)" - if [[ -n \''$pid ]]; then - echo "sending \''$pid!" - ${pkgs.dbus}/bin/dbus-send --system --dest=com.system76.Scheduler --type=method_call /com/system76/Scheduler com.system76.Scheduler.SetForegroundProcess uint32:\''$pid - fi - pid="" - fi - echo "continuing.." -done -echo "finished." -EOF - chmod +x $out/bin/hyprland-system76-scheduler-hook.sh - - runHook postInstall - ''; - - -} diff --git a/system/syspkgs/kwin-system76-scheduler-integration.nix b/system/syspkgs/kwin-system76-scheduler-integration.nix deleted file mode 100755 index ea26b5d..0000000 --- a/system/syspkgs/kwin-system76-scheduler-integration.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ lib, pkgs, stdenv, fetchFromGitHub, dbus, qt5, qtbase, wrapQtAppsHook, kpackage, kcoreaddons, ... }: - -stdenv.mkDerivation rec { - pname = "kwin-system76-scheduler-integration"; - version = "0.1"; - - src = fetchFromGitHub { - owner = "maxiberta"; - repo = pname; - rev = version; - sha256 = "sha256-HX0nK1p97kqt+ZZuECm7Mg9aAXaFDnsJDkbcLUEU+p0="; - }; - - nativeBuildInputs = [ - wrapQtAppsHook - kpackage - ]; - - buildInputs = [ - dbus - qt5.qttools.bin - ]; - - dontBuild = true; - - installPhase = '' - runHook preInstall - - mkdir -p $out/bin - kpackagetool5 --type=KWin/Script -i . -p $out/share/kwin/scripts - - cat < $out/bin/kwin-system76-scheduler-dbus-proxy.sh - #!${pkgs.bash}/bin/bash - DBUS_SERVICE="com.system76.Scheduler" - DBUS_PATH="/com/system76/Scheduler" - DBUS_INTERFACE="com.system76.Scheduler" - DBUS_METHOD="SetForegroundProcess" - echo "starting dbus proxy.." - echo \''$DBUS_SERVICE \''$DBUS_PATH \''$DBUS_INTERFACE \''$DBUS_METHOD - ${pkgs.dbus}/bin/dbus-monitor --session "destination=\''$DBUS_SERVICE,path=\''$DBUS_PATH,interface=\''$DBUS_INTERFACE,member=\''$DBUS_METHOD" | - while true; do - read method call time sender _ dest serial path interface member - read type pid - [ "\''$member" = "member=\''$DBUS_METHOD" ] && ${pkgs.libsForQt5.qt5.qttools.bin}/bin/qdbus --system \''$DBUS_SERVICE \''$DBUS_PATH \''$DBUS_INTERFACE.\''$DBUS_METHOD \''$pid && echo "new foreground process: \''$pid" - done - EOF - - chmod +x $out/bin/kwin-system76-scheduler-dbus-proxy.sh - - runHook postInstall - ''; - - -} diff --git a/system/syspkgs/lemurs.nix b/system/syspkgs/lemurs.nix deleted file mode 100755 index 82af7a8..0000000 --- a/system/syspkgs/lemurs.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ lib, fetchFromGitHub, rustPlatform, linux-pam, pkg-config }: - -rustPlatform.buildRustPackage rec { - pname = "lemurs"; - version = "0.3.1"; - - src = fetchFromGitHub { - owner = "coastalwhite"; - repo = pname; - rev = "60fda2a"; - sha256 = "sha256-mQXavJULD5iyOnzj72xTV0EQ1HQvj25SHsbDgfRg4lQ="; - }; - - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ linux-pam ]; - - cargoSha256 = "sha256-OCaIeQB8reK0089vbC+4IvQt5pKdZ2SCyyGuQEYWzjo="; - - meta = with lib; { - description = "A customizable TUI display/login manager written in Rust"; - homepage = "https://git.atagen.co/coastalwhite/lemurs"; - license = licenses.mit; - maintainers = [ ]; - }; - -} diff --git a/system/syspkgs/ly.nix b/system/syspkgs/ly.nix deleted file mode 100644 index dd499fe..0000000 --- a/system/syspkgs/ly.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ stdenv, lib, fetchFromGitHub, linux-pam, libxcb, git }: - -stdenv.mkDerivation rec { - pname = "ly"; - version = "0.5.0+"; - - src = fetchFromGitHub { - owner = "fairyglade"; - repo = pname; - rev = "c64f806a68af225cc95623971b5e464abb55b879"; - sha256 = "sha256-orCqjKlK6U1q7NDoMwxZZE44cyG8yuxdCCk1cQAalP0="; - fetchSubmodules = true; - }; - - nativeBuildInputs = [ git ]; - buildInputs = [ linux-pam libxcb ]; - makeFlags = [ "FLAGS=-Wno-error=unused-result" ]; - - preBuildPhase = '' - mkdir -p ./data - export DESTDIR="$PWD" - export DATADIR="$PWD/data" - ''; - buildPhase = '' - make -j16 - ''; - - installPhase = '' - mkdir -p $out/bin - cp bin/ly $out/bin - mkdir -p $out/etc/ly - cp -R ./data/* $out/etc/ly - ''; - - meta = with lib; { - description = "TUI display manager"; - license = licenses.wtfpl; - homepage = "https://github.com/fairyglade/ly"; - maintainers = [ ]; - }; -} diff --git a/system/syspkgs/system76-scheduler.nix b/system/syspkgs/system76-scheduler.nix deleted file mode 100755 index ee80a53..0000000 --- a/system/syspkgs/system76-scheduler.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ pkgs, lib, rustPlatform, fetchFromGitHub, ... }: -rustPlatform.buildRustPackage rec { - - pname = "system76-scheduler"; - version = "1.2.2"; - - src = fetchFromGitHub { - owner = "pop-os"; - repo = pname; - rev = version; - sha256 = "sha256-uFFJkuMxqcGj6OQShF0zh/FGwX4/ln1l6NwGonkUsNI="; - }; - - nativeBuildInputs = with pkgs; [ - bcc - ]; - - EXECSNOOP_PATH = "${pkgs.bcc}/bin/execsnoop"; - - cargoSha256 = "sha256-s91T/Ttr7G8sjyf0Mp5suep4IA+l/r4118B+ue33yfQ="; - - postInstall = '' - mkdir -p $out/etc/system76-scheduler/assignments \ - $out/etc/system76-scheduler/exceptions \ - $out/lib/systemd/system \ - $out/etc/dbus-1/system.d - install -Dm0644 data/config.ron $out/etc/system76-scheduler/config.ron - install -Dm0644 data/assignments.ron $out/etc/system76-scheduler/assignments/default.ron - install -Dm0644 data/exceptions.ron $out/etc/system76-scheduler/exceptions/default.ron - # install -Dm0644 data/com.system76.Scheduler.service $out/lib/systemd/system/com.system76.Scheduler.service - install -Dm0644 data/com.system76.Scheduler.conf $out/etc/dbus-1/system.d/com.system76.Scheduler.conf - ''; - -} diff --git a/system/wollomi.nix b/system/wollomi.nix deleted file mode 100755 index cde4ae9..0000000 --- a/system/wollomi.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbcore" "sd_mod" ]; - boot.initrd.kernelModules = []; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - - boot.supportedFilesystems = [ "ntfs" ]; - - networking.useDHCP = lib.mkDefault true; - - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - - # dlna - services.minidlna = { - enable = true; - announceInterval = 120; - friendlyName = "PC"; - mediaDirs = [ "A,/data/Music/Slsk" ]; - }; - - services.xserver.videoDrivers = [ "nvidia" ]; - hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; - hardware.ckb-next.enable = true; - environment.systemPackages = with pkgs; [ - ckb-next - ]; - - networking.hostName = "quiver"; # Define your hostname. - users.users.bolt = { - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - }; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/06f59431-d939-4b48-9d91-e23606dd3ce0"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/5008-1946"; - fsType = "vfat"; - }; - - fileSystems."/data" = { - device = "/dev/disk/by-uuid/39D4F78C658E8B56"; - fsType = "ntfs"; - options = [ "rw" "uid=1000" "gid=100" ]; - }; - - swapDevices = [ ]; - - networking.firewall = { - allowedUDPPorts = [ 1900 ]; - allowedTCPPorts = [ 8200 ]; - }; - -} diff --git a/top n bottom.layout.latte b/top n bottom.layout.latte deleted file mode 100755 index 2314fa0..0000000 --- a/top n bottom.layout.latte +++ /dev/null @@ -1,278 +0,0 @@ -[ActionPlugins][1] -RightButton;NoModifier=org.kde.latte.contextmenu - -[Containments][1] -activityId= -byPassWM=false -dockWindowBehavior=true -enableKWinEdges=true -formfactor=2 -immutability=1 -isPreferredForShortcuts=false -lastScreen=-1 -layoutId= -location=4 -name=Default Dock -onPrimary=true -plugin=org.kde.latte.containment -raiseOnActivityChange=false -raiseOnDesktopChange=false -timerHide=700 -timerShow=200 -viewType=0 -visibility=2 -wallpaperplugin=org.kde.image - -[Containments][1][Applets][2] -immutability=1 -plugin=org.kde.latte.plasmoid - -[Containments][1][Applets][2][Configuration] -PreloadWeight=0 - -[Containments][1][Applets][2][Configuration][General] -isInLatteDock=true -launchers59=applications:firefox.desktop,applications:org.kde.dolphin.desktop - -[Containments][1][Applets][3] -immutability=1 -plugin=org.kde.plasma.analogclock - -[Containments][1][Applets][3][Configuration] -PreloadWeight=0 - -[Containments][1][ConfigDialog] -DialogHeight=600 -DialogWidth=586 - -[Containments][1][Configuration] -PreloadWeight=0 - -[Containments][1][General] -advanced=false -alignmentUpgraded=true -appletOrder=2;3 -configurationSticker=true -panelSize=10 -shadowOpacity=60 -shadowSize=45 -shadows=All -shadowsUpgraded=true -showGlow=false -tasksUpgraded=true -titleTooltips=false -zoomLevel=17 - -[Containments][1][Indicator] -customType= -enabled=true -type=org.kde.latte.default - -[Containments][17] -PreloadWeight=0 -activityId= -formfactor=2 -immutability=1 -lastScreen=11 -layoutId= -location=3 -plugin=org.kde.plasma.private.systemtray -wallpaperplugin=org.kde.image - -[Containments][17][Applets][122] -immutability=1 -plugin=org.kde.plasma.manage-inputmethod - -[Containments][17][Applets][123] -immutability=1 -plugin=org.kde.plasma.keyboardlayout - -[Containments][17][Applets][88] -immutability=1 -plugin=org.kde.plasma.notifications - -[Containments][17][Applets][89] -immutability=1 -plugin=org.kde.plasma.battery - -[Containments][17][Applets][90] -immutability=1 -plugin=org.kde.plasma.printmanager - -[Containments][17][Applets][91] -immutability=1 -plugin=org.kde.plasma.volume - -[Containments][17][Applets][92] -immutability=1 -plugin=org.kde.plasma.nightcolorcontrol - -[Containments][17][Applets][93] -immutability=1 -plugin=org.kde.plasma.keyboardindicator - -[Containments][17][Applets][94] -immutability=1 -plugin=org.kde.plasma.networkmanagement - -[Containments][17][Applets][95] -immutability=1 -plugin=org.kde.plasma.clipboard - -[Containments][17][Applets][96] -immutability=1 -plugin=org.kde.plasma.bluetooth - -[Containments][17][Applets][97] -immutability=1 -plugin=org.kde.plasma.devicenotifier - -[Containments][17][Applets][98] -immutability=1 -plugin=org.kde.kdeconnect - -[Containments][17][ConfigDialog] -DialogHeight=1025 -DialogWidth=963 - -[Containments][17][Configuration] -PreloadWeight=26 - -[Containments][17][General] -extraItems=org.kde.plasma.manage-inputmethod,org.kde.plasma.notifications,org.kde.plasma.devicenotifier,org.kde.plasma.clipboard,org.kde.plasma.mediacontroller,org.kde.plasma.battery,org.kde.kdeconnect,org.kde.plasma.keyboardlayout,org.kde.plasma.keyboardindicator,org.kde.plasma.volume,org.kde.plasma.networkmanagement,org.kde.plasma.printmanager,org.kde.plasma.nightcolorcontrol -knownItems=org.kde.plasma.manage-inputmethod,org.kde.plasma.notifications,org.kde.plasma.devicenotifier,org.kde.plasma.clipboard,org.kde.plasma.mediacontroller,org.kde.plasma.battery,org.kde.kdeconnect,org.kde.plasma.keyboardlayout,org.kde.plasma.keyboardindicator,org.kde.plasma.volume,org.kde.plasma.networkmanagement,org.kde.plasma.printmanager,org.kde.plasma.nightcolorcontrol - -[Containments][19] -activityId= -byPassWM=false -dockWindowBehavior=true -enableKWinEdges=true -formfactor=2 -immutability=1 -isPreferredForShortcuts=false -lastScreen=11 -layoutId= -location=3 -maxLength=100 -name=Default Panel -onPrimary=true -plugin=org.kde.latte.containment -raiseOnActivityChange=false -raiseOnDesktopChange=false -settingsComplexity=4 -timerHide=700 -timerShow=200 -viewType=0 -visibility=0 -wallpaperplugin=org.kde.image - -[Containments][19][Applets][112] -immutability=1 -plugin=org.kde.plasma.kickoff - -[Containments][19][Applets][112][Configuration][General] -favoritesPortedToKAstats=true - -[Containments][19][Applets][113] -immutability=1 -plugin=org.kde.plasma.digitalclock - -[Containments][19][Applets][114] -immutability=1 -plugin=org.kde.plasma.systemtray - -[Containments][19][Applets][114][Configuration] -PreloadWeight=100 -SystrayContainmentId=17 - -[Containments][19][Applets][115] -immutability=1 -plugin=org.kde.plasma.pager - -[Containments][19][Applets][116] -immutability=1 -plugin=org.kde.plasma.marginsseparator - -[Containments][19][Applets][124] -immutability=1 -plugin=org.kde.windowtitle - -[Containments][19][Applets][124][Configuration][General] -containmentType=Latte - -[Containments][19][Applets][125] -immutability=1 -plugin=org.kde.plasma.lock_logout - -[Containments][19][Applets][126] -immutability=1 -plugin=org.kde.plasma.marginsseparator - -[Containments][19][ConfigDialog] -DialogHeight=1254 -DialogWidth=529 - -[Containments][19][Configuration] -PreloadWeight=0 - -[Containments][19][General] -advanced=true -alignment=10 -alignmentUpgraded=true -appletOrder=112;124;115;116;114;113;126;125 -appletShadowsEnabled=false -autoDecreaseIconSize=false -backgroundRadius=0 -backgroundShadowSize=0 -blurEnabled=false -configurationSticker=true -dragActiveWindowEnabled=true -floatingInternalGapIsForced=false -iconSize=24 -inConfigureAppletsMode=true -lockedZoomApplets=112;113 -mouseWheelActions=false -panelPosition=10 -panelShadows=false -panelSize=100 -plasmaBackgroundForPopups=true -screenEdgeMargin=0 -shadowOpacity=25 -shadows=None -shadowsUpgraded=true -splitterPosition=2 -splitterPosition2=4 -taskScrollAction=ScrollNone -tasksUpgraded=true -thickMargin=11 -titleTooltips=false -zoomLevel=0 - -[Containments][19][Indicator] -customType=org.kde.latte.unity -enabled=true -enabledForApplets=true -padding=0.09000000357627869 -type=org.kde.latte.default - -[Containments][19][Indicator][org.kde.latte.default][General] -lengthPadding=0.3 -reversed=true - -[Containments][19][Indicator][org.kde.latte.plasma][General] -lengthPadding=0.19 - -[LayoutSettings] -activities= -backgroundStyle=0 -color=blue -customBackground= -customTextColor= -icon= -lastUsedActivity= -launchers= -popUpMargin=-1 -preferredForShortcutsTouched=false -schemeFile= -showInMenu=true -version=2 diff --git a/util/get-modules.nix b/util/get-modules.nix new file mode 100644 index 0000000..0d67f22 --- /dev/null +++ b/util/get-modules.nix @@ -0,0 +1,7 @@ +{ inputs }: +let + inherit (inputs.nixpkgs) lib; +in +l: +lib.filterAttrs (_: v: builtins.elem v l) inputs +|> lib.mapAttrsToList (n: v: v.nixosModules.${n} or v.nixosModules.default) diff --git a/wollomi-xorg.conf b/wollomi-xorg.conf deleted file mode 100755 index e21a00b..0000000 --- a/wollomi-xorg.conf +++ /dev/null @@ -1,63 +0,0 @@ -# nvidia-settings: X configuration file generated by nvidia-settings -# nvidia-settings: version 515.48.07 - -Section "ServerLayout" - Identifier "Layout0" - Screen 0 "Screen0" 0 0 - InputDevice "Keyboard0" "CoreKeyboard" - InputDevice "Mouse0" "CorePointer" - Option "Xinerama" "0" -EndSection - -Section "Files" -EndSection - -Section "InputDevice" - # generated from default - Identifier "Mouse0" - Driver "mouse" - Option "Protocol" "auto" - Option "Device" "/dev/input/mice" - Option "Emulate3Buttons" "no" - Option "ZAxisMapping" "4 5" -EndSection - -Section "InputDevice" - # generated from default - Identifier "Keyboard0" - Driver "kbd" -EndSection - -Section "Monitor" - # HorizSync source: edid, VertRefresh source: edid - Identifier "Monitor0" - VendorName "Unknown" - ModelName "LG Electronics W2343" - HorizSync 30.0 - 83.0 - VertRefresh 56.0 - 75.0 - Option "DPMS" -EndSection - -Section "Device" - Identifier "Device0" - Driver "nvidia" - VendorName "NVIDIA Corporation" - BoardName "NVIDIA GeForce GTX 1070" -EndSection - -Section "Screen" - Identifier "Screen0" - Device "Device0" - Monitor "Monitor0" - DefaultDepth 24 - Option "Stereo" "0" - Option "nvidiaXineramaInfoOrder" "DFP-0" - Option "metamodes" "DVI-D-0: nvidia-auto-select +1050+265, HDMI-0: nvidia-auto-select +0+0 {rotation=left}" - Option "SLI" "Off" - Option "MultiGPU" "Off" - Option "BaseMosaic" "off" - SubSection "Display" - Depth 24 - EndSubSection -EndSection -