421 Commits

Author SHA1 Message Date
40424a0102 temp: disable visidata bc of python errors 2022-10-31 14:46:04 -04:00
d7b711ff02 replace alacritty with kitty on macos 2022-10-31 14:45:51 -04:00
7bd2125438 fix: actually use exa for ls 2022-10-30 20:43:49 -04:00
0448037a6b set kitty tab style to slant 2022-10-30 20:43:34 -04:00
7075371b11 remove warning about dirty git tree 2022-10-30 20:42:32 -04:00
22885f1b27 temp: try to show users in lightdm greeter
still isn't working unfortunately
2022-10-30 20:16:37 -04:00
52edaa7d9c prevent ctrl-q from quitting firefox
will this affect macos?
2022-10-30 20:16:01 -04:00
c74d003a57 change alacritty scrollback keybind to match kitty
add fonts for kitty
2022-10-30 20:15:32 -04:00
2d10939285 clean up flake inputs and allow standalone home-manager
closes #11
2022-10-30 20:14:41 -04:00
b15cd8c0b6 add basic kitty config
closes #7
2022-10-30 20:13:32 -04:00
dfd903d3c9 add aerc and fix nvim 0.8 2022-10-30 13:57:14 -04:00
2af30faf7c update system and fix nvim 2022-10-29 14:42:37 -04:00
b718a01dc4 i think i fixed picom screen tearing 2022-10-29 08:57:14 -04:00
e16674c817 tweaks for i3 and common 2022-10-28 23:58:33 -04:00
bf09e166a9 fix: grub wrong monitor 2022-10-28 23:58:25 -04:00
3dcafb8c25 package ocr script with dependencies 2022-10-25 20:22:17 -04:00
be581dba1f fix: jellyfin dir permissions for nextcloud 2022-10-23 04:16:42 +00:00
941fa359d9 add windows app plaintext list 2022-10-22 15:10:30 +00:00
f6096e3472 replace vimwiki with mkdnflow 2022-10-22 14:29:50 +00:00
cd204f5ac3 move apps declaration to apps directory 2022-10-18 12:31:42 +00:00
4c685eb8dd ignore non-age files in private dir 2022-10-18 12:25:06 +00:00
2694e3288c move generators to hosts directory 2022-10-18 12:21:22 +00:00
af31c65788 fix: generator module references 2022-10-18 12:17:58 +00:00
ef6c920c48 move calibre-web patch to patches directory
still requires overlay because there is no package option
2022-10-18 03:19:23 +00:00
d97e3fda07 gitea litestream permissions fixes 2022-10-16 20:39:04 +00:00
982566a92e add gitea service 2022-10-16 20:34:28 +00:00
27e2a42e46 fix: typo in copy 2022-10-16 20:21:25 +00:00
41d8e30990 vaultwarden automated backups 2022-10-16 19:06:56 +00:00
6f67e31723 working vaultwarden
haven't tested websockets
2022-10-16 18:10:11 +00:00
7bca2775d1 don't start stop-minecraft timer on rebuild 2022-10-16 14:44:42 +00:00
89a95445e1 remove age and loadkey module 2022-10-16 14:25:47 +00:00
084e832039 wsl fixes 2022-10-16 14:21:38 +00:00
e1e27ca065 backup calibre data 2022-10-16 03:47:21 +00:00
6e26b64f43 backups requires secrets 2022-10-16 03:19:41 +00:00
0f112ea16b reencrypt secrets and fix nextcloud backups 2022-10-16 03:18:58 +00:00
69a54b99c8 new secrets management system 2022-10-16 01:32:39 +00:00
e2c351098b move cloudflare to separate file 2022-10-15 19:00:37 +00:00
5410afb45b switch to /var/lib for calibre-web 2022-10-15 15:29:21 +00:00
bc83c818db honeypot for banning port scanners 2022-10-15 12:16:05 +00:00
8cce61f4a8 change metrics server hostname 2022-10-14 13:08:13 +00:00
595eac9367 switch from netdata to grafana 2022-10-14 04:01:41 +00:00
a17a048d9d set credentials oneshots to stop after launch 2022-10-14 01:35:14 +00:00
c2d0037bab autostart and stop minecraft server 2022-10-14 01:34:35 +00:00
e2af159c26 lockdown caddy and ssh connections 2022-10-13 23:40:30 +00:00
01e71e5810 add minecraft server 2022-10-10 23:09:32 +00:00
c4c75cd587 switch to netdata cloud
fix performance issues with caddy mostly
2022-10-10 19:22:39 +00:00
a5e186ee87 netdata metrics with basic auth
seems to have performance problems with caddy
2022-10-10 18:11:08 +00:00
170f8c67de enable transmission web allowlist 2022-10-10 03:25:28 +00:00
b0aa82e7d0 refactor wireguard and add port forwarding 2022-10-10 03:13:16 +00:00
7aacfe7887 fix issues reaching transmission web 2022-10-09 20:41:04 +00:00
d8b5d74dcb transmission reaches internet through vpn 2022-10-09 18:32:43 +00:00
129e4bba4b wireguard working but not transmission 2022-10-09 14:12:31 +00:00
e309889b0b replace activationscripts with systemd 2022-10-09 03:51:25 +00:00
5872abcc33 move calibre perms out of activations 2022-10-08 15:57:52 +00:00
bfa9e8fc4e remember to require age for mail 2022-10-08 15:52:43 +00:00
8dba2ef88b litestream backups for nextcloud 2022-10-08 15:52:19 +00:00
e89db82e7f make whois core utility 2022-10-07 03:31:14 +00:00
4044721606 add vaultwarden, not activated 2022-10-07 00:44:06 +00:00
0637cc693b fix: patch calibre-web cloudflare login issues 2022-10-05 03:59:13 +00:00
a9ae0c8858 add activationscript for jellyfin directory 2022-10-04 22:59:28 +00:00
da01f3be9b add cloudflare IPs as nextcloud trusted proxies 2022-10-04 22:43:04 +00:00
a7117fe4e9 fix: max upload size for nextcloud 2022-10-04 12:29:29 +00:00
c2b570b2af don't use s3 as primary nextcloud storage 2022-10-04 03:06:55 +00:00
84ecbf9974 grant nextcloud access to jellyfin 2022-10-04 00:45:05 +00:00
f38f782b63 add helper statements for loadkeys app 2022-10-03 12:32:09 +00:00
31f3cfe77c fix firewall issues with oracle 2022-10-03 12:19:29 +00:00
a0089e28ae move mailpass to private section 2022-10-03 12:12:50 +00:00
92223a49cd separate age ssh key setup from nextcloud 2022-10-03 04:05:07 +00:00
2434376963 working nextcloud configuration 2022-10-02 20:54:26 +00:00
f196f546b8 add jellyfin, switch caddy to one listener 2022-10-02 17:40:10 +00:00
b4ba0706c0 move caddy config into separate file 2022-10-02 15:24:25 +00:00
90bc2ecd49 add iptables settings for oracle reboot 2022-10-02 15:09:54 +00:00
19de583433 setup caddy and calibre-web 2022-10-02 14:48:51 +00:00
8a97d9b2da calibre needs to use path it can read 2022-10-02 02:47:10 +00:00
015c393274 docs: deprecated nixFlakes package 2022-10-01 21:42:33 +00:00
db0645075f setup calibre server 2022-10-01 21:39:36 +00:00
034ff33e70 add more description for mkpasswd salt 2022-10-01 18:28:32 +00:00
cd53060f02 switch to ssh for dotfiles repo 2022-10-01 18:28:03 +00:00
f20b4ee31a add ssh host to starship 2022-10-01 18:24:06 +00:00
381e06519b add oracle hardware config 2022-10-01 16:29:16 +00:00
3ec1ef4394 add server bootloader 2022-10-01 16:24:44 +00:00
d303924f02 try adding oracle server config 2022-10-01 16:21:34 +00:00
485e8223cf Merge branch 'aws-nix-build' 2022-10-01 15:26:01 +00:00
657bec0929 browse active directory on macos 2022-09-30 11:09:58 -04:00
4e23d677e8 auto-formatting changes 2022-09-30 10:11:55 -04:00
5ce4ebf522 fix: hostname for macos 2022-09-28 15:33:49 -04:00
e6b7938218 update lockfile and fix some darwin configs 2022-09-27 21:30:27 -04:00
1addb7ec21 manage touchid sudo with nix-darwin 2022-09-25 14:47:04 +00:00
ba14638a8a navigate git hunks in neovim 2022-09-25 14:46:50 +00:00
ddd517e0dd update installer with gum, add more charm stuff 2022-09-25 04:19:46 +00:00
0ac3aec208 dynamic rebuild-nixos based on current hostname 2022-09-24 16:53:16 +00:00
ae90b1041d add charm packages, fix neovim tree height 2022-09-24 14:26:02 +00:00
9b0dcaba9f docs: update wsl instructions for fonts and term 2022-09-24 01:55:11 +00:00
0bf5fd5862 update docs for non-nix users 2022-09-23 14:35:14 -04:00
7a9f7dd760 add more general utilities 2022-09-21 16:58:04 -04:00
f834cc20f4 aws generator gh workflow and terraform upload 2022-09-21 03:49:04 +00:00
720a3cc409 additional options needed to build aws image 2022-09-20 12:50:04 +00:00
9e3345ff9b add sshd for aws generators 2022-09-20 11:50:45 +00:00
50a538c78e start generator work 2022-09-20 04:01:45 +00:00
6281e32275 wsl alacritty fixes 2022-09-20 01:15:52 +00:00
8dd9c012cc update system 2022-09-17 21:34:36 -04:00
daf1669c8b set flake registry for all hosts 2022-09-17 21:33:57 -04:00
4e15c21df7 set flake registry to flake nixpkgs 2022-09-17 21:15:31 -04:00
2c0cc201e9 tweaks to vim paste and git 2022-09-13 23:09:03 -04:00
5648cd29e7 changes to homebrew config requirements 2022-09-11 19:35:56 -04:00
32e8d60d02 add kubernetes tools to devops kit 2022-09-10 16:14:30 -04:00
2986ad06f5 modify git config for work 2022-09-09 22:18:05 -04:00
8fe3cffc9f document fixes for nvim issues 2022-09-09 22:05:30 -04:00
ea47b375b6 another update 2022-09-09 22:04:14 -04:00
49148cbf93 update to latest 2022-09-09 18:30:42 -04:00
14cb90cd52 fixes for latest picom on nixos desktop 2022-09-09 17:16:13 -04:00
39d465c7c1 comments for devshells 2022-08-21 15:27:47 -06:00
9bca6e1321 flake devshell for devops tools 2022-08-19 19:10:08 -06:00
82e04dcdb1 run nix-shell with fish and set name in starship 2022-08-19 19:09:42 -06:00
b3bcd89b7e switch vimv to vimv-rs after issues 2022-08-17 23:09:23 -06:00
54d0a73d08 include nix-shell symbol on right of prompt 2022-08-17 21:16:35 -06:00
14c1abf761 add steam back to macos 2022-08-16 21:21:49 -06:00
a06cb74340 add k9s and gh run watch to toggleterm 2022-08-15 22:29:23 -06:00
6827aa4369 remove window launcher from hammerspoon, reformat 2022-08-14 20:44:18 -06:00
34049fa5fb revert vim paste register hack 2022-08-14 20:43:36 -06:00
5251f2cd5a use noti for darwin gh commands 2022-08-14 20:43:10 -06:00
bdcee575db script apps don't need shebang 2022-08-07 19:16:51 -06:00
e0370bf1d1 make basic template the default 2022-08-07 18:37:19 -06:00
99f1777827 fix: add readme and fix installer apps 2022-08-07 18:32:11 -06:00
79f8e621e6 add basic nix flake template 2022-08-07 12:52:03 -06:00
e9fef7dbbb add nord for neovim 2022-07-31 16:06:00 -06:00
842d25e798 update packages 2022-07-31 13:01:54 -06:00
5d5412bf1f add ipcalc 2022-07-31 13:01:45 -06:00
4be7762aba move stylua file out of root 2022-07-30 12:17:59 -06:00
d343c2a9f7 fix: ocr and touch id 2022-07-28 23:00:52 -06:00
8efea24282 readme fixes 2022-07-27 17:13:41 -06:00
7559782749 add MIT license 2022-07-27 19:03:31 -04:00
d299b861b6 add generic server host 2022-07-26 19:11:07 -06:00
7edfcd9743 remove some legacy config files 2022-07-26 00:09:25 -04:00
4e8546728e move colorscheme out of gui section 2022-07-25 23:36:06 -04:00
6353ac188e reorganize files 2022-07-25 23:20:02 -04:00
2a4a8efa48 search-and-edit jump to line number 2022-07-22 09:49:21 -04:00
8705f2a96f add proper readme file 2022-07-20 11:50:04 -04:00
c42b0b20be add flake8 and improve nvim-tree 2022-07-18 23:34:32 -04:00
f745a24462 bump versions 2022-07-14 20:21:13 -04:00
42877bdebc add toggleterm plugin 2022-07-13 12:53:51 +00:00
59c5369783 improve nvim-tree icons 2022-07-13 04:23:38 +00:00
51c75e2874 fix: nvim-cmp completion bugs 2022-07-13 02:15:00 +00:00
a22acac57d neovim improve bufferline and tree 2022-07-12 12:36:10 +00:00
ee305529ce nvim fancy bufferline, file tree, git cmds 2022-07-12 03:53:30 +00:00
50665737e2 change python template to allow more programs 2022-07-11 17:43:09 -04:00
92e2eac11e fix: treesitter breaking (auto-installs markdown) 2022-07-11 11:17:01 -04:00
e2400475f2 fix: nvim headless failing on darwin 2022-07-11 09:23:41 -04:00
35aa851231 neovim tree-sitter textobject selections 2022-07-11 12:47:36 +00:00
24acd220fb move keybinds to plugin configs 2022-07-11 03:31:48 +00:00
e1ac175333 lsp and completion tweaks 2022-07-11 02:47:54 +00:00
df6ac12204 add gruvbox for windows alacritty 2022-07-11 00:24:55 +00:00
e9f85b815b run packer sync on nix rebuild 2022-07-10 23:48:11 +00:00
5243003bad switch to new neovim gruvbox 2022-07-10 22:17:19 +00:00
4f1c61bbe0 neovim replace keymap cmds with lua 2022-07-10 17:54:21 +00:00
4851637770 conditional lsp servers 2022-07-10 14:15:41 +00:00
cc801b4981 neovim colors.lua based on colorscheme 2022-07-09 21:57:56 +00:00
a10e33c1e1 refactor neovim into proper lua files 2022-07-09 21:27:04 +00:00
050cbfcba7 windows alacritty settings 2022-07-09 19:21:33 +00:00
3015f29f3b wsl-specific module 2022-07-08 03:13:09 +00:00
cfe3c137ba wsl compatibility fixes 2022-07-08 01:31:00 +00:00
86b1ab61cb add wsl host 2022-07-07 07:49:48 -04:00
1e511ce08b mac alacritty keybind fixes 2022-07-06 16:04:07 -04:00
8f5522c2c9 nix shell features for flake, remove channels 2022-07-06 15:50:10 -04:00
df3e8e60d7 hammerspoon worklayout functional 2022-07-06 10:35:00 -04:00
9aad4efd27 fix: recent file lookup with wrong stat 2022-07-05 21:05:24 -04:00
682acdc8ae bind ctrl-n to nix run 2022-07-05 20:42:49 -04:00
758321adc3 more commandline changes 2022-07-05 19:40:54 -04:00
c646f126e2 commandline append in uncommitted and darwin-rebuild 2022-07-05 19:16:08 -04:00
faa7f74773 add shfmt and shellcheck to system-wide neovim packages 2022-07-05 17:18:08 -04:00
7093ba7791 improve nix-shell-run with args 2022-07-05 08:42:24 -04:00
076068aa85 nix-shell-run shortcut 2022-07-04 23:31:56 -04:00
6d08491f1c add haskell programming template 2022-07-04 19:17:58 -04:00
704acea26e add nixpkgs search shortcut 2022-07-01 18:50:16 -04:00
372727c915 bring back python, visidata was the problem 2022-07-01 09:04:17 -04:00
35a57d2905 gh repos and fix mac build 2022-07-01 08:45:07 -04:00
8a22c80b2d add python black formatter to python.nix 2022-06-30 21:23:17 -04:00
83488999f8 update system 2022-06-30 19:50:14 -04:00
b5f3e83f15 switch pip python to mach-nix 2022-06-27 16:41:29 -04:00
9b936105a0 update system 2022-06-26 23:08:58 -04:00
bfd3eb997c temp: home-manager requires state version 2022-06-26 23:08:45 -04:00
6383d88b4b shortcut for nix commands 2022-06-26 22:15:25 -04:00
720ca5d94c add template for python requirements.txt projects 2022-06-26 22:10:57 -04:00
e4b15ea100 tweaks after adding lf browser 2022-06-26 22:08:17 -04:00
0cfad06763 improve fzf project presentation 2022-06-26 21:53:08 -04:00
8ba28be649 hammerspoon maximize window fixes 2022-06-22 09:53:03 -04:00
85116fc8fd python and other fixes 2022-06-21 17:51:27 -04:00
c4ee4cafa5 bring back direnv output (was too quiet) 2022-06-21 08:36:20 -04:00
1d9f48f5d3 separate kubernetes and terraform fish abbrs 2022-06-21 08:33:05 -04:00
c08c5c5a9e alacritty recognize key binds for macos 2022-06-21 08:22:51 -04:00
b7788431d2 add poetry template 2022-06-20 23:34:24 -04:00
f5ab31dd82 ignore nix result files 2022-06-20 20:32:08 -04:00
5d3fbd35c9 improve programming experience for nix 2022-06-20 19:51:03 -04:00
d0b3be617c add terraform and initial programming tools 2022-06-20 16:14:04 -04:00
74e53a3cd1 fzf improvements 2022-06-20 15:49:25 -04:00
6a47ffa024 fish search updates 2022-06-20 15:20:20 -04:00
454ceb7d7d fix email on darwin 2022-06-20 14:41:36 -04:00
98dcc471b4 darwin fixes after merge 2022-06-20 14:33:19 -04:00
2f58396c61 Merge branch 'experimental' 2022-06-20 09:23:26 -04:00
4ad1cff80e add changes from master 2022-06-20 09:19:51 -04:00
5a43ad997f replace manual home dir with config option 2022-06-20 08:39:41 -04:00
fdfc66c7ad fix build on linux 2022-06-19 23:54:16 -04:00
e22a4f3df2 more darwin cleanup 2022-06-19 23:44:29 -04:00
a8f497e226 darwin fix dock 2022-06-19 17:30:32 -04:00
7861f9ec3a fix macos homebrew and system activations 2022-06-19 15:27:52 -04:00
bd7290fe63 darwin alacritty statusbar 2022-06-19 10:02:06 -04:00
4f1e948843 fixes to nvim and alacritty 2022-06-19 09:34:17 -04:00
baa20e4dbb fixes to darwin alacritty 2022-06-19 08:38:44 -04:00
f2f0ccd63f hacking fonts 2022-06-18 17:16:38 -04:00
518d788c73 more macos hacks 2022-06-18 15:45:51 -04:00
e2189397fc fixes to get darwin to build 2022-06-18 13:17:11 -04:00
d7b2f36dfe update user for macbook 2022-06-17 20:53:19 -04:00
07b00d3e3f automatically create lock screen cache if needed 2022-06-17 20:50:12 -04:00
e69dd6a98e replace included wallpapers with input reference 2022-06-16 21:13:50 -04:00
efac9b98f7 add windows utc time registry file 2022-06-16 12:57:14 -04:00
89e2e52e44 separate hammerspoon and add installation instructions 2022-06-15 08:14:01 -04:00
4e3054d91e move templates to legacy dir 2022-06-14 19:04:12 -04:00
0229df9b97 merge darwin and nixos rebuild function 2022-06-14 19:03:16 -04:00
708672b2e3 add nr to rebuild nixos and darwin 2022-06-14 18:17:52 -04:00
c67d84fcd1 clean up makefile 2022-06-14 08:10:07 -04:00
985d80eaa2 switch hammerspoon to .config 2022-06-14 08:10:02 -04:00
1381b9d063 split up darwin configs 2022-06-14 07:54:18 -04:00
7dfef72177 macos custom settings and alacritty tmux 2022-06-14 07:43:59 -04:00
df59e376f2 hammerspoon and reorganize old files to legacy 2022-06-14 07:32:27 -04:00
c048b7244f use ctrl-shift-g to insert path to git repo 2022-06-14 07:14:26 -04:00
84a6f3a38a alacritty settings for macos 2022-06-14 07:00:12 -04:00
884f0cdeea grub boot timeout 2022-06-14 06:38:34 -04:00
b48c9aef12 add macos applications 2022-06-13 23:43:49 -04:00
404426c480 prevent discord auto-update 2022-06-13 20:29:49 -04:00
ac1e8828ed add some darwin user stuff 2022-06-13 08:53:00 -04:00
388e50d9d4 start adding macos configuration 2022-06-12 17:46:26 -04:00
2539151df9 switch to grub for dual-boot convenience 2022-06-12 16:43:07 -04:00
9a21db7165 add more flexibility to installer script 2022-06-05 09:32:42 -04:00
f4786156de create automatic partition installer 2022-06-05 09:24:46 -04:00
8d50690a79 update system 2022-06-05 08:32:23 -04:00
cd62307786 use unfree system for firefox extensions 2022-06-04 21:09:17 -04:00
3b38f0301a allow specific unfree 2022-06-04 21:08:09 -04:00
f4d5df0071 enable official mullvad client 2022-06-04 11:24:40 -04:00
0fd3956bda wireguard config but not enabled 2022-06-04 10:29:36 -04:00
aa8765b2a2 launch legendary game with fzf 2022-06-03 21:58:20 -04:00
350d7bb3cd add rofi alt-tab command 2022-06-02 22:09:53 -04:00
4b2a219e72 improve screen maximization 2022-06-02 10:28:58 -04:00
6f5b4725e7 fix: actually do home activation 2022-05-30 16:14:02 -04:00
3656ed7e8f add home activation script 2022-05-30 16:07:43 -04:00
60fe4caed4 add nautilus file manager 2022-05-30 13:18:18 -04:00
36c4881384 revert to nvim as alias for vim 2022-05-30 13:09:50 -04:00
bea0924972 use nvim for edit function 2022-05-30 09:44:33 -04:00
3ba26ccfd5 improve comments and general tweaks 2022-05-29 13:44:45 -04:00
3ea0e40121 unused wireguard config 2022-05-29 12:00:19 -04:00
f1fda23f3f volnoti volume notifications 2022-05-28 16:48:02 -04:00
93de15cec0 improve gaming tools 2022-05-28 10:34:00 -04:00
2b72ffb6cf attempts to improve league install 2022-05-26 19:33:18 -04:00
86c86d0215 temp: project dir hardcoded 2022-05-22 19:53:18 -04:00
5b9058935d move more modules to common section 2022-05-22 19:43:46 -04:00
df96ff6cea try to fix mbsync datetime when migrating 2022-05-22 17:33:45 -04:00
e0777a40ca documentation tweaks 2022-05-19 08:48:23 -04:00
99bff6fa42 try to prevent keyboard from waking again 2022-05-19 08:48:09 -04:00
de023c2cd9 fix: suspend w betterlockscreen 2022-05-19 08:47:43 -04:00
d3cd9891f3 fix: alacritty vi mode jump to end of line 2022-05-19 08:47:15 -04:00
f8edbeaeca change mail system 2022-05-17 23:34:09 -04:00
077b3c9337 add wallpaper to lightdm 2022-05-17 22:58:41 -04:00
6c6d80a1d0 improve lockscreen and remove explicit packages 2022-05-17 19:17:36 -04:00
7603005864 disable kbfs redirector to fix errors 2022-05-17 18:36:32 -04:00
490c78714f fix: i3 lock on sleep 2022-05-17 08:43:47 -04:00
ec4dcbd3a6 fix kbfs, mbsync, alacritty i3 2022-05-16 22:05:21 -04:00
3b385f21fc fix geoclue when enabling wifi 2022-05-16 20:37:26 -04:00
82e85a7d95 fix gpp 2022-05-16 20:27:26 -04:00
d28465e475 set git defaultbranch config 2022-05-16 08:29:32 -04:00
9099a9f63b devShell for all system types 2022-05-15 20:46:17 -04:00
b9d28efa4b install calibre
dark mode still isn't working
2022-05-15 20:21:45 -04:00
78ea55f029 change email pass file 2022-05-15 15:24:16 -04:00
cb47f4bbd3 mess around with rofi brightness script 2022-05-15 14:31:22 -04:00
58ca0a0fe2 increase brightness changes 2022-05-15 14:31:13 -04:00
6cd48da8a4 rename desktop to graphical 2022-05-15 08:32:16 -04:00
eccd5e7e33 rofi with emoji and calc plugins activated 2022-05-15 08:18:03 -04:00
1a31d4d3e5 toggle polybar with keybinding 2022-05-14 23:31:04 -04:00
7baec572e3 new password 2022-05-14 22:51:57 -04:00
9be5b17988 fix wallpaper 2022-05-14 22:38:26 -04:00
14ab11e526 i3 jump to workspace after move 2022-05-14 20:41:05 -04:00
6e72764ff1 i3 - remove resize mode 2022-05-14 20:38:21 -04:00
9d6898e0d3 fixing gtk back to normal 2022-05-14 20:29:03 -04:00
c75bffa0dc playing with gtk theme package 2022-05-14 17:36:38 -04:00
9ba095c29d hammerspoon fix for 3 monitors 2022-05-13 14:46:46 -04:00
e3d9fe083c i3 tabbed terminal, mess with lock cmd 2022-05-12 08:44:03 -04:00
835cebebfb use neovim for man pager 2022-05-11 21:13:41 -04:00
2c07d8e24a add encrypted mail password 2022-05-11 21:08:16 -04:00
73c837b710 prevent keyboard from waking up machine 2022-05-11 20:30:16 -04:00
5e6dd8c2b8 mail config and firefox container tabs 2022-05-10 23:45:50 -04:00
852385ef4d initial gpg setup 2022-05-09 22:55:10 -04:00
cc974cb013 lowercase directories and nix-index 2022-05-08 20:49:42 -04:00
ed2b61b03f move system to hosts directory 2022-05-08 16:02:13 -04:00
446fc5d5c1 fix polybar workspace order 2022-05-08 15:30:05 -04:00
e9de34405f replace commentary with comment.nvim 2022-05-08 10:04:12 -04:00
2bcf7ab079 remove extra stylua file 2022-05-08 09:58:13 -04:00
284f54584e everforest base16 colors 2022-05-08 09:57:07 -04:00
93f254abf9 firefox tabs, nord base16 scheme, wallpaper alt 2022-05-07 22:04:34 -04:00
c311e8625b fix: monitor artifacts 2022-05-07 21:14:02 -04:00
7f00617856 firefox urlbar color tweaks 2022-05-07 21:05:11 -04:00
40f06384ba split neovim lua config with mkorder 2022-05-07 18:11:47 -04:00
d6657cee86 test splitting up init.lua 2022-05-07 17:31:19 -04:00
ce52be726f move neovim init.lua to module 2022-05-07 16:54:47 -04:00
046b24d3aa polybar underline color tweak 2022-05-07 16:11:15 -04:00
2c4a737d37 firefox color scheme and addons 2022-05-07 14:24:00 -04:00
337ddd6c35 make polybar brown 2022-05-07 10:25:41 -04:00
7dece0be25 rofi size adjustments, add icons 2022-05-07 09:56:16 -04:00
6b14485632 use hack for desktop font 2022-05-07 09:36:07 -04:00
4540327cb8 basic rofi and more macos cleanup 2022-05-07 09:24:17 -04:00
43571c66dd focus don't follow mouse 2022-05-06 09:46:49 -04:00
fa25e24351 move static fish functions 2022-05-06 09:44:21 -04:00
5f946b5d8c move wallpapers out of themes
and remove theme directory entirely
2022-05-06 09:35:08 -04:00
6f2fff80ed split out starship, fzf, direnv 2022-05-06 09:29:25 -04:00
e215ef6428 change macos directory layout 2022-05-06 08:58:44 -04:00
417623965e refactor arguments to options
also change theme to colorscheme
2022-05-05 23:02:01 -04:00
672001829d git checkout default branch instead of master 2022-05-05 10:29:15 -04:00
531c78ebe0 set flake for hostname 2022-05-05 09:21:34 -04:00
01c5f09f41 use git safe mechanic to fix doas git issue 2022-05-05 07:33:07 -04:00
f2d01ec575 try rofi instead of dmenu 2022-05-03 21:11:31 -04:00
67f8a8b08d experiment with themes and colors 2022-05-03 20:32:47 -04:00
ec0b1c4e04 remove nixos directory 2022-05-01 23:39:50 -04:00
6cd892f67a fix gitignore 2022-05-01 23:22:54 -04:00
3304efab01 i3 gaps and carbon fiber 2022-05-01 23:16:03 -04:00
7bfc3c68bd add picom 2022-05-01 12:10:38 -04:00
d32757924f start prettying polybar 2022-05-01 11:16:58 -04:00
f65255c7c1 clean up devshell 2022-05-01 11:16:48 -04:00
a35753cfd9 remove some old unnecessary configs 2022-04-30 19:28:19 -04:00
8aa532eb20 comment out parts of polybar 2022-04-30 17:40:24 -04:00
5057f8d597 add polybar default config 2022-04-30 17:27:42 -04:00
0685a90aa3 setup more default.nix 2022-04-30 12:32:00 -04:00
9d7307d16d collapse gui and identity arguments 2022-04-30 12:07:58 -04:00
8e08b70d86 move polybar init script into nix 2022-04-30 11:32:26 -04:00
70d50a8681 more fish initializations 2022-04-30 11:08:16 -04:00
f5508c747c move fish functions into nix 2022-04-30 10:21:43 -04:00
47d09a98e2 actually activate i3 config 2022-04-30 08:42:08 -04:00
69f5375541 add i3 config in nix format 2022-04-29 22:29:50 -04:00
b7a75da2d3 hammerspoon hotkey for maximize 2022-04-29 10:50:29 -04:00
8cb2ec4e13 update nixpkgs 2022-04-28 23:13:11 -04:00
4da5e381b2 move gtk theme to firefox 2022-04-28 23:04:48 -04:00
4735cce26f separate groups and himalaya 2022-04-28 22:55:42 -04:00
bbed1ed591 forgot to add back 1pass 2022-04-28 22:44:42 -04:00
c797f5ab65 move more apps and separate unfree 2022-04-28 22:43:50 -04:00
c89df227e6 remove stateVersion 2022-04-28 22:25:56 -04:00
5404476552 networking and fonts 2022-04-28 22:25:05 -04:00
992496b1f0 separate hardware 2022-04-28 22:12:16 -04:00
2a5c896322 separate xorg and i3 2022-04-28 21:56:21 -04:00
2a225debe5 completely remove secondary home-manager section 2022-04-28 21:40:21 -04:00
cb66ca402e move home.nix to main config 2022-04-28 21:23:43 -04:00
7296c0fefc combine home-manager and system configs 2022-04-28 21:15:47 -04:00
b922cd8f09 pass other values as arg 2022-04-28 20:54:37 -04:00
71e4cc2f5a pass user as arg 2022-04-28 20:46:00 -04:00
eadec0c699 move git stuff to modules 2022-04-28 19:20:46 -04:00
4ccbd8b393 move neovim to module 2022-04-28 19:11:33 -04:00
80209f3a4c some global options with flakes 2022-04-28 18:55:15 -04:00
f9d106e27d more flakiness 2022-04-27 09:23:26 -04:00
c8381110c5 minimum initial working flakes 2022-04-26 21:36:16 -04:00
9e12221b43 more refactoring with default.nix 2022-04-26 19:59:55 -04:00
523a53f607 add quick rebuild alias 2022-04-26 19:44:11 -04:00
63c89ed902 lower mouse speed 2022-04-26 19:44:00 -04:00
3989a16015 start to split nix into modules 2022-04-25 21:54:53 -04:00
55577615e2 ignore patterns in home-manager 2022-04-25 20:34:33 -04:00
703b2673ba makefile quick scripts 2022-04-25 20:34:20 -04:00
03e1b99f51 remove custom kbfs after update 2022-04-25 20:34:08 -04:00
2e53f7c779 add macos window moving 2022-04-25 10:42:01 -04:00
23d178b2a2 temp fix for kbfs 2022-04-24 13:30:01 -04:00
e73b8be0cd some temp scripts while working on nixos 2022-04-24 10:54:52 -04:00
516957c812 keybase move to system 2022-04-24 10:49:10 -04:00
ece8b09fd1 temp: remove pipewire, back to pulseaudio 2022-04-23 18:25:37 +00:00
30711aa05c more shell requirements for dotfiles 2022-04-23 18:24:46 +00:00
0fb8bf410c bring aliases up to date 2022-04-23 17:45:41 +00:00
712f0ea6a6 fix brightness control 2022-04-23 17:15:14 +00:00
7312243963 add notes path 2022-04-23 16:27:17 +00:00
addc286bf2 i3 and polybar 2022-04-23 16:22:04 +00:00
c969c50026 add music switcher 2022-04-22 10:12:28 -04:00
eb99ec48f7 make switcher visuals adaptive 2022-04-21 17:26:34 -04:00
2e737fd85c prevent bugs in hammerspoon switcher 2022-04-21 14:22:02 -04:00
ba3aa9cd93 draw switcher indicator on screen 2022-04-16 16:50:03 -04:00
244c431c75 allow amend commits with editing 2022-04-14 11:37:32 -04:00
e7ad5c923f dismiss alerts keyboard shortcut 2022-04-12 17:34:04 -04:00
ed09f24529 add shortcut for sc-im spreadsheets 2022-04-10 08:03:15 -04:00
d240456c9f update to notes and ssh dir in rg ignore 2022-03-27 19:34:45 -04:00
3c65cfc70a nvim codeactions and renames 2022-03-18 08:35:28 -04:00
bd0bf927e1 script cleaning for docker_cleanup 2022-03-18 08:34:43 -04:00
d2ab01ee15 more spectrwm changes 2022-01-26 00:42:18 +00:00
1604e7ba47 fish config for loading nix in non-nixos 2022-01-25 12:49:20 -05:00
41eff7f1d8 use direnv instead of poetry 2022-01-25 11:22:42 -05:00
2177397947 Merge branch 'nixos-flashdrive' into experimental 2022-01-25 10:49:23 -05:00
df4ca6e4c4 add telescope file browser 2022-01-25 09:20:47 -05:00
e0c405f8e8 try spectrwm 2022-01-24 01:32:38 +00:00
e51867e838 try qtile 2022-01-23 16:37:47 +00:00
623e029b81 dark mode and league of legends 2022-01-22 23:41:53 -05:00
1424f6c983 keybase encryption 2022-01-22 19:16:37 -05:00
c14702c9ee fix broken system w default.nix 2022-01-22 17:38:36 -05:00
7d52ec7286 move to make, change formatting, break everything 2022-01-22 17:19:32 -05:00
d49dbebf9d vi mode and direnv updates 2022-01-22 15:58:20 -05:00
215e5157ab remove flakes experiment 2022-01-22 15:57:46 -05:00
8c167a0367 fix hyphen abbreviation 2022-01-22 14:55:22 -05:00
449b452cd1 don't install formatters globally 2022-01-22 14:01:32 -05:00
635414aa36 make nvim an alias of vim 2022-01-22 11:06:14 -05:00
121e1e9c37 nixfmt 2022-01-22 11:02:03 -05:00
ecc00acc05 set fonts with italics 2022-01-22 10:46:51 -05:00
010b9bbc3d update mouse speed 2022-01-21 19:22:31 -05:00
60414f062a remove some awesomewm boilerplate 2022-01-21 19:22:31 -05:00
ec42968d7d add back himalaya 2022-01-21 19:22:31 -05:00
bbd39ca5e0 fix audio control w pipewire 2022-01-21 19:22:31 -05:00
4d5791c213 sound redshift awesomewm steam 2022-01-21 19:22:31 -05:00
62f74cdf4a piper and xrandr fixes 2022-01-21 19:22:31 -05:00
82d5c72a7d mouse accel and channels in justfile 2022-01-21 19:22:31 -05:00
7ad8892d81 try to make left monitor primary 2022-01-21 19:22:31 -05:00
b560659dfe fix: fish complete keybind 2022-01-21 19:22:31 -05:00
ccf17ec001 include fish functions 2022-01-21 19:22:31 -05:00
322eb1310a swap caps lock 2022-01-21 19:22:31 -05:00
0b7221bd6a temp: disable neoclip 2022-01-21 19:22:31 -05:00
cc06fadcd9 alacritty colors 2022-01-21 19:22:31 -05:00
e2288101ad use original nvim 2022-01-21 19:22:31 -05:00
244b36aee3 remove unnecessary comments 2022-01-21 19:22:31 -05:00
98e5bc7cbf switch to pipewire 2022-01-21 19:22:31 -05:00
31fc8e204f use unstable nix for everything 2022-01-21 19:22:31 -05:00
fc66f23a49 start with nvme drive 2022-01-21 19:22:31 -05:00
f1bc34e8fd updates with ec2 2022-01-21 19:22:31 -05:00
0aade99d4a fonts 2022-01-21 19:22:31 -05:00
b111045ab4 fish abbreviations 2022-01-21 19:22:31 -05:00
634e8cabac a bit of nix config 2022-01-21 19:22:31 -05:00
324 changed files with 10543 additions and 3646 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

