2022-06-09 21:50:24 +00:00
# docs:
# https://rycee.gitlab.io/home-manager/
# https://rycee.gitlab.io/home-manager/options.html
# man home-configuration.nix
#
2022-07-06 21:36:14 +00:00
{ lib , config , pkgs , . . . }:
2022-06-09 21:50:24 +00:00
with lib ;
let
2022-08-01 07:23:49 +00:00
cfg = config . sane . home-manager ;
2022-07-31 19:00:06 +00:00
vim-swap-dir = " . c a c h e / v i m - s w a p " ;
2022-08-03 08:51:15 +00:00
# extract package from `extraPackages`
pkglist = pkgspec : builtins . map ( e : e . pkg or e ) pkgspec ;
# extract `dir` from `extraPackages`
dirlist = pkgspec : builtins . concatLists ( builtins . map ( e : if e ? " d i r " then [ e . dir ] else [ ] ) pkgspec ) ;
2022-09-27 00:48:55 +00:00
# extract `persist-files` from `extraPackages`
persistfileslist = pkgspec : builtins . concatLists ( builtins . map ( e : if e ? " p e r s i s t - f i l e s " then e . persist-files else [ ] ) pkgspec ) ;
# TODO: dirlist and persistfileslist should be folded
2022-06-09 21:50:24 +00:00
in
2022-05-22 08:27:02 +00:00
{
2022-06-09 21:50:24 +00:00
options = {
2022-08-01 07:23:49 +00:00
sane . home-manager . enable = mkOption {
2022-06-23 07:24:39 +00:00
default = false ;
type = types . bool ;
} ;
2022-08-03 09:03:17 +00:00
# packages to deploy to the user's home
2022-08-01 07:23:49 +00:00
sane . home-manager . extraPackages = mkOption {
2022-06-09 21:50:24 +00:00
default = [ ] ;
2022-08-03 08:51:15 +00:00
# each entry can be either a package, or attrs:
2022-08-03 09:03:17 +00:00
# { pkg = package; dir = optional string;
2022-08-03 08:51:15 +00:00
type = types . listOf ( types . either types . package types . attrs ) ;
2022-06-09 21:50:24 +00:00
} ;
2022-08-03 09:03:17 +00:00
2022-08-03 08:23:23 +00:00
# attributes to copy directly to home-manager's `wayland.windowManager` option
2022-08-01 07:23:49 +00:00
sane . home-manager . windowManager = mkOption {
2022-06-09 22:01:38 +00:00
default = { } ;
type = types . attrs ;
} ;
2022-08-03 09:03:17 +00:00
2022-08-03 08:23:23 +00:00
# extra attributes to include in home-manager's `programs` option
2022-08-01 07:23:49 +00:00
sane . home-manager . programs = mkOption {
2022-06-09 22:05:58 +00:00
default = { } ;
type = types . attrs ;
} ;
2022-06-09 21:50:24 +00:00
} ;
2022-06-23 07:24:39 +00:00
config = lib . mkIf cfg . enable {
2022-06-21 06:55:43 +00:00
sops . secrets . " a e r c _ a c c o u n t s " = {
owner = config . users . users . colin . name ;
2022-07-06 21:23:49 +00:00
sopsFile = ../../../secrets/universal/aerc_accounts.conf ;
2022-06-21 06:55:43 +00:00
format = " b i n a r y " ;
} ;
2022-08-10 06:10:21 +00:00
sops . secrets . " s u b l i m e _ m u s i c _ c o n f i g " = {
owner = config . users . users . colin . name ;
sopsFile = ../../../secrets/universal/sublime_music_config.json.bin ;
format = " b i n a r y " ;
} ;
2022-06-10 01:53:19 +00:00
2022-08-01 07:23:49 +00:00
sane . impermanence . home-dirs = [
2022-07-10 22:25:04 +00:00
" a r c h i v e "
" d e v "
" r e c o r d s "
" r e f "
" t m p "
" u s e "
" M u s i c "
" P i c t u r e s "
" V i d e o s "
2022-07-31 19:00:06 +00:00
vim-swap-dir
2022-08-03 08:51:15 +00:00
] ++ ( dirlist cfg . extraPackages ) ;
2022-09-27 00:48:55 +00:00
sane . impermanence . home-files = persistfileslist cfg . extraPackages ;
2022-07-10 22:25:04 +00:00
2022-06-09 21:50:24 +00:00
home-manager . useGlobalPkgs = true ;
home-manager . useUserPackages = true ;
2022-06-21 06:55:43 +00:00
# XXX this weird rename + closure is to get home-manager's `config.lib.file` to exist.
# see: https://github.com/nix-community/home-manager/issues/589#issuecomment-950474105
home-manager . users . colin = let sysconfig = config ; in { config , . . . }: {
2022-08-03 08:51:15 +00:00
home . packages = pkglist cfg . extraPackages ;
wayland . windowManager = cfg . windowManager ;
2022-06-09 21:50:24 +00:00
home . stateVersion = " 2 1 . 1 1 " ;
home . username = " c o l i n " ;
home . homeDirectory = " / h o m e / c o l i n " ;
# XDG defines things like ~/Desktop, ~/Downloads, etc.
# these clutter the home, so i mostly don't use them.
xdg . userDirs = {
enable = true ;
createDirectories = false ; # on headless systems, most xdg dirs are noise
desktop = " $ H O M E / . x d g / D e s k t o p " ;
2022-06-18 00:52:31 +00:00
documents = " $ H O M E / d e v " ;
2022-06-09 21:50:24 +00:00
download = " $ H O M E / t m p " ;
music = " $ H O M E / M u s i c " ;
pictures = " $ H O M E / P i c t u r e s " ;
publicShare = " $ H O M E / . x d g / P u b l i c " ;
templates = " $ H O M E / . x d g / T e m p l a t e s " ;
videos = " $ H O M E / V i d e o s " ;
} ;
2022-09-26 09:21:09 +00:00
# the xdg mime type for a file can be found with:
# - `xdg-mime query filetype path/to/thing.ext`
2022-07-01 11:36:32 +00:00
xdg . mimeApps . enable = true ;
xdg . mimeApps . defaultApplications = {
2022-09-26 09:21:09 +00:00
# HTML
2022-07-01 11:36:32 +00:00
" t e x t / h t m l " = [ " l i b r e w o l f . d e s k t o p " ] ;
" x - s c h e m e - h a n d l e r / h t t p " = [ " l i b r e w o l f . d e s k t o p " ] ;
" x - s c h e m e - h a n d l e r / h t t p s " = [ " l i b r e w o l f . d e s k t o p " ] ;
" x - s c h e m e - h a n d l e r / a b o u t " = [ " l i b r e w o l f . d e s k t o p " ] ;
" x - s c h e m e - h a n d l e r / u n k n o w n " = [ " l i b r e w o l f . d e s k t o p " ] ;
2022-09-27 00:02:14 +00:00
# RICH-TEXT DOCUMENTS
" a p p l i c a t i o n / p d f " = [ " o r g . g n o m e . E v i n c e . d e s k t o p " ] ;
" t e x t / m a r k d o w n " = [ " o b s i d i a n . d e s k t o p " ] ;
2022-09-26 09:21:09 +00:00
# IMAGES
" i m a g e / h e i f " = [ " o r g . g n o m e . g T h u m b . d e s k t o p " ] ; # apple codec
2022-08-01 01:09:01 +00:00
" i m a g e / p n g " = [ " o r g . g n o m e . g T h u m b . d e s k t o p " ] ;
2022-09-26 09:21:09 +00:00
" i m a g e / j p e g " = [ " o r g . g n o m e . g T h u m b . d e s k t o p " ] ;
# VIDEO
" v i d e o / m p 4 " = [ " v l c . d e s k t o p " ] ;
" v i d e o / q u i c k t i m e " = [ " v l c . d e s k t o p " ] ;
" v i d e o / x - m a t r o s k a " = [ " v l c . d e s k t o p " ] ;
# AUDIO
" a u d i o / f l a g " = [ " v l c . d e s k t o p " ] ;
" a u d i o / m p e g " = [ " v l c . d e s k t o p " ] ;
" a u d i o / x - v o r b i s + o g g " = [ " v l c . d e s k t o p " ] ;
2022-07-01 11:36:32 +00:00
} ;
2022-06-09 21:50:24 +00:00
2022-06-21 08:59:31 +00:00
# convenience
home . file . " k n o w l e d g e " . source = config . lib . file . mkOutOfStoreSymlink " / h o m e / c o l i n / d e v / k n o w l e d g e " ;
2022-06-21 09:23:19 +00:00
home . file . " n i x o s " . source = config . lib . file . mkOutOfStoreSymlink " / h o m e / c o l i n / d e v / n i x o s " ;
2022-06-21 08:59:31 +00:00
2022-08-01 01:09:01 +00:00
# nb markdown/personal knowledge manager
home . file . " . n b / k n o w l e d g e " . source = config . lib . file . mkOutOfStoreSymlink " / h o m e / c o l i n / d e v / k n o w l e d g e " ;
home . file . " . n b / . c u r r e n t " . text = " k n o w l e d g e " ;
home . file . " . n b r c " . text = ''
# manage with `nb settings`
export NB_AUTO_SYNC = 0
'' ;
2022-09-16 01:49:16 +00:00
# uBlock filter list configuration.
# specifically, enable the GDPR cookie prompt blocker.
# data.toOverwrite.filterLists is additive (i.e. it supplements the default filters)
# this configuration method is documented here:
# - <https://github.com/gorhill/uBlock/issues/2986#issuecomment-364035002>
# the specific attribute path is found via scraping ublock code here:
# - <https://github.com/gorhill/uBlock/blob/master/src/js/storage.js>
# - <https://github.com/gorhill/uBlock/blob/master/assets/assets.json>
home . file . " . l i b r e w o l f / m a n a g e d - s t o r a g e / u B l o c k 0 @ r a y m o n d h i l l . n e t . j s o n " . text = ''
{
" n a m e " : " u B l o c k 0 @ r a y m o n d h i l l . n e t " ,
" d e s c r i p t i o n " : " i g n o r e d " ,
" t y p e " : " s t o r a g e " ,
" d a t a " : {
" t o O v e r w r i t e " : " { \" f i l t e r L i s t s \" : [ \" f a n b o y - c o o k i e m o n s t e r \" ] } "
}
}
'' ;
2022-08-01 01:09:01 +00:00
# aerc TUI mail client
2022-06-21 06:55:43 +00:00
xdg . configFile . " a e r c / a c c o u n t s . c o n f " . source =
config . lib . file . mkOutOfStoreSymlink sysconfig . sops . secrets . aerc_accounts . path ;
2022-09-20 11:39:28 +00:00
# make Discord usable even when client is "outdated"
xdg . configFile . " d i s c o r d / s e t t i n g s . j s o n " . text = ''
{
" S K I P _ H O S T _ U P D A T E " : true
}
'' ;
2022-08-10 06:10:21 +00:00
# sublime music player
xdg . configFile . " s u b l i m e - m u s i c / c o n f i g . j s o n " . source =
config . lib . file . mkOutOfStoreSymlink sysconfig . sops . secrets . sublime_music_config . path ;
2022-08-05 07:46:17 +00:00
xdg . configFile . " v l c / v l c r c " . text =
let
2022-09-23 11:14:46 +00:00
podcastUrls = lib . strings . concatStringsSep " | " sysconfig . sane . feeds . podcastUrls ;
2022-08-05 07:46:17 +00:00
in ''
[ podcast ]
2022-09-23 11:14:46 +00:00
podcast-urls = $ { podcastUrls }
2022-08-05 07:46:17 +00:00
[ core ]
metadata-network-access = 0
[ qt ]
qt-privacy-ask = 0
'' ;
2022-09-23 11:14:46 +00:00
xdg . configFile . " g p o d d e r F e e d s . o p m l " . text =
let
entries = builtins . toString ( builtins . map
( url : '' \ n < o u t l i n e x m l U r l = " ${ url } " t y p e = " r s s " / > '' )
sysconfig . sane . feeds . podcastUrls
) ;
in ''
< ? xml version = " 1 . 0 " encoding = " u t f - 8 " ? >
< opml version = " 2 . 0 " >
<body> $ { entries }
< /body >
< /opml >
'' ;
2022-08-05 07:46:17 +00:00
2022-08-04 21:16:37 +00:00
# gnome feeds RSS viewer
xdg . configFile . " o r g . g a b m u s . g f e e d s . j s o n " . text = builtins . toJSON {
feeds = {
2022-08-04 23:17:51 +00:00
# AGGREGATORS (> 1 post/day)
2022-08-04 23:43:36 +00:00
" h t t p s : / / w w w . l e s s w r o n g . c o m / f e e d . x m l " = { tags = [ " h o u r l y " " r a t " ] ; } ;
" h t t p : / / w w w . e c o n l i b . o r g / i n d e x . x m l " = { tags = [ " h o u r l y " " p o l " ] ; } ;
2022-08-11 22:45:35 +00:00
# AGGREGATORS (< 1 post/day)
2022-08-04 23:43:36 +00:00
" h t t p s : / / p a l l a d i u m m a g . c o m / f e e d " = { tags = [ " w e e k l y " " u n c a t " ] ; } ;
" h t t p s : / / p r o f e c t u s m a g . c o m / f e e d " = { tags = [ " w e e k l y " " u n c a t " ] ; } ;
2022-08-04 23:17:51 +00:00
2022-08-04 23:43:36 +00:00
" h t t p s : / / s e m i a c c u r a t e . c o m / f e e d " = { tags = [ " w e e k l y " " t e c h " ] ; } ;
" h t t p s : / / l i n u x p h o n e a p p s . o r g / b l o g / a t o m . x m l " = { tags = [ " i n f r e q u e n t " " t e c h " ] ; } ;
2022-08-11 22:47:40 +00:00
" h t t p s : / / s p e c t r u m . i e e e . o r g / r s s " = { tags = [ " w e e k l y " " t e c h " ] ; } ;
2022-08-04 23:17:51 +00:00
## No Moods, Ads or Cutesy Fucking Icons
2022-08-04 23:43:36 +00:00
" h t t p s : / / w w w . r i f t e r s . c o m / c r a w l / ? f e e d = r s s 2 " = { tags = [ " w e e k l y " " u n c a t " ] ; } ;
2022-08-04 23:17:51 +00:00
# DEVELOPERS
2022-08-04 23:43:36 +00:00
" h t t p s : / / m g . l o l / b l o g / r s s / " = { tags = [ " i n f r e q u e n t " " t e c h " ] ; } ;
2022-08-04 23:17:51 +00:00
## Ken Shirriff
2022-08-04 23:43:36 +00:00
" h t t p s : / / w w w . r i g h t o . c o m / f e e d s / p o s t s / d e f a u l t " = { tags = [ " i n f r e q u e n t " " t e c h " ] ; } ;
2022-08-04 23:17:51 +00:00
## Vitalik Buterin
2022-08-04 23:43:36 +00:00
" h t t p s : / / v i t a l i k . c a / f e e d . x m l " = { tags = [ " i n f r e q u e n t " " t e c h " ] ; } ;
2022-08-04 23:17:51 +00:00
## ian (Sanctuary)
2022-08-04 23:43:36 +00:00
" h t t p s : / / s a g a c i o u s s u r i c a t a . c o m / f e e d . x m l " = { tags = [ " i n f r e q u e n t " " t e c h " ] ; } ;
2022-08-04 23:17:51 +00:00
## Bunnie Juang
2022-08-04 23:43:36 +00:00
" h t t p s : / / w w w . b u n n i e s t u d i o s . c o m / b l o g / ? f e e d = r s s 2 " = { tags = [ " i n f r e q u e n t " " t e c h " ] ; } ;
2022-08-19 02:47:58 +00:00
" h t t p s : / / b l o g . d a n i e l j a n u s . p l / a t o m . x m l " = { tags = [ " i n f r e q u e n t " " t e c h " ] ; } ;
2022-08-20 19:49:09 +00:00
" h t t p s : / / i a n t h e h e n r y . c o m / f e e d . x m l " = { tags = [ " i n f r e q u e n t " " t e c h " ] ; } ;
2022-08-04 23:43:36 +00:00
" h t t p s : / / b i t b a s h i n g . i o / f e e d . x m l " = { tags = [ " i n f r e q u e n t " " t e c h " ] ; } ;
" h t t p s : / / i d i o m d r o t t n i n g . o r g / f e e d . x m l " = { tags = [ " d a i l y " " u n c a t " ] ; } ;
2022-08-04 23:17:51 +00:00
# (TECH; POL) COMMENTATORS
2022-08-04 23:43:36 +00:00
" h t t p : / / b e n j a m i n r o s s h o f f m a n . c o m / f e e d " = { tags = [ " w e e k l y " " p o l " ] ; } ;
2022-08-04 23:17:51 +00:00
## Ben Thompson
2022-08-04 23:43:36 +00:00
" h t t p s : / / w w w . s t r a t e c h e r y . c o m / r s s " = { tags = [ " w e e k l y " " p o l " ] ; } ;
2022-08-04 23:17:51 +00:00
## Balaji
2022-08-04 23:43:36 +00:00
" h t t p s : / / b a l a j i s . c o m / r s s " = { tags = [ " w e e k l y " " p o l " ] ; } ;
" h t t p s : / / w w w . b e n - e v a n s . c o m / b e n e d i c t e v a n s / r s s . x m l " = { tags = [ " w e e k l y " " p o l " ] ; } ;
" h t t p s : / / w w w . l y n a l d e n . c o m / f e e d " = { tags = [ " i n f r e q u e n t " " p o l " ] ; } ;
" h t t p s : / / a u s t i n v e r n o n . s i t e / r s s . x m l " = { tags = [ " i n f r e q u e n t " " t e c h " ] ; } ;
" h t t p s : / / o v e r s h a r i n g . s u b s t a c k . c o m / f e e d " = { tags = [ " d a i l y " " p o l " ] ; } ;
2022-08-05 23:45:30 +00:00
## David Rosenthal
" h t t p s : / / b l o g . d s h r . o r g / r s s . x m l " = { tags = [ " w e e k l y " " p o l " ] ; } ;
2022-08-04 23:17:51 +00:00
## Matt Levine
2022-08-04 23:43:36 +00:00
" h t t p s : / / w w w . b l o o m b e r g . c o m / o p i n i o n / a u t h o r s / A R b T Q l R L R j E / m a t t h e w - s - l e v i n e . r s s " = { tags = [ " w e e k l y " " p o l " ] ; } ;
2022-08-04 23:17:51 +00:00
# RATIONALITY/PHILOSOPHY/ETC
2022-09-23 09:25:26 +00:00
" h t t p s : / / s a m k r i s s . s u b s t a c k . c o m / f e e d " = { tags = [ " i n f r e q u e n t " " u n c a t " ] ; } ; # ... satire? phil?
2022-08-04 23:43:36 +00:00
" h t t p s : / / u n i n t e n d e d c o n s e q u e n c . e s / f e e d " = { tags = [ " i n f r e q u e n t " " r a t " ] ; } ;
2022-08-04 23:17:51 +00:00
2022-08-04 23:43:36 +00:00
" h t t p s : / / a p p l i e d d i v i n i t y s t u d i e s . c o m / a t o m . x m l " = { tags = [ " w e e k l y " " r a t " ] ; } ;
" h t t p s : / / s l i m e m o l d t i m e m o l d . c o m / f e e d . x m l " = { tags = [ " w e e k l y " " r a t " ] ; } ;
2022-08-04 23:17:51 +00:00
2022-08-04 23:43:36 +00:00
" h t t p s : / / w w w . r i c h a r d c a r r i e r . i n f o / f e e d " = { tags = [ " w e e k l y " " r a t " ] ; } ;
" h t t p s : / / w w w . g w e r n . n e t / f e e d . x m l " = { tags = [ " i n f r e q u e n t " " u n c a t " ] ; } ;
2022-08-04 23:17:51 +00:00
## Jason Crawford
2022-08-04 23:43:36 +00:00
" h t t p s : / / r o o t s o f p r o g r e s s . o r g / f e e d . x m l " = { tags = [ " w e e k l y " " r a t " ] ; } ;
2022-08-04 23:17:51 +00:00
## Robin Hanson
2022-08-04 23:43:36 +00:00
" h t t p s : / / w w w . o v e r c o m i n g b i a s . c o m / f e e d " = { tags = [ " d a i l y " " r a t " ] ; } ;
2022-08-04 23:17:51 +00:00
## Scott Alexander
2022-08-04 23:43:36 +00:00
" h t t p s : / / a s t r a l c o d e x t e n . s u b s t a c k . c o m / f e e d . x m l " = { tags = [ " d a i l y " " r a t " ] ; } ;
2022-08-04 23:17:51 +00:00
## Paul Christiano
2022-08-04 23:43:36 +00:00
" h t t p s : / / s i d e w a y s - v i e w . c o m / f e e d " = { tags = [ " i n f r e q u e n t " " r a t " ] ; } ;
2022-08-04 23:17:51 +00:00
## Sean Carroll
2022-08-04 23:43:36 +00:00
" h t t p s : / / w w w . p r e p o s t e r o u s u n i v e r s e . c o m / r s s " = { tags = [ " i n f r e q u e n t " " r a t " ] ; } ;
2022-08-12 00:09:51 +00:00
# COMICS
" h t t p s : / / w w w . s m b c - c o m i c s . c o m / c o m i c / r s s " = { tags = [ " d a i l y " " v i s u a l " ] ; } ;
" h t t p s : / / x k c d . c o m / a t o m . x m l " = { tags = [ " d a i l y " " v i s u a l " ] ; } ;
2022-09-25 23:38:38 +00:00
" h t t p : / / d i l b e r t . c o m / f e e d " = { tags = [ " d a i l y " " v i s u a l " ] ; } ;
2022-08-25 02:46:23 +00:00
# ART
" h t t p s : / / m i n i a t u r e - c a l e n d a r . c o m / f e e d " = { tags = [ " d a i l y " " v i s u a l " ] ; } ;
2022-09-28 06:44:55 +00:00
# CODE
" h t t p s : / / g i t h u b . c o m / K a i t e k i - F e d i / K a i t e k i / c o m m i t s / m a s t e r . a t o m " = { tags = [ " i n f r e q u e n t " " t e c h " ] ; } ;
2022-08-04 21:16:37 +00:00
} ;
dark_reader = false ;
new_first = true ;
2022-08-04 21:20:21 +00:00
# windowsize = {
# width = 350;
# height = 650;
# };
2022-08-04 23:43:36 +00:00
max_article_age_days = 90 ;
2022-08-04 21:16:37 +00:00
enable_js = false ;
2022-08-20 19:49:35 +00:00
max_refresh_threads = 3 ;
2022-08-04 21:20:21 +00:00
# saved_items = {};
# read_items = [];
2022-08-04 21:16:37 +00:00
show_read_items = true ;
full_article_title = true ;
2022-08-04 23:35:04 +00:00
# views: "webview", "reader", "rsscont"
default_view = " r s s c o n t " ;
2022-08-04 21:16:37 +00:00
open_links_externally = true ;
full_feed_name = false ;
2022-08-04 21:20:21 +00:00
refresh_on_startup = true ;
2022-08-04 23:35:04 +00:00
tags = [
# hourly => aggregator
# daily => prolifiq writer
# weekly => i can keep up with most -- but maybe not all -- of their content
# infrequent => i can read everything in this category
" h o u r l y " " d a i l y " " w e e k l y " " i n f r e q u e n t "
2022-08-12 00:09:51 +00:00
# rat[ionality] gets used interchangably with philosophy, here.
# pol[itical] gets used for social commentary and economics as well.
# visual gets used for comics/art
" u n c a t " " r a t " " t e c h " " p o l " " v i s u a l "
2022-08-25 07:17:33 +00:00
] ;
2022-08-04 21:16:37 +00:00
open_youtube_externally = false ;
2022-08-05 02:16:15 +00:00
media_player = " v l c " ; # default: mpv
2022-08-04 21:16:37 +00:00
} ;
2022-06-09 22:05:58 +00:00
programs = {
home-manager . enable = true ; # this lets home-manager manage dot-files in user dirs, i think
zsh = {
2022-06-09 21:50:24 +00:00
enable = true ;
2022-06-09 22:05:58 +00:00
enableSyntaxHighlighting = true ;
enableVteIntegration = true ;
dotDir = " . c o n f i g / z s h " ;
initExtraBeforeCompInit = ''
# p10k instant prompt
# run p10k configure to configure, but it can't write out its file :-(
POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD = true
'' ;
# prezto = oh-my-zsh fork; controls prompt, auto-completion, etc.
# see: https://github.com/sorin-ionescu/prezto
prezto = {
enable = true ;
pmodules = [
" e n v i r o n m e n t "
" t e r m i n a l "
" e d i t o r "
" h i s t o r y "
" d i r e c t o r y "
" s p e c t r u m "
" u t i l i t y "
" c o m p l e t i o n "
" p r o m p t "
" g i t "
] ;
prompt = {
theme = " p o w e r l e v e l 1 0 k " ;
} ;
2022-06-09 21:50:24 +00:00
} ;
} ;
2022-08-04 10:33:42 +00:00
kitty = {
2022-06-30 07:43:08 +00:00
enable = true ;
2022-08-01 06:42:13 +00:00
# docs: https://sw.kovidgoyal.net/kitty/conf/
settings = {
# disable terminal bell (when e.g. you backspace too many times)
enable_audio_bell = false ;
} ;
keybindings = {
" c t r l + n " = " n e w _ o s _ w i n d o w _ w i t h _ c w d " ;
} ;
2022-08-02 00:12:36 +00:00
# docs: https://github.com/kovidgoyal/kitty-themes
# theme = "1984 Light"; # dislike: awful, harsh blues/teals
# theme = "Adventure Time"; # dislike: harsh (dark)
# theme = "Atom One Light"; # GOOD: light theme. all color combos readable. not a huge fan of the blue.
# theme = "Belafonte Day"; # dislike: too low contrast for text colors
# theme = "Belafonte Night"; # better: dark theme that's easy on the eyes. all combos readable. low contrast.
# theme = "Catppuccin"; # dislike: a bit pale/low-contrast (dark)
# theme = "Desert"; # mediocre: colors are harsh
# theme = "Earthsong"; # BEST: dark theme. readable, good contrast. unique, but decent colors.
# theme = "Espresso Libre"; # better: dark theme. readable, but meh colors
# theme = "Forest Night"; # decent: very pastel. it's workable, but unconventional and muted/flat.
# theme = "Gruvbox Material Light Hard"; # mediocre light theme.
# theme = "kanagawabones"; # better: dark theme. colors are too background-y
# theme = "Kaolin Dark"; # dislike: too dark
# theme = "Kaolin Breeze"; # mediocre: not-too-harsh light theme, but some parts are poor contrast
# theme = "Later This Evening"; # mediocre: not-too-harsh dark theme, but cursor is poor contrast
# theme = "Material"; # decent: light theme, few colors.
# theme = "Mayukai"; # decent: not-too-harsh dark theme. the teal is a bit straining
# theme = "Nord"; # mediocre: pale background, low contrast
# theme = "One Half Light"; # better: not-too-harsh light theme. contrast could be better
theme = " P a p e r C o l o r D a r k " ; # BEST: dark theme, very readable still the colors are background-y
# theme = "Parasio Dark"; # dislike: too low contrast
# theme = "Pencil Light"; # better: not-too-harsh light theme. decent contrast.
# theme = "Pnevma"; # dislike: too low contrast
# theme = "Piatto Light"; # better: readable light theme. pleasing colors. powerline prompt is hard to read.
# theme = "Rosé Pine Dawn"; # GOOD: light theme. all color combinations are readable. it is very mild -- may need to manually tweak contrast. tasteful colors
# theme = "Rosé Pine Moon"; # GOOD: dark theme. tasteful colors. but background is a bit intense
# theme = "Sea Shells"; # mediocre. not all color combos are readable
# theme = "Solarized Light"; # mediocre: not-too-harsh light theme; GREAT background; but some colors are low contrast
# theme = "Solarized Dark Higher Contrast"; # better: dark theme, decent colors
# theme = "Sourcerer"; # mediocre: ugly colors
# theme = "Space Gray"; # mediocre: too muted
# theme = "Space Gray Eighties"; # better: all readable, decent colors
# theme = "Spacemacs"; # mediocre: too muted
# theme = "Spring"; # mediocre: readable light theme, but the teal is ugly.
# theme = "Srcery"; # better: highly readable. colors are ehhh
# theme = "Substrata"; # decent: nice colors, but a bit flat.
# theme = "Sundried"; # mediocre: the solar text makes me squint
# theme = "Symfonic"; # mediocre: the dark purple has low contrast to the black bg.
# theme = "Tango Light"; # dislike: teal is too grating
# theme = "Tokyo Night Day"; # medicore: too muted
# theme = "Tokyo Night"; # better: tasteful. a bit flat
# theme = "Tomorrow"; # GOOD: all color combinations are readable. contrast is slightly better than Rose. on the blander side
# theme = "Treehouse"; # dislike: the orange is harsh on my eyes.
# theme = "Urple"; # dislike: weird palette
# theme = "Warm Neon"; # decent: not-too-harsh dark theme. the green is a bit unattractive
# theme = "Wild Cherry"; # GOOD: dark theme: nice colors. a bit flat
# theme = "Xcodedark"; # dislike: bad palette
# theme = "citylights"; # decent: dark theme. some parts have just a bit low contrast
# theme = "neobones_light"; # better light theme. the background is maybe too muted
# theme = "vimbones";
# theme = "zenbones_dark"; # mediocre: readable, but meh colors
# theme = "zenbones_light"; # decent: light theme. all colors are readable. contrast is passable but not excellent. highlight color is BAD
# theme = "zenwritten_dark"; # mediocre: looks same as zenbones_dark
2022-08-01 06:42:13 +00:00
# extraConfig = "";
2022-06-30 07:43:08 +00:00
} ;
2022-06-09 22:05:58 +00:00
git = {
enable = true ;
userName = " c o l i n " ;
userEmail = " c o l i n @ u n i n s a n e . o r g " ;
} ;
2022-06-09 21:50:24 +00:00
2022-08-01 01:09:01 +00:00
neovim = {
# neovim: https://github.com/neovim/neovim
2022-06-09 22:05:58 +00:00
enable = true ;
2022-08-01 01:09:01 +00:00
viAlias = true ;
vimAlias = true ;
plugins = with pkgs . vimPlugins ; [
2022-08-25 07:17:33 +00:00
# docs: surround-nvim: https://github.com/ur4ltz/surround.nvim/
2022-08-01 01:09:01 +00:00
# docs: vim-surround: https://github.com/tpope/vim-surround
vim-surround
# docs: fzf-vim (fuzzy finder): https://github.com/junegunn/fzf.vim
fzf-vim
2022-08-25 07:59:13 +00:00
# docs: https://github.com/KeitaNakamura/tex-conceal.vim/
( {
plugin = tex-conceal-vim ;
type = " v i m l " ;
config = ''
" p r e s e n t p r e t t i e r f r a c t i o n s
let g:tex_conceal_frac=1
'' ;
} )
2022-08-25 07:17:33 +00:00
( {
plugin = vim-SyntaxRange ;
type = " v i m l " ;
config = ''
" e n a b l e m a r k d o w n - s t y l e c o d e b l o c k h i g h l i g h t i n g f o r t e x c o d e
autocmd BufEnter * call SyntaxRange #Include('```tex', '```', 'tex', 'NonText')
2022-08-25 07:59:13 +00:00
" a u t o c m d S y n t a x t e x s e t c o n c e a l l e v e l = 2
2022-08-25 07:17:33 +00:00
'' ;
} )
2022-08-25 02:44:32 +00:00
# nabla renders inline math in any document, but it's buggy.
# https://github.com/jbyuki/nabla.nvim
# ({
# plugin = pkgs.nabla;
# type = "lua";
# config = ''
# require'nabla'.enable_virt()
# '';
# })
# treesitter syntax highlighting: https://nixos.wiki/wiki/Tree_sitters
2022-08-25 07:17:33 +00:00
# docs: https://github.com/nvim-treesitter/nvim-treesitter
# config taken from: https://github.com/i077/system/blob/master/modules/home/neovim/default.nix
# this is required for tree-sitter to even highlight
( {
plugin = ( nvim-treesitter . withPlugins ( _ : pkgs . tree-sitter . allGrammars ) ) ;
type = " l u a " ;
config = ''
2022-08-01 01:09:01 +00:00
require'nvim-treesitter . configs' . setup {
highlight = {
enable = true ,
2022-08-25 07:17:33 +00:00
- - disable treesitter on Rust so that we can use SyntaxRange
- - and leverage TeX rendering in rust projects
disable = { " r u s t " , " t e x " , " l a t e x " } ,
- - disable = { " t e x " , " l a t e x " } ,
- - true to also use builtin vim syntax highlighting when treesitter fails
additional_vim_regex_highlighting = false
2022-08-01 01:09:01 +00:00
} ,
incremental_selection = {
enable = true ,
keymaps = {
init_selection = " g n n " ,
node_incremental = " g r n " ,
mcope_incremental = " g r c " ,
node_decremental = " g r m "
}
} ,
indent = {
enable = true ,
disable = { }
}
}
2022-08-25 22:57:48 +00:00
2022-08-01 01:09:01 +00:00
vim . o . foldmethod = ' expr'
vim . o . foldexpr = ' nvim_treesitter #foldexpr()'
'' ;
2022-08-25 07:17:33 +00:00
} )
2022-08-01 01:09:01 +00:00
] ;
2022-08-25 07:17:33 +00:00
extraConfig = ''
2022-06-09 22:05:58 +00:00
" c o p y / p a s t e t o s y s t e m c l i p b o a r d
set clipboard = unnamedplus
2022-08-25 22:57:48 +00:00
" s c r e w t a b s ; a l w a y s e x p a n d t h e m i n t o s p a c e s
set expandtab
2022-08-25 07:17:33 +00:00
" a t l e a s t d o n ' t o p e n f i l e s w i t h s e c t i o n s f o l d e d b y d e f a u l t
set nofoldenable
2022-08-25 07:59:13 +00:00
" a l l o w t e x t s u b s t i t u t i o n s f o r c e r t a i n g l y p h s .
" h i g h e r n u m b e r = m o r e a g g r e s s i v e s u b s t i t u t i o n ( 0 , 1 , 2 , 3 )
" i o n l y m a k e u s e o f t h i s f o r t e x , b u t i t ' s u n c l e a r h o w t o
" a p p l y t h a t * j u s t * t o t e x a n d r e t a i n t h e S y n t a x R a n g e s t u f f .
set conceallevel = 2
2022-08-25 22:57:48 +00:00
2022-08-01 01:09:01 +00:00
" h o r i z o n t a l r u l e u n d e r t h e a c t i v e l i n e
2022-08-25 07:17:33 +00:00
" s e t c u r s o r l i n e
2022-08-25 22:57:48 +00:00
2022-08-01 01:09:01 +00:00
" h i g h l i g h t t r a i l i n g s p a c e & r e l a t e d s y n t a x e r r o r s ( d o e s n ' t s e e m t o w o r k ? ? )
" l e t c _ s p a c e _ e r r o r s = 1
" l e t p y t h o n _ s p a c e _ e r r o r s = 1
2022-08-25 22:57:48 +00:00
" e n a b l e h i g h l i g h t i n g o f l e a d i n g / t r a i l i n g s p a c e s ,
" a n d e s p e c i a l l y t a b s
" s o u r c e : h t t p s : / / w w w . r e d d i t . c o m / r / n e o v i m / c o m m e n t s / c h l m f k / h i g h l i g h t _ t r a i l i n g _ w h i t e s p a c e s _ i n _ n e o v i m /
set list
set listchars = tab : ▷ \ · , trail : · , extends : ◣ , precedes : ◢ , nbsp : ○
2022-08-25 07:17:33 +00:00
'' ;
2022-06-09 22:05:58 +00:00
} ;
2022-06-09 21:50:24 +00:00
2022-08-03 08:23:23 +00:00
# XXX: although home-manager calls this option `firefox`, we can use other browsers and it still mostly works.
2022-08-01 07:23:49 +00:00
firefox = lib . mkIf ( sysconfig . sane . gui . enable ) {
2022-06-09 22:05:58 +00:00
enable = true ;
2022-07-06 21:41:19 +00:00
package = import ./web-browser.nix pkgs ;
2022-06-09 21:50:24 +00:00
} ;
2022-06-09 22:05:58 +00:00
# "command not found" will cause the command to be searched in nixpkgs
nix-index . enable = true ;
} // cfg . programs ;
2022-06-09 21:50:24 +00:00
home . shellAliases = {
" : q " = " e x i t " ;
# common typos
" c d . . " = " c d . . " ;
" c d . . / " = " c d . . / " ;
} ;
} ;
} ;
2022-05-22 08:27:02 +00:00
}