finished flake

dev-docs
Moritz Böhme 2021-09-09 21:55:28 +02:00
parent d0522cb15c
commit 84f303eed6
21 changed files with 1540 additions and 149 deletions

View File

@ -12,7 +12,7 @@
};
};
outputs = inputs@{ self, utils, home-manager, ...}:
outputs = inputs@{ self, utils, home-manager, nixpkgs, ...}:
utils.lib.mkFlake {
inherit self inputs;
@ -23,6 +23,10 @@
hostDefaults.modules = [
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
./modules
];

31
modules/bspwm/bspwmrc Executable file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env bash
# MONITORS #
if [[ "$(uname -n)" == *'desktop'* ]]; then
bspc monitor HDMI-0 -d 1 2 3 4 5
bspc monitor HDMI-1 -d 6 7 8 9 10
else
bspc monitor -d 1 2 3 4 5 6 7 8 9
fi
# CONFIGURATION #
bspc config border_width 2
bspc config window_gap 5
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config focus_follows_pointer true
# Dracula theme #
bspc config focused_border_color "#bd93f9"
# WINDOW RULES #
bspc rule -a Steam state=tiled
bspc rule -a Zathura state=tiled
bspc rule -a Emacs state=tiled
# AUTOSTART #
[[ ! $(pidof -x sxhkd) ]] && sxhkd &
feh --bg-fill ~/.dotfiles/config/wallpaper/base.png
systemctl --user start polybar

25
modules/bspwm/default.nix Normal file
View File

@ -0,0 +1,25 @@
{ config, lib, pkgs, ... }:
let
base = {
xdg = {
enable = true;
configFile = {
"bspwm/bspwmrc" = {
source = ./bspwmrc;
onChange = "bspc wm -r";
};
"sxhkd/sxhkdrc" = {
source = ./sxhkdrc;
onChange = "pkill -USR1 -x sxhkd";
};
};
};
home.packages = with pkgs; [
feh
];
};
in
{
home-manager.users.moritz = {...}: (base);
}

171
modules/bspwm/sxhkdrc Executable file
View File

@ -0,0 +1,171 @@
#
# wm independent hotkeys
#
# terminal emulator
super + Return
kitty
# program launcher
super + d
rofi -show combi
# make sxhkd reload its configuration files:
alt + shift + c
pkill -USR1 -x sxhkd
# Show help
super + h
~/bin/sxhkd-help
#
# bspwm hotkeys
#
# quit/restart bspwm
alt + shift + {e,r}
bspc {quit,wm -r}
# close and kill
alt + {_,shift + }q
bspc node -{c,k}
# alternate between the tiled and monocle layout
alt + m
bspc desktop -l next
# send the newest marked node to the newest preselected node
super + y
bspc node newest.marked.local -n newest.!automatic.local
# swap the current node and the biggest node
super + g
bspc node -s biggest
# Rotate tree
super + shift + {d,a}
bspc node @/ -C {forward,backward}
#
# state/flags
#
# set the window state
alt + {t,shift + t,s,f}
bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
# set the node flags
super + ctrl + {m,x,y,z}
bspc node -g {marked,locked,sticky,private}
#
# focus/swap
#
# focus the node in the given direction
alt + {_,shift + }{h,j,k,l}
bspc node -{f,s} {west,south,north,east}
# focus the node for the given path jump
alt + {p,b,comma,period}
bspc node -f @{parent,brother,first,second}
# focus the next/previous node in the current desktop
alt + {_,shift + }c
bspc node -f {next,prev}.local
# focus the next/previous desktop in the current monitor
alt + {w,q}
bspc desktop -f {prev,next}.local
# focus the last node/desktop
alt + {grave,Tab}
bspc {node,desktop} -f last
# focus the older or newer node in the focus history
super + {o,i}
bspc wm -h off; \
bspc node {older,newer} -f; \
bspc wm -h on
# focus or send to the given desktop
alt + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} '{1-9,10}'
#
# preselect
#
# preselect the direction
super + ctrl + {h,j,k,l}
bspc node -p {west,south,north,east}
# preselect the ratio
super + ctrl + {1-9}
bspc node -o 0.{1-9}
# cancel the preselection for the focused node
super + ctrl + space
bspc node -p cancel
# cancel the preselection for the focused desktop
super + ctrl + shift + space
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
#
# move/resize
#
# expand a window by moving one of its side outward
alt + ctrl + {h,j,k,l}
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
# contract a window by moving one of its side inward
super + alt + shift + {h,j,k,l}
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
# move a floating window
alt + {Left,Down,Up,Right}
bspc node -v {-20 0,0 20,0 -20,20 0}
XF86AudioRaiseVolume
pactl set-sink-volume @DEFAULT_SINK@ +5%
XF86AudioLowerVolume
pactl set-sink-volume @DEFAULT_SINK@ -5%
XF86AudioMute
pactl set-sink-mute @DEFAULT_SINK@ toggle
XF86AudioPlay
playerctl -p "spotify,firefox" play-pause
XF86AudioNext
playerctl -p "spotify,firefox" next
XF86AudioPrev
playerctl -p "spotify,firefox" previous
XF86MonBrightnessDown
xbacklight -dec 16
XF86MonBrightnessUp
xbacklight -inc 16
# Take a screenshot
Print
flameshot gui
#
# Favourite Progamms
#
# start firefox
super + {_,shift} +f
firefox {_,--private-window}
# start Networkmanager dmenu
super + w
networkmanager_dmenu
# start rofi-bluetooth
super + b
rofi-bluetooth
# start rofi-calc
super + c
rofi -show calc -modi calc -no-show-match -no-sort | xclip -selection clipboard
# start emacs
super + e
emacsclient -c -a emacs

