feat: more cleanup

main
Ricard Illa 2023-07-23 17:07:50 +02:00
parent d23c70e2a2
commit 66b0d86c42
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
21 changed files with 862 additions and 1624 deletions

View File

@ -1,7 +1,6 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = [ ./nixos.nix ]; imports = [ ./common.nix ];
# programs.alacritty.settings.font.size = 9;
programs.alacritty.settings.font.size = 7; programs.alacritty.settings.font.size = 7;
} }

View File

@ -44,6 +44,10 @@
family = "Hack Nerd Font"; family = "Hack Nerd Font";
style = "Italic"; style = "Italic";
}; };
offset = {
x = 0;
y = 0;
};
}; };
selection = { save_to_clipboard = true; }; selection = { save_to_clipboard = true; };
shell = { shell = {

View File

@ -1,15 +0,0 @@
{ config, pkgs, ... }:
{
imports = [ ./common.nix ];
programs.alacritty = {
settings = {
font = {
offset = {
x = 0;
y = 0;
};
};
};
};
}

View File

@ -1,6 +1,6 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = [ ./nixos.nix ]; imports = [ ./common.nix ];
programs.alacritty.settings.font.size = 7.5; programs.alacritty.settings.font.size = 7.5;
} }

View File

@ -1,239 +0,0 @@
{ config, pkgs, ... }:
let
calendars = "${config.home.homeDirectory}/Calendars";
contacts = "${config.home.homeDirectory}/Contacts";
addressbook = "${config.home.homeDirectory}/.abook/addressbook";
pass = "${pkgs.pass}/bin/pass";
tokens = "${config.home.homeDirectory}/.vdirsyncer/tokens/";
in {
home.file.".config/vdirsyncer/config".text = ''
[general]
status_path = "${config.home.homeDirectory}/.vdirsyncer/status/"
#############
# nextcloud #
#############
## calendar
[pair nextcloud_calendar]
a = "nextcloud_calendar_local"
b = "nextcloud_calendar_remote"
collections = ["personal", "contact_birthdays", "yoga", "events"]
metadata = ["color"]
[storage nextcloud_calendar_local]
type = "filesystem"
path = "${calendars}/nextcloud/"
fileext = ".ics"
[storage nextcloud_calendar_remote]
type = "caldav"
url = "https://nextcloud.monotremata.xyz/"
username = "rilla"
password.fetch = ["command", "${pass}", "narwhal/nextcloud.monotremata.xyz/rilla"]
## contacts
[pair nextcloud_contacts]
a = "nextcloud_contacts_local"
b = "nextcloud_contacts_remote"
collections = ["contacts"]
[storage nextcloud_contacts_local]
type = "filesystem"
path = "${contacts}/nextcloud/"
fileext = ".vcf"
[storage nextcloud_contacts_remote]
type = "carddav"
url = "https://nextcloud.monotremata.xyz/"
username = "rilla"
password.fetch = ["command", "${pass}", "narwhal/nextcloud.monotremata.xyz/rilla"]
##########
# google #
##########
## calendar
[pair google_calendar_sync]
a = "google_calendar_remote"
b = "google_calendar_local"
collections = [["gcal", "r.illa.pujagut@gmail.com", "r.illa.pujagut@gmail.com"]]
[storage google_calendar_local]
type = "filesystem"
path = "${calendars}/google/"
fileext = ".ics"
[storage google_calendar_remote]
type = "google_calendar"
token_file = "${tokens}/goole_calendar"
client_id.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_id"]
client_secret.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_secret"]
## contacts
[pair google_contacts]
a = "google_contacts_local"
b = "google_contacts_remote"
collections = [["gcontacts", "default", "default"]]
[storage google_contacts_local]
type = "filesystem"
path = "${contacts}/google/"
fileext = ".vcf"
[storage google_contacts_remote]
type = "google_contacts"
token_file = "${tokens}/google_contacts"
client_id.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_id"]
client_secret.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_secret"]
###########
# trakken #
###########
## calendar
[pair trakken_calendar_sync]
a = "trakken_calendar_remote"
b = "trakken_calendar_local"
collections = [["trakken_cal", "ricard@trkkn.com", "ricard@trkkn.com"]]
[storage trakken_calendar_local]
type = "filesystem"
path = "${calendars}/trakken/"
fileext = ".ics"
[storage trakken_calendar_remote]
type = "google_calendar"
token_file = "${tokens}/trakken_calendar"
client_id.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_id"]
client_secret.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_secret"]
## contacts
[pair trakken_contacts]
a = "trakken_contacts_local"
b = "trakken_contacts_remote"
collections = [["trakken_contacts", "default", "default"]]
[storage trakken_contacts_local]
type = "filesystem"
path = "${contacts}/trakken"
fileext = ".vcf"
[storage trakken_contacts_remote]
type = "google_contacts"
token_file = "${tokens}/trakken_contacts"
client_id.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_id"]
client_secret.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_secret"]
'';
home.file.".config/khal/config".text = ''
[calendars]
[[default]]
path = ${calendars}/nextcloud/personal/
color = dark green
[[birthdays]]
path = ${calendars}/nextcloud/contact_birthdays/
color = dark green
[[google]]
path = ${calendars}/google/r.illa.pujagut@gmail.com/
color = dark blue
[[trakken]]
path = ${calendars}/trakken/ricard@trkkn.com/
color = dark red
[[yoga]]
path = ${calendars}/nextcloud/yoga/
color = dark magenta
[[events]]
path = ${calendars}/nextcloud/events
color = brown
# supported colors:
# black, white, brown, yellow, dark gray, dark green, dark blue,
# light gray, light green, light blue, dark magenta, dark cyan, dark red,
# light magenta, light cyan, light red.
[view]
dynamic_days = True
frame = color
theme = dark
[locale]
default_timezone = Europe/Madrid
local_timezone = Europe/Madrid
timeformat = %H:%M
dateformat= %m-%d
longdateformat= %Y-%m-%d
datetimeformat= %m-%d %H:%M
longdatetimeformat= %Y-%m-%d %H:%M
'';
home.file.".config/khard/khard.conf".text = ''
[addressbooks]
[[default]]
path = ${contacts}/nextcloud/contacts/
[[google]]
path = ${contacts}/google/default/
[[trakken]]
path = ${contacts}/trakken/default/
[general]
debug = no
default_action = list
# These are either strings or comma seperated lists
editor = vim, -i, NONE
merge_editor = vimdiff
[contact table]
# display names by first or last name: first_name / last_name / formatted_name
display = first_name
# group by address book: yes / no
group_by_addressbook = no
# reverse table ordering: yes / no
reverse = no
# append nicknames to name column: yes / no
show_nicknames = no
# show uid table column: yes / no
show_uids = yes
# sort by first or last name: first_name / last_name / formatted_name
sort = last_name
# localize dates: yes / no
localize_dates = yes
# set a comma separated list of preferred phone number types in descending priority
# or nothing for non-filtered alphabetical order
preferred_phone_number_type = pref, cell, home
# set a comma separated list of preferred email address types in descending priority
# or nothing for non-filtered alphabetical order
preferred_email_address_type = pref, work, home
[vcard]
# extend contacts with your own private objects
# these objects are stored with a leading "X-" before the object name in the vcard files
# every object label may only contain letters, digits and the - character
# example:
# private_objects = Jabber, Skype, Twitter
# default: , (the empty list)
private_objects = Jabber, Skype, Twitter
# preferred vcard version: 3.0 / 4.0
preferred_version = 3.0
# Look into source vcf files to speed up search queries: yes / no
search_in_source_files = no
# skip unparsable vcard files: yes / no
skip_unparsable = no
'';
}

View File