16
.gitignore vendored
View File

@ -1,14 +1,8 @@
.DS_Store .DS_Store
newsboat.configlink/history.search
newsboat.configlink/urls
nvim.configlink/dirs/*
nvim.configlink/.netrwhist
nvim.configlink/plugin/**
nvim.configlink/plugged/**
nvim.configlink/autoload/**
fish.configlink/config.fish.bac
fish.configlink/functions/vim.fish
fish_variables
homebrew/*.lock.json
*.bak *.bak
*.db *.db
**/.direnv/**
result
.luarc.json
private/**
!private/**.age

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Noah Masur
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,40 +0,0 @@
bootstrap:
./scripts/bootstrap
./scripts/setup_symlinks
all:
./scripts/bootstrap
./scripts/setup_symlinks
./scripts/setup_fish
./scripts/brews
./scripts/update_rust_analyzer
./scripts/rust
./scripts/cargos
./scripts/setup_cheatsheet
./scripts/setup_ytfzf
fish: bootstrap
./scripts/setup_fish
macos: bootstrap
./scripts/configure_macos
brews: bootstrap
./scripts/brews
casks: bootstrap
./scripts/casks
rust:
./scripts/update_rust_analyzer
./scripts/rust
cargos: rust
./scripts/rust
programs:
./scripts/setup_cheatsheet
./scripts/setup_ytfzf
python: brews
npm install -g pyright

105
README.md Normal file
View File

@ -0,0 +1,105 @@
This repository contains configuration files for my NixOS, macOS, and WSL
hosts.
They are organized and managed by [Nix](https://nixos.org), so some of the
configuration may be difficult to translate to a non-Nix system.
However, some of the configurations are easier to lift directly:
- [Neovim](https://github.com/nmasur/dotfiles/tree/master/modules/neovim/lua)
- [Fish functions](https://github.com/nmasur/dotfiles/tree/master/modules/shell/fish/functions)
- [More fish aliases](https://github.com/nmasur/dotfiles/blob/master/modules/shell/fish/default.nix)
- [Git aliases](https://github.com/nmasur/dotfiles/blob/master/modules/shell/git.nix)
- [Hammerspoon](https://github.com/nmasur/dotfiles/tree/master/modules/darwin/hammerspoon)
---
# Installation
## NixOS - From Live Disk
Format drives and build system from any NixOS host, including the live
installer disk:
**This will erase your drives; use at your own risk!**
```bash
lsblk # Choose the disk you want to wipe
nix-shell -p nixVersions.stable
nix run github:nmasur/dotfiles#installer -- nvme0n1 desktop
```
## NixOS - From Existing System
If you're already running NixOS, you can switch to this configuration with the
following command:
```bash
nix-shell -p nixVersions.stable
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#desktop
```
## Windows - From NixOS WSL
After [installing NixOS on
WSL](https://xeiaso.net/blog/nix-flakes-4-wsl-2022-05-01), you can switch to
the WSL configuration:
```
nix-shell -p nixVersions.stable
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#wsl
```
You should also download the
[FiraCode](https://github.com/ryanoasis/nerd-fonts/releases/download/v2.2.2/FiraCode.zip)
font and install it on Windows. Install [Alacritty](https://alacritty.org/) and
move the `windows/alacritty.yml` file to
`C:\Users\<user>\AppData\Roaming\alacritty`.
## macOS
To get started on a bare macOS installation, first install Nix:
```bash
sh -c "$(curl -L https://nixos.org/nix/install)"
```
Then use Nix to build nix-darwin:
```bash
nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
./result/bin/darwin-installer
```
Then switch to the macOS configuration:
```bash
darwin-rebuild switch --flake github:nmasur/dotfiles#macbook
```
### Dealing with corporate MITM SSL certificates:
```bash
# Get the certificates
openssl s_client -showcerts -verify 5 -connect cache.nixos.org:443 < /dev/null
# Paste them in here
sudo nvim $NIX_SSL_CERT_FILE
```
### Dealing with Neovim issues:
Update Neovim Packer plugins: `:PackerSync`
Update TreeSitter languages: `:TSUpdateSync`
---
# Flake Templates
You can also use the [templates](./templates/) as flakes for starting new
projects:
```bash
nix flake init --template github:nmasur/dotfiles#poetry
```

View File

@ -1,840 +0,0 @@
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
#env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
#TERM: alacritty
#TERM: xterm-256color
window:
# Window dimensions (changes require restart)
#
# Specified in number of columns/lines, not pixels.
# If both are `0`, this setting is ignored.
dimensions:
columns: 130
lines: 50
# Window position (changes require restart)
#
# Specified in number of pixels.
# If the position is not set, the window manager will handle the placement.
#position:
# x: 0
# y: 0
# Window padding (changes require restart)
#
# Blank space added around the window in pixels. This padding is scaled
# by DPI and the specified value is always added at both opposing sides.
padding:
x: 20
y: 20
# Spread additional padding evenly around the terminal content.
#dynamic_padding: false
# Window decorations
#
# Values for `decorations`:
# - full: Borders and title bar
# - none: Neither borders nor title bar
#
# Values for `decorations` (macOS only):
# - transparent: Title bar, transparent background and title bar buttons
# - buttonless: Title bar, transparent background, but no title bar buttons
decorations: full
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
startup_mode: SimpleFullscreen
# Window title
#title: Alacritty
# Window class (Linux/BSD only):
#class:
# Application instance name
#instance: Alacritty
# General application class
#general: Alacritty
# GTK theme variant (Linux/BSD only)
#
# Override the variant of the GTK theme. Commonly supported values are `dark` and `light`.
# Set this to `None` to use the default theme variant.
#gtk_theme_variant: None
scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
history: 10000
# Scrolling distance multiplier.
#multiplier: 3
# Font configuration
font:
# Normal (roman) font face
normal:
# Font family
#
# Default:
# - (macOS) Menlo
# - (Linux/BSD) monospace
# - (Windows) Consolas
#family: Fira Code
#family: Noto Sans Mono
# family: Fira Mono for Powerline
family: FiraMono Nerd Font
# The `style` can be specified to pick a specific face.
#style: Regular
# Bold font face
#bold:
# Font family
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Bold
# Italic font face
#italic:
# Font family
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Italic
# Bold italic font face
#bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Bold Italic
# Point size
size: 17.0
# Offset is the extra space around each character. `offset.y` can be thought of
# as modifying the line spacing, and `offset.x` as modifying the letter spacing.
#offset:
# x: 0
# y: 0
# Glyph offset determines the locations of the glyphs within their cells with
# the default being at the bottom. Increasing `x` moves the glyph to the right,
# increasing `y` moves the glyph upward.
#glyph_offset:
# x: 0
# y: 0
# Thin stroke font rendering (macOS only)
#
# Thin strokes are suitable for retina displays, but for non-retina screens
# it is recommended to set `use_thin_strokes` to `false`.
#use_thin_strokes: true
# If `true`, bold text is drawn using the bright color variants.
#draw_bold_text_with_bright_colors: false
# Colors (Tomorrow Night)
#colors:
# Default colors
#primary:
# background: '#1d1f21'
# foreground: '#c5c8c6'
# Bright and dim foreground colors
#
# The dimmed foreground color is calculated automatically if it is not present.
# If the bright foreground color is not set, or `draw_bold_text_with_bright_colors`
# is `false`, the normal foreground color will be used.
#dim_foreground: '#828482'
#bright_foreground: '#eaeaea'
# Cursor colors
#
# Colors which should be used to draw the terminal cursor.
#
# Allowed values are CellForeground and CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#cursor:
# text: CellBackground
# cursor: CellForeground
# Vi mode cursor colors
#
# Colors for the cursor when the vi mode is active.
#
# Allowed values are CellForeground and CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#vi_mode_cursor:
# text: CellBackground
# cursor: CellForeground
# Selection colors
#
# Colors which should be used to draw the selection area.
#
# Allowed values are CellForeground and CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#selection:
# text: CellBackground
# background: CellForeground
# Search colors
#
# Colors used for the search bar and match highlighting.
#
# Allowed values are CellForeground and CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#search:
# matches:
# foreground: '#000000'
# background: '#ffffff'
#
# bar:
# background: CellForeground
# foreground: CellBackground
# Normal colors
#normal:
# black: '#1d1f21'
# red: '#cc6666'
# green: '#b5bd68'
# yellow: '#f0c674'
# blue: '#81a2be'
# magenta: '#b294bb'
# cyan: '#8abeb7'
# white: '#c5c8c6'
# Bright colors
#bright:
# black: '#666666'
# red: '#d54e53'
# green: '#b9ca4a'
# yellow: '#e7c547'
# blue: '#7aa6da'
# magenta: '#c397d8'
# cyan: '#70c0b1'
# white: '#eaeaea'
# Dim colors
#
# If the dim colors are not set, they will be calculated automatically based
# on the `normal` colors.
#dim:
# black: '#131415'
# red: '#864343'
# green: '#777c44'
# yellow: '#9e824c'
# blue: '#556a7d'
# magenta: '#75617b'
# cyan: '#5b7d78'
# white: '#828482'
# Indexed Colors
#
# The indexed colors include all colors from 16 to 256.
# When these are not set, they're filled with sensible defaults.
#
# Example:
# `- { index: 16, color: '#ff00ff' }`
#
#indexed_colors: []
# Bell
#
# The bell is rung every time the BEL control character is received.
#bell:
# Visual Bell Animation
#
# Animation effect for flashing the screen when the visual bell is rung.
#
# Values for `animation`:
# - Ease
# - EaseOut
# - EaseOutSine
# - EaseOutQuad
# - EaseOutCubic
# - EaseOutQuart
# - EaseOutQuint
# - EaseOutExpo
# - EaseOutCirc
# - Linear
#animation: EaseOutExpo
# Duration of the visual bell flash. A `duration` of `0` will disable the
# visual bell animation.
#duration: 0
# Visual bell animation color.
#color: '#ffffff'
# Bell Command
#
# This program is executed whenever the bell is rung.
#
# When set to `command: None`, no command will be executed.
#
# Example:
# command:
# program: notify-send
# args: ["Hello, World!"]
#
#command: None
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
#background_opacity: 1.0
#selection:
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
# When set to `true`, selected text will be copied to the primary clipboard.
#save_to_clipboard: false
# Allow terminal applications to change Alacritty's window title.
#dynamic_title: true
#cursor:
# Cursor style
#
# Values for `style`:
# - ▇ Block
# - _ Underline
# - | Beam
#style: Block
# Vi mode cursor style
#
# If the vi mode cursor style is `None` or not specified, it will fall back to
# the style of the active value of the normal cursor.
#
# See `cursor.style` for available options.
#vi_mode_style: Block
# If this is `true`, the cursor will be rendered as a hollow box when the
# window is not focused.
#unfocused_hollow: true
# Thickness of the cursor relative to the cell width as floating point number
# from `0.0` to `1.0`.
#thickness: 0.15
# Live config reload (changes require restart)
#live_config_reload: true
# Shell
#
# You can set `shell.program` to the path of your favorite shell, e.g. `/bin/fish`.
# Entries in `shell.args` are passed unmodified as arguments to the shell.
#
# Default:
# - (macOS) /bin/bash --login
# - (Linux/BSD) user login shell
# - (Windows) powershell
shell:
program: /usr/local/bin/fish
args:
- --login
- --init-command
- tmux a -t noah || tmux new -s noah
# Startup directory
#
# Directory the shell is started in. If this is unset, or `None`, the working
# directory of the parent process will be used.
#working_directory: None
# WinPTY backend (Windows only)
#
# Alacritty defaults to using the newer ConPTY backend if it is available,
# since it resolves a lot of bugs and is quite a bit faster. If it is not
# available, the WinPTY backend will be used instead.
#
# Setting this option to `true` makes Alacritty use the legacy WinPTY backend,
# even if the ConPTY backend is available.
#winpty_backend: false
# Send ESC (\x1b) before characters when alt is pressed.
#alt_send_esc: true
#mouse:
# Click settings
#
# The `double_click` and `triple_click` settings control the time
# alacritty should wait for accepting multiple clicks as one double
# or triple click.
#double_click: { threshold: 300 }
#triple_click: { threshold: 300 }
# If this is `true`, the cursor is temporarily hidden when typing.
#hide_when_typing: false
#url:
# URL launcher
#
# This program is executed when clicking on a text which is recognized as a URL.
# The URL is always added to the command as the last parameter.
#
# When set to `launcher: None`, URL launching will be disabled completely.
#
# Default:
# - (macOS) open
# - (Linux/BSD) xdg-open
# - (Windows) explorer
#launcher:
# program: xdg-open
# args: []
# URL modifiers
#
# These are the modifiers that need to be held down for opening URLs when clicking
# on them. The available modifiers are documented in the key binding section.
#modifiers: None
# Mouse bindings
#
# Mouse bindings are specified as a list of objects, much like the key
# bindings further below.
#
# To trigger mouse bindings when an application running within Alacritty captures the mouse, the
# `Shift` modifier is automatically added as a requirement.
#
# Each mouse binding will specify a:
#
# - `mouse`:
#
# - Middle
# - Left
# - Right
# - Numeric identifier such as `5`
#
# - `action` (see key bindings)
#
# And optionally:
#
# - `mods` (see key bindings)
#mouse_bindings:
# - { mouse: Middle, action: PasteSelection }
# Key bindings
#
# Key bindings are specified as a list of objects. For example, this is the
# default paste binding:
#
# `- { key: V, mods: Control|Shift, action: Paste }`
#
# Each key binding will specify a:
#
# - `key`: Identifier of the key pressed
#
# - A-Z
# - F1-F24
# - Key0-Key9
#
# A full list with available key codes can be found here:
# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants
#
# Instead of using the name of the keys, the `key` field also supports using
# the scancode of the desired key. Scancodes have to be specified as a
# decimal number. This command will allow you to display the hex scancodes
# for certain keys:
#
# `showkey --scancodes`.
#
# Then exactly one of:
#
# - `chars`: Send a byte sequence to the running application
#
# The `chars` field writes the specified string to the terminal. This makes
# it possible to pass escape sequences. To find escape codes for bindings
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
# of tmux. Note that applications use terminfo to map escape sequences back
# to keys. It is therefore required to update the terminfo when changing an
# escape sequence.
#
# - `action`: Execute a predefined action
#
# - ToggleViMode
# - SearchForward
# - SearchBackward
# - Copy
# - Paste
# - PasteSelection
# - IncreaseFontSize
# - DecreaseFontSize
# - ResetFontSize
# - ScrollPageUp
# - ScrollPageDown
# - ScrollHalfPageUp
# - ScrollHalfPageDown
# - ScrollLineUp
# - ScrollLineDown
# - ScrollToTop
# - ScrollToBottom
# - ClearHistory
# - Hide
# - Minimize
# - Quit
# - ToggleFullscreen
# - SpawnNewInstance
# - ClearLogNotice
# - ClearSelection
# - ReceiveChar
# - None
#
# (`mode: Vi` only):
# - Open
# - Up
# - Down
# - Left
# - Right
# - First
# - Last
# - FirstOccupied
# - High
# - Middle
# - Low
# - SemanticLeft
# - SemanticRight
# - SemanticLeftEnd
# - SemanticRightEnd
# - WordRight
# - WordLeft
# - WordRightEnd
# - WordLeftEnd
# - Bracket
# - ToggleNormalSelection
# - ToggleLineSelection
# - ToggleBlockSelection
# - ToggleSemanticSelection
# - SearchNext
# - SearchPrevious
# - SearchStart
# - SearchEnd
#
# (macOS only):
# - ToggleSimpleFullscreen: Enters fullscreen without occupying another space
#
# (Linux/BSD only):
# - CopySelection: Copies into selection buffer
#
# - `command`: Fork and execute a specified command plus arguments
#
# The `command` field must be a map containing a `program` string and an
# `args` array of command line parameter strings. For example:
# `{ program: "alacritty", args: ["-e", "vttest"] }`
#
# And optionally:
#
# - `mods`: Key modifiers to filter binding actions
#
# - Command
# - Control
# - Option
# - Super
# - Shift
# - Alt
#
# Multiple `mods` can be combined using `|` like this:
# `mods: Control|Shift`.
# Whitespace and capitalization are relevant and must match the example.
#
# - `mode`: Indicate a binding for only specific terminal reported modes
#
# This is mainly used to send applications the correct escape sequences
# when in different modes.
#
# - AppCursor
# - AppKeypad
# - Alt
#
# A `~` operator can be used before a mode to apply the binding whenever
# the mode is *not* active, e.g. `~Alt`.
#
# Bindings are always filled by default, but will be replaced when a new
# binding with the same triggers is defined. To unset a default binding, it can
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
# a no-op if you do not wish to receive input characters for that binding.
#
# If the same trigger is assigned to multiple actions, all of them are executed
# in the order they were defined in.
key_bindings:
- { key: F, mods: Super, action: ToggleSimpleFullscreen }
# Reference for escape codes: https://www.gaijin.at/en/infos/ascii-ansi-character-table
- { key: L, mods : Super, chars: "\x1F" } # CMD-L sends null key for fish
- { key: H, mods : Super|Shift, chars: "\x02p" } # CMD-SHIFT-H previous tmux window
- { key: L, mods : Super|Shift, chars: "\x02n" } # CMD-SHIFT-L next tmux window
- { key: Return, mods : Shift, chars: "\x1b[13;2u" }
- { key: Return, mods : Control, chars: "\x1b[13;5u" }
- { key: Return, mods : Control|Shift, chars: "\x1b[13;6u" }
- { key: N, mods: Command, action: SpawnNewInstance }
- { key: PageUp, action: ScrollPageUp }
- { key: PageUp, mode: Alt, chars: "\x1B[5~" }
- { key: PageUp, mods: Shift, chars: "\x1B[5~" }
- { key: PageDown, action: ScrollPageDown }
- { key: PageDown, mode: Alt, chars: "\x1B[6~" }
- { key: PageDown, mods: Shift, chars: "\x1B[6~" }
- { key: Home, action: ScrollToTop }
- { key: Home, mode: Alt, chars: "\x1BOH" }
- { key: Home, mods: Shift, chars: "\x1B[H" }
- { key: End, action: ScrollToBottom }
- { key: End, mode: Alt, chars: "\x1BOF" }
- { key: End, mods: Shift, chars: "\x1B[F" }
- { key: Tab, mods: Alt, chars: "\x1B\t" }
- { key: Tab, mods: Alt|Shift, chars: "\x1B\x1B[Z" }
- { key: Back, chars: "\x7F" }
- { key: Back, mods: Alt, chars: "\x1B\x7F" }
- { key: Back, mods: Alt|Shift, chars: "\x1B\x08" }
- { key: Space, mods: Control, chars: "\x00" }
- { key: Space, mods: Alt, chars: "\x20" }
- { key: Left, mods: Alt, chars: "\x1Bb" }
- { key: Left, mods: Alt|Shift, chars: "\x1B\x1B[D" }
- { key: Right, mods: Alt, chars: "\x1Bf" }
- { key: Right, mods: Alt|Shift, chars: "\x1B\x1B[C" }
- { key: Down, mods: Alt, chars: "\x1B\x1B[B" }
- { key: Down, mods: Alt|Shift, chars: "\x1B\x1B[B" }
- { key: Up, mods: Alt, chars: "\x1B\x1B[A" }
- { key: Up, mods: Alt|Shift, chars: "\x1B\x1B[A" }
- { key: A, mods: Alt, chars: "\x1Ba" }
- { key: A, mods: Alt|Shift, chars: "\x1BA" }
- { key: B, mods: Alt, chars: "\x1Bb" }
- { key: B, mods: Alt|Shift, chars: "\x1BB" }
- { key: C, mods: Alt, chars: "\x1Bc" }
- { key: C, mods: Alt|Shift, chars: "\x1BC" }
- { key: D, mods: Alt, chars: "\x1Bd" }
- { key: D, mods: Alt|Shift, chars: "\x1BD" }
- { key: E, mods: Alt, chars: "\x1Be" }
- { key: E, mods: Alt|Shift, chars: "\x1BE" }
- { key: F, mods: Alt, chars: "\x1Bf" }
- { key: F, mods: Alt|Shift, chars: "\x1BF" }
- { key: G, mods: Alt, chars: "\x1Bg" }
- { key: G, mods: Alt|Shift, chars: "\x1BG" }
- { key: H, mods: Alt, chars: "\x1Bh" }
- { key: H, mods: Alt|Shift, chars: "\x1BH" }
- { key: I, mods: Alt, chars: "\x1Bi" }
- { key: I, mods: Alt|Shift, chars: "\x1BI" }
- { key: J, mods: Alt, chars: "\x1Bj" }
- { key: J, mods: Alt|Shift, chars: "\x1BJ" }
- { key: K, mods: Alt, chars: "\x1Bk" }
- { key: K, mods: Alt|Shift, chars: "\x1BK" }
- { key: L, mods: Alt, chars: "\x1Bl" }
- { key: L, mods: Alt|Shift, chars: "\x1BL" }
- { key: M, mods: Alt, chars: "\x1Bm" }
- { key: M, mods: Alt|Shift, chars: "\x1BM" }
- { key: N, mods: Alt, chars: "\x1Bn" }
- { key: N, mods: Alt|Shift, chars: "\x1BN" }
- { key: O, mods: Alt, chars: "\x1Bo" }
- { key: O, mods: Alt|Shift, chars: "\x1BO" }
- { key: P, mods: Alt, chars: "\x1Bp" }
- { key: P, mods: Alt|Shift, chars: "\x1BP" }
- { key: Q, mods: Alt, chars: "\x1Bq" }
- { key: Q, mods: Alt|Shift, chars: "\x1BQ" }
- { key: R, mods: Alt, chars: "\x1Br" }
- { key: R, mods: Alt|Shift, chars: "\x1BR" }
- { key: S, mods: Alt, chars: "\x1Bs" }
- { key: S, mods: Alt|Shift, chars: "\x1BS" }
- { key: T, mods: Alt, chars: "\x1Bt" }
- { key: T, mods: Alt|Shift, chars: "\x1BT" }
- { key: U, mods: Alt, chars: "\x1Bu" }
- { key: U, mods: Alt|Shift, chars: "\x1BU" }
- { key: V, mods: Alt, chars: "\x1Bv" }
- { key: V, mods: Alt|Shift, chars: "\x1BV" }
- { key: W, mods: Alt, chars: "\x1Bw" }
- { key: W, mods: Alt|Shift, chars: "\x1BW" }
- { key: X, mods: Alt, chars: "\x1Bx" }
- { key: X, mods: Alt|Shift, chars: "\x1BX" }
- { key: Y, mods: Alt, chars: "\x1By" }
- { key: Y, mods: Alt|Shift, chars: "\x1BY" }
- { key: Z, mods: Alt, chars: "\x1Bz" }
- { key: Z, mods: Alt|Shift, chars: "\x1BZ" }
- { key: Key1, mods: Alt, chars: "\x1B1" }
- { key: Key1, mods: Alt|Shift, chars: "\x1B!" }
- { key: Key2, mods: Alt, chars: "\x1B2" }
- { key: Key2, mods: Alt|Shift, chars: "\x1B#" }
- { key: Key3, mods: Alt, chars: "\x1B3" }
- { key: Key3, mods: Alt|Shift, chars: "\x1B#" }
- { key: Key4, mods: Alt, chars: "\x1B4" }
- { key: Key4, mods: Alt|Shift, chars: "\x1B$" }
- { key: Key5, mods: Alt, chars: "\x1B5" }
- { key: Key5, mods: Alt|Shift, chars: "\x1B%" }
- { key: Key6, mods: Alt, chars: "\x1B6" }
- { key: Key6, mods: Alt|Shift, chars: "\x1B^" }
- { key: Key7, mods: Alt, chars: "\x1B7" }
- { key: Key7, mods: Alt|Shift, chars: "\x1B&" }
- { key: Key8, mods: Alt, chars: "\x1B8" }
- { key: Key8, mods: Alt|Shift, chars: "\x1B*" }
- { key: Key9, mods: Alt, chars: "\x1B9" }
- { key: Key9, mods: Alt|Shift, chars: "\x1B(" }
- { key: Key0, mods: Alt, chars: "\x1B0" }
- { key: Key0, mods: Alt|Shift, chars: "\x1B)" }
- { key: Minus, mods: Alt, chars: "\x1B-" }
- { key: Minus, mods: Alt|Shift, chars: "\x1B_" }
- { key: Equals, mods: Alt, chars: "\x1B=" }
- { key: Equals, mods: Alt|Shift, chars: "\x1B+" }
- { key: LBracket, mods: Alt, chars: "\x1B[" }
- { key: LBracket, mods: Alt|Shift, chars: "\x1B{" }
- { key: RBracket, mods: Alt, chars: "\x1B]" }
- { key: RBracket, mods: Alt|Shift, chars: "\x1B}" }
- { key: Backslash, mods: Alt, chars: "\x1B\\" }
- { key: Backslash, mods: Alt|Shift, chars: "\x1B|" }
- { key: Semicolon, mods: Alt, chars: "\x1B;" }
- { key: Semicolon, mods: Alt|Shift, chars: "\x1B:" }
- { key: Apostrophe, mods: Alt, chars: "\x1B'" }
- { key: Apostrophe, mods: Alt|Shift, chars: "\x1B\"" }
- { key: Comma, mods: Alt, chars: "\x1B," }
- { key: Comma, mods: Alt|Shift, chars: "\x1B<" }
- { key: Period, mods: Alt, chars: "\x1B." }
- { key: Period, mods: Alt|Shift, chars: "\x1B>" }
- { key: Slash, mods: Alt, chars: "\x1B/" }
- { key: Slash, mods: Alt|Shift, chars: "\x1B?" }
- { key: Grave, mods: Alt, chars: "\x1B`" }
- { key: Grave, mods: Alt|Shift, chars: "\x1B~" }
# - { key: E, mods: Alt, chars: "\x1be" } # Send ALT-E for fish
#- { key: Paste, action: Paste }
#- { key: Copy, action: Copy }
#- { key: L, mods: Control, action: ClearLogNotice }
#- { key: L, mods: Control, mode: ~Vi, chars: "\x0c" }
#- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp, }
#- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown }
#- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop, }
#- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom }
# Vi Mode
#- { key: Space, mods: Shift|Control, mode: Vi, action: ScrollToBottom }
#- { key: Space, mods: Shift|Control, action: ToggleViMode }
#- { key: Escape, mode: Vi, action: ClearSelection }
#- { key: I, mode: Vi, action: ScrollToBottom }
#- { key: I, mode: Vi, action: ToggleViMode }
#- { key: Y, mods: Control, mode: Vi, action: ScrollLineUp }
#- { key: E, mods: Control, mode: Vi, action: ScrollLineDown }
#- { key: G, mode: Vi, action: ScrollToTop }
#- { key: G, mods: Shift, mode: Vi, action: ScrollToBottom }
#- { key: B, mods: Control, mode: Vi, action: ScrollPageUp }
#- { key: F, mods: Control, mode: Vi, action: ScrollPageDown }
#- { key: U, mods: Control, mode: Vi, action: ScrollHalfPageUp }
#- { key: D, mods: Control, mode: Vi, action: ScrollHalfPageDown }
#- { key: Y, mode: Vi, action: Copy }
#- { key: Y, mode: Vi, action: ClearSelection }
#- { key: Copy, mode: Vi, action: ClearSelection }
#- { key: V, mode: Vi, action: ToggleNormalSelection }
#- { key: V, mods: Shift, mode: Vi, action: ToggleLineSelection }
#- { key: V, mods: Control, mode: Vi, action: ToggleBlockSelection }
#- { key: V, mods: Alt, mode: Vi, action: ToggleSemanticSelection }
#- { key: Return, mode: Vi, action: Open }
#- { key: K, mode: Vi, action: Up }
#- { key: J, mode: Vi, action: Down }
#- { key: H, mode: Vi, action: Left }
#- { key: L, mode: Vi, action: Right }
#- { key: Up, mode: Vi, action: Up }
#- { key: Down, mode: Vi, action: Down }
#- { key: Left, mode: Vi, action: Left }
#- { key: Right, mode: Vi, action: Right }
#- { key: Key0, mode: Vi, action: First }
#- { key: Key4, mods: Shift, mode: Vi, action: Last }
#- { key: Key6, mods: Shift, mode: Vi, action: FirstOccupied }
#- { key: H, mods: Shift, mode: Vi, action: High }
#- { key: M, mods: Shift, mode: Vi, action: Middle }
#- { key: L, mods: Shift, mode: Vi, action: Low }
#- { key: B, mode: Vi, action: SemanticLeft }
#- { key: W, mode: Vi, action: SemanticRight }
#- { key: E, mode: Vi, action: SemanticRightEnd }
#- { key: B, mods: Shift, mode: Vi, action: WordLeft }
#- { key: W, mods: Shift, mode: Vi, action: WordRight }
#- { key: E, mods: Shift, mode: Vi, action: WordRightEnd }
#- { key: Key5, mods: Shift, mode: Vi, action: Bracket }
#- { key: Slash, mode: Vi, action: SearchForward }
#- { key: Slash, mods: Shift, mode: Vi, action: SearchBackward }
#- { key: N, mode: Vi, action: SearchNext }
#- { key: N, mods: Shift, mode: Vi, action: SearchPrevious }
# (Windows, Linux, and BSD only)
#- { key: V, mods: Control|Shift, action: Paste }
#- { key: C, mods: Control|Shift, action: Copy }
#- { key: F, mods: Control|Shift, action: SearchForward }
#- { key: B, mods: Control|Shift, action: SearchBackward }
#- { key: C, mods: Control|Shift, mode: Vi, action: ClearSelection }
#- { key: Insert, mods: Shift, action: PasteSelection }
#- { key: Key0, mods: Control, action: ResetFontSize }
#- { key: Equals, mods: Control, action: IncreaseFontSize }
#- { key: Add, mods: Control, action: IncreaseFontSize }
#- { key: Subtract, mods: Control, action: DecreaseFontSize }
#- { key: Minus, mods: Control, action: DecreaseFontSize }
# (Windows only)
#- { key: Return, mods: Alt, action: ToggleFullscreen }
# (macOS only)
#- { key: K, mods: Command, mode: ~Vi, chars: "\x0c" }
#- { key: Key0, mods: Command, action: ResetFontSize }
#- { key: Equals, mods: Command, action: IncreaseFontSize }
#- { key: Add, mods: Command, action: IncreaseFontSize }
#- { key: Minus, mods: Command, action: DecreaseFontSize }
#- { key: K, mods: Command, action: ClearHistory }
#- { key: V, mods: Command, action: Paste }
#- { key: C, mods: Command, action: Copy }
#- { key: C, mods: Command, mode: Vi, action: ClearSelection }
#- { key: H, mods: Command, action: Hide }
#- { key: M, mods: Command, action: Minimize }
#- { key: Q, mods: Command, action: Quit }
#- { key: W, mods: Command, action: Quit }
#- { key: N, mods: Command, action: SpawnNewInstance }
#- { key: F, mods: Command|Control, action: ToggleFullscreen }
#- { key: F, mods: Command, action: SearchForward }
#- { key: B, mods: Command, action: SearchBackward }
#debug:
# Display the time it takes to redraw each frame.
#render_timer: false
# Keep the log file after quitting Alacritty.
#persistent_logging: false
# Log level
#
# Values for `log_level`:
# - None
# - Error
# - Warn
# - Info
# - Debug
# - Trace
#log_level: Warn
# Print all received window events.
#print_events: false

23
apps/default.nix Normal file
View File

@ -0,0 +1,23 @@
{ pkgs, ... }: rec {
default = readme;
# Format and install from nothing
installer = import ./installer.nix { inherit pkgs; };
# Display the readme for this repository
readme = import ./readme.nix { inherit pkgs; };
# Load the SSH key for this machine
loadkey = import ./loadkey.nix { inherit pkgs; };
# Encrypt secret for all machines
encrypt-secret = import ./encrypt-secret.nix { inherit pkgs; };
# Re-encrypt secrets for all machines
reencrypt-secrets = import ./reencrypt-secrets.nix { inherit pkgs; };
# Connect machine metrics to Netdata Cloud
netdata = import ./netdata-cloud.nix { inherit pkgs; };
}

19
apps/encrypt-secret.nix Normal file
View File

@ -0,0 +1,19 @@
{ pkgs, ... }: {
# nix run github:nmasur/dotfiles#encrypt-secret > private/mysecret.age
type = "app";
program = builtins.toString (pkgs.writeShellScript "encrypt-secret" ''
printf "\nEnter the secret data to encrypt for all hosts...\n\n" 1>&2
read -p "Secret: " secret
printf "\nEncrypting...\n\n" 1>&2
tmpfile=$(mktemp)
echo "''${secret}" > ''${tmpfile}
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${
builtins.toString ../hosts/public-keys
} $tmpfile
rm $tmpfile
'');
}

48
apps/installer.nix Normal file
View File

@ -0,0 +1,48 @@
{ pkgs, ... }: {
# Inspired by https://github.com/cleverca22/nix-tests/blob/master/kexec/justdoit.nix
# This script will partition and format drives; use at your own risk!
type = "app";
program = builtins.toString (pkgs.writeShellScript "installer" ''
set -e
DISK=$1
FLAKE=$2
PARTITION_PREFIX=""
if [ -z "$DISK" ] || [ -z "$FLAKE" ]; then
${pkgs.gum}/bin/gum style --width 50 --margin "1 2" --padding "2 4" \
--foreground "#fb4934" \
"Missing required parameter." \
"Usage: installer -- <disk> <host>" \
"Example: installer -- nvme0n1 desktop" \
"Flake example: nix run github:nmasur/dotfiles#installer -- nvme0n1 desktop"
echo "(exiting)"
exit 1
fi
case "$DISK" in nvme*)
PARTITION_PREFIX="p"
esac
${pkgs.gum}/bin/gum confirm \
"This will ERASE ALL DATA on the disk /dev/''${DISK}. Are you sure you want to continue?" \
--default=false
${pkgs.parted}/bin/parted /dev/''${DISK} -- mklabel gpt
${pkgs.parted}/bin/parted /dev/''${DISK} -- mkpart primary 512MiB 100%
${pkgs.parted}/bin/parted /dev/''${DISK} -- mkpart ESP fat32 1MiB 512MiB
${pkgs.parted}/bin/parted /dev/''${DISK} -- set 3 esp on
mkfs.ext4 -L nixos /dev/''${DISK}''${PARTITION_PREFIX}1
mkfs.fat -F 32 -n boot /dev/''${DISK}''${PARTITION_PREFIX}2
mount /dev/disk/by-label/nixos /mnt
mkdir --parents /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot
${pkgs.nixos-install-tools}/bin/nixos-install --flake github:nmasur/dotfiles#''${FLAKE}
'');
}

12
apps/loadkey.nix Normal file
View File

@ -0,0 +1,12 @@
{ pkgs, ... }: {
type = "app";
program = builtins.toString (pkgs.writeShellScript "loadkey" ''
printf "\nEnter the seed phrase for your SSH key...\n"
printf "\nThen press ^D when complete.\n\n"
${pkgs.melt}/bin/melt restore ~/.ssh/id_ed25519
printf "\n\nContinuing activation.\n\n"
'');
}

19
apps/netdata-cloud.nix Normal file
View File

@ -0,0 +1,19 @@
{ pkgs, ... }: {
type = "app";
program = builtins.toString (pkgs.writeShellScript "netdata-cloud" ''
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit 1
fi
mkdir --parents --mode 0750 /var/lib/netdata/cloud.d
printf "\nEnter the claim token for netdata cloud...\n\n"
read -p "Token: " token
echo "''${token}" > /var/lib/netdata/cloud.d/token
chown -R netdata:netdata /var/lib/netdata
${pkgs.netdata}/bin/netdata-claim.sh -id=$(uuidgen)
printf "\n\nNow restart netdata service.\n\n"
'');
}

9
apps/readme.nix Normal file
View File

@ -0,0 +1,9 @@
{ pkgs, ... }: {
type = "app";
program = builtins.toString (pkgs.writeShellScript "readme" ''
${pkgs.glow}/bin/glow ${builtins.toString ../README.md}
'');
}

View File

@ -0,0 +1,27 @@
{ pkgs, ... }: {
# nix run github:nmasur/dotfiles#reencrypt-secrets ./private
type = "app";
program = builtins.toString (pkgs.writeShellScript "reencrypt-secrets" ''
if [ $# -eq 0 ]; then
echo "Must provide directory to reencrypt."
exit 1
fi
encrypted=$1
for encryptedfile in ''${1}/*; do
tmpfile=$(mktemp)
echo "Decrypting ''${encryptedfile}..."
${pkgs.age}/bin/age --decrypt \
--identity ~/.ssh/id_ed25519 $encryptedfile > $tmpfile
echo "Encrypting ''${encryptedfile}..."
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${
builtins.toString ../hosts/public-keys
} $tmpfile > $encryptedfile
rm $tmpfile
done
echo "Finished."
'');
}

View File

@ -1,15 +0,0 @@
#!/bin/sh
URL=$1
TITLE=$2
DESCRIPTION=$3
FEED=$4
printf "\n\n## [%s](%s)\n%s\nFrom %s: added on [%s](%s.md).\n\n---\n" \
"$TITLE" \
"$URL" \
"$DESCRIPTION" \
"$FEED" \
"$TODAY_NOTE" \
"$TODAY_NOTE" \
>>"$NOTES_PATH/bookmarks.md"

View File

@ -1,13 +0,0 @@
#!/usr/bin/env ruby
#
# Run a quick calculation with Ruby
#
# Usage: calc "1/2"
class Integer
def /(other)
fdiv(other)
end
end
puts eval(ARGV.join(""))

View File

@ -1,16 +0,0 @@
FROM alpine:latest
COPY requirements.txt /
RUN apk update && \
apk add \
openssh \
python \
py-pip \
&& \
pip install -r requirements.txt
COPY connect_cloud.sh /
COPY connect_cloud.py /
ENTRYPOINT ["/connect_cloud.sh"]

View File

@ -1,85 +0,0 @@
#!/usr/bin/env python
"""Connect to Cloud instances"""
import os
import sys
import argparse
import boto3
# Initiate the parser
parser = argparse.ArgumentParser("Type the name of the connection you want")
parser.add_argument('profile', metavar='P', nargs='?',
help='an account to use')
parser.add_argument('environment', metavar='E', nargs='?',
help='an environment to specify')
args = parser.parse_args()
# Get AWS credentials profile
profile_map = {
'gs' : {
'profile': 'ghoststory',
'prod': 'id_rsa_gstory_prod.pem',
'dev': 'id_rsa_gstory_prod.pem',
'username': 'centos',
},
'di' : {
'profile': 't2indies',
'prod': 'disintegration-prod.pem',
'dev': 'disintegration-dev.pem',
'username': 'centos',
},
'pd' : {
'profile': 't2indies',
'prod': 't2indies-prod.pem',
'dev': 't2indies-dev.pem',
'username': 'centos',
},
'corp' : {
'profile': 't2corp',
'prod': 'take2games-corp.pem',
'dev': 'take2games-corp.pem',
'username': 'ec2-user',
},
'ksp' : {
'profile': 'kerbal',
'prod': 'kerbal_prod_key.pem',
'dev': 'kerbal_dev_key.pem',
'username': 'centos',
},
}
profile_dict = profile_map.get(args.profile)
profile = profile_dict['profile']
# Connect to AWS
session = boto3.Session(profile_name=profile)
client = session.client('ec2', verify=False)
response = client.describe_instances()
print(len(response['Reservations']), "total instances\n")
matched_instances = []
for instance_wrapper in response['Reservations']:
instance = instance_wrapper['Instances'][0]
is_matched_env = False
is_matched_role = False
for tag in instance.get('Tags', []):
if tag['Key'] == "site_env" and args.environment in tag['Value']:
is_matched_env = True
if tag['Key'] == "role" and tag['Value'] == 'host':
is_matched_role = True
if tag['Key'] == "Name":
instance['Name'] = tag['Value']
if is_matched_env and is_matched_role:
matched_instances.append(instance)
for instance in matched_instances:
print(instance['Name'])
print(instance['PublicIpAddress'])
print("")
with open("aws_connect", 'w') as outfile:
outfile.write("ssh-keyscan {} >> ~/.ssh/known_hosts\n".format(matched_instances[0]['PublicIpAddress']))
outfile.write("ssh -i ~/.ssh/{} {}@{}".format(profile_dict[args.environment], profile_dict['username'], matched_instances[0]['PublicIpAddress']))
os.chmod("aws_connect", 0o755)

View File

@ -1,5 +0,0 @@
#!/bin/sh
python connect_cloud.py "$@"
/aws_connect

View File

@ -1,8 +0,0 @@
boto3==1.9.239
botocore==1.12.239
docutils==0.15.2
jmespath==0.9.4
python-dateutil==2.8.0
s3transfer==0.2.1
six==1.12.0
urllib3==1.26.5

View File

@ -1,37 +0,0 @@
#!/bin/sh
case $1 in
t2) organization="take-two" ;;
d2c) organization="take-two-t2gp" ;;
t2gp) organization="take-two-t2gp" ;;
pd) organization="private-division" ;;
dots) organization="playdots" ;;
*) organization="nmasur" ;;
esac
selected=$(gh repo list "$organization" \
--limit 50 \
--no-archived \
--json=name,description,isPrivate,updatedAt,primaryLanguage \
| jq -r '.[] | .name + "," + if .description == "" then "-" else .description |= gsub(","; " ") | .description end + "," + .updatedAt + "," + .primaryLanguage.name' \
| (echo "REPO,DESCRIPTION,UPDATED,LANGUAGE"; cat -) \
| column -s , -t \
| fzf \
--header-lines=1 \
--layout=reverse \
--bind "ctrl-o:execute:gh repo view -w ${organization}/{1}" \
--bind "shift-up:preview-half-page-up" \
--bind "shift-down:preview-half-page-down" \
--preview "GH_FORCE_TTY=49% gh repo view ${organization}/{1} | glow -" \
--preview-window up
)
[ -n "${selected}" ] && {
directory="$HOME/dev/work"
if [ $organization = "nmasur" ]; then directory="$HOME/dev/personal"; fi
repo=$(echo "${selected}" | awk '{print $1}')
repo_full="${organization}/${repo}"
if [ ! -d "${directory}/${repo}" ]; then
gh repo clone "$repo_full" "${directory}/${repo}"
fi
echo "${directory}/${repo}"
}

View File

@ -1,7 +0,0 @@
#!/bin/sh
kubectl -n kube-system get secret $(kubectl -n kube-system get secret | grep dashboard-admin | awk '{print $1}') -o json | jq -j --raw-output '.data.token' | base64 --decode | pbcopy
open http://localhost:8001/api/v1/namespaces/default/services/https:kubernetes-dashboard:https/proxy/#!/login
kubectl proxy

View File

@ -1,13 +0,0 @@
#!/bin/sh
nuke() {
local pid
pid=$(ps -ef | grep -v ^root | sed 1d | fzf -m | awk '{print $2}')
if [ "x$pid" != "x" ]
then
echo $pid | xargs kill -${1:-9}
fi
}
nuke

View File

@ -1,25 +0,0 @@
#!/usr/bin/env bash
# Credit: https://github.com/junegunn/fzf/blob/master/ADVANCED.md
# Requires bash.
# 1. Search for text in files using Ripgrep
# 2. Interactively narrow down the list using fzf
# 3. Open the file in Vim
IFS=: read -ra selected < <(
rg \
--color=always \
--line-number \
--no-heading \
--smart-case \
--iglob !/Library/** \
--iglob !/System/** \
--iglob "!Users/$HOME/Library/*" \
"${*:-}" |
fzf --ansi \
--color "hl:-1:underline,hl+:-1:underline:reverse" \
--delimiter : \
--preview 'bat --color=always {1} --highlight-line {2}' \
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3'
)
[ -n "${selected[0]}" ] && nvim "${selected[0]}" "+${selected[1]}"

View File

@ -1,4 +0,0 @@
#!/bin/sh
security find-generic-password -s 1Password -w | op signin enterprise_console --output=raw > $HOME/.op_tmux_token_tmp

View File

@ -1,5 +0,0 @@
#!/bin/sh
bucket="$1"
access="$2"
uplink ls ${access:+--access "$access"} "sj://$bucket/" | awk '{print $NF}' | xargs -I {} uplink rm ${access:+--access "$access"} "sj://$bucket/{}"

View File

@ -1,44 +0,0 @@
#!/usr/bin/env bash
set -eu
# Lists the current directory's files in Vim, so you can edit it and save to rename them
# USAGE: vimv [file1 file2]
# https://github.com/thameera/vimv
declare -r FILENAMES_FILE=$(mktemp "${TMPDIR:-/tmp}/vimv.XXX")
trap '{ rm -f "${FILENAMES_FILE}" ; }' EXIT
if [ $# -ne 0 ]; then
src=( "$@" )
else
IFS=$'\r\n' GLOBIGNORE='*' command eval 'src=($(ls))'
fi
for ((i=0;i<${#src[@]};++i)); do
echo "${src[i]}" >> "${FILENAMES_FILE}"
done
${EDITOR:-vi} "${FILENAMES_FILE}"
IFS=$'\r\n' GLOBIGNORE='*' command eval 'dest=($(cat "${FILENAMES_FILE}"))'
if (( ${#src[@]} != ${#dest[@]} )); then
echo "WARN: Number of files changed. Did you delete a line by accident? Aborting.." >&2
exit 1
fi
declare -i count=0
for ((i=0;i<${#src[@]};++i)); do
if [ "${src[i]}" != "${dest[i]}" ]; then
mkdir -p "$(dirname "${dest[i]}")"
if git ls-files --error-unmatch "${src[i]}" > /dev/null 2>&1; then
git mv "${src[i]}" "${dest[i]}"
else
mv "${src[i]}" "${dest[i]}"
fi
((++count))
fi
done
echo "$count" files renamed.

View File

@ -1,16 +0,0 @@
#!/bin/sh
CACHE_FILE="$HOME/.cache/weather_cache"
if [ "$1" = "clear" ]; then
rm -f "$CACHE_FILE"
fi
CACHE_TIME="$(stat -f %m "$CACHE_FILE" 2>/dev/null)"
NOW_TIME=$(date +%s)
TIME_PASSED=$((NOW_TIME-CACHE_TIME))
if [ "$TIME_PASSED" -gt "1200" ]
then
curl -m 2 -s "wttr.in/$WEATHER_CITY?format=%c%t" > "$CACHE_FILE"
fi
cat "$CACHE_FILE"

View File

@ -1,6 +0,0 @@
# Packages to install with Cargo
toml-cli # Parse TOML from the command line
rates # See exchange rates
wrangler # Cloudflare Workers CLI
csview # Quick display CSV as tables

View File

@ -1 +0,0 @@
+noall +answer

View File

@ -1,8 +0,0 @@
!.env*
!.github/
!.gitignore
!*.tfvars
.terraform/
.target/
/Library/
target

View File

@ -1,9 +0,0 @@
function __complete_nomad
set -lx COMP_LINE (commandline -cp)
test -z (commandline -ct)
and set COMP_LINE "$COMP_LINE "
/usr/local/bin/nomad
end
complete -f -c nomad -a "(__complete_nomad)"

View File

@ -1,44 +0,0 @@
#!/usr/local/bin/fish
if status --is-interactive
# Add directories to path
set PATH $PATH \
/usr/local/bin \
~/.local/bin \
$DOTS/bin \
~/.cargo/bin
# Use `vi` in the shell with cursor shapes
fish_vi_key_bindings
bind yy fish_clipboard_copy
bind Y fish_clipboard_copy
bind -M visual y fish_clipboard_copy
bind p fish_clipboard_paste
set -g fish_vi_force_cursor
set -g fish_cursor_default block
set -g fish_cursor_insert line
set -g fish_cursor_visual block
set -g fish_cursor_replace_one underscore
fish_vi_cursor
# Autojump
zoxide init fish | source
# Colors
if test -e $DOTS/fish.configlink/fish_colors
command cat $DOTS/fish.configlink/fish_colors
end
# Fuzzy finder
fzf_key_bindings
set -gx FZF_DEFAULT_COMMAND 'fd --type file'
set -g FZF_CTRL_T_COMMAND "$FZF_DEFAULT_COMMAND"
set -g FZF_DEFAULT_OPTS '-m --height 50% --border'
# Use `starship` prompt
starship init fish | source
# Hook into direnv
direnv hook fish | source
end

View File

@ -1 +0,0 @@
]4;1;rgb:cc/24/1d]4;2;rgb:98/97/1a]4;3;rgb:d7/99/21]4;4;rgb:45/85/88]4;5;rgb:b1/62/86]4;6;rgb:68/9d/6a]11;rgb:28/28/28]10;rgb:eb/db/b2]4;0;rgb:28/28/28]4;7;rgb:a8/99/84]4;8;rgb:92/83/74]4;9;rgb:fb/59/34]4;10;rgb:b8/bb/26]4;11;rgb:fa/bd/2f]4;12;rgb:83/a5/98]4;13;rgb:d3/86/9b]4;14;rgb:8e/c0/7c]4;15;rgb:eb/db/b2]4;236;rgb:32/30/2f]4;234;rgb:1d/20/21]4;235;rgb:28/28/28]4;237;rgb:3c/38/36]4;239;rgb:50/49/45]4;241;rgb:66/5c/54]4;243;rgb:7c/6f/64]4;244;rgb:92/83/74]4;245;rgb:92/83/74]4;228;rgb:f2/e5/bc]4;230;rgb:f9/f5/d7]4;229;rgb:fb/f1/c7]4;223;rgb:eb/db/b2]4;250;rgb:d5/c4/a1]4;248;rgb:bd/ae/93]4;246;rgb:a8/99/84]4;167;rgb:fb/49/34]4;142;rgb:b8/bb/26]4;214;rgb:fa/bd/2f]4;109;rgb:83/a5/98]4;175;rgb:d3/86/9b]4;108;rgb:8e/c0/7c]4;208;rgb:fe/80/19]4;88;rgb:9d/00/06]4;100;rgb:79/74/0e]4;136;rgb:b5/76/14]4;24;rgb:07/66/78]4;96;rgb:8f/3f/71]4;66;rgb:42/7b/58]4;130;rgb:af/3a/03

View File

@ -1,150 +0,0 @@
#!/usr/local/bin/fish
function abbrs --description 'All abbreviations'
# Directory aliases
abbr -a l ls
abbr -a lh 'ls -lh'
abbr -a ll 'ls -alhF'
abbr -a lf 'ls -lh | fzf'
abbr -a c cd
abbr -a -- - 'cd -'
abbr -a proj 'cd $PROJ'
abbr -a mkd 'mkdir -pv'
# Tmux
abbr -a ta 'tmux attach-session'
abbr -a tan 'tmux attach-session -t noah'
abbr -a tnn 'tmux new-session -s noah'
# Git
abbr -a g git
abbr -a gs 'git status'
abbr -a gd 'git diff'
abbr -a gds 'git diff --staged'
abbr -a gdp 'git diff HEAD^'
abbr -a ga 'git add'
abbr -a gaa 'git add -A'
abbr -a gac 'git commit -am'
abbr -a gc 'git commit -m'
abbr -a gca 'git commit --amend --no-edit'
abbr -a gu 'git pull'
abbr -a gp 'git push'
abbr -a gpp git-push-upstream
abbr -a gl 'git log --graph --decorate --oneline -20'
abbr -a gll 'git log --graph --decorate --oneline'
abbr -a gco 'git checkout'
abbr -a gcom 'git checkout master'
abbr -a gcob 'git checkout -b'
abbr -a gb 'git branch'
abbr -a gbd 'git branch -d'
abbr -a gbD 'git branch -D'
abbr -a gr 'git reset'
abbr -a grh 'git reset --hard'
abbr -a gm 'git merge'
abbr -a gcp 'git cherry-pick'
abbr -a cdg 'cd (git rev-parse --show-toplevel)'
# GitHub
abbr -a ghr 'gh repo view -w'
abbr -a gha 'gh run list | head -1 | awk \'{ print $(NF-2) }\' | xargs gh run view'
abbr -a grw 'noti gh run watch'
abbr -a grf 'gh run view --log-failed'
abbr -a grl 'gh run view --log'
abbr -a ghpr 'gh pr create && sleep 3 && noti gh run watch'
abbr -a ghm 'gh pr merge -s -d && git pull'
# Vim
if command -v nvim >/dev/null
alias --save vim='nvim'
abbr -a vimrc 'vim $HOME/.config/nvim/init.lua'
else
alias --save vim='vim'
abbr -a vimrc 'vim $HOME/.vimrc'
end
abbr -a v vim
abbr -a vl 'vim -c "normal! `0"'
abbr -a vll 'vim -c "Telescope oldfiles"'
abbr -a vh 'vim -c "Telescope oldfiles"'
# Notes
abbr -a qn quicknote
abbr -a sn syncnotes
abbr -a to today
abbr -a work 'vim $NOTES_PATH/work.md'
# RSS
abbr -a nb newsboat
# Improved CLI Tools
abbr -a cat bat # Swap cat with bat
abbr -a h 'http -Fh --all' # Curl site for headers
abbr -a j just
# Fun CLI Tools
abbr weather 'curl wttr.in/$WEATHER_CITY'
abbr moon 'curl wttr.in/Moon'
# Dotfile and config shortcuts
abbr -a s sudo
abbr -a boot '$DOTS/scripts/bootstrap'
abbr -a sshc 'vim ~/.ssh/config'
abbr -a hosts 'sudo nvim /etc/hosts'
abbr -a frc 'vim $HOME/.config/fish/config.fish'
abbr -a falias 'vim $HOME/.config/fish/functions/abbrs.fish'
# Cheat Sheets
abbr -a ssl 'openssl req -new -newkey rsa:2048 -nodes' \
'-keyout server.key -out server.csr'
abbr -a fingerprint 'ssh-keyscan myhost.com | ssh-keygen -lf -'
abbr -a publickey 'ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub'
abbr -a forloop 'for i in (seq 1 100)'
abbr -a gatekeeper 'sudo spctl --master-disable'
abbr -a flushdns 'sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder'
# Docker
abbr -a dc '$DOTS/bin/docker_cleanup'
abbr -a dr 'docker run --rm -it'
abbr -a db 'docker build . -t'
abbr -a ds 'docker ps -a'
abbr -a de 'docker exec -it'
abbr -a dpy 'docker run --rm -it -v $PWD:/project python:alpine python'
abbr -a alp 'docker run --rm -it -v $PWD:/project alpine sh'
# Terraform
abbr -a te terraform
abbr -a tap 'terraform apply'
# Kubernetes
abbr -a k kubectl
abbr -a pods 'kubectl get pods -A'
abbr -a nodes 'kubectl get nodes'
abbr -a deploys 'kubectl get deployments -A'
abbr -a dash kube-dashboard
abbr -a ks k9s
# Cloud
abbr -a awsc 'vim ~/.aws/credentials'
# Python
abbr -a py python
abbr -a po poetry
abbr -a pr 'poetry run python'
abbr -a pl 'poetry run pylint *'
abbr -a black 'poetry run black --target-version py38 .'
abbr -a bl 'poetry run black --target-version py38 .'
# Rust
abbr -a ca cargo
# macOS
abbr -a casks 'vim $DOTS/homebrew/Caskfile'
abbr -a t trash
# Linux
if [ (uname) = Linux ]
linux
end
end

View File

@ -1,10 +0,0 @@
function brews --description "Open Homebrew bundles file"
set -lx brewdir $DOTS/homebrew
set -l brewfile (basename $brewdir/*.Brewfile \
| fzf \
--height 70% \
--preview-window right:70% \
--preview 'bat --color=always $brewdir/{}' \
)
and vim $brewdir/$brewfile
end

View File

@ -1,9 +0,0 @@
function brewsearch --description "Install brew plugins"
set -l inst (brew formulae | eval "fzf $FZF_DEFAULT_OPTS -m --header='[press ctrl-i for info, enter to install]' --bind 'ctrl-i:preview(brew info {})'")
if not test (count $inst) = 0
for prog in $inst
brew install "$prog"
end
end
end

View File

@ -1,10 +0,0 @@
#!/usr/local/bin/fish
function commandline-git-commits
set commit (git-commits)
if [ $commit ]
commandline -i "$commit"
else
commandline -i "HEAD"
end
end

View File

@ -1,3 +0,0 @@
function copy --description 'Copy file contents into clipboard'
cat $argv | pbcopy
end

View File

@ -1,6 +0,0 @@
function edit --description "Open a file in Vim"
set vimfile (fzf)
and set vimfile (echo $vimfile | tr -d '\r')
and commandline -r "vim $vimfile"
and commandline -f execute
end

View File

@ -1,3 +0,0 @@
function envs --description 'Set from a bash environment variables file'
set -gx (cat $argv | tr "=" " " | string split ' ')
end

View File

@ -1,12 +0,0 @@
function fcd --description 'Jump to directory' -a 'directory'
if test -z $directory
set directory "$HOME"
end
if ! test -d $directory
echo "Directory not found: $directory"
return 1
end
set jump (fd -t d . $directory | fzf)
and cd $jump $argv;
and commandline -f execute;
end

View File

@ -1,17 +0,0 @@
#!/usr/local/bin/fish
function fish_user_key_bindings
bind -M insert \co 'edit'
bind -M default \co 'edit'
bind -M insert \ca 'cd ~; and edit; and commandline -a "; cd -"; commandline -f execute'
bind -M default \ca 'cd ~; and edit; and commandline -a "; cd -"; commandline -f execute'
bind -M insert \ce 'recent'
bind -M default \ce 'recent'
bind -M insert \cg 'commandline-git-commits'
bind -M insert \cf 'fcd'
bind -M default \cf 'fcd'
bind -M insert \cp 'prj'
bind -M default \cp 'prj'
bind -M insert \x1F accept-autosuggestion
bind -M default \x1F accept-autosuggestion
end

View File

@ -1 +0,0 @@
/usr/local/opt/fzf/shell/key-bindings.fish

View File

@ -1,8 +0,0 @@
# This function creates an output file of just the printf values for
# modifying the shell colors. This output file is used to load the
# current colors into my shell much faster than running the function on
# prompt.
function generate_fish_colors --description "Create fish colors file"
theme_gruvbox dark > $DOTS/fish.configlink/fish_colors
end

View File

@ -1,16 +0,0 @@
function git-add-fuzzy
set gitfile (git status -s \
| fzf \
--height 50% \
-m \
--preview-window right:70% \
--layout reverse \
--preview 'set -l IFS; set gd (git diff --color=always (echo {} | awk \'{$1=$1};1\' | cut -d" " -f2)); if test "$gd"; echo "$gd"; else; bat --color=always (echo {} | awk \'{$1=$1};1\' | cut -d" " -f2); end')
and for gf in $gitfile
set gf (echo $gf \
| awk '{$1=$1};1' \
| cut -d' ' -f2 \
)
and git add $gf
end
end

View File

@ -1,4 +0,0 @@
function git-checkout-fuzzy
set branch (git-fuzzy-branch "checkout branch...")
and git checkout $branch
end

View File

@ -1,10 +0,0 @@
function git-commits
set commitline (git log \
--pretty="format:%C(auto)%ar %h%d %s" \
| fzf \
--height 50% \
--preview 'git show --color=always (echo {} | cut -d" " -f4)' \
)
and set commit (echo $commitline | cut -d" " -f4)
and echo $commit
end

View File

@ -1,4 +0,0 @@
function git-delete-fuzzy
set branch (git-fuzzy-branch "delete branch...")
and git branch -d $branch
end

View File

@ -1,4 +0,0 @@
function git-force-delete-fuzzy
set branch (git-fuzzy-branch "force delete branch...")
and git branch -D $branch
end

View File

@ -1,12 +0,0 @@
function git-fuzzy-branch -a header
set -l current (git rev-parse --abbrev-ref HEAD | tr -d '\n')
set -l branch (git branch \
--format "%(refname:short)" \
| fzf \
--height 50% \
--header="On $current, $header" \
--preview-window right:70% \
--preview 'git log {} --color=always --pretty="format:%C(auto)%ar %h%d %s"' \
)
and echo $branch
end

View File

@ -1,16 +0,0 @@
function git-history
if not count $argv > /dev/null
echo "Must provide filename."
return 1
end
set commitline ( git log \
--follow \
--pretty="format:%C(auto)%ar %h%d %s" \
-- ./$argv \
| fzf \
--height 100% \
--preview "git diff --color=always (echo {} | cut -d' ' -f4)^1..(echo {} | cut -d' ' -f4) -- ./$argv" \
)
and set commit (echo $commitline | cut -d" " -f4)
and echo $commit
end

View File

@ -1,4 +0,0 @@
function git-merge-fuzzy
set branch (git-fuzzy-branch "merge from...")
and git merge $branch
end

View File

@ -1,6 +0,0 @@
function git-push-upstream --description "Create upstream branch"
set -l branch (git branch 2>/dev/null | grep '^\*' | colrm 1 2)
set -l command "git push --set-upstream origin $branch"
commandline -r $command
commandline -f execute
end

View File

@ -1,8 +0,0 @@
function git-show-fuzzy
set commitline (git log \
--pretty="format:%C(auto)%ar %h%d %s" \
| fzf \
)
and set commit (echo $commitline | cut -d" " -f4 )
and git show $commit
end

View File

@ -1,39 +0,0 @@
function git
if contains f $argv
switch $argv[1]
case "checkout"
git-checkout-fuzzy
case "add"
git-add-fuzzy
case "show"
git-show-fuzzy
case "merge"
git-merge-fuzzy
case "branch"
if test "$argv[2]" = "-d"
git-delete-fuzzy
else if test "$argv[2]" = "-D"
git-force-delete-fuzzy
else
echo "Not a fuzzy option."
return 1
end
case "reset"
set commit (git-commits)
and if test "$argv[2]" = "--hard"
git reset --hard $commit
else
git reset $commit
end
case "*"
echo "No fuzzy option."
return 1
end
else
if count $argv > /dev/null
command git $argv
else
command git status -sb
end
end
end

View File

@ -1,7 +0,0 @@
function ip
if count $argv > /dev/null
curl ipinfo.io/$argv
else
curl checkip.amazonaws.com
end
end

View File

@ -1,10 +0,0 @@
function journal --description "Create today's journal"
note-dates
if [ -f $TODAY_NOTE_FILE ]
echo "Already exists."
else
note-header
printf $JOURNAL_HEADER > $TODAY_NOTE_FILE
echo "New journal added."
end
end

View File

@ -1,3 +0,0 @@
function json --description "Tidy up JSON with jq"
pbpaste | jq '.' | pbcopy
end

View File

@ -1,4 +0,0 @@
function linux --description "Load only on Linux"
alias pbcopy='xclip -selection clipboard -in'
alias pbpaste='xclip -selection clipboard -out'
end

View File

@ -1,3 +0,0 @@
function ls --description "Use exa to list files"
exa $argv
end

View File

@ -1,11 +0,0 @@
function meeting --description "Describe a meeting" -a "name"
note-dates
set today_date (date -j +"%Y-%m-%d")
set time (date +"%I:%M%p" | tr '[:upper:]' '[:lower:]')
set meeting_name (echo $name | tr ' ' '-' | tr '[:upper:]' '[:lower:]')
set meeting_note $today_date-$meeting_name
set meeting_file meetings/$meeting_note.md
printf "[$TODAY_NOTE](../journal/$TODAY_NOTE.md) | #meeting\n\n# $name\n\n---\n\n" > $NOTES_PATH/$meeting_file
printf "\n\n---\n\n$time - [$name](../$meeting_file)\n\n---\n\n" >> $TODAY_NOTE_FILE
vim $NOTES_PATH/$meeting_file
end

View File

@ -1,7 +0,0 @@
function note-dates
set -g TODAY_NOTE (date +"%Y-%m-%d_%a")
set -g YESTERDAY_NOTE (date -jv "-1d" +"%Y-%m-%d_%a")
set -g TOMORROW_NOTE (date -jv "+1d" +"%Y-%m-%d_%a")
set -g LONG_DATE (date +"%A, %B %e, %Y" | sed 's/ */ /g')
set -g TODAY_NOTE_FILE $NOTES_PATH/journal/$TODAY_NOTE.md
end