View File

@ -1,148 +1,39 @@
{ config, pkgs, ... }:
{ lib, pkgs, ... }:
{
imports = [
./bspwm
./dunst
./emacs
./polybar
./git.nix
./kitty.nix
./picom.nix
./rofi.nix
./zathura.nix
./zsh.nix
];
home-manager.users.moritz = {
# Let Home Manager install and manage itself.
#programs.home-manager.enable = true;
programs.home-manager.enable = true;
# paths it should manage.
home.username = "moritz";
home.homeDirectory = "/home/moritz";
programs = {
git = {
enable = true;
userName = "MoritzBoehme";
userEmail = "mr.x@moritzboeh.me";
};
zathura = {
enable = true;
options = {
recolor = true;
completion-bg = "#282a36";
completion-fg = "#ff79c6";
default-bg = "#44475a";
default-fg = "#bd93f9";
inputbar-bg = "#282a36";
inputbar-fg = "#8be9fd";
statusbar-bg = "#282a36";
statusbar-fg = "#bd93f9";
font = "Jetbrains Mono 9";
recolor-lightcolor = "#282a36";
recolor-darkcolor = "#f8f8f2";
};
};
zsh = {
enable = true;
shellGlobalAliases = {
ls = "exa -lh";
cat = "bat";
};
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
};
kitty = {
enable = true;
settings = {
scrollback_lines = 10000;
enable_audio_bell = false;
cursor_shape = "underline";
};
extraConfig = builtins.readFile ~/.dotfiles/config/kitty/dracula.conf;
font = {
name = "FiraCode Nerd Font";
size = 10;
};
};
exa.enable = true;
bat.enable = true;
starship = {
enable = true;
enableZshIntegration = true;
};
rofi = {
enable = true;
theme = ~/.dotfiles/config/rofi/dracula_old.rasi;
};
emacs.enable = true;
};
xdg = {
enable = true;
configFile = {
"sxhkd/sxhkdrc" = {
source = ~/.dotfiles/config/sxhkd/sxhkdrc;
onChange = "pkill -USR1 -x sxhkd";
};
"bspwm/bspwmrc" = {
source = ~/.dotfiles/config/bspwm/bspwmrc;
onChange = "bspc wm -r";
};
"doom" = {
source = ~/.dotfiles/config/doom;
recursive = true;
onChange = builtins.readFile ~/.dotfiles/config/doom/reload.sh;
};
"dunst/dunstrc" = {
source = ~/.dotfiles/config/dunst/dunstrc;
};
};
};
services = {
polybar = {
enable = true;
script = ''for m in $(polybar --list-monitors | ${pkgs.coreutils}/bin/cut -d":" -f1); do
MONITOR=$m polybar --reload bottom &
done
'';
config = ~/.dotfiles/config/polybar/config.ini;
extraConfig = builtins.readFile ~/.dotfiles/config/polybar/modules.ini +
builtins.readFile ~/.dotfiles/config/polybar/colors.ini;
};
picom = {
enable = true;
inactiveOpacity = "0.95";
opacityRule = [
"100:fullscreen"
"80 :class_g = 'Polybar'"
];
blur = true;
inactiveDim = "0.1";
};
emacs = {
enable = true;
package = pkgs.emacsUnstable;
};
dunst.enable = true;
kdeconnect.enable = true;
};
home.packages = with pkgs; [
neofetch
feh
keepassxc
];
nixpkgs.overlays = [
(import (builtins.fetchTarball {
url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
}))
];
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
@ -152,4 +43,5 @@
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "21.05";
};
}

