🧹 restructure layout
This commit is contained in:
parent
40c2a5fb29
commit
268374ad58
115 changed files with 2641 additions and 2085 deletions
24
modules/programs/adb.nix
Normal file
24
modules/programs/adb.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.adb;
|
||||
in
|
||||
{
|
||||
options.my.programs.adb = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.adb.enable = true;
|
||||
users.users.moritz.extraGroups = [ "adbusers" ];
|
||||
};
|
||||
}
|
||||
11
modules/programs/bspwm/bspwmrc
Executable file
11
modules/programs/bspwm/bspwmrc
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
mapfile -t monitors < <(bspc query -M --names | sort -r)
|
||||
desktops=$(( 10 / ${#monitors[@]} ))
|
||||
start=1
|
||||
end=$desktops
|
||||
for monitor in "${monitors[@]}"; do
|
||||
bspc monitor "$monitor" -d $(seq -s ' ' $start $end)
|
||||
start=$(( start + desktops ))
|
||||
end=$(( end + desktops ))
|
||||
done
|
||||
79
modules/programs/bspwm/default.nix
Normal file
79
modules/programs/bspwm/default.nix
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.bspwm;
|
||||
in
|
||||
{
|
||||
options.my.programs.bspwm = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services = {
|
||||
xserver = {
|
||||
enable = true;
|
||||
layout = "de";
|
||||
displayManager = {
|
||||
defaultSession = "none+bspwm";
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "moritz";
|
||||
};
|
||||
lightdm.enable = true;
|
||||
};
|
||||
windowManager.bspwm.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.users.moritz = {
|
||||
xsession.windowManager.bspwm = {
|
||||
enable = true;
|
||||
rules = {
|
||||
"Zathura".state = "tiled";
|
||||
"Emacs".state = "tiled";
|
||||
"feh".state = "floating";
|
||||
"Vampire_Survivors".state = "fullscreen";
|
||||
};
|
||||
settings = with config.scheme.withHashtag; {
|
||||
border_width = 2;
|
||||
window_gap = 5;
|
||||
borderless_monocle = true;
|
||||
gapless_monocle = true;
|
||||
focus_follows_pointer = true;
|
||||
};
|
||||
startupPrograms = [
|
||||
"${pkgs.systemd}/bin/systemctl --user start polybar.service"
|
||||
"randomWallpaper"
|
||||
"synology-drive"
|
||||
];
|
||||
extraConfig = builtins.readFile ./bspwmrc;
|
||||
};
|
||||
services = {
|
||||
sxhkd = {
|
||||
enable = true;
|
||||
extraConfig = builtins.readFile ./sxhkdrc;
|
||||
};
|
||||
polybar = {
|
||||
enable = true;
|
||||
package = pkgs.polybar.override { pulseSupport = true; };
|
||||
script = ''
|
||||
for m in $(polybar --list-monitors | ${pkgs.coreutils}/bin/cut -d":" -f1); do
|
||||
MONITOR=$m polybar --reload bottom &
|
||||
done
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [ feh playerctl pamixer brightnessctl ];
|
||||
};
|
||||
};
|
||||
}
|
||||
116
modules/programs/bspwm/sxhkdrc
Executable file
116
modules/programs/bspwm/sxhkdrc
Executable file
|
|
@ -0,0 +1,116 @@
|
|||
# BSPWM
|
||||
# Uses modifier key ALT
|
||||
|
||||
# Desktop
|
||||
# View desktop
|
||||
alt + {1-9,0}
|
||||
bspc desktop -f {1-9,10}
|
||||
|
||||
# Move node to desktop
|
||||
alt + shift + {1-9,0}
|
||||
bspc node -d {1-9,10}
|
||||
|
||||
|
||||
# WM
|
||||
# quit/restart bspwm
|
||||
alt + shift + {e,r}
|
||||
bspc {quit,wm -r}
|
||||
|
||||
# close/kill node
|
||||
alt + {_,shift + }q
|
||||
bspc node -{c,k}
|
||||
|
||||
# make sxhkd reload its configuration files:
|
||||
alt + shift + c
|
||||
pkill -USR1 -x sxhkd && dunstify 'sxhkd' 'Reloaded config!'
|
||||
|
||||
|
||||
# State and Flags
|
||||
# set the window state
|
||||
alt + {t,shift + t,s,f}
|
||||
bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
|
||||
|
||||
|
||||
# Focus/Swap Nodes
|
||||
# focus the node in the given direction
|
||||
alt + {_,shift + }{h,j,k,l}
|
||||
bspc node -{f,s} {west,south,north,east}
|
||||
|
||||
# Rotate tree
|
||||
alt + shift + {d,a}
|
||||
bspc node @/ -C {forward,backward}
|
||||
|
||||
|
||||
# Resize Node
|
||||
# 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
|
||||
alt + shift + ctrl + {h,j,k,l}
|
||||
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
|
||||
|
||||
|
||||
# XF86 Keys
|
||||
XF86AudioRaiseVolume
|
||||
pamixer -i 5
|
||||
XF86AudioLowerVolume
|
||||
pamixer -d 5
|
||||
XF86AudioMute
|
||||
pamixer -t
|
||||
|
||||
XF86AudioPlay
|
||||
[ $(playerctl -p "spotifyd,firefox" status) = "Playing" ] && playerctl -p "spotifyd,firefox" pause || playerctl -p "spotifyd,firefox" play
|
||||
XF86AudioNext
|
||||
playerctl -p "spotifyd,firefox" next
|
||||
XF86AudioPrev
|
||||
playerctl -p "spotifyd,firefox" previous
|
||||
|
||||
XF86MonBrightnessDown
|
||||
brightnessctl s 10%-
|
||||
XF86MonBrightnessUp
|
||||
brightnessctl s +10%
|
||||
|
||||
|
||||
# Programs
|
||||
# Uses modifier key SUPER
|
||||
|
||||
# Rofi
|
||||
# start rofi
|
||||
super + d
|
||||
rofi -show combi
|
||||
|
||||
# start Networkmanager rofi
|
||||
super + w
|
||||
networkmanager_dmenu
|
||||
|
||||
# start rofi-calc
|
||||
super + c
|
||||
rofi -show calc -modi calc -no-show-match -no-sort | xclip -selection clipboard
|
||||
|
||||
# Show help
|
||||
super + h
|
||||
sxhkd-help
|
||||
|
||||
# script for sharing files
|
||||
super + s
|
||||
share
|
||||
|
||||
# Apps
|
||||
# start firefox
|
||||
super + {_,shift} + f
|
||||
firefox {_,--private-window}
|
||||
|
||||
# terminal emulator
|
||||
super + {_,shift} + Return
|
||||
{_,bspc rule -a "kitty" -o state=floating;} kitty
|
||||
|
||||
|
||||
# Emacs
|
||||
# start emacs
|
||||
super + e
|
||||
emacsclient -c -a emacs
|
||||
# emacs everywhere
|
||||
super + shift + e
|
||||
bspc rule -a 'Emacs' -o state=floating sticky=on; \
|
||||
emacsclient --eval "(emacs-everywhere)"
|
||||
34
modules/programs/code.nix
Normal file
34
modules/programs/code.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.code;
|
||||
in
|
||||
{
|
||||
options.my.programs.code = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.moritz = {
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
package = pkgs.vscode-fhsWithPackages (ps: with ps; [ git ]);
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
bbenoist.nix
|
||||
dracula-theme.theme-dracula
|
||||
esbenp.prettier-vscode
|
||||
pkief.material-icon-theme
|
||||
vscodevim.vim
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
30
modules/programs/default.nix
Normal file
30
modules/programs/default.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./adb.nix
|
||||
./bspwm
|
||||
./code.nix
|
||||
./direnv.nix
|
||||
./emacs.nix
|
||||
./firefox.nix
|
||||
./fish.nix
|
||||
./git.nix
|
||||
./gpg.nix
|
||||
./hub.nix
|
||||
./kitty.nix
|
||||
./ledger
|
||||
./rofi
|
||||
./spotify.nix
|
||||
./sway.nix
|
||||
./thunar.nix
|
||||
./vim.nix
|
||||
./xmonad
|
||||
./zathura.nix
|
||||
./zsh.nix
|
||||
];
|
||||
}
|
||||
26
modules/programs/direnv.nix
Normal file
26
modules/programs/direnv.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.direnv;
|
||||
in
|
||||
{
|
||||
options.my.programs.direnv = {
|
||||
enable = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
example = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.moritz.programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
102
modules/programs/emacs.nix
Normal file
102
modules/programs/emacs.nix
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, inputs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.emacs;
|
||||
myEmacs = with pkgs; ((emacsPackagesFor emacsPgtkNativeComp).emacsWithPackages
|
||||
(epkgs: [ epkgs.vterm ]));
|
||||
in
|
||||
{
|
||||
options.my.programs.emacs = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
my.shell.aliases = {
|
||||
emacs = "emacsclient -t -a 'emacs -t'";
|
||||
};
|
||||
fonts.fonts = [ pkgs.emacs-all-the-icons-fonts ];
|
||||
|
||||
home-manager.users.moritz = {
|
||||
home.sessionPath = [ "/home/moritz/.config/emacs/bin/" ];
|
||||
services.emacs = {
|
||||
enable = true;
|
||||
package = myEmacs;
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
### Emacs itself
|
||||
binutils # native-comp needs 'as', provided by this
|
||||
myEmacs
|
||||
|
||||
### Doom dependencies
|
||||
git
|
||||
(ripgrep.override { withPCRE2 = true; })
|
||||
gnutls # for TLS connectivity
|
||||
|
||||
### Optional dependencies
|
||||
fd # faster projectile indexing
|
||||
imagemagick # for image-dired
|
||||
zstd # for undo-fu-session/undo-tree compression
|
||||
|
||||
### Module dependencies
|
||||
## :checkers
|
||||
# spell
|
||||
(hunspellWithDicts [
|
||||
hunspellDicts.en_GB-ize
|
||||
hunspellDicts.en_US
|
||||
hunspellDicts.de_DE
|
||||
])
|
||||
|
||||
# grammar
|
||||
languagetool
|
||||
|
||||
## : tools
|
||||
# lookup & org +roam
|
||||
sqlite
|
||||
gcc # HACK to get emacsqlite binary
|
||||
wordnet
|
||||
graphviz
|
||||
|
||||
## :lang
|
||||
# latex & org (latex previews)
|
||||
texlive.combined.scheme-full
|
||||
texlab
|
||||
|
||||
# nix
|
||||
nixfmt # for formating nix
|
||||
rnix-lsp
|
||||
|
||||
# markdown & org +pandoc
|
||||
pandoc
|
||||
|
||||
# python
|
||||
nodePackages.pyright
|
||||
python-dev
|
||||
|
||||
# sh
|
||||
nodePackages.bash-language-server
|
||||
|
||||
## :email
|
||||
# mu4e
|
||||
mu
|
||||
isync
|
||||
|
||||
## :app
|
||||
# everywhere
|
||||
xdotool
|
||||
xorg.xwininfo
|
||||
xclip
|
||||
xorg.xprop
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
47
modules/programs/firefox.nix
Normal file
47
modules/programs/firefox.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, inputs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.firefox;
|
||||
arkenfox = builtins.readFile "${inputs.arkenfox-userjs}/user.js";
|
||||
in
|
||||
{
|
||||
options.my.programs.firefox = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
overrides = mkOption {
|
||||
default = { };
|
||||
type = with types; attrsOf (oneOf [ str bool int ]);
|
||||
apply = overrides: lib.concatStrings (
|
||||
lib.mapAttrsToList
|
||||
(
|
||||
name: value: ''
|
||||
user_pref("${name}", ${builtins.toJSON value});
|
||||
''
|
||||
)
|
||||
overrides
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.moritz.programs.firefox = {
|
||||
enable = true;
|
||||
profiles."default".extraConfig = ''
|
||||
// Arkenfox user.js
|
||||
${arkenfox}
|
||||
|
||||
// Overrides
|
||||
${cfg.overrides}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
86
modules/programs/fish.nix
Normal file
86
modules/programs/fish.nix
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, inputs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.fish;
|
||||
shellConfig = config.my.shell;
|
||||
exportVariables =
|
||||
lib.mapAttrsToList (n: v: ''set -x ${n} "${v}"'') shellConfig.variables;
|
||||
exportedVariables = lib.concatStringsSep "\n" exportVariables;
|
||||
in
|
||||
{
|
||||
options.my.programs.fish = {
|
||||
enable = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
example = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# set as default shell
|
||||
users.users.moritz.shell = pkgs.fish;
|
||||
# needed for nix completions
|
||||
programs.fish.enable = true;
|
||||
|
||||
home-manager.users.moritz = {
|
||||
programs = {
|
||||
fish = {
|
||||
enable = true;
|
||||
shellAbbrs = shellConfig.abbreviations;
|
||||
|
||||
shellAliases = shellConfig.aliases;
|
||||
|
||||
shellInit = ''
|
||||
fzf_configure_bindings --git_log=\cg
|
||||
|
||||
# Vi Mode
|
||||
fish_vi_key_bindings
|
||||
|
||||
# Emulates vim's cursor shape behavior
|
||||
# Set the normal and visual mode cursors to a block
|
||||
set fish_cursor_default block
|
||||
# Set the insert mode cursor to a line
|
||||
set fish_cursor_insert line
|
||||
# Set the replace mode cursor to an underscore
|
||||
set fish_cursor_replace_one underscore
|
||||
# The following variable can be used to configure cursor shape in
|
||||
# visual mode, but due to fish_cursor_default, is redundant here
|
||||
set fish_cursor_visual block
|
||||
|
||||
# Variables
|
||||
${exportedVariables}
|
||||
'';
|
||||
functions = {
|
||||
gi = ''
|
||||
set url https://www.gitignore.io/api
|
||||
if test (count $argv) -ne 1
|
||||
set list (curl -sL $url/list | string split ",")
|
||||
set choice (string split " " $list | fzf -m --preview "curl -sL $url/{}" | string join ",")
|
||||
else
|
||||
set choice $argv[1]
|
||||
end
|
||||
curl -sL $url/$choice > .gitignore
|
||||
'';
|
||||
fish_greeting = "";
|
||||
cheat = "cht.sh $argv | bat -p";
|
||||
};
|
||||
plugins = [
|
||||
{
|
||||
name = "dracula";
|
||||
src = inputs.dracula-fish;
|
||||
}
|
||||
];
|
||||
};
|
||||
fzf.enableFishIntegration = true;
|
||||
starship.enableFishIntegration = true;
|
||||
};
|
||||
home.packages = with pkgs.fishPlugins; [ fzf-fish pisces ];
|
||||
};
|
||||
};
|
||||
}
|
||||
57
modules/programs/git.nix
Normal file
57
modules/programs/git.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.git;
|
||||
in
|
||||
{
|
||||
options.my.programs.git = {
|
||||
enable = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
example = false;
|
||||
};
|
||||
signing = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
my.shell.abbreviations = {
|
||||
ga = "git add";
|
||||
gb = "git branch";
|
||||
gc = "git commit";
|
||||
gco = "git checkout";
|
||||
gd = "git diff";
|
||||
gds = "git diff --staged";
|
||||
gp = "git push";
|
||||
gf = "git fetch";
|
||||
gF = "git pull";
|
||||
gs = "git status";
|
||||
};
|
||||
home-manager.users.moritz = {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Moritz Böhme";
|
||||
userEmail = "mail@moritzboeh.me";
|
||||
extraConfig.init.defaultBranch = "main";
|
||||
delta.enable = true;
|
||||
signing = mkIf cfg.signing {
|
||||
key = "0x970C6E89EB0547A9";
|
||||
signByDefault = true;
|
||||
};
|
||||
lfs.enable = true;
|
||||
};
|
||||
};
|
||||
programs.git = {
|
||||
enable = true;
|
||||
config.safe.directory = "/home/moritz/.dotfiles";
|
||||
};
|
||||
};
|
||||
}
|
||||
34
modules/programs/gpg.nix
Normal file
34
modules/programs/gpg.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.gpg;
|
||||
in
|
||||
{
|
||||
options.my.programs.gpg = {
|
||||
enable = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.moritz.programs.gpg.enable = true;
|
||||
environment.shellInit = ''
|
||||
export GPG_TTY="$(tty)"
|
||||
gpg-connect-agent /bye
|
||||
export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
|
||||
'';
|
||||
programs = {
|
||||
ssh.startAgent = false;
|
||||
gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
27
modules/programs/hub.nix
Normal file
27
modules/programs/hub.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.hub;
|
||||
in
|
||||
{
|
||||
options.my.programs.hub = {
|
||||
enable = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
example = false;
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
age.secrets = {
|
||||
github = {
|
||||
file = ../../secrets/github.age;
|
||||
owner = "1000";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
48
modules/programs/kitty.nix
Normal file
48
modules/programs/kitty.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.kitty;
|
||||
in
|
||||
{
|
||||
options.my.programs.kitty = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
my.shell.aliases.ssh = "kitty +kitten ssh";
|
||||
home-manager.users.moritz = {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
scrollback_lines = 10000;
|
||||
enable_audio_bell = false;
|
||||
cursor_shape = "underline";
|
||||
window_padding_width = 3;
|
||||
confirm_os_window_close = 0;
|
||||
};
|
||||
keybindings = {
|
||||
"ctrl+plus" = "change_font_size all +2.0";
|
||||
"ctrl+minus" = "change_font_size all -2.0";
|
||||
};
|
||||
font = {
|
||||
name = "FiraCode Nerd Font";
|
||||
size = 10;
|
||||
};
|
||||
};
|
||||
xdg.configFile."kitty/ssh.conf" = {
|
||||
text = ''
|
||||
env TERM=xterm-color
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
44
modules/programs/ledger/default.nix
Normal file
44
modules/programs/ledger/default.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.ledger;
|
||||
in
|
||||
{
|
||||
options.my.programs.ledger = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
my.shell.aliases = {
|
||||
bal = "ledger bal";
|
||||
balcash = "ledger bal -R -X € --current --flat ^assets:bank ^liabilities";
|
||||
balnet = "ledger bal -R -X € --current --depth 2 ^assets ^liabilities";
|
||||
bud = ''ledger --budget --unbudgeted bal ^expenses -p "this month"'';
|
||||
budr = ''ledger --budget reg -p "this month" ^expenses'';
|
||||
reg = "ledger reg -R -V --tail 15";
|
||||
};
|
||||
home-manager.users.moritz = {
|
||||
home.packages = with pkgs; [ ledger ];
|
||||
xdg.configFile = {
|
||||
"fish/completions/ledger.fish" = {
|
||||
text = builtins.readFile ./ledger.fish;
|
||||
};
|
||||
"ledger/ledgerrc".text = ''
|
||||
--strict
|
||||
--explicit
|
||||
--payee note
|
||||
--file ~/Notes/ledger/main.ledger
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
344
modules/programs/ledger/ledger.fish
Normal file
344
modules/programs/ledger/ledger.fish
Normal file
|
|
@ -0,0 +1,344 @@
|
|||
# ledger completion
|
||||
|
||||
function __fish_ledger_needs_command
|
||||
set cmd (commandline -opc)
|
||||
set skip_next 0
|
||||
test (count $cmd) -eq 1
|
||||
and return 0
|
||||
for item in $cmd[2..-1]
|
||||
test $skip_next -eq 1
|
||||
and set skip_next 0
|
||||
and continue
|
||||
switch $item
|
||||
case '-D' '-F'
|
||||
# These take an argument
|
||||
set skip_next 1
|
||||
case '-*' '*:*'
|
||||
# Do nothing
|
||||
case '*'
|
||||
# Action found
|
||||
echo $item
|
||||
return 1
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
function __fish_ledger_command_is
|
||||
set cmd (__fish_ledger_needs_command)
|
||||
test -z "$cmd"
|
||||
and return 1
|
||||
contains -- $cmd $argv
|
||||
and return 0
|
||||
return 1
|
||||
end
|
||||
|
||||
function __fish_complete_ledger_commands
|
||||
for target in \
|
||||
"accounts\\tList accounts of matching postings\\n" \
|
||||
"args\\tPrint how args are evaluated\\n" \
|
||||
"balance\\tBalance report\\n" \
|
||||
"budget\\tBudget report\\n" \
|
||||
"cleared\\tCleared report\\n" \
|
||||
"commodities\\tCommodities report\\n" \
|
||||
"convert\\tConvert from CSV\\n" \
|
||||
"csv\\tPrint output in CSV format\\n" \
|
||||
"emacs\\tPrint output in Lisp form\\n" \
|
||||
"entry\\tGenerate entry from template\\n" \
|
||||
"equity\\tEquity report\\n" \
|
||||
"eval\\tEvaluate the arguments\\n" \
|
||||
"expr\\tPrint how given value expr is evaluated\\n" \
|
||||
"format\\tPrint how given format is evaluated\\n" \
|
||||
"generate\\tGenerate random ledger data for tests\\n" \
|
||||
"org\\tExport to Org Mode\\n" \
|
||||
"parse\\tPrint how given value expr is evaluated\\n" \
|
||||
"payees\\tList payees of matching posting\\n" \
|
||||
"period\\tPrint how given period is interpreted\\n" \
|
||||
"pop\\tUnset option in the REPL\\n" \
|
||||
"pricedb\\tPrices report based on ~/.pricedb\\n" \
|
||||
"pricemap\\tGraph of commodities relationships\\n" \
|
||||
"prices\\tPrices report\\n" \
|
||||
"print\\tPrint full transactions\\n" \
|
||||
"push\\tSet option in the REPL\\n" \
|
||||
"python\\tRun given file in Python inerpreter\\n" \
|
||||
"query\\tPrint how args are evaluated\\n" \
|
||||
"register\\tList matching postings\\n" \
|
||||
"reload\\tReload all data files for current session\\n" \
|
||||
"select\\tUse an SQL query to print postings\\n" \
|
||||
"server\\tStarts HTTP server\\n" \
|
||||
"source\\tCheck journal file for errors\\n" \
|
||||
"stats\\tPrint summary info on matching postings\\n" \
|
||||
"template\\tShow insertion template generated by xcat command\\n" \
|
||||
"xact\\tGenerate entry from template\\n" \
|
||||
"xml\\tPrint report in XML format\\n" \
|
||||
|
||||
printf $target
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_complete_ledger_expr
|
||||
set -l tail (commandline -tc)
|
||||
string match -q -r -- '^-' "$tail"
|
||||
and return 0
|
||||
string match -q -r -- '[()!]' "$tail"
|
||||
# Complete "ledger echo \(foo"
|
||||
and set -l head (string match -r -- '.*[()!]' "$tail"; true)
|
||||
and set head (string replace -r -a -- '[\\\]' '\\' "$head"; true)
|
||||
and set tail (string match -r -- '[^()!]*$' "$tail"; true)
|
||||
and set -l items (complete -C"ledger echo $tail")
|
||||
and for item in $items
|
||||
printf '%s%s\n' "$head" "$item"
|
||||
end
|
||||
and return 0
|
||||
# Expression words
|
||||
printf '(\tStart enclosed expression\n'
|
||||
printf ')\tEnd enclosed expression\n'
|
||||
printf '!\tLogical negation\n'
|
||||
printf 'and\tLogical conjunction\n'
|
||||
printf 'or\tLogical disjunction\n'
|
||||
printf 'not\tLogical negation\n'
|
||||
# Pseudo-portnames
|
||||
set -l pseudo "all" "current" "active" "inactive" "installed" "uninstalled" \
|
||||
"outdated" "obsolete" "requested" "unrequested" "leaves"
|
||||
for item in $pseudo
|
||||
printf '%s\tPseudo-portname\n' $item
|
||||
end
|
||||
# Pseudo-portname selectors
|
||||
set -l selectors "depof:" "rdepof:" "depends:" "rdepends:" "dependentof:" \
|
||||
"rdependentof:" "name:" "version:" "revision:" "epoch:" "variant:" \
|
||||
"variants:" "category:" "categories:" "maintainer:" "maintainers:" \
|
||||
"platform:" "platforms:" "description:" "long_description:" "homepage:" \
|
||||
"license:" "portdir:"
|
||||
for item in $selectors
|
||||
printf '%s\tSelector\n' $item
|
||||
end
|
||||
test -z "$tail"
|
||||
# Listing all ports is too slow, just stop here if empty
|
||||
and return 0
|
||||
# Globbing characters
|
||||
printf '%s*\tGlob pattern\n' "$tail"
|
||||
printf '%s?\tGlob pattern\n' "$tail"
|
||||
# Portnames
|
||||
test "$argv[1]" = "all"
|
||||
# This might take long, try to limit the output
|
||||
and set -l portexpr "*$tail*"
|
||||
or set -l portexpr $argv[1]
|
||||
set portnames (ledger -q echo $portexpr | string replace -r -- ' *@.*' '' \
|
||||
| string replace -a -- ' ' '')
|
||||
for item in $portnames
|
||||
printf '%s\tPortname\n' $item
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
function __fish_complete_ledger_help
|
||||
complete -C"ledger "
|
||||
printf '%s\t%s\n' macports.conf "Configuration file of the MacPorts system"
|
||||
printf '%s\t%s\n' portfile "MacPorts description file reference"
|
||||
printf '%s\t%s\n' portgroup "MacPorts PortGroup command reference"
|
||||
printf '%s\t%s\n' portstyle "Style guide for Portfiles"
|
||||
printf '%s\t%s\n' porthier "Layout of the ports-filesystems"
|
||||
end
|
||||
|
||||
function __fish_complete_ledger_select
|
||||
set cmd (commandline -opc)
|
||||
set count 0
|
||||
for item in $cmd
|
||||
switch $item
|
||||
case '-*'
|
||||
test $item = "--set"
|
||||
and set is_set 1
|
||||
or set is_set = 0
|
||||
set count 0
|
||||
case '*'
|
||||
set count (math $count + 1)
|
||||
set group $item
|
||||
end
|
||||
end
|
||||
test $count -eq 0
|
||||
and for name in (ledger select --summary | awk 'NR>2{print $1}')
|
||||
printf '%s\tGroup name\n' $name
|
||||
end
|
||||
and return 0
|
||||
test $count -eq 1
|
||||
and test "$is_set" -eq 1
|
||||
and for name in (ledger -q select --list $group)
|
||||
string match -q -r -- '(active)' "$name"
|
||||
and printf '%s\tActive\n' (string match -r -- '^\s*[^ \t]+' "$name")
|
||||
or printf '%s\tInactive\n' "$name"
|
||||
end
|
||||
end
|
||||
|
||||
complete -e -c ledger
|
||||
complete -f -c ledger
|
||||
|
||||
# --option | -o
|
||||
complete -f -c ledger -s A -l average -d "Print average values over the number of transactions instead of running totals."
|
||||
complete -f -c ledger -s B -l basis -d "Report the cost basis on all posting. Alias for --cost"
|
||||
complete -f -c ledger -s L -l actual -d "Report only real transactions, with no automated or virtual transactions used."
|
||||
complete -f -c ledger -s j -l amount-data -d "On a register report print only the dates and amount of post- ings. Useful for graphing and spreadsheet applications."
|
||||
complete -f -c ledger -s P -l by-payee -d "Group postings in the register report by common payee names."
|
||||
complete -f -c ledger -s C -l cleared -d "Display only cleared postings."
|
||||
complete -f -c ledger -s n -l collapse -d "Print only the top level accounts."
|
||||
complete -f -c ledger -s c -l current -d "Shorthand for --limit 'date <= today'."
|
||||
complete -f -c ledger -s D -l daily -d "Shorthand for --period daily."
|
||||
complete -f -c ledger -s E -l empty -d "Include empty accounts in report."
|
||||
complete -f -c ledger -s G -l gain -d "Report net gain or loss for commodities that have a price his- tory."
|
||||
complete -f -c ledger -s V -l market -d "Use the latest market value for all commodities."
|
||||
complete -f -c ledger -s M -l monthly -d "Shorthand for --period monthly."
|
||||
complete -f -c ledger -s % -l percent -d "Calculate the percentage value of each account in a balance reports. Only works for account that have a single commodity."
|
||||
complete -f -c ledger -s I -l price -d "Use the price of the commodity purchase for performing calcula- tions."
|
||||
complete -f -c ledger -s O -l quantity -d "Report commodity totals (this is the default)."
|
||||
complete -f -c ledger -s R -l real -d "Account using only real transactions ignoring virtual and auto- matic transactions."
|
||||
complete -f -c ledger -s r -l related -d "In a register report show the related account. This is the other side of the transaction."
|
||||
complete -f -c ledger -s s -l subtotal -d "Report register as a single subtotal."
|
||||
complete -f -c ledger -s J -l total-data -d "Show only dates and totals to format the output for plots."
|
||||
complete -f -c ledger -s U -l uncleared -d "Use only uncleared transactions in calculations and reports."
|
||||
complete -f -c ledger -s Y -l yearly -d "Shorthand for --period yearly."
|
||||
complete -f -c ledger -s w -l wide -d "Assume 132 columns instead of the TTY width."
|
||||
complete -f -c ledger -s W -l weekly -d "Shorthand for --period weekly."
|
||||
|
||||
# --option
|
||||
complete -f -c ledger -l version -d "Print version information and exit."
|
||||
complete -f -c ledger -l verify-memory -d "Verify that every constructed object is properly destructed. This is for debugging purposes only."
|
||||
complete -f -c ledger -l verify -d "Enable additional assertions during run-time. This causes a significant slowdown. When combined with --debug CODE ledger will produce memory trace information."
|
||||
complete -f -c ledger -l verbose -d "Print detailed information on the execution of ledger."
|
||||
complete -f -c ledger -l values -d "Show the values used by each tag when used in combination with the tags command."
|
||||
complete -f -c ledger -l unround -d "Perform all calculations without rounding and display results to full precision."
|
||||
complete -f -c ledger -l unrealized-losses -d "Allow the user to specify what account name should be used for unrealized losses. Defaults to Equity:Unrealized Losses. Often set in one's ~/.ledgerrc file to change the default."
|
||||
complete -f -c ledger -l unrealized-gains -d "Allow the user to specify what account name should be used for unrealized gains. Defaults to Equity:Unrealized Gains. Often set in one's ~/.ledgerrc file to change the default."
|
||||
complete -f -c ledger -l unrealized -d "Show generated unrealized gain and loss accounts in the balance report."
|
||||
complete -f -c ledger -l unbudgeted -d "Show only un-budgeted postings."
|
||||
complete -f -c ledger -l time-report -d "Add two columns to the balance report to show the earliest checkin and checkout times for timelog entries."
|
||||
complete -f -c ledger -l time-colon -d "Display the value for commodities based on seconds as hours and minutes. Thus 8100s will be displayed as 2:15h instead of 2.25h."
|
||||
complete -f -c ledger -l strict -d "Accounts, tags or commodities not previously declared will cause warnings."
|
||||
complete -f -c ledger -l sort-xacts -d "Sort the posting within transactions using the given value expression."
|
||||
complete -f -c ledger -l rich-data -d "When generating a ledger transaction from a CSV file using the convert command, add CSV, Imported, and UUID meta-data."
|
||||
complete -f -c ledger -l revalued-total -d "Display the sum of the revalued postings as the running total, which serves to show unrealized capital in a gain/losses report."
|
||||
complete -f -c ledger -l revalued-only -d "Show only <Revalued> postings."
|
||||
complete -f -c ledger -l revalued -d "Report discrepancy in values for manual reports by inserting <Revalued> postings. This is implied when using the --exchange (-X) or --market (-V) option."
|
||||
complete -f -c ledger -l related-all -d "Show all postings in a transaction, similar to --related but show both sides of each transaction."
|
||||
complete -f -c ledger -l recursive-aliases -d "Causes ledger to try to expand aliases recursively, i.e. try to expand the result of an earlier expansion again, until no more expansions apply."
|
||||
complete -f -c ledger -l raw -d "In the print report, show transactions using the exact same syn- tax as specified by the user in their data file. Don't do any massaging or interpreting. Can be useful for minor cleanups, like just aligning amounts."
|
||||
complete -f -c ledger -l quarterly -d "Shorthand for --period quarterly."
|
||||
complete -f -c ledger -l primary-date -d "Show primary dates for all calculations. Alias for --actual-dates"
|
||||
complete -f -c ledger -l permissive -d "Quiet balance assertions."
|
||||
complete -f -c ledger -l period-sort -d "Sort the posting within transactions using the given value expression."
|
||||
complete -f -c ledger -l pending -d "Use only postings that are marked pending."
|
||||
complete -f -c ledger -l pedantic -d "Accounts, tags or commodities not previously declared will cause errors."
|
||||
complete -f -c ledger -l payee -d "Sets a value expression for formatting the payee. In the register report this prevents the second entry from having a date and payee for each transaction."
|
||||
complete -f -c ledger -l options -d "Display the options in effect for this ledger invocation, along with their values and the source of those values."
|
||||
complete -f -c ledger -l no-total -d "Suppress printing the final total line in a balance report."
|
||||
complete -f -c ledger -l no-titles -d "Suppress the output of group titles."
|
||||
complete -f -c ledger -l no-rounding -d "Don't output \"<Adjustment>\" postings. Note that this will cause the running total to often not add up! Its main use is for --amount-data (-j) and --total-data (-J) reports."
|
||||
complete -f -c ledger -l no-revalued -d "Stop ledger from showing <Revalued> postings."
|
||||
complete -f -c ledger -l no-pager -d "Disables the pager on TTY output."
|
||||
complete -f -c ledger -l no-color -d "Suppress any color TTY output."
|
||||
complete -f -c ledger -l no-aliases -d "Aliases are completely ignored."
|
||||
complete -f -c ledger -l lots-actual -d "Preserve the uniqueness of commodities so they aren't merged during reporting without printing the lot annotations."
|
||||
complete -f -c ledger -l lots -d "Report the date and price at which each commodity was purchased in a balance report."
|
||||
complete -f -c ledger -l lot-prices -d "Report the price at which each commodity in a balance report was purchased."
|
||||
complete -f -c ledger -l lot-notes -d "Report the tag attached to each commodity in a balance report."
|
||||
complete -f -c ledger -l lot-dates -d "Report the date on which each commodity in a balance report was purchased."
|
||||
complete -f -c ledger -l invert -d "Change the sign of all reported values."
|
||||
complete -f -c ledger -l immediate -d "Evaluate calculations immediately rather than lazily."
|
||||
complete -f -c ledger -l help -d "Print this man page. --generated Include auto-generated postings (such as those from automated transactions) in the report, in cases where you normally wouldn't want them."
|
||||
complete -f -c ledger -l force-pager -d "Force ledger to paginate its output."
|
||||
complete -f -c ledger -l force-color -d "Output TTY color codes even if the TTY doesn't support them. Useful for TTYs that don't advertise their capabilities cor- rectly."
|
||||
complete -f -c ledger -l flat -d "Force the full names of accounts to be used in the balance report. The balance report will not use an indented tree."
|
||||
complete -f -c ledger -l explicit -d "Direct ledger to require pre-declarations for entities (such as accounts, commodities and tags) rather than taking entities from cleared transactions as defined."
|
||||
complete -f -c ledger -l exact -d "Report beginning and ending of periods by the date of the first and last posting occurring in that period."
|
||||
complete -f -c ledger -l equity -d "Related to the equity command. Gives current account balances in the form of a register report."
|
||||
complete -f -c ledger -l effective -d "Show auxiliary dates for all calculations. Alias for --aux-date."
|
||||
complete -f -c ledger -l download -d "Cause quotes to be automagically downloaded, as needed, by run- ning a script named getquote and expecting that script to return a value understood by ledger. A sample implementation of a getquote script, implemented in Perl, is provided in the distri- bution. Downloaded quote price are then appended to the price database, usually specified using the environment variable LEDGER_PRICE_DB."
|
||||
complete -f -c ledger -l dow -d "Group transactions by the days of the week. Alias for --days-of-week."
|
||||
complete -f -c ledger -l deviation -d "Report each posting's deviation from the average. It is only meaningful in the register and prices reports."
|
||||
complete -f -c ledger -l detail -d "Related to convert command. Synonym to --rich-data option."
|
||||
complete -f -c ledger -l decimal-comma -d "Direct ledger to parse journals using the European standard comma as decimal separator, vice a period."
|
||||
complete -f -c ledger -l dc -d "Display register or balance in debit/credit format If you use --dc with either the register or balance commands, you will now get separate columns for debits and credits."
|
||||
complete -f -c ledger -l days-of-week -d "Group transactions by the days of the week. Alias for --dow."
|
||||
complete -f -c ledger -l day-break -d "Break up register report of timelog entries that span multiple days by day."
|
||||
complete -f -c ledger -l count -d "Direct ledger to report the number of items when appended to the commodities, accounts or payees commands."
|
||||
complete -f -c ledger -l cost -d "Report the cost basis on all posting. Alias for --basis. --color Use color if the terminal supports it. Alias for --ansi"
|
||||
complete -f -c ledger -l collapse-if-zero -d "Collapse the account display only if it has a zero balance."
|
||||
complete -f -c ledger -l check-payees -d "Enable strict and pedantic checking for payees as well as accounts, commodities and tags."
|
||||
complete -f -c ledger -l budget -d "Only display budgeted items. In a register report this displays transaction in the budget, in a balance report this displays accounts in the budget."
|
||||
complete -f -c ledger -l base -d "Reduce convertible commodities down the bottom of the conver- sion, e.g. display time in seconds."
|
||||
complete -f -c ledger -l aux-date -d "Show auxiliary dates for all calculations. Alias for --effective"
|
||||
complete -f -c ledger -l auto-match -d "When generating a ledger transaction from a CSV file using the convert command, automatically match an account from the Ledger journal."
|
||||
complete -f -c ledger -l args-only -d "Ignore init files and environment variables for the ledger run."
|
||||
complete -f -c ledger -l ansi -d "Use color if the terminal supports it. Alias for --color --anon Anonymize registry output, mostly for sending in bug reports."
|
||||
complete -f -c ledger -l add-budget -d "Show only un-budgeted postings."
|
||||
complete -f -c ledger -l abbrev-len -d "INT Set the minimum length an account can be abbreviated to if it doesn't fit inside the account-width. If INT is zero, then the account name will be truncated on the right. If INT is greater than account-width then the account will be truncated on the left, with no shortening of the account names in order to fit into the desired width."
|
||||
|
||||
complete -f -c ledger -l account -a "(__fish_complete_ledger_opt_args EXPR)" -d "Prepend EXPR to all accounts reported. That is, the option --account \"'Personal'\" would tack Personal: and --account \"tag('VAT')\" would tack the value of the VAT tag to the begin- ning of every account reported in a balance or register report."
|
||||
complete -f -c ledger -l value-expr -a "(__fish_complete_ledger_opt_args EXPR)" -d "Set a global value expression annotation."
|
||||
complete -f -c ledger -l only -a "(__fish_complete_ledger_opt_args EXPR)" -d "This is a postings predicate that applies after certain trans- forms have been executed, such as periodic gathering."
|
||||
complete -f -c ledger -l group-by -a "(__fish_complete_ledger_opt_args EXPR)" -d "Group transaction together in the register report. EXPR can be anything, although most common would be payee or commodity. The tag() function is also useful here."
|
||||
complete -f -c ledger -l forecast-while -a "(__fish_complete_ledger_opt_args EXPR)" -d "Continue forecasting while VEXPR is true. Alias for --forecast."
|
||||
complete -f -c ledger -l display-total -a "(__fish_complete_ledger_opt_args EXPR)" -d "Apply a transformation to the displayed total. This occurs after calculations occur."
|
||||
complete -f -c ledger -l display-amount -a "(__fish_complete_ledger_opt_args EXPR)" -d "Apply a transformation to the displayed amount. This occurs after calculations occur."
|
||||
complete -f -c ledger -l date -a "(__fish_complete_ledger_opt_args EXPR)" -d "Transform the date of the transaction using EXPR."
|
||||
complete -f -c ledger -l bold-if -a "(__fish_complete_ledger_opt_args EXPR)" -d "Print the entire line in bold if the given value expression is true."
|
||||
complete -f -c ledger -l group-title-format -a "(__fish_complete_ledger_opt_args FMT)" -d "Set the format for the headers that separate reports section of a grouped report. Only has effect with a --group-by EXPR regis- ter report."
|
||||
complete -f -c ledger -l register-format -a "(__fish_complete_ledger_opt_args FMT)" -d "Define the output format for the register report."
|
||||
complete -f -c ledger -l pricedb-format -a "(__fish_complete_ledger_opt_args FMT)" -d "Set the format expected for the historical price file."
|
||||
complete -f -c ledger -l prices-format -a "(__fish_complete_ledger_opt_args FMT)" -d "Set the format for the prices report."
|
||||
complete -f -c ledger -l prepend-format -a "(__fish_complete_ledger_opt_args FMT)" -d "Prepend FMT to every line of the output."
|
||||
complete -f -c ledger -l plot-total-format -a "(__fish_complete_ledger_opt_args FMT)" -d "Define the output format for a total data plot."
|
||||
complete -f -c ledger -l plot-amount-format -a "(__fish_complete_ledger_opt_args FMT)" -d "Define the output format for an amount data plot."
|
||||
complete -f -c ledger -l csv-format -a "(__fish_complete_ledger_opt_args FMT)" -d "Format csv report according to FMT."
|
||||
complete -f -c ledger -l cleared-format -a "(__fish_complete_ledger_opt_args FMT)" -d "Specify the format to use for the cleared report"
|
||||
complete -f -c ledger -l budget-format -a "(__fish_complete_ledger_opt_args FMT)" -d "Specify the format to use for the budget report."
|
||||
complete -f -c ledger -l balance-format -a "(__fish_complete_ledger_opt_args FMT)" -d "Specify the format to use for the balance report."
|
||||
complete -f -c ledger -l account-width -a "(__fish_complete_ledger_opt_args INT)" -d "Set the width of the account column in the register report to INT characters."
|
||||
complete -f -c ledger -l trace -a "(__fish_complete_ledger_opt_args INT)" -d "Enable tracing. The INT specifies the level of trace desired."
|
||||
complete -f -c ledger -l total-width -a "(__fish_complete_ledger_opt_args INT)" -d "Set the width of the total field in the register report."
|
||||
complete -f -c ledger -l tail -a "(__fish_complete_ledger_opt_args INT)" -d "Report only the last INT entries. Only useful on a register report. Alias for --last INT"
|
||||
complete -f -c ledger -l seed -a "(__fish_complete_ledger_opt_args INT)" -d "Set the random seed to INT for the generate command. Used as part of development testing."
|
||||
complete -f -c ledger -l prepend-width -a "(__fish_complete_ledger_opt_args INT)" -d "Reserve INT spaces at the beginning of each line of the output."
|
||||
complete -f -c ledger -l payee-width -a "(__fish_complete_ledger_opt_args INT)" -d "Set the number of columns dedicated to the payee in the register report to INT."
|
||||
complete -f -c ledger -l meta-width -a "(__fish_complete_ledger_opt_args INT)" -d "Specify the width of the Meta column used for the --meta TAG options."
|
||||
complete -f -c ledger -l last -a "(__fish_complete_ledger_opt_args INT)" -d "Report only the last INT entries. Opposite of --first INT. Only useful on a register report. Alias for --tail."
|
||||
complete -f -c ledger -l head -a "(__fish_complete_ledger_opt_args INT)" -d "Print the first INT entries. Opposite of --tail INT. Alias for --first"
|
||||
complete -f -c ledger -l forecast-years -a "(__fish_complete_ledger_opt_args INT)" -d "Forecast at most INT years into the future."
|
||||
complete -f -c ledger -l first -a "(__fish_complete_ledger_opt_args INT)" -d "Print the first INT entries. Opposite of --last INT. Alias for --head."
|
||||
complete -f -c ledger -l depth -a "(__fish_complete_ledger_opt_args INT)" -d "Limit the depth of the account tree. In a balance report, for example, --depth 2 will print balances only for accounts with two levels, i.e. Expenses:Entertainment but not Expenses:Entertainment:Dining. This is a display predicate, which means it only affects display, not the total calculations."
|
||||
complete -f -c ledger -l date-width -a "(__fish_complete_ledger_opt_args INT)" -d "Specify the width, in characters, of the date column in the register report."
|
||||
complete -f -c ledger -l columns -a "(__fish_complete_ledger_opt_args INT)" -d "Make the register report INT characters wide. By default ledger will use all available columns in your terminal."
|
||||
complete -f -c ledger -l amount-width -a "(__fish_complete_ledger_opt_args INT)" -d "Set the width in characters of the amount column in the register report."
|
||||
complete -f -c ledger -l datetime-format -a "(__fish_complete_ledger_opt_args DATETIMEFMT)" -d "Print datetimes using DATETIMEFMT. Refer to strftime(3) for details on the format string syntax."
|
||||
complete -f -c ledger -l debug -a "(__fish_complete_ledger_opt_args STR)" -d "If ledger has been built with debug options this will provide extra data during the run."
|
||||
complete -f -c ledger -l truncate -a "(__fish_complete_ledger_opt_args STR)" -d "Indicates how truncation should happen when the contents of col- umns exceed their width. Valid arguments for STR are leading, middle, and trailing. The default is smarter than any of these three, as it considers sub-names within the account name (that style is called \"abbreviate\")."
|
||||
complete -f -c ledger -l start-of-week -a "(__fish_complete_ledger_opt_args STR)" -d "Use STR as the particular day of the week to start when using the --weekly option. STR can be day names, their abbreviations like \"Mon\", or the weekday number starting at 0 for Sunday."
|
||||
complete -f -c ledger -l pager -a "(__fish_complete_ledger_opt_args STR)" -d "Use STR as the pager program."
|
||||
complete -f -c ledger -l meta -a "(__fish_complete_ledger_opt_args STR)" -d "In the register report, prepend the transaction with the value of the given tag STR."
|
||||
complete -f -c ledger -l master-account -a "(__fish_complete_ledger_opt_args STR)" -d "Prepend all account names with STR"
|
||||
complete -f -c ledger -l inject -a "(__fish_complete_ledger_opt_args STR)" -d "Use STR amounts in calculations. In case you know what amount a transaction should be, but the actual transaction has the wrong value you can use metadata STR to specify the expected amount."
|
||||
complete -f -c ledger -l script -a "(__fish_complete_ledger_opt_args FILE)" -d "Execute a ledger script."
|
||||
complete -f -c ledger -l import -a "(__fish_complete_ledger_opt_args FILE)" -d "Import FILE as Python module."
|
||||
complete -f -c ledger -l input-date-format -a "(__fish_complete_ledger_opt_args DATEFMT)" -d "Specify the input date format for journal entries."
|
||||
complete -f -c ledger -l now -a "(__fish_complete_ledger_opt_args DATE)" -d "Use DATE as the current date. This affects the output when using --period, --begin, --end, or --current to decide which dates lie in the past or future."
|
||||
complete -f -c ledger -l pivot -a "(__fish_complete_ledger_opt_args TAG)" -d "Produce a balance pivot report "around" the given TAG."
|
||||
|
||||
complete -f -c ledger -s T -l total -a "(__fish_complete_ledger_opt_args EXPR)" -d "Define a value expression used to calculate the total in reports."
|
||||
complete -f -c ledger -s t -l amount -a "(__fish_complete_ledger_opt_args EXPR)" -d "Apply the given value expression to the posting amount. Using --amount EXPR you can apply an arbitrary transformation to the postings."
|
||||
complete -f -c ledger -s d -l display -a "(__fish_complete_ledger_opt_args EXPR)" -d "Display lines that satisfy the expression EXPR."
|
||||
complete -f -c ledger -s l -l limit -a "(__fish_complete_ledger_opt_args EXPR)" -d "Limit postings in calculations."
|
||||
complete -f -c ledger -s S -l sort -a "(__fish_complete_ledger_opt_args EXPR)" -d "Sort the register report based on the value expression EXPR."
|
||||
complete -f -c ledger -s f -l file -a "(__fish_complete_ledger_opt_args FILE)" -d "Read journal data from FILE."
|
||||
complete -f -c ledger -s Z -l price-db -a "(__fish_complete_ledger_opt_args FILE)" -d "Set the expected freshness of price quotes, in INT minutes. That is, if the last known quote for any commodity is older than this value, and if --download is being used, then the Internet will be consulted again for a newer price. Otherwise, the old price is still considered to be fresh enough. Alias for --leeway."
|
||||
complete -f -c ledger -s i -l init-file -a "(__fish_complete_ledger_opt_args FILE)" -d "Read FILE before any other ledger file. This file may not con- tain any postings, but it may contain option settings. To spec- ify options in the init file, use the same syntax as the com- mand-line, but put each option on its own line."
|
||||
complete -f -c ledger -s o -l output -a "(__fish_complete_ledger_opt_args FILE)" -d "Redirect the output of ledger to FILE."
|
||||
complete -f -c ledger -s Z -l price-exp -a "(__fish_complete_ledger_opt_args STR)" -d "Set the expected freshness of price quotes, in INT minutes. That is, if the last known quote for any commodity is older than this value, and if --download is being used, then the Internet will be consulted again for a newer price. Otherwise, the old price is still considered to be fresh enough. Alias for --leeway."
|
||||
complete -f -c ledger -s p -l period -a "(__fish_complete_ledger_opt_args PERIOD)" -d "Define a period expression that sets the time period during which transactions are to be accounted. For a register report only the transactions that satisfy the period expression with be displayed. For a balance report only those transactions will be accounted in the final balances."
|
||||
complete -f -c ledger -s Z -l leeway -a "(__fish_complete_ledger_opt_args INT)" -d "Alias for --price-expr."
|
||||
complete -f -c ledger -s F -l format -a "(__fish_complete_ledger_opt_args FMT)" -d "Use the given format string FMT to print output."
|
||||
complete -f -c ledger -s X -l exchange -a "(__fish_complete_ledger_opt_args COMMODITY)" -d "Display values in terms of the given COMMODITY. The latest available price is used."
|
||||
complete -f -c ledger -s e -l end -a "(__fish_complete_ledger_opt_args DATE)" -d "Constrain the report so that transactions on or after DATE are not considered."
|
||||
complete -f -c ledger -s b -l begin -a "(__fish_complete_ledger_opt_args DATE)" -d "Specify the start DATE of all calculations. Transactions before that date will be ignored."
|
||||
complete -f -c ledger -s y -l date-format -a "(__fish_complete_ledger_opt_args DATEFMT)" -d "Print dates using DATEFMT. Refer to strftime(3) for details on the format string syntax."
|
||||
|
||||
|
||||
complete -f -c ledger -n '__fish_ledger_needs_command' -a '(__fish_complete_ledger_commands)'
|
||||
complete -f -c ledger -n "__fish_ledger_command_is search" -a "(__fish_complete_ledger_expr all)"
|
||||
40
modules/programs/rofi/default.nix
Normal file
40
modules/programs/rofi/default.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.rofi;
|
||||
in
|
||||
{
|
||||
options.my.programs.rofi = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.moritz = {
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
package =
|
||||
pkgs.rofi.override { plugins = with pkgs; [ rofi-calc rofi-emoji ]; };
|
||||
extraConfig = { combi-modi = "drun,window,emoji"; };
|
||||
};
|
||||
home.packages = with pkgs; [
|
||||
(lib.mkIf config.networking.networkmanager.enable networkmanager_dmenu)
|
||||
];
|
||||
xdg = {
|
||||
enable = true;
|
||||
configFile."networkmanager-dmenu/config.ini".text = ''
|
||||
[dmenu]
|
||||
dmenu_command = rofi
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
128
modules/programs/rofi/dracula.rasi
Normal file
128
modules/programs/rofi/dracula.rasi
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
* {
|
||||
/* 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-text {
|
||||
border: 0;
|
||||
padding: 1px ;
|
||||
text-color: @foreground;
|
||||
}
|
||||
#element-text normal.normal {
|
||||
background-color: @background;
|
||||
}
|
||||
#element-text normal.urgent {
|
||||
background-color: @urgent-background;
|
||||
text-color: @urgent-foreground;
|
||||
}
|
||||
#element-text normal.active {
|
||||
backgroundr: @active-background;
|
||||
}
|
||||
#element-text selected.normal {
|
||||
background-color: @selected-background;
|
||||
}
|
||||
#element-text selected.urgent {
|
||||
background-color: @selected-urgent-background;
|
||||
}
|
||||
#element-text selected.active {
|
||||
background-color: @selected-active-background;
|
||||
}
|
||||
#element-text alternate.normal {
|
||||
background-color: @background;
|
||||
}
|
||||
#element-text alternate.urgent {
|
||||
background-color: @urgent-background;
|
||||
}
|
||||
#element-text alternate.active {
|
||||
background-color: @active-background;
|
||||
}
|
||||
#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;
|
||||
}
|
||||
87
modules/programs/spotify.nix
Normal file
87
modules/programs/spotify.nix
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.spotify;
|
||||
in
|
||||
{
|
||||
options.my.programs.spotify = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
age.secrets.spotifyd = {
|
||||
file = ../../secrets/spotifyd.age;
|
||||
owner = "1000";
|
||||
};
|
||||
home-manager.users.moritz = {
|
||||
home.packages = with pkgs; [ spotify-tui sptlrx ];
|
||||
services.spotifyd = {
|
||||
enable = true;
|
||||
package = pkgs.spotifyd.override { withMpris = true; };
|
||||
settings = {
|
||||
global = {
|
||||
# A command that gets executed and can be used to
|
||||
# retrieve your username.
|
||||
username_cmd = "${pkgs.coreutils}/bin/head -n 1 /run/agenix/spotifyd";
|
||||
|
||||
# A command that gets executed and can be used to
|
||||
# retrieve your password.
|
||||
password_cmd = "${pkgs.coreutils}/bin/tail -n 1 /run/agenix/spotifyd";
|
||||
|
||||
# The name that gets displayed under the connect tab on
|
||||
# official clients. Spaces are not allowed!
|
||||
device_name = "spotifyd";
|
||||
|
||||
# The audio bitrate. 96, 160 or 320 kbit/s
|
||||
bitrate = 320;
|
||||
|
||||
# Volume on startup between 0 and 100
|
||||
initial_volume = "71";
|
||||
|
||||
# The directory used to cache audio data.
|
||||
cache_path = "/tmp/spotifyd-cache";
|
||||
|
||||
# The displayed device type in Spotify clients.
|
||||
device_type = "computer";
|
||||
|
||||
# set backend to pulseaudio
|
||||
backend = "pulseaudio";
|
||||
};
|
||||
};
|
||||
};
|
||||
xdg.configFile."spotify-tui/config.yml".text = ''
|
||||
# Dracula theme
|
||||
theme:
|
||||
active: "139,233,253" # current playing song in list
|
||||
banner: "80,250,123" # the "spotify-tui" banner on launch
|
||||
error_border: "241,250,140" # error dialog border
|
||||
error_text: "248,248,242" # error message text (e.g. "Spotify API
|
||||
# reported error 404")
|
||||
hint: "241,250,140" # hint text in errors
|
||||
hovered: "255,184,108" # hovered pane border
|
||||
inactive: "248,248,242" # borders of inactive panes
|
||||
playbar_background: "68,71,90" # background of progress bar
|
||||
playbar_progress: "248,248,242" # filled-in part of the progress bar
|
||||
playbar_progress_text: "248,248,242" # song length and time played/left
|
||||
# indicator in the progress bar
|
||||
playbar_text: "248,248,242" # artist name in player pane
|
||||
selected: "80,250,123" # a) selected pane border, b) hovered item
|
||||
# in list, & c) track title in player
|
||||
text: "248,248,242" # text in panes
|
||||
header: "248,248,242" # header text in panes (e.g. 'Title',
|
||||
# 'Artist', etc.)
|
||||
behavior:
|
||||
volume_increment: 5
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
87
modules/programs/sway.nix
Normal file
87
modules/programs/sway.nix
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.sway;
|
||||
in
|
||||
{
|
||||
options.my.programs.sway = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
};
|
||||
environment.loginShellInit = ''
|
||||
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
|
||||
exec sway
|
||||
fi
|
||||
'';
|
||||
home-manager.users.moritz = {
|
||||
home.packages = with pkgs; [ wl-clipboard wofi waybar feh ];
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
height = 30;
|
||||
output = [ "eDP-1" "HDMI-A-1" ];
|
||||
modules-left = [ "sway/workspaces" "sway/mode" "wlr/taskbar" ];
|
||||
modules-center = [ "sway/window" "custom/hello-from-waybar" ];
|
||||
modules-right = [ "mpd" "custom/mymodule#with-css-id" "temperature" ];
|
||||
"sway/workspaces" = { all-outputs = true; };
|
||||
};
|
||||
};
|
||||
};
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
config = {
|
||||
input = {
|
||||
"*" = { xkb_layout = "de"; };
|
||||
"type:touchpad" = {
|
||||
natural_scroll = "enabled";
|
||||
middle_emulation = "enabled";
|
||||
};
|
||||
};
|
||||
terminal = "kitty";
|
||||
menu = "wofi --show drun";
|
||||
modifier = "Mod4";
|
||||
gaps = {
|
||||
inner = 5;
|
||||
outer = 3;
|
||||
smartBorders = "on";
|
||||
};
|
||||
bars = [ ];
|
||||
keybindings = lib.mkOptionDefault {
|
||||
inherit
|
||||
(config.home-manager.users.moritz.wayland.windowManager.sway.config)
|
||||
modifier
|
||||
;
|
||||
"${modifier}+f" = "firefox";
|
||||
"${modifier}+e" = "emacsclient -c -a emacs";
|
||||
};
|
||||
startup = [
|
||||
{
|
||||
command = "systemctl --user restart waybar";
|
||||
always = true;
|
||||
}
|
||||
{ command = "synology-drive"; }
|
||||
{ command = "randomWallpaper"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
32
modules/programs/thunar.nix
Normal file
32
modules/programs/thunar.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.thunar;
|
||||
in
|
||||
{
|
||||
options.my.programs.thunar = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
xfce.exo
|
||||
xfce.thunar
|
||||
xfce.tumbler
|
||||
xfce.xfconf
|
||||
];
|
||||
services.gvfs = {
|
||||
enable = true;
|
||||
package = lib.mkForce pkgs.gnome3.gvfs;
|
||||
};
|
||||
};
|
||||
}
|
||||
29
modules/programs/vim.nix
Normal file
29
modules/programs/vim.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.vim;
|
||||
in
|
||||
{
|
||||
options.my.programs.vim = {
|
||||
enable = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
example = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.moritz.programs.neovim = {
|
||||
enable = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
withNodeJs = true;
|
||||
withPython3 = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
56
modules/programs/xmonad/default.nix
Normal file
56
modules/programs/xmonad/default.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.xmonad;
|
||||
in
|
||||
{
|
||||
options.my.programs.xmonad = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services = {
|
||||
xserver = {
|
||||
enable = true;
|
||||
layout = "de";
|
||||
|
||||
displayManager = {
|
||||
defaultSession = "none+xmonad";
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "moritz";
|
||||
};
|
||||
lightdm.enable = true;
|
||||
};
|
||||
windowManager.xmonad.enable = true;
|
||||
};
|
||||
};
|
||||
home-manager.users.moritz =
|
||||
let
|
||||
xmonadPackages = haskellPackages: [
|
||||
haskellPackages.xmonad-contrib
|
||||
haskellPackages.xmonad-extras
|
||||
haskellPackages.xmonad
|
||||
haskellPackages.xmobar
|
||||
];
|
||||
in
|
||||
{
|
||||
xsession.windowManager.xmonad = {
|
||||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
config = ./xmonad.hs;
|
||||
# extraPackages = xmonadPackages;
|
||||
};
|
||||
programs.xmobar.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
39
modules/programs/xmonad/xmonad.hs
Normal file
39
modules/programs/xmonad/xmonad.hs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import XMonad
|
||||
( Choose,
|
||||
Default (def),
|
||||
Full,
|
||||
KeyMask,
|
||||
Mirror,
|
||||
Tall,
|
||||
X,
|
||||
XConfig (modMask, terminal),
|
||||
mod4Mask,
|
||||
spawn,
|
||||
xmonad,
|
||||
)
|
||||
import XMonad.Hooks.EwmhDesktops (ewmh)
|
||||
import XMonad.Util.EZConfig (additionalKeysP)
|
||||
|
||||
myModMask :: KeyMask
|
||||
myModMask = mod4Mask
|
||||
|
||||
myTerminal :: String
|
||||
myTerminal = "kitty"
|
||||
|
||||
myKeys :: [(String, X ())]
|
||||
myKeys =
|
||||
[ ("M-d", spawn "rofi -show combi"),
|
||||
("M-e", spawn "emacsclient -c -a emacs"),
|
||||
("M-f", spawn "firefox")
|
||||
]
|
||||
|
||||
myConfig :: (XConfig (Choose Tall (Choose (Mirror Tall) Full)))
|
||||
myConfig =
|
||||
def
|
||||
{ modMask = myModMask,
|
||||
terminal = myTerminal
|
||||
}
|
||||
`additionalKeysP` myKeys
|
||||
|
||||
main :: IO ()
|
||||
main = xmonad $ ewmh $ ewmhFullscreen myConfig
|
||||
31
modules/programs/zathura.nix
Normal file
31
modules/programs/zathura.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.zathura;
|
||||
in
|
||||
{
|
||||
options.my.programs.zathura = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.moritz.programs.zathura = {
|
||||
enable = true;
|
||||
options = {
|
||||
recolor = true;
|
||||
adjust-open = "width";
|
||||
font = "Jetbrains Mono 9";
|
||||
selection-clipboard = "clipboard";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
49
modules/programs/zsh.nix
Normal file
49
modules/programs/zsh.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, inputs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.programs.zsh;
|
||||
shellConfig = config.my.shell;
|
||||
in
|
||||
{
|
||||
options.my.programs.zsh = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.pathsToLink = [ "/share/zsh" ];
|
||||
users.users.moritz.shell = pkgs.zsh;
|
||||
home-manager.users.moritz.programs = {
|
||||
zsh = {
|
||||
enable = true;
|
||||
dotDir = ".config/zsh";
|
||||
history.expireDuplicatesFirst = true;
|
||||
localVariables = shellConfig.variables;
|
||||
shellAliases = lib.trivial.mergeAttrs shellConfig.aliases shellConfig.abbreviations;
|
||||
enableSyntaxHighlighting = true;
|
||||
enableAutosuggestions = true;
|
||||
enableCompletion = true;
|
||||
initExtra = ''
|
||||
function nix-which() {
|
||||
readlink -f $(which $1)
|
||||
}
|
||||
'';
|
||||
plugins = [
|
||||
{
|
||||
name = "forgit";
|
||||
src = inputs.forgit-git;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue