Add dotfiles

This commit is contained in:
muon 2024-03-26 11:39:16 +00:00
commit 39fe550b3e
45 changed files with 4363 additions and 0 deletions

View file

@ -0,0 +1,48 @@
{
config,
lib,
pkgs,
...
}:
{
programs.alacritty = {
enable = true;
settings = {
cursor = {
style.shape = "Beam";
vi_mode_style = "Block";
unfocused_hollow = true;
};
window = {
padding.x = 6;
padding.y = 6;
};
key_bindings = [
{
key = "U";
mods = "Control";
mode = "Vi|~Search";
action = "ScrollHalfPageUp";
}
{
key = "D";
mods = "Control";
mode = "Vi|~Search";
action = "ScrollHalfPageDown";
}
{
key = "U";
mods = "Control";
mode = "~Alt";
action = "ScrollHalfPageUp";
}
{
key = "D";
mods = "Control";
mode = "~Alt";
action = "ScrollHalfPageDown";
}
];
};
};
}

36
modules/home/default.nix Normal file
View file

@ -0,0 +1,36 @@
{
inputs,
pkgs,
config,
lib,
self,
stylix,
...
}:
{
config.home.stateVersion = "23.05";
config.home.extraOutputsToInstall = ["doc" "devdoc"];
imports = [
./packages.nix
./git
./shell
./alacritty
./helix
./tools
./qutebrowser
stylix.homeManagerModules.stylix
./theme
# ./herbstluftwm
# ./leftwm
./xmonad
# ./hyprland
# inputs.hyprland.homeManagerModules.default
inputs.nix-doom-emacs.hmModule
./doom-emacs
];
}

View file

@ -0,0 +1,12 @@
{
config,
lib,
pkgs,
...
}:
{
programs.doom-emacs = {
enable = true;
doomPrivateDir = ./doom;
};
}

View file