16
modules/dunst/default.nix Normal file
View File

@ -0,0 +1,16 @@
{ config, lib, pkgs, ... }:
let
base = {
xdg = {
enable = true;
configFile."dunt/dunstrc" = {
source = ./dunstrc;
};
};
services.dunst.enable = true;
};
in
{
home-manager.users.moritz = {...}: (base);
}

31
modules/emacs/default.nix Normal file
View File

@ -0,0 +1,31 @@
{ config, lib, pkgs, ... }:
let
base = {
programs.emacs.enable = true;
services.emacs.enable = true;
xdg = {
enable = true;
configFile = {
"doom" = {
source = ~/doom;
recursive = true;
onChange = ''
#!/bin/sh
DOOM="$HOME/.emacs.d"
if [ ! -d "$DOOM" ]; then
git clone https://github.com/hlissner/doom-emacs.git "$DOOM"
"$DOOM/bin/doom" -y install
fi
"$DOOM/bin/doom" sync
'';
};
};
};
};
in
{
home-manager.users.moritz = {...}: (base);
}

View File

@ -0,0 +1,93 @@
;;; $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 "Moritz Böhme"
user-mail-address "mail@moritzboeh.me")
;; 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))
;; 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-dracula)
;; 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)
;; 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.
;; Set FiraCode as Font
(setq doom-font (font-spec :family "FiraCode Nerd Font" :size 13) )
(setq ispell-dictionary "english")
;; Switch Flyspell Dictionary
(defun fd-switch-dictionary()
(interactive)
(let* ((dic ispell-current-dictionary)
(change (if (string= dic "deutsch") "english" "deutsch")))
(ispell-change-dictionary change)
(message "Dictionary switched from %s to %s" dic change)
))
(global-set-key (kbd "<f8>") 'fd-switch-dictionary)
(add-to-list 'auto-mode-alist '("\\.pl\\'" . prolog-mode))
(setq org-roam-directory "~/org-roam")
(after! org-roam
:custom
(setq org-roam-capture-templates
'(
("d" "default" plain
"%?"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t)
("s" "semester" plain (file "~/org-roam/templates/semester-template.org")
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t)
("m" "modul" plain (file "~/org-roam/templates/modul-template.org")
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t)
("D" "dozent" plain (file "~/org-roam/templates/dozent-template.org")
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t)
)
)
)

View File