@ -1,12 +1,246 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
calendars = "${config.home.homeDirectory}/Calendars";
contacts = "${config.home.homeDirectory}/Contacts"; contacts = "${config.home.homeDirectory}/Contacts";
addressbook = "${config.home.homeDirectory}/.abook/addressbook"; addressbook = "${config.home.homeDirectory}/.abook/addressbook";
davsync = pkgs.callPackage ./davsync.nix { davsync = pkgs.callPackage ./davsync.nix {
inherit config pkgs contacts addressbook; inherit config pkgs contacts addressbook;
}; };
in { pass = "${pkgs.pass}/bin/pass";
imports = [ ./common.nix ]; tokens = "${config.home.homeDirectory}/.vdirsyncer/tokens/";
in
{
home.packages = [ davsync pkgs.vdirsyncer pkgs.khal pkgs.khard pkgs.abook ]; home.packages = [ davsync pkgs.vdirsyncer pkgs.khal pkgs.khard pkgs.abook ];
home.file.".config/vdirsyncer/config".text = ''
[general]
status_path = "${config.home.homeDirectory}/.vdirsyncer/status/"
#############
# nextcloud #
#############
## calendar
[pair nextcloud_calendar]
a = "nextcloud_calendar_local"
b = "nextcloud_calendar_remote"
collections = ["personal", "contact_birthdays", "yoga", "events"]
metadata = ["color"]
[storage nextcloud_calendar_local]
type = "filesystem"
path = "${calendars}/nextcloud/"
fileext = ".ics"
[storage nextcloud_calendar_remote]
type = "caldav"
url = "https://nextcloud.monotremata.xyz/"
username = "rilla"
password.fetch = ["command", "${pass}", "narwhal/nextcloud.monotremata.xyz/rilla"]
## contacts
[pair nextcloud_contacts]
a = "nextcloud_contacts_local"
b = "nextcloud_contacts_remote"
collections = ["contacts"]
[storage nextcloud_contacts_local]
type = "filesystem"
path = "${contacts}/nextcloud/"
fileext = ".vcf"
[storage nextcloud_contacts_remote]
type = "carddav"
url = "https://nextcloud.monotremata.xyz/"
username = "rilla"
password.fetch = ["command", "${pass}", "narwhal/nextcloud.monotremata.xyz/rilla"]
##########
# google #
##########
## calendar
[pair google_calendar_sync]
a = "google_calendar_remote"
b = "google_calendar_local"
collections = [["gcal", "r.illa.pujagut@gmail.com", "r.illa.pujagut@gmail.com"]]
[storage google_calendar_local]
type = "filesystem"
path = "${calendars}/google/"
fileext = ".ics"
[storage google_calendar_remote]
type = "google_calendar"
token_file = "${tokens}/goole_calendar"
client_id.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_id"]
client_secret.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_secret"]
## contacts
[pair google_contacts]
a = "google_contacts_local"
b = "google_contacts_remote"
collections = [["gcontacts", "default", "default"]]
[storage google_contacts_local]
type = "filesystem"
path = "${contacts}/google/"
fileext = ".vcf"
[storage google_contacts_remote]
type = "google_contacts"
token_file = "${tokens}/google_contacts"
client_id.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_id"]
client_secret.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_secret"]
###########
# trakken #
###########
## calendar
[pair trakken_calendar_sync]
a = "trakken_calendar_remote"
b = "trakken_calendar_local"
collections = [["trakken_cal", "ricard@trkkn.com", "ricard@trkkn.com"]]
[storage trakken_calendar_local]
type = "filesystem"
path = "${calendars}/trakken/"
fileext = ".ics"
[storage trakken_calendar_remote]
type = "google_calendar"
token_file = "${tokens}/trakken_calendar"
client_id.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_id"]
client_secret.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_secret"]
## contacts
[pair trakken_contacts]
a = "trakken_contacts_local"
b = "trakken_contacts_remote"
collections = [["trakken_contacts", "default", "default"]]
[storage trakken_contacts_local]
type = "filesystem"
path = "${contacts}/trakken"
fileext = ".vcf"
[storage trakken_contacts_remote]
type = "google_contacts"
token_file = "${tokens}/trakken_contacts"
client_id.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_id"]
client_secret.fetch = ["command", "${pass}", "google.com/vdirsyncer/client_secret"]
'';
home.file.".config/khal/config".text = ''
[calendars]
[[default]]
path = ${calendars}/nextcloud/personal/
color = dark green
[[birthdays]]
path = ${calendars}/nextcloud/contact_birthdays/
color = dark green
[[google]]
path = ${calendars}/google/r.illa.pujagut@gmail.com/
color = dark blue
[[trakken]]
path = ${calendars}/trakken/ricard@trkkn.com/
color = dark red
[[yoga]]
path = ${calendars}/nextcloud/yoga/
color = dark magenta
[[events]]
path = ${calendars}/nextcloud/events
color = brown
# supported colors:
# black, white, brown, yellow, dark gray, dark green, dark blue,
# light gray, light green, light blue, dark magenta, dark cyan, dark red,
# light magenta, light cyan, light red.
[view]
dynamic_days = True
frame = color
theme = dark
[locale]
default_timezone = Europe/Madrid
local_timezone = Europe/Madrid
timeformat = %H:%M
dateformat= %m-%d
longdateformat= %Y-%m-%d
datetimeformat= %m-%d %H:%M
longdatetimeformat= %Y-%m-%d %H:%M
'';
home.file.".config/khard/khard.conf".text = ''
[addressbooks]
[[default]]
path = ${contacts}/nextcloud/contacts/
[[google]]
path = ${contacts}/google/default/
[[trakken]]
path = ${contacts}/trakken/default/
[general]
debug = no
default_action = list
# These are either strings or comma seperated lists
editor = vim, -i, NONE
merge_editor = vimdiff
[contact table]
# display names by first or last name: first_name / last_name / formatted_name
display = first_name
# group by address book: yes / no
group_by_addressbook = no
# reverse table ordering: yes / no
reverse = no
# append nicknames to name column: yes / no
show_nicknames = no
# show uid table column: yes / no
show_uids = yes
# sort by first or last name: first_name / last_name / formatted_name
sort = last_name
# localize dates: yes / no
localize_dates = yes
# set a comma separated list of preferred phone number types in descending priority
# or nothing for non-filtered alphabetical order
preferred_phone_number_type = pref, cell, home
# set a comma separated list of preferred email address types in descending priority
# or nothing for non-filtered alphabetical order
preferred_email_address_type = pref, work, home
[vcard]
# extend contacts with your own private objects
# these objects are stored with a leading "X-" before the object name in the vcard files
# every object label may only contain letters, digits and the - character
# example:
# private_objects = Jabber, Skype, Twitter
# default: , (the empty list)
private_objects = Jabber, Skype, Twitter
# preferred vcard version: 3.0 / 4.0
preferred_version = 3.0
# Look into source vcf files to speed up search queries: yes / no
search_in_source_files = no
# skip unparsable vcard files: yes / no
skip_unparsable = no
'';
} }

View File

@ -1,101 +0,0 @@
{ config, pkgs, ... }:
# usage: bemenu [options]
# Options
# -h, --help display this help and exit.
# -v, --version display version.
# -i, --ignorecase match items case insensitively.
# -F, --filter filter entries for a given string.
# -w, --wrap wraps cursor selection.
# -l, --list list items vertically with the given number of lines.
# -p, --prompt defines the prompt text to be displayed.
# -P, --prefix text to show before highlighted item.
# -I, --index select item at index automatically.
# -x, --password hide input.
# -s, --no-spacing disable the title spacing on entries.
# --scrollbar display scrollbar. (none (default), always, autohide)
# --ifne only display menu if there are items.
# --fork always fork. (bemenu-run)
# --no-exec do not execute command. (bemenu-run)
#
# Use BEMENU_BACKEND env variable to force backend:
# curses ncurses based terminal backend
# wayland wayland backend
# x11 x11 backend
#
# If BEMENU_BACKEND is empty, one of the GUI backends is selected automatically.
#
# Backend specific options
# c = ncurses, w == wayland, x == x11
# (...) At end of help indicates the backend support for option.
#
# -b, --bottom appears at the bottom of the screen. (wx)
# -c, --center appears at the center of the screen. (wx)
# -f, --grab show the menu before reading stdin. (wx)
# -n, --no-overlap adjust geometry to not overlap with panels. (w)
# -m, --monitor index of monitor where menu will appear. (wx)
# -H, --line-height defines the height to make each menu line (0 = default height). (wx)
# -M, --margin defines the empty space on either side of the menu. (wx)
# -W, --width-factor defines the relative width factor of the menu (from 0 to 1). (wx)
# -B, --border defines the width of the border in pixels around the menu. (wx)
# --ch defines the height of the cursor (0 = scales with line height). (wx)
# --cw defines the width of the cursor. (wx)
# --hp defines the horizontal padding for the entries in single line mode. (wx)
# --fn defines the font to be used ('name [size]'). (wx)
# --tb defines the title background color. (wx)
# --tf defines the title foreground color. (wx)
# --fb defines the filter background color. (wx)
# --ff defines the filter foreground color. (wx)
# --nb defines the normal background color. (wx)
# --nf defines the normal foreground color. (wx)
# --hb defines the highlighted background color. (wx)
# --hf defines the highlighted foreground color. (wx)
# --fbb defines the feedback background color. (wx)
# --fbf defines the feedback foreground color. (wx)
# --sb defines the selected background color. (wx)
# --sf defines the selected foreground color. (wx)
# --ab defines the alternating background color. (wx)
# --af defines the alternating foreground color. (wx)
# --scb defines the scrollbar background color. (wx)
# --scf defines the scrollbar foreground color. (wx)
# --bdr defines the border color. (wx)
let
bemenuColors = {
titleBackground = "#282828E0";
titleForeground = "#fbf1c7";
filterBackground = "#282828E0";
filterForeground = "#ebdbb2";
normalBackground = "#282828E0";
normalForeground = "#ebdbb2";
highlightedBackground = "#458588E0";
highlightedForeground = "#fbf1c7";
scrollbarBackground = "#282828E0";
scrollbarForeground = "#458588E0";
};
in {
home.packages = [ pkgs.bemenu ];
home.sessionVariables.BEMENU_OPTS = ''
--ignorecase \
--list 20 \
--prompt '' \
--scrollbar none \
--wrap \
--scrollbar autohide \
--no-overlap \
--monitor all \
--fn 'Inter 13px' \
--tb '${bemenuColors.titleBackground}' \
--tf '${bemenuColors.titleForeground}' \
--fb '${bemenuColors.filterBackground}' \
--ff '${bemenuColors.filterForeground}' \
--nb '${bemenuColors.normalBackground}' \
--ab '${bemenuColors.normalBackground}' \
--nf '${bemenuColors.normalForeground}' \
--af '${bemenuColors.normalForeground}' \
--hb '${bemenuColors.highlightedBackground}' \
--hf '${bemenuColors.highlightedForeground}' \
--scb '${bemenuColors.scrollbarBackground}' \
--scf '${bemenuColors.scrollbarForeground}'
'';
}

View File