View File

@ -1,4 +0,0 @@
function note-header
set -g CURRENT_WEATHER (curl -s "https://wttr.in/?format=1")
set -g JOURNAL_HEADER "[Yesterday]($YESTERDAY_NOTE.md) | [Home](../home.md) | [Today](obsidian://advanced-uri?daily=true) | [Tomorrow]($TOMORROW_NOTE.md)\n\n$LONG_DATE\n$CURRENT_WEATHER\n#journal\n\n---\n\n"
end

View File

@ -1,10 +0,0 @@
function note --description "Edit or create a note" -a "filename"
if test -n "$filename"
vim $NOTES_PATH/$filename.md
else
set file (ls $NOTES_PATH | fzf)
if [ $status -eq 0 ]
vim $NOTES_PATH/$file
end
end
end

View File

@ -1,3 +0,0 @@
function ping --description "Improved ping" -a "target"
prettyping --nolegend $target
end

View File

@ -1,5 +0,0 @@
function prj --description "cd to a project"
set projdir (ls $PROJ | fzf)
and cd $PROJ/$projdir
and commandline -f execute
end

View File

@ -1,3 +0,0 @@
function psf --description "Search for open process" -a "process"
ps aux | rg -v "$USER.*rg $argv" | rg $argv
end

View File

@ -1,3 +0,0 @@
function qr
qrencode $argv[1] -o /tmp/qr.png | open /tmp/qr.png
end

View File

@ -1,5 +0,0 @@
function quicknote --description "Write a quick note" -a "note"
note-dates
set time (date +"%I:%M%p" | tr '[:upper:]' '[:lower:]')
printf "\n\n---\n\n#### $time\n$note\n" >> $TODAY_NOTE_FILE
end

View File

@ -1,6 +0,0 @@
function recent --description "Open a recent file in Vim"
set vimfile (fd -t f --exec stat -f "%m%t%N" | sort -nr | cut -f2 | fzf)
and set vimfile (echo $vimfile | tr -d '\r')
and commandline -r "vim $vimfile"
and commandline -f execute
end

View File

@ -1,3 +0,0 @@
function reload --description "Reload fish configuration"
source $DOTS/fish.configlink/config.fish
end

View File

@ -1,42 +0,0 @@
#!/usr/local/bin/fish
function repos --description 'Clone GitHub repositories' -a 'organization'
set directory (gh-repos $organization)
and cd $directory
end
#switch $organization
# case t2; set organization "take-two"
# case d2c; set organization "take-two-t2gp"
# case t2gp; set organization "take-two-t2gp"
# case pd; set organization "private-division"
# case dots; set organization "playdots"
# case '*'; set organization "nmasur"
#end
#set selected (gh repo list "$organization" \
# --limit 50 \
# --no-archived \
# --json=name,description,isPrivate,updatedAt,primaryLanguage \
# | jq -r '.[] | .name + "," + if .description == "" then "-" else .description end + "," + .updatedAt + "," + .primaryLanguage.name' \
# | begin
# echo "REPO,DESCRIPTION,UPDATED,LANGUAGE"
# cat -
# end | column -s , -t
# | fzf \
# --header-lines=1 \
# --layout=reverse
#--bind "ctrl-o:execute:gh repo view -w $organization/{1}" \
#--preview "GH_FORCE_TTY=49% gh repo view $organization/{1} | glow -" \
#--preview-window up
#)
#if test -n (echo $selected | tr -d '\r')
# set directory "$HOME/dev/work"
# if test $organization = "nmasur"
# set directory "$HOME/dev/personal"
# end
# set repo (echo $selected | awk '{print $1}')
# set repo_full "$organization/$repo"
# gh repo clone "$repo_full" "$directory/$repo"
# cd "$directory/$repo"
#end
#end

View File

@ -1,9 +0,0 @@
function syncnotes --description "Full git commit on notes"
set current_dir $PWD
cd $NOTES_PATH
git pull
git add -A
git commit -m "autosync"
git push
cd $current_dir
end

View File

@ -1,141 +0,0 @@
#!/usr/bin/fish
function theme_gruvbox --description 'Apply gruvbox theme'
set -l mode 'light'
if test (count $argv) -gt 0
set mode $argv[1]
end
set -g contrast 'medium'
if test (count $argv) -gt 1
set contrast $argv[2]
end
switch $contrast
case 'soft'
case 'medium'
case 'hard'
case '*'
set_color $fish_color_error
echo 'Unknown contrast $contrast, choose soft, medium or hard'
set_color $fish_color_normal
return 1
end
switch $mode
case 'light'
__theme_gruvbox_base
__theme_gruvbox_light
case 'dark'
__theme_gruvbox_base
__theme_gruvbox_dark
case '*'
set_color $fish_color_error
echo 'Unknown mode $mode, choose light or dark'
set_color $fish_color_normal
return 1
end
__theme_gruvbox_palette
return 0
end
function __theme_gruvbox_base
__printf_color 1 'cc/24/1d'
__printf_color 2 '98/97/1a'
__printf_color 3 'd7/99/21'
__printf_color 4 '45/85/88'
__printf_color 5 'b1/62/86'
__printf_color 6 '68/9d/6a'
end
function __theme_gruvbox_light
set -l bg 'fb/f1/c7'
switch $contrast
case "soft"
set bg 'f2/e5/bc'
case "hard"
set bg 'f9/f5/d7'
end
command printf "\033]11;rgb:$bg\007"
set -l fg '3c/38/36'
command printf "\033]10;rgb:$fg\007"
__printf_color 0 $bg
__printf_color 7 '7c/6f/64'
__printf_color 8 '92/83/74'
__printf_color 9 '9d/00/06'
__printf_color 10 '79/74/0e'
__printf_color 11 'b5/76/14'
__printf_color 12 '07/66/78'
__printf_color 13 '8f/3f/71'
__printf_color 14 '42/7b/58'
__printf_color 15 $fg
end
function __theme_gruvbox_dark
set -l bg '28/28/28'
switch $contrast
case "soft"
set bg '32/30/2f'
case "hard"
set bg '1d/20/21'
end
command printf "\033]11;rgb:$bg\007"
set -l fg 'eb/db/b2'
command printf "\033]10;rgb:$fg\007"
__printf_color 0 $bg
__printf_color 7 'a8/99/84'
__printf_color 8 '92/83/74'
__printf_color 9 'fb/59/34'
__printf_color 10 'b8/bb/26'
__printf_color 11 'fa/bd/2f'
__printf_color 12 '83/a5/98'
__printf_color 13 'd3/86/9b'
__printf_color 14 '8e/c0/7c'
__printf_color 15 $fg
end
function __theme_gruvbox_palette
__printf_color 236 '32/30/2f'
__printf_color 234 '1d/20/21'
__printf_color 235 '28/28/28'
__printf_color 237 '3c/38/36'
__printf_color 239 '50/49/45'
__printf_color 241 '66/5c/54'
__printf_color 243 '7c/6f/64'
__printf_color 244 '92/83/74'
__printf_color 245 '92/83/74'
__printf_color 228 'f2/e5/bc'
__printf_color 230 'f9/f5/d7'
__printf_color 229 'fb/f1/c7'
__printf_color 223 'eb/db/b2'
__printf_color 250 'd5/c4/a1'
__printf_color 248 'bd/ae/93'
__printf_color 246 'a8/99/84'
__printf_color 167 'fb/49/34'
__printf_color 142 'b8/bb/26'
__printf_color 214 'fa/bd/2f'
__printf_color 109 '83/a5/98'
__printf_color 175 'd3/86/9b'
__printf_color 108 '8e/c0/7c'
__printf_color 208 'fe/80/19'
__printf_color 88 '9d/00/06'
__printf_color 100 '79/74/0e'
__printf_color 136 'b5/76/14'
__printf_color 24 '07/66/78'
__printf_color 96 '8f/3f/71'
__printf_color 66 '42/7b/58'
__printf_color 130 'af/3a/03'
end
function __printf_color
command printf "\033]4;$argv[1];rgb:$argv[2]\007"
end

