diff options
Diffstat (limited to 'modules/user/aszlig/programs')
-rw-r--r-- | modules/user/aszlig/programs/gajim/config.nix | 731 | ||||
-rw-r--r-- | modules/user/aszlig/programs/gajim/config.patch | 80 | ||||
-rw-r--r-- | modules/user/aszlig/programs/gajim/default.nix | 59 | ||||
-rw-r--r-- | modules/user/aszlig/programs/git/default.nix | 74 | ||||
-rw-r--r-- | modules/user/aszlig/programs/mpv/default.nix | 24 | ||||
-rw-r--r-- | modules/user/aszlig/programs/taalo-build/default.nix | 65 | ||||
-rw-r--r-- | modules/user/aszlig/programs/taskwarrior/config.patch | 48 | ||||
-rw-r--r-- | modules/user/aszlig/programs/taskwarrior/default.nix | 36 | ||||
-rw-r--r-- | modules/user/aszlig/programs/vim/default.nix | 384 | ||||
-rw-r--r-- | modules/user/aszlig/programs/xpdf/default.nix | 20 | ||||
-rw-r--r-- | modules/user/aszlig/programs/zsh/default.nix | 117 |
11 files changed, 1638 insertions, 0 deletions
diff --git a/modules/user/aszlig/programs/gajim/config.nix b/modules/user/aszlig/programs/gajim/config.nix new file mode 100644 index 00000000..86c4fef1 --- /dev/null +++ b/modules/user/aszlig/programs/gajim/config.nix @@ -0,0 +1,731 @@ +lib: with lib; + +let + mkConfig = let + traverse = path: attrs: let + mkVal = name: value: let + flatPath = concatStringsSep "." (path ++ [name]); + in if isAttrs value then traverse (path ++ [name]) value + else if value == true then "${flatPath} = True" + else if value == false then "${flatPath} = False" + else "${flatPath} = ${value}"; + in concatStringsSep "\n" (mapAttrsToList mkVal attrs); + + rootTraverse = attrs: (traverse [] attrs) + "\n"; + in rootTraverse; + +in mkConfig { + activity_iconset = "default"; + after_nickname = ">"; + allow_hide_roster = true; + always_english_wikipedia = false; + always_english_wiktionary = true; + ascii_formatting = true; + ask_avatars_on_startup = true; + ask_offline_status = true; + ask_offline_status_on_connection = false; + ask_online_status = false; + attach_notifications_to_systray = false; + audio_input_device = "pulsesrc device=alsa_input." + + "usb-046d_0804_DD519390-02-U0x46d0x804.analog-mono" + + " ! volume name=gajim_vol"; + audio_input_volume = "50"; + audio_output_device = "pulsesink device=alsa_output." + + "pci-0000_00_1b.0.analog-stereo sync=true"; + audio_output_volume = "50"; + autoaway = false; + autoaway_message = "$S (Away as a result of being idle more than $T min)"; + autoawaytime = "5"; + autodetect_browser_mailer = false; + autopopup = true; + autopopupaway = true; + autoxa = false; + autoxa_message = "$S (Not available as a result of being" + + " idle more than $T min)"; + autoxatime = "15"; + avatar_position_in_roster = "left"; + before_nickname = "<"; + change_roster_title = true; + change_status_window_timeout = "15"; + "chat-msgwin-height" = "440"; + "chat-msgwin-width" = "480"; + "chat-msgwin-x-position" = "-1"; + "chat-msgwin-y-position" = "-1"; + chat_avatar_height = "52"; + chat_avatar_width = "52"; + chat_merge_consecutive_nickname = false; + chat_merge_consecutive_nickname_indent = " "; + check_idle_every_foo_seconds = "2"; + check_if_gajim_is_default = true; + collapsed_rows = ""; + compact_view = false; + confirm_block = ""; + confirm_close_muc = true; + confirm_close_muc_rooms = ""; + confirm_close_multiple_tabs = true; + confirm_custom_status = "no"; + confirm_metacontacts = "no"; + conversation_font = "Liberation Mono 10"; + ctrl_tab_go_to_next_composing = true; + custom_file_manager = ""; + custombrowser = "chromium"; + custommailapp = ""; + dictionary_url = "WIKTIONARY"; + displayed_chat_state_notifications = "all"; + emoticons_theme = ""; + enable_negative_priority = false; + escape_key_closes = false; + esession_modp = "5,14"; + file_transfers_port = "28011"; + ft_add_hosts_to_send = ""; + "gc-hpaned-position" = "979"; + "gc-msgwin-height" = "440"; + "gc-msgwin-width" = "600"; + "gc-msgwin-x-position" = "-1"; + "gc-msgwin-y-position" = "-1"; + gc_nicknames_colors = "#4e9a06:#f57900:#ce5c00:#3465a4:#204a87:#75507b:" + + "#5c3566:#c17d11:#8f5902:#ef2929:#cc0000:#a40000"; + gc_proposed_nick_char = "_"; + gc_refer_to_nick_char = ":"; + global_proxy = ""; + hide_avatar_of_transport = true; + hide_chat_banner = false; + hide_groupchat_banner = false; + hide_groupchat_occupants_list = false; + history_window_height = "1156"; + history_window_width = "1596"; + "history_window_x-position" = "0"; + "history_window_y-position" = "20"; + iconset = "dcraven"; + ignore_incoming_xhtml = false; + inmsgcolor = "#ff7f50"; + inmsgfont = ""; + inmsgtxtcolor = ""; + inmsgtxtfont = ""; + just_connected_bg_color = "#adc3c6"; + just_disconnected_bg_color = "#ab6161"; + key_up_lines = "25"; + last_emoticons_dir = ""; + last_roster_visible = true; + last_save_dir = ""; + last_send_dir = ""; + last_sounds_dir = ""; + latex_png_dpi = "108"; + log_contact_status_changes = true; + log_xhtml_messages = false; + markedmsgcolor = "#ff8080"; + max_conversation_lines = "500"; + mergeaccounts = false; + mood_iconset = "default"; + "msgwin-height" = "1156"; + "msgwin-max-state" = true; + "msgwin-width" = "1336"; + "msgwin-x-position" = "0"; + "msgwin-y-position" = "20"; + muc_autorejoin_on_kick = false; + muc_autorejoin_timeout = "1"; + muc_highlight_words = "DOWN;PROBLEM;CRITICAL;UNREACHABLE"; + muc_restore_lines = "20"; + muc_restore_timeout = "60"; + networkmanager_support = true; + noconfirm_close_muc_rooms = ""; + notification_avatar_height = "48"; + notification_avatar_width = "48"; + notification_position_x = "-1"; + notification_position_y = "-1"; + notification_preview_message = true; + notification_timeout = "5"; + notify_on_all_muc_messages = false; + notify_on_file_complete = true; + notify_on_new_gmail_email = true; + notify_on_new_gmail_email_command = ""; + notify_on_new_gmail_email_extra = false; + notify_on_new_message = false; + notify_on_signin = false; + notify_on_signout = false; + one_message_window = "always_with_roster"; + openwith = "xdg-open"; + outgoing_chat_state_notifications = "composing_only"; + outmsgcolor = "#add8e6"; + outmsgfont = ""; + outmsgtxtcolor = ""; + outmsgtxtfont = ""; + plugins.plugin_installer.active = false; + print_ichat_every_foo_minutes = "5"; + print_status_in_chats = true; + print_status_in_muc = "in_and_out"; + print_time = "always"; + print_time_fuzzy = "0"; + quit_on_roster_x_button = true; + recently_groupchat = ""; + remote_control = true; + restore_lines = "10"; + restore_timeout = "60"; + restored_messages_color = "#555753"; + restored_messages_small = false; + roster_avatar_height = "16"; + roster_avatar_width = "16"; + roster_height = "1156"; + roster_theme = "blue"; + roster_width = "206"; + roster_window_skip_taskbar = false; + "roster_x-position" = "0"; + "roster_y-position" = "20"; + rst_formatting_outgoing_messages = false; + "save-roster-position" = true; + scroll_roster_to_last_message = true; + search_engine = "https://www.google.com/search?&q=%s&sourceid=gajim"; + send_on_ctrl_enter = false; + send_sha_in_gc_presence = true; + shell_like_completion = true; + show_activity_in_roster = true; + show_affiliation_in_groupchat = true; + show_ascii_formatting_chars = true; + show_avatar_in_chat = true; + show_avatars_in_roster = true; + show_contacts_number = true; + show_location_in_roster = true; + show_mood_in_roster = true; + show_only_chat_and_online = false; + show_roster_on_startup = "always"; + show_self_contact = "when_other_resource"; + show_status_msgs_in_roster = true; + show_transports_group = true; + show_tunes_in_roster = true; + show_unread_tab_icon = true; + showoffline = false; + "single-msg-height" = "280"; + "single-msg-width" = "400"; + "single-msg-x-position" = "0"; + "single-msg-y-position" = "0"; + sort_by_show_in_muc = false; + sort_by_show_in_roster = true; + sounddnd = false; + soundplayer = "aplay -q"; + sounds_on = false; + speller_language = "de.en"; + statusmsgcolor = "#4e9a06"; + statusmsgfont = ""; + stun_server = ""; + tabs_always_visible = true; + tabs_border = false; + tabs_close_button = true; + tabs_position = "right"; + time_stamp = "[%H:%M:%S]"; + tooltip_account_name_color = "#888A85"; + tooltip_affiliation_administrator_color = "#F57900"; + tooltip_affiliation_member_color = "#73D216"; + tooltip_affiliation_none_color = "#555753"; + tooltip_affiliation_owner_color = "#CC0000"; + tooltip_avatar_height = "125"; + tooltip_avatar_width = "125"; + tooltip_idle_color = "#888A85"; + tooltip_status_away_color = "#EDD400"; + tooltip_status_busy_color = "#F57900"; + tooltip_status_free_for_chat_color = "#3465A4"; + tooltip_status_na_color = "#CC0000"; + tooltip_status_offline_color = "#555753"; + tooltip_status_online_color = "#73D216"; + trayicon = "never"; + trayicon_notification_on_events = true; + treat_incoming_messages = ""; + uri_schemes = "aaa:// aaas:// acap:// cap:// cid: crid:// data: dav: " + + "dict:// dns: fax: file:/ ftp:// geo: go: gopher:// h323: " + + "http:// https:// iax: icap:// im: imap:// info: ipp:// iris: " + + "iris.beep: iris.xpc: iris.xpcs: iris.lwz: ldap:// mid: " + + "modem: msrp:// msrps:// mtqp:// mupdate:// news: nfs:// " + + "nntp:// opaquelocktoken: pop:// pres: prospero:// rtsp:// " + + "service: shttp:// sip: sips: sms: snmp:// soap.beep:// " + + "soap.beeps:// tag: tel: telnet:// tftp:// thismessage:/ " + + "tip:// tv: urn:// vemmi:// xmlrpc.beep:// xmlrpc.beeps:// " + + "z39.50r:// z39.50s:// about: apt: cvs:// daap:// ed2k:// " + + "feed: fish:// git:// iax2: irc:// ircs:// ldaps:// magnet: " + + "mms:// rsync:// ssh:// svn:// sftp:// smb:// webcal://"; + urlmsgcolor = "#add8e6"; + use_gnomekeyring = true; + use_gpg_agent = true; + use_kib_mib = false; + use_kwalletcli = true; + use_latex = false; + use_notif_daemon = true; + use_smooth_scrolling = true; + use_speller = true; + use_stun_server = false; + use_transports_iconsets = true; + use_urgency_hint = true; + vcard_avatar_height = "200"; + vcard_avatar_width = "200"; + verbose = false; + version = "0.15.4"; + video_framerate = ""; + video_input_device = "v4l2src device=/dev/video0"; + video_output_device = "ximagesink"; + video_size = ""; + + accounts = { + Local = { + action_when_plaintext_connection = "warn"; + active = true; + adjust_priority_with_status = true; + allow_no_log_for = ""; + anonymous_auth = false; + answer_receipts = true; + attached_gpg_keys = ""; + autoauth = false; + autoconnect = true; + autoconnect_as = "online"; + autonegotiate_esessions = true; + autopriority_away = "40"; + autopriority_chat = "50"; + autopriority_dnd = "20"; + autopriority_invisible = "10"; + autopriority_online = "50"; + autopriority_xa = "30"; + autoreconnect = true; + client_cert = ""; + client_cert_encrypted = false; + connection_types = "tls ssl plain"; + custom_host = ""; + custom_port = "5298"; + dont_ack_subscription = false; + enable_esessions = true; + enable_message_carbons = false; + file_transfer_proxies = "proxy.eu.jabber.org, proxy.jabber.ru, " + + "proxy.jabbim.cz"; + ft_send_local_ips = true; + gpg_sign_presence = true; + hostname = "mmrnmhrm"; + http_auth = "ask"; + ignore_ssl_errors = ""; + ignore_unknown_contacts = false; + is_zeroconf = true; + keep_alive_every_foo_secs = "55"; + keep_alives_enabled = true; + keyid = ""; + keyname = ""; + last_archiving_time = "1970-01-01T00:00:00Z"; + last_status = "online"; + last_status_msg = ""; + listen_to_network_manager = true; + log_encrypted_sessions = true; + minimized_gc = ""; + "msgwin-height" = "440"; + "msgwin-width" = "480"; + "msgwin-x-position" = "-1"; + "msgwin-y-position" = "-1"; + name = "aszlig"; + no_log_for = ""; + password = "zeroconf"; + ping_alive_every_foo_secs = "120"; + ping_alives_enabled = true; + priority = "5"; + proxy = ""; + publish_location = false; + publish_tune = false; + request_receipt = true; + resource = "gajim"; + restore_last_status = false; + roster_version = ""; + savepass = false; + send_idle_time = true; + send_os_info = true; + send_time_info = true; + ssl_fingerprint_sha1 = ""; + subscribe_activity = true; + subscribe_location = true; + subscribe_mood = true; + subscribe_nick = true; + subscribe_tune = true; + subscription_request_msg = ""; + sync_with_global_status = true; + test_ft_proxies_on_startup = true; + time_for_ping_alive_answer = "60"; + try_connecting_for_foo_secs = "60"; + use_custom_host = false; + use_env_http_proxy = false; + use_ft_proxies = false; + use_srv = true; + warn_when_insecure_password = true; + warn_when_insecure_ssl_connection = true; + zeroconf_email = ""; + zeroconf_first_name = ""; + zeroconf_jabber_id = ""; + zeroconf_last_name = ""; + }; + + "aszlig.net" = { + action_when_plaintext_connection = "disconnect"; + active = true; + adjust_priority_with_status = true; + allow_no_log_for = ""; + anonymous_auth = false; + answer_receipts = true; + autoauth = false; + autoconnect = false; + autoconnect_as = "online"; + autonegotiate_esessions = true; + autopriority_away = "40"; + autopriority_chat = "50"; + autopriority_dnd = "20"; + autopriority_invisible = "10"; + autopriority_online = "50"; + autopriority_xa = "30"; + autoreconnect = true; + client_cert = ""; + client_cert_encrypted = false; + connection_types = "tls ssl plain"; + custom_host = "aszlig.net"; + custom_port = "5222"; + dont_ack_subscription = false; + enable_esessions = true; + enable_message_carbons = false; + file_transfer_proxies = "proxy.headcounter.org"; + ft_send_local_ips = true; + gpg_sign_presence = true; + hostname = "aszlig.net"; + http_auth = "ask"; + ignore_ssl_errors = ""; + ignore_unknown_contacts = false; + is_zeroconf = false; + keep_alive_every_foo_secs = "55"; + keep_alives_enabled = true; + keyid = "8C2DC961"; + keyname = ''aszlig <"^[0-9]+$"@regexmail.net>''; + last_archiving_time = "1970-01-01T00:00:00Z"; + last_status_msg = ""; + listen_to_network_manager = true; + log_encrypted_sessions = true; + minimized_gc = ""; + "msgwin-height" = "440"; + "msgwin-width" = "480"; + "msgwin-x-position" = "-1"; + "msgwin-y-position" = "-1"; + name = "aszlig"; + no_log_for = ""; + ping_alive_every_foo_secs = "120"; + ping_alives_enabled = true; + priority = "5"; + proxy = ""; + publish_location = false; + publish_tune = false; + request_receipt = true; + resource = "redmoon"; + restore_last_status = false; + savepass = true; + send_idle_time = true; + send_os_info = true; + send_time_info = true; + ssl_fingerprint_sha1 = "8D:BC:E5:46:AB:B3:53:F7:36:B3:" + + "66:0D:B4:B7:83:32:65:BA:A8:EF"; + subscribe_activity = true; + subscribe_location = true; + subscribe_mood = true; + subscribe_nick = true; + subscribe_tune = true; + subscription_request_msg = ""; + sync_with_global_status = true; + test_ft_proxies_on_startup = true; + time_for_ping_alive_answer = "60"; + try_connecting_for_foo_secs = "60"; + use_custom_host = false; + use_env_http_proxy = false; + use_ft_proxies = true; + use_srv = true; + warn_when_insecure_password = true; + warn_when_insecure_ssl_connection = true; + zeroconf_email = ""; + zeroconf_first_name = ""; + zeroconf_jabber_id = ""; + zeroconf_last_name = ""; + }; + }; + + defaultstatusmsg = { + away = { + enabled = false; + message = "Be right back."; + }; + + chat = { + enabled = false; + message = "I'm free for chat."; + }; + + dnd = { + enabled = false; + message = "Do not disturb."; + }; + + invisible = { + enabled = false; + message = "Bye!"; + }; + + offline = { + enabled = false; + message = "Bye!"; + }; + + online = { + enabled = false; + message = "I'm available."; + }; + + xa = { + enabled = false; + message = "I'm not available."; + }; + }; + + statusmsg = let + defaults = { + activity = ""; + activity_text = ""; + message = ""; + mood = ""; + mood_text = ""; + subactivity = ""; + }; + applyDefaults = const (attrs: defaults // attrs); + in mapAttrs applyDefaults { + zone.activity = "working"; + zone.subactivity = "coding"; + zone.message = "In The Zone[TM]"; + + rofa.activity = "working"; + rofa.activity_text = "Blinded by the lights..."; + rofa.subactivity = "other"; + rofa.message = "RoFa"; + + kernel.mood = "happy"; + kernel.message = "Kerneling down for reboot NOW."; + + sleep.activity = "inactive"; + sleep.subactivity = "sleeping"; + sleep.mood = "sleepy"; + sleep.message = "Sleeping the hell out of here..."; + + _last_away = {}; + _last_chat = {}; + _last_dnd = {}; + _last_invisible = {}; + _last_offline = {}; + _last_online = {}; + _last_xa = {}; + }; + + soundevents = { + contact_connected = { + enabled = false; + path = "connected.wav"; + }; + + contact_disconnected = { + enabled = false; + path = "disconnected.wav"; + }; + + first_message_received = { + enabled = true; + path = "message1.wav"; + }; + + gmail_received = { + enabled = false; + path = "message1.wav"; + }; + + message_sent = { + enabled = false; + path = "sent.wav"; + }; + + muc_message_highlight = { + enabled = true; + path = "gc_message1.wav"; + }; + + muc_message_received = { + enabled = false; + path = "gc_message2.wav"; + }; + + next_message_received_focused = { + enabled = false; + path = "message2.wav"; + }; + + next_message_received_unfocused = { + enabled = true; + path = "message2.wav"; + }; + }; + + proxies.Tor = { + bosh_content = "text/xml; charset=utf-8"; + bosh_hold = "2"; + bosh_http_pipelining = false; + bosh_uri = ""; + bosh_useproxy = false; + bosh_wait = "30"; + bosh_wait_for_restart_response = false; + host = "localhost"; + pass = ""; + port = "9050"; + type = "socks5"; + useauth = false; + user = ""; + }; + + themes = { + blue = { + accountbgcolor = "#0c232e"; + accountfont = "Liberation Mono 8"; + accountfontattrs = "B"; + accounttextcolor = "#ffffff"; + bannerbgcolor = "#0f4864"; + bannerfont = "Liberation Mono Bold 12"; + bannerfontattrs = "B"; + bannertextcolor = "#ffffff"; + contactbgcolor = "#0c232b"; + contactfont = "Liberation Mono Bold 8"; + contactfontattrs = ""; + contacttextcolor = "#ffffff"; + groupbgcolor = "#18515f"; + groupfont = "Liberation Mono Bold 8"; + groupfontattrs = "I"; + grouptextcolor = "#ffffff"; + state_composing_color = "green4"; + state_gone_color = "grey"; + state_inactive_color = "grey62"; + state_muc_directed_msg_color = "red2"; + state_muc_msg_color = "mediumblue"; + state_paused_color = "mediumblue"; + }; + + default = { + accountbgcolor = ""; + accountfont = ""; + accountfontattrs = "B"; + accounttextcolor = ""; + bannerbgcolor = ""; + bannerfont = ""; + bannerfontattrs = "B"; + bannertextcolor = ""; + contactbgcolor = ""; + contactfont = ""; + contactfontattrs = ""; + contacttextcolor = ""; + groupbgcolor = ""; + groupfont = ""; + groupfontattrs = "I"; + grouptextcolor = ""; + state_composing_color = "green4"; + state_gone_color = "grey"; + state_inactive_color = "grey62"; + state_muc_directed_msg_color = "red2"; + state_muc_msg_color = "mediumblue"; + state_paused_color = "mediumblue"; + }; + + green = { + accountbgcolor = "#94aa8c"; + accountfont = ""; + accountfontattrs = "B"; + accounttextcolor = ""; + bannerbgcolor = "#94aa8c"; + bannerfont = ""; + bannerfontattrs = "B"; + bannertextcolor = ""; + contactbgcolor = ""; + contactfont = ""; + contactfontattrs = ""; + contacttextcolor = "#000000"; + groupbgcolor = "#eff3e7"; + groupfont = ""; + groupfontattrs = "I"; + grouptextcolor = "#0000ff"; + state_composing_color = "green4"; + state_gone_color = "grey"; + state_inactive_color = "grey62"; + state_muc_directed_msg_color = "red2"; + state_muc_msg_color = "mediumblue"; + state_paused_color = "mediumblue"; + }; + + grocery = { + accountbgcolor = "#6bbe18"; + accountfont = ""; + accountfontattrs = "B"; + accounttextcolor = ""; + bannerbgcolor = "#108abd"; + bannerfont = ""; + bannerfontattrs = "B"; + bannertextcolor = ""; + contactbgcolor = "#efb26b"; + contactfont = ""; + contactfontattrs = ""; + contacttextcolor = "#000000"; + groupbgcolor = "#ceefad"; + groupfont = ""; + groupfontattrs = "I"; + grouptextcolor = "#12125a"; + state_composing_color = "green4"; + state_gone_color = "grey"; + state_inactive_color = "grey62"; + state_muc_directed_msg_color = "red2"; + state_muc_msg_color = "mediumblue"; + state_paused_color = "mediumblue"; + }; + + human = { + accountbgcolor = "#996442"; + accountfont = ""; + accountfontattrs = "B"; + accounttextcolor = ""; + bannerbgcolor = "#996442"; + bannerfont = ""; + bannerfontattrs = "B"; + bannertextcolor = ""; + contactbgcolor = ""; + contactfont = ""; + contactfontattrs = ""; + contacttextcolor = "#000000"; + groupbgcolor = "#e3ca94"; + groupfont = ""; + groupfontattrs = "I"; + grouptextcolor = "#ab5920"; + state_composing_color = "green4"; + state_gone_color = "grey"; + state_inactive_color = "grey62"; + state_muc_directed_msg_color = "red2"; + state_muc_msg_color = "mediumblue"; + state_paused_color = "mediumblue"; + }; + + marine = { + accountbgcolor = "#918caa"; + accountfont = ""; + accountfontattrs = "B"; + accounttextcolor = ""; + bannerbgcolor = "#918caa"; + bannerfont = ""; + bannerfontattrs = "B"; + bannertextcolor = ""; + contactbgcolor = ""; + contactfont = ""; + contactfontattrs = ""; + contacttextcolor = "#000000"; + groupbgcolor = "#e9e7f3"; + groupfont = ""; + groupfontattrs = "I"; + grouptextcolor = ""; + state_composing_color = "green4"; + state_gone_color = "grey"; + state_inactive_color = "grey62"; + state_muc_directed_msg_color = "red2"; + state_muc_msg_color = "mediumblue"; + state_paused_color = "mediumblue"; + }; + }; +} diff --git a/modules/user/aszlig/programs/gajim/config.patch b/modules/user/aszlig/programs/gajim/config.patch new file mode 100644 index 00000000..fcfcc371 --- /dev/null +++ b/modules/user/aszlig/programs/gajim/config.patch @@ -0,0 +1,80 @@ +diff --git a/src/common/optparser.py b/src/common/optparser.py +index f84b18a..0078317 100644 +--- a/src/common/optparser.py ++++ b/src/common/optparser.py +@@ -30,6 +30,7 @@ import os + import sys + import locale + import re ++from itertools import chain + from time import time + from common import gajim + from common import helpers +@@ -46,19 +47,25 @@ class OptionsParser: + + def read(self): + try: +- fd = open(self.__filename) ++ cfg = nixfd = open("@nix_config@", 'r') + except Exception: + if os.path.exists(self.__filename): + #we talk about a file + print _('Error: cannot open %s for reading') % self.__filename + return False + ++ try: ++ fd = open(self.__filename) ++ cfg = chain(cfg, fd) ++ except Exception: ++ fd = None ++ + new_version = gajim.config.get('version') + new_version = new_version.split('-', 1)[0] + seen = set() + regex = re.compile(r"(?P<optname>[^.=]+)(?:(?:\.(?P<key>.+))?\.(?P<subname>[^.=]+))?\s=\s(?P<value>.*)") + +- for line in fd: ++ for line in cfg: + try: + line = line.decode('utf-8') + except UnicodeDecodeError: +@@ -79,10 +86,13 @@ class OptionsParser: + self.update_config(old_version, new_version) + self.old_values = {} # clean mem + +- fd.close() ++ if fd is not None: ++ fd.close() ++ ++ nixfd.close() + return True + +- def write_line(self, fd, opt, parents, value): ++ def write_line(self, (fd, nixcfg), opt, parents, value): + if value is None: + return + value = value[1] +@@ -102,17 +112,21 @@ class OptionsParser: + p = p.encode('utf-8') + s += p + '.' + s += opt +- fd.write(s + ' = ' + value + '\n') ++ line = s + ' = ' + value + '\n' ++ if not nixcfg.startswith(line) and not ('\n' + line) in nixcfg: ++ fd.write(line) + + def write(self): + (base_dir, filename) = os.path.split(self.__filename) + self.__tempfile = os.path.join(base_dir, '.' + filename) ++ + try: ++ nixcfg = open("@nix_config@", 'r').read() + f = open(self.__tempfile, 'w') + except IOError, e: + return str(e) + try: +- gajim.config.foreach(self.write_line, f) ++ gajim.config.foreach(self.write_line, (f, nixcfg)) + except IOError, e: + return str(e) + f.flush() diff --git a/modules/user/aszlig/programs/gajim/default.nix b/modules/user/aszlig/programs/gajim/default.nix new file mode 100644 index 00000000..4c8a4304 --- /dev/null +++ b/modules/user/aszlig/programs/gajim/default.nix @@ -0,0 +1,59 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + cfg = config.vuizvui.user.aszlig.programs.gajim; + + gtkTheme = pkgs.writeText "gajim.gtkrc" '' + style "default" { + fg[NORMAL] = "#d5faff" + fg[ACTIVE] = "#fffeff" + fg[SELECTED] = "#fffeff" + fg[INSENSITIVE] = "#85aaaf" + fg[PRELIGHT] = "#d7f2ff" + + text[NORMAL] = "#fffefe" + text[ACTIVE] = "#fffeff" + text[SELECTED] = "#fffeff" + text[INSENSITIVE] = "#85aaaf" + text[PRELIGHT] = "#d7f2ff" + + bg[NORMAL] = "#0f4866" + bg[ACTIVE] = "#0c232e" + bg[SELECTED] = "#005a56" + bg[INSENSITIVE] = "#103040" + bg[PRELIGHT] = "#1d5875" + + base[NORMAL] = "#0c232e" + base[ACTIVE] = "#0f4864" + base[SELECTED] = "#005a56" + base[INSENSITIVE] = "#103040" + base[PRELIGHT] = "#1d5875" + } + + class "GtkWidget" style "default" + + gtk-enable-animations = 0 + ''; + + gajimPatched = overrideDerivation pkgs.gajim (o: { + patches = (o.patches or []) ++ singleton (pkgs.substituteAll { + src = ./config.patch; + nix_config = pkgs.writeText "gajim.config" (import ./config.nix lib); + }); + postPatch = (o.postPatch or "") + '' + sed -i -e '/^export/i export GTK2_RC_FILES="${gtkTheme}"' \ + scripts/gajim.in + ''; + }); + +in { + options.vuizvui.user.aszlig.programs.gajim = { + enable = mkEnableOption "aszlig's Gajim"; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [ gajimPatched ]; + }; +} diff --git a/modules/user/aszlig/programs/git/default.nix b/modules/user/aszlig/programs/git/default.nix new file mode 100644 index 00000000..0090b617 --- /dev/null +++ b/modules/user/aszlig/programs/git/default.nix @@ -0,0 +1,74 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.vuizvui.user.aszlig.programs.git; + + genConf = attrs: let + escStr = s: "\"${escape [ "\"" "\\" ] s}\""; + mkVal = v: if isBool v && v then "true" + else if isBool v && !v then "false" + else escStr (toString v); + mkLine = key: val: "${key} = ${mkVal val}"; + + filterNull = filterAttrs (_: v: !(isNull v)); + + mkSection = sect: subsect: vals: '' + [${sect}${optionalString (subsect != null) " ${escStr subsect}"}] + ${concatStringsSep "\n" (mapAttrsToList mkLine (filterNull vals))} + ''; + + mkConf = sect: content: let + subs = filterAttrs (_: isAttrs) content; + nonSubs = filterAttrs (_: s: !isAttrs s) content; + hasPlain = (attrNames nonSubs) != []; + plainSects = singleton (mkSection sect null nonSubs); + in mapAttrsToList (mkSection sect) subs ++ optional hasPlain plainSects; + + text = concatStringsSep "\n" (flatten (mapAttrsToList mkConf attrs)); + in pkgs.writeText "gitconfig" text; + + gitPatched = overrideDerivation pkgs.gitFull (git: { + makeFlags = let + oldFlags = git.makeFlags or []; + newVal = "ETC_GITCONFIG=${cfg.config}"; + in if isList oldFlags + then oldFlags ++ [ newVal ] + else "${oldFlags} ${newVal}"; + }); +in { + options.vuizvui.user.aszlig.programs.git = { + enable = mkEnableOption "Git"; + + config = mkOption { + description = "System-wide default config for Git"; + + type = let + superType = types.attrsOf types.unspecified; + in mkOptionType { + name = "attribute set of either plain values or " + + "attribute sets of values (if it is a subsection)"; + inherit (superType) check merge; + inherit (superType) getSubOptions getSubModules substSubModules; + }; + + default = {}; + example = { + color.ui = "auto"; + merge.tool = "vimdiff"; + guitool.foobar.noconsole = true; + }; + + apply = genConf; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [ + gitPatched + pkgs.gitAndTools.git-remote-hg + pkgs.gitAndTools.hub + ]; + }; +} diff --git a/modules/user/aszlig/programs/mpv/default.nix b/modules/user/aszlig/programs/mpv/default.nix new file mode 100644 index 00000000..1e412c71 --- /dev/null +++ b/modules/user/aszlig/programs/mpv/default.nix @@ -0,0 +1,24 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + cfg = config.vuizvui.user.aszlig.programs.mpv; + + patchedMpv = overrideDerivation pkgs.mpv (o: { + installPhase = o.installPhase + '' + cat > "$out/etc/mpv/mpv.conf" <<CONFIG + ao=pulse + CONFIG + ''; + }); + +in { + options.vuizvui.user.aszlig.programs.mpv = { + enable = mkEnableOption "aszlig's MPV"; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [ patchedMpv ]; + }; +} diff --git a/modules/user/aszlig/programs/taalo-build/default.nix b/modules/user/aszlig/programs/taalo-build/default.nix new file mode 100644 index 00000000..6b50df1d --- /dev/null +++ b/modules/user/aszlig/programs/taalo-build/default.nix @@ -0,0 +1,65 @@ +{ config, pkgs, lib, ... }: + +with lib; + +{ + options.vuizvui.user.aszlig.programs.taalo-build = { + enable = mkEnableOption "aszlig's build helper for remote builds"; + }; + config = mkIf config.vuizvui.user.aszlig.programs.taalo-build.enable { + environment.systemPackages = singleton (pkgs.writeScriptBin "taalo-build" '' + #!${pkgs.perl}/bin/perl -I${pkgs.nix}/lib/perl5/site_perl + use strict; + use Nix::CopyClosure; + use Nix::SSH; + use IPC::Open2; + + binmode STDERR, ":encoding(utf8)"; + + open my $instantiate, "-|", "nix-instantiate", @ARGV + or die "Failed to run nix-instantiate"; + my $to_realize = join "", <$instantiate>; + close $instantiate or exit $? >> 8; + + chomp $to_realize; + + my ($from, $to); + my $dest = 'nix-remote-build@taalo.headcounter.org'; + my $cmd = "exec ssh $dest -C -- nix-store --serve --write"; + my $pid = open2($from, $to, $cmd); + + # Do the handshake. + my $magic; + eval { + my $SERVE_MAGIC_1 = 0x390c9deb; # FIXME + my $clientVersion = 0x200; + syswrite($to, pack("L<x4L<x4", $SERVE_MAGIC_1, $clientVersion)) + or die; + $magic = readInt($from); + }; + + die "unable to connect to taalo\n" if $@; + die "did not get valid handshake from taalo\n" if $magic != 0x5452eecb; + + my $serverVersion = readInt($from); + die "unsupported server version\n" + if $serverVersion < 0x200 || $serverVersion >= 0x300; + + Nix::CopyClosure::copyToOpen( + $from, $to, "taalo", [$to_realize], 0, 0, 0, 1 + ); + + writeInt(6, $to) or die; + writeStrings([$to_realize], $to); + writeInt(0, $to); + writeInt(0, $to); + + my $res = readInt($from); + + close $to; + + waitpid($pid, 0); + exit $res; + ''); + }; +} diff --git a/modules/user/aszlig/programs/taskwarrior/config.patch b/modules/user/aszlig/programs/taskwarrior/config.patch new file mode 100644 index 00000000..4ee4c4ce --- /dev/null +++ b/modules/user/aszlig/programs/taskwarrior/config.patch @@ -0,0 +1,48 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5558f6b..c8956f8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -91,6 +91,9 @@ SET (TASK_DOCDIR share/doc/task CACHE STRING "Installation directory for doc fi + SET (TASK_RCDIR "${TASK_DOCDIR}/rc" CACHE STRING "Installation directory for configuration files") + SET (TASK_BINDIR bin CACHE STRING "Installation directory for the binary") + ++SET (SYSTEM_TASKRC "${CMAKE_INSTALL_PREFIX}/etc/taskrc" ++ CACHE STRING "System-wide taskrc") ++ + message ("-- Looking for SHA1 references") + if (EXISTS ${CMAKE_SOURCE_DIR}/.git/index) + set (HAVE_COMMIT true) +diff --git a/cmake.h.in b/cmake.h.in +index 0041e6e..f8c1a0e 100644 +--- a/cmake.h.in ++++ b/cmake.h.in +@@ -16,6 +16,7 @@ + + /* Installation details */ + #define TASK_RCDIR "${CMAKE_INSTALL_PREFIX}/${TASK_RCDIR}" ++#define SYSTEM_TASKRC "${SYSTEM_TASKRC}" + + /* Localization */ + #define PACKAGE_LANGUAGE ${PACKAGE_LANGUAGE} +diff --git a/src/Context.cpp b/src/Context.cpp +index 8aae74e..ffa5557 100644 +--- a/src/Context.cpp ++++ b/src/Context.cpp +@@ -121,7 +121,8 @@ int Context::initialize (int argc, const char** argv) + } + + config.clear (); +- config.load (rc_file); ++ config.load (SYSTEM_TASKRC); ++ config.load (rc_file, 2); + CLI2::applyOverrides (argc, argv); + + //////////////////////////////////////////////////////////////////////////// +@@ -146,7 +147,6 @@ int Context::initialize (int argc, const char** argv) + } + + tdb2.set_location (data_dir); +- createDefaultConfig (); + + //////////////////////////////////////////////////////////////////////////// + // diff --git a/modules/user/aszlig/programs/taskwarrior/default.nix b/modules/user/aszlig/programs/taskwarrior/default.nix new file mode 100644 index 00000000..99d428de --- /dev/null +++ b/modules/user/aszlig/programs/taskwarrior/default.nix @@ -0,0 +1,36 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.vuizvui.user.aszlig.programs.taskwarrior; + + taskrc = pkgs.writeText "taskrc.in" '' + data.location=~/.task + include @out@/share/doc/task/rc/dark-yellow-green.theme + + color=on + dateformat=Y-m-d + dateformat.annotation=Y-m-d + dateformat.edit=Y-m-d H:N:S + dateformat.holiday=YMD + dateformat.info=Y-m-d H:N:S + dateformat.report=Y-m-d + weekstart=Monday + ''; + + taskwarrior = pkgs.taskwarrior.overrideDerivation (t: { + patches = (t.patches or []) ++ [ ./config.patch ]; + postInstall = (t.postInstall or "") + '' + mkdir -p "$out/etc" + substituteAll "${taskrc}" "$out/etc/taskrc" + ''; + }); + +in { + options.vuizvui.user.aszlig.programs.taskwarrior = { + enable = lib.mkEnableOption "aszlig's TaskWarrior"; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = lib.singleton taskwarrior; + }; +} diff --git a/modules/user/aszlig/programs/vim/default.nix b/modules/user/aszlig/programs/vim/default.nix new file mode 100644 index 00000000..cb6149fe --- /dev/null +++ b/modules/user/aszlig/programs/vim/default.nix @@ -0,0 +1,384 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.vuizvui.user.aszlig.programs.vim; + + fetchVimScript = { srcId, sha256, type, name }: let + baseUrl = "http://www.vim.org/scripts/download_script.php"; + src = pkgs.fetchurl { + name = "script${toString srcId}.vim"; + url = "${baseUrl}?src_id=${toString srcId}"; + inherit sha256; + }; + in pkgs.stdenv.mkDerivation { + name = "vim-${type}-${toString srcId}"; + buildCommand = '' + install -vD -m 0644 "${src}" "$out/${type}/${name}.vim" + ''; + }; + + extractSubdir = subdir: src: pkgs.stdenv.mkDerivation { + name = "${src.name}-subdir"; + phases = [ "unpackPhase" "installPhase" ]; + inherit src; + installPhase = '' + cp -Rd "${subdir}" "$out" + ''; + }; + + mkVimPlugins = plugins: pkgs.buildEnv { + name = "vim-plugins"; + paths = with lib; mapAttrsToList (const id) plugins; + ignoreCollisions = true; + postBuild = '' + find -L "$out" -mindepth 1 -maxdepth 1 -type f -delete + ''; + }; + + pluginDeps = { + vimAddonMwUtils = pkgs.fetchFromGitHub { + owner = "MarcWeber"; + repo = "vim-addon-mw-utils"; + rev = "0c5612fa31ee434ba055e21c76f456244b3b5109"; + sha256 = "147s1k4n45d3x281vj35l26sv4waxjlpqdn83z3k9n51556h1d45"; + }; + + vimAddonCompletion = pkgs.fetchFromGitHub { + owner = "MarcWeber"; + repo = "vim-addon-completion"; + rev = "80f717d68df5b0d7b32228229ddfd29c3e86e435"; + sha256 = "08acffzy847w8b5j8pdw6qsidm2859ki5q351n4r7fkr969p80mi"; + }; + + vimAddonActions = pkgs.fetchFromGitHub { + owner = "MarcWeber"; + repo = "vim-addon-actions"; + rev = "a5d20500fb8812958540cf17862bd73e7af64936"; + sha256 = "1wfkwr89sn2w97i94d0dqylcg9mr6pirjadi0a4l492nfnsh99bc"; + }; + + vimAddonBackgroundCmd = pkgs.fetchFromGitHub { + owner = "MarcWeber"; + repo = "vim-addon-background-cmd"; + rev = "14df72660a95804a57c02b9ff0ae3198608e2491"; + sha256 = "09lh6hqbx05gm7njhpqvhqdwig3pianq9rddxmjsr6b1vylgdgg4"; + }; + + vimAddonErrorFormats = pkgs.fetchFromGitHub { + owner = "MarcWeber"; + repo = "vim-addon-errorformats"; + rev = "dcbb203ad5f56e47e75fdee35bc92e2ba69e1d28"; + sha256 = "159zqm69fxbxcv3b2y99g57bf20qrzsijcvb5rzy2njxah3049m1"; + }; + + vimAddonToggleBuffer = pkgs.fetchFromGitHub { + owner = "MarcWeber"; + repo = "vim-addon-toggle-buffer"; + rev = "a1b38b9c5709cba666ed2d84ef06548f675c6b0b"; + sha256 = "1xq38kfdm36c34ln66znw841q797w5gm8bpq1x64bsf2h6n3ml03"; + }; + + vimAddonGotoThingAtCursor = pkgs.fetchFromGitHub { + owner = "MarcWeber"; + repo = "vim-addon-goto-thing-at-cursor"; + rev = "f052e094bdb351829bf72ae3435af9042e09a6e4"; + sha256 = "1ksm2b0j80zn8sz2y227bpcx4jsv76lwgr2gpgy2drlyqhn2vlv0"; + }; + + vimAddonViews = pkgs.fetchFromGitHub { + owner = "MarcWeber"; + repo = "vim-addon-views"; + rev = "d1383ad56d0a07d7350880adbadf9de501729fa8"; + sha256 = "09gqh7w5rk4lmra706schqaj8dnisf396lpsipm7xv6gy1qbslnv"; + }; + + vimAddonSwfMill = pkgs.fetchFromGitHub { + owner = "MarcWeber"; + repo = "vim-addon-swfmill"; + rev = "726777e02cbe3ad8f82e37421fb37674f446a148"; + sha256 = "0ablzl5clgfzhzwvzzbaj0cda0b4cyrj3pbv02f26hx7rfnssaqm"; + }; + + vimHaxeSyntax = pkgs.fetchFromGitHub { + owner = "MarcWeber"; + repo = "vim-haxe-syntax"; + rev = "500acc2f2ab92d77ff6cd04fdc7868800c033dfa"; + sha256 = "1ipm0igplplfmscm3bk95qpf9rw71h133l9shmw54mxr4h0ymnmj"; + }; + + tlib = pkgs.fetchFromGitHub { + owner = "tomtom"; + repo = "tlib_vim"; + rev = "bc4097bd38c4bc040fe1e74df68dec6c9adfcb6a"; + sha256 = "19v7bgmkk4k2g1z62bd0kky29xxfq96l7wfrl27wb2zijlhbrnpz"; + }; + + vamStub = pkgs.writeTextFile { + name = "vam-stub"; + destination = "/autoload/vam.vim"; + text = '' + fun! vam#DefineAndBind(local, global, default) + return ' if !exists('.string(a:global).') | + \ let '.a:global.' = '.a:default.' | + \ endif | let '.a:local.' = '.a:global + endfun + ''; + }; + }; + + plugins = mkVimPlugins (pluginDeps // { + vimErl = pkgs.fetchFromGitHub { + owner = "jimenezrick"; + repo = "vimerl"; + rev = "823bf8cb515bb10396c705cdc017aa9121cc4d12"; + sha256 = "0sybkx8iy8qhr6nlwn52j7zd5v99rn0b8wbg43d112z2px4yq5x3"; + }; + + vimHaxe = pkgs.fetchFromGitHub { + owner = "MarcWeber"; + repo = "vim-haxe"; + rev = "8efc705db41a01713d67d437f29866a1ff831e8a"; + sha256 = "15kv13gvpgf23p0566qrlw7gmpir2z7g5dnkfs1knmcwzw45am5d"; + }; + + factor = extractSubdir "misc/vim" (pkgs.fetchFromGitHub { + owner = "slavapestov"; + repo = "factor"; + rev = "0d6f70cc7cf35cc627ee78886e2932091a651fe6"; + sha256 = "0lmqzvrmwgmxpcpwgn59y033sf4jybmw3lffbjwww5d7ch90333q"; + }); + + opaLang = extractSubdir "tools/editors/vim" (pkgs.fetchFromGitHub { + owner = "MLstate"; + repo = "opalang"; + rev = "94e4e6d9d8da9a72214f4f28dd1ffa1a987997eb"; + sha256 = "0d6b67868cfqakkz63y5ynpz549lbpfzc3c3x7kx3ffsv10xy3bb"; + }); + + lslvim = pkgs.fetchFromGitHub { + owner = "sukima"; + repo = "LSLvim"; + rev = "f269de39a1c713a43470e90d0ec78208c0f05e0b"; + sha256 = "1plwx5id3jsj4y6yhshlf3rishxhf1b9k47g2cpzaczvqb5bl40w"; + }; + + vimSyntaxShakespeare = pkgs.fetchFromGitHub { + owner = "pbrisbin"; + repo = "vim-syntax-shakespeare"; + rev = "29085ae94ee3dbd7f39f2a7705d86692ef5bc365"; + sha256 = "0kvys81jiwqzwmpbk1lvbciw28yha4shd1xby5saiy4b68l6d8rk"; + }; + + glsl = fetchVimScript { + name = "glsl"; + srcId = 3194; + sha256 = "1vqfcpjmfyjc95wns3i84kgd1k5r2lwjjvjcprygi9g9vng7i5xc"; + type = "syntax"; + }; + + actionScript = fetchVimScript { + name = "actionscript"; + srcId = 1205; + sha256 = "0pdzqg678lhn7lmqf3z9icpj6ff2nnghsxy983kxkn8sblnzlhfs"; + type = "syntax"; + }; + + indentPython = fetchVimScript { + name = "python"; + srcId = 4316; + sha256 = "1pgdiaqd1hm0qpspy1asj7i103pq0846lnjrxvl6pk17ymww9pmk"; + type = "indent"; + }; + + nixAddon = pkgs.stdenv.mkDerivation { + name = "vim-nix-support"; + + lnl7 = pkgs.fetchFromGitHub { + owner = "LnL7"; + repo = "vim-nix"; + rev = "f0b7bd4bce5ed0f12fb4d26115c84fb3edcd1e12"; + sha256 = "0x12a191xafn7918xa8r4sjiw79005lcr0yv5kjc4p1izwddfgdv"; + }; + + src = pkgs.fetchFromGitHub { + owner = "MarcWeber"; + repo = "vim-addon-nix"; + rev = "2aed79ba5d8c5e6abd102de77e55e242f61b17f1"; + sha256 = "0zx1q9994py6jmm0qbbx6fc1dy5la8zfskkbvqqxssxrl5dx7vvi"; + }; + + phases = [ "unpackPhase" "patchPhase" "installPhase" ]; + patchPhase = '' + for what in indent syntax; do + install -vD -m 0644 "$lnl7/$what/nix.vim" "$what/nix.vim" + done + sed -i -re '/^ *au(group)? /,/^ *au(group)? +end/ { + s/^ *au(tocmd)? +((BufRead|BufNewFile),?)+ +[^ ]+ +setl(ocal)?/${ + "& sw=2 sts=2 et iskeyword+=-" + }/ + }' plugin/vim-addon-nix.vim + grep '^setlocal' "$lnl7/ftplugin/nix.vim" >> ftplugin/nix.vim + ''; + + installPhase = '' + cp -Rd . "$out" + ''; + }; + + urwebAddon = pkgs.fetchFromGitHub { + owner = "MarcWeber"; + repo = "vim-addon-urweb"; + rev = "49ea3960a9924a5dd7ff70956d1a7c0479a55773"; + sha256 = "090ww8nxqsabrwf4r8g7a93kawnp6zwpsx65yxpacwwwlbc73m7s"; + }; + + indentHaskell = fetchVimScript { + name = "haskell"; + srcId = 7407; + sha256 = "1lj44jkyihmcnj2kcfckhqzr9gfipda9frbzicix2wrc5728kjsv"; + type = "indent"; + }; + + fishSyntax = fetchVimScript { + name = "fish"; + srcId = 20242; + sha256 = "12gfmyxxf84f19bp8xfmkb9phbfkifn89sjgi8hnv6dn0a5y1zpj"; + type = "syntax"; + }; + + elmVim = pkgs.fetchFromGitHub { + owner = "lambdatoast"; + repo = "elm.vim"; + rev = "ad556c97e26072b065825852ceead0fe6a1f7d7c"; + sha256 = "19k6b6m5ngm5qn2f3p13hzjyvha53fpdgq691z8n0lwfn8831b21"; + }; + + flake8 = pkgs.fetchFromGitHub { + owner = "nvie"; + repo = "vim-flake8"; + rev = "293613dbe731a2875ce93739e7b64ee504d8bbab"; + sha256 = "0xmqmbh66g44vhx9769mzs820k6ksbpfnsfvivmbhzlps2hjqpqg"; + }; + + vader = pkgs.fetchFromGitHub { + owner = "junegunn"; + repo = "vader.vim"; + rev = "ad2c752435baba9e7544d0046f0277c3573439bd"; + sha256 = "0yvnah4lxk5w5qidc3y5nvl6lpi8rcv26907b3w7vjskqc935b8f"; + }; + }); + + generic = '' + syntax on + colorscheme elflord + + " boolean + set nocompatible + set showcmd + set showmatch + set ignorecase + set smartcase + set incsearch + set modeline + set smarttab + set expandtab + set smartindent + set ruler + + " non-boolean + set tabstop=4 + set softtabstop=4 + set shiftwidth=4 + set textwidth=80 + set termencoding=ascii + set backspace=indent,eol,start + set background=dark + ''; + + plugin = '' + " erlang + let erlang_folding = 0 + let erlang_highlight_bif = 1 + let erlang_force_use_vimerl_indent = 1 + + " python + let python_highlight_numbers = 1 + let python_highlight_builtins = 1 + let python_highlight_exceptions = 1 + let g:flake8_cmd = '${pkgs.pythonPackages.flake8}/bin/flake8' + + " all plugins + set runtimepath^=${plugins} + set runtimepath+=${plugins}/after + runtime! ftdetect/*.vim + ''; + + autocmd = '' + " jump to last position + au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | + \ exe "normal! g'\"zz" | endif + + " filetype defaults + filetype plugin indent on + au BufNewFile,BufRead *.as set filetype=actionscript + au BufNewFile,BufRead *.html set tabstop=4|set shiftwidth=4|set expandtab + au FileType python set textwidth=79 + au FileType gitcommit set textwidth=72 + au FileType docbk set tabstop=2 shiftwidth=2 expandtab + + " highlight unnecessary whitespace + highlight ExtraWhitespace ctermbg=red guibg=red + match ExtraWhitespace /\s\+$/ + au BufWinEnter,InsertLeave * match ExtraWhitespace /\s\+$/ + au InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/ + " prevent colorscheme from overriding these highlights + au ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red + + " highlight everything exceeding 80 characters + au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1) + ''; + + misc = '' + " ASCII art mode + fun! AAMode() + highlight clear ExtraWhitespace + for m in getmatches() + if m.group == 'ErrorMsg' && m.pattern == '\%>80v.\+' + call matchdelete(m.id) + endif + endfor + endfun + + command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis + \ | wincmd p | diffthis + + " flake everything that has been *detected* as python (not just by suffix). + autocmd BufWritePost * if &ft ==# 'python' | call Flake8() | endif + ''; + + vimrc = pkgs.writeText "vimrc" '' + ${generic} + ${plugin} + + if has("autocmd") + ${autocmd} + endif + + ${misc} + ''; + + patchedVim = lib.overrideDerivation pkgs.vim_configurable (o: { + postInstall = (o.postInstall or "") + '' + ln -sf "${vimrc}" "$out/share/vim/vimrc" + ''; + }); + +in { + options.vuizvui.user.aszlig.programs.vim = { + enable = lib.mkEnableOption "aszlig's Vim"; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = lib.singleton patchedVim; + }; +} diff --git a/modules/user/aszlig/programs/xpdf/default.nix b/modules/user/aszlig/programs/xpdf/default.nix new file mode 100644 index 00000000..e7edd806 --- /dev/null +++ b/modules/user/aszlig/programs/xpdf/default.nix @@ -0,0 +1,20 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.vuizvui.user.aszlig.programs.xpdf; + + xpdf = pkgs.xpdf.overrideDerivation (drv: { + postInstall = (drv.postInstall or "") + '' + echo 'bind ctrl-o any toggleOutline' >> "$out/etc/xpdfrc" + ''; + }); + +in { + options.vuizvui.user.aszlig.programs.xpdf = { + enable = lib.mkEnableOption "aszlig's xpdf"; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = lib.singleton xpdf; + }; +} diff --git a/modules/user/aszlig/programs/zsh/default.nix b/modules/user/aszlig/programs/zsh/default.nix new file mode 100644 index 00000000..119b6aa9 --- /dev/null +++ b/modules/user/aszlig/programs/zsh/default.nix @@ -0,0 +1,117 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.vuizvui.user.aszlig.programs.zsh; + +in { + options.vuizvui.user.aszlig.programs.zsh = { + enable = mkEnableOption "zsh"; + }; + + config = mkIf cfg.enable { + environment.shellInit = '' + export EDITOR="vim" + export EMAIL="aszlig@redmoonstudios.org" + ''; + + nixpkgs.config.packageOverrides = pkgs: { + zsh = overrideDerivation pkgs.zsh (o: { + postConfigure = (o.postConfigure or "") + '' + sed -i -e '/^name=zsh\/newuser/d' config.modules + ''; + }); + }; + + programs.zsh.enable = true; + + programs.zsh.shellAliases.t = "task"; + + programs.zsh.interactiveShellInit = mkAfter '' + export HISTFILE=~/.histfile + export HISTSIZE=100000 + export SAVEHIST=100000 + + unsetopt SHARE_HISTORY + + setopt extendedglob + setopt extendedhistory + setopt globcomplete + setopt histnostore + setopt histreduceblanks + setopt correct + setopt dvorak + setopt interactivecomments + setopt autopushd + setopt autocd + setopt beep + + bindkey -v + if [[ "$TERM" = xterm ]]; then + bindkey -v '\e[H' vi-beginning-of-line + bindkey -v '\e[F' vi-end-of-line + + function set-title() { + echo -en "\e]2;$2\a" + } + + function reset-title() { + echo -en "\e]2;''${(%):-%~}\a\a" + } + + autoload -Uz add-zsh-hook + add-zsh-hook preexec set-title + add-zsh-hook precmd reset-title + else + bindkey -v '\e[1~' vi-beginning-of-line + bindkey -v '\e[4~' vi-end-of-line + fi + + bindkey -a '/' history-incremental-pattern-search-backward + bindkey -a '?' history-incremental-pattern-search-forward + bindkey '\e[A' up-line-or-history + bindkey '\e[B' down-line-or-history + + zstyle ':completion:*' completer _expand _complete _ignored _approximate + zstyle ':completion:*' expand prefix suffix + zstyle ':completion:*' group-name ''' + zstyle ':completion:*' insert-unambiguous true + zstyle ':completion:*' list-colors ''' + zstyle ':completion:*' list-prompt \ + %SAt %p: Hit TAB for more, or the character to insert%s + zstyle ':completion:*' list-suffixes true + zstyle ':completion:*' matcher-list ''' \ + 'm:{[:lower:]}={[:upper:]}' \ + 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' \ + 'l:|=* r:|=*' \ + 'r:|[._-]=** r:|=**' + zstyle ':completion:*' max-errors 2 numeric + zstyle ':completion:*' menu select=long + zstyle ':completion:*' original true + zstyle ':completion:*' preserve-prefix '//[^/]##/' + zstyle ':completion:*' prompt \ + 'Hm, did you mistype something? There are %e errors in the completion.' + zstyle ':completion:*' select-prompt \ + %SScrolling active: current selection at %p%s + zstyle ':completion:*' use-compctl false + zstyle ':completion:*' verbose true + + autoload -Uz compinit + compinit + + autoload -Uz zmv + ''; + + programs.zsh.promptInit = '' + autoload -Uz prompt_special_chars + + () { + local p_machine='%(!..%B%F{red}%n%b%F{blue}@)%b%F{red}%m' + local p_path='%B%F{blue}[%F{cyan}%~%B%F{blue}]' + local p_exitcode='%F{green}%?%(!.%F{cyan}>.%b%F{green}>)%b%f ' + PROMPT="$p_machine$p_path$p_exitcode" + } + ''; + }; +} |