@ -1,64 +0,0 @@
{ config, pkgs, ... }:
{
imports = [ ./sway.nix ./waybar.nix ./bemenu.nix ];
home.packages = with pkgs; [
swaylock
swayidle
wl-clipboard
wtype
brightnessctl
foot
];
programs.mako = {
enable = true;
actions = true;
anchor = "top-right";
backgroundColor = "#282828E6";
borderColor = "#458588";
borderRadius = 0;
borderSize = 1;
font = "Inter 10";
icons = true;
textColor = "#ebdbb2";
defaultTimeout = 5000;
};
home.file.".config/swaylock/config".text = ''
ignore-empty-password
font=Inter
color=282828E6
inside-color=504945
ring-color=504945
line-color=504945
separator-color=504945
inside-clear-color=FE8019
line-clear-color=FE8019
ring-clear-color=FE8019
inside-ver-color=458588
line-ver-color=458588
ring-ver-color=458588
inside-wrong-color=CC241D
line-wrong-color=CC241D
ring-wrong-color=CC241D
key-hl-color=B8BB26
bs-hl-color=FB4934
text-color=282828
text-clear-color=282828
text-ver-color=282828
text-wrong-color=282828
'';
programs.zsh.loginExtra = ''
[[ -z "''${DISPLAY}" ]] && [[ "$(tty)" = "/dev/tty1" ]] && \
exec ${pkgs.sway}/bin/sway 1> "${config.home.homeDirectory}/.sway-errors" 2>&1
'';
}

View File

@ -1,172 +0,0 @@
{ config, pkgs, ... }:
let
cfg = config.wayland.windowManager.sway.config;
pactl = "${pkgs.pulseaudio}/bin/pactl";
brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
playerctl = "${pkgs.playerctl}/bin/playerctl";
wallpapers = "${config.home.homeDirectory}/Images/wallpapers/enabled";
# # todo: do it properly like in https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/security/pass/rofi-pass.nix
# tessenSrc = builtins.fetchTarball {
# url =
# "https://github.com/ayushnix/tessen/releases/download/v1.3.1/tessen-1.3.1.tar.gz";
# };
# tessen = pkgs.runCommandLocal "tessen" {
# nativeBuildInputs = [ pkgs.makeWrapper ];
# } ''
# install -m755 ${tessenSrc}/tessen -D $out/bin/tessen
# patchShebangs $out/bin/tessen
# wrapProgram $out/bin/tessen \
# --prefix PATH: ${pkgs.lib.makeBinPath [ pkgs.bash ]}
# '';
in {
# home.packages = [ tessen ];
wayland.windowManager.sway = {
enable = true;
wrapperFeatures.gtk = true;
config = {
modifier = "Mod4";
terminal = "alacritty";
menu = "${pkgs.bemenu}/bin/bemenu-run";
left = "h";
down = "j";
up = "k";
right = "l";
output = {
"LVDS-1" = {
resolution = "1366x768";
bg =
"`${pkgs.findutils}/bin/find ${wallpapers} -type f | ${pkgs.coreutils}/bin/shuf -n 1` fill";
};
};
input = {
"type:keyboard" = {
xkb_layout = "us";
xkb_variant = "altgr-intl";
xkb_options = "caps:escape";
};
};
keybindings = {
"${cfg.modifier}+Return" = "exec ${cfg.terminal}";
"${cfg.modifier}+Shift+c" = "kill";
"${cfg.modifier}+r" = "exec ${cfg.menu}";
"${cfg.modifier}+Shift+r" = "reload";
"${cfg.modifier}+Shift+Escape" = "exec ${pkgs.sway}/bin/swaymsg exit";
"${cfg.modifier}+Escape" = "exec ${pkgs.swaylock}/bin/swaylock";
"${cfg.modifier}+${cfg.left}" = "focus left";
"${cfg.modifier}+${cfg.down}" = "focus down";
"${cfg.modifier}+${cfg.up}" = "focus up";
"${cfg.modifier}+${cfg.right}" = "focus right";
"${cfg.modifier}+Shift+${cfg.left}" = "move left";
"${cfg.modifier}+Shift+${cfg.down}" = "move down";
"${cfg.modifier}+Shift+${cfg.up}" = "move up";
"${cfg.modifier}+Shift+${cfg.right}" = "move right";
"${cfg.modifier}+Control+${cfg.left}" = "move workspace to output left";
"${cfg.modifier}+Control+${cfg.down}" = "move workspace to output down";
"${cfg.modifier}+Control+${cfg.up}" = "move workspace to output up";
"${cfg.modifier}+Control+${cfg.right}" =
"move workspace to output right";
"${cfg.modifier}+Shift+w" = "move window to output left";
"${cfg.modifier}+Shift+e" = "move window to output right";
"${cfg.modifier}+w" = "focus output left";
"${cfg.modifier}+e" = "focus output right";
"${cfg.modifier}+1" = "workspace number 1";
"${cfg.modifier}+2" = "workspace number 2";
"${cfg.modifier}+3" = "workspace number 3";
"${cfg.modifier}+4" = "workspace number 4";
"${cfg.modifier}+5" = "workspace number 5";
"${cfg.modifier}+6" = "workspace number 6";
"${cfg.modifier}+7" = "workspace number 7";
"${cfg.modifier}+8" = "workspace number 8";
"${cfg.modifier}+9" = "workspace number 9";
"${cfg.modifier}+Shift+1" = "move container to workspace number 1";
"${cfg.modifier}+Shift+2" = "move container to workspace number 2";
"${cfg.modifier}+Shift+3" = "move container to workspace number 3";
"${cfg.modifier}+Shift+4" = "move container to workspace number 4";
"${cfg.modifier}+Shift+5" = "move container to workspace number 5";
"${cfg.modifier}+Shift+6" = "move container to workspace number 6";
"${cfg.modifier}+Shift+7" = "move container to workspace number 7";
"${cfg.modifier}+Shift+8" = "move container to workspace number 8";
"${cfg.modifier}+Shift+9" = "move container to workspace number 9";
"${cfg.modifier}+b" = "splith";
"${cfg.modifier}+v" = "splitv";
"${cfg.modifier}+s" = "layout stacking";
"${cfg.modifier}+t" = "layout tabbed";
# "${cfg.modifier}+e" = "layout toggle split";
"${cfg.modifier}+m" = "fullscreen toggle";
"${cfg.modifier}+a" = "focus parent";
"${cfg.modifier}+f" = "floating toggle";
# "${cfg.modifier}+space" = "focus mode_toggle";
"${cfg.modifier}+d" = "mode resize";
"${cfg.modifier}+space" = "layout toggle all";
"${cfg.modifier}+Shift+space" = "layout default";
# "${cfg.modifier}+p" = "exec ${tessen}/bin/tessen";
"XF86AudioRaiseVolume" =
"exec ${pactl} set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" =
"exec ${pactl} set-sink-volume @DEFAULT_SINK@ -5%";
"XF86AudioMute" = "exec ${pactl} set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" =
"exec ${pactl} set-source-mute @DEFAULT_SOURCE@ toggle";
"XF86MonBrightnessDown" = "exec ${brightnessctl} set 5%-";
"XF86MonBrightnessUp" = "exec ${brightnessctl} set +5%";
"XF86AudioPlay" = "exec ${playerctl} play-pause";
"XF86AudioNext" = "exec ${playerctl} next";
"XF86AudioPrev" = "exec ${playerctl} previous";
"XF86Search" = "exec ${cfg.menu}";
};
colors = {
focused = rec {
childBorder = "#458588";
background = "#282828";
text = "#fbf1c7";
indicator = "#3c3836";
border = "#83a598";
};
unfocused = rec {
childBorder = "#504945";
background = "#282828";
text = "#ebdbb2";
indicator = "#3c3836";
border = "#bdae93";
};
};
focus.followMouse = true;
window.border = 3;
workspaceAutoBackAndForth = true;
bars = [ ];
startup = [{
command = "${pkgs.autotiling}/bin/autotiling";
always = true;
}];
};
};
}

View File