View File

@ -1,11 +0,0 @@
#!/usr/local/bin/fish
function tickers --description "Stock and money tickers"
abbr -a tk 'tickrs -s'
abbr -a vt 'tickrs -s vt'
abbr -a vti 'tickrs -s vti'
abbr -a vxus 'tickrs -s vxus'
abbr -a btc 'rates btc usd'
abbr -a ada 'rates ada usd'
abbr -a eth 'rates eth usd'
end

View File

@ -1,11 +0,0 @@
function today --description "Open today's journal"
note-dates
if [ -f $TODAY_NOTE_FILE ]
vim $TODAY_NOTE_FILE
else
note-header
printf $JOURNAL_HEADER > $TODAY_NOTE_FILE
echo "New journal added."
vim $TODAY_NOTE_FILE
end
end

View File

@ -1,16 +0,0 @@
#!/usr/local/bin/fish
function uncommitted --description "Find uncommitted git repos"
set current_dir (pwd)
cd $HOME/dev
find . -type d -name '.git' | \
while read dir
cd $dir/../
and if test -n (echo (git status -s))
pwd
git status -s
end
cd -
end
cd $current_dir
end

View File

@ -1,6 +0,0 @@
#!/usr/bin/local/fish
function unsetaws --description "Clear AWS credentials environment variables"
set -e AWS_ACCESS_KEY_ID
set -e AWS_SECRET_ACCESS_KEY
end