@ -0,0 +1,121 @@
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
(setq user-full-name "Muonis"
user-mail-address "user@muon.host")
;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
;; are the three important ones:
;;
;; + `doom-font'
;; + `doom-variable-pitch-font'
;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for
;; presentations or streaming.
;;
;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
;; font string. You generally only need these two:
;; (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light)
;; doom-variable-pitch-font (font-spec :family "sans" :size 13))
(setq doom-font (font-spec :family "Mononoki Nerd Font" :size 14 :weight 'regular))
;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
(setq doom-theme 'doom-gruvbox)
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/documents/org/")
;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
; (setq display-line-numbers-type t)
;; (setq display-line-numbers-type relative)
(setq display-line-numbers-type 'relative)
(setq doom-line-numbers-style 'relative)
;; Company coc mode
(company-tng-configure-default)
;; Unbind jk bind jj, Dutch :/
(setq evil-escape-key-sequence "jj")
;; Here are some additional functions/macros that could help you configure Doom:
;;
;; - `load!' for loading external *.el files relative to this one
;; - `use-package!' for configuring packages
;; - `after!' for running code after a package has loaded
;; - `add-load-path!' for adding directories to the `load-path', relative to
;; this file. Emacs searches the `load-path' when you load packages with
;; `require' or `use-package'.
;; - `map!' for binding new keys
;;
;; To get information about any of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
;; This will open documentation for it, including demos of how they are used.
;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.
;; Window nav
(map! :g "C-h" 'evil-window-left)
(map! :g "C-j" 'evil-window-down)
(map! :g "C-k" 'evil-window-up)
(map! :g "C-l" 'evil-window-right)
;; org-roam
(setq org-roam-directory "~/documents/roam")
(org-roam-db-autosync-enable)
(org-roam-complete-everywhere)
(map! :leader
"r f" 'org-roam-node-find
"r g" 'org-roam-graph
"r b" 'org-roam-buffer-toggle
"r i" 'org-roam-node-insert
"r c" 'org-roam-capture
)
;; vterm
(after! vterm
(set-evil-initial-state! 'vterm-mode
'emacs))
;; Autocomplete region buffer
(defun narrow-to-region-indirect (start end)
"Restrict editing in this buffer to the current region, indirectly."
(interactive "r")
(deactivate-mark)
(let ((buf (clone-indirect-buffer nil nil)))
(with-current-buffer buf
(narrow-to-region start end))
(switch-to-buffer buf)))
;; EIN
(setq ein:output-area-inlined-images t)
(setq ein:slice-image t)
(setq ein:completion-backend 'ein:use-company-backend)
(setq ein:polymode t)
;; ORG
(require 'org)
(require 'ox-latex)
(add-to-list 'org-latex-packages-alist '("" "minted"))
(setq org-latex-listings 'minted)
(setq org-latex-pdf-process
'("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
"pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
(setq org-src-fontify-natively t)
(org-babel-do-load-languages
'org-babel-load-languages
'((R . t)
(latex . t)))

View file

@ -0,0 +1,16 @@
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
'("7a424478cb77a96af2c0f50cfb4e2a88647b3ccca225f8c650ed45b7f50d9525" "a138ec18a6b926ea9d66e61aac28f5ce99739cf38566876dc31e29ec8757f6e2" "b54376ec363568656d54578d28b95382854f62b74c32077821fdfd604268616a" "2e05569868dc11a52b08926b4c1a27da77580daa9321773d92822f7a639956ce" "5f128efd37c6a87cd4ad8e8b7f2afaba425425524a68133ac0efd87291d05874" "680f62b751481cc5b5b44aeab824e5683cf13792c006aeba1c25ce2d89826426" "4ff1c4d05adad3de88da16bd2e857f8374f26f9063b2d77d38d14686e3868d8d" "8d3ef5ff6273f2a552152c7febc40eabca26bae05bd12bc85062e2dc224cde9a" "944d52450c57b7cbba08f9b3d08095eb7a5541b0ecfb3a0a9ecd4a18f3c28948" "2721b06afaf1769ef63f942bf3e977f208f517b187f2526f0e57c1bd4a000350" "e3daa8f18440301f3e54f2093fe15f4fe951986a8628e98dcd781efbec7a46f2" "afa47084cb0beb684281f480aa84dab7c9170b084423c7f87ba755b15f6776ef" "a44e2d1636a0114c5e407a748841f6723ed442dc3a0ed086542dc71b92a87aee" "60ada0ff6b91687f1a04cc17ad04119e59a7542644c7c59fc135909499400ab8" "467dc6fdebcf92f4d3e2a2016145ba15841987c71fbe675dcfe34ac47ffb9195" "e19ac4ef0f028f503b1ccafa7c337021834ce0d1a2bca03fcebc1ef635776bea" "b5803dfb0e4b6b71f309606587dd88651efe0972a5be16ece6a958b197caeed8" "6c531d6c3dbc344045af7829a3a20a09929e6c41d7a7278963f7d3215139f6a7" "1f1b545575c81b967879a5dddc878783e6ebcca764e4916a270f9474215289e5" "3d47380bf5aa650e7b8e049e7ae54cdada54d0637e7bac39e4cc6afb44e8463b" "6c98bc9f39e8f8fd6da5b9c74a624cbb3782b4be8abae8fd84cbc43053d7c175" "97db542a8a1731ef44b60bc97406c1eb7ed4528b0d7296997cbb53969df852d6" "028c226411a386abc7f7a0fba1a2ebfae5fe69e2a816f54898df41a6a3412bb5" "7a7b1d475b42c1a0b61f3b1d1225dd249ffa1abb1b7f726aec59ac7ca3bf4dae" "da186cce19b5aed3f6a2316845583dbee76aea9255ea0da857d1c058ff003546" "4699e3a86b1863bbc695236036158d175a81f0f3ea504e2b7c71f8f7025e19e3" "234dbb732ef054b109a9e5ee5b499632c63cc24f7c2383a849815dacc1727cb6" "1704976a1797342a1b4ea7a75bdbb3be1569f4619134341bd5a4c1cfb16abad4" "f6665ce2f7f56c5ed5d91ed5e7f6acb66ce44d0ef4acfaa3a42c7cfe9e9a9013" "c4063322b5011829f7fdd7509979b5823e8eea2abf1fe5572ec4b7af1dd78519" default))
'(package-selected-packages '(jekyll-modes))
'(warning-suppress-log-types '((lsp-mode) (lsp-mode)))
'(warning-suppress-types '((emacs) (defvaralias) (lsp-mode))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

View file

@ -0,0 +1,190 @@
;;; init.el -*- lexical-binding: t; -*-
;; This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
;; documentation. There you'll find a "Module Index" link where you'll find
;; a comprehensive list of Doom's modules and what flags they support.
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
;; 'C-c c k' for non-vim users) to view its documentation. This works on
;; flags as well (those symbols that start with a plus).
;;
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
;; directory (for easy access to its source code).
(doom! :input
;;chinese
;;japanese
;;layout ; auie,ctsrnm is the superior home row
:completion
company ; the ultimate code completion backend
(helm +fuzzy) ; the *other* search engine for love and life
;; ido ; the other *other* search engine...
;; (ivy +fuzzy) ; a search engine for love and life
;; (vertico +fuzzy) ; the search engine of the future
:ui
;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
doom-quit ; DOOM quit-message prompts when you quit Emacs
;;(emoji +unicode) ; 🙂
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
;;indent-guides ; highlighted indent columns
(ligatures +hasklig) ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
;;nav-flash ; blink cursor line after big motions
neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
;;tabs ; a tab bar for Emacs
;;treemacs ; a project drawer, like neotree but cooler
;;unicode ; extended unicode support for various languages
vc-gutter ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
;;window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces
;;zen ; distraction-free coding or writing
:editor
(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;;lispy ; vim for lisp, for people who don't like vim
;;multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
;;parinfer ; turn lisp into python, sort of
;;rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to
;;word-wrap ; soft wrapping with language-aware indent
:emacs
dired ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
;;ibuffer ; interactive buffer management
undo ; persistent, smarter undo for your inevitable mistakes
vc ; version-control and Emacs, sitting in a tree
:term
;;eshell ; the elisp shell that works everywhere
;;shell ; simple shell REPL for Emacs
term ; basic terminal emulator for Emacs
vterm ; the best terminal emulation in Emacs
:checkers
syntax ; tasing you for every semicolon you forget
;;(spell +flyspell) ; tasing you for misspelling mispelling
;;grammar ; tasing grammar mistake every you make
:tools
;;ansible
biblio ; Writes a PhD for you (citation needed)
debugger ; FIXME stepping through code, to help you add bugs
;;direnv
;;docker
;;editorconfig ; let someone else argue about tabs vs spaces
ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
;;gist ; interacting with github gists
lookup ; navigate your code and its documentation
lsp ; M-x vscode
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
;;pass ; password manager for nerds
pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
;;rgb ; creating color strings
;;taskrunner ; taskrunner for all your projects
;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
;;upload ; map local to remote projects via ssh/ftp
:os
(:if IS-MAC macos) ; improve compatibility with macOS
tty ; improve the terminal Emacs experience
:lang
;;agda ; types of types of types of types...
;;beancount ; mind the GAAP
cc ; C > C++ == 1
;;clojure ; java with a lisp
;;common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
;;data ; config/data formats
;;(dart +flutter) ; paint ui and not much else
;;dhall
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses
;;erlang ; an elegant language for a more civilized age
;;ess ; emacs speaks statistics
;;factor
;;faust ; dsp, but you get to keep your soul
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
;;fsharp ; ML stands for Microsoft's Language
;;fstar ; (dependent) types and (monadic) effects and Z3
;;gdscript ; the language you waited for
;;(go +lsp) ; the hipster dialect
(haskell +lsp) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
;;idris ; a language you can depend on
json ; At least it ain't XML
(java +lsp) ; the poster child for carpal tunnel syndrome
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB
kotlin ; a better, slicker Java(Script)
latex ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove
;;ledger ; be audit you can be
lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
(org +present) ; organize your plain life in plain text
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
python ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6
;;rest ; Emacs as a REST client
;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor
;;sml
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
web ; the tubes
yaml ; JSON, but readable
zig ; C, but simpler
:email
;;(mu4e +org +gmail)
;;notmuch
;;(wanderlust +gmail)
:app
;;calendar
;;emms
;;everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize
;;(rss +org) ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought
:config
;;literate
(default +bindings +smartparens))

View file

@ -0,0 +1,56 @@
;; -*- no-byte-compile: t; -*-
;;; $DOOMDIR/packages.el
;; To install a package with Doom you must declare them here and run 'doom sync'
;; on the command line, then restart Emacs for the changes to take effect -- or
;; use 'M-x doom/reload'.
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
;(package! some-package)
;; To install a package directly from a remote git repo, you must specify a
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
;; https://github.com/raxod502/straight.el#the-recipe-format
;(package! another-package
; :recipe (:host github :repo "username/repo"))
;; If the package you are trying to install does not contain a PACKAGENAME.el
;; file, or is located in a subdirectory of the repo, you'll need to specify
;; `:files' in the `:recipe':
;(package! this-package
; :recipe (:host github :repo "username/repo"
; :files ("some-file.el" "src/lisp/*.el")))
;; If you'd like to disable a package included with Doom, you can do so here
;; with the `:disable' property:
;(package! builtin-package :disable t)
;; You can override the recipe of a built in package without having to specify
;; all the properties for `:recipe'. These will inherit the rest of its recipe
;; from Doom or MELPA/ELPA/Emacsmirror:
;(package! builtin-package :recipe (:nonrecursive t))
;(package! builtin-package-2 :recipe (:repo "myfork/package"))
;; Specify a `:branch' to install a package from a particular branch or tag.
;; This is required for some packages whose default branch isn't 'master' (which
;; our package manager can't deal with; see raxod502/straight.el#279)
;(package! builtin-package :recipe (:branch "develop"))
;; Use `:pin' to specify a particular commit to install.
;(package! builtin-package :pin "1a2b3c4d5e")
;; Doom's packages are pinned to a specific commit and updated from release to
;; release. The `unpin!' macro allows you to unpin single packages...
;(unpin! pinned-package)
;; ...or multiple packages
;(unpin! pinned-package another-pinned-package)
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
;(unpin! t)
(package! evil-tutor)
(package! org-roam)
(package! platformio-mode)

View file

@ -0,0 +1,68 @@
{
config,
pkgs,
...
}: {
home.packages = with pkgs; [zsh-forgit gitflow];
programs.git = {
enable = true;
userName = "muon";
userEmail = "admin@muon.host";
ignores = [
".cache/"
".DS_Store"
".idea/"
"*.swp"
"*.elc"
"auto-save-list"
".direnv/"
"node_modules"
"result"
"result-*"
];
extraConfig = {
init = {defaultBranch = "main";};
delta = {
line-numbers = true;
};
branch.autosetupmerge = "true";
push.default = "current";
merge.stat = "true";
core.whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol";
repack.usedeltabaseoffset = "true";
pull.ff = "only";
rebase = {
autoSquash = true;
autoStash = true;
};
rerere = {
autoupdate = true;
enabled = true;
};
};
lfs.enable = true;
delta.enable = true;
aliases = {
co = "checkout";
c = "commit -m";
ca = "commit -am";
graph = "log --all --decorate --graph --oneline";
l = "log";
r = "rebase";
s = "status --short";
ss = "status";
d = "diff";
ps = "!git push origin $(git rev-parse --abbrev-ref HEAD)";
pl = "!git pull origin $(git rev-parse --abbrev-ref HEAD)";
af = "!git add $(git ls-files -m -o --exclude-standard | sk -m)";
st = "status";
br = "branch";
df = "!git hist | peco | awk '{print $2}' | xargs -I {} git diff {}^ {}";
hist = ''
log --pretty=format:"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)" --graph --date=relative --decorate --all'';
llog = ''
log --graph --name-status --pretty=format:"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset" --date=relative'';
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; hx `f`";
};
};
}

View file

@ -0,0 +1,177 @@
{
pkgs,
lib,
inputs,
...
}: {
programs.helix = {
enable = true;
settings = {
keys.normal = {
"C" = ["collapse_selection" "extend_to_line_end" "change_selection"];
"D" = ["extend_to_line_end" "delete_selection"];
"Y" = ["extend_to_line_bounds" "yank_main_selection_to_clipboard" "goto_line_start" "collapse_selection"];
"V" = ["select_mode" "extend_to_line_bounds"];
"{" = "goto_prev_paragraph";
"}" = "goto_next_paragraph";
"X" = "extend_line_above";
"esc" = ["collapse_selection" "keep_primary_selection"];
space.space = "file_picker";
space.w = ":w";
# space.q = ":bc";
"C-q" = ":xa";
space.u = {
f = ":format"; # format using LSP formatter
w = ":set whitespace.render all";
W = ":set whitespace.render none";
};
};
keys.select = {
"%" = "match_brackets";
};
editor = {
color-modes = true;
cursorline = true;
mouse = false;
idle-timeout = 1;
line-number = "relative";
scrolloff = 5;
completion-replace = true;
bufferline = "always";
true-color = true;
rulers = [80];
soft-wrap.enable = true;
indent-guides = {
render = true;
};
lsp = {
display-messages = true;
display-inlay-hints = true;
};
statusline = {
separator = "|";
left = ["mode" "selections" "spinner" "file-name" "total-line-numbers"];
center = [];
right = ["diagnostics" "file-encoding" "file-line-ending" "file-type" "position-percentage" "position"];
mode = {
normal = "NORMAL";
insert = "INSERT";
select = "SELECT";
};
};
whitespace.characters = {
space = "·";
nbsp = "";
tab = "";
newline = "";
};
cursor-shape = {
insert = "bar";
normal = "block";
select = "block";
};
};
};
languages = {
language = [
{
name = "bash";
auto-format = true;
formatter = {
command = "${pkgs.shfmt}/bin/shfmt";
args = ["-i" "2" "-"];
};
}
{
name = "html";
file-types = ["html" "tera"];
}
{
name = "clojure";
injection-regex = "(clojure|clj|edn|boot|yuck)";
file-types = ["clj" "cljs" "cljc" "clje" "cljr" "cljx" "edn" "boot" "yuck"];
}
{
name = "latex";
file-types = ["tex"];
config.texlab = {
build = {
forwardSearchAfter = true;
onSave = true;
};
chktex = {
onEdit = true;
};
forwardSearch = {
executable = "zathura";
args = [ "--synctex-forward" "%l:1:%f" "%p" ];
};
};
}
];
language-server = {
bash-language-server = {
command = "${pkgs.nodePackages.bash-language-server}/bin/bash-language-server";
args = ["start"];
};
clangd = {
command = "${pkgs.clang-tools}/bin/clangd";
clangd.fallbackFlags = ["-std=c++2b"];
};
nil = {
command = lib.getExe pkgs.nil;
config.nil.formatting.command = ["${lib.getExe pkgs.alejandra}" "-q"];
};
};
};
themes = {
ui.selection = {bg = "white"; modifiers = ["reversed"];};
ui.primary = {bg = "light-cyan"; modifiers = ["reversed"];};
};
};
home.packages = with pkgs; [
# some other lsp related packages / dev tools
typst
shellcheck
lldb
gopls
clang-tools
nodejs
guile
nim
zig
texlab
zls
jre8
gcc
uncrustify
black
shellcheck
gawk
haskellPackages.haskell-language-server
java-language-server
kotlin-language-server
nodePackages.vls
nodePackages.jsonlint
nodePackages.yarn
# Nix
alejandra
nil
# Rust
cargo
rust-analyzer
];
}

View file

@ -0,0 +1,192 @@
#!/usr/bin/env bash
# this is a simple config for herbstluftwm
hc() {
herbstclient "$@"
}
hc emit_hook reload
xsetroot -solid '#5A8E3A'
# remove all existing keybindings
hc keyunbind --all
# keybindings
# if you have a super key you will be much happier with Mod set to Mod4
#Mod=Mod1 # Use alt as the main modifier
Mod=Mod4 # Use the super key as the main modifier
hc keybind $Mod-Shift-e quit
hc keybind $Mod-Shift-r reload
hc keybind $Mod-Shift-q close
hc keybind $Mod-Return spawn "${TERMINAL:-alacritty}" # use your $TERMINAL with xterm as fallback
# basic movement in tiling and floating mode
# focusing clients
hc keybind $Mod-Left focus left
hc keybind $Mod-Down focus down
hc keybind $Mod-Up focus up
hc keybind $Mod-Right focus right
hc keybind $Mod-h focus left
hc keybind $Mod-j focus down
hc keybind $Mod-k focus up
hc keybind $Mod-l focus right
# moving clients in tiling and floating mode
hc keybind $Mod-Shift-Left shift left
hc keybind $Mod-Shift-Down shift down
hc keybind $Mod-Shift-Up shift up
hc keybind $Mod-Shift-Right shift right
hc keybind $Mod-Shift-h shift left
hc keybind $Mod-Shift-j shift down
hc keybind $Mod-Shift-k shift up
hc keybind $Mod-Shift-l shift right
# splitting frames
# create an empty frame at the specified direction
hc keybind $Mod-u split bottom 0.5
hc keybind $Mod-o split right 0.5
# let the current frame explode into subframes
hc keybind $Mod-Control-space split explode
# resizing frames and floating clients
resizestep=0.02
hc keybind $Mod-Control-h resize left +$resizestep
hc keybind $Mod-Control-j resize down +$resizestep
hc keybind $Mod-Control-k resize up +$resizestep
hc keybind $Mod-Control-l resize right +$resizestep
hc keybind $Mod-Control-Left resize left +$resizestep
hc keybind $Mod-Control-Down resize down +$resizestep
hc keybind $Mod-Control-Up resize up +$resizestep
hc keybind $Mod-Control-Right resize right +$resizestep
# tags
tag_names=({1..9})
tag_keys=({1..9} 0)
hc rename default "${tag_names[0]}" || true
for i in "${!tag_names[@]}"; do
hc add "${tag_names[$i]}"
key="${tag_keys[$i]}"
if [ -n "$key" ]; then
hc keybind "$Mod-$key" use_index "$i"
hc keybind "$Mod-Shift-$key" move_index "$i"
fi
done
# cycle through tags
hc keybind $Mod-period use_index +1 --skip-visible
hc keybind $Mod-comma use_index -1 --skip-visible
# layouting
hc keybind $Mod-r remove
hc keybind $Mod-s floating toggle
hc keybind $Mod-f fullscreen toggle
hc keybind $Mod-Shift-f set_attr clients.focus.floating toggle
hc keybind $Mod-Shift-d set_attr clients.focus.decorated toggle
hc keybind $Mod-Shift-m set_attr clients.focus.minimized true
hc keybind $Mod-Control-m jumpto last-minimized
hc keybind $Mod-p pseudotile toggle
# The following cycles through the available layouts within a frame, but skips
# layouts, if the layout change wouldn't affect the actual window positions.
# I.e. if there are two windows within a frame, the grid layout is skipped.
hc keybind $Mod-space \
or , and . compare tags.focus.curframe_wcount = 2 \
. cycle_layout +1 horizontal max vertical grid \
, cycle_layout +1
# mouse
hc mouseunbind --all
hc mousebind $Mod-Button1 move
hc mousebind $Mod-Button2 zoom
hc mousebind $Mod-Button3 resize
# focus
hc keybind $Mod-BackSpace cycle_monitor
hc keybind $Mod-Tab cycle_all +1
hc keybind $Mod-Shift-Tab cycle_all -1
hc keybind $Mod-c cycle
hc keybind $Mod-i jumpto urgent
# theme
hc attr theme.tiling.reset 1
hc attr theme.floating.reset 1
hc set frame_border_active_color '#222222cc'
hc set frame_border_normal_color '#101010cc'
hc set frame_bg_normal_color '#565656aa'
hc set frame_bg_active_color '#345F0Caa'
hc set frame_border_width 1
hc set show_frame_decorations 'focused_if_multiple'
hc set frame_bg_transparent on
hc set frame_transparent_width 5
hc set frame_gap 4
hc attr theme.title_height 0
hc attr theme.title_when never
hc attr theme.title_font 'Dejavu Sans:pixelsize=12' # example using Xft
# hc attr theme.title_font '-*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*'
hc attr theme.title_depth 3 # space below the title's baseline
hc attr theme.active.color '#345F0Cef'
hc attr theme.title_color '#ffffff'
hc attr theme.normal.color '#323232dd'
hc attr theme.urgent.color '#7811A1dd'
hc attr theme.tab_color '#1F1F1Fdd'
hc attr theme.active.tab_color '#2B4F0Add'
hc attr theme.active.tab_outer_color '#6C8257dd'
hc attr theme.active.tab_title_color '#ababab'
hc attr theme.normal.title_color '#898989'
hc attr theme.inner_width 1
hc attr theme.inner_color black
hc attr theme.border_width 1
hc attr theme.floating.border_width 1
hc attr theme.floating.outer_width 1
hc attr theme.floating.outer_color black
hc attr theme.active.inner_color '#789161'
hc attr theme.urgent.inner_color '#9A65B0'
hc attr theme.normal.inner_color '#606060'
# copy inner color to outer_color
for state in active urgent normal; do
hc substitute C theme.${state}.inner_color \
attr theme.${state}.outer_color C
done
hc attr theme.tiling.outer_width 1
hc attr theme.background_color '#141414'
hc set window_gap 0
hc set frame_padding 0
hc set smart_window_surroundings on
hc set smart_frame_surroundings on
hc set mouse_recenter_gap 0
# rules
hc unrule -F
#hc rule class=XTerm tag=3 # move all xterms to tag 3
hc rule focus=on # normally focus new clients
hc rule floatplacement=smart
#hc rule focus=off # normally do not focus new clients
# give focus to most common terminals
#hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' floating=on
hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)' manage=off
hc rule fixedsize floating=on
hc set tree_style '╾│ ├└╼─┐'
# unlock, just to be sure
hc unlock
# do multi monitor setup here, e.g.:
# hc set_monitors 1280x1024+0+0 1280x1024+1280+0
# or simply:
# hc detect_monitors
# find the panel
#panel=~/.config/herbstluftwm/panel.sh
#[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
#for monitor in $(hc list_monitors | cut -d: -f1) ; do
# # start it on each monitor
# "$panel" "$monitor" &
#done

View file

@ -0,0 +1,9 @@
{
config,
lib,
pkgs,
...
}:
{
home.file.".config/herbstluftwm/autostart".source = ./autostart;
}

View file

@ -0,0 +1,48 @@
{
config,
lib,
pkgs,
inputs,
...
}:
{
wayland.windowManager.hyprland = with lib; with pkgs; {
enable = true;
xwayland.enable = true;
nvidiaPatches = true;
recommendedEnvironment = true;
extraConfig = ''
monitor=,preferred,auto,1
input {
kb_layout = us
kb_variant =
kb_model =
kb_options = caps:escape
kb_rules =
follow_mouse = 1
touchpad {
natural_scroll = false
}
sensitivity = 0 # -1.0 - 1.0
}
bind = SUPER, Return, exec, ${getExe alacritty}
bind = SUPER, b, exec, ${getExe chromium}
'';
};
home.pointerCursor = {
name = "Adwaita";
package = pkgs.gnome.adwaita-icon-theme;
size = 24;
x11 = {
enable = true;
defaultCursor = "Adwaita";
};
};
}

View file

@ -0,0 +1,109 @@
{
config,
lib,
pkgs,
...
}:
{
xdg.configFile."leftwm/themes/current/theme.toml".source = ./theme.toml;
xdg.configFile."leftwm/themes/current/up".source = ./up;
xdg.configFile."leftwm/themes/current/down".source = ./down;
xdg.configFile."leftwm/config.ron".text = ''
#![enable(implicit_some)]
(
modkey: "Mod4",
mousekey: "Mod4",
workspaces: [],
tags: [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
],
max_window_width: None,
layouts: [
MainAndVertStack,
MainAndHorizontalStack,
MainAndDeck,
GridHorizontal,
EvenHorizontal,
EvenVertical,
Fibonacci,
LeftMain,
CenterMain,
CenterMainBalanced,
CenterMainFluid,
Monocle,
RightWiderLeftStack,
LeftWiderRightStack,
],
layout_mode: Tag,
insert_behavior: Bottom,
scratchpad: [
(name: "Alacritty", value: "alacritty", x: 860, y: 390, height: 300, width: 200),
],
window_rules: [],
disable_current_tag_swap: false,
disable_tile_drag: false,
disable_window_snap: true,
focus_behaviour: Sloppy,
focus_new_windows: true,
single_window_border: true,
sloppy_mouse_follows_focus: true,
auto_derive_workspaces: true,
keybind: [
(command: Execute, value: "dmenu_run", modifier: ["modkey"], key: "p"),
(command: Execute, value: "alacritty", modifier: ["modkey"], key: "Return"),
(command: CloseWindow, value: "", modifier: ["modkey", "Shift"], key: "q"),
(command: SoftReload, value: "", modifier: ["modkey", "Shift"], key: "r"),
(command: Execute, value: "loginctl kill-session $XDG_SESSION_ID", modifier: ["modkey", "Shift"], key: "x"),
(command: Execute, value: "slock", modifier: ["modkey", "Control"], key: "l"),
(command: MoveToLastWorkspace, value: "", modifier: ["modkey", "Shift"], key: "w"),
(command: SwapTags, value: "", modifier: ["modkey"], key: "w"),
(command: MoveWindowUp, value: "", modifier: ["modkey", "Shift"], key: "k"),
(command: MoveWindowDown, value: "", modifier: ["modkey", "Shift"], key: "j"),
(command: MoveWindowTop, value: "", modifier: ["modkey", "Shift"], key: "Return"),
(command: FocusWindowUp, value: "", modifier: ["modkey"], key: "k"),
(command: FocusWindowDown, value: "", modifier: ["modkey"], key: "j"),
(command: NextLayout, value: "", modifier: ["modkey", "Control"], key: "k"),
(command: PreviousLayout, value: "", modifier: ["modkey", "Control"], key: "j"),
(command: FocusWorkspaceNext, value: "", modifier: ["modkey"], key: "l"),
(command: FocusWorkspacePrevious, value: "", modifier: ["modkey"], key: "h"),
(command: MoveWindowUp, value: "", modifier: ["modkey", "Shift"], key: "Up"),
(command: MoveWindowDown, value: "", modifier: ["modkey", "Shift"], key: "Down"),
(command: FocusWindowUp, value: "", modifier: ["modkey"], key: "Up"),
(command: FocusWindowDown, value: "", modifier: ["modkey"], key: "Down"),
(command: NextLayout, value: "", modifier: ["modkey", "Control"], key: "Up"),
(command: PreviousLayout, value: "", modifier: ["modkey", "Control"], key: "Down"),
(command: FocusWorkspaceNext, value: "", modifier: ["modkey"], key: "Right"),
(command: FocusWorkspacePrevious, value: "", modifier: ["modkey"], key: "Left"),
(command: GotoTag, value: "1", modifier: ["modkey"], key: "1"),
(command: GotoTag, value: "2", modifier: ["modkey"], key: "2"),
(command: GotoTag, value: "3", modifier: ["modkey"], key: "3"),
(command: GotoTag, value: "4", modifier: ["modkey"], key: "4"),
(command: GotoTag, value: "5", modifier: ["modkey"], key: "5"),
(command: GotoTag, value: "6", modifier: ["modkey"], key: "6"),
(command: GotoTag, value: "7", modifier: ["modkey"], key: "7"),
(command: GotoTag, value: "8", modifier: ["modkey"], key: "8"),
(command: GotoTag, value: "9", modifier: ["modkey"], key: "9"),
(command: MoveToTag, value: "1", modifier: ["modkey", "Shift"], key: "1"),
(command: MoveToTag, value: "2", modifier: ["modkey", "Shift"], key: "2"),
(command: MoveToTag, value: "3", modifier: ["modkey", "Shift"], key: "3"),
(command: MoveToTag, value: "4", modifier: ["modkey", "Shift"], key: "4"),
(command: MoveToTag, value: "5", modifier: ["modkey", "Shift"], key: "5"),
(command: MoveToTag, value: "6", modifier: ["modkey", "Shift"], key: "6"),
(command: MoveToTag, value: "7", modifier: ["modkey", "Shift"], key: "7"),
(command: MoveToTag, value: "8", modifier: ["modkey", "Shift"], key: "8"),
(command: MoveToTag, value: "9", modifier: ["modkey", "Shift"], key: "9"),
],
state_path: None,
)
'';
}

6
modules/home/leftwm/down Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
SCRIPTPATH="$HOME/config/leftwm/themes/current"
leftwm-command "UnloadTheme"

View file

@ -0,0 +1,3 @@
border_width = 1
margin = 4
focused_border_color = "#2cb8b5"

13
modules/home/leftwm/up Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
export SCRIPTPATH="$HOME/.config/leftwm/themes/current"
#down the last running theme
if [ -f "/tmp/leftwm-theme-down" ]; then
/tmp/leftwm-theme-down
rm /tmp/leftwm-theme-down
fi
ln -s $SCRIPTPATH/down /tmp/leftwm-theme-down
#set the theme.toml config
leftwm-command "LoadTheme $SCRIPTPATH/theme.toml"

91
modules/home/packages.nix Normal file
View file

@ -0,0 +1,91 @@
{
inputs,
pkgs,
self,
config,
...
}: {
nixpkgs.config.allowUnfree = false;
home.packages = with pkgs; [
# system
wget
unzip
neovim
python3
dconf
libnotify
i3lock-fancy-rapid
pkg-config
alsa-utils
# cli
zellij
fd
glow
trash-cli
thefuck
xclip
fend
broot
unar
bottom
# gui
feh
rofi
dunst
yq
imagemagick
ungoogled-chromium
librewolf
mullvad-browser
tor-browser-bundle-bin
gimp
logseq
zotero
armcord
freetube
texstudio
texlive.combined.scheme-full
mpv
inkscape
dolphin
qgis
obs-studio
mumble
onionshare-gui
freetube
kotatogram-desktop
signal-desktop
# dev
psmisc
qmk
python311Packages.pip
cmake
texlab
# gaming
gamemode
gamehub
lutris
prismlauncher
airshipper
bottles
minigalaxy
cemu
mindustry
# media
ffmpeg
pulseaudio
playerctl
pavucontrol
pulsemixer
pamixer
alsa-utils
alsa-tools
cava
];
}

View file

@ -0,0 +1,41 @@
{
pkgs,
lib,
inputs,
...
}: {
programs.qutebrowser = {
enable = true;
settings = {
content.cookies.accept = "no-3rdparty";
url = {
default_page = "https://searx.be/";
start_pages = "https://searx.be/";
};
};
searchEngines = {
DEFAULT = "https://searx.be/?q={}";
};
extraConfig = ''
host = c.content.blocking.hosts.lists.append
host("https://www.github.developerdan.com/hosts/lists/facebook-extended.txt")
abp = c.content.blocking.adblock.lists.append
abp("https://fanboy.co.nz/r/fanboy-ultimate.txt")
abp("https://fanboy.co.nz/fanboy-antifacebook.txt")
abp("https://fanboy.co.nz/fanboy-annoyance.txt")
abp("https://fanboy.co.nz/fanboy-cookiemonster.txt")
abp("https://easylist-downloads.adblockplus.org/antiadblockfilters.txt")
abp("https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt")
abp("https://github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt")
abp("https://github.com/DandelionSprout/adfilt/raw/master/AnnoyancesList")
abp("https://github.com/DandelionSprout/adfilt/raw/master/SocialShareList.txt")
abp("https://github.com/DandelionSprout/adfilt/raw/master/ExtremelyCondensedList.txt")
'';
};
}

View file

@ -0,0 +1,137 @@
{
config,
lib,
pkgs,
...
}:
{
home.packages = with pkgs; [comma ripgrep];
home.sessionVariables.STARSHIP_CACHE = "${config.xdg.cacheHome}/starship";
programs = {
nix-index.enable = false;
exa.enable = true;
zoxide = {
enable = true;
enableZshIntegration = true;
};
dircolors = {
enable = true;
enableZshIntegration = true;
};
skim = {
enable = true;
enableZshIntegration = true;
defaultCommand = "rg --files --hidden";
changeDirWidgetOptions = [
"--preview 'exa --icons --git --color always -T -L 3 {} | head -200'"
"--exact"
];
};
starship = {
enable = true;
settings = {
add_newline = true;
scan_timeout = 1;
#character = {
#error_symbol = "[󰊠](bold red)";
#success_symbol = "[󰊠](bold green)";
#vicmd_symbol = "[󰊠](bold yellow)";
#format = "$symbol [|](bold bright-black) ";
#};
git_commit = {commit_hash_length = 4;};
line_break.disabled = false;
lua.symbol = "[](blue) ";
python.symbol = "[](blue) ";
hostname = {
ssh_only = true;
format = "[$hostname](bold blue) ";
disabled = false;
};
};
};
zsh = {
enable = true;
dotDir = ".config/zsh";
enableCompletion = true;
enableAutosuggestions = true;
syntaxHighlighting.enable = true;
initExtra = ''
autoload -U compinit
setopt no_auto_remove_slash
fuck () {
TF_PYTHONIOENCODING=$PYTHONIOENCODING;
export TF_SHELL=zsh;
export TF_ALIAS=fuck;
TF_SHELL_ALIASES=$(alias);
export TF_SHELL_ALIASES;
TF_HISTORY="$(fc -ln -10)";
export TF_HISTORY;
export PYTHONIOENCODING=utf-8;
TF_CMD=$(
thefuck THEFUCK_ARGUMENT_PLACEHOLDER $@
) && eval $TF_CMD;
unset TF_HISTORY;
export PYTHONIOENCODING=$TF_PYTHONIOENCODING;
test -n "$TF_CMD" && print -s $TF_CMD
}
'';
history = {
save = 2000000;
size = 2000000;
expireDuplicatesFirst = true;
ignoreDups = true;
ignoreSpace = true;
path = "$HOME/.local/state/zsh/history";
};
shellAliases = with pkgs; with lib; {
rebuild = "doas nix-store --verify; pushd ~/.config/dotfiles && doas nixos-rebuild switch --flake .# && notify-send \"Done\" && bat cache --build; popd";
update = "doas nix-store --verify; pushd ~/.config/dotfiles && doas nixos-rebuild switch --upgrade-all --flake .# && notify-send \"Done\" && bat cache --build; popd";
cleanup = "doas nix-collect-garbage --delete-older-than 7d";
bloat = "nix path-info -Sh /run/current-system";
cat = "${getExe bat} --style=plain";
vpn = getExe mullvad;
grep = getExe ripgrep;
fzf = getExe skim;
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
du = getExe du-dust;
ps = getExe procs;
m = "mkdir -p";
fcd = "cd $(find -type d | fzf)";
l = "ls -lF --time-style=long-iso --icons";
sc = "sudo systemctl";
scu = "systemctl --user ";
la = "${getExe exa} -lah";
ls = "${getExe exa} -h --git --icons --color=auto --group-directories-first -s extension";
tree = "${getExe exa} --tree --icons --tree";
burn = "pkill -9";
diff = "diff --color=auto";
".." = "cd ..";
"..." = "cd ../../";
"...." = "cd ../../../";
"....." = "cd ../../../../";
"......" = "cd ../../../../../";
v = "${getExe neovim}";
vim = "${getExe neovim}";
};
plugins = with pkgs; [
{
name = "zsh-vi-mode";
src = zsh-vi-mode;
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
}
];
};
};
}

View file

@ -0,0 +1,47 @@
{
config,
lib,
pkgs,
inputs,
stylix,
...
}:
let
theme-name = "mocha";
theme = "${pkgs.base16-schemes}/share/themes/${theme-name}.yaml";
wallpaper = pkgs.runCommand "image.png" {} ''
COLOR=$(${pkgs.yq}/bin/yq -r .base00 ${theme})
COLOR="#"$COLOR
${pkgs.imagemagick}/bin/magick convert -size 1920x1080 xc:$COLOR $out
'';
in {
stylix = {
image = wallpaper;
# polarity = "light";
# base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";
base16Scheme = theme;
fonts = {
monospace = {
package = pkgs.mononoki;
name = "Mononoki Nerd Font";
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
serif = config.stylix.fonts.monospace;
sansSerif = config.stylix.fonts.monospace;
};
};
services.random-background = {
enable = true;
imageDirectory = "${wallpaper}";
};
programs.zellij.enable = true;
programs.rofi.enable = true;
# config.services.xserver.desktopManager.wallpaper = ./wallpaper.jpg;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

View file

@ -0,0 +1,93 @@
{
pkgs,
lib,
config,
...
}: let
browser = ["chromium.desktop"];
associations = {
"text/html" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/ftp" = browser;
"x-scheme-handler/about" = browser;
"x-scheme-handler/unknown" = browser;
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;
"application/xhtml+xml" = browser;
"application/x-extension-xhtml" = browser;
"application/x-extension-xht" = browser;
"audio/*" = ["mpv.desktop"];
"video/*" = ["mpv.dekstop"];
"image/*" = ["imv.desktop"];
"application/json" = browser;
#"application/pdf" = ["org.pwmt.zathura.desktop.desktop"];
#"x-scheme-handler/tg" = ["telegramdesktop.desktop"];
#"x-scheme-handler/spotify" = ["spotify.desktop"];
#"x-scheme-handler/discord" = ["WebCord.desktop"];
};
texlive = pkgs.texlive.combine {
inherit
(pkgs.texlive)
scheme-small
noto
mweights
cm-super
cmbright
fontaxes
beamer
;
};
in {
# home.packages = [texlive];
services = {
gpg-agent = {
enable = true;
pinentryFlavor = "gnome3";
enableSshSupport = true;
enableZshIntegration = true;
};
};
programs = {
gpg.enable = true;
man.enable = true;
direnv = {
enable = true;
nix-direnv.enable = true;
};
tealdeer = {
enable = true;
settings = {
display = {
compact = false;
use_pager = true;
};
updates = {
auto_update = true;
};
};
};
bat.enable = true;
};
xdg = {
userDirs = {
enable = true;
documents = "$HOME/documents";
download = "$HOME/downloads";
videos = "$HOME/misc/videos";
music = "$HOME/misc/music";
pictures = "$HOME/misc/pictures";
desktop = "$HOME/misc/desktop";
publicShare = "$HOME/misc/public";
templates = "$HOME/misc/templates";
};
mimeApps.enable = true;
mimeApps.associations.added = associations;
mimeApps.defaultApplications = associations;
};
}

View file

@ -0,0 +1,165 @@
{
config,
lib,
pkgs,
...
}:
with config.lib.stylix.colors; {
xsession.windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
};
xsession.windowManager.xmonad.config =
pkgs.writeText "xmonad.hs" ''
import XMonad
import XMonad.Config.Desktop
import XMonad.Layout.ResizableTile
import XMonad.Layout.NoBorders
import XMonad.Layout.Gaps
import XMonad.Layout.Spacing
import XMonad.Layout.PerScreen
import XMonad.Util.EZConfig
import XMonad.Util.Ungrab
import XMonad.Util.Loggers
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP
import System.Exit
import qualified XMonad.StackSet as W
mobarStart = "xmobar ~/.config/xmobar/xmobarrc"
main :: IO()
main = xmonad
. ewmhFullscreen
. ewmh
. docks
. withEasySB mySB defToggleStrutsKey
$ myConfig
where
mySB = statusBarProp mobarStart (pure myXmobarPP)
myConfig = def
{ modMask = mod4Mask
, terminal = "alacritty"
-- Border
, borderWidth = 1
, normalBorderColor = "#${base03}"
, focusedBorderColor = "#${base0B}"
-- Hooks
, manageHook = myHook
-- , layoutHook = desktopLayoutModifiers $ smartBorders myLayout
, layoutHook = myLayout
-- , startupHook = myStartup
}
`additionalKeysP`
[ ("M-b", spawn "chromium")
, ("M-<Return>", spawn "alacritty")
, ("M-d", spawn "rofi -show drun")
-- Windows
, ("M-S-<Return>", windows W.swapMaster)
, ("M-S-q", kill)
, ("M-S-x", io (exitWith ExitSuccess))
-- Media keys
, ("<XF86AudioMute>", spawn "pamixer -t")
, ("<XF86AudioLowerVolume>", spawn "pamixer -d2")
, ("<XF86AudioRaiseVolume>", spawn "pamixer -i2")
]
myLayout = avoidStruts $ lessBorders Screen $ smartBorders $ tall ||| Full
where
addSpaces = spacingRaw True (Border 2 2 2 2) True (Border 2 2 2 2) True
-- addGaps = gaps [(U,10),(R,10),(L,10),(D,10)]
-- tall = ResizableTall 2 (1/10) 1 []
tall = ifWider 1280 (tiled) (Mirror tiled)
tiled = Tall nmaster delta ratio
nmaster = 1
ratio = 1/2
delta = 3/100
myHook :: ManageHook
myHook = composeAll
[ isDialog --> doFloat
, isFullscreen --> (doF W.focusDown <+> doFullFloat)
]
-- myStartup :: X ()
-- myStartup = do
-- spawn mobarStart
myXmobarPP :: PP
myXmobarPP = def
{ ppSep = magenta " "
, ppTitleSanitize = xmobarStrip
, ppCurrent = wrap " " "" . xmobarBorder "Top" "#${base0C}" 2
, ppHidden = white . wrap " " ""
, ppHiddenNoWindows = lowWhite . wrap " " ""
, ppUrgent = red . wrap (yellow "!") (yellow "!")
, ppOrder = \[ws, l, _, wins] -> [ws, l, wins]
, ppExtras = [logTitles formatFocused formatUnfocused]
}
where
formatFocused = wrap (white "[") (white "]") . magenta . ppWindow
formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow
-- | Windows should have *some* title, which should not not exceed a
-- sane length.
ppWindow :: String -> String
ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30
blue, lowWhite, magenta, red, white, yellow :: String -> String
magenta = xmobarColor "#${base0E}" ""
blue = xmobarColor "#${base0D}" ""
white = xmobarColor "#${base05}" ""
yellow = xmobarColor "#${base0A}" ""
red = xmobarColor "#${base08}" ""
lowWhite = xmobarColor "#${base04}" ""
'';
programs.xmobar.enable = true;
programs.xmobar.extraConfig = ''
Config
{ overrideRedirect = False
, font = "Mononoki"
, bgColor = "#${base00}"
, fgColor = "#${base05}"
, position = BottomH 20
, lowerOnStart = True
, commands =
[ Run Cpu
[ "-L", "3"
, "-H", "50"
, "--high" , "red"
, "--normal", "green"
] 10
, Run Alsa "default" "Master"
[ "--template", "Vol: <volumestatus>"
, "--suffix" , "True"
, "--"
, "--on", ""
]
, Run Memory ["--template", "Mem: <usedratio>%"] 10
, Run Swap [] 10
, Run Date "%Y-%m-%d %a <fc=#${base0C}>%H:%M:%S</fc>" "date" 1
, Run XMonadLog
]
, sepChar = "%"
, alignSep = "}{"
, template = "%XMonadLog% }{ %cpu% | %memory% | %swap% | %date% "
}
'';
}