@ -0,0 +1,13 @@
(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.
'(org-agenda-files
'("/home/moritz/Documents/org/wochen" "/home/moritz/Documents/org/")))
(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.
)

188
modules/emacs/doom/init.el Normal file
View File

@ -0,0 +1,188 @@
;;; 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 ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
ivy ; a search engine for love and life
: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) ; 🙂
;;fill-column ; a `fill-column' indicator
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
;;indent-guides ; highlighted indent columns
ligatures ; 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
;;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
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
;;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
;;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 +dante) ; 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 +meghanada) ; 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 +roam2) ; 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 ; 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 +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,54 @@
;; -*- 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! ligatures
:recipe (:host github :repo "mickeynp/ligature.el"))

14
modules/git.nix Normal file
View File

@ -0,0 +1,14 @@
{ config, lib, pkgs, ... }:
let
base = (home: {
programs.git = {
enable = true;
userName = "MoritzBoehme";
userEmail = "mr.x@moritzboeh.me";
};
});
in
{
home-manager.users.moritz = {...}: (base "/home/moritz");
}

73
modules/kitty.nix Normal file
View File

@ -0,0 +1,73 @@
{ config, lib, pkgs, ... }:
let
base = {
programs.kitty = {
enable = true;
settings = {
scrollback_lines = 10000;
enable_audio_bell = false;
cursor_shape = "underline";
};
# extraConfig = builtins.readFile ~/.dotfiles/config/kitty/dracula.conf;
extraConfig = ''
foreground #f8f8f2
background #282a36
#background #000000
selection_foreground #44475a
selection_background #f8f8f2
url_color #ffb86c
# black
color0 #21222c
color8 #6272a4
# red
color1 #ff5555
color9 #ff6e6e
# green
color2 #50fa7b
color10 #69ff94
# yellow
color3 #f1fa8c
color11 #ffffa5
# blue
color4 #bd93f9
color12 #d6acff
# magenta
color5 #ff79c6
color13 #ff92df
# cyan
color6 #8be9fd
color14 #a4ffff
# white
color7 #f8f8f2
color15 #ffffff
# Cursor colors
cursor #6272a4
cursor_text_color background
# Tab bar colors
active_tab_foreground #44475a
active_tab_background #f8f8f2
inactive_tab_foreground #282a36
inactive_tab_background #6272a4
'';
font = {
name = "FiraCode Nerd Font";
size = 10;
};
};
};
in
{
home-manager.users.moritz = {...}: (base);
}

19
modules/picom.nix Normal file
View File

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
let
base = {
services.picom = {
enable = true;
inactiveOpacity = "0.95";
opacityRule = [
"100:fullscreen"
"80 :class_g = 'Polybar'"
];
blur = true;
inactiveDim = "0.1";
};
};
in
{
home-manager.users.moritz = {...}: (base);
}

18
modules/polybar/colors.ini Executable file
View File

@ -0,0 +1,18 @@
[colors]
background = #282a36
current-line = #44475a
foreground = #f8f8f2
comment = #6272a4
cyan = #8be9fd
green = #50fa7b
orange = #ffb86c
pink = #ff79c6
purple = #bd93f9
red = #ff5555
yellow = #f1fa8c
foreground-alt = ${self.foreground}
background-alt = #1E2029
primary = ${self.pink}
secondary = ${self.green}

281
modules/polybar/config.ini Executable file
View File

@ -0,0 +1,281 @@
; Global WM Settings
[global/wm]
; Adjust the _NET_WM_STRUT_PARTIAL top value
; Used for top aligned bars
margin-bottom = 0
; Adjust the _NET_WM_STRUT_PARTIAL bottom value
; Used for bottom aligned bars
margin-top = 0
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
;; File Inclusion
; include an external file, like module file, etc.
#include-file = ~/.config/polybar/colors.ini
#include-file = ~/.config/polybar/modules.ini
#include-file = ~/.config/polybar/custom/modules.ini
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
[bar/bottom]
; Use either of the following command to list available outputs:
; If unspecified, the application will pick the first one it finds.
; $ polybar -m | cut -d ':' -f 1
; $ xrandr -q | grep " connected" | cut -d ' ' -f1
monitor = ${env:MONITOR}
; Use the specified monitor as a fallback if the main one is not found.
monitor-fallback =
; Require the monitor to be in connected state
; XRandR sometimes reports my monitor as being disconnected (when in use)
monitor-strict = false
; Tell the Window Manager not to configure the window.
; Use this to detach the bar if your WM is locking its size/position.
override-redirect = false
; Put the bar at the bottom of the screen
bottom = true
; Prefer fixed center position for the `modules-center` block
; When false, the center position will be based on the size of the other blocks.
fixed-center = true
; Dimension defined as pixel value (e.g. 35) or percentage (e.g. 50%),
; the percentage can optionally be extended with a pixel offset like so:
; 50%:-10, this will result in a width or height of 50% minus 10 pixels
width = 100%
height = 25
; Offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
; the percentage can optionally be extended with a pixel offset like so:
; 50%:-10, this will result in an offset in the x or y direction
; of 50% minus 10 pixels
offset-x = 0%
offset-y = 0%
; Background ARGB color (e.g. #f00, #ff992a, #ddff1023)
background = ${colors.background-alt}
; Foreground ARGB color (e.g. #f00, #ff992a, #ddff1023)
foreground = ${colors.foreground}
; Background gradient (vertical steps)
; background-[0-9]+ = #aarrggbb
;;background-0 =
; Value used for drawing rounded corners
; Note: This shouldn't be used together with border-size because the border
; doesn't get rounded
; Individual top/bottom values can be defined using:
; radius-{top,bottom}
radius-top = 0.0
radius-bottom = 0.0
; Under-/overline pixel size and argb color
; Individual values can be defined using:
; {overline,underline}-size
; {overline,underline}-color
line-size = 3
line-color = ${colors.pink}
; Values applied to all borders
; Individual side values can be defined using:
; border-{left,top,right,bottom}-size
; border-{left,top,right,bottom}-color
; The top and bottom borders are added to the bar height, so the effective
; window height is:
; height + border-top-size + border-bottom-size
; Meanwhile the effective window width is defined entirely by the width key and
; the border is placed withing this area. So you effectively only have the
; following horizontal space on the bar:
; width - border-right-size - border-left-size
border-size = 0
border-bottom-color = ${colors.pink}
; Number of spaces to add at the beginning/end of the bar
; Individual side values can be defined using:
; padding-{left,right}
padding-left = 1
padding-right = 1
; Number of spaces to add before/after each module
; Individual side values can be defined using:
; module-margin-{left,right}
module-margin-left = 1
module-margin-right = 1
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
; Fonts are defined using <font-name>;<vertical-offset>
; Font names are specified using a fontconfig pattern.
; font-0 = NotoSans-Regular:size=8;2
; font-1 = MaterialIcons:size=10
; font-2 = Termsynu:size=8;-1
; font-3 = FontAwesome:size=10
; See the Fonts wiki page for more details
font-0 = "FiraCode Nerd Font:size=11;0"
; Modules are added to one of the available blocks
; modules-left = cpu ram
; modules-center = xwindow xbacklight
; modules-right = ipc clock
modules-left = cpu memory wlan eth battery
modules-center = bspwm
modules-right = pulseaudio date powermenu
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
; The separator will be inserted between the output of each module
separator =
; Opacity value between 0.0 and 1.0 used on fade in/out
dim-value = 1.0
; Value to be used to set the WM_NAME atom
; If the value is empty or undefined, the atom value
; will be created from the following template: polybar-[BAR]_[MONITOR]
; NOTE: The placeholders are not available for custom values
wm-name =
; Locale used to localize various module data (e.g. date)
; Expects a valid libc locale, for example: sv_SE.UTF-8
locale =
; Position of the system tray window
; If empty or undefined, tray support will be disabled
; NOTE: A center aligned tray will cover center aligned modules
;
; Available positions:
; left
; center
; right
; none
tray-position = right
; If true, the bar will not shift its
; contents when the tray changes
tray-detached = false
; Tray icon max size
tray-maxsize = 16
; Background color for the tray container
; ARGB color (e.g. #f00, #ff992a, #ddff1023)
; By default the tray container will use the bar
; background color.
tray-background = ${colors.background-alt}
; Tray offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
tray-offset-x = 0
tray-offset-y = 0
; Pad the sides of each tray icon
tray-padding = 2
; Scale factor for tray clients
tray-scale = 1.0
; Restack the bar window and put it above the
; selected window manager's root
;
; Fixes the issue where the bar is being drawn
; on top of fullscreen window's
;
; Currently supported WM's:
; bspwm
; i3 (requires: `override-redirect = true`)
wm-restack = bspwm
; Set a DPI values used when rendering text
; This only affects scalable fonts
; dpi =
; Enable support for inter-process messaging
; See the Messaging wiki page for more details.
enable-ipc = true
; Fallback click handlers that will be called if
; there's no matching module handler found.
click-left =
click-middle =
click-right =
scroll-up =
scroll-down =
double-click-left =
double-click-middle =
double-click-right =
; Requires polybar to be built with xcursor support (xcb-util-cursor)
; Possible values are:
; - default : The default pointer as before, can also be an empty string (default)
; - pointer : Typically in the form of a hand
; - ns-resize : Up and down arrows, can be used to indicate scrolling
cursor-click = pointer
cursor-scroll = ns-resize
;; WM Workspace Specific
; bspwm
;;scroll-up = #bspwm.next
;;scroll-down = #bspwm.prev
;;scroll-up = bspc desktop -f prev.local
;;scroll-down = bspc desktop -f next.local
;i3
;;scroll-up = i3wm-wsnext
;;scroll-down = i3wm-wsprev
;;scroll-up = i3-msg workspace next_on_output
;;scroll-down = i3-msg workspace prev_on_output
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
;; Application Settings
[settings]
; The throttle settings lets the eventloop swallow up til X events
; if they happen within Y millisecond after first event was received.
; This is done to prevent flood of update event.
;
; For example if 5 modules emit an update event at the same time, we really
; just care about the last one. But if we wait too long for events to swallow
; the bar would appear sluggish so we continue if timeout
; expires or limit is reached.
throttle-output = 5
throttle-output-for = 10
; Time in milliseconds that the input handler will wait between processing events
;throttle-input-for = 30
; Reload upon receiving XCB_RANDR_SCREEN_CHANGE_NOTIFY events
screenchange-reload = true
; Compositing operators
; @see: https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-operator-t
;;compositing-background = source
;;compositing-foreground = over
;;compositing-overline = over
;;compositing-underline = over
;;compositing-border = over
; Define fallback values used by all module formats
;format-foreground =
;format-background =
;format-underline =
;format-overline =
;format-spacing =
;format-padding =
;format-margin =
;format-offset =
; Enables pseudo-transparency for the bar
; If set to true the bar can be transparent without a compositor.
pseudo-transparency = false
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

View File

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
let
base = {
services.polybar = {
enable = true;
script = ''for m in $(polybar --list-monitors | ${pkgs.coreutils}/bin/cut -d":" -f1); do
MONITOR=$m polybar --reload bottom &
done
'';
config = ./config.ini;
extraConfig = builtins.readFile ./modules.ini +
builtins.readFile ./colors.ini;
};
};
in
{
home-manager.users.moritz = {...}: (base);
}

224
modules/polybar/modules.ini Executable file
View File

@ -0,0 +1,224 @@
[module/battery]
type= internal/battery
battery= BATT
adapter= ACAD
; see "man date" for details on how to format the time string
; NOTE: if you want to use syntax tags here you need to use %%{...}
; Default: %H:%M:%S
time-format = %H:%M
; Available tags:
; <label-charging> (default)
; <bar-capacity>
; <ramp-capacity>
; <animation-charging>
format-charging = <animation-charging> <label-charging>
format-charging-underline = ${colors.green}
; Available tags:
; <label-discharging> (default)
; <bar-capacity>
; <ramp-capacity>
; <animation-discharging>
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${colors.red}
; Available tags:
; <label-full> (default)
; <bar-capacity>
; <ramp-capacity>
format-full = <label-full>
format-full-underline = ${colors.green}
; Available tokens:
; %percentage% (default) - is set to 100 if full-at is reached
; %percentage_raw%
; %time%
; %consumption% (shows current charge rate in watts)
label-charging = %percentage%% %time% remaining
; Available tokens:
; %percentage% (default) - is set to 100 if full-at is reached
; %percentage_raw%
; %time%
; %consumption% (shows current discharge rate in watts)
label-discharging = %percentage%% %time% remaining
; Available tokens:
; %percentage% (default) - is set to 100 if full-at is reached
; %percentage_raw%
label-full = Fully charged
; Only applies if <ramp-capacity> is used
ramp-capacity-0 =
ramp-capacity-1 =
ramp-capacity-2 =
ramp-capacity-3 =
ramp-capacity-4 =
; Only applies if <bar-capacity> is used
bar-capacity-width = 10
; Only applies if <animation-charging> is used
animation-charging-0 =
animation-charging-1 =
animation-charging-2 =
animation-charging-3 =
animation-charging-4 =
; Framerate in milliseconds
animation-charging-framerate = 750
; Only applies if <animation-discharging> is used
animation-discharging-0 =
animation-discharging-1 =
animation-discharging-2 =
animation-discharging-3 =
animation-discharging-4 =
; Framerate in milliseconds
animation-discharging-framerate = 500
[module/bspwm]
type = internal/bspwm
reverse-scroll = false
label-focused =
label-focused-foreground = ${colors.purple}
label-focused-padding = 1
label-occupied =
label-occupied-foreground = ${colors.comment}
label-occupied-padding = 1
label-urgent =
label-urgent-foreground = ${colors.red}
label-urgent-padding = 1
label-empty =
label-empty-foreground = ${colors.comment}
; label-empty-background = ${colors.pink}
label-empty-padding = 1
label-separator = " "
label-separator-foreground = ${colors.cyan}
label-separator-padding = 1
pin-workspaces = true
[module/cpu]
type = internal/cpu
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.red}
format-underline = ${colors.red}
label = %percentage:2%%
[module/date]
type = internal/date
interval = 5
date = "%A"
date-alt = " %Y-%m-%d"
time = %H:%M
time-alt = %H:%M:%S
format-underline = ${colors.purple}
label = %date% %time%
[module/eth]
type = internal/network
interface = enp42s0
interval = 3.0
format-connected-underline = ${colors.purple}
label-connected = "%upspeed% %downspeed%"
[module/memory]
type = internal/memory
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.green}
format-underline = ${colors.green}
label = %percentage_used%%
click-left=kitty bpytop
[module/powermenu]
type = custom/menu
expand-right = false
format-spacing = 1
label-open = ""
label-open-foreground = ${colors.orange}
label-close = ""
label-close-foreground = ${colors.red}
label-separator = |
label-separator-foreground = ${colors.cyan}
menu-0-0 = " "
menu-0-0-exec = #powermenu.open.1
menu-0-1 = " "
menu-0-1-exec = #powermenu.open.2
menu-0-2 = " "
menu-0-2-exec = #powermenu.open.3
menu-1-0 = " "
menu-1-0-exec = systemctl reboot
menu-2-0 = " "
menu-2-0-exec = systemctl poweroff
menu-3-0 = " "
menu-3-0-exec = systemctl hibernate
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <label-volume> <bar-volume>
label-volume = %percentage%%
label-volume-foreground = ${colors.foreground}
label-muted = " muted"
label-muted-foreground = ${colors.foreground-alt}
bar-volume-width = 12
bar-volume-foreground-0 = ${colors.green}
bar-volume-foreground-1 = ${colors.green}
bar-volume-foreground-2 = ${colors.green}
bar-volume-foreground-3 = ${colors.green}
bar-volume-foreground-4 = ${colors.green}
bar-volume-foreground-5 = ${colors.orange}
bar-volume-foreground-6 = ${colors.orange}
bar-volume-foreground-7 = ${colors.orange}
bar-volume-foreground-8 = ${colors.red}
bar-volume-gradient = true
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = -
bar-volume-fill-font = 2
bar-volume-empty = -
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground}
click-middle=pavucontrol
click-right=~/bin/cycle_sinks.sh
[module/wlan]
type = internal/network
interface = wlp1s0
interval = 3.0
format-connected-underline = ${colors.purple}
label-connected = "%upspeed% %downspeed%"
[module/xwindow]
type = internal/xwindow
format = <label>
label = %title:0:30:...%
format-underline = ${colors.orange}

150
modules/rofi.nix Normal file
View File

@ -0,0 +1,150 @@
{ config, lib, pkgs, ... }:
let
base = (home: {
programs.rofi = {
enable = true;
# theme = ~/.dotfiles/config/rofi/dracula_old.rasi;
theme = ''
* {
/* Dracula theme colour palette */
drac-bgd: #282a36;
drac-cur: #44475a;
drac-fgd: #f8f8f2;
drac-cmt: #6272a4;
drac-cya: #8be9fd;
drac-grn: #50fa7b;
drac-ora: #ffb86c;
drac-pnk: #ff79c6;
drac-pur: #bd93f9;
drac-red: #ff5555;
drac-yel: #f1fa8c;
font: "FiraCode Nerd Font 14";
foreground: @drac-fgd;
background-color: @drac-bgd;
active-background: @drac-pnk;
urgent-background: @drac-red;
selected-background: @active-background;
selected-urgent-background: @urgent-background;
selected-active-background: @active-background;
separatorcolor: @active-background;
bordercolor: #6272a4;
}
#window {
background-color: @background;
border: 3;
border-radius: 6;
border-color: @bordercolor;
padding: 25;
}
#mainbox {
border: 0;
padding: 5;
}
#message {
border: 1px dash 0px 0px ;
border-color: @separatorcolor;
padding: 1px ;
}
#textbox {
text-color: @foreground;
}
#listview {
fixed-height: 0;
border: 2px dash 0px 0px ;
border-color: @bordercolor;
spacing: 2px ;
scrollbar: false;
padding: 2px 0px 0px ;
}
#element {
border: 0;
padding: 1px ;
}
#element.normal.normal {
background-color: @background;
text-color: @foreground;
}
#element.normal.urgent {
background-color: @urgent-background;
text-color: @urgent-foreground;
}
#element.normal.active {
background-color: @active-background;
text-color: @background;
}
#element.selected.normal {
background-color: @selected-background;
text-color: @foreground;
}
#element.selected.urgent {
background-color: @selected-urgent-background;
text-color: @foreground;
}
#element.selected.active {
background-color: @selected-active-background;
text-color: @background;
}
#element.alternate.normal {
background-color: @background;
text-color: @foreground;
}
#element.alternate.urgent {
background-color: @urgent-background;
text-color: @foreground;
}
#element.alternate.active {
background-color: @active-background;
text-color: @foreground;
}
#scrollbar {
width: 2px ;
border: 0;
handle-width: 8px ;
padding: 0;
}
#sidebar {
border: 2px dash 0px 0px ;
border-color: @separatorcolor;
}
#button.selected {
background-color: @selected-background;
text-color: @foreground;
}
#inputbar {
spacing: 0;
text-color: @foreground;
padding: 1px ;
}
#case-indicator {
spacing: 0;
text-color: @foreground;
}
#entry {
spacing: 0;
text-color: @drac-cya;
}
#prompt {
spacing: 0;
text-color: @drac-grn;
}
#inputbar {
children: [ prompt,textbox-prompt-colon,entry,case-indicator ];
}
#textbox-prompt-colon {
expand: false;
str: ":";
margin: 0px 0.3em 0em 0em ;
text-color: @drac-grn;
}
'';
};
});
in
{
home-manager.users.moritz = {...}: (base "/home/moritz/");
}

26
modules/zathura.nix Normal file
View File

@ -0,0 +1,26 @@
{ config, lib, pkgs, ... }:
let
base = {
programs.zathura = {
enable = true;
options = {
recolor = true;
completion-bg = "#282a36";
completion-fg = "#ff79c6";
default-bg = "#44475a";
default-fg = "#bd93f9";
inputbar-bg = "#282a36";
inputbar-fg = "#8be9fd";
statusbar-bg = "#282a36";
statusbar-fg = "#bd93f9";
font = "Jetbrains Mono 9";
recolor-lightcolor = "#282a36";
recolor-darkcolor = "#f8f8f2";
};
};
};
in
{
home-manager.users.moritz = {...}: (base);
}

49
modules/zsh.nix Normal file
View File

@ -0,0 +1,49 @@
{ config, lib, pkgs, ... }:
let
base = (home: {
programs = {
zsh = {
enable = true;
dotDir = ".config/zsh";
history = {
expireDuplicatesFirst = true;
};
shellGlobalAliases = {
ls = "exa -lh";
cat = "bat";
};
plugins = [
{
name = "zsh-autosuggestions";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-autosuggestions";
rev = "v0.4.0";
sha256 = "0z6i9wjjklb4lvr7zjhbphibsyx51psv50gm07mbb0kj9058j6kc";
};
}
{
name = "zsh-syntax-highlighting";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0e1bb14452e3fc66dcc81531212e1061e02c1a61";
sha256 = "09ncmyqlk9a3h470z0wgbkrznb5zyc9dj96011wm89rdxc1irxk2";
};
}
];
};
exa.enable = true;
bat.enable = true;
starship = {
enable = true;
enableZshIntegration = true;
};
};
});
in
{
home-manager.users.moritz = {...}: (base "/home/moritz");
}