@ -1,150 +0,0 @@
{ config, pkgs, ... }:
{
programs.waybar = {
enable = true;
settings = [
{
modules-left = [ "sway/workspaces" ];
modules-center = [ "sway/window" ];
modules-right = [ "tray" "pulseaudio" "battery" "network" "clock" ];
modules = {
clock.format = "{: %m/%d <span color=\"#a89984\">|</span> %H:%M}";
network = {
format-icons = [
"<span color=\"#fb4944\"></span>"
"<span color=\"#fabd2f\"></span>"
"<span color=\"#b8bb26\"></span>"
];
format = "({ifname})";
format-wifi = "{icon} {signalStrength}";
format-disconnected = "<span color=\"#a89974\"></span>";
format-ethernet = "";
};
battery = {
states = {
good = 95;
warning = 50;
critical = 20;
};
format-icons = {
discharging = [
"<span color=\"#fb4944\"></span>"
"<span color=\"#fb4944\"></span>"
"<span color=\"#fb4944\"></span>"
"<span color=\"#fabd2f\"></span>"
"<span color=\"#fabd2f\"></span>"
"<span color=\"#fabd2f\"></span>"
"<span color=\"#b8bb26\"></span>"
"<span color=\"#b8bb26\"></span>"
"<span color=\"#b8bb26\"></span>"
]; # 
charging = [
"<span color=\"#fb4944\"></span>"
"<span color=\"#fb4944\"></span>"
"<span color=\"#fabd2f\"></span>"
"<span color=\"#fabd2f\"></span>"
"<span color=\"#b8bb26\"></span>"
"<span color=\"#b8bb26\"></span>"
]; # 
};
format = " {capacity}";
format-full = "";
format-good-charging = "";
format-plugged = "";
format-charging = "{icon} {capacity}";
format-discharging = "{icon} {capacity} ({time})";
interval = 5;
};
pulseaudio = {
states = {
high = 101;
very_high = 111;
};
format-icons = [
"<span color=\"#a89974\"></span>"
"<span color=\"#83a587\">奔</span>"
"<span color=\"#b8bb26\"></span>"
];
format = "{icon} {volume}";
format-bluetooth = "{icon} {volume}";
format-muted = "";
};
tray.icon-size = 14;
};
}
];
style = ''
* {
border-radius: 0px;
border: none;
font-family: Inter, "mplus Nerd Font";
font-size: 13px;
min-height: 0;
}
window#waybar {
background-color: #282828;
color: #ebdbb2;
}
#workspaces {
padding: 0px;
margin: 0px;
}
#workspaces button {
padding: 0px;
margin: 0px;
background: transparent;
}
#window {
color: #fbf1c7;
padding-left: 10px;
padding-right: 10px;
}
#workspaces button.focused {
background-color: #458588;
color: #fbf1c7;
}
#tray,
#pulseaudio,
#battery,
#network,
#cpu,
#memory,
#clock {
color: #fbf1c7;
padding-left: 5px;
padding-right: 5px;
}
#tray,
#pulseaudio,
#battery,
#cpu,
#memory,
#network {
border-right: 1px solid #a89984;
}
#pulseaudio.high {
color: #fabd2f;
}
#pulseaudio.very_high {
color: #fb4944;
}
#pulseaudio.muted {
color: #a8997a;
}
'';
systemd.enable = true;
};
}

View File

@ -1,27 +0,0 @@
{ config, pkgs, ... }:
let woodpecker-cli = pkgs.callPackage ./woodpecker-cli.nix { inherit pkgs; };
in {
home.packages = [ pkgs.diff-so-fancy pkgs.tig pkgs.tea woodpecker-cli ];
programs.git = {
enable = true;
userName = "Ricard Illa";
signing = {
key = "0x8333CFB0B9D3244D";
signByDefault = true;
};
# delta = maybe?
extraConfig = {
core = {
editor = "${pkgs.neovim}/bin/nvim";
pager =
"${pkgs.diff-so-fancy}/bin/diff-so-fancy | ${pkgs.less}/bin/less --tabs=4 -RFX";
};
color.ui = true;
pull.rebase = false;
init.defaultBranch = "main";
diff-so-fancy.stripLeadingSymbols = false;
};
};
}

View File

@ -1,6 +1,28 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ let woodpecker-cli = pkgs.callPackage ./woodpecker-cli.nix { inherit pkgs; };
imports = [ ./common.nix ]; in {
programs.git.userEmail = "rilla@monotremata.xyz"; home.packages = [ pkgs.diff-so-fancy pkgs.tig pkgs.tea woodpecker-cli ];
programs.git = {
enable = true;
userName = "Ricard Illa";
userEmail = "rilla@monotremata.xyz";
signing = {
key = "0x8333CFB0B9D3244D";
signByDefault = true;
};
# delta = maybe?
extraConfig = {
core = {
editor = "${pkgs.neovim}/bin/nvim";
pager =
"${pkgs.diff-so-fancy}/bin/diff-so-fancy | ${pkgs.less}/bin/less --tabs=4 -RFX";
};
color.ui = true;
pull.rebase = false;
init.defaultBranch = "main";
diff-so-fancy.stripLeadingSymbols = false;
};
};
} }

View File

@ -1,6 +0,0 @@
{ config, pkgs, ... }:
{
imports = [ ./common.nix ];
programs.git.userEmail = "ricard@trkkn.com";
}

View File

@ -1,533 +0,0 @@
{ config, pkgs, ... }:
let
gpgKey = "B51D4548A4846E3C8D115C808333CFB0B9D3244D";
personalSignature = ''
Ricard Illa
https://monotremata.xyz
http://zswm576cm7wgmgcwluy4l4ixkfasj25taqbn2r5pnrrj552l263ff2qd.onion
public key fingerprint: B51D4548A4846E3C8D115C808333CFB0B9D3244D
'';
workSignature = ''
Ricard Illa
Data Engineer
Trakken GmbH
- Sucursal en España
Carrer de Sardenya 229
08013 Barcelona
E-mail:ricard@trkkn.com
Web:www.trkkn.com
___________________________________________________________
HRB 104862, Amtsgericht Hamburg
Managing Directors: Timo Aden, Lennart Paulsen
___________________________________________________________
'';
accountSignature = { showSignature ? "append", text ? "" }: {
showSignature = showSignature;
text = text;
};
pwCmd = x: "${pkgs.pass}/bin/pass ${x}";
defaultAccountSettings = { accountEmail
, mailboxes ? ''"=Inbox" "=Archive" "=Drafts" "=Junk" "=Sent" "=Trash"''
, smtpHost ? "mail.monotremata.xyz", imapHost ? "mail.monotremata.xyz" }: {
primary = false;
realName = "Ricard Illa";
aliases = [ ];
address = accountEmail;
userName = accountEmail;
neomutt = {
enable = true;
extraConfig = ''
unmailboxes *
mailboxes ${mailboxes}
set status_format = "[ ${accountEmail} ] [ %f ] [%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]%>%?p?( %p postponed )?"
'';
sendMailCommand = "msmtp -a ${accountEmail}";
};
signature = accountSignature { text = personalSignature; };
mbsync = {
enable = true;
create = "both";
expunge = "both";
flatten = ".";
patterns = [ "*" ];
remove = "both";
};
gpg = {
encryptByDefault = false;
signByDefault = true;
key = gpgKey;
};
msmtp.enable = true;
smtp = {
host = smtpHost;
tls = {
enable = true;
useStartTls = true;
};
port = 587;
};
imap = {
host = imapHost;
tls.enable = true;
port = 993;
};
notmuch.enable = true;
};
switchAccountMacro = i: x: {
map = [ "index" "pager" ];
key = "i${i}";
action =
"<enter-command>source ${config.xdg.configHome}/neomutt/${x}<enter><change-folder>!<enter><check-stats>";
};
in {
accounts.email.accounts = {
"rilla@monotremata.xyz" =
defaultAccountSettings { accountEmail = "rilla@monotremata.xyz"; } // {
primary = true;
passwordCommand = pwCmd "mail.monotremata.xyz/rilla@monotremata.xyz";
};
"r.illa.pujagut@gmail.com" = defaultAccountSettings {
accountEmail = "r.illa.pujagut@gmail.com";
mailboxes = ''
"=INBOX" "=[Gmail].Drafts" "=[Gmail].Sent Mail" "=[Gmail].Trash" "=[Gmail].Spam" "=[Gmail].All Mail"'';
smtpHost = "smtp.gmail.com";
imapHost = "imap.gmail.com";
} // {
passwordCommand = pwCmd "google.com/mutt/r.illa.pujagut@gmail.com";
};
"ricard@trkkn.com" = defaultAccountSettings {
accountEmail = "ricard@trkkn.com";
mailboxes = ''
"=INBOX" "=[Gmail].Drafts" "=[Gmail].Sent Mail" "=[Gmail].Trash" "=[Gmail].Spam" "=[Gmail].All Mail"'';
smtpHost = "smtp.gmail.com";
imapHost = "imap.gmail.com";
} // {
signature = accountSignature { text = workSignature; };
aliases = [ "ricard@trakken.es" ];
passwordCommand = pwCmd "trakken/google.com/mutt/ricard@trkkn.com";
};
"accounts@monotremata.xyz" =
defaultAccountSettings { accountEmail = "accounts@monotremata.xyz"; } // {
realName = "monotremata.xyz";
signature = accountSignature { showSignature = "none"; };
passwordCommand = pwCmd "mail.monotremata.xyz/accounts@monotremata.xyz";
};
"admin@monotremata.xyz" =
defaultAccountSettings { accountEmail = "admin@monotremata.xyz"; } // {
aliases = [
"postmaster@monotremata.xyz"
"hostmaster@monotremata.xyz"
"webmaster@monotremata.xyz"
"abuse@monotremata.xyz"
];
realName = "monotremata.xyz";
signature = accountSignature { text = "admin@monotremata.xyz"; };
passwordCommand = pwCmd "mail.monotremata.xyz/admin@monotremata.xyz";
};
};
programs.neomutt = {
enable = true;
editor = "nvim";
sort = "threads";
# vimKeys = true;
sidebar = {
enable = true;
shortPath = true;
width = 20;
format = "%D%?F? [%F]?%* %?N?%N/? %?S?%S?";
};
extraConfig = ''
alternative_order text/html text/plain text/enriched text/*
auto_view text/html application/gpg-encrypted text/calendar application/ics
# Default index colors:
color index yellow default '.*'
color index_author red default '.*'
color index_number blue default
color index_subject cyan default '.*'
# New mail is boldened:
color index brightyellow black "~N"
color index_author brightred black "~N"
color index_subject brightcyan black "~N"
# Tagged mail is highlighted:
color index brightyellow blue "~T"
color index_author brightred blue "~T"
color index_subject brightcyan blue "~T"
# Other colors and aesthetic settings:
mono bold bold
mono underline underline
mono indicator reverse
mono error bold
color normal default default
color indicator brightblack white
color sidebar_highlight red default
color sidebar_divider brightblack black
color sidebar_flagged red black
color sidebar_new green black
color normal brightyellow default
color error red default
color tilde black default
color message cyan default
color markers red white
color attachment white default
color search brightmagenta default
color status brightyellow black
color hdrdefault brightgreen default
color quoted green default
color quoted1 blue default
color quoted2 cyan default
color quoted3 yellow default
color quoted4 red default
color quoted5 brightred default
color signature brightgreen default
color bold black default
color underline black default
color normal default default
# Regex highlighting:
color header blue default ".*"
color header brightmagenta default "^(From)"
color header brightcyan default "^(Subject)"
color header brightwhite default "^(CC|BCC)"
color body brightred default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # Email addresses
color body brightblue default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" # URL
color body green default "\`[^\`]*\`" # Green text between ` and `
color body brightblue default "^# \.*" # Headings as bold blue
color body brightcyan default "^## \.*" # Subheadings as bold cyan
color body brightgreen default "^### \.*" # Subsubheadings as bold green
color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow
color body brightcyan default "[;:][-o][)/(|]" # emoticons
color body brightcyan default "[;:][)(|]" # emoticons
color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon?
color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon?
color body red default "(BAD signature)"
color body cyan default "(Good signature)"
color body brightblack default "^gpg: Good signature .*"
color body brightyellow default "^gpg: "
color body brightyellow red "^gpg: BAD signature from.*"
mono body bold "^gpg: Good signature"
mono body bold "^gpg: BAD signature from.*"
color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
set fast_reply # skip to compose when replying
set fcc_attach # save attachments with the body
set forward_quote # include message in forwards
set reverse_name # reply as whomever it was to
set include # include message in replies
set uncollapse_jump
set sort_re
set quit
set beep_new
'';
settings = {
# set mailcap_path = /usr/local/share/mutt-wizard/mailcap:$mailcap_path # todo
mime_type_query_command = ''"${pkgs.file}/bin/file --mime-type -b %s"'';
date_format = ''"%d.%m.%Y %H:%M"'';
index_format = ''"%2C %Z %?X?A& ? %D %-15.15F %s (%-4.4c)"'';
rfc2047_parameters = "yes";
sleep_time = "0"; # Pause 0 seconds for informational messages
markers = "no"; # Disables the `+` displayed at line wraps
mark_old = "no"; # Unread mail stay unread until read
mime_forward = "yes"; # attachments are forwarded with mail
wait_key = "no"; # mutt won't ask "press key to continue"
forward_format = ''"Fwd: %s"''; # format of subject when forwarding
status_chars = ''" *%A"'';
sort_aux = "reverse-last-date-received";
reply_regexp = ''"^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"'';
quote_regexp = ''"^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"'';
send_charset = "utf-8:iso-8859-1:us-ascii";
charset = "utf-8";
arrow_cursor = "no"; # Change `color indicator` depending
};
binds = [
{
map = [ "index" ];
key = "h";
action = "noop";
}
{
map = [ "index" ];
key = "\\Cf";
action = "noop";
}
{
map = [ "pager" ];
key = "r";
action = "noop";
}
{
map = [ "editor" ];
key = "<space>";
action = "noop";
}
{
map = [ "index" "pager" ];
key = "i";
action = "noop";
}
{
map = [ "index" "pager" ];
key = "g";
action = "noop";
}
# general rebindings
{
map = [ "index" ];
key = "j";
action = "next-entry";
}
{
map = [ "index" ];
key = "k";
action = "previous-entry";
}
{
map = [ "index" ];
key = "G";
action = "last-entry";
}
{
map = [ "index" ];
key = "gg";
action = "first-entry";
}
{
map = [ "index" ];
key = "D";
action = "delete-message";
}
{
map = [ "index" ];
key = "U";
action = "undelete-message";
}
{
map = [ "index" ];
key = "L";
action = "limit";
}
{
map = [ "index" ];
key = "l";
action = "display-message";
}
{
map = [ "index" ];
key = "\\031";
action = "previous-undeleted";
} # Mouse wheel
{
map = [ "index" ];
key = "\\005";
action = "next-undeleted";
} # Mouse wheel
{
map = [ "attach" ];
key = "<return>";
action = "view-mailcap";
}
{
map = [ "attach" ];
key = "l";
action = "view-mailcap";
}
{
map = [ "pager" ];
key = "j";
action = "next-line";
}
{
map = [ "pager" ];
key = "k";
action = "previous-line";
}
{
map = [ "pager" ];
key = "l";
action = "view-attachments";
}
{
map = [ "pager" ];
key = "\\031";
action = "previous-line";
} # Mouse wheel
{
map = [ "pager" ];
key = "\\005";
action = "next-line";
} # Mouse wheel
{
map = [ "editor" ];
key = "<Tab>";
action = "complete-query";
}
{
map = [ "browser" ];
key = "l";
action = "select-entry";
}
{
map = [ "index" "pager" ];
key = "H";
action = "view-raw-message";
}
{
map = [ "index" "pager" ];
key = "S";
action = "sync-mailbox";
}
{
map = [ "index" "pager" ];
key = "R";
action = "group-reply";
}
{
map = [ "index" "pager" ];
key = "rg";
action = "group-reply";
}
{
map = [ "index" "pager" ];
key = "rr";
action = "reply";
}
{
map = [ "index" "query" ];
key = "<space>";
action = "tag-entry";
}
{
map = [ "pager" "browser" ];
key = "gg";
action = "top-page";
}
{
map = [ "pager" "browser" ];
key = "G";
action = "bottom-page";
}
{
map = [ "pager" "attach" ];
key = "h";
action = "exit";
}
{
map = [ "index" "pager" "browser" ];
key = "d";
action = "half-down";
}
{
map = [ "index" "pager" "browser" ];
key = "u";
action = "half-up";
}
# sidebar mappings
{
map = [ "index" "pager" ];
key = "\\Ck";
action = "sidebar-prev";
}
{
map = [ "index" "pager" ];
key = "\\Cj";
action = "sidebar-next";
}
{
map = [ "index" "pager" ];
key = "\\Co";
action = "sidebar-open";
}
{
map = [ "index" "pager" ];
key = "\\Cp";
action = "sidebar-prev-new";
}
{
map = [ "index" "pager" ];
key = "\\Cn";
action = "sidebar-next-new";
}
{
map = [ "index" "pager" ];
key = "B";
action = "sidebar-toggle-visible";
}
];
macros = [
{
map = [ "browser" ];
key = "h";
action = "<change-dir><kill-line>..<enter>";
} # go to parent folder
{
map = [ "index" ];
key = "\\Cr";
action = "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>";
} # mark all messages as read
{
map = [ "index" ];
key = "A";
action = "<limit>all\\n";
} # show all messages (undo limit)
{
map = [ "index" "pager" ];
key = "\\cb";
action = "<pipe-message> ${pkgs.urlscan}/bin/urlscan<Enter>";
} # call urlscan to extract URLs out of a message"
{
map = [ "attach" "compose" ];
key = "\\cb";
action = "<pipe-entry> ${pkgs.urlscan}/bin/urlscan<Enter>";
} # call urlscan to extract URLs out of a message
{
map = [ "index" "pager" ];
key = "A";
action = "<pipe-message>${pkgs.khard}/bin/khard add-email<return>";
} # add the sender email address to khard
] ++ [
(switchAccountMacro "1" "rilla@monotremata.xyz")
(switchAccountMacro "2" "r.illa.pujagut@gmail.com")
(switchAccountMacro "3" "ricard@trkkn.com")
(switchAccountMacro "4" "accounts@monotremata.xyz")
(switchAccountMacro "5" "admin@monotremata.xyz")
];
};
programs.notmuch = {
enable = true;
new = { tags = [ "unread" "inbox" ]; };
};
programs.mbsync.enable = true;
programs.msmtp.enable = true;
}

View File

@ -1,10 +1,509 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let mailsync = pkgs.callPackage ./mailsync.nix { inherit config pkgs; }; let
in { mailsync = pkgs.callPackage ./mailsync.nix { inherit config pkgs; };
imports = [ ./common.nix ]; gpgKey = "B51D4548A4846E3C8D115C808333CFB0B9D3244D";
personalSignature = ''
Ricard Illa
https://monotremata.xyz
http://zswm576cm7wgmgcwluy4l4ixkfasj25taqbn2r5pnrrj552l263ff2qd.onion
public key fingerprint: B51D4548A4846E3C8D115C808333CFB0B9D3244D
'';
accountSignature = { showSignature ? "append", text ? "" }: {
showSignature = showSignature;
text = text;
};
pwCmd = x: "${pkgs.pass}/bin/pass ${x}";
defaultAccountSettings =
{ accountEmail
, mailboxes ? ''"=Inbox" "=Archive" "=Drafts" "=Junk" "=Sent" "=Trash"''
, smtpHost ? "mail.monotremata.xyz"
, imapHost ? "mail.monotremata.xyz"
}: {
primary = false;
realName = "Ricard Illa";
aliases = [ ];
address = accountEmail;
userName = accountEmail;
neomutt = {
enable = true;
extraConfig = ''
unmailboxes *
mailboxes ${mailboxes}
set status_format = "[ ${accountEmail} ] [ %f ] [%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]%>%?p?( %p postponed )?"
'';
sendMailCommand = "msmtp -a ${accountEmail}";
};
signature = accountSignature { text = personalSignature; };
mbsync = {
enable = true;
create = "both";
expunge = "both";
flatten = ".";
patterns = [ "*" ];
remove = "both";
};
gpg = {
encryptByDefault = false;
signByDefault = true;
key = gpgKey;
};
msmtp.enable = true;
smtp = {
host = smtpHost;
tls = {
enable = true;
useStartTls = true;
};
port = 587;
};
imap = {
host = imapHost;
tls.enable = true;
port = 993;
};
notmuch.enable = true;
};
switchAccountMacro = i: x: {
map = [ "index" "pager" ];
key = "i${i}";
action =
"<enter-command>source ${config.xdg.configHome}/neomutt/${x}<enter><change-folder>!<enter><check-stats>";
};
in
{
home.packages = [ mailsync pkgs.urlscan pkgs.abook ]; home.packages = [ mailsync pkgs.urlscan pkgs.abook ];
programs.neomutt.settings.query_command = accounts.email.accounts = {
''"${pkgs.abook}/bin/abook --mutt-query '%s'"'';
"rilla@monotremata.xyz" =
defaultAccountSettings { accountEmail = "rilla@monotremata.xyz"; } // {
primary = true;
passwordCommand = pwCmd "mail.monotremata.xyz/rilla@monotremata.xyz";
};
"r.illa.pujagut@gmail.com" = defaultAccountSettings
{
accountEmail = "r.illa.pujagut@gmail.com";
mailboxes = ''
"=INBOX" "=[Gmail].Drafts" "=[Gmail].Sent Mail" "=[Gmail].Trash" "=[Gmail].Spam" "=[Gmail].All Mail"'';
smtpHost = "smtp.gmail.com";
imapHost = "imap.gmail.com";
} // {
passwordCommand = pwCmd "google.com/mutt/r.illa.pujagut@gmail.com";
};
"accounts@monotremata.xyz" =
defaultAccountSettings { accountEmail = "accounts@monotremata.xyz"; } // {
realName = "monotremata.xyz";
signature = accountSignature { showSignature = "none"; };
passwordCommand = pwCmd "mail.monotremata.xyz/accounts@monotremata.xyz";
};
"admin@monotremata.xyz" =
defaultAccountSettings { accountEmail = "admin@monotremata.xyz"; } // {
aliases = [
"postmaster@monotremata.xyz"
"hostmaster@monotremata.xyz"
"webmaster@monotremata.xyz"
"abuse@monotremata.xyz"
];
realName = "monotremata.xyz";
signature = accountSignature { text = "admin@monotremata.xyz"; };
passwordCommand = pwCmd "mail.monotremata.xyz/admin@monotremata.xyz";
};
};
programs.neomutt = {
enable = true;
editor = "nvim";
sort = "threads";
# vimKeys = true;
sidebar = {
enable = true;
shortPath = true;
width = 20;
format = "%D%?F? [%F]?%* %?N?%N/? %?S?%S?";
};
extraConfig = ''
alternative_order text/html text/plain text/enriched text/*
auto_view text/html application/gpg-encrypted text/calendar application/ics
# Default index colors:
color index yellow default '.*'
color index_author red default '.*'
color index_number blue default
color index_subject cyan default '.*'
# New mail is boldened:
color index brightyellow black "~N"
color index_author brightred black "~N"
color index_subject brightcyan black "~N"
# Tagged mail is highlighted:
color index brightyellow blue "~T"
color index_author brightred blue "~T"
color index_subject brightcyan blue "~T"
# Other colors and aesthetic settings:
mono bold bold
mono underline underline
mono indicator reverse
mono error bold
color normal default default
color indicator brightblack white
color sidebar_highlight red default
color sidebar_divider brightblack black
color sidebar_flagged red black
color sidebar_new green black
color normal brightyellow default
color error red default
color tilde black default
color message cyan default
color markers red white
color attachment white default
color search brightmagenta default
color status brightyellow black
color hdrdefault brightgreen default
color quoted green default
color quoted1 blue default
color quoted2 cyan default
color quoted3 yellow default
color quoted4 red default
color quoted5 brightred default
color signature brightgreen default
color bold black default
color underline black default
color normal default default
# Regex highlighting:
color header blue default ".*"
color header brightmagenta default "^(From)"
color header brightcyan default "^(Subject)"
color header brightwhite default "^(CC|BCC)"
color body brightred default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # Email addresses
color body brightblue default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" # URL
color body green default "\`[^\`]*\`" # Green text between ` and `
color body brightblue default "^# \.*" # Headings as bold blue
color body brightcyan default "^## \.*" # Subheadings as bold cyan
color body brightgreen default "^### \.*" # Subsubheadings as bold green
color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow
color body brightcyan default "[;:][-o][)/(|]" # emoticons
color body brightcyan default "[;:][)(|]" # emoticons
color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon?
color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon?
color body red default "(BAD signature)"
color body cyan default "(Good signature)"
color body brightblack default "^gpg: Good signature .*"
color body brightyellow default "^gpg: "
color body brightyellow red "^gpg: BAD signature from.*"
mono body bold "^gpg: Good signature"
mono body bold "^gpg: BAD signature from.*"
color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
set fast_reply # skip to compose when replying
set fcc_attach # save attachments with the body
set forward_quote # include message in forwards
set reverse_name # reply as whomever it was to
set include # include message in replies
set uncollapse_jump
set sort_re
set quit
set beep_new
'';
settings = {
# set mailcap_path = /usr/local/share/mutt-wizard/mailcap:$mailcap_path # todo
mime_type_query_command = ''"${pkgs.file}/bin/file --mime-type -b %s"'';
date_format = ''"%d.%m.%Y %H:%M"'';
index_format = ''"%2C %Z %?X?A& ? %D %-15.15F %s (%-4.4c)"'';
rfc2047_parameters = "yes";
sleep_time = "0"; # Pause 0 seconds for informational messages
markers = "no"; # Disables the `+` displayed at line wraps
mark_old = "no"; # Unread mail stay unread until read
mime_forward = "yes"; # attachments are forwarded with mail
wait_key = "no"; # mutt won't ask "press key to continue"
forward_format = ''"Fwd: %s"''; # format of subject when forwarding
status_chars = ''" *%A"'';
sort_aux = "reverse-last-date-received";
reply_regexp = ''"^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"'';
quote_regexp = ''"^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"'';
send_charset = "utf-8:iso-8859-1:us-ascii";
charset = "utf-8";
arrow_cursor = "no"; # Change `color indicator` depending
query_command = ''"${pkgs.abook}/bin/abook --mutt-query '%s'"'';
};
binds = [
{
map = [ "index" ];
key = "h";
action = "noop";
}
{
map = [ "index" ];
key = "\\Cf";
action = "noop";
}
{
map = [ "pager" ];
key = "r";
action = "noop";
}
{
map = [ "editor" ];
key = "<space>";
action = "noop";
}
{
map = [ "index" "pager" ];
key = "i";
action = "noop";
}
{
map = [ "index" "pager" ];
key = "g";
action = "noop";
}
# general rebindings
{
map = [ "index" ];
key = "j";
action = "next-entry";
}
{
map = [ "index" ];
key = "k";
action = "previous-entry";
}
{
map = [ "index" ];
key = "G";
action = "last-entry";
}
{
map = [ "index" ];
key = "gg";
action = "first-entry";
}
{
map = [ "index" ];
key = "D";
action = "delete-message";
}
{
map = [ "index" ];
key = "U";
action = "undelete-message";
}
{
map = [ "index" ];
key = "L";
action = "limit";
}
{
map = [ "index" ];
key = "l";
action = "display-message";
}
{
map = [ "index" ];
key = "\\031";
action = "previous-undeleted";
} # Mouse wheel
{
map = [ "index" ];
key = "\\005";
action = "next-undeleted";
} # Mouse wheel
{
map = [ "attach" ];
key = "<return>";
action = "view-mailcap";
}
{
map = [ "attach" ];
key = "l";
action = "view-mailcap";
}
{
map = [ "pager" ];
key = "j";
action = "next-line";
}
{
map = [ "pager" ];
key = "k";
action = "previous-line";
}
{
map = [ "pager" ];
key = "l";
action = "view-attachments";
}
{
map = [ "pager" ];
key = "\\031";
action = "previous-line";
} # Mouse wheel
{
map = [ "pager" ];
key = "\\005";
action = "next-line";
} # Mouse wheel
{
map = [ "editor" ];
key = "<Tab>";
action = "complete-query";
}
{
map = [ "browser" ];
key = "l";
action = "select-entry";
}
{
map = [ "index" "pager" ];
key = "H";
action = "view-raw-message";
}
{
map = [ "index" "pager" ];
key = "S";
action = "sync-mailbox";
}
{
map = [ "index" "pager" ];
key = "R";
action = "group-reply";
}
{
map = [ "index" "pager" ];
key = "rg";
action = "group-reply";
}
{
map = [ "index" "pager" ];
key = "rr";
action = "reply";
}
{
map = [ "index" "query" ];
key = "<space>";
action = "tag-entry";
}
{
map = [ "pager" "browser" ];
key = "gg";
action = "top-page";
}
{
map = [ "pager" "browser" ];
key = "G";
action = "bottom-page";
}
{
map = [ "pager" "attach" ];
key = "h";
action = "exit";
}
{
map = [ "index" "pager" "browser" ];
key = "d";
action = "half-down";
}
{
map = [ "index" "pager" "browser" ];
key = "u";
action = "half-up";
}
# sidebar mappings
{
map = [ "index" "pager" ];
key = "\\Ck";
action = "sidebar-prev";
}
{
map = [ "index" "pager" ];
key = "\\Cj";
action = "sidebar-next";
}
{
map = [ "index" "pager" ];
key = "\\Co";
action = "sidebar-open";
}
{
map = [ "index" "pager" ];
key = "\\Cp";
action = "sidebar-prev-new";
}
{
map = [ "index" "pager" ];
key = "\\Cn";
action = "sidebar-next-new";
}
{
map = [ "index" "pager" ];
key = "B";
action = "sidebar-toggle-visible";
}
];
macros = [
{
map = [ "browser" ];
key = "h";
action = "<change-dir><kill-line>..<enter>";
} # go to parent folder
{
map = [ "index" ];
key = "\\Cr";
action = "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>";
} # mark all messages as read
{
map = [ "index" ];
key = "A";
action = "<limit>all\\n";
} # show all messages (undo limit)
{
map = [ "index" "pager" ];
key = "\\cb";
action = "<pipe-message> ${pkgs.urlscan}/bin/urlscan<Enter>";
} # call urlscan to extract URLs out of a message"
{
map = [ "attach" "compose" ];
key = "\\cb";
action = "<pipe-entry> ${pkgs.urlscan}/bin/urlscan<Enter>";
} # call urlscan to extract URLs out of a message
{
map = [ "index" "pager" ];
key = "A";
action = "<pipe-message>${pkgs.khard}/bin/khard add-email<return>";
} # add the sender email address to khard
] ++ [
(switchAccountMacro "1" "rilla@monotremata.xyz")
(switchAccountMacro "2" "r.illa.pujagut@gmail.com")
(switchAccountMacro "4" "accounts@monotremata.xyz")
(switchAccountMacro "5" "admin@monotremata.xyz")
];
};
programs.notmuch = {
enable = true;
new = { tags = [ "unread" "inbox" ]; };
};
programs.mbsync.enable = true;
programs.msmtp.enable = true;
programs.alot.enable = true; programs.alot.enable = true;
} }

View File

@ -1,70 +0,0 @@
{ config, pkgs, ... }:
let musicDir = "${config.home.homeDirectory}/Music";
in {
home.packages = [ pkgs.mpc_cli ];
programs.ncmpcpp = {
enable = true;
bindings = [
{ key = "+"; command = "show_clock"; }
{ key = "="; command = "volume_up"; }
{ key = "j"; command = "scroll_down"; }
{ key = "k"; command = "scroll_up"; }
{ key = "h"; command = "previous_column"; }
{ key = "l"; command = "next_column"; }
{ key = "."; command = "show_lyrics"; }
{ key = "n"; command = "next_found_item"; }
{ key = "N"; command = "previous_found_item"; }
{ key = "J"; command = "move_sort_order_down"; }
{ key = "K"; command = "move_sort_order_up"; }
{ key = "ctrl-u"; command = "page_up"; }
{ key = "ctrl-d"; command = "page_down"; }
];
settings = {
autocenter_mode = "yes";
follow_now_playing_lyrics = "yes";
ignore_leading_the = "yes";
ignore_diacritics = "yes";
default_place_to_search_in = "database";
user_interface = "alternative";
alternative_header_first_line_format = "$0$aqqu$/a {$6%a$9 - }{$3%t$9}|{$3%f$9} $0$atqq$/a$9";
alternative_header_second_line_format = "{{$4%b$9}{ [$8%y$9]}}|{$4%D$9}";
song_status_format = " $6%a $7| $3%t $7| $4%b ";
colors_enabled = "yes";
main_window_color = "white";
header_window_color = "cyan";
volume_color = "green";
statusbar_color = "white";
progressbar_color = "cyan";
progressbar_elapsed_color = "white";
playlist_editor_display_mode = "columns";
search_engine_display_mode = "columns";
browser_display_mode = "columns";
playlist_display_mode = "columns";
song_columns_list_format = "(10)[blue]{l} (30)[green]{t} (30)[magenta]{a} (30)[yellow]{b}";
song_list_format = "{$7%a - $9}{$5%t$9}|{$5%f$9}$R{$6%b $9}{$3%l$9}";
progressbar_look = "";
current_item_prefix = "$(blue)$r";
current_item_suffix = "$/r$(end)";
current_item_inactive_column_prefix = "$(cyan)$r";
now_playing_prefix = " ";
centered_cursor = "yes";
selected_item_prefix = "* ";
discard_colors_if_item_is_selected = "yes";
display_bitrate = "yes";
enable_window_title = "yes";
empty_tag_marker = "";
};
};
}

View File

@ -1,17 +1,12 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let master-host = "music.monotremata.xyz"; let
in { musicDir = "${config.home.homeDirectory}/Music";
imports = [ ./common.nix ]; master-host = "music.monotremata.xyz";
in
{
home.packages = [ pkgs.mpc_cli pkgs.mpdris2 ]; home.packages = [ pkgs.mpc_cli pkgs.mpdris2 ];
services.mpdris2 = {
enable = true;
notifications = false;
mpd = {
host = "localhost";
musicDirectory = null;
};
};
services.mpd = { services.mpd = {
enable = true; enable = true;
musicDirectory = "https://${master-host}"; musicDirectory = "https://${master-host}";
@ -38,5 +33,77 @@ in {
} }
''; '';
}; };
programs.ncmpcpp.mpdMusicDir = null;
programs.ncmpcpp = {
enable = true;
mpdMusicDir = null;
bindings = [
{ key = "+"; command = "show_clock"; }
{ key = "="; command = "volume_up"; }
{ key = "j"; command = "scroll_down"; }
{ key = "k"; command = "scroll_up"; }
{ key = "h"; command = "previous_column"; }
{ key = "l"; command = "next_column"; }
{ key = "."; command = "show_lyrics"; }
{ key = "n"; command = "next_found_item"; }
{ key = "N"; command = "previous_found_item"; }
{ key = "J"; command = "move_sort_order_down"; }
{ key = "K"; command = "move_sort_order_up"; }
{ key = "ctrl-u"; command = "page_up"; }
{ key = "ctrl-d"; command = "page_down"; }
];
settings = {
autocenter_mode = "yes";
follow_now_playing_lyrics = "yes";
ignore_leading_the = "yes";
ignore_diacritics = "yes";
default_place_to_search_in = "database";
user_interface = "alternative";
alternative_header_first_line_format = "$0$aqqu$/a {$6%a$9 - }{$3%t$9}|{$3%f$9} $0$atqq$/a$9";
alternative_header_second_line_format = "{{$4%b$9}{ [$8%y$9]}}|{$4%D$9}";
song_status_format = " $6%a $7| $3%t $7| $4%b ";
colors_enabled = "yes";
main_window_color = "white";
header_window_color = "cyan";
volume_color = "green";
statusbar_color = "white";
progressbar_color = "cyan";
progressbar_elapsed_color = "white";
playlist_editor_display_mode = "columns";
search_engine_display_mode = "columns";
browser_display_mode = "columns";
playlist_display_mode = "columns";
song_columns_list_format = "(10)[blue]{l} (30)[green]{t} (30)[magenta]{a} (30)[yellow]{b}";
song_list_format = "{$7%a - $9}{$5%t$9}|{$5%f$9}$R{$6%b $9}{$3%l$9}";
progressbar_look = "";
current_item_prefix = "$(blue)$r";
current_item_suffix = "$/r$(end)";
current_item_inactive_column_prefix = "$(cyan)$r";
now_playing_prefix = " ";
centered_cursor = "yes";
selected_item_prefix = "* ";
discard_colors_if_item_is_selected = "yes";
display_bitrate = "yes";
enable_window_title = "yes";
empty_tag_marker = "";
};
};
services.mpdris2 = {
enable = true;
notifications = false;
mpd = {
host = "localhost";
musicDirectory = null;
};
};
} }

View File

@ -1,200 +0,0 @@
#ifdef _WINDOW_CONFIG
/* default window dimensions (overwritten via -g option): */
static const int WIN_WIDTH = 800;
static const int WIN_HEIGHT = 600;
/* colors and font can be overwritten via X resource properties.
* See nsxiv(1), X(7) section Resources and xrdb(1) for more information.
*/
static const char *DEFAULT_WIN_BG = "#282828";
static const char *DEFAULT_WIN_FG = "#ebdbb2";
static const char *DEFAULT_MARK_COLOR = NULL; /* NULL means it will default to window foreground */
#if HAVE_LIBFONTS
static const char *DEFAULT_BAR_BG = "#282828"; /* NULL means it will default to window background */
static const char *DEFAULT_BAR_FG = "#ebdbb2"; /* NULL means it will default to window foreground */
static const char *DEFAULT_FONT = "Inter:size=9";
/* if true, statusbar appears on top of the window */
static const bool TOP_STATUSBAR = false;
#endif /* HAVE_LIBFONTS */
#endif
#ifdef _IMAGE_CONFIG
/* levels (in percent) to use when zooming via '-' and '+':
* (first/last value is used as min/max zoom level)
*/
static const float zoom_levels[] = {
12.5, 25.0, 50.0, 75.0,
100.0, 150.0, 200.0, 400.0, 800.0
};
/* default slideshow delay (in sec, overwritten via -S option): */
static const int SLIDESHOW_DELAY = 5;
/* gamma correction: the user-visible ranges [-GAMMA_RANGE, 0] and
* (0, GAMMA_RANGE] are mapped to the ranges [0, 1], and (1, GAMMA_MAX].
*/
static const double GAMMA_MAX = 10.0;
static const int GAMMA_RANGE = 32;
/* command i_scroll pans image 1/PAN_FRACTION of screen width/height */
static const int PAN_FRACTION = 5;
/* if false, pixelate images at zoom level != 100%,
* toggled with 'a' key binding
*/
static const bool ANTI_ALIAS = true;
/* if true, use a checkerboard background for alpha layer,
* toggled with 'A' key binding
*/
static const bool ALPHA_LAYER = false;
/* percentage of memory to use for imlib2's cache size.
* 3 means use 3% of total memory which is about 245MiB on 8GiB machine.
* 0 or less means disable cache.
* 100 means use all available memory (but not above CACHE_SIZE_LIMIT).
*/
static const int CACHE_SIZE_MEM_PERCENTAGE = 3; /* use 3% of total memory for cache */
static const int CACHE_SIZE_LIMIT = 256 * 1024 * 1024; /* but not above 256MiB */
static const int CACHE_SIZE_FALLBACK = 32 * 1024 * 1024; /* fallback to 32MiB if we can't determine total memory */
#endif
#ifdef _THUMBS_CONFIG
/* thumbnail sizes in pixels (width == height): */
static const int thumb_sizes[] = { 32, 64, 96, 128, 160 };
/* thumbnail size at startup, index into thumb_sizes[]: */
static const int THUMB_SIZE = 3;
#endif
#ifdef _MAPPINGS_CONFIG
/* these modifiers will be used when processing keybindings */
static const unsigned int USED_MODMASK = ShiftMask | ControlMask | Mod1Mask;
/* abort the keyhandler */
static const KeySym KEYHANDLER_ABORT = XK_Escape;
/* keyboard mappings for image and thumbnail mode: */
static const keymap_t keys[] = {
/* modifiers key function argument */
{ 0, XK_q, g_quit, 0 },
{ 0, XK_Return, g_switch_mode, None },
{ 0, XK_f, g_toggle_fullscreen, None },
{ 0, XK_b, g_toggle_bar, None },
{ ControlMask, XK_x, g_prefix_external, None },
{ 0, XK_g, g_first, None },
{ 0, XK_G, g_n_or_last, None },
{ 0, XK_r, g_reload_image, None },
{ 0, XK_D, g_remove_image, None },
{ ControlMask, XK_h, g_scroll_screen, DIR_LEFT },
{ ControlMask, XK_Left, g_scroll_screen, DIR_LEFT },
{ ControlMask, XK_j, g_scroll_screen, DIR_DOWN },
{ ControlMask, XK_Down, g_scroll_screen, DIR_DOWN },
{ ControlMask, XK_k, g_scroll_screen, DIR_UP },
{ ControlMask, XK_Up, g_scroll_screen, DIR_UP },
{ ControlMask, XK_l, g_scroll_screen, DIR_RIGHT },
{ ControlMask, XK_Right, g_scroll_screen, DIR_RIGHT },
{ 0, XK_plus, g_zoom, +1 },
{ 0, XK_KP_Add, g_zoom, +1 },
{ 0, XK_minus, g_zoom, -1 },
{ 0, XK_KP_Subtract, g_zoom, -1 },
{ 0, XK_m, g_toggle_image_mark, None },
{ 0, XK_M, g_mark_range, None },
{ ControlMask, XK_m, g_reverse_marks, None },
{ ControlMask, XK_u, g_unmark_all, None },
{ 0, XK_N, g_navigate_marked, +1 },
{ 0, XK_P, g_navigate_marked, -1 },
{ 0, XK_braceleft, g_change_gamma, -1 },
{ 0, XK_braceright, g_change_gamma, +1 },
{ ControlMask, XK_g, g_change_gamma, 0 },
{ 0, XK_h, t_move_sel, DIR_LEFT },
{ 0, XK_Left, t_move_sel, DIR_LEFT },
{ 0, XK_j, t_move_sel, DIR_DOWN },
{ 0, XK_Down, t_move_sel, DIR_DOWN },
{ 0, XK_k, t_move_sel, DIR_UP },
{ 0, XK_Up, t_move_sel, DIR_UP },
{ 0, XK_l, t_move_sel, DIR_RIGHT },
{ 0, XK_Right, t_move_sel, DIR_RIGHT },
{ 0, XK_R, t_reload_all, None },
{ 0, XK_n, i_navigate, +1 },
{ 0, XK_n, i_scroll_to_edge, DIR_LEFT | DIR_UP },
{ 0, XK_space, i_navigate, +1 },
{ 0, XK_p, i_navigate, -1 },
{ 0, XK_p, i_scroll_to_edge, DIR_LEFT | DIR_UP },
{ 0, XK_BackSpace, i_navigate, -1 },
{ 0, XK_bracketright, i_navigate, +10 },
{ 0, XK_bracketleft, i_navigate, -10 },
{ ControlMask, XK_6, i_alternate, None },
{ ControlMask, XK_n, i_navigate_frame, +1 },
{ ControlMask, XK_p, i_navigate_frame, -1 },
{ ControlMask, XK_space, i_toggle_animation, None },
{ ControlMask, XK_a, i_toggle_animation, None },
{ 0, XK_h, i_scroll, DIR_LEFT },
{ 0, XK_Left, i_scroll, DIR_LEFT },
{ 0, XK_j, i_scroll, DIR_DOWN },
{ 0, XK_Down, i_scroll, DIR_DOWN },
{ 0, XK_k, i_scroll, DIR_UP },
{ 0, XK_Up, i_scroll, DIR_UP },
{ 0, XK_l, i_scroll, DIR_RIGHT },
{ 0, XK_Right, i_scroll, DIR_RIGHT },
{ 0, XK_H, i_scroll_to_edge, DIR_LEFT },
{ 0, XK_J, i_scroll_to_edge, DIR_DOWN },
{ 0, XK_K, i_scroll_to_edge, DIR_UP },
{ 0, XK_L, i_scroll_to_edge, DIR_RIGHT },
{ 0, XK_z, i_scroll_to_center, None },
{ 0, XK_equal, i_set_zoom, 100 },
{ 0, XK_w, i_fit_to_win, SCALE_DOWN },
{ 0, XK_W, i_fit_to_win, SCALE_FIT },
{ 0, XK_F, i_fit_to_win, SCALE_FILL },
{ 0, XK_e, i_fit_to_win, SCALE_WIDTH },
{ 0, XK_E, i_fit_to_win, SCALE_HEIGHT },
{ 0, XK_less, i_rotate, DEGREE_270 },
{ 0, XK_greater, i_rotate, DEGREE_90 },
{ 0, XK_question, i_rotate, DEGREE_180 },
{ 0, XK_bar, i_flip, FLIP_HORIZONTAL },
{ 0, XK_underscore, i_flip, FLIP_VERTICAL },
{ 0, XK_a, i_toggle_antialias, None },
{ 0, XK_A, i_toggle_alpha, None },
{ 0, XK_s, i_slideshow, None },
};
/* mouse button mappings for image mode: */
static const button_t buttons_img[] = {
/* modifiers button function argument */
{ 0, 1, i_cursor_navigate, None },
{ ControlMask, 1, i_drag, DRAG_RELATIVE },
{ 0, 2, i_drag, DRAG_ABSOLUTE },
{ 0, 3, g_switch_mode, None },
{ 0, 4, g_zoom, +1 },
{ 0, 5, g_zoom, -1 },
};
/* mouse button mappings for thumbnail mode: */
static const button_t buttons_tns[] = {
/* modifiers button function argument */
{ 0, 1, t_select, None },
{ 0, 3, t_drag_mark_image, None },
{ 0, 4, t_scroll, DIR_UP },
{ 0, 5, t_scroll, DIR_DOWN },
{ ControlMask, 4, g_scroll_screen, DIR_UP },
{ ControlMask, 5, g_scroll_screen, DIR_DOWN },
};
/* true means NAV_WIDTH is relative (33%), false means absolute (33 pixels) */
static const bool NAV_IS_REL = true;
/* width of navigation area, 0 disables cursor navigation, */
static const unsigned int NAV_WIDTH = 33;
/* mouse cursor on left, middle and right part of the window */
static const cursor_t imgcursor[3] = {
CURSOR_LEFT, CURSOR_ARROW, CURSOR_RIGHT
};
#endif

View File

@ -1,5 +0,0 @@
{ config, pkgs, ... }:
# https://raw.githubusercontent.com/nsxiv/nsxiv/master/config.def.h
let config = builtins.readFile ./config.h;
in { home.packages = [ (pkgs.nsxiv.override { conf = config; }) ]; }

View File

@ -1,16 +0,0 @@
{ config, pkgs, ... }:
{
home.file.".vitetris".text = ''
mode=1
level=0
height=5
rotate=2
softdrop=1
[stdin]
left=h
right=l
up=k
down=j
'';
}

View File

@ -1,6 +1,17 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = [ ./common.nix ];
home.packages = [ pkgs.vitetris ]; home.packages = [ pkgs.vitetris ];
home.file.".vitetris".text = ''
mode=1
level=0
height=5
rotate=2
softdrop=1
[stdin]
left=h
right=l
up=k
down=j
'';
} }