Add nix home-manager config

This commit is contained in:
Oystein Kristoffer Tveit 2021-12-08 16:26:56 +01:00
parent 470384ac20
commit aab1d4ff96
22 changed files with 2063 additions and 0 deletions

30
nixpkgs/common/colors.nix Normal file
View File

@ -0,0 +1,30 @@
rec {
monokai = rec {
foreground = white;
background = black;
black = "#272822";
red = "#f92672";
green = "#a6e22e";
yellow = "#f4bf75";
blue = "#66d9ef";
magenta = "#ae81ff";
cyan = "#a1efe4";
white = "#f8f8f2";
};
paper = {
background = "#f2e3bd";
foreground = "#2f343f";
black = "#222222";
red = "#C30771";
green = "#10A778";
yellow = "#A89C14";
blue = "#008ec4";
magenta = "#523C79";
cyan = "#20A5BA";
white = "#f7f3ee";
};
default = monokai;
}

5
nixpkgs/config.nix Normal file
View File

@ -0,0 +1,5 @@
{ ... }:
{
allowUnfree = true;
android_sdk.accept_license = true;
}

230
nixpkgs/home.nix Normal file
View File

@ -0,0 +1,230 @@
{ lib, pkgs, ... } @ args:
let
colorType = with lib.types; (attrsOf str);
colorTheme = import ./common/colors.nix;
in
{
_module.args.colorTheme = colorTheme;
imports = [
./programs/alacritty.nix
./programs/comma.nix
./programs/emacs.nix
./programs/gh.nix
./programs/git.nix
./programs/ncmpcpp.nix
./programs/neovim.nix
./programs/newsboat.nix
./programs/rofi.nix
./programs/tmux.nix
./programs/vscode.nix
./programs/zathura.nix
./programs/zsh.nix
];
xsession = {
pointerCursor = {
package = pkgs.capitaine-cursors;
name = "capitaine-cursors";
size = 16;
};
};
programs = {
home-manager.enable = true;
bat.enable = true;
# bottom.enable = true;
exa.enable = true;
feh.enable = true;
fzf = {
enable = true;
defaultCommand = "fd --type f";
};
gpg.enable = true;
irssi.enable = true;
lazygit.enable = true;
mpv.enable = true;
man = {
enable = true;
generateCaches = true;
};
obs-studio.enable = true;
qutebrowser = {
enable = true;
aliases = {};
searchEngines = {};
settings = {};
keyBindings = {};
# quickmarks = {};
extraConfig = '''';
};
skim = {
enable = true;
defaultCommand ="fd --type f";
};
texlive = {
enable = true;
# packageSet = pkgs.texlive.combined.scheme-medium;
};
# xmobar.enable = true;
zoxide.enable = true;
};
services.mpd = import ./services/mpd.nix args;
services.picom = import ./services/picom.nix;
services.stalonetray = import ./services/stalonetray.nix (args // { inherit colorTheme; });
services.sxhkd = import ./services/sxhkd.nix args;
home = {
stateVersion = "21.05";
username = "h7x4";
homeDirectory = "/home/h7x4";
packages = with pkgs; [
ahoviewer
anki
asciidoctor
audacity
beets
calibre
castnow
citra
copyq
czkawka
desmume
discord
diskonaut
diskus
docker
du-dust
fcitx
fd
ffmpeg
geogebra
google-chrome
# gpgtui
# hck
hexyl
imagemagick
inkscape
insomnia
jq
kepubify
kid3
koreader
krita
ktouch
lastpass-cli
lazydocker
libreoffice-fresh
lolcat
maim
mdcat
mdp
mediainfo
megacmd
megasync
micro
minecraft
mkvtoolnix
mmv
mopidy
mopidy-mpd
mopidy-soundcloud
mopidy-spotify
mopidy-youtube
mpc_cli
mps-youtube
neofetch
nmap
nyxt
osu-lazer
pandoc
pulseaudio
pulsemixer
python3
ripgrep
rsync
sc-im
scrcpy
slack
slack-term
# steam-tui
sxiv
tagainijisho
taisei
tealdeer
teams
# tenacity
# tv-renamer
toilet
tokei
touchegg
w3m
waifu2x-converter-cpp
wavemon
xcalib
xclip
xdotool
youtube-dl
# yuzu-mainline
zeal
zoom-us
zotero
# Needed for VSCode liveshare
desktop-file-utils
krb5
zlib
icu
openssl
xorg.xprop
];
};
services.gnome-keyring.enable = true;
services.dropbox.enable = true;
services.dunst = {
enable = true;
iconTheme = {
package = pkgs.gnome.adwaita-icon-theme;
name = "Adwaita";
size = "32x32";
};
settings = {
global = {
geometry = "300x5-30+50";
transparency = 10;
frame_color = "#eceff1";
font = "Droid Sans 9";
};
urgency_normal = {
background = "#37474f";
foreground = "#eceff1";
timeout = 10;
};
};
};
services.network-manager-applet.enable = true;
# services.redshift.enable = true;
}

View File

@ -0,0 +1,29 @@
{ lib, pkgs, colorTheme, ... }:
{
programs.alacritty = { enable = true; settings = { window.padding = { x = 15; y = 15; }; font = { normal = { family = "Fira Code"; style = "Retina"; }; bold.family = "Fira Code"; italic.family = "Fira Code"; size = 12.0; };
colors =
let
pColors = [ "foreground" "background" ];
in
{
primary = lib.attrsets.getAttrs pColors colorTheme.default;
normal = lib.attrsets.filterAttrs (n: v: pColors ? n) colorTheme.default;
};
background_opacity = 1.0;
cursor = {
style = "Block";
blinking = "On";
unfocused_hollow = true;
};
live_config_reload = true;
shell = {
program = "${pkgs.zsh}/bin/zsh";
args = [ "--login" ];
};
};
};
}

View File

@ -0,0 +1,14 @@
{ config, pkgs, ... }:
let
comma = import ( pkgs.fetchFromGitHub {
owner = "Shopify";
repo = "comma";
rev = "4a62ec17e20ce0e738a8e5126b4298a73903b468";
sha256 = "0n5a3rnv9qnnsrl76kpi6dmaxmwj1mpdd2g0b4n1wfimqfaz6gi1";
}) {};
in
{
home.packages = with pkgs; [
comma
];
}

View File

@ -0,0 +1,25 @@
{ ... }:
{
programs.emacs = {
enable = true;
# socketActivation.enable = true;
extraPackages = epkgs: with epkgs; [
# package
use-package
evil
evil-collection
evil-nerd-commenter
# org
evil-org
monokai-theme
gruber-darker-theme
company
flycheck
projectile
yasnippet
magit
# recentf
which-key
];
};
}

11
nixpkgs/programs/gh.nix Normal file
View File

@ -0,0 +1,11 @@
{ ... }:
{
programs.gh = {
enable = true;
gitProtocol = "ssh";
aliases = {
co = "pr checkout";
pv = "pr view";
};
};
}

82
nixpkgs/programs/git.nix Normal file
View File

@ -0,0 +1,82 @@
{pkgs, ...}:
{
programs.git = {
enable = true;
package = pkgs.gitFull;
userName = "h7x4";
userEmail = "h7x4abk3g@protonmail.com";
aliases = {
aliases = "!git config --get-regexp alias | sed -re 's/alias\\.(\\S*)\\s(.*)$/\\1 = \\2/g'";
uncommit = "reset --soft HEAD^";
rev = "checkout HEAD -- ";
revall = "checkout .";
# unstage = "rm --cached ";
unstage = "restore --staged ";
delete-merged = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d";
mkbr = "checkout -b";
mvbr = "branch -m";
rmbr = "branch -d";
rrmbr = "push origin --delete";
graph = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all";
graphv = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all";
g = "!git graph";
};
extraConfig = {
core = {
whitespace = "space-before-tab,-indent-with-non-tab,trailing-space";
precomposeunicode = false;
untrackedCache = true;
editor = "nvim";
pager = "less";
};
"color \"branch\"".upstream = "cyan";
color.ui = "auto";
init.defaultBranch = "main";
fetch.prune = true;
pull.rebase = true;
push.default = "current";
merge = {
tool = "nvimdiff";
conflictstyle = "diff3";
colorMoved = "zebra";
};
mergetool.keepBackup = false;
"mergetool \"nvimdiff\"".cmd = "nvim -d $BASE $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'";
diff = {
mnemonicPrefix = true;
renames = true;
tool = "nvimdiff";
};
grep = {
break = true;
heading= true;
lineNumber = true;
extendedRegexp = true;
};
github.user = "h7x4abk3g";
web.browser = "google-chrome-stable";
"filter \"lfs\"" = {
required = true;
smudge = "git-lfs smudge -- %f";
process = "git-lfs filter-process";
clean = "git-lfs clean -- %f";
};
};
};
}

View File

@ -0,0 +1,338 @@
{pkgs, ...}:
{
programs.ncmpcpp = {
enable = true;
package = pkgs.ncmpcpp.override { visualizerSupport = true; };
bindings = [
# { key = "j"; command = "scroll_down"; }
{ key = "mouse"; command = "mouse_event"; }
{ key = "up"; command = "scroll_up"; }
{ key = "shift-up"; command = ["select_item" "scroll_up"]; }
{ key = "down"; command = "scroll_down"; }
{ key = "shift-down"; command = ["select_item" "scroll_down"]; }
{ key = "["; command = "scroll_up_album"; }
{ key = "]"; command = "scroll_down_album"; }
{ key = "{"; command = "scroll_up_artist"; }
{ key = "}"; command = "scroll_down_artist"; }
{ key = "page_up"; command = "page_up"; }
{ key = "page_down"; command = "page_down"; }
{ key = "home"; command = "move_home"; }
{ key = "end"; command = "move_end"; }
{ key = "insert"; command = "select_item"; }
{ key = "enter"; command = "enter_directory"; }
{ key = "enter"; command = "toggle_output"; }
{ key = "enter"; command = "run_action"; }
{ key = "enter"; command = "play_item"; }
{ key = "space"; command = "add_item_to_playlist"; }
{ key = "space"; command = "toggle_lyrics_update_on_song_change"; }
{ key = "space"; command = "toggle_visualization_type"; }
#CHANGE
{ key = "d"; command = "delete_playlist_items"; }
{ key = "delete"; command = "delete_browser_items"; }
{ key = "delete"; command = "delete_stored_playlist"; }
{ key = "right"; command = "next_column"; }
{ key = "right"; command = "slave_screen"; }
{ key = "right"; command = "volume_up"; }
{ key = "+"; command = "volume_up"; }
{ key = "left"; command = "previous_column"; }
{ key = "left"; command = "master_screen"; }
{ key = "left"; command = "volume_down"; }
{ key = "-"; command = "volume_down"; }
{ key = ":"; command = "execute_command"; }
{ key = "tab"; command = "next_screen"; }
{ key = "shift-tab"; command = "previous_screen"; }
{ key = "f1"; command = "show_help"; }
{ key = "1"; command = "show_playlist"; }
{ key = "2"; command = "show_browser"; }
{ key = "2"; command = "change_browse_mode"; }
{ key = "3"; command = "show_search_engine"; }
{ key = "3"; command = "reset_search_engine"; }
{ key = "4"; command = "show_media_library"; }
{ key = "4"; command = "toggle_media_library_columns_mode"; }
{ key = "5"; command = "show_playlist_editor"; }
{ key = "6"; command = "show_tag_editor"; }
{ key = "7"; command = "show_outputs"; }
{ key = "8"; command = "show_visualizer"; }
{ key = "="; command = "show_clock"; }
{ key = "@"; command = "show_server_info"; }
{ key = "s"; command = "stop"; }
{ key = "p"; command = "pause"; }
{ key = ">"; command = "next"; }
{ key = "<"; command = "previous"; }
{ key = "ctrl-h"; command = "jump_to_parent_directory"; }
{ key = "ctrl-h"; command = "replay_song"; }
{ key = "backspace"; command = "jump_to_parent_directory"; }
{ key = "backspace"; command = "replay_song"; }
{ key = "f"; command = "seek_forward"; }
{ key = "b"; command = "seek_backward"; }
{ key = "r"; command = "toggle_repeat"; }
{ key = "z"; command = "toggle_random"; }
{ key = "y"; command = "save_tag_changes"; }
{ key = "y"; command = "start_searching"; }
{ key = "y"; command = "toggle_single"; }
{ key = "R"; command = "toggle_consume"; }
{ key = "Y"; command = "toggle_replay_gain_mode"; }
{ key = "T"; command = "toggle_add_mode"; }
{ key = "|"; command = "toggle_mouse"; }
{ key = "#"; command = "toggle_bitrate_visibility"; }
{ key = "Z"; command = "shuffle"; }
{ key = "x"; command = "toggle_crossfade"; }
{ key = "X"; command = "set_crossfade"; }
{ key = "u"; command = "update_database"; }
{ key = "ctrl-s"; command = "sort_playlist"; }
{ key = "ctrl-s"; command = "toggle_browser_sort_mode"; }
{ key = "ctrl-s"; command = "toggle_media_library_sort_mode"; }
{ key = "ctrl-r"; command = "reverse_playlist"; }
{ key = "ctrl-f"; command = "apply_filter"; }
{ key = "ctrl-_"; command = "select_found_items"; }
{ key = "/"; command = "find"; }
{ key = "/"; command = "find_item_forward"; }
{ key = "?"; command = "find"; }
{ key = "?"; command = "find_item_backward"; }
{ key = "."; command = "next_found_item"; }
{ key = ","; command = "previous_found_item"; }
{ key = "w"; command = "toggle_find_mode"; }
{ key = "e"; command = "edit_song"; }
{ key = "e"; command = "edit_library_tag"; }
{ key = "e"; command = "edit_library_album"; }
{ key = "e"; command = "edit_directory_name"; }
{ key = "e"; command = "edit_playlist_name"; }
{ key = "e"; command = "edit_lyrics"; }
{ key = "i"; command = "show_song_info"; }
{ key = "I"; command = "show_artist_info"; }
{ key = "g"; command = "jump_to_position_in_song"; }
{ key = "l"; command = "show_lyrics"; }
{ key = "ctrl-v"; command = "select_range"; }
{ key = "v"; command = "reverse_selection"; }
{ key = "V"; command = "remove_selection"; }
{ key = "B"; command = "select_album"; }
{ key = "a"; command = "add_selected_items"; }
{ key = "c"; command = "clear_playlist"; }
{ key = "c"; command = "clear_main_playlist"; }
{ key = "C"; command = "crop_playlist"; }
{ key = "C"; command = "crop_main_playlist"; }
{ key = "m"; command = "move_sort_order_up"; }
{ key = "m"; command = "move_selected_items_up"; }
{ key = "n"; command = "move_sort_order_down"; }
{ key = "n"; command = "move_selected_items_down"; }
{ key = "M"; command = "move_selected_items_to"; }
{ key = "A"; command = "add"; }
{ key = "S"; command = "save_playlist"; }
{ key = "o"; command = "jump_to_playing_song"; }
{ key = "G"; command = "jump_to_browser"; }
{ key = "G"; command = "jump_to_playlist_editor"; }
{ key = "~"; command = "jump_to_media_library"; }
{ key = "E"; command = "jump_to_tag_editor"; }
{ key = "U"; command = "toggle_playing_song_centering"; }
{ key = "P"; command = "toggle_display_mode"; }
{ key = "\\\\"; command = "toggle_interface"; }
{ key = "!"; command = "toggle_separators_between_albums"; }
{ key = "L"; command = "toggle_lyrics_fetcher"; }
{ key = "F"; command = "fetch_lyrics_in_background"; }
{ key = "alt-l"; command = "toggle_fetching_lyrics_in_background"; }
{ key = "ctrl-l"; command = "toggle_screen_lock"; }
{ key = "`"; command = "toggle_library_tag_type"; }
{ key = "`"; command = "refetch_lyrics"; }
{ key = "`"; command = "add_random_items"; }
{ key = "ctrl-p"; command = "set_selected_items_priority"; }
{ key = "q"; command = "quit"; }
# the t key isn't used and it's easier to press than /, so lets use it
{ key = "t"; command = "find"; }
{ key = "t"; command = "find_item_forward"; }
{ key = "+"; command = "show_clock"; }
{ key = "="; command = "volume_up"; }
{ key = "j"; command = "scroll_down"; }
{ key = "k"; command = "scroll_up"; }
{ key = "ctrl-u"; command = "page_up"; }
#push_characters "kkkkkkkkkkkkkkk"
{ key = "ctrl-d"; command = "page_down"; }
#push_characters "jjjjjjjjjjjjjjj"
{ 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"; }
# not used but bound
{ key = "J"; command = "move_sort_order_down"; }
{ key = "K"; command = "move_sort_order_up"; }
];
settings = {
lyrics_directory = "~/music/.lyrics";
playlist_disable_highlight_delay = 0;
message_delay_time = 5;
# - 0 - default window color (discards all other colors)
# - 1 - black
# - 2 - red
# - 3 - green
# - 4 - yellow
# - 5 - blue
# - 6 - magenta
# - 7 - cyan
# - 8 - white
# - 9 - end of current color
# - b - bold text
# - u - underline text
# - r - reverse colors
# - a - use alternative character set
song_list_format = "{%a - }{%t}|{$8%f$9}$R{$3(%l)$9}";
song_status_format = "{{%a{ \"%b\"{ (%y)}} - }{%t}}|{%f}";
song_library_format = "{%n - }{%t}|{%f}";
alternative_header_first_line_format = "$b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b";
alternative_header_second_line_format = "{{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}";
current_item_prefix = "$(yellow)$r";
current_item_suffix = "$/r$(end)";
current_item_inactive_column_prefix = "$(white)$r";
current_item_inactive_column_suffix = "$/r$(end)";
now_playing_prefix = "$b";
now_playing_suffix = "$/b";
browser_playlist_prefix = "$2playlist$9 ";
selected_item_prefix = "$6";
selected_item_suffix = "$9";
modified_item_prefix = "$3> $9";
song_window_title_format = "{%a - }{%t}|{%f}";
browser_sort_mode = "name";
browser_sort_format = "{%a - }{%t}|{%f} {(%l)}";
song_columns_list_format = "(10)[green]{a} (50)[white]{t|f:Title} (20)[cyan]{b} (7f)[magenta]{l}";
# song_columns_list_format = "(10)[green]{a} (50)[black]{t|f:Title} (20)[cyan]{b} (7f)[magenta]{l}";
execute_on_song_change = "";
execute_on_player_state_change = "";
playlist_show_mpd_host = "no";
playlist_show_remaining_time = "no";
playlist_shorten_total_times = "no";
playlist_separate_albums = "no";
playlist_display_mode = "columns";
browser_display_mode = "classic";
search_engine_display_mode = "classic";
playlist_editor_display_mode = "classic";
discard_colors_if_item_is_selected = "yes";
show_duplicate_tags = "yes";
incremental_seeking = "yes";
seek_time = 1;
volume_change_step = 2;
autocenter_mode = "no";
centered_cursor = "no";
progressbar_look = "";
# progressbar_look = "◾◾◽";
# progressbar_look = "=> ";
default_place_to_search_in = "database";
user_interface = "classic";
data_fetching_delay = "yes";
media_library_primary_tag = "artist";
media_library_albums_split_by_date = "yes";
default_find_mode = "wrapped";
default_tag_editor_pattern = "%n - %t";
header_visibility = "yes";
statusbar_visibility = "yes";
titles_visibility = "yes";
header_text_scrolling = "yes";
cyclic_scrolling = "no";
lines_scrolled = 2;
# lyrics_fetchers = "azlyrics, genius, sing365, lyricsmania, metrolyrics, justsomelyrics, jahlyrics, plyrics, tekstowo, internet";
follow_now_playing_lyrics = "no";
fetch_lyrics_for_current_song_in_background = "no";
store_lyrics_in_song_dir = "no";
generate_win32_compatible_filenames = "yes";
allow_for_physical_item_deletion = "no";
lastfm_preferred_language = "en";
space_add_mode = "add_remove";
show_hidden_files_in_local_browser = "no";
screen_switcher_mode = "playlist, browser";
startup_screen = "playlist";
startup_slave_screen = "";
startup_slave_screen_focus = "no";
locked_screen_width_part = "50";
ask_for_locked_screen_width_part = "yes";
jump_to_now_playing_song_at_start = "yes";
ask_before_clearing_playlists = "yes";
clock_display_seconds = "no";
display_volume_level = "yes";
display_bitrate = "yes";
display_remaining_time = "no";
ignore_leading_the = "no";
ignore_diacritics = "no";
block_search_constraints_change_if_items_found = "yes";
mouse_support = "yes";
mouse_list_scroll_whole_page = "yes";
empty_tag_marker = "<empty>";
tags_separator = " | ";
tag_editor_extended_numeration = "no";
media_library_sort_by_mtime = "no";
enable_window_title = "no";
search_engine_default_search_mode = 1;
external_editor = "vim";
use_console_editor = "yes";
colors_enabled = "yes";
empty_tag_color = "cyan";
header_window_color = "cyan";
volume_color = "red";
state_line_color = "yellow";
state_flags_color = "red";
# This one is probably the one you're looking for
main_window_color = "white";
# main_window_color = "black";
color1 = "white";
color2 = "green";
progressbar_color = "yellow";
progressbar_elapsed_color = "green:b";
statusbar_color = "cyan";
statusbar_time_color = "default:b";
player_state_color = "default:b";
alternative_ui_separator_color = "black:b";
window_border_color = "green";
active_window_border = "red";
# visualizer_fifo_path = "/tmp/mpd.fifo";
# visualizer_output_name = "my_fifo";
# visualizer_sync_interval = "30";
# visualizer_in_stereo = "no";
# visualizer_type = "spectrum"; # spectrum, ellipse, wave_filled, wave
# visualizer_look = "+█"; # wave | spectrum, ellipse, wave_filled
};
};
}

View File

@ -0,0 +1,34 @@
{pkgs, ...}:
{
programs.neovim = {
enable = true;
# defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
extraConfig = ''
set clipboard+=unnamedplus
'';
plugins = with pkgs.vimPlugins; [
vim-commentary
vim-gitgutter
fzf-vim
vim-which-key
vim-nix
vim-surround
vim-fugitive
vim-css-color
semshi
goyo-vim
limelight-vim
vim-tmux-navigator
vim-polyglot
{
plugin = vim-monokai;
config = ''
colorscheme monokai
'';
}
];
};
}

View File

@ -0,0 +1,62 @@
{ ... }:
let
defaultBrowser = "google-chrome-stable %u";
videoViewer = "mpv %u";
in {
programs.newsboat = {
enable = true;
autoReload = true;
maxItems = 50;
browser = defaultBrowser;
extraConfig = builtins.concatStringsSep "\n" [
''
macro m set browser "${videoViewer}"; open-in-browser ; set browser "${defaultBrowser}"
macro l set browser "${defaultBrowser}"; open-in-browser ; set browser "${defaultBrowser}"
''
# Unbind keys
''
unbind-key ENTER
unbind-key j
unbind-key k
unbind-key J
unbind-key K
''
# Bind keys - vim style
''
bind-key j down
bind-key k up
bind-key l open
bind-key h quit
''
# Theme
''
color background default default
color listnormal default default
color listnormal_unread default default
color listfocus black cyan
color listfocus_unread black cyan
color info default black
color article default default
''
# Highlights
''
highlight all "---.*---" yellow
highlight feedlist ".*(0/0))" black
highlight article "(^Feed:.*|^Title:.*|^Author:.*)" cyan default bold
highlight article "(^Link:.*|^Date:.*)" default default
highlight article "https?://[^ ]+" green default
highlight article "^(Title):.*$" blue default
highlight article "\\[[0-9][0-9]*\\]" magenta default bold
highlight article "\\[image\\ [0-9]+\\]" green default bold
highlight article "\\[embedded flash: [0-9][0-9]*\\]" green default bold
highlight article ":.*\\(link\\)$" cyan default
highlight article ":.*\\(image\\)$" blue default
highlight article ":.*\\(embedded flash\\)$" magenta default
''
];
};
}

35
nixpkgs/programs/rofi.nix Normal file
View File

@ -0,0 +1,35 @@
{pkgs, ...}:
{
programs.rofi = {
enable = true;
# plugins = with pkgs; [
# rofi-emoji
# rofi-mpd
# rofi-pass
# rofi-calc
# rofi-systemd
# rofi-power-menu
# rofi-file-browser
# ];
font = "Droid Sans 12";
theme = ../../rofi/themes/blank.rasi;
extraConfig = {
modi = "window,run,drun,ssh,windowcd,file-browser";
show-icons = true;
drun-display-format = "{name}";
fullscreen = false;
threads = 0;
matching = "fuzzy";
scroll-method = 0;
disable-history = false;
window-thumbnail = true;
kb-row-up = "Up,Alt+k";
kb-row-down = "Down,Alt+j";
kb-row-left = "Alt+h";
kb-row-right = "Alt+l";
};
};
}

100
nixpkgs/programs/tmux.nix Normal file
View File

@ -0,0 +1,100 @@
{pkgs, ...}:
{
programs.tmux = {
enable = true;
baseIndex = 1;
clock24 = true;
escapeTime = 0;
# keyMode = "vi";
prefix = "C-a";
plugins = with pkgs.tmuxPlugins; [
];
extraConfig = ''
# Don't rename windows automatically after rename with ','
set-option -g allow-rename off
set -g mouse on
set -q -g status-utf8 on
setw -q -g utf8 on
set-option -g default-terminal screen-256color
set -g base-index 1 # windows starts at 1
setw -g monitor-activity on
set -g visual-activity on
# Length of tmux status line
set -g status-left-length 30
set -g status-right-length 150
set -g base-index 1
set -g pane-base-index 0
######################
######## KEYS ########
######################
# Split panes using $P-[gh]
bind h split-window -h -c "#{pane_current_path}"
bind g split-window -v -c "#{pane_current_path}"
unbind '"' # Unbind default vertical split
unbind % # Unbind default horizontal split
# Reload config using $P-r
unbind r
bind r \
source-file $XDG_CONFIG_HOME/tmux/tmux.conf\;\
display-message 'Reloaded tmux.conf'
# Switch panes using Alt-[hjkl]
bind -n C-h select-pane -L
bind -n C-j select-pane -D
bind -n C-k select-pane -U
bind -n C-l select-pane -R
# Resize pane using Alt-Shift-[hjkl]
bind -n M-H resize-pane -L 5
bind -n M-J resize-pane -D 5
bind -n M-K resize-pane -U 5
bind -n M-L resize-pane -R 5
# Fullscreen current pane using $P-Alt-z
unbind z
bind M-z resize-pane -Z
# Kill pane using $P-Backspace
unbind &
bind BSpace killp
# Swap clock-mode and new-window
# New tab: $P-t
# Clock mode: $P-c
unbind c
unbind t
bind c clock-mode
bind t new-window
# Setup 'y' to yank (copy)
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi 'V' send -X select-line
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
######################
### DESIGN CHANGES ###
######################
set-option -g status-left '#[bg=blue]#[fg=black,bold] ###S #[bg=default] #[fg=green]#(~/.scripts/tmux/fcitx) #[fg=red]%H:%M '
set-option -g status-right '#[fg=red]#(~/.scripts/tmux/mpd)'
set-window-option -g window-status-current-style fg=magenta
set-option -g status-style 'bg=black fg=default'
set-option -g default-shell '${pkgs.zsh}/bin/zsh'
set -g status-position bottom
set -g status-interval 4
set -g status-justify centre # center align window list
setw -g status-bg default
setw -g window-status-format '#[bg=#888888]#[fg=black,bold] #I #[bg=default] #[fg=#888888]#W '
setw -g window-status-current-format '#[fg=black,bold]#[bg=cyan] #I #[fg=cyan]#[bg=default] #W '
'';
};
}

View File

@ -0,0 +1 @@
void syslog(int priority, const char *format, ...) { }

View File

@ -0,0 +1,124 @@
# Based on previous attempts:
# - <https://github.com/msteen/nixos-vsliveshare/blob/master/pkgs/vsliveshare/default.nix>
# - <https://github.com/NixOS/nixpkgs/issues/41189>
{ lib, gccStdenv, vscode-utils
, jq, autoPatchelfHook, bash, makeWrapper
, dotnet-sdk_3, curl, gcc, icu, libkrb5, libsecret, libunwind, libX11, lttng-ust, openssl, util-linux, zlib
, desktop-file-utils, xprop, xsel
}:
with lib;
let
# https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/linux#install-prerequisites-manually
libs = [
# .NET Core
openssl
libkrb5
zlib
icu
# Credential Storage
libsecret
# NodeJS
libX11
# https://github.com/flathub/com.visualstudio.code.oss/issues/11#issuecomment-392709170
libunwind
lttng-ust
curl
# General
gcc.cc.lib
util-linux # libuuid
];
in ((vscode-utils.override { stdenv = gccStdenv; }).buildVscodeMarketplaceExtension {
mktplcRef = {
name = "vsliveshare";
publisher = "ms-vsliveshare";
version = "1.0.5090";
sha256 = "gQ4tChmGxYIt+/izw9NvLCLHD8ypNO7pcWuLw4umhF0=";
};
}).overrideAttrs({ nativeBuildInputs ? [], buildInputs ? [], ... }: {
nativeBuildInputs = nativeBuildInputs ++ [
bash
jq
autoPatchelfHook
makeWrapper
];
buildInputs = buildInputs ++ libs;
# Using a patch file won't work, because the file changes too often, causing the patch to fail on most updates.
# Rather than patching the calls to functions, we modify the functions to return what we want,
# which is less likely to break in the future.
postPatch = ''
sed -i \
-e 's/updateExecutablePermissionsAsync() {/& return;/' \
-e 's/isInstallCorrupt(traceSource, manifest) {/& return false;/' \
out/prod/extension-prod.js
declare ext_unique_id
ext_unique_id="$(basename "$out")"
# Fix extension attempting to write to 'modifiedInternalSettings.json'.
# Move this write to the tmp directory indexed by the nix store basename.
substituteInPlace out/prod/extension-prod.js \
--replace "path.resolve(constants_1.EXTENSION_ROOT_PATH, './modifiedInternalSettings.json')" \
"path.join(os.tmpdir(), '$ext_unique_id-modifiedInternalSettings.json')"
# Fix extension attempting to write to 'vsls-agent.lock'.
# Move this write to the tmp directory indexed by the nix store basename.
substituteInPlace out/prod/extension-prod.js \
--replace "path + '.lock'" \
"__webpack_require__('path').join(__webpack_require__('os').tmpdir(), '$ext_unique_id-vsls-agent.lock')"
# Hardcode executable paths
echo '#!/bin/sh' >node_modules/@vsliveshare/vscode-launcher-linux/check-reqs.sh
substituteInPlace node_modules/@vsliveshare/vscode-launcher-linux/install.sh \
--replace desktop-file-install ${desktop-file-utils}/bin/desktop-file-install
substituteInPlace node_modules/@vsliveshare/vscode-launcher-linux/uninstall.sh \
--replace update-desktop-database ${desktop-file-utils}/bin/update-desktop-database
substituteInPlace node_modules/@vsliveshare/vscode-launcher-linux/vsls-launcher \
--replace /bin/bash ${bash}/bin/bash
substituteInPlace out/prod/extension-prod.js \
--replace xprop ${xprop}/bin/xprop \
--replace "'xsel'" "'${xsel}/bin/xsel'"
'';
postInstall = ''
cd $out/share/vscode/extensions/ms-vsliveshare.vsliveshare
bash -s <<ENDSUBSHELL
shopt -s extglob
# A workaround to prevent the journal filling up due to diagnostic logging.
# See: https://github.com/MicrosoftDocs/live-share/issues/1272
# See: https://unix.stackexchange.com/questions/481799/how-to-prevent-a-process-from-writing-to-the-systemd-journal
gcc -fPIC -shared -ldl -o dotnet_modules/noop-syslog.so ${./noop-syslog.c}
# Normally the copying of the right executables is done externally at a later time,
# but we want it done at installation time.
cp dotnet_modules/exes/linux-x64/* dotnet_modules
# The required executables are already copied over,
# and the other runtimes won't be used and thus are just a waste of space.
rm -r dotnet_modules/exes dotnet_modules/runtimes/!(linux-x64|unix)
# Not all executables and libraries are executable, so make sure that they are.
jq <package.json '.executables.linux[]' -r | xargs chmod +x
# Lock the extension downloader.
touch install-linux.Lock externalDeps-linux.Lock
ENDSUBSHELL
'';
postFixup = ''
# We cannot use `wrapProgram`, because it will generate a relative path,
# which will break when copying over the files.
mv dotnet_modules/vsls-agent{,-wrapped}
makeWrapper $PWD/dotnet_modules/vsls-agent{-wrapped,} \
--prefix LD_LIBRARY_PATH : "${makeLibraryPath libs}" \
--set LD_PRELOAD $PWD/dotnet_modules/noop-syslog.so \
--set DOTNET_ROOT ${dotnet-sdk_3}
'';
meta = {
description = "Live Share lets you achieve greater confidence at speed by streamlining collaborative editing, debugging, and more in real-time during development";
homepage = "https://aka.ms/vsls-docs";
license = licenses.unfree;
maintainers = with maintainers; [ jraygauthier V ];
platforms = [ "x86_64-linux" ];
};
})

585
nixpkgs/programs/vscode.nix Normal file
View File

@ -0,0 +1,585 @@
{ pkgs, lib, ... }:
let mapPrefixToSet = prefix: set:
with lib; attrsets.mapAttrs' (k: v: attrsets.nameValuePair ("${prefix}.${k}") v) set;
vs-liveshare = pkgs.callPackage ./vscode-extensions/vsliveshare.nix {};
in
{
programs.vscode ={
enable = true;
# package = pkgs.vscodium;
# package = pkgs.vscode-fhsWithPackages (ps: with ps; [rustup zlib]);
# package = pkgs.vscode-fhs;
userSettings = let
editor = mapPrefixToSet "editor" {
fontFamily = "Fira Code";
fontLigatures = true;
lineNumbers = "on";
mouseWheelZoom = false;
fontSize = 14;
"minimap.enabled" = false;
tabSize = 2;
insertSpaces = true;
detectIndentation = false;
tabCompletion = "onlySnippets";
snippetSuggestions = "top";
cursorBlinking = "smooth";
cursorSmoothCaretAnimation = true;
multiCursorModifier = "ctrlCmd";
suggestSelection = "first";
cursorStyle = "line";
wordSeparators = "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-";
wordWrap = "off";
# "bracketPairColorization.enabled" = true;
};
zen = mapPrefixToSet "zenMode" {
centerLayout = true;
hideStatusBar = false;
hideLineNumbers = false;
hideTabs = false;
};
vim = mapPrefixToSet "vim" {
useSystemClipboard = true;
"statusBarColorControl" = true;
"statusBarColors.insert" = "#20ff00";
"statusBarColors.normal" = "#1D1E20";
"statusBarColors.visual" = "#00ffff";
"statusBarColors.replace" = "#ff002b";
handleKeys = {
"<C-d>" = true;
"<C-j>" = false;
"<C-b>" = false;
"<C-k>" = false;
"<C-w>" = false;
"<C-n>" = false;
"<A-o>" = true;
};
};
workbench = mapPrefixToSet "workbench" {
"settings.enableNaturalLanguageSearch" = false;
enableExperiments = false;
iconTheme = "material-icon-theme";
colorTheme = "Monokai ST3";
colorCustomizations = {
"statusBar.background" = "#1D1E20";
"statusBar.noFolderBackground" = "#1D1E20";
"statusBar.debuggingBackground" = "#1D1E20";
"[Monokai ST3]" = {
"editor.foreground" = "#ffffff";
};
};
editorAssociations = {
"*.pdf" = "default";
"*.ipynb" = "jupyter.notebook.ipynb";
};
};
python = mapPrefixToSet "python" {
"analysis.completeFunctionParens" = true;
"formatting.provider" = "yapf";
"formatting.yapfArgs" = [
"--style={based_on_style: pep8, indent_width: 2}"
];
"autoComplete.addBrackets" = true;
languageServer = "Pylance";
};
java = mapPrefixToSet "java" {
"configuration.checkProjectSettingsExclusions" = false;
"test.report.showAfterExecution" = "always";
"test.report.position" = "currentView";
"refactor.renameFromFileExplorer" = "preview";
};
sync = mapPrefixToSet "sync" {
autoUpload = true;
autoDownload = true;
quietSync = true;
gist = "86e19852a95d31a278ad1a516b40556b";
};
svg = mapPrefixToSet "svgviewer" {
transparencygrid = true;
enableautopreview = true;
previewcolumn = "Beside";
showzoominout = true;
};
indentRainbow = mapPrefixToSet "indentRainbow" {
errorColor = "rgb(255, 0, 0)";
colors = [ # http://colrd.com/palette/38436/
"rgba(26, 19, 52, 0.1)"
"rgba(1, 84, 90, 0.1)"
"rgba(3, 195, 131, 0.1)"
"rgba(251, 191, 69, 0.1)"
"rgba(237, 3, 69, 0.1)"
"rgba(113, 1, 98, 0.1)"
"rgba(2, 44, 125, 0.1)"
"rgba(38, 41, 74, 0.1)"
"rgba(1, 115, 81, 0.1)"
"rgba(170, 217, 98, 0.1)"
"rgba(239, 106, 50, 0.1)"
"rgba(161, 42, 94, 0.1)"
];
ignoreErrorLanguages = [
"markdown"
"haskell"
"elm"
"fsharp"
"java"
];
};
in
editor //
indentRainbow //
java //
python //
svg //
sync //
workbench //
vim // # This needs to come after workbench because of setting ordering
zen //
{
"extensions.autoCheckUpdates" = false;
"extensions.autoUpdate" = false;
"diffEditor.ignoreTrimWhitespace" = false;
"emmet.triggerExpansionOnTab" = true;
"explorer.confirmDragAndDrop" = false;
"git.allowForcePush" = true;
"git.autofetch" = true;
"telemetry.telemetryLevel" = "off";
"terminal.integrated.fontSize" = 14;
"vsintellicode.modify.editor.suggestSelection" = "automaticallyOverrodeDefaultValue";
"window.zoomLevel" = 2;
# This setting does not support language overrides
"files.exclude" = {
# Java
"**/.classpath" = true;
"**/.project" = true;
"**/.settings" = true;
"**/.factorypath" = true;
};
# Extensions
"bracket-pair-colorizer-2.colorMode" = "Consecutive";
"bracket-pair-colorizer-2.forceIterationColorCycle" = true;
"bracket-pair-colorizer-2.colors" = [
"#fff200"
"#3d33ff"
"#ff57d5"
"#00ff11"
"#ff8400"
"#ff0030"
];
"docker.showStartPage" = false;
"errorLens.errorColor" = "rgba(240,0,0,0.1)";
"errorLens.warningColor" = "rgba(180,180,0,0.1)";
"jupyter.askForKernelRestart" = false;
"keyboard-quickfix.showActionNotification" = false;
"latex-workshop.latex.autoBuild.run" = "onFileChange";
"latex-workshop.view.pdf.viewer" = "tab";
"liveshare.presence" = true;
"liveshare.showInStatusBar" = "whileCollaborating";
"liveServer.settings.port" = 5500;
"material-icon-theme.folders.associations" = {
ui = "layout";
bloc = "controller";
};
"redhat.telemetry.enabled" = false;
"sonarlint.rules" = {
"java:S3358" = {
"level" = "off";
};
};
# Language overrides
"dart.previewFlutterUiGuides" = true;
"dart.previewFlutterUiGuidesCustomTracking" = true;
"dart.previewLsp" = true;
"[dart]" = {
"editor.defaultFormatter" = "Dart-Code.dart-code";
};
"[html]" = {
"editor.formatOnSave" = false;
"editor.defaultFormatter" = "lonefy.vscode-JS-CSS-HTML-formatter";
};
"[javascript]" = {
"editor.formatOnSave" = false;
"editor.defaultFormatter" = "vscode.typescript-language-features";
};
"[json]" = {
"editor.formatOnSave" = true;
};
"[jsonc]" = {
"editor.defaultFormatter" = "vscode.json-language-features";
};
};
keybindings = [
{
key = "ctrl+[Period]";
command = "keyboard-quickfix.openQuickFix";
when = "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly";
}
{
key = "alt+k";
command = "selectPrevSuggestion";
when = "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus";
}
{
key = "alt+j";
command = "selectNextSuggestion";
when = "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus";
}
{
key = "alt+k";
command = "editor.action.moveLinesUpAction";
when = "editorTextFocus && !editorReadonly && !suggestWidgetVisible";
}
{
key = "alt+j";
command = "editor.action.moveLinesDownAction";
when = "editorTextFocus && !editorReadonly && !suggestWidgetVisible";
}
{
key = "alt+j";
command = "workbench.action.quickOpenNavigateNext";
when = "inQuickOpen";
}
{
key = "alt+k";
command = "workbench.action.quickOpenNavigatePrevious";
when = "inQuickOpen";
}
{
key = "alt+f";
command = "editor.action.formatDocument";
when = "editorTextFocus && !editorReadonly";
}
{
key = "alt+o";
command = "editor.action.insertLineAfter";
when = "textInputFocus && !editorReadonly";
}
{
key = "alt+shift+o";
command = "editor.action.insertLineBefore";
when = "textInputFocus && !editorReadonly";
}
];
extensions = with pkgs.vscode-extensions; [
vs-liveshare
# ms-vsliveshare.vsliveshare
redhat.java
wholroyd.jinja
bbenoist.Nix
# jock.svg
vscodevim.vim
haskell.haskell
justusadam.language-haskell
naumovs.color-highlight
# eamodio.gitlens
ms-python.python
mikestead.dotenv
redhat.vscode-yaml
# ms-toolsai.jupyter
# dotjoshjohnson.xml
usernamehw.errorlens
ibm.output-colorizer
gruntfuggly.todo-tree
mechatroner.rainbow-csv
ms-python.vscode-pylance
james-yu.latex-workshop
elmtooling.elm-ls-vscode
# WakaTime.vscode-wakatime
yzhang.markdown-all-in-one
pkief.material-icon-theme
# ms-vscode-remote.remote-ssh
# ms-azuretools.vscode-docker
justusadam.language-haskell
coenraads.bracket-pair-colorizer-2
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
name = "path-intellisense";
publisher = "christian-kohler";
version = "2.4.2";
sha256 = "1a4d1n4jpdlx4r2majirnhnwlj34jc94wzbxdrih615176hadxvc";
}
{
name = "xml";
publisher = "DotJoshJohnson";
version = "2.5.1";
sha256 = "1v4x6yhzny1f8f4jzm4g7vqmqg5bqchyx4n25mkgvw2xp6yls037";
}
{
name = "vscode-html-css";
publisher = "ecmel";
version = "1.10.2";
sha256 = "0qzh7fwgadcahxx8hz1sbfz9lzi81iv4xiidvfm3sahyl9s6pyg1";
}
{
name = "elm-ls-vscode";
publisher = "elmTooling";
version = "2.3.0";
sha256 = "1nxl3im5aqiggjx0va64bpjrwshb6fzxan78fqzs68iwn16vsa0b";
}
{
name = "vscode-drawio";
publisher = "hediet";
version = "1.6.3";
sha256 = "0r4qrw1l8s8sfgxj4wvkzamd3yc1h1l60r3kkc1g9afkikmnbr5w";
}
{
name = "language-x86-64-assembly";
publisher = "13xforever";
version = "3.0.0";
sha256 = "0lxg58hgdl4d96yjgrcy2dbacxsc3wz4navz23xaxcx1bgl1i2y0";
}
{
name = "monokai-st3";
publisher = "AndreyVolosovich";
version = "0.2.0";
sha256 = "1rvz5hlrfshy9laybxzvrdklx328s13j0lb8ljbda9zkadi3wcad";
}
# {
# name = "nix-env-selector";
# publisher = "arrterian";
# version = "1.0.7";
# sha256 = "0mralimyzhyp4x9q98x3ck64ifbjqdp8cxcami7clvdvkmf8hxhf";
# }
{
name = "vscode-JS-CSS-HTML-formatter";
publisher = "lonefy";
version = "0.2.3";
sha256 = "06vivclp58wzmqcx6s6pl8ndqina7p995dr59aj9fk65xihkaagy";
}
{
name = "indent-rainbow";
publisher = "oderwat";
version = "8.2.2";
sha256 = "1xxljwh66f21fzmhw8icrmxxmfww1s67kf5ja65a8qb1x1rhjjgf";
}
{
name = "vscode-css-peek";
publisher = "pranaygp";
version = "4.2.0";
sha256 = "0dpkp3xs8jd826h2aa9xlfilsj4yv8q6r9cs350ljrpcyj7wrlpq";
}
{
name = "LiveServer";
publisher = "ritwickdey";
version = "5.6.1";
sha256 = "077arf3hsn1yb8xdhlrax5gf93ljww78irv4gm8ffmsqvcr1kws0";
}
{
name = "background";
publisher = "shalldie";
version = "1.1.29";
sha256 = "1x3k8pmzp186bcgga3wg6y86waxrcsi5cnwaxfmifqgn87jp2vqq";
}
{
name = "trailing-spaces";
publisher = "shardulm94";
version = "0.3.1";
sha256 = "0h30zmg5rq7cv7kjdr5yzqkkc1bs20d72yz9rjqag32gwf46s8b8";
}
{
name = "comment-divider";
publisher = "stackbreak";
version = "0.4.0";
sha256 = "1qcj2lngcv1sc7jri70ilkkrcx34wn8f4sqwk4dlgrribw6nvj1g";
}
{
name = "lorem-ipsum";
publisher = "Tyriar";
version = "1.3.0";
sha256 = "03jas413ivahfpxrlc5qif35nd67m1nmwx8p8dj1fpv04s6fdigb";
}
{
name = "asciidoctor-vscode";
publisher = "asciidoctor";
version = "2.8.10";
sha256 = "1n293nsaid9c4lsfn5ns4899yay9vckfk7ld3l2cnd29s82d316i";
}
{
name = "vscode-svgviewer";
publisher = "cssho";
version = "2.0.0";
sha256 = "06swlqiv3gc7plcbmzz795y6zwpxsdhg79k1n3jj6qngfwnv2p6z";
}
{
name = "arm";
publisher = "dan-c-underwood";
version = "1.5.2";
sha256 = "0x31wmd6m1gzm0sfi5xjsa38jr043qq9kgykw3b52hcma7ww8ky3";
}
{
name = "dart-code";
publisher = "Dart-Code";
version = "3.28.0";
sha256 = "0ppzv0cs4b559m4nvbfik2m63hs10g5idrc5j3pkgdjm14n1jiwv";
}
{
name = "comment-anchors";
publisher = "ExodiusStudios";
version = "1.9.6";
sha256 = "1zgvgf6zq1ny3v8b9jjp4j3n27qmiz45g23ljaim92g6hni38wvv";
}
{
name = "bloc";
publisher = "FelixAngelov";
version = "6.2.0";
sha256 = "0rr00pfcpjk17plzmmaqr0znj3k1qd0m2rh15c9894fifdyy69fx";
}
{
name = "vscode-test-explorer";
publisher = "hbenl";
version = "2.21.1";
sha256 = "022lnkq278ic0h9ggpqcwb3x3ivpcqjimhgirixznq0zvwyrwz3w";
}
{
name = "haskell-linter";
publisher = "hoovercj";
version = "0.0.6";
sha256 = "0fb71cbjx1pyrjhi5ak29wj23b874b5hqjbh68njs61vkr3jlf1j";
}
{
name = "plantuml";
publisher = "jebbs";
version = "2.16.1";
sha256 = "17gkrai7fdhrq0q1zip4wn7j4qx9vbbirx3n68silb34wh0dbydk";
}
{
name = "vscode-gutter-preview";
publisher = "kisstkondoros";
version = "0.29.0";
sha256 = "00vibv9xmhwaqiqzp0y2c246pqiqfjsw4bqx4vcdd67pz1wnqhg1";
}
{
name = "vscode-JS-CSS-HTML-formatter";
publisher = "lonefy";
version = "0.2.3";
sha256 = "06vivclp58wzmqcx6s6pl8ndqina7p995dr59aj9fk65xihkaagy";
}
{
name = "git-graph";
publisher = "mhutchie";
version = "1.30.0";
sha256 = "000zhgzijf3h6abhv4p3cz99ykj6489wfn81j0s691prr8q9lxxh";
}
{
name = "test-adapter-converter";
publisher = "ms-vscode";
version = "0.1.4";
sha256 = "02b04756kfk640hri1xw0p6kwjxwp8d2hpmca0iysfivfcmm1bqn";
}
{
name = "awesome-flutter-snippets";
publisher = "Nash";
version = "3.0.2";
sha256 = "009z6k719w0sypzsk53wiard3j3d8bq9b0g9s82vw3wc4jvkc3hr";
}
{
name = "indent-rainbow";
publisher = "oderwat";
version = "8.2.2";
sha256 = "1xxljwh66f21fzmhw8icrmxxmfww1s67kf5ja65a8qb1x1rhjjgf";
}
{
name = "vscode-xml";
publisher = "redhat";
version = "0.18.1";
sha256 = "006fjcr8s3rsznqgpp13cmvw8k94cfpr24r3rp019jaj5as3l1ck";
}
{
name = "comment-divider";
publisher = "stackbreak";
version = "0.4.0";
sha256 = "1qcj2lngcv1sc7jri70ilkkrcx34wn8f4sqwk4dlgrribw6nvj1g";
}
{
name = "addDocComments";
publisher = "stevencl";
version = "0.0.8";
sha256 = "08572fhn6ilfbx8zwn849ab3npyfkh9m5mk2br6sii601s9k5vrk";
}
{
name = "vscodeintellicode";
publisher = "VisualStudioExptTeam";
version = "1.2.14";
sha256 = "1j72v6grwasqk34m1jy3d6w3fgrw0dnsv7v17wca8baxrvgqsm6g";
}
{
name = "vscode-java-debug";
publisher = "vscjava";
version = "0.36.0";
sha256 = "1p9mymbf8sn39k44350zf3zwl29fhcwxfsqxr7841ch1qz88w9r8";
}
{
name = "vscode-java-dependency";
publisher = "vscjava";
version = "0.18.8";
sha256 = "1yjzgf96kqm09qlhxpa249fqb2b5wpzw9k53sgr8jx8sfx5qn95b";
}
{
name = "vscode-java-pack";
publisher = "vscjava";
version = "0.18.6";
sha256 = "095jdvvv4m8s2ymnrsq0ay7afqff5brgn6waknjfyy97qb3mzxj8";
}
{
name = "vscode-java-test";
publisher = "vscjava";
version = "0.32.0";
sha256 = "0lq6daz228ipzls88y09zbdsv9n6backs5bddpdam628rs99qvn3";
}
{
name = "vscode-maven";
publisher = "vscjava";
version = "0.34.1";
sha256 = "1mnlvnl2lg8fijxx4a6rqjix9k2j82js8kn8da7kjf4wh0ksdgvd";
}
{
name = "markdown-all-in-one";
publisher = "yzhang";
version = "3.4.0";
sha256 = "0ihfrsg2sc8d441a2lkc453zbw1jcpadmmkbkaf42x9b9cipd5qb";
}
];
};
}

View File

@ -0,0 +1,26 @@
{ ... }:
{
programs.zathura = {
enable = true;
options = {
selection-clipboard = "clipboard";
default-bg = "#f2e3bd";
completion-bg = "#f2e3bd";
completion-fg = "#5fd7a7";
statusbar-bg = "#f2e3bd";
statusbar-fg = "#008ec4";
inputbar-bg = "#f2e3bd";
inputbar-fg = "#c30771";
recolor = true;
recolor-lightcolor = "#f2e3bd";
# recolor-darkcolor = "#000000";
recolor-darkcolor = "#101010";
recolor-keephue = true;
};
};
}

192
nixpkgs/programs/zsh.nix Normal file
View File

@ -0,0 +1,192 @@
{ pkgs, lib, config, ... }:
{
programs.zsh = rec {
enable = true;
dotDir = ".config/zsh";
# enableSyntaxHighlighting = true;
defaultKeymap = "viins";
plugins = [
{
name = "zsh-completions";
src = pkgs.zsh-completions;
}
{
name = "zsh-you-should-use";
src = pkgs.zsh-you-should-use;
}
{
name = "zsh-autosuggestions";
src = pkgs.zsh-autosuggestions;
}
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
# {
# name = "powerlevel10k-config";
# src = lib.cleanSource ./p10k-config;
# file = "p10k.zsh";
# }
];
localVariables = {
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS = ["dir" "vcs"];
# NIX_PATH = ''$HOME/.nix-defexpr/channels$\{NIX_PATH:+:}$NIX_PATH'';
};
shellAliases = with pkgs; let
sedColor =
color:
inputPattern:
outputPattern:
"-e \"s|${inputPattern}|${outputPattern.before or ""}$(tput setaf ${toString color})${outputPattern.middle}$(tput op)${outputPattern.after or ""}|g\"";
colorRed = sedColor 1;
shellPipe = lib.strings.concatStringsSep " | ";
join = lib.strings.concatStringsSep " ";
in {
# This for some reason uses an outdated version of hm
# hs = "${pkgs.home-manager}/bin/home-manager switch";
hms = "home-manager switch";
nos = "sudo ${nixos-rebuild}/bin/nixos-rebuild switch";
ns = "nix-shell";
# Having 'watch' with a space after as an alias, enables it to expand other aliases
watch = "${procps}/bin/watch ";
m = "${ncmpcpp}/bin/ncmpcpp";
p = "${python39Packages.ipython}/bin/ipython";
lls = "${coreutils}/bin/ls";
ls = "${exa}/bin/exa";
la = "${exa}/bin/exa -lah --changed --time-style long-iso --git --group";
lsa = "la";
killall = "echo \"killall is dangerous on non-gnu platforms. Using 'pkill -x'\"; pkill -x";
youtube-dl-list = join [
"${youtube-dl}/bin/youtube-dl"
"-f \"bestvideo[ext=mp4]+bestaudio[e=m4a]/bestvideo+bestaudio\""
"-o \"%(playlist_index)s-%(title)s.%(ext)s\""
];
music-dl = "${youtube-dl}/bin/youtube-dl --extract-audio -f \"bestaudio[ext=m4a]/best\"";
music-dl-list = join [
"${youtube-dl}/bin/youtube-dl"
"--extract-audio"
"-f \"bestaudio[ext=m4a]/best\""
"-o \"%(playlist_index)s-%(title)s.%(ext)s\""
];
skusho = "${maim}/bin/maim --hidecursor --nokeyboard $(echo $SCREENSHOT_DIR)/$(date_%s).png";
skushoclip = shellPipe [
"${maim}/bin/maim --hidecursor --nokeyboard --select"
"${xclip}/bin/xclip -selection clipboard -target image/png -in"
];
view-latex = "${texlive.combined.scheme-full}/bin/latexmk -pdf -pvc main.tex";
reload-tmux = "${tmux}/bin/tmux source $HOME/.config/tmux/tmux.conf";
ag="${ripgrep}/bin/rg";
dp = "${dropbox-cli}/bin/dropbox";
cd = "z";
ccp = "${coreutils}/bin/cp";
cp = "${rsync}/bin/rsync --progress --human-readable";
cpr = "${rsync}/bin/rsync --progress --human-readable --recursive";
ccat = "${coreutils}/bin/cat";
cat = "${bat}/bin/bat";
htop = "${bottom}/bin/bottom";
ps = "${procs}/bin/procs";
fin = "${fd}/bin/fd";
ip = "ip -c";
connectedIps = shellPipe [
"netstat -tn 2>/dev/null"
"grep :$1"
"awk '{print $5}'"
"cut -d: -f1"
"sort"
"uniq -c"
"sort -nr"
"head"
];
path = let
colorSlashes = colorRed "/" {middle = "/";};
in
"echo $PATH | sed -e 's/:/\\n/g' ${colorSlashes} | sort";
aliases = let
colorAliasNames = colorRed "\\(^[^=]*\\)=" {middle = "\\1"; after = "\\t";};
# The '[^]]' (character before /nix should not be ']') is there so that this alias'
# definition won't be removed.
removeNixLinks = "-e 's|\\([^]]\\)/nix/store/.*/bin/|\\1|'";
in
shellPipe [
"alias"
"sed ${colorAliasNames} ${removeNixLinks}"
"column -ts $'\\t'"
];
ports = let
colorSlashes = colorRed "/" {middle = "/";};
colorFirstColumn = colorRed "(^[^ ]+)" {middle = "\\1";};
in
shellPipe [
"sudo netstat -tulpn"
"grep LISTEN"
"sed -r 's/\\s+/ /g'"
"cut -d' ' -f 4,7"
"column -t"
"sed -r ${colorFirstColumn} ${colorSlashes}"
];
}
//
(let
inherit (lib.strings) concatStrings concatStringsSep;
inherit (lib.lists) range flatten;
inherit (lib.attrsets) nameValuePair;
inherit (lib.trivial) const;
repeatItem = n: item: map (const item) (range 1 n);
repeatString = n: string: concatStrings (repeatItem n string);
nthCds = n: [
("cd" + (repeatString (n + 1) "."))
("cd." + toString n)
(repeatString (n + 1) ".")
("." + toString n)
(".." + toString n)
];
realCommand = n: "cd " + (concatStringsSep "/" (repeatItem n ".."));
nthCdsAsNameValuePairs = n: map (cmd: nameValuePair cmd (realCommand n)) (nthCds n);
allCdNameValuePairs = (flatten (map nthCdsAsNameValuePairs (range 1 9)));
in
builtins.listToAttrs allCdNameValuePairs);
initExtra = ''
source ${config.home.homeDirectory}/${dotDir}/p10k.zsh
'';
};
}

8
nixpkgs/services/mpd.nix Normal file
View File

@ -0,0 +1,8 @@
{ config, ... }:
rec {
enable = true;
musicDirectory = "${config.services.dropbox.path}/music/music";
# musicDirectory = "${config.home.homeDirectory}/music";
playlistDirectory = "${musicDirectory}/playlists/MPD";
}

View File

@ -0,0 +1,34 @@
{
enable = true;
blur = true;
blurExclude = [
"class_g = 'slop'"
"class_g = 'XAVA'"
"class_g = 'lattedock'"
"class_g = 'latte-dock'"
"window_type = 'dock'"
"window_type = 'desktop'"
"_GTK_FRAME_EXTENTS@:c"
];
fade = true;
fadeSteps = [ "0.1" "0.1" ];
fadeExclude = [];
shadow = true;
shadowOffsets = [ (-7) (-7) ];
shadowOpacity = "0.25";
shadowExclude = [
"class_g = 'XAVA'"
"class_g = 'stalonetray'"
"class_g = 'lattedock'"
"class_g = 'latte-dock'"
];
noDockShadow = true;
noDNDShadow = true;
vSync = true;
extraOptions = '''';
}

View File

@ -0,0 +1,21 @@
{ colorTheme, ... }:
{
enable = true;
config = {
decorations = "none";
transparent = false;
dockapp_mode = "none";
geometry = "8x1-0+0";
background = colorTheme.default.background;
kludges = "force_icons_size";
grow_gravity = "NW";
icon_gravity = "NW";
icon_size = 30;
sticky = true;
window_type = "dock";
window_layer = "bottom";
no_shrink = true;
skip_taskbar = true;
slot_size = 40;
};
}

View File

@ -0,0 +1,77 @@
{ pkgs, ... }:
{
enable = true;
keybindings = {
# make sxhkd reload its configuration files:
"super + Escape" = "pkill -USR1 -x sxhkd && ${pkgs.libnotify}/bin/notify-send -t 3000 \"sxhkd configuration reloaded\"";
# Applications
"super + w" = "${pkgs.emacs}/bin/emacs";
"super + e" = "$FILEBROWSER";
"super + s" = "$BROWSER";
"super + r" = "${pkgs.rofi}/bin/rofi -show drun";
# Volume
"super + {@F7,@F8}" = "${pkgs.alsaUtils}/bin/amixer set Master 2%{-,+}";
"{XF86AudioLowerVolume,XF86AudioRaiseVolume}" = "${pkgs.alsaUtils}/bin/amixer set Master 2%{-,+}";
"XF86AudioMute" = "${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
# Music
"super + p" = "${pkgs.mpc_cli}/bin/mpc toggle";
"XF86AudioPlay" = "${pkgs.mpc_cli}/bin/mpc toggle";
"XF86AudioPrev" = "${pkgs.mpc_cli}/bin/mpc prev";
"XF86AudioNext" = "${pkgs.mpc_cli}/bin/mpc next";
# Monitor
"XF86MonBrightnessUp" = "${pkgs.light}/bin/light -A 5";
"XF86MonBrightnessDown" = "${pkgs.light}/bin/light -U 5";
"@Print" = "${pkgs.maim}/bin/maim --hidecursor --nokeyboard --select | ${pkgs.xclip}/bin/xclip -selection clipboard -target image/png -in";
"shift + @Print" = "${pkgs.maim}/bin/maim --hidecursor --nokeyboard $SCREENSHOT_DIR/$(date +%s).png";
# TODO: Add boomer as package
# "super + @Print" = "boomer";
# Misc
"super + a" = "${pkgs.copyq}/bin/copyq toggle";
# fcitx
"super + {b,n,m}" = "${pkgs.fcitx}/bin/fcitx-remote -s {mozc,fcitx-keyboard-no,fcitx-keyboard-us}";
# fcitx5
# "super + {b,n,m}" = "${pkgs.fcitx5}/bin/fcitx5-remote -s {mozc,keyboard-no,keyboard-us}";
# TODO: fix
# "super + v" = "${pkgs.rofi}/bin/rofi -modi lpass:$HOME/.scripts/rofi/lpass/rofi-lpass -show lpass";
"super + minus" = "${pkgs.xcalib}/bin/xcalib -invert -alter";
# ¯\_(ツ)_/¯
# "super + shift + s"
# sleep 0.3; \
# ${pkgs.xdotool}/bin/xdotool key U00AF; \
# ${pkgs.xdotool}/bin/xdotool key U005C; \
# ${pkgs.xdotool}/bin/xdotool key U005F; \
# ${pkgs.xdotool}/bin/xdotool key U0028; \
# ${pkgs.xdotool}/bin/xdotool key U30C4; \
# ${pkgs.xdotool}/bin/xdotool key U0029; \
# ${pkgs.xdotool}/bin/xdotool key U005F; \
# ${pkgs.xdotool}/bin/xdotool key U002F; \
# ${pkgs.xdotool}/bin/xdotool key U00AF
# é
"super + shift + e" = "sleep 0.3; ${pkgs.xdotool}/bin/xdotool key U00E9";
};
}