View File

@ -1,29 +0,0 @@
# by @farcaller from https://github.com/fish-shell/fish-shell/issues/825#issuecomment-440286038
function up-or-search -d "Depending on cursor position and current mode, either search backward or move up one line"
# If we are already in search mode, continue
if commandline --search-mode
commandline -f history-search-backward
return
end
# If we are navigating the pager, then up always navigates
if commandline --paging-mode
commandline -f up-line
return
end
# We are not already in search mode.
# If we are on the top line, start search mode,
# otherwise move up
set lineno (commandline -L)
switch $lineno
case 1
commandline -f history-search-backward
history merge # <-- ADDED THIS
case '*'
commandline -f up-line
end
end

View File

@ -1,3 +0,0 @@
function worldmap --description "Terminal atlas"
telnet mapscii.me
end

224
flake.lock generated Normal file
View File

@ -0,0 +1,224 @@
{
"nodes": {
"darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1666776005,
"narHash": "sha256-HwSMF19PpczfqNHKcFsA6cF4PVbG00uUSdbq6q3jB5o=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "f6648ca0698d1611d7eadfa72b122252b833f86c",
"type": "github"
},
"original": {
"owner": "lnl7",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1666903647,
"narHash": "sha256-sFI1Gh9DTGzHnBINondupUGYbe+T0wZcpcZjkW0qffM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "213a06295dff96668a1d673b9fd1c03ce1de6745",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "home-manager",
"type": "github"
}
},
"nixlib": {
"locked": {
"lastModified": 1636849918,
"narHash": "sha256-nzUK6dPcTmNVrgTAC1EOybSMsrcx+QrVPyqRdyKLkjA=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "28a5b0557f14124608db68d3ee1f77e9329e9dd5",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixos-generators": {
"inputs": {
"nixlib": "nixlib",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1666812839,
"narHash": "sha256-0nBDgjPU+iDsvz89W+cDEyhnFGSwCJmwDl/gMGqYiU0=",
"owner": "nix-community",
"repo": "nixos-generators",
"rev": "41f3518bc194389df22a3d198215eae75e6b5ab9",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-generators",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1666959691,
"narHash": "sha256-TRpWA3t8ata79HOGtFd5dDCl1kJQmIE16PDF53/Hcxo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "448a599c49978c2794401bfc3a2e1fba1a8663be",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1660318005,
"narHash": "sha256-g9WCa9lVUmOV6dYRbEPjv/TLOR5hamjeCcKExVGS3OQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5c211b47aeadcc178c5320afd4e74c7eed5c389f",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-22.05",
"type": "indirect"
}
},
"nur": {
"locked": {
"lastModified": 1667025500,
"narHash": "sha256-88akaieCIrqta3Uyha7Zv3FJWzKJebb2BrOdZba1zdI=",
"owner": "nix-community",
"repo": "nur",
"rev": "21dd192519af12a01f1348bbfa86cde47f7aa392",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nur",
"type": "github"
}
},
"root": {
"inputs": {
"darwin": "darwin",
"home-manager": "home-manager",
"nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs",
"nur": "nur",
"wallpapers": "wallpapers",
"wsl": "wsl"
}
},
"utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"wallpapers": {
"flake": false,
"locked": {
"lastModified": 1657544922,
"narHash": "sha256-1c1uDz37MhksWC75myv6jao5q2mIzD8X8I+TykXXmWg=",
"owner": "exorcist365",
"repo": "wallpapers",
"rev": "8d2860ac6c05cec0f78d5c9d07510f4ff5da90dc",
"type": "gitlab"
},
"original": {
"owner": "exorcist365",
"repo": "wallpapers",
"type": "gitlab"
}
},
"wsl": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1666720338,
"narHash": "sha256-7V91ZtTz7zDXb6hivktQ9RlBglP+WEkYFSciPJHwMJw=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "7bfb8f5aa91fee30a189eae32cda8ddc465076df",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NixOS-WSL",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

147
flake.nix Normal file
View File

@ -0,0 +1,147 @@
{
description = "My system";
# Other flakes that we want to pull from
inputs = {
# Used for system packages
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Used for MacOS system config
darwin = {
url = "github:/lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
# Used for Windows Subsystem for Linux compatibility
wsl.url = "github:nix-community/NixOS-WSL";
# Used for user packages
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows =
"nixpkgs"; # Use system packages list where available
};
# Community packages; used for Firefox extensions
nur.url = "github:nix-community/nur";
# Wallpapers
wallpapers = {
url = "gitlab:exorcist365/wallpapers";
flake = false;
};
# Used to generate NixOS images for other platforms
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, ... }@inputs:
let
# Global configuration for my systems
globals = rec {
user = "noah";
fullName = "Noah Masur";
gitName = fullName;
gitEmail = "7386960+nmasur@users.noreply.github.com";
mailServer = "noahmasur.com";
dotfilesRepo = "git@github.com:nmasur/dotfiles";
};
# System types to support.
supportedSystems =
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in rec {
nixosConfigurations = {
desktop = import ./hosts/desktop { inherit inputs globals; };
wsl = import ./hosts/wsl { inherit inputs globals; };
oracle = import ./hosts/oracle { inherit inputs globals; };
};
darwinConfigurations = {
macbook = import ./hosts/macbook { inherit inputs globals; };
};
# For quickly applying local settings with:
# home-manager switch --flake .#desktop
homeConfigurations = {
desktop =
nixosConfigurations.desktop.config.home-manager.users.${globals.user}.home;
macbook =
darwinConfigurations.macbook.config.home-manager.users."Noah.Masur".home;
};
# Package servers into images with a generator
packages.x86_64-linux = with inputs; {
aws = import ./hosts/aws {
inherit inputs globals;
system = "x86_64-linux";
};
};
apps = forAllSystems (system:
let pkgs = import nixpkgs { inherit system; };
in import ./apps { inherit pkgs; });
devShells = forAllSystems (system:
let pkgs = import nixpkgs { inherit system; };
in {
# Used to run commands and edit files in this repo
default = pkgs.mkShell {
buildInputs = with pkgs; [ git stylua nixfmt shfmt shellcheck ];
};
# Used for cloud and systems development and administration
devops = pkgs.mkShell {
buildInputs = with pkgs; [
git
terraform
consul
vault
awscli2
google-cloud-sdk
ansible
kubectl
kubernetes-helm
kustomize
fluxcd
];
};
});
# Templates for starting other projects quickly
templates = rec {
default = basic;
basic = {
path = ./templates/basic;
description = "Basic program template";
};
poetry = {
path = ./templates/poetry;
description = "Poetry template";
};
python = {
path = ./templates/python;
description = "Legacy Python template";
};
haskell = {
path = ./templates/haskell;
description = "Haskell template";
};
};
};
}

View File

@ -1,18 +0,0 @@
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
name = Noah Masur
email = 7386960+nmasur@users.noreply.github.com
[hub]
host = github.take2games.com
[pager]
branch = false
[core]
editor = nvim
[pull]
ff = only
[credential]
helper = osxkeychain

View File

@ -1,120 +0,0 @@
--- === ControlEscape ===
---
--- Adapted very loosely from https://github.com/jasonrudolph/ControlEscape.spoon
--- Removed timing/delay; always send Escape as well as Control
---
--- Make the `control` key more useful: If the `control` key is tapped, treat it
--- as the `escape` key. If the `control` key is held down and used in
--- combination with another key, then provide the normal `control` key
--- behavior.
local obj={}
obj.__index = obj
-- Metadata
obj.name = 'ControlEscape'
obj.version = '0.1'
obj.author = 'Jason Rudolph <jason@jasonrudolph.com>'
obj.homepage = 'https://github.com/jasonrudolph/ControlEscape.spoon'
obj.license = 'MIT - https://opensource.org/licenses/MIT'
function obj:init()
self.movements = 0
self.sendEscape = false
self.lastModifiers = {}
-- Create an eventtap to run each time the modifier keys change (i.e., each
-- time a key like control, shift, option, or command is pressed or released)
self.controlTap = hs.eventtap.new({hs.eventtap.event.types.flagsChanged},
function(event)
local newModifiers = event:getFlags()
-- If this change to the modifier keys does not involve a *change* to the
-- up/down state of the `control` key (i.e., it was up before and it's
-- still up, or it was down before and it's still down), then don't take
-- any action.
if self.lastModifiers['ctrl'] == newModifiers['ctrl'] then
return false
end
-- Control was not down but is now
if not self.lastModifiers['ctrl'] then
-- Only prepare to send escape if no other modifier keys are in use
self.lastModifiers = newModifiers
if (not self.lastModifiers['cmd'] and not self.lastModifiers['alt']) then
self.sendEscape = true
self.movements = 0
end
-- Control was down and is up, hasn't been blocked by another key, and
-- isn't above the movement threshold
elseif (self.sendEscape == true and not newModifiers['ctrl'] and self.movements < 30) then
self.lastModifiers = newModifiers
-- Allow for shift-escape
if newModifiers['shift'] then
hs.eventtap.keyStroke({'shift'}, 'escape', 0)
else
hs.eventtap.keyStroke(newModifiers, 'escape', 0)
end
self.sendEscape = false
self.movements = 0
self.numberOfCharacters = 0
-- Control was down and is up, but isn't ready to send escape
else
self.lastModifiers = newModifiers
end
end
)
-- If any other key is pressed, don't send escape
self.asModifier = hs.eventtap.new({hs.eventtap.event.types.keyDown},
function(event)
self.sendEscape = false
end
)
-- If mouse is moving significantly, don't send escape
self.scrolling = hs.eventtap.new({hs.eventtap.event.types.gesture},
function(event)
local touches = event:getTouches()
local i, v = next(touches, nil)
while i do
if v["phase"] == "moved" then
-- Increment the movement counter
self.movements = self.movements + 1
end
i, v = next(touches, i) -- get next index
end
end
)
end
--- ControlEscape:start()
--- Method
--- Start sending `escape` when `control` is pressed and released in isolation
function obj:start()
self.controlTap:start()
self.asModifier:start()
self.scrolling:start()
end
--- ControlEscape:stop()
--- Method
--- Stop sending `escape` when `control` is pressed and released in isolation
function obj:stop()
-- Stop monitoring keystrokes
self.controlTap:stop()
self.asModifier:stop()
self.scrolling:stop()
-- Reset state
self.sendEscape = false
self.lastModifiers = {}
end
return obj

View File

@ -1,77 +0,0 @@
--- === Launcher ===
local obj = {}
obj.__index = obj
-- Metadata
obj.name = "Launcher"
obj.version = "0.1"
obj.license = "MIT - https://opensource.org/licenses/MIT"
function obj:init()
-- Begin launcher mode
self.launcher = hs.hotkey.modal.new("ctrl", "space")
-- Behaviors on enter
function self.launcher:entered()
-- hs.alert'Entered mode'
end
-- Behaviors on exit
function self.launcher:exited()
-- hs.alert'Exited mode'
end
-- Use escape to exit launcher mode
self.launcher:bind("", "escape", function()
self.launcher:exit()
end)
-- Launcher shortcuts
self.launcher:bind("", "space", function()
hs.hints.windowHints()
self.launcher:exit()
end)
self.launcher:bind("", "return", function()
self:switch("Alacritty.app")
end)
self.launcher:bind("", "C", function()
self:switch("Calendar.app")
end)
self.launcher:bind("", "D", function()
self:switch("Discord.app")
end)
self.launcher:bind("", "E", function()
self:switch("Mail.app")
end)
self.launcher:bind("", "F", function()
self:switch("Firefox.app")
end)
self.launcher:bind("", "G", function()
self:switch("Mimestream.app")
end)
self.launcher:bind("", "M", function()
self:switch("Messages.app")
end)
self.launcher:bind("", "O", function()
self:switch("Obsidian.app")
end)
self.launcher:bind("", "P", function()
self:switch("System Preferences.app")
end)
self.launcher:bind("", "R", function()
hs.reload()
end)
self.launcher:bind("", "S", function()
self:switch("Slack.app")
end)
self.launcher:bind("", "Z", function()
self:switch("zoom.us.app")
end)
end
function obj:switch(app)
hs.application.launchOrFocus(app)
self.launcher:exit()
end
return obj

View File

@ -1,2 +0,0 @@
hs.loadSpoon('ControlEscape'):start() -- Load Hammerspoon bits from https://github.com/jasonrudolph/ControlEscape.spoon
hs.loadSpoon('Launcher'):init()

View File

@ -1,38 +0,0 @@
tap "homebrew/cask"
# Core Applications
cask "alacritty" # Terminal
cask "firefox" # Browser
#cask "slack" # Chat
#cask "zoomus" # Video conference
cask "1password" # Passwords
cask "dropbox" # File sync
#cask "docker" # Containers
# Helpful Applications
cask "obsidian" # Notes
# Auxiliary Tools
cask "scroll-reverser" # Mouse vs. trackpad
cask "meetingbar" # Scheduling
cask "gitify" # GitHub notifications
# cask "basictex" # Small LaTeX distribution
cask "hammerspoon"
tap "homebrew/cask-drivers"
cask "logitech-g-hub" # Hardware drivers
# Fonts
tap "homebrew/cask-fonts"
cask "font-fira-mono-nerd-font"
# Personal
cask "keybase" # Encryption
cask "discord" # Chat
#cask "steam" # Games
#cask "epic-games" # Games
#cask "calibre" # E-Books
#cask "signal" # Messaging
# Maybe
#cask "jira-client" # Project Management

View File

@ -1,17 +0,0 @@
# Core Packages
brew "fish" # Shell
brew "neovim" # Editor
brew "tmux" # Terminal panes and windows
brew "starship" # Shell prompt
brew "git" # Latest git
brew "ripgrep" # Faster, better grep
brew "fd" # Faster, better find
brew "sd" # Faster, better sed
brew "zoxide" # Faster, better autojump
brew "exa" # Better ls
brew "bat" # Better cat
brew "fzf" # Fuzzy finder
brew "tealdeer" # Mini man page
brew "direnv" # Environment variables
brew "glow" # Markdown previews

View File

@ -1,14 +0,0 @@
# DevOps Packages
tap "nmasur/repo"
tap "hashicorp/tap"
brew "ansible" # Deploy to local server
brew "terraform" # Deploy cloud infra
brew "packer" # Build deployment images
brew "awscli" # AWS API tools
brew "kubectl" # Kubernetes CLI
brew "k9s" # Kubernetes TUI
brew "nmasur/repo/drips" # Retrieve AWS IPs
brew "hashicorp/tap/terraform-ls"
brew "tflint"

View File

@ -1,8 +0,0 @@
# Fun / Unnecessary Packages
#tap "nmasur/repo"
#tap "tarkah/tickrs"
#brew "ffmpeg" # Convert videos
#brew "nmasur/repo/bee" # Cheat on NYTimes Spelling Bee
#brew "tarkah/tickrs/tickrs" # Interactive stock tickers

View File

@ -1,17 +0,0 @@
# Still Learning Tools
tap "superfly/tap"
tap "nmasur/repo"
tap "cjbassi/ytop"
#brew "superfly/tap/flyctl" # Fly.io CLI
#brew "ghc" # Haskell
#brew "xsv" # CSV manipulation
#brew "gron" # JSON grep
#brew "nushell" # Data manipulation shell
#brew "tectonic" # Minimal LaTeX compiler
brew "noti" # Create system notifications
#brew "b2-tools" # BackBlaze B2 storage
#brew "cjbassi/ytop/ytop" # Fancy system performance
#brew "nmasur/repo/update-ssh-config" # Update .ssh/config
brew "awslogs" # View AWS log streams

View File

@ -1,10 +0,0 @@
# Programming Packages
brew "shellcheck" # Lint for bash
brew "shfmt" # Formatter for bash
brew "stylua" # Formatter for lua
brew "python" # Latest version of Python
brew "ipython" # Better interactive Python shell
brew "poetry" # Project-based Python dependencies
brew "ruby" # Newer than default ruby
brew "node" # NodeJS

View File

@ -1,20 +0,0 @@
# Utility Packages
tap "saulpw/vd"
brew "jq" # JSON manipulation
brew "dos2unix" # File conversion
brew "tree" # Display directory trees
brew "trash" # Delete to trash
brew "wget" # Not quite curl
brew "telnet" # Check networking
brew "prettyping" # Better ping
brew "httpie" # Better curl
brew "gpg" # Encryption
brew "qrencode" # Make a QR code
brew "mpv" # Video player
brew "youtube-dl" # Download YouTube videos
brew "gh" # GitHub commands
brew "pandoc" # Document converter
brew "saulpw/vd/visidata" # Spreadsheet manipulation
brew "mdp" # Terminal slideshows

32
hosts/aws/default.nix Normal file
View File

@ -0,0 +1,32 @@
{ inputs, globals, ... }:
with inputs;
nixos-generators.nixosGenerate {
inherit system;
format = "amazon";
modules = [
home-manager.nixosModules.home-manager
{
user = globals.user;
fullName = globals.fullName;
dotfilesRepo = globals.dotfilesRepo;
gitName = globals.gitName;
gitEmail = globals.gitEmail;
networking.hostName = "sheep";
gui.enable = false;
colorscheme = (import ../modules/colorscheme/gruvbox);
passwordHash = null;
publicKey =
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
# AWS settings require this
permitRootLogin = "prohibit-password";
}
../../hosts/common.nix
../../modules/nixos
../../modules/services/sshd.nix
] ++ [
# Required to fix diskSize errors during build
({ ... }: { amazonImage.sizeMB = 16 * 1024; })
];
}

80
hosts/aws/main.tf Normal file
View File

@ -0,0 +1,80 @@
locals {
image_file = one(fileset(path.root, "result/nixos-amazon-image-*.vhd"))
}
# Upload to S3
resource "aws_s3_object" "image" {
bucket = "your_bucket_name"
key = basename(local.image_file)
source = local.image_file
etag = filemd5(local.image_file)
}
# Setup IAM access for the VM Importer
data "aws_iam_policy_document" "vmimport_trust_policy" {
statement {
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = ["vmie.amazonaws.com"]
}
}
}
data "aws_iam_policy_document" "vmimport" {
statement {
actions = [
"s3:GetBucketLocation",
"s3:GetObject",
"s3:ListBucket",
]
resources = [
"arn:aws:s3:::${aws_s3_object.image.bucket}",
"arn:aws:s3:::${aws_s3_object.image.bucket}/*",
]
}
statement {
actions = [
"ec2:ModifySnapshotAttribute",
"ec2:CopySnapshot",
"ec2:RegisterImage",
"ec2:Describe*",
]
resources = ["*"]
}
}
resource "aws_iam_role" "vmimport" {
name = "vmimport"
assume_role_policy = data.aws_iam_policy_document.vmimport_trust_policy.json
inline_policy {
name = "vmimport"
policy = data.aws_iam_policy_document.vmimport.json
}
}
# Import to EBS
resource "aws_ebs_snapshot_import" "image" {
disk_container {
format = "VHD"
user_bucket {
s3_bucket = aws_s3_object.image.bucket
s3_key = aws_s3_object.image.key
}
}
role_name = aws_iam_role.vmimport.name
}
# Convert to AMI
resource "aws_ami" "image" {
description = "Created with NixOS."
name = replace(basename(local.image_file), "/\\.vhd$/", "")
virtualization_type = "hvm"
ebs_block_device {
device_name = "/dev/xvda"
snapshot_id = aws_ebs_snapshot_import.image.id
volume_size = 8
}
}

260
hosts/aws/workflow.yml Normal file
View File

@ -0,0 +1,260 @@
name: 'Terraform'
env:
AWS_ACCOUNT_NUMBER: ''
AWS_PLAN_ROLE_NAME: github_actions_plan
AWS_APPLY_ROLE_NAME: github_actions_admin
# Always required. Used for authenticating to AWS, but can also act as your
# default region if you don't want to specify in the provider configuration.
AWS_REGION: us-east-1
# You must change these to fit your project.
TF_VAR_project: change-me
TF_VAR_label: change-me
TF_VAR_owner: Your Name Here
# If storing Terraform in a subdirectory, specify it here.
TERRAFORM_DIRECTORY: .
# Pinned versions of tools to use.
# Check for new releases:
# - https://github.com/hashicorp/terraform/releases
# - https://github.com/fugue/regula/releases
# - https://github.com/terraform-linters/tflint/releases
TERRAFORM_VERSION: 1.2.6
REGULA_VERSION: 2.9.0
TFLINT_VERSION: 0.39.1
# Terraform configuration options
TERRAFORM_PARALLELISM: 10
# These variables are passed to Terraform based on GitHub information.
TF_VAR_repo: ${{ github.repository }}
# This workflow is triggered in the following ways.
on:
# Any push or merge to these branches.
push:
branches:
- dev
- prod
# Any pull request targeting these branches (plan only).
pull_request:
branches:
- dev
- prod
# Any manual trigger on these branches.
workflow_dispatch:
branches:
- dev
- prod
# -------------------------------------------------------------------
# The rest of this workflow can operate without adjustments. Edit the
# below content at your own risk!
# -------------------------------------------------------------------
# Used to connect to AWS IAM
permissions:
id-token: write
contents: read
pull-requests: write
# Only run one workflow at a time for each Terraform state. This prevents
# lockfile conflicts, especially during PR vs push.
concurrency: terraform-${{ github.base_ref || github.ref }}
jobs:
terraform:
name: 'Terraform'
# Change this if you need to run your deployment on-prem.
runs-on: ubuntu-latest
steps:
# Downloads the current repo code to the runner.
- name: Checkout Repo Code
uses: actions/checkout@v2
# Install Nix
- name: Install Nix
uses: cachix/install-nix-action@v17
# Build the image
- name: Build Image
run: nix build .#aws
# Login to AWS
- name: AWS Assume Role
uses: aws-actions/configure-aws-credentials@v1.6.1
with:
role-to-assume: ${{ env.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
# Exports all GitHub Secrets as environment variables prefixed by
# "TF_VAR_", which exposes them to Terraform. The name of each GitHub
# Secret must match its Terraform variable name exactly.
- name: Export Secrets to Terraform Variables
env:
ALL_SECRETS: ${{ toJson(secrets) }}
run: |
echo "$ALL_SECRETS" \
| jq "to_entries | .[] | \"TF_VAR_\" + ( .key | ascii_downcase ) + \"=\" + .value" \
| tr -d \" >> $GITHUB_ENV
# Installs the Terraform binary and some other accessory functions.
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
# Checks whether Terraform is formatted properly. If this fails, you
# should install the pre-commit hook.
- name: Check Formatting
run: |
terraform fmt -no-color -check -diff -recursive
# Downloads a Terraform code lint test.
- uses: terraform-linters/setup-tflint@v1
name: Setup TFLint
with:
tflint_version: v${{ env.TFLINT_VERSION }}
# Sets up linting with this codebase.
- name: Init TFLint
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
run: tflint --init
# Lints the current code.
- name: Run TFLint
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
run: |
tflint -f compact
find ./modules/* -type d -maxdepth 0 | xargs -I __ tflint -f compact --disable-rule=terraform_required_providers --disable-rule=terraform_required_version __
# Connects to remote state backend and download providers.
- name: Terraform Init
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
run: |
terraform init \
-backend-config="role_arn=${{ env.AWS_STATE_ROLE_ARN }}" \
-backend-config="region=us-east-1" \
-backend-config="workspace_key_prefix=accounts/${{ env.AWS_ACCOUNT_NUMBER }}/${{ github.repository }}" \
-backend-config="key=state.tfstate" \
-backend-config="dynamodb_table=global-tf-state-lock"
# Set the Terraform Workspace to the current branch name.
- name: Set Terraform Workspace
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
shell: bash
run: |
export WORKSPACE=${{ github.base_ref || github.ref_name }}
terraform workspace select ${WORKSPACE} || terraform workspace new $WORKSPACE
echo "TF_WORKSPACE=$(echo ${WORKSPACE} | sed 's/\//_/g')" >> $GITHUB_ENV
# Checks differences between current code and infrastructure state.
- name: Terraform Plan
id: plan
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
run: |
terraform plan \
-input=false \
-no-color \
-out=tfplan \
-parallelism=${TERRAFORM_PARALLELISM} \
-var-file=variables-${TF_WORKSPACE}.tfvars
# Gets the results of the plan for pull requests.
- name: Terraform Show Plan
id: show
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
run: terraform show -no-color tfplan
# Adds the results of the plan to the pull request.
- name: Comment Plan
uses: actions/github-script@v6
if: github.event_name == 'pull_request'
env:
STDOUT: "```terraform\n${{ steps.show.outputs.stdout }}```"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
// 1. Retrieve existing bot comments for the PR
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
})
const botComment = comments.find(comment => {
return comment.user.type === 'Bot' && comment.body.includes('Terraform Format and Style')
})
// 2. Prepare format of the comment
const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
#### Terraform Validation 🤖\`${{ steps.validate.outcome }}\`
<details><summary>Validation Output</summary>
\`\`\`\n
${{ steps.validate.outputs.stdout }}
\`\`\`
</details>
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
<details><summary>Show Plan</summary>
\`\`\`\n
${process.env.PLAN}
\`\`\`
</details>
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Working Directory: \`${{ env.tf_actions_working_dir }}\`, Workflow: \`${{ github.workflow }}\`*`;
// 3. If we have a comment, update it, otherwise create a new one
if (botComment) {
github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: output
})
} else {
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
}
# Downloads Regula and checks whether the plan meets compliance requirements.
- name: Regula Compliance Check
shell: bash
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
run: |
REGULA_URL="https://github.com/fugue/regula/releases/download/v${REGULA_VERSION}/regula_${REGULA_VERSION}_Linux_x86_64.tar.gz"
curl -sL "$REGULA_URL" -o regula.tar.gz
tar xzf regula.tar.gz
terraform show -json tfplan | ./regula run
# Deploys infrastructure or changes to infrastructure.
- name: Terraform Apply
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
run: |
terraform apply \
-auto-approve \
-input=false \
-parallelism=${TERRAFORM_PARALLELISM} \
tfplan

94
hosts/common.nix Normal file
View File

@ -0,0 +1,94 @@
{ config, lib, pkgs, ... }: {
imports =
[ ../modules/shell ../modules/neovim ../modules/repositories/dotfiles.nix ];
options = with lib; {
user = mkOption {
type = types.str;
description = "Primary user of the system";
};
fullName = lib.mkOption {
type = lib.types.str;
description = "Human readable name of the user";
};
userDirs = {
# Required to prevent infinite recursion when referenced by himalaya
download = lib.mkOption {
type = lib.types.str;
description = "XDG directory for downloads";
default =
if pkgs.stdenv.isDarwin then "$HOME/Downloads" else "$HOME/downloads";
};
};
identityFile = lib.mkOption {
type = lib.types.str;
description = "Path to existing private key file.";
default = "/etc/ssh/ssh_host_ed25519_key";
};
gui = {
enable = mkEnableOption {
description = "Enable graphics";
default = false;
};
};
colorscheme = mkOption {
type = types.attrs;
description = "Base16 color scheme";
};
homePath = mkOption {
type = types.path;
description = "Path of user's home directory.";
default = builtins.toPath (if pkgs.stdenv.isDarwin then
"/Users/${config.user}"
else
"/home/${config.user}");
};
dotfilesPath = mkOption {
type = types.path;
description = "Path of dotfiles repository.";
default = config.homePath + "/dev/personal/dotfiles";
};
dotfilesRepo = mkOption {
type = types.str;
description = "Link to dotfiles repository.";
};
unfreePackages = mkOption {
type = types.listOf types.str;
description = "List of unfree packages to allow.";
default = [ ];
};
};
config = let stateVersion = "22.11";
in {
# Enable features in Nix commands
nix.extraOptions = ''
experimental-features = nix-command flakes
warn-dirty = false
'';
# Basic common system packages for all devices
environment.systemPackages = with pkgs; [ git vim wget curl ];
# Use the system-level nixpkgs instead of Home Manager's
home-manager.useGlobalPkgs = true;
# Install packages to /etc/profiles instead of ~/.nix-profile, useful when
# using multiple profiles for one user
home-manager.useUserPackages = true;
# Allow specified unfree packages (identified elsewhere)
# Retrieves package object based on string name
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) config.unfreePackages;
# Pin a state version to prevent warnings
home-manager.users.${config.user}.home.stateVersion = stateVersion;
home-manager.users.root.home.stateVersion = stateVersion;
};
}

46
hosts/desktop/default.nix Normal file
View File

@ -0,0 +1,46 @@
{ inputs, globals, ... }:
with inputs;
# System configuration for my desktop
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { };
modules = [
globals
home-manager.nixosModules.home-manager
{
networking.hostName = "desktop";
nixpkgs.overlays = [ nur.overlay ];
# Set registry to flake packages, used for nix X commands
nix.registry.nixpkgs.flake = nixpkgs;
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
gaming.steam = true;
gaming.legendary = true;
gui = {
enable = true;
compositor.enable = true;
wallpaper = "${wallpapers}/gruvbox/road.jpg";
gtk.theme = { name = "Adwaita-dark"; };
};
colorscheme = (import ../../modules/colorscheme/gruvbox);
passwordHash =
"$6$PZYiMGmJIIHAepTM$Wx5EqTQ5GApzXx58nvi8azh16pdxrN6Qrv1wunDlzveOgawitWzcIxuj76X9V868fsPi/NOIEO8yVXqwzS9UF.";
}
./hardware-configuration.nix
../common.nix
../../modules/hardware
../../modules/nixos
../../modules/graphical
../../modules/gaming
../../modules/applications
../../modules/mail/default.nix
../../modules/repositories/notes.nix
../../modules/services/keybase.nix
../../modules/services/gnupg.nix
../../modules/services/mullvad.nix
../../modules/programming/nix.nix
../../modules/programming/haskell.nix
];
}

View File

@ -0,0 +1,30 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
swapDevices = [ ];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

39
hosts/macbook/default.nix Normal file
View File

@ -0,0 +1,39 @@
{ inputs, globals, ... }:
with inputs;
# System configuration for my work MacBook
darwin.lib.darwinSystem {
system = "x86_64-darwin";
specialArgs = { };
modules = [
(globals // {
user = "Noah.Masur";
gitName = "Noah-Masur_1701";
gitEmail = "Noah.Masur@take2games.com";
})
home-manager.darwinModules.home-manager
{
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
gui.enable = true;
colorscheme = (import ../../modules/colorscheme/gruvbox);
mailUser = globals.user;
networking.hostName = "noah-masur-mac";
nixpkgs.overlays = [ nur.overlay ];
# Set registry to flake packages, used for nix X commands
nix.registry.nixpkgs.flake = nixpkgs;
}
../common.nix
../../modules/darwin
../../modules/mail
../../modules/applications/alacritty.nix
../../modules/applications/kitty.nix
../../modules/applications/discord.nix
../../modules/repositories/notes.nix
../../modules/programming/nix.nix
../../modules/programming/terraform.nix
../../modules/programming/python.nix
../../modules/programming/lua.nix
../../modules/programming/kubernetes.nix
];
}

Some files were not shown because too many files have changed in this diff Show More