259 Commits

Author SHA1 Message Date
1c9bd21ced set keyd overload tap timeout
helps prevent escape key from being sent if not tapped
2023-10-07 08:58:34 -04:00
14d2cbfdfb attempt to upgrade to keyd 2.4.3 pr 2023-10-07 07:52:47 -04:00
b4c08adea4 temp: disable terminfo on flame due to broken contour in nixpkgs 2023-10-02 03:38:22 +00:00
13972b1d66 update lockfile and fix tree-sitter issues 2023-09-30 10:20:58 -04:00
352f515798 fix: keyd doesn't restart properly on rebuild 2023-09-30 10:20:45 -04:00
d84be966fc auto close pr if check fails 2023-09-30 09:35:37 -04:00
c9aa20c703 initial attempt for declarative proton-ge 2023-09-16 11:15:41 -04:00
771d41254f partial fix to bash and tree-sitter
still not working in opening bash files but works for other files
2023-09-16 10:08:38 -04:00
90092c48ec update lockfile and reclassify steam in i3 2023-09-16 09:31:56 -04:00
159a6efe09 update lockfile, pin age with overlay 2023-09-15 08:46:28 -04:00
0008de7434 update lockfile and replace exa with eza 2023-09-11 23:18:22 -04:00
9826178c0e fix: rofi-calc live results 2023-09-10 17:34:46 -04:00
d2b1d95281 fix: caddy cloudflare build requires newer golang 2023-09-09 23:20:38 +00:00
4c71797818 fix: nextcloudapps now require specifying licenses 2023-09-09 21:27:15 +00:00
dba975fe86 update lockfile and fix nil build 2023-09-09 10:46:00 -04:00
1a9ab975d1 update darwin firefox and add small convenience tweaks 2023-09-06 15:21:59 -04:00
67251a6d8d add epic games store to macos 2023-08-19 10:49:54 -06:00
967175df70 flake.lock: Update
Flake lock file updates:

• Updated input 'darwin':
    'github:lnl7/nix-darwin/829041cf10c4f6751a53c0a11ca2fd22ff0918d6' (2023-08-05)
  → 'github:lnl7/nix-darwin/426d38710b656b0a31f8eaae6e0002206a3b96d7' (2023-08-10)
• Updated input 'disko':
    'github:nix-community/disko/4015740375676402a2ee6adebc3c30ea625b9a94' (2023-07-30)
  → 'github:nix-community/disko/241c878d4b542fea7c61ed4421e9224af054ff56' (2023-08-11)
• Updated input 'firefox-darwin':
    'github:bandithedoge/nixpkgs-firefox-darwin/6081c33185dba05da784d9f2a392861af025bf1a' (2023-08-05)
  → 'github:bandithedoge/nixpkgs-firefox-darwin/4011a1903422d241c0619f7c631a15d27643fa30' (2023-08-12)
• Updated input 'hmts-nvim-src':
    'github:calops/hmts.nvim/1d40963804925754672940d07ddb250d19efec2e' (2023-08-05)
  → 'github:calops/hmts.nvim/594dd17c870afb7f6517723c8963f6eb144e3c0d' (2023-08-08)
• Updated input 'home-manager':
    'github:nix-community/home-manager/0a014a729cdd54d9919ff36b714d047909d7a4c8' (2023-08-05)
  → 'github:nix-community/home-manager/406d34d919e9e8b831b531782cf5ef6995188566' (2023-08-12)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/18036c0be90f4e308ae3ebcab0e14aae0336fe42' (2023-08-04)
  → 'github:nixos/nixpkgs/ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e' (2023-08-10)
• Updated input 'null-ls-nvim-src':
    'github:jose-elias-alvarez/null-ls.nvim/db09b6c691def0038c456551e4e2772186449f35' (2023-07-06)
  → 'github:jose-elias-alvarez/null-ls.nvim/0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7' (2023-08-12)
• Updated input 'nur':
    'github:nix-community/nur/cf2f5d8ad452795e5aca290c95eedc829d3da7ec' (2023-08-06)
  → 'github:nix-community/nur/fe48fefbf13a75562599c1ab43871eb5c4274e1a' (2023-08-13)
• Updated input 'nvim-tree-lua-src':
    'github:kyazdani42/nvim-tree.lua/904f95cd9db31d1800998fa428e78e418a50181d' (2023-08-06)
  → 'github:kyazdani42/nvim-tree.lua/0a54dcb76b02f3a4e2da370c7a3f6f2b7b43ef01' (2023-08-13)
2023-08-13 03:52:18 +00:00
5561c85b43 add networkmanager to fix steam startup times 2023-08-08 22:13:24 -04:00
05a8f4a49b revert to basic adwaita gtk theme 2023-08-08 22:13:02 -04:00
a1f651010b successfully build custom gtk with latest materia-theme
too bad it looks terrible, especially for nautilus
2023-08-08 20:08:34 -04:00
3cecb8810c playing with custom gtk theme
still pretty ugly unfortunately
2023-08-06 18:07:47 -04:00
af753153f1 fix: clicking mouse in rofi power menu 2023-08-06 18:06:50 -04:00
d2afdd56ae gitcredentialhelper option renamed 2023-08-06 18:06:23 -04:00
18fec1d058 add another mbsync ignorefile for polybar 2023-08-06 18:06:11 -04:00
6a0e70568a remove litestream docs from nextcloud
now that i've migrated from sqlite to mariadb
2023-08-06 16:38:24 -04:00
9b44d8f171 add jujutsu vcs 2023-08-06 16:37:53 -04:00
1cf3405103 add readme for each directory 2023-08-06 08:01:21 -04:00
7439d4bf39 fix: lightdm not showing username 2023-08-06 07:30:40 -04:00
316c33e66c flake.lock: Update
Flake lock file updates:

• Updated input 'darwin':
    'github:lnl7/nix-darwin/16c07487ac9bc59f58b121d13160c67befa3342e' (2023-07-27)
  → 'github:lnl7/nix-darwin/829041cf10c4f6751a53c0a11ca2fd22ff0918d6' (2023-08-05)
• Updated input 'disko':
    'github:nix-community/disko/43f17a8b31c49f6696b8b258d317161afdc7e36b' (2023-07-28)
  → 'github:nix-community/disko/4015740375676402a2ee6adebc3c30ea625b9a94' (2023-07-30)
• Updated input 'firefox-darwin':
    'github:bandithedoge/nixpkgs-firefox-darwin/69010f2ef9fbcef70d12541910ccc6db7a9997db' (2023-07-28)
  → 'github:bandithedoge/nixpkgs-firefox-darwin/6081c33185dba05da784d9f2a392861af025bf1a' (2023-08-05)
• Updated input 'hmts-nvim-src':
    'github:calops/hmts.nvim/725300f46d702529a739d2e6ef84758b6003d135' (2023-08-03)
  → 'github:calops/hmts.nvim/1d40963804925754672940d07ddb250d19efec2e' (2023-08-05)
• Updated input 'home-manager':
    'github:nix-community/home-manager/f58889c07efa8e1328fdf93dc1796ec2a5c47f38' (2023-07-29)
  → 'github:nix-community/home-manager/0a014a729cdd54d9919ff36b714d047909d7a4c8' (2023-08-05)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/2a9d660ff0f7ffde9d73be328ee6e6f10ef66b28' (2023-07-28)
  → 'github:nixos/nixpkgs/18036c0be90f4e308ae3ebcab0e14aae0336fe42' (2023-08-04)
• Updated input 'nur':
    'github:nix-community/nur/1c4ba84e2cbfd43976a0fd3f848b536611735a79' (2023-07-30)
  → 'github:nix-community/nur/cf2f5d8ad452795e5aca290c95eedc829d3da7ec' (2023-08-06)
• Updated input 'nvim-tree-lua-src':
    'github:kyazdani42/nvim-tree.lua/4bd30f0137e44dcf3e74cc1164efb568f78f2b02' (2023-07-29)
  → 'github:kyazdani42/nvim-tree.lua/904f95cd9db31d1800998fa428e78e418a50181d' (2023-08-06)
2023-08-06 03:47:21 +00:00
c845ae2fd4 use ssh host key as identityfile on tempest
reencrypt secrets and use personal key for mail
2023-08-05 20:06:03 -04:00
5bc10bef87 improve hosts documentation 2023-08-05 17:14:26 -04:00
f0e1fc740f save ratbag profile to text
move misc data files to misc directory
2023-08-05 16:55:37 -04:00
5826877ad2 more zfs docs 2023-08-05 14:59:09 -04:00
d3b0f21313 initial zfs documentation 2023-08-05 14:44:24 -04:00
b7d1921c4d provision grafana alerts and smtp 2023-08-05 14:21:49 +00:00
de1337bf58 fix: failure to provision 2023-08-05 13:03:17 +00:00
3cff7e090c fix: port is an integer 2023-08-05 01:20:38 +00:00
21794891e7 grafana provisioning
convert grafana dashboard to nix native

remove grafana yml file
2023-08-04 21:15:38 -04:00
20e5d7fef5 disable hmts because it's buggy 2023-08-04 05:14:05 +00:00
b6a6c761e9 fix warnings in nextcloud 2023-08-04 05:13:43 +00:00
fc4bd9e4a8 hmts: tree-sitter injections for home-manager 2023-08-03 16:06:47 -04:00
25e3de5058 fix: output hash for nextcloud apps 2023-08-03 02:30:11 +00:00
9694467ba0 try making nextcloud apps as flake inputs 2023-08-02 22:27:28 -04:00
71e6780439 fix: wrong order of args 2023-08-02 21:50:26 -04:00
e6d0852be0 try refactoring overlays into flake inputs 2023-08-02 11:51:11 -04:00
00564c0c40 switch nextcloud to nix-based apps 2023-08-02 12:26:45 +00:00
57b38a417e switch nextcloud from sqlite to mysql 2023-08-02 11:32:54 +00:00
7f9ce5925e add undodir to hopefully fix short undo history
seems like undo history was being lost after committing to git
2023-08-01 11:05:41 -04:00
5ce9a26441 fix: exa ls not showing group names 2023-08-01 08:14:06 -04:00
73680961a0 bring back docker-cleanup file
just for safekeeping
2023-08-01 08:13:17 -04:00
c59e914430 attempt to fix rofi power confirm issues 2023-07-31 23:00:30 -04:00
e194003f8d fix: mach-nix not working with latest updates 2023-07-31 13:50:44 -04:00
3d6f57c324 clean up and improve docs 2023-07-30 20:26:23 -04:00
ef2ee7b871 fix: tree-sitter-python errors 2023-07-30 12:43:44 -04:00
fc867d60cd add description for caddy overlay 2023-07-30 12:43:27 -04:00
d395347a29 chore: fonts.fonts renamed to fonts.packages 2023-07-30 12:42:45 -04:00
080f7395e0 flake.lock: Update
Flake lock file updates:

• Updated input 'darwin':
    'github:lnl7/nix-darwin/efd35d99ce412335c478dff9da9a4256bbd39757' (2023-07-25)
  → 'github:lnl7/nix-darwin/16c07487ac9bc59f58b121d13160c67befa3342e' (2023-07-27)
• Updated input 'disko':
    'github:nix-community/disko/713eb78002e69bd77f5a69595756fd2e564233f3' (2023-07-23)
  → 'github:nix-community/disko/43f17a8b31c49f6696b8b258d317161afdc7e36b' (2023-07-28)
• Updated input 'firefox-darwin':
    'github:bandithedoge/nixpkgs-firefox-darwin/9f5f2b9396724b807818f889abfa7ccf61e20afa' (2023-07-22)
  → 'github:bandithedoge/nixpkgs-firefox-darwin/69010f2ef9fbcef70d12541910ccc6db7a9997db' (2023-07-28)
• Updated input 'home-manager':
    'github:nix-community/home-manager/d309a62ee81faec56dd31a263a0184b0e3227e36' (2023-07-24)
  → 'github:nix-community/home-manager/f58889c07efa8e1328fdf93dc1796ec2a5c47f38' (2023-07-29)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/b12803b6d90e2e583429bb79b859ca53c348b39a' (2023-07-24)
  → 'github:nixos/nixpkgs/2a9d660ff0f7ffde9d73be328ee6e6f10ef66b28' (2023-07-28)
• Updated input 'nur':
    'github:nix-community/nur/ed0946320360d3a08404d93077c0847c176d4da0' (2023-07-25)
  → 'github:nix-community/nur/1c4ba84e2cbfd43976a0fd3f848b536611735a79' (2023-07-30)
• Updated input 'nvim-tree-lua-src':
    'github:kyazdani42/nvim-tree.lua/273c1700eb68c27dce4e518efafc8144fd7ce4ab' (2023-07-23)
  → 'github:kyazdani42/nvim-tree.lua/4bd30f0137e44dcf3e74cc1164efb568f78f2b02' (2023-07-29)
• Updated input 'wsl':
    'github:nix-community/NixOS-WSL/01112baf546b5577038e2a422a5215eedd9bc84b' (2023-07-24)
  → 'github:nix-community/NixOS-WSL/f7a95a37306c46b42e9ce751977c44c752fd5eca' (2023-07-28)
• Updated input 'wsl/nixpkgs':
    'github:NixOS/nixpkgs/53657afe29748b3e462f1f892287b7e254c26d77' (2023-07-17)
  → 'github:NixOS/nixpkgs/9462344318b376e157c94fa60c20a25b913b2381' (2023-07-27)
2023-07-30 14:23:23 +00:00
1475172bdb switch to rebase merge
uses fast-forward commit style
2023-07-30 10:17:52 -04:00
5d6dab3cab auth automerge and run status check in same action 2023-07-30 09:49:53 -04:00
3e6232cbee fix: update to latest version of updater 2023-07-30 09:38:53 -04:00
8d72216f13 fix: flake update permissions 2023-07-30 09:37:52 -04:00
dd36a3bd82 fix: typo 2023-07-30 09:23:29 -04:00
0ed3633404 add more comments and utilities 2023-07-29 23:56:44 -04:00
95e04de763 reduce unnecessary caddy matches 2023-07-30 03:56:17 +00:00
b1ebca57d2 replace nginx with caddy for nextcloud 2023-07-30 03:51:01 +00:00
939d17ada1 delay gitea runner until gitea is running 2023-07-29 19:49:47 +00:00
dfd52e2cd5 enable gitea metrics 2023-07-29 19:33:13 +00:00
b589ba5d8a enable auto PRs and checks 2023-07-29 15:20:14 -04:00
200f790ea1 lock down nix daemon 2023-07-29 08:24:03 -04:00
9f561c822c add comments for notifications 2023-07-29 08:23:17 -04:00
1f0b04b89b add which-key keybind helper 2023-07-29 08:18:49 -04:00
38892b1135 auto-upgrades and notify using email 2023-07-28 23:28:08 -04:00
9c2e004c8b add killall to utilities 2023-07-28 18:49:48 -04:00
bbb210ec4f enable msmtp and ignore mbsyncstate files 2023-07-28 18:49:24 -04:00
984fca2021 switch dotfiles repo to https
not used anywhere else, so no need to use ssh
2023-07-28 18:46:59 -04:00
b284b333c5 auto reload hammerspoon on rebuild 2023-07-26 11:55:58 -04:00
3aef23b746 lockfile: fix lua langserver build 2023-07-26 11:16:00 -04:00
5f36508d2b update lockfile 2023-07-25 03:16:48 +00:00
3387bea109 enable exportarr 2023-07-25 02:55:30 +00:00
6f59ea9f22 fix bad polybar icons and mail messages 2023-07-23 15:46:41 -04:00
8d09544663 fix: betterlockscreen failing on suspend 2023-07-20 22:14:59 -04:00
cb15cc209b create wakeonlan convenience function 2023-07-21 01:07:09 +00:00
b390fff749 enable wakeonlan for tempest 2023-07-20 21:06:44 -04:00
20456b444b fix: localhost as default not in caddy allowlist 2023-07-20 00:18:28 +00:00
cce6f6573f upgrade firefox to 115.0.2 2023-07-19 12:27:04 -04:00
52b86efbb1 kitty tweaks, fix scrollback character issues 2023-07-18 23:36:09 -04:00
f41774f641 neovim keybind to open specific file in gh web 2023-07-18 13:11:42 -04:00
22cba9acac use bind for local dns 2023-07-18 03:52:37 +00:00
9e8bac6834 setup bind 2023-07-17 22:37:26 -04:00
b07a8f5e20 auto empty trash on login 2023-07-17 22:24:41 -04:00
8eb7ef0be7 fix avahi and dhcp, mark swan as physical 2023-07-18 02:00:38 +00:00
22ab2acf66 fix: swan not using avahi because not set as physical 2023-07-17 11:38:08 -04:00
d85e4b1593 fix: caddy denylist and jellyfin prometheus 2023-07-16 21:04:07 +00:00
6ea99eca5d enable caddy prometheus metrics 2023-07-16 20:13:41 +00:00
60e779085e add victoriametrics to tempest 2023-07-16 10:43:55 -04:00
6abcdfa3bd switch flame to victoriametrics 2023-07-16 14:43:14 +00:00
0f0a64b5c4 add victoriametrics 2023-07-16 13:50:58 +00:00
edb4ec77ca set caddy prometheus port dynamically 2023-07-16 03:34:03 +00:00
3cc264a857 fix: register gitea runner 2023-07-16 03:33:35 +00:00
76a7480a1d working prometheus setup with processes 2023-07-16 01:04:52 +00:00
9d4bf082c7 fix: prometheus remote write 2023-07-14 02:52:23 +00:00
e86b2f184f fix: cloudflare tunnel on tempest
requires openssh, but removing public key
2023-07-12 23:33:35 -04:00
d14054ab17 update to nextcloud 27 2023-07-13 03:22:45 +00:00
9b3d2e39c9 change nix run shortcut to nix shell 2023-07-10 16:01:01 -06:00
5a1a843ecd enable gitea actions and runner 2023-07-10 16:00:48 -06:00
2ddd980436 clean up colorschemes 2023-07-09 23:06:36 -06:00
febf1071af remove flake locks from templates 2023-07-09 22:26:14 -06:00
05adc8a221 add custom treesitter grammars 2023-07-09 17:22:41 -06:00
a463212023 clarify neovimBuilder 2023-07-09 14:51:41 -06:00
2457ade6eb enable installed glow markdown plugin 2023-07-09 14:51:23 -06:00
88d52614a9 prevent infinite neovim lsp log files 2023-07-09 14:51:02 -06:00
2c663347ee inject bash highlighting in nix shell scripts 2023-07-09 14:50:41 -06:00
02fc29c482 update to firefox 115 2023-07-07 12:45:02 -06:00
21cbe29bd8 create universal options for hostnames 2023-07-07 10:16:07 -06:00
c0da8391ef replace vscode tf snippets with larger one 2023-07-06 13:01:35 -06:00
d4e203a04c add vscode tf snippets, fix tf tree-sitter 2023-07-06 12:07:29 -06:00
38480e0c0c remove extraneous nixpkgs inputs 2023-07-05 14:23:19 -06:00
ee58f7a4ee abstract grafana in prometheus config 2023-07-05 14:19:54 -06:00
4c4e250fa1 add cloudflare tunnel to tempest 2023-07-05 14:18:59 -06:00
ffe867e6a8 have gitea actually backup full repos 2023-07-04 18:01:11 -06:00
b599162090 fix: paren required on function 2023-07-04 17:21:53 -06:00
4b0d68089a fix: grafana settings schema 2023-07-04 17:15:04 -06:00
b304e529b4 fix: nextcloud infinite recursion 2023-07-04 17:12:22 -06:00
2b0f03ba1f fix: mc server infinite recursion 2023-07-04 17:10:37 -06:00
2c4f215b6e define grafana settings explicitly 2023-07-04 17:05:56 -06:00
066ea8e440 remote prometheus and reconfig server modules 2023-07-04 16:20:43 -06:00
cd0c93c6d9 cloudflare tunnel for flame 2023-07-03 09:49:21 -06:00
78e9c817d0 move generators into hosts directory 2023-07-01 21:00:17 -06:00
53a8cc83ea remove extraLib, replace mkScript with writeShellApplication 2023-07-01 20:40:48 -06:00
1cf5f46adf clean up flake and reset neovim plugin versions 2023-07-01 20:22:03 -06:00
5348cbdf61 cleanup comments and unneeded code 2023-07-01 15:33:24 -06:00
140b410ea0 neovim keybind for telescope resume 2023-06-28 22:53:52 -06:00
b282e76be4 fix: gq with null-ls 2023-06-24 15:15:50 -06:00
a26f5dc2b5 tweak readme links 2023-06-24 15:15:39 -06:00
b0fcee6707 don't auto exit bat pager 2023-06-24 15:15:20 -06:00
46e633c8b9 fixup updates to ami workflow 2023-06-24 12:36:57 -06:00
7a74f0a504 update lockfile, remove gh cli overlay
gh cli overlay no longer needed thanks to latest release which fixes
logs on composite actions
2023-06-24 12:33:06 -06:00
bacf1ab1fa fix: garbage collection deleting mailpass 2023-06-22 22:26:07 -04:00
ddf48998db pass cloudflare tunnel info to module 2023-06-19 08:30:30 -04:00
23f72c3c2e fix: cloudflare tunnel failed to match ssh mac 2023-06-18 18:46:34 +00:00
77d81742a9 possible fix for amdgpu driver with kernel params 2023-06-18 14:28:02 +00:00
13c7859a78 fix: including disabled wireguard settings 2023-06-18 03:24:35 +00:00
0f4914db95 gh-cli overlay for log view on composite actions
can be removed with the next release of gh-cli
2023-06-16 08:00:42 -04:00
25e56b7421 git-push-upstream no longer needed 2023-06-16 08:00:07 -04:00
a6ec04db7e fixes to build on darwin 2023-06-16 07:59:06 -04:00
2a56c04e17 update lockfile
fix empty steam window
2023-06-12 22:07:21 -04:00
894a22cb2d update lockfile 2023-06-08 13:14:55 -04:00
eefed57929 enable firefox builtin cookie blocker 2023-06-08 13:14:50 -04:00
494cf355e9 try to enable hw accel for mpv and firefox 2023-06-05 23:50:32 -04:00
c88718b649 add protonup-qt for downloading proton versions 2023-06-05 23:50:17 -04:00
790cb4a9d0 use keyd instead of xkb for key remap 2023-06-05 23:50:01 -04:00
e3d4b36613 decouple wireguard and transmission 2023-06-05 23:49:41 -04:00
18154b6579 possible fixes to hardware acceleration 2023-06-06 03:13:17 +00:00
fb44473d22 shared group for media services 2023-06-06 00:56:52 +00:00
c1e89fb20e setup journald retention and rotation 2023-06-05 03:09:38 +00:00
04e8b8834e fix: headless hardware acceleration
requires kernel module and firmware
2023-06-04 16:14:11 +00:00
472a2b965c attempt to enable hardware acceleration 2023-06-04 14:22:04 +00:00
79eba7f333 fix jellyfin permissions with sab 2023-06-04 14:19:56 +00:00
28418c4e37 enable jellyseerr 2023-06-04 01:10:23 +00:00
fa797c81f8 add sabnzbd 2023-06-03 23:00:18 +00:00
d243d68c72 merge swan hardware file into host config 2023-06-03 11:12:04 -04:00
f4f5f19183 Merge branch 'cloudflare-acme-dns' 2023-06-03 00:31:10 +00:00
3a40bb7485 update lockfile 2023-06-02 20:30:14 -04:00
e8456e131b switch nautilus sushi to service 2023-06-02 20:10:45 -04:00
8d8dd8ad62 use css highlighting for rasi files 2023-06-01 22:55:05 -04:00
bad49cb2c3 fix bash interactive from fish 2023-06-01 22:54:25 -04:00
c052813f6d only toggle sleep mobo fix if needed 2023-06-01 22:54:08 -04:00
ed19eaafd1 auto wake and sleep for garbage collection
only sleep again for non-servers
2023-06-01 22:42:06 -04:00
09de243bd3 enable ryujinx 2023-06-01 22:39:05 -04:00
82a1954c26 fix: new aerc has different directory for filters 2023-06-01 20:58:46 -04:00
6815af21dc clean up custom caddy build 2023-06-01 12:18:38 +00:00
3269d5e247 update calibre-web patch for new login changes 2023-06-01 12:11:53 +00:00
d337ffff51 fix: compiling cloudflare caddy module
actually compile locally since xcaddy is impure
2023-06-01 03:46:17 +00:00
df5fba19f8 cloudflare caddy module for dns validation 2023-05-31 21:03:08 -04:00
8cc158221d fix: replace removed rofi nerdfont icons 2023-05-31 08:01:32 -04:00
f391433584 update lockfile, remove mimestream 2023-05-25 08:51:22 -04:00
241b2deb49 update lockfile, cleanup readme 2023-05-14 17:17:56 -04:00
605824c1a4 update flame, cleanup host config file 2023-04-30 21:51:35 +00:00
e8f4ee52c3 update lockfile, linux 6.3
also pin nil version
maybe it fixed sleep issues as well?
2023-04-29 18:25:30 -04:00
6518db291f enable cloudflare tunnel for ssh 2023-04-29 16:00:31 +00:00
a6551ce043 update flake lock
jellyfin security update
also view.mappings.list nvim-tree deprecated
also partition type removed from disko
2023-04-26 23:28:15 -04:00
b089ec4668 disable discord and music macos shortcuts 2023-04-25 13:54:45 -04:00
5970555572 use dwarf therapist and dfhack for dwarf fortress 2023-04-23 15:27:25 -04:00
1083ee4ff8 enable classic dwarf fortress 2023-04-19 19:50:10 -04:00
a2bbcf7f55 try reenabling avahi
used public instead of publish accidentally
2023-04-19 16:50:19 -04:00
f388aee56c replace flake8 with ruff 2023-04-19 16:50:05 -04:00
958ab8a96b update lockfile 2023-04-19 16:49:55 -04:00
3059241c1c fix: builtins.storePath issue on mac 2023-04-19 16:49:40 -04:00
fe938ec713 update lockfile
include neovim 0.9.0 and new lazy load

also obsidian requires broken electron
2023-04-17 08:13:36 -04:00
05f705d794 remove dunst requirements when disabled 2023-04-16 19:05:09 -04:00
f67a44fa87 fix: won't boot on amdgpu
must be required linux firmware blobs
2023-04-16 19:04:57 -04:00
713b835f70 enable cloudflare IP filtering
forgot to turn this on before
2023-04-16 20:59:52 +00:00
480d515302 upgrade to nextcloud 26 2023-04-16 20:59:37 +00:00
2337db0bda fix flake check errors
also break out packages into individual systems
2023-04-16 16:33:16 -04:00
1510c8c31f split wsl, consolidate hardware 2023-04-15 20:55:56 -04:00
8f8012e435 refactor neovim colors
using base16 color plugin instead of homemade
2023-04-15 18:38:03 -04:00
8d389013ad disable dunst
not really needed currently
2023-04-15 18:37:36 -04:00
d013f980a7 clean up host settings
and start removing if statements
2023-04-15 12:58:37 -04:00
3c51dd0db6 option for chiaki ps remote play 2023-04-15 10:11:44 -04:00
7f0600580f more attempts to fix sleep 2023-04-15 10:11:30 -04:00
05d5fcb8f9 try avahi, not working
doesn't seem to be discovering other devices
2023-04-15 10:10:10 -04:00
ca7a4ed408 only show new mail if in inbox 2023-04-15 10:08:45 -04:00
cf73ce8136 remove unnecessary mail options 2023-04-15 10:08:19 -04:00
82344372dd add auto garbage collection 2023-04-15 10:07:59 -04:00
34cf2a4483 rofi calculator (rest of it) 2023-04-10 23:10:49 -04:00
efb3933f5a hide polybar mail notification when no messages 2023-04-10 23:09:17 -04:00
cd067cce69 add rofi calculator 2023-04-10 23:08:59 -04:00
0d9df06bce switch from telescope-project.nvim to project.nvim 2023-04-10 15:35:06 -04:00
b4e5852f48 again remove legacy packer files 2023-04-10 15:34:02 -04:00
1a60c5e9db Revert "remove old neovim lua config"
This reverts commit 2d8a84c286.
2023-04-10 15:25:46 -04:00
2d8a84c286 remove old neovim lua config 2023-04-10 14:49:17 -04:00
319106364a add keybase back as homebrew package 2023-04-08 12:26:14 -04:00
fd5d6ab141 update lockfile, neovim tf filetype working again 2023-04-07 13:00:35 -04:00
4df1132eb7 switch to babelfish to improve fish macos startup 2023-04-05 14:11:44 -04:00
f4d9897f21 reset lookinglass hostname and email 2023-04-05 14:10:54 -04:00
634baf0a7e fix: keep polybar mail updated 2023-04-04 08:32:01 -04:00
600fd06974 fix nautilus and xdg mimetypes
discovered sushi is not working, however
2023-04-03 21:54:53 -04:00
c9ab46696d reenable mbsync timer with notmuch
fixes polybar mail indicator
2023-04-03 20:36:05 -04:00
b5790a2795 disable long running command notifications 2023-04-03 20:35:30 -04:00
61f26315d5 setup ultrawide curved monitor 2023-04-03 11:51:04 -04:00
4fefe54435 add email notifications
not required to run aerc, uses imapnotify and notmuch/polybar

closes #10
2023-04-02 23:16:44 -04:00
0833a0009c enable dunst notifications
also rebuilds with shortcuts
2023-04-02 19:19:40 -04:00
e349ac35b8 fix: flake app for rebuilds 2023-04-02 18:47:06 -04:00
49c2c013a2 update polybar spacing 2023-04-02 18:46:22 -04:00
985b8bf13b polybar audio and power buttons
also switched from systemd because it breaks rofi
2023-04-02 16:53:01 -04:00
8283480fd1 rofi brightness menu 2023-04-02 15:52:45 -04:00
d6611ca7a2 rofi power menu 2023-04-02 12:25:33 -04:00
a13083a264 now really fix sleep 2023-04-02 08:22:28 -04:00
ff4db1463e finally fix sleep on tempest 2023-04-01 20:21:26 -04:00
afedfcf187 i3 focus or run browser and mail 2023-04-01 09:41:45 -04:00
2e3c376d73 add prs shortcut 2023-03-31 12:39:10 -04:00
59824adb3a much improved speed in fzf project switcher 2023-03-30 10:24:19 -04:00
8e32c16fd3 try to fix timezone failure 2023-03-27 13:45:23 -04:00
76c80dd31d fix: samba don't use force group 2023-03-26 20:52:28 +00:00
57de089baf add mpv delete file script 2023-03-25 10:51:20 -04:00
f9c09deb2a compile all grammars for nvim-treesitter 2023-03-24 16:20:47 -04:00
b06b6490f4 start working on readme table
fill out readme table

more readme links and move installation

clean up

add more flake comments

hosts and modules readmes

fix: macos readme link

switch links to relative file
2023-03-22 21:38:39 -04:00
514244476d adjust rofi themes 2023-03-22 21:33:06 -04:00
47590abc3a lazy evaluated let for rofi 2023-03-22 21:17:15 -04:00
f69d233c39 switch audio with rofi and add extraLib 2023-03-22 21:15:41 -04:00
9b97c9ac84 update lockfile, fix darwin 2023-03-22 16:20:38 -04:00
bda59eeb4a enable num lock on login 2023-03-21 18:37:22 -04:00
e7468ecc46 fix: swan globals not included 2023-03-20 03:36:15 +00:00
1b798f5af0 grant permissions to service directories 2023-03-20 03:35:54 +00:00
4406116203 adjust fan curve 2023-03-19 23:35:06 -04:00
c53f1470ee allow rofi-systemd to use kitty terminal 2023-03-19 12:49:41 -04:00
da89732001 switch to nsxiv and set media for aerc 2023-03-19 10:45:52 -04:00
2176a53c4a setup amd gpu fancontrol curve 2023-03-18 09:29:20 -04:00
28576c1b8f update lockfile 2023-03-16 14:52:20 -04:00
64590c539b reorder utilities alphabetically
also add bc
2023-03-12 20:09:56 -04:00
78b364afd7 launch aerc with super+E 2023-03-12 20:09:41 -04:00
f219ce45c8 enable actual bash support 2023-03-12 19:00:59 -04:00
5002c881f7 fix: mail not syncing read and deleted 2023-03-12 17:08:21 -04:00
5859377802 fix: arr options when not used 2023-03-12 17:08:21 -04:00
e6dbed2e17 enable caddy logfile 2023-03-12 13:24:25 +00:00
86076f0844 add arr services 2023-03-12 13:24:16 +00:00
2aea76c0e3 switch mpv to managed settings 2023-03-11 14:14:45 -05:00
42a5ad40de add heroic game launcher 2023-03-11 14:14:25 -05:00
212 changed files with 6668 additions and 2728 deletions

20
.github/workflows/check.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: Check Build
on:
workflow_dispatch: # allows manual triggering
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Check Nixpkgs Inputs
uses: DeterminateSystems/flake-checker-action@v5
- name: Add Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Check the Flake
run: nix flake check

52
.github/workflows/update.yml vendored Normal file
View File

@ -0,0 +1,52 @@
name: Update Flake
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '33 3 * * 0' # runs weekly on Sunday at 03:33
permissions:
contents: write
pull-requests: write
jobs:
lockfile:
name: Lockfile
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Check Nixpkgs Inputs
uses: DeterminateSystems/flake-checker-action@v5
- name: Add Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@v19
id: update
with:
pr-title: "Update flake.lock" # Title of PR to be created
pr-labels: | # Labels to be set on the PR
dependencies
automated
- name: Check the Flake
run: nix flake check
- name: Enable Pull Request Automerge
if: success()
run: |
gh pr merge \
--rebase \
--auto \
${{ steps.update.outputs.pull-request-number }}
env:
GH_TOKEN: ${{ github.token }}
- name: Close Pull Request If Failed
if: failure()
run: |
gh pr close \
--comment "Auto-closing pull request" \
--delete-branch \
${{ steps.update.outputs.pull-request-number }}
env:
GH_TOKEN: ${{ github.token }}

3
.gitignore vendored
View File

@ -3,7 +3,6 @@
*.db *.db
**/.direnv/** **/.direnv/**
result result
.luarc.json
private/** private/**
templates/**/flake.lock
!private/**.age !private/**.age
!private/**.sha512

118
README.md
View File

@ -6,21 +6,56 @@ hosts.
They are organized and managed by [Nix](https://nixos.org), so some of the 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. configuration may be difficult to translate to a non-Nix system.
However, some of the configurations are easier to lift directly: ## System Features
- [Neovim](https://github.com/nmasur/dotfiles/tree/master/modules/common/neovim/config) | Feature | Program | Configuration |
- [Fish functions](https://github.com/nmasur/dotfiles/tree/master/modules/common/shell/fish/functions) | --- | --- | --- |
- [More fish aliases](https://github.com/nmasur/dotfiles/blob/master/modules/common/shell/fish/default.nix) | OS | [NixOS](https://nixos.org) | [Link](./modules/nixos) |
- [Git aliases](https://github.com/nmasur/dotfiles/blob/master/modules/common/shell/git.nix) | Display Server | [X11](https://www.x.org/wiki/) | [Link](./modules/nixos/graphical/xorg.nix) |
- [Hammerspoon](https://github.com/nmasur/dotfiles/tree/master/modules/darwin/hammerspoon) | Compositor | [Picom](https://github.com/yshui/picom) | [Link](./modules/nixos/graphical/picom.nix) |
| Window Manager | [i3](https://i3wm.org/) | [Link](./modules/nixos/graphical/i3.nix) |
| Panel | [Polybar](https://polybar.github.io/) | [Link](./modules/nixos/graphical/polybar.nix) |
| Font | [Victor Mono](https://rubjo.github.io/victor-mono/) | [Link](./modules/nixos/graphical/fonts.nix) |
| Launcher | [Rofi](https://github.com/davatorium/rofi) | [Link](./modules/nixos/graphical/rofi.nix) |
Try out my Neovim config (requires [nix](https://nixos.org/download.html)): ## User Features
| Feature | Program | Configuration |
| --- | --- | --- |
| Dotfiles | [Home-Manager](https://github.com/nix-community/home-manager) | [Link](./modules/common) |
| Terminal | [Kitty](https://sw.kovidgoyal.net/kitty/) | [Link](./modules/common/applications/kitty.nix) |
| Shell | [Fish](https://fishshell.com/) | [Link](./modules/common/shell/fish) |
| Shell Prompt | [Starship](https://starship.rs/) | [Link](./modules/common/shell/starhip.nix) |
| Colorscheme | [Gruvbox](https://github.com/morhetz/gruvbox) | [Link](./colorscheme/gruvbox/default.nix) |
| Wallpaper | [Road](https://gitlab.com/exorcist365/wallpapers/-/blob/master/gruvbox/road.jpg) | [Link](./hosts/tempest/default.nix) |
| Text Editor | [Neovim](https://neovim.io/) | [Link](./modules/common/neovim/config) |
| Browser | [Firefox](https://www.mozilla.org/en-US/firefox/new/) | [Link](./modules/common/applications/firefox.nix) |
| E-Mail | [Aerc](https://aerc-mail.org/) | [Link](./modules/common/mail/aerc.nix) |
| File Manager | [Nautilus](https://wiki.gnome.org/action/show/Apps/Files) | [Link](./modules/common/applications/nautilus.nix) |
| PDF Reader | [Zathura](https://pwmt.org/projects/zathura/) | [Link](./modules/common/applications/media.nix) |
| Video Player | [mpv](https://mpv.io/) | [Link](./modules/common/applications/media.nix) |
## macOS Features
| Feature | Program | Configuration |
| --- | --- | --- |
| Keybinds | [Hammerspoon](https://www.hammerspoon.org/) | [Link](./modules/darwin/hammerspoon) |
---
# Installation
Click [here](./docs/installation.md) for detailed installation instructions.
# Neovim
Try out my Neovim config with nix:
```bash ```bash
nix run github:nmasur/dotfiles#neovim nix run github:nmasur/dotfiles#neovim
``` ```
Or build it as a package (requires [nix](https://nixos.org/download.html)): Or build it as a package:
```bash ```bash
nix build github:nmasur/dotfiles#neovim nix build github:nmasur/dotfiles#neovim
@ -30,73 +65,6 @@ If you already have a Neovim configuration, you may need to move it out of
`~/.config/nvim` or set `XDG_CONFIG_HOME` to another value; otherwise both `~/.config/nvim` or set `XDG_CONFIG_HOME` to another value; otherwise both
configs might conflict with each other. configs might conflict with each other.
---
# Full 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 tempest
```
## 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#tempest
```
## 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#hydra
```
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#lookingglass
```
---
# Flake Templates # Flake Templates
You can also use the [templates](./templates/) as flakes for starting new You can also use the [templates](./templates/) as flakes for starting new

9
apps/README.md Normal file
View File

@ -0,0 +1,9 @@
# Apps
These are all my miscellaneous utilies and scripts to accompany this project.
They can be run with:
```
nix run github:nmasur/dotfiles#appname
```

View File

@ -11,7 +11,7 @@
tmpfile=$(mktemp) tmpfile=$(mktemp)
echo "''${secret}" > ''${tmpfile} echo "''${secret}" > ''${tmpfile}
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${ ${pkgs.age}/bin/age --encrypt --armor --recipients-file ${
builtins.toString ../public-keys builtins.toString ../misc/public-keys
} $tmpfile } $tmpfile
rm $tmpfile rm $tmpfile
''); '');

View File

@ -17,8 +17,8 @@
--foreground "#fb4934" \ --foreground "#fb4934" \
"Missing required parameter." \ "Missing required parameter." \
"Usage: installer -- <disk> <host>" \ "Usage: installer -- <disk> <host>" \
"Example: installer -- nvme0n1 desktop" \ "Example: installer -- nvme0n1 tempest" \
"Flake example: nix run github:nmasur/dotfiles#installer -- nvme0n1 desktop" "Flake example: nix run github:nmasur/dotfiles#installer -- nvme0n1 tempest"
echo "(exiting)" echo "(exiting)"
exit 1 exit 1
fi fi

View File

@ -5,8 +5,7 @@
program = "${ program = "${
(import ../modules/common/neovim/package { (import ../modules/common/neovim/package {
inherit pkgs; inherit pkgs;
colors = colors = (import ../colorscheme/nord).dark;
import ../colorscheme/gruvbox/neovim-gruvbox.nix { inherit pkgs; };
}) })
}/bin/nvim"; }/bin/nvim";

View File

@ -6,9 +6,9 @@
echo ${pkgs.system} echo ${pkgs.system}
SYSTEM=${if pkgs.stdenv.isDarwin then "darwin" else "linux"} SYSTEM=${if pkgs.stdenv.isDarwin then "darwin" else "linux"}
if [ "$SYSTEM" == "darwin" ]; then if [ "$SYSTEM" == "darwin" ]; then
darwin-rebuild switch --flake github:nmasur/dotfiles#lookingglass sudo darwin-rebuild switch --flake ${builtins.toString ../.}
else else
nixos-rebuild switch --flake github:nmasur/dotfiles doas nixos-rebuild switch --flake ${builtins.toString ../.}
fi fi
''); '');

View File

@ -17,7 +17,7 @@
--identity ~/.ssh/id_ed25519 $encryptedfile > $tmpfile --identity ~/.ssh/id_ed25519 $encryptedfile > $tmpfile
echo "Encrypting ''${encryptedfile}..." echo "Encrypting ''${encryptedfile}..."
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${ ${pkgs.age}/bin/age --encrypt --armor --recipients-file ${
builtins.toString ../public-keys builtins.toString ../misc/public-keys
} $tmpfile > $encryptedfile } $tmpfile > $encryptedfile
rm $tmpfile rm $tmpfile
done done

5
colorscheme/README.md Normal file
View File

@ -0,0 +1,5 @@
# Colorschemes
Color information for different themes is found here. The colors are sourced
and used with [base16](https://github.com/chriskempson/base16) format
consistently across the system.

View File

@ -1,6 +1,7 @@
{ {
name = "everforest"; # dark, hard name = "everforest"; # dark, hard
author = "Sainnhe Park"; author = "Sainnhe Park";
dark = {
base00 = "#2b3339"; # Default Background base00 = "#2b3339"; # Default Background
base01 = "#323c41"; # Lighter Background base01 = "#323c41"; # Lighter Background
base02 = "#503946"; # Selection Background base02 = "#503946"; # Selection Background
@ -15,6 +16,9 @@
base0B = "#dbbc7f"; # Strings, Inherited Class, Markup Code, Diff Inserted base0B = "#dbbc7f"; # Strings, Inherited Class, Markup Code, Diff Inserted
base0C = "#e69875"; # Support, Regular Expressions, Escape Characters, ... base0C = "#e69875"; # Support, Regular Expressions, Escape Characters, ...
base0D = "#a7c080"; # Functions, Methods, Attribute IDs, Headings base0D = "#a7c080"; # Functions, Methods, Attribute IDs, Headings
base0E = "#e67e80"; # Keywords, Storage, Selector, Markup Italic, Diff Changed base0E =
base0F = "#d699b6"; # Deprecated, Opening/Closing Embedded Language Tags, ... "#e67e80"; # Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F =
"#d699b6"; # Deprecated, Opening/Closing Embedded Language Tags, ...
};
} }

View File

@ -0,0 +1,45 @@
# Gruvbox with a darker background for greater contrast
{
name = "gruvbox-dark"; # Dark, Medium
author =
"Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox), ElRastaOk (https://www.reddit.com/user/ElRastaOk)";
dark = {
base00 = "#1D2122"; # ---- This is the change from normal gruvbox
base01 = "#3c3836"; # ---
base02 = "#504945"; # --
base03 = "#665c54"; # -
base04 = "#bdae93"; # +
base05 = "#d5c4a1"; # ++
base06 = "#ebdbb2"; # +++
base07 = "#fbf1c7"; # ++++
base08 = "#fb4934"; # red
base09 = "#fe8019"; # orange
base0A = "#fabd2f"; # yellow
base0B = "#b8bb26"; # green
base0C = "#8ec07c"; # aqua/cyan
base0D = "#83a598"; # blue
base0E = "#d3869b"; # purple
base0F = "#d65d0e"; # brown
batTheme = "gruvbox-dark";
};
light = {
base00 = "#fbf1c7"; # ----
base01 = "#ebdbb2"; # ---
base02 = "#d5c4a1"; # --
base03 = "#bdae93"; # -
base04 = "#665c54"; # +
base05 = "#504945"; # ++
base06 = "#3c3836"; # +++
base07 = "#1D2122"; # ++++ Adjusted darker here
base08 = "#9d0006"; # red
base09 = "#af3a03"; # orange
base0A = "#b57614"; # yellow
base0B = "#79740e"; # green
base0C = "#427b58"; # aqua/cyan
base0D = "#076678"; # blue
base0E = "#8f3f71"; # purple
base0F = "#d65d0e"; # brown
batTheme = "gruvbox-light";
};
}

View File

@ -19,7 +19,6 @@
base0D = "#83a598"; # blue base0D = "#83a598"; # blue
base0E = "#d3869b"; # purple base0E = "#d3869b"; # purple
base0F = "#d65d0e"; # brown base0F = "#d65d0e"; # brown
neovimConfig = ./neovim-gruvbox.nix;
batTheme = "gruvbox-dark"; batTheme = "gruvbox-dark";
}; };
light = { light = {
@ -39,7 +38,6 @@
base0D = "#076678"; # blue base0D = "#076678"; # blue
base0E = "#8f3f71"; # purple base0E = "#8f3f71"; # purple
base0F = "#d65d0e"; # brown base0F = "#d65d0e"; # brown
neovimConfig = ./neovim-gruvbox.nix;
batTheme = "gruvbox-light"; batTheme = "gruvbox-light";
}; };
} }

View File

@ -1,12 +0,0 @@
{ pkgs, ... }: {
plugins = [ pkgs.vimPlugins.vim-gruvbox8 ];
vim.g.gruvbox_italicize_strings = 0;
vim.o.background = "dark";
vimscript = ''
let g:gruvbox_italicize_strings = 0
colorscheme gruvbox8
'';
}

View File

@ -1,6 +1,7 @@
{ {
name = "nord"; name = "nord";
author = "arcticicestudio"; author = "arcticicestudio";
dark = {
base00 = "#2E3440"; base00 = "#2E3440";
base01 = "#3B4252"; base01 = "#3B4252";
base02 = "#434C5E"; base02 = "#434C5E";
@ -17,5 +18,6 @@
base0D = "#EBCB8B"; base0D = "#EBCB8B";
base0E = "#A3BE8C"; base0E = "#A3BE8C";
base0F = "#B48EAD"; base0F = "#B48EAD";
neovimConfig = ./neovim.lua; batTheme = "nord";
};
} }

View File

@ -1,13 +0,0 @@
local M = {}
M.packer = function(use)
use({
"shaunsingh/nord.nvim",
config = function()
vim.g.nord_italic = true
vim.cmd("colorscheme nord")
end,
})
end
return M

5
disks/README.md Normal file
View File

@ -0,0 +1,5 @@
# Disks
These are my [disko](https://github.com/nix-community/disko) configurations,
which allow me to save desired disk formatting layouts as a declarative file so
I don't have to remember how to format my disks later on.

View File

@ -9,7 +9,6 @@
partitions = [ partitions = [
# Boot partition # Boot partition
{ {
type = "partition";
name = "ESP"; name = "ESP";
start = "0"; start = "0";
end = "512MiB"; end = "512MiB";
@ -24,7 +23,6 @@
} }
# Root partition ext4 # Root partition ext4
{ {
type = "partition";
name = "root"; name = "root";
start = "512MiB"; start = "512MiB";
end = "100%"; end = "100%";

4
docs/README.md Normal file
View File

@ -0,0 +1,4 @@
# Documentation
Reference documents for some of the more complicated services and maintenance
tasks.

67
docs/installation.md Normal file
View File

@ -0,0 +1,67 @@
[Back to README](../README.md)
---
# 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 tempest
```
## 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#tempest
```
## 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#hydra
```
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#lookingglass
```

65
docs/repair-nextcloud.md Normal file
View File

@ -0,0 +1,65 @@
# Repairing Nextcloud
You can run the maintenance commands like this:
```
sudo -u nextcloud nextcloud-occ maintenance:mode --on
sudo -u nextcloud nextcloud-occ maintenance:repair
sudo -u nextcloud nextcloud-occ maintenance:mode --off
```
## Rescan Files
```
sudo -u nextcloud nextcloud-occ files:scan --all
```
## Converting from SQLite to MySQL (mariadb)
First: keep Nextcloud set to SQLite as its dbtype, and separately launch MySQL
as a service by copying the configuration found
[here](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/web-apps/nextcloud.nix).
No password is necessary, since the user-based auth works with UNIX sockets.
You can connect to the MySQL instance like this:
```
sudo -u nextcloud mysql -S /run/mysqld/mysqld.sock
```
Create a blank database for Nextcloud:
```sql
create database nextcloud;
```
Now setup the [conversion](https://docs.nextcloud.com/server/17/admin_manual/configuration_database/db_conversion.html):
```
sudo -u nextcloud nextcloud-occ db:convert-type mysql nextcloud localhost nextcloud
```
Ignore the password prompt. Proceed with the conversion.
Now `config.php` will be updated but the override config from NixOS will not
be. Now update your NixOS configuration:
- Remove the `mysql` service you created.
- Set `dbtype` to `mysql`.
- Set `database.createLocally` to `true`.
Rebuild your configuration.
Now, make sure to enable [4-byte
support](https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/mysql_4byte_support.html)
in the database.
## Backing Up MySQL Database
Use this mysqldump command:
```
sudo -u nextcloud mysqldump -S /run/mysqld/mysqld.sock --default-character-set=utf8mb4 nextcloud > backup.sql
```

View File

@ -1,43 +0,0 @@
# Restoring Nextcloud From Backup
Install the `litestream` package.
```
nix-shell --run fish -p litestream
```
Set the S3 credentials:
```
set -x AWS_ACCESS_KEY_ID (read)
set -x AWS_SECRET_ACCESS_KEY (read)
```
Restore from S3:
```
litestream restore -o nextcloud.db s3://noahmasur-backup.s3.us-west-002.backblazeb2.com/nextcloud
```
Install Nextcloud. Then copy DB:
```
sudo rm /data/nextcloud/data/nextcloud.db*
sudo mv nextcloud.db /data/nextcloud/data/
sudo chown nextcloud:nextcloud /data/nextcloud/data/nextcloud.db
sudo chmod 770 /data/nextcloud/data/nextcloud.db
```
Restart Nextcloud:
```
sudo systemctl restart phpfpm-nextcloud.service
```
Adjust Permissions and Directories:
```
sudo mkdir /data/nextcloud/data/noah/files
sudo chown nextcloud:nextcloud /data/nextcloud/data/noah/files
```

45
docs/zfs.md Normal file
View File

@ -0,0 +1,45 @@
# ZFS
Swan runs its root on ext4. The ZFS drives are managed imperatively (this
[disko configuration](../disks/zfs.nix) is an unused work-in-progress).
The basic ZFS settings are managed [here](../modules/nixos/hardware/zfs.nix).
## Creating a New Dataset
```
sudo zfs create tank/mydataset
sudo zfs set compression=zstd tank/myzstddataset
sudo zfs set mountpoint=/data/mydataset tank/mydataset
```
## Maintenance
### Get Status
```
sudo zpool status
```
### Replace Disk
```
sudo zdb
sudo zpool status -g # Show by GUID
sudo zpool offline tank <GUID>
sudo zpool status
# Remove old disk, insert new disk
sudo zdb
sudo zpool replace tank <OLD GUID> /dev/disk/by-id/<NEW PATH>
sudo zpool status
```
## Initial Setup
```
sudo zpool create tank raidz1 sda sdb sdc
sudo zpool set ashift=12 tank
sudo zpool set autoexpand=on tank
sudo zpool set compression=on tank
```

531
flake.lock generated
View File

@ -3,31 +3,66 @@
"Comment-nvim-src": { "Comment-nvim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1674040818, "lastModified": 1681214440,
"narHash": "sha256-7UtZAE9tPlnpeHS2LLol/LGVOxptDXNKWXHNHvFBNk4=", "narHash": "sha256-48hy+hiaDJLlgWqC7IeZI3dT+VwWkRo4atQbyPxu/ys=",
"owner": "numToStr", "owner": "numToStr",
"repo": "Comment.nvim", "repo": "Comment.nvim",
"rev": "eab2c83a0207369900e92783f56990808082eac2", "rev": "e51f2b142d88bb666dcaa77d93a07f4b419aca70",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numToStr", "owner": "numToStr",
"ref": "v0.8.0",
"repo": "Comment.nvim", "repo": "Comment.nvim",
"type": "github" "type": "github"
} }
}, },
"age": {
"flake": false,
"locked": {
"lastModified": 1672087018,
"narHash": "sha256-LRxxJQLQkzoCNYGS/XBixVmYXoZ1mPHKvFicPGXYLcw=",
"owner": "FiloSottile",
"repo": "age",
"rev": "c6dcfa1efcaa27879762a934d5bea0d1b83a894c",
"type": "github"
},
"original": {
"owner": "FiloSottile",
"ref": "v1.1.1",
"repo": "age",
"type": "github"
}
},
"baleia-nvim-src": {
"flake": false,
"locked": {
"lastModified": 1681806450,
"narHash": "sha256-jxRlIzWbnSj89032msc5w+2TVt7zVyzlxdXxiH1dQqY=",
"owner": "m00qek",
"repo": "baleia.nvim",
"rev": "00bb4af31c8c3865b735d40ebefa6c3f07b2dd16",
"type": "github"
},
"original": {
"owner": "m00qek",
"repo": "baleia.nvim",
"type": "github"
}
},
"bufferline-nvim-src": { "bufferline-nvim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1676130961, "lastModified": 1687763763,
"narHash": "sha256-3LT45i0eSMfUV9EBrtdtzHxFKRATIhRy/faDd3lI3mA=", "narHash": "sha256-wbOeylzjjScQXkrDbBU2HtrOZrp2YUK+wQ2aOkgxmRQ=",
"owner": "akinsho", "owner": "akinsho",
"repo": "bufferline.nvim", "repo": "bufferline.nvim",
"rev": "84b0822b2af478d0b4f7b0f9249ca218855331db", "rev": "bf2f6b7edd0abf6b0732f5e5c0a8f30e51611c75",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "akinsho", "owner": "akinsho",
"ref": "v4.2.0",
"repo": "bufferline.nvim", "repo": "bufferline.nvim",
"type": "github" "type": "github"
} }
@ -35,11 +70,11 @@
"cmp-nvim-lsp-src": { "cmp-nvim-lsp-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1675708067, "lastModified": 1687494203,
"narHash": "sha256-DxpcPTBlvVP88PDoTheLV2fC76EXDqS2UpM5mAfj/D4=", "narHash": "sha256-mU0soCz79erJXMMqD/FyrJZ0mu2n6fE0deymPzQlxts=",
"owner": "hrsh7th", "owner": "hrsh7th",
"repo": "cmp-nvim-lsp", "repo": "cmp-nvim-lsp",
"rev": "0e6b2ed705ddcff9738ec4ea838141654f12eeef", "rev": "44b16d11215dce86f253ce0c30949813c0a90765",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -55,11 +90,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1673295039, "lastModified": 1696043447,
"narHash": "sha256-AsdYgE8/GPwcelGgrntlijMg4t3hLFJFCRF3tL5WVjA=", "narHash": "sha256-VbJ1dY5pVH2fX1bS+cT2+4+BYEk4lMHRP0+udu9G6tk=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "87b9d090ad39b25b2400029c64825fc2a8868943", "rev": "792c2e01347cb1b2e7ec84a1ef73453ca86537d8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -76,11 +111,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1677116397, "lastModified": 1695864092,
"narHash": "sha256-2OHwhv4k1SDEuNxhq+zluvrd5pbW8d4TP9NKW4B8iO8=", "narHash": "sha256-Hu1SkFPqO7ND95AOzBkZE2jGXSYhfZ965C03O72Kbu8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "8fddb2fd721365fa77ff68b709539639d4dc65d7", "rev": "19b62324663b6b9859caf7f335d232cf4f1f6a32",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -91,14 +126,16 @@
}, },
"firefox-darwin": { "firefox-darwin": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs" "nixpkgs": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1676854489, "lastModified": 1696034364,
"narHash": "sha256-hWmx3JFLNPGMtflyjgEn5GZydbLW3msjXvarS1NsBDM=", "narHash": "sha256-7giewUYqKhhfhKRxe2EPHCpSM0oMLuByW4RTRZl6Jfc=",
"owner": "bandithedoge", "owner": "bandithedoge",
"repo": "nixpkgs-firefox-darwin", "repo": "nixpkgs-firefox-darwin",
"rev": "6a5cca0ea8dfab4718e1e43e243c80ba110c2364", "rev": "b1e4d451a15c34d45bfefb05137a20469399a2df",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -124,12 +161,15 @@
} }
}, },
"flake-utils": { "flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": { "locked": {
"lastModified": 1667395993, "lastModified": 1687709756,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -139,12 +179,15 @@
} }
}, },
"flake-utils_2": { "flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": { "locked": {
"lastModified": 1659877975, "lastModified": 1685518550,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -154,12 +197,15 @@
} }
}, },
"flake-utils_3": { "flake-utils_3": {
"inputs": {
"systems": "systems_3"
},
"locked": { "locked": {
"lastModified": 1667395993, "lastModified": 1694529238,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -168,19 +214,34 @@
"type": "github" "type": "github"
} }
}, },
"hmts-nvim-src": {
"flake": false,
"locked": {
"lastModified": 1693226725,
"narHash": "sha256-jUuztOqNBltC3axa7s3CPJz9Cmukfwkf846+Z/gAxCU=",
"owner": "calops",
"repo": "hmts.nvim",
"rev": "14fd941d7ec2bb98314a1aacaa2573d97f1629ab",
"type": "github"
},
"original": {
"owner": "calops",
"repo": "hmts.nvim",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ]
"utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1678271387, "lastModified": 1696063111,
"narHash": "sha256-H2dv/i1LRlunRtrESirELzfPWdlG/6ElDB1ksO529H4=", "narHash": "sha256-F2IJEbyH3xG0eqyAYn9JoV+niqNz+xb4HICYNkkviNI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "36999b8d19eb6eebb41983ef017d7e0095316af2", "rev": "ae896c810f501bf0c3a2fd7fc2de094dd0addf01",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -190,22 +251,61 @@
"type": "github" "type": "github"
} }
}, },
"nextcloud-cookbook": {
"flake": false,
"locked": {
"narHash": "sha256-XgBwUr26qW6wvqhrnhhhhcN4wkI+eXDHnNSm1HDbP6M=",
"type": "tarball",
"url": "https://github.com/nextcloud/cookbook/releases/download/v0.10.2/Cookbook-0.10.2.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/nextcloud/cookbook/releases/download/v0.10.2/Cookbook-0.10.2.tar.gz"
}
},
"nextcloud-external": {
"flake": false,
"locked": {
"narHash": "sha256-X7eC8T8wSZGVwCQp6U/WxjMC7aIj39osgHotaUoRNSQ=",
"type": "tarball",
"url": "https://github.com/nextcloud-releases/external/releases/download/v5.2.1/external-v5.2.1.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/nextcloud-releases/external/releases/download/v5.2.1/external-v5.2.1.tar.gz"
}
},
"nextcloud-news": {
"flake": false,
"locked": {
"narHash": "sha256-cfJkKRNSz15L4E3w1tnEb+t4MrVwVzb8lb6vCOA4cK4=",
"type": "tarball",
"url": "https://github.com/nextcloud/news/releases/download/24.0.0/news.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/nextcloud/news/releases/download/24.0.0/news.tar.gz"
}
},
"nil": { "nil": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2", "nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1676110678, "lastModified": 1691372739,
"narHash": "sha256-hemg8rMKS2me2Wua9ZG/0aQ8fEOfytjyKB+WYcXfEKE=", "narHash": "sha256-fZ8KfBMcIFO/R7xaWtB85SFeuUjb9SCH8fxYBnY8068=",
"owner": "oxalica", "owner": "oxalica",
"repo": "nil", "repo": "nil",
"rev": "ce2e0b5d60fe497134050796f7d12ffb6b50eb28", "rev": "97abe7d3d48721d4e0fcc1876eea83bb4247825b",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "oxalica", "owner": "oxalica",
"ref": "2023-08-09",
"repo": "nil", "repo": "nil",
"type": "github" "type": "github"
} }
@ -218,11 +318,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1673891598, "lastModified": 1685980282,
"narHash": "sha256-EevceKxQtA+I0XVA8tBGKmYV1V1KbWc3gsswysMzeDk=", "narHash": "sha256-uQyVaoqkiocA8bXKMfrgizuKmz0hUzHye5owFoUd2AQ=",
"owner": "gytis-ivaskevicius", "owner": "gytis-ivaskevicius",
"repo": "nix2vim", "repo": "nix2vim",
"rev": "5b31eb81e2c6c74f9e8a4911660f3bf585d55158", "rev": "3836a348503ae27340c7f83f0bc7bcb907f3781d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -233,11 +333,11 @@
}, },
"nixlib": { "nixlib": {
"locked": { "locked": {
"lastModified": 1636849918, "lastModified": 1693701915,
"narHash": "sha256-nzUK6dPcTmNVrgTAC1EOybSMsrcx+QrVPyqRdyKLkjA=", "narHash": "sha256-waHPLdDYUOHSEtMKKabcKIMhlUOHPOOPQ9UyFeEoovs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs.lib", "repo": "nixpkgs.lib",
"rev": "28a5b0557f14124608db68d3ee1f77e9329e9dd5", "rev": "f5af57d3ef9947a70ac86e42695231ac1ad00c25",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -254,11 +354,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1674666581, "lastModified": 1696058303,
"narHash": "sha256-KNI2s/xrL7WOYaPJAWKBtb7cCH3335rLfsL+B+ssuGY=", "narHash": "sha256-eNqKWpF5zG0SrgbbtljFOrRgFgRzCc4++TMFADBMLnc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixos-generators", "repo": "nixos-generators",
"rev": "6a5dc1d3d557ea7b5c19b15ff91955124d0400fa", "rev": "150f38bd1e09e20987feacb1b0d5991357532fb5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -269,43 +369,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1639237670, "lastModified": 1695830400,
"narHash": "sha256-RTdL4rEQcgaZGpvtDgkp3oK/V+1LM3I53n0ACPSroAQ=", "narHash": "sha256-gToZXQVr0G/1WriO83olnqrLSHF2Jb8BPcmCt497ro0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "edfb969386ebe6c3cf8f878775a7975cd88f926d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1675309347,
"narHash": "sha256-D3CQ6HRDT2m3XJlrzb5jKq4vNFR5xFTEFKC7iSjlFpM=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "006c3bd4dd2f5d1d2094047f307cbf9e2b73d9c5", "rev": "8a86b98f0ba1c405358f1b71ff8b5e1d317f5db2",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1676885936,
"narHash": "sha256-ZRKb6zBfTvdCOXI7nGC1L9UWSU5ay2ltxg+f5UIzBOU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b69883faca9542d135fa6bab7928ff1b233c167f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -315,18 +383,34 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": { "nixpkgs-keyd": {
"locked": { "locked": {
"lastModified": 1674868155, "lastModified": 1690363189,
"narHash": "sha256-eFNm2h6fNbgD7ZpO4MHikCB5pSnCJ7DTmwPisjetmwc=", "narHash": "sha256-Zs0VkngOtQz7nIEO7Wi8AwGB4TBSex2KZAw784aOm2M=",
"owner": "JohnAZoidberg",
"repo": "nixpkgs",
"rev": "6591d332f93422e388ef6337f6b362b4ff8d0724",
"type": "github"
},
"original": {
"owner": "JohnAZoidberg",
"ref": "keyd-2.4.3",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1695825837,
"narHash": "sha256-4Ne11kNRnQsmSJCRSSNkFRSnHC4Y5gPDBIQGjjPfJiU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ce20e9ebe1903ea2ba1ab006ec63093020c761cb", "rev": "5cfafa12d57374f48bcc36fda3274ada276cf69e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-22.11", "ref": "nixos-23.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -334,11 +418,11 @@
"null-ls-nvim-src": { "null-ls-nvim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1676246878, "lastModified": 1691810493,
"narHash": "sha256-hAUEa2zNsYXQ+TsHYHBzcW67lCxhiD7x+uPbdOZwY8o=", "narHash": "sha256-cWA0rzkOp/ekVKaFee7iea1lhnqKtWUIU+fW5M950wI=",
"owner": "jose-elias-alvarez", "owner": "jose-elias-alvarez",
"repo": "null-ls.nvim", "repo": "null-ls.nvim",
"rev": "d4594231a06cecce73a78a256b0d7c7ab51f7dd5", "rev": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -349,11 +433,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1676251563, "lastModified": 1696080597,
"narHash": "sha256-itLKR2Haeh5wQ6dxkuZ8L5gwp3+CAggpN+w2e7cLQPg=", "narHash": "sha256-fhf7+NT/xMwPZ/sRT30lnI04AHgf7tLPU4ClMux1nWA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nur", "repo": "nur",
"rev": "9a8b28a9d6611f6af9f7abb3e690fc755d6906fe", "rev": "8783c360abc69f58d46a2929534ddd91eb41f3c6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -365,15 +449,16 @@
"nvim-lspconfig-src": { "nvim-lspconfig-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1676175675, "lastModified": 1675639052,
"narHash": "sha256-Wg3NatT4DRBMF6hCxK4C2DC+geFMpfFUFogPbqeMt6E=", "narHash": "sha256-B8IgpypxzCACZ5VcqM6KiWyClaN+KrmemtkwMznmj5Y=",
"owner": "neovim", "owner": "neovim",
"repo": "nvim-lspconfig", "repo": "nvim-lspconfig",
"rev": "1712672e4da3003a0dd9f771d30389600b360f42", "rev": "255e07ce2a05627d482d2de77308bba51b90470c",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "neovim", "owner": "neovim",
"ref": "v0.1.6",
"repo": "nvim-lspconfig", "repo": "nvim-lspconfig",
"type": "github" "type": "github"
} }
@ -381,11 +466,11 @@
"nvim-tree-lua-src": { "nvim-tree-lua-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1676244722, "lastModified": 1695716495,
"narHash": "sha256-xoSekdZhWr59qTOM0/ihYiuKiwHiKYb42Ep5JHn65UM=", "narHash": "sha256-Fkchn7UuIHPmVFFrx1kzsE2lviJrAFAe9tHu73HnS/w=",
"owner": "kyazdani42", "owner": "kyazdani42",
"repo": "nvim-tree.lua", "repo": "nvim-tree.lua",
"rev": "ba1778e061f25814bc5940be886a7f41d7d7736e", "rev": "934469b9b6df369e198fb3016969e56393b0dc07",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -397,42 +482,71 @@
"nvim-treesitter-src": { "nvim-treesitter-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1676240774, "lastModified": 1696061053,
"narHash": "sha256-eRSU/9ysSvTyYxBrp9Whg0eXgAOsCdmIHMlYZK7bjRg=", "narHash": "sha256-KR+VMYTVM2qsLPx412gySAKiGObhs+awbDJhWX72/wY=",
"owner": "nvim-treesitter", "owner": "nvim-treesitter",
"repo": "nvim-treesitter", "repo": "nvim-treesitter",
"rev": "7eb5f1a2e3949496f26c4084b521b30f2d08137a", "rev": "dd4e2dbc002dfce109d621e8bdcd9d89438b0a32",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nvim-treesitter", "owner": "nvim-treesitter",
"ref": "master",
"repo": "nvim-treesitter", "repo": "nvim-treesitter",
"type": "github" "type": "github"
} }
}, },
"proton-ge": {
"flake": false,
"locked": {
"narHash": "sha256-75A0VCVdYkiMQ1duE9r2+DLBJzV02vUozoVLeo/TIWQ=",
"type": "tarball",
"url": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton8-16/GE-Proton8-16.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton8-16/GE-Proton8-16.tar.gz"
}
},
"root": { "root": {
"inputs": { "inputs": {
"Comment-nvim-src": "Comment-nvim-src", "Comment-nvim-src": "Comment-nvim-src",
"age": "age",
"baleia-nvim-src": "baleia-nvim-src",
"bufferline-nvim-src": "bufferline-nvim-src", "bufferline-nvim-src": "bufferline-nvim-src",
"cmp-nvim-lsp-src": "cmp-nvim-lsp-src", "cmp-nvim-lsp-src": "cmp-nvim-lsp-src",
"darwin": "darwin", "darwin": "darwin",
"disko": "disko", "disko": "disko",
"firefox-darwin": "firefox-darwin", "firefox-darwin": "firefox-darwin",
"hmts-nvim-src": "hmts-nvim-src",
"home-manager": "home-manager", "home-manager": "home-manager",
"nextcloud-cookbook": "nextcloud-cookbook",
"nextcloud-external": "nextcloud-external",
"nextcloud-news": "nextcloud-news",
"nil": "nil", "nil": "nil",
"nix2vim": "nix2vim", "nix2vim": "nix2vim",
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs",
"nixpkgs-keyd": "nixpkgs-keyd",
"null-ls-nvim-src": "null-ls-nvim-src", "null-ls-nvim-src": "null-ls-nvim-src",
"nur": "nur", "nur": "nur",
"nvim-lspconfig-src": "nvim-lspconfig-src", "nvim-lspconfig-src": "nvim-lspconfig-src",
"nvim-tree-lua-src": "nvim-tree-lua-src", "nvim-tree-lua-src": "nvim-tree-lua-src",
"nvim-treesitter-src": "nvim-treesitter-src", "nvim-treesitter-src": "nvim-treesitter-src",
"proton-ge": "proton-ge",
"telescope-nvim-src": "telescope-nvim-src", "telescope-nvim-src": "telescope-nvim-src",
"telescope-project-nvim-src": "telescope-project-nvim-src", "telescope-project-nvim-src": "telescope-project-nvim-src",
"toggleterm-nvim-src": "toggleterm-nvim-src", "toggleterm-nvim-src": "toggleterm-nvim-src",
"tree-sitter-bash": "tree-sitter-bash",
"tree-sitter-ini": "tree-sitter-ini",
"tree-sitter-lua": "tree-sitter-lua",
"tree-sitter-puppet": "tree-sitter-puppet",
"tree-sitter-python": "tree-sitter-python",
"tree-sitter-rasi": "tree-sitter-rasi",
"vscode-terraform-snippets": "vscode-terraform-snippets",
"wallpapers": "wallpapers", "wallpapers": "wallpapers",
"wsl": "wsl" "wsl": "wsl",
"zenyd-mpv-scripts": "zenyd-mpv-scripts"
} }
}, },
"rust-overlay": { "rust-overlay": {
@ -447,11 +561,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1675391458, "lastModified": 1688783586,
"narHash": "sha256-ukDKZw922BnK5ohL9LhwtaDAdCsJL7L6ScNEyF1lO9w=", "narHash": "sha256-HHaM2hk2azslv1kH8zmQxXo2e7i5cKgzNIuK4yftzB0=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "383a4acfd11d778d5c2efcf28376cbd845eeaedf", "rev": "7a29283cc242c2486fc67f60b431ef708046d176",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -460,18 +574,64 @@
"type": "github" "type": "github"
} }
}, },
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"telescope-nvim-src": { "telescope-nvim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1675149856, "lastModified": 1686302912,
"narHash": "sha256-L4Kw94CUy6N7zcyy9INuR/O0fxQ7sp0IvGd/u7fHxMA=", "narHash": "sha256-fV3LLRwAPykVGc4ImOnUSP+WTrPp9Ad9OTfBJ6wqTMk=",
"owner": "nvim-telescope", "owner": "nvim-telescope",
"repo": "telescope.nvim", "repo": "telescope.nvim",
"rev": "203bf5609137600d73e8ed82703d6b0e320a5f36", "rev": "776b509f80dd49d8205b9b0d94485568236d1192",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nvim-telescope", "owner": "nvim-telescope",
"ref": "0.1.2",
"repo": "telescope.nvim", "repo": "telescope.nvim",
"type": "github" "type": "github"
} }
@ -479,11 +639,11 @@
"telescope-project-nvim-src": { "telescope-project-nvim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1671805267, "lastModified": 1682606566,
"narHash": "sha256-S4SOHzQ17ux5pcwwYFpVVLzjLeC4/EJ0IFPbrfzUJC8=", "narHash": "sha256-H6lrPjpOUVleKHB0ziI+6dthg9ymitHhEWtcgYJTrKo=",
"owner": "nvim-telescope", "owner": "nvim-telescope",
"repo": "telescope-project.nvim", "repo": "telescope-project.nvim",
"rev": "8e8ee37b7210761502cdf2c3a82b5ba8fb5b2972", "rev": "7c64b181dd4e72deddcf6f319e3bf1e95b2a2f30",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -495,31 +655,132 @@
"toggleterm-nvim-src": { "toggleterm-nvim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1675358836, "lastModified": 1685434104,
"narHash": "sha256-9O7p/7tRStg51OFhMc88M5ewYquiYC9x9CV4s5veVP8=", "narHash": "sha256-oiCnBrvft6XxiQtQH8E4F842xhh348SaTpHzaeb+iDY=",
"owner": "akinsho", "owner": "akinsho",
"repo": "toggleterm.nvim", "repo": "toggleterm.nvim",
"rev": "19aad0f41f47affbba1274f05e3c067e6d718e1e", "rev": "95204ece0f2a54c89c4395295432f9aeedca7b5f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "akinsho", "owner": "akinsho",
"ref": "v2.7.0",
"repo": "toggleterm.nvim", "repo": "toggleterm.nvim",
"type": "github" "type": "github"
} }
}, },
"utils": { "tree-sitter-bash": {
"flake": false,
"locked": { "locked": {
"lastModified": 1676283394, "lastModified": 1695263734,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", "narHash": "sha256-dJUJGrpBWBLjcqiqxCnJ/MENwa2+uxAmQD71aYloxsw=",
"owner": "numtide", "owner": "tree-sitter",
"repo": "flake-utils", "repo": "tree-sitter-bash",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", "rev": "fd4e40dab883d6456da4d847de8321aee9c80805",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "owner": "tree-sitter",
"repo": "flake-utils", "ref": "master",
"repo": "tree-sitter-bash",
"type": "github"
}
},
"tree-sitter-ini": {
"flake": false,
"locked": {
"lastModified": 1690815608,
"narHash": "sha256-IIpKzpA4q1jpYVZ75VZaxWHaqNt8TA427eMOui2s71M=",
"owner": "justinmk",
"repo": "tree-sitter-ini",
"rev": "7f11a02fb8891482068e0fe419965d7bade81a68",
"type": "github"
},
"original": {
"owner": "justinmk",
"repo": "tree-sitter-ini",
"type": "github"
}
},
"tree-sitter-lua": {
"flake": false,
"locked": {
"lastModified": 1694072484,
"narHash": "sha256-5t5w8KqbefInNbA12/jpNzmky/uOUhsLjKdEqpl1GEc=",
"owner": "MunifTanjim",
"repo": "tree-sitter-lua",
"rev": "9668709211b2e683f27f414454a8b51bf0a6bda1",
"type": "github"
},
"original": {
"owner": "MunifTanjim",
"ref": "main",
"repo": "tree-sitter-lua",
"type": "github"
}
},
"tree-sitter-puppet": {
"flake": false,
"locked": {
"lastModified": 1690231696,
"narHash": "sha256-YEjjy9WLwITERYqoeSVrRYnwVBIAwdc4o0lvAK9wizw=",
"owner": "amaanq",
"repo": "tree-sitter-puppet",
"rev": "9ce9a5f7d64528572aaa8d59459ba869e634086b",
"type": "github"
},
"original": {
"owner": "amaanq",
"repo": "tree-sitter-puppet",
"type": "github"
}
},
"tree-sitter-python": {
"flake": false,
"locked": {
"lastModified": 1695282953,
"narHash": "sha256-gRhD3M1DkmwYQDDnyRq6QMTWUJUY0vbetGnN+pBTd84=",
"owner": "tree-sitter",
"repo": "tree-sitter-python",
"rev": "a901729099257aac932d79c60adb5e8a53fa7e6c",
"type": "github"
},
"original": {
"owner": "tree-sitter",
"ref": "master",
"repo": "tree-sitter-python",
"type": "github"
}
},
"tree-sitter-rasi": {
"flake": false,
"locked": {
"lastModified": 1678701563,
"narHash": "sha256-2nYZoLcrxxxiOJEySwHUm93lzMg8mU+V7LIP63ntFdA=",
"owner": "Fymyte",
"repo": "tree-sitter-rasi",
"rev": "371dac6bcce0df5566c1cfebde69d90ecbeefd2d",
"type": "github"
},
"original": {
"owner": "Fymyte",
"repo": "tree-sitter-rasi",
"type": "github"
}
},
"vscode-terraform-snippets": {
"flake": false,
"locked": {
"lastModified": 1614849738,
"narHash": "sha256-v392tyzXV+zyBNt5OCB2NBCK7JcByrTa5Ne/nFtSCJI=",
"owner": "run-at-scale",
"repo": "vscode-terraform-doc-snippets",
"rev": "6ab3e44b566e660f38922cf908e6e547eaa5d4b4",
"type": "github"
},
"original": {
"owner": "run-at-scale",
"repo": "vscode-terraform-doc-snippets",
"type": "github" "type": "github"
} }
}, },
@ -543,14 +804,14 @@
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1676126384, "lastModified": 1696053802,
"narHash": "sha256-3aAnN891Cb1pizewAgaHIo3W1WbAjXtoWuX8n3j8YoI=", "narHash": "sha256-8TTbJbtGDz1MstExrVQe56eXZpovvZv6G6L6q/4NOKg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NixOS-WSL", "repo": "NixOS-WSL",
"rev": "a1c7e8bebac32cfac7aa8498bdfc60cbff13eb50", "rev": "cadde47d123d1a534c272b04a7582f1d11474c48",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -558,6 +819,22 @@
"repo": "NixOS-WSL", "repo": "NixOS-WSL",
"type": "github" "type": "github"
} }
},
"zenyd-mpv-scripts": {
"flake": false,
"locked": {
"lastModified": 1650625438,
"narHash": "sha256-OBCuzCtgfSwj0i/rBNranuu4LRc47jObwQIJgQQoerg=",
"owner": "zenyd",
"repo": "mpv-scripts",
"rev": "19ea069abcb794d1bf8fac2f59b50d71ab992130",
"type": "github"
},
"original": {
"owner": "zenyd",
"repo": "mpv-scripts",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

227
flake.nix
View File

@ -7,6 +7,10 @@
# Used for system packages # Used for system packages
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Update to keyd 2.4.3 not yet in nixpkgs-unstable
# https://github.com/NixOS/nixpkgs/pull/245327
nixpkgs-keyd.url = "github:JohnAZoidberg/nixpkgs/keyd-2.4.3";
# Used for MacOS system config # Used for MacOS system config
darwin = { darwin = {
url = "github:/lnl7/nix-darwin/master"; url = "github:/lnl7/nix-darwin/master";
@ -16,18 +20,21 @@
# Used for Windows Subsystem for Linux compatibility # Used for Windows Subsystem for Linux compatibility
wsl.url = "github:nix-community/NixOS-WSL"; wsl.url = "github:nix-community/NixOS-WSL";
# Used for user packages # Used for user packages and dotfiles
home-manager = { home-manager = {
url = "github:nix-community/home-manager/master"; url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = inputs.nixpkgs.follows =
"nixpkgs"; # Use system packages list where available "nixpkgs"; # Use system packages list for their inputs
}; };
# Community packages; used for Firefox extensions # Community packages; used for Firefox extensions
nur.url = "github:nix-community/nur"; nur.url = "github:nix-community/nur";
# Use official Firefox binary for macOS # Use official Firefox binary for macOS
firefox-darwin.url = "github:bandithedoge/nixpkgs-firefox-darwin"; firefox-darwin = {
url = "github:bandithedoge/nixpkgs-firefox-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
# Manage disk format and partitioning # Manage disk format and partitioning
disko = { disko = {
@ -54,11 +61,15 @@
}; };
# Nix language server # Nix language server
nil.url = "github:oxalica/nil"; nil = {
url = "github:oxalica/nil/2023-08-09";
inputs.nixpkgs.follows = "nixpkgs";
};
# Neovim plugins # Neovim plugins
nvim-lspconfig-src = { nvim-lspconfig-src = {
url = "github:neovim/nvim-lspconfig"; # https://github.com/neovim/nvim-lspconfig/tags
url = "github:neovim/nvim-lspconfig/v0.1.6";
flake = false; flake = false;
}; };
cmp-nvim-lsp-src = { cmp-nvim-lsp-src = {
@ -69,16 +80,21 @@
url = "github:jose-elias-alvarez/null-ls.nvim"; url = "github:jose-elias-alvarez/null-ls.nvim";
flake = false; flake = false;
}; };
baleia-nvim-src = {
url = "github:m00qek/baleia.nvim";
flake = false;
};
Comment-nvim-src = { Comment-nvim-src = {
url = "github:numToStr/Comment.nvim"; url = "github:numToStr/Comment.nvim/v0.8.0";
flake = false; flake = false;
}; };
nvim-treesitter-src = { nvim-treesitter-src = {
url = "github:nvim-treesitter/nvim-treesitter"; # https://github.com/nvim-treesitter/nvim-treesitter/tags
url = "github:nvim-treesitter/nvim-treesitter/master";
flake = false; flake = false;
}; };
telescope-nvim-src = { telescope-nvim-src = {
url = "github:nvim-telescope/telescope.nvim"; url = "github:nvim-telescope/telescope.nvim/0.1.2";
flake = false; flake = false;
}; };
telescope-project-nvim-src = { telescope-project-nvim-src = {
@ -86,17 +102,92 @@
flake = false; flake = false;
}; };
toggleterm-nvim-src = { toggleterm-nvim-src = {
url = "github:akinsho/toggleterm.nvim"; url = "github:akinsho/toggleterm.nvim/v2.7.0";
flake = false; flake = false;
}; };
bufferline-nvim-src = { bufferline-nvim-src = {
url = "github:akinsho/bufferline.nvim"; url = "github:akinsho/bufferline.nvim/v4.2.0";
flake = false; flake = false;
}; };
nvim-tree-lua-src = { nvim-tree-lua-src = {
url = "github:kyazdani42/nvim-tree.lua"; url = "github:kyazdani42/nvim-tree.lua";
flake = false; flake = false;
}; };
vscode-terraform-snippets = {
url = "github:run-at-scale/vscode-terraform-doc-snippets";
flake = false;
};
hmts-nvim-src = {
url = "github:calops/hmts.nvim";
flake = false;
};
# Tree-Sitter Grammars
tree-sitter-bash = {
url = "github:tree-sitter/tree-sitter-bash/master";
flake = false;
};
tree-sitter-python = {
url = "github:tree-sitter/tree-sitter-python/master";
flake = false;
};
tree-sitter-lua = {
url = "github:MunifTanjim/tree-sitter-lua/main";
flake = false;
};
tree-sitter-ini = {
url = "github:justinmk/tree-sitter-ini";
flake = false;
};
tree-sitter-puppet = {
url = "github:amaanq/tree-sitter-puppet";
flake = false;
};
tree-sitter-rasi = {
url = "github:Fymyte/tree-sitter-rasi";
flake = false;
};
# MPV Scripts
zenyd-mpv-scripts = {
url = "github:zenyd/mpv-scripts";
flake = false;
};
# Age encryption (pin because of failed builds)
age = {
url = "github:FiloSottile/age/v1.1.1";
flake = false;
};
# GE version of Proton for game compatibility
# Alternatively, could consider using https://github.com/fufexan/nix-gaming
proton-ge = {
# https://github.com/GloriousEggroll/proton-ge-custom/releases
url =
"https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton8-16/GE-Proton8-16.tar.gz";
flake = false;
};
# Nextcloud Apps
nextcloud-news = {
# https://github.com/nextcloud/news/releases
url =
"https://github.com/nextcloud/news/releases/download/24.0.0/news.tar.gz";
flake = false;
};
nextcloud-external = {
# https://github.com/nextcloud-releases/external/releases
url =
"https://github.com/nextcloud-releases/external/releases/download/v5.2.1/external-v5.2.1.tar.gz";
flake = false;
};
nextcloud-cookbook = {
# https://github.com/nextcloud/cookbook/releases
url =
"https://github.com/nextcloud/cookbook/releases/download/v0.10.2/Cookbook-0.10.2.tar.gz";
flake = false;
};
}; };
@ -105,13 +196,26 @@
let let
# Global configuration for my systems # Global configuration for my systems
globals = rec { globals = let baseName = "masu.rs";
in rec {
user = "noah"; user = "noah";
fullName = "Noah Masur"; fullName = "Noah Masur";
gitName = fullName; gitName = fullName;
gitEmail = "7386960+nmasur@users.noreply.github.com"; gitEmail = "7386960+nmasur@users.noreply.github.com";
mail.server = "noahmasur.com"; mail.server = "noahmasur.com";
dotfilesRepo = "git@github.com:nmasur/dotfiles"; mail.imapHost = "imap.purelymail.com";
mail.smtpHost = "smtp.purelymail.com";
dotfilesRepo = "https://github.com/nmasur/dotfiles";
hostnames = {
git = "git.${baseName}";
metrics = "metrics.${baseName}";
prometheus = "prom.${baseName}";
secrets = "vault.${baseName}";
stream = "stream.${baseName}";
content = "cloud.${baseName}";
books = "books.${baseName}";
download = "download.${baseName}";
};
}; };
# Common overlays to always use # Common overlays to always use
@ -120,6 +224,15 @@
inputs.nix2vim.overlay inputs.nix2vim.overlay
(import ./overlays/neovim-plugins.nix inputs) (import ./overlays/neovim-plugins.nix inputs)
(import ./overlays/calibre-web.nix) (import ./overlays/calibre-web.nix)
(import ./overlays/disko.nix inputs)
(import ./overlays/tree-sitter.nix inputs)
(import ./overlays/caddy.nix inputs)
(import ./overlays/mpv-scripts.nix inputs)
(import ./overlays/nextcloud-apps.nix inputs)
(import ./overlays/betterlockscreen.nix)
(import ./overlays/age.nix inputs)
(import ./overlays/proton-ge.nix inputs)
(import ./overlays/keyd.nix inputs)
]; ];
# System types to support. # System types to support.
@ -131,6 +244,8 @@
in rec { in rec {
# Contains my full system builds, including home-manager
# nixos-rebuild switch --flake .#tempest
nixosConfigurations = { nixosConfigurations = {
tempest = import ./hosts/tempest { inherit inputs globals overlays; }; tempest = import ./hosts/tempest { inherit inputs globals overlays; };
hydra = import ./hosts/hydra { inherit inputs globals overlays; }; hydra = import ./hosts/hydra { inherit inputs globals overlays; };
@ -138,12 +253,14 @@
swan = import ./hosts/swan { inherit inputs globals overlays; }; swan = import ./hosts/swan { inherit inputs globals overlays; };
}; };
# Contains my full Mac system builds, including home-manager
# darwin-rebuild switch --flake .#lookingglass
darwinConfigurations = { darwinConfigurations = {
lookingglass = lookingglass =
import ./hosts/lookingglass { inherit inputs globals overlays; }; import ./hosts/lookingglass { inherit inputs globals overlays; };
}; };
# For quickly applying local settings with: # For quickly applying home-manager settings with:
# home-manager switch --flake .#tempest # home-manager switch --flake .#tempest
homeConfigurations = { homeConfigurations = {
tempest = tempest =
@ -152,44 +269,37 @@
darwinConfigurations.lookingglass.config.home-manager.users."Noah.Masur".home; darwinConfigurations.lookingglass.config.home-manager.users."Noah.Masur".home;
}; };
# Disk formatting # Disk formatting, only used once
diskoConfigurations = { root = import ./disks/root.nix; }; diskoConfigurations = { root = import ./disks/root.nix; };
# Package servers into images with a generator packages = let
packages = forAllSystems (system: { aws = system:
import ./hosts/aws { inherit inputs globals overlays system; };
aws = { staff = system:
"${system}" = import ./hosts/staff { inherit inputs globals overlays system; };
import ./generators/aws { inherit inputs globals system overlays; }; neovim = system:
}; let pkgs = import nixpkgs { inherit system overlays; };
staff = {
"${system}" = import ./generators/staff {
inherit inputs globals system overlays;
};
};
neovim = let pkgs = import nixpkgs { inherit system overlays; };
in import ./modules/common/neovim/package { in import ./modules/common/neovim/package {
inherit pkgs; inherit pkgs;
colors = colors = (import ./colorscheme/gruvbox-dark).dark;
import ./colorscheme/gruvbox/neovim-gruvbox.nix { inherit pkgs; }; };
in {
x86_64-linux.aws = aws "x86_64-linux";
x86_64-linux.staff = staff "x86_64-linux";
# Package Neovim config into standalone package
x86_64-linux.neovim = neovim "x86_64-linux";
x86_64-darwin.neovim = neovim "x86_64-darwin";
aarch64-linux.neovim = neovim "aarch64-linux";
aarch64-darwin.neovim = neovim "aarch64-darwin";
}; };
}); # Programs that can be run by calling this flake
apps = forAllSystems (system: apps = forAllSystems (system:
let let pkgs = import nixpkgs { inherit system overlays; };
pkgs = import nixpkgs {
inherit system;
overlays = overlays ++ [
(final: prev: {
disko-packaged = inputs.disko.packages.${system}.disko;
})
];
};
in import ./apps { inherit pkgs; }); in import ./apps { inherit pkgs; });
# Development environments
devShells = forAllSystems (system: devShells = forAllSystems (system:
let pkgs = import nixpkgs { inherit system overlays; }; let pkgs = import nixpkgs { inherit system overlays; };
in { in {
@ -199,23 +309,24 @@
buildInputs = with pkgs; [ git stylua nixfmt shfmt shellcheck ]; 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
];
};
checks = forAllSystems (system:
let pkgs = import nixpkgs { inherit system overlays; };
in {
neovim = pkgs.runCommand "neovim-check-health" {
buildInputs = [ inputs.self.packages.${system}.neovim ];
} ''
mkdir -p $out
export HOME=$TMPDIR
nvim -c "checkhealth" -c "write $out/health.log" -c "quitall"
# Check for errors inside the health log
if $(grep "ERROR" $out/health.log); then
cat $out/health.log
exit 1
fi
'';
}); });
# Templates for starting other projects quickly # Templates for starting other projects quickly

14
hosts/README.md Normal file
View File

@ -0,0 +1,14 @@
# Hosts
These are the individual machines managed by this flake.
| Host | Purpose |
| --- | --- |
| [aws](./aws/default.nix) | AWS AMI |
| [staff](./staff/default.nix) | Live USB stick |
| [flame](./flame/default.nix) | Oracle cloud server |
| [hydra](./hydra/default.nix) | WSL config |
| [lookingglass](./lookingglass/default.nix) | Work MacBook |
| [swan](./swan/default.nix) | Home server |
| [tempest](./tempest/default.nix) | Linux desktop |

View File

@ -1,21 +1,16 @@
{ inputs, globals, ... }: { inputs, system, globals, overlays, ... }:
with inputs; inputs.nixos-generators.nixosGenerate {
nixos-generators.nixosGenerate {
inherit system; inherit system;
format = "amazon"; format = "amazon";
modules = [ modules = [
home-manager.nixosModules.home-manager globals
inputs.home-manager.nixosModules.home-manager
{ {
user = globals.user; nixpkgs.overlays = overlays;
fullName = globals.fullName;
dotfilesRepo = globals.dotfilesRepo;
gitName = globals.gitName;
gitEmail = globals.gitEmail;
networking.hostName = "sheep"; networking.hostName = "sheep";
gui.enable = false; gui.enable = false;
colorscheme = (import ../colorscheme/gruvbox); theme.colors = (import ../../colorscheme/gruvbox).dark;
passwordHash = null; passwordHash = null;
publicKey = publicKey =
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s"; "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
@ -24,7 +19,7 @@ nixos-generators.nixosGenerate {
} }
../../modules/common ../../modules/common
../../modules/nixos ../../modules/nixos
../../modules/common/services/sshd.nix ../../modules/nixos/services/sshd.nix
] ++ [ ] ++ [
# Required to fix diskSize errors during build # Required to fix diskSize errors during build
({ ... }: { amazonImage.sizeMB = 16 * 1024; }) ({ ... }: { amazonImage.sizeMB = 16 * 1024; })

View File

@ -1,7 +1,6 @@
name: 'Terraform' name: 'Terraform'
env: env:
AWS_ACCOUNT_NUMBER: '' AWS_ACCOUNT_NUMBER: ''
AWS_PLAN_ROLE_NAME: github_actions_plan AWS_PLAN_ROLE_NAME: github_actions_plan
AWS_APPLY_ROLE_NAME: github_actions_admin AWS_APPLY_ROLE_NAME: github_actions_admin
@ -82,15 +81,14 @@ jobs:
# Downloads the current repo code to the runner. # Downloads the current repo code to the runner.
- name: Checkout Repo Code - name: Checkout Repo Code
uses: actions/checkout@v2 uses: actions/checkout@v3
# Install Nix # Enable access to KVM, required to build an image
- name: Install Nix - name: Enable KVM group perms
uses: cachix/install-nix-action@v17 run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
# Build the image sudo udevadm control --reload-rules
- name: Build Image sudo udevadm trigger --name-match=kvm
run: nix build .#aws
# Login to AWS # Login to AWS
- name: AWS Assume Role - name: AWS Assume Role
@ -99,6 +97,28 @@ jobs:
role-to-assume: ${{ env.AWS_ROLE_ARN }} role-to-assume: ${{ env.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }} aws-region: ${{ env.AWS_REGION }}
# Install Nix
- name: Install Nix
uses: cachix/install-nix-action@v17
with:
extra_nix_config: |
substituters = s3://insert-cache-bucket https://cache.nixos.org/
trusted-public-keys = insert-cache-bucket:M6PsZjHXcLvbQyPUBLICKEYGVoNwI84g1FBQzouRU= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
# Build the image
- name: Build Image
run: nix build .#aws
# Copy the image to S3
- name: Upload Image to Cache
env:
NIX_CACHE_PRIVATE_KEY: ${{ secrets.NIX_CACHE_PRIVATE_KEY }}
run: |
echo "$NIX_CACHE_PRIVATE_KEY" > cache.key
nix store sign --key-file cache.key $(readlink result)
nix copy --to s3://t2-aws-nixos-test $(readlink result)
rm cache.key
# Exports all GitHub Secrets as environment variables prefixed by # Exports all GitHub Secrets as environment variables prefixed by
# "TF_VAR_", which exposes them to Terraform. The name of each GitHub # "TF_VAR_", which exposes them to Terraform. The name of each GitHub
# Secret must match its Terraform variable name exactly. # Secret must match its Terraform variable name exactly.

View File

@ -3,42 +3,73 @@
# How to install: # How to install:
# https://blog.korfuri.fr/posts/2022/08/nixos-on-an-oracle-free-tier-ampere-machine/ # https://blog.korfuri.fr/posts/2022/08/nixos-on-an-oracle-free-tier-ampere-machine/
# These days, probably use nixos-anywhere instead.
{ inputs, globals, overlays, ... }: { inputs, globals, overlays, ... }:
with inputs; inputs.nixpkgs.lib.nixosSystem {
nixpkgs.lib.nixosSystem {
system = "aarch64-linux"; system = "aarch64-linux";
specialArgs = { }; specialArgs = { };
modules = [ modules = [
./hardware-configuration.nix globals
inputs.home-manager.nixosModules.home-manager
../../modules/common ../../modules/common
../../modules/nixos ../../modules/nixos
(removeAttrs globals [ "mail.server" ])
wsl.nixosModules.wsl
home-manager.nixosModules.home-manager
{ {
server = true;
gui.enable = false;
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
nixpkgs.overlays = overlays; nixpkgs.overlays = overlays;
wsl.enable = false;
caddy.enable = true;
# FQDNs for various services # Hardware
server = true;
networking.hostName = "flame"; networking.hostName = "flame";
bookServer = "books.masu.rs";
# streamServer = "stream.masu.rs";
nextcloudServer = "cloud.masu.rs";
transmissionServer = "download.masu.rs";
metricsServer = "metrics.masu.rs";
vaultwardenServer = "vault.masu.rs";
giteaServer = "git.masu.rs";
# Disable passwords, only use SSH key # Not sure what's necessary but too afraid to remove anything
publicKey = imports = [ (inputs.nixpkgs + "/nixos/modules/profiles/qemu-guest.nix") ];
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s"; boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "usbhid" ];
# File systems must be declared in order to boot
# This is the root filesystem containing NixOS
# I forgot to set a clean label for it
fileSystems."/" = {
device = "/dev/disk/by-uuid/e1b6bd50-306d-429a-9f45-78f57bc597c3";
fsType = "ext4";
};
# This is the boot filesystem for systemd-boot
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/D5CA-237A";
fsType = "vfat";
};
# Theming
# Server doesn't require GUI
gui.enable = false;
# Still require colors for programs like Neovim, K9S
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
# Programs and services
cloudflare.enable = true; # Proxy traffic with Cloudflare
dotfiles.enable = true; # Clone dotfiles
neovim.enable = true;
giteaRunner.enable = true;
services.caddy.enable = true;
services.grafana.enable = true;
services.openssh.enable = true;
services.victoriametrics.enable = true;
services.gitea.enable = true;
services.vaultwarden.enable = true;
services.minecraft-server.enable = true; # Setup Minecraft server
# Allows private remote access over the internet
cloudflareTunnel = {
enable = true;
id = "bd250ee1-ed2e-42d2-b627-039f1eb5a4d2";
credentialsFile = ../../private/cloudflared-flame.age;
ca =
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK/6oyVqjFGX3Uvrc3VS8J9sphxzAnRzKC85xgkHfYgR3TK6qBGXzHrknEj21xeZrr3G2y1UsGzphWJd9ZfIcdA= open-ssh-ca@cloudflareaccess.org";
};
# Nextcloud backup config # Nextcloud backup config
backup.s3 = { backup.s3 = {
@ -47,51 +78,38 @@ nixpkgs.lib.nixosSystem {
accessKeyId = "0026b0e73b2e2c80000000005"; accessKeyId = "0026b0e73b2e2c80000000005";
}; };
# Grant access to Jellyfin directories from Nextcloud # Disable passwords, only use SSH key
users.users.nextcloud.extraGroups = [ "jellyfin" ]; publicKey =
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
# Wireguard config for Transmission # # Wireguard config for Transmission
wireguard.enable = true; # wireguard.enable = true;
networking.wireguard.interfaces.wg0 = { # networking.wireguard.interfaces.wg0 = {
#
# # The local IPs for this machine within the Wireguard network
# # Any inbound traffic bound for these IPs should be kept on localhost
# ips = [ "10.66.13.200/32" "fc00:bbbb:bbbb:bb01::3:dc7/128" ];
#
# peers = [{
#
# # Identity of Wireguard target peer (VPN)
# publicKey = "bOOP5lIjqCdDx5t+mP/kEcSbHS4cZqE0rMlBI178lyY=";
#
# # The public internet address of the target peer
# endpoint = "86.106.143.132:51820";
#
# # Which outgoing IP ranges should be sent through Wireguard
# allowedIPs = [ "0.0.0.0/0" "::0/0" ];
#
# # Send heartbeat signal within the network
# persistentKeepalive = 25;
#
# }];
#
# };
# The local IPs for this machine within the Wireguard network # # VPN port forwarding
# Any inbound traffic bound for these IPs should be kept on localhost # services.transmission.settings.peer-port = 57599;
ips = [ "10.66.13.200/32" "fc00:bbbb:bbbb:bb01::3:dc7/128" ];
peers = [{
# Identity of Wireguard target peer (VPN)
publicKey = "bOOP5lIjqCdDx5t+mP/kEcSbHS4cZqE0rMlBI178lyY=";
# The public internet address of the target peer
endpoint = "86.106.143.132:51820";
# Which outgoing IP ranges should be sent through Wireguard
allowedIPs = [ "0.0.0.0/0" "::0/0" ];
# Send heartbeat signal within the network
persistentKeepalive = 25;
}];
};
# VPN port forwarding
services.transmission.settings.peer-port = 57599;
# Grant access to Transmission directories from Jellyfin
users.users.jellyfin.extraGroups = [ "transmission" ];
# Proxy traffic with Cloudflare
cloudflare.enable = true;
# Setup Minecraft server
gaming.minecraft-server.enable = true;
# Clone dotfiles
dotfiles.enable = true;
neovim.enable = true;
} }
]; ];

View File

@ -1,34 +0,0 @@
# 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.
{ lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "usbhid" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/e1b6bd50-306d-429a-9f45-78f57bc597c3";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/D5CA-237A";
fsType = "vfat";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eth0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}

View File

@ -3,29 +3,26 @@
{ inputs, globals, overlays, ... }: { inputs, globals, overlays, ... }:
with inputs; inputs.nixpkgs.lib.nixosSystem {
nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { }; specialArgs = { };
modules = [ modules = [
../../modules/common ../../modules/common
../../modules/nixos ../../modules/nixos
../../modules/wsl
globals globals
wsl.nixosModules.wsl inputs.wsl.nixosModules.wsl
home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
{ {
networking.hostName = "hydra"; networking.hostName = "hydra";
nixpkgs.overlays = overlays; nixpkgs.overlays = overlays;
# Set registry to flake packages, used for nix X commands
nix.registry.nixpkgs.flake = nixpkgs;
identityFile = "/home/${globals.user}/.ssh/id_ed25519"; identityFile = "/home/${globals.user}/.ssh/id_ed25519";
gui.enable = false; gui.enable = false;
theme = { theme = {
colors = (import ../../colorscheme/gruvbox).dark; colors = (import ../../colorscheme/gruvbox).dark;
dark = true; dark = true;
}; };
passwordHash = nixpkgs.lib.fileContents ../../password.sha512; passwordHash = inputs.nixpkgs.lib.fileContents ../../misc/password.sha512;
wsl = { wsl = {
enable = true; enable = true;
wslConf.automount.root = "/mnt"; wslConf.automount.root = "/mnt";

View File

@ -3,37 +3,33 @@
{ inputs, globals, overlays, ... }: { inputs, globals, overlays, ... }:
with inputs; inputs.darwin.lib.darwinSystem {
darwin.lib.darwinSystem {
system = "x86_64-darwin"; system = "x86_64-darwin";
specialArgs = { }; specialArgs = { };
modules = [ modules = [
../../modules/common ../../modules/common
../../modules/darwin ../../modules/darwin
(globals // { (globals // rec {
user = "Noah.Masur"; user = "Noah.Masur";
gitName = "Noah-Masur_1701"; gitName = "Noah-Masur_1701";
gitEmail = "Noah.Masur@take2games.com"; gitEmail = "${user}@take2games.com";
}) })
home-manager.darwinModules.home-manager inputs.home-manager.darwinModules.home-manager
{ {
networking.hostName = "noah-masur-mac"; nixpkgs.overlays = [ inputs.firefox-darwin.overlay ] ++ overlays;
networking.hostName = "lookingglass";
identityFile = "/Users/Noah.Masur/.ssh/id_ed25519"; identityFile = "/Users/Noah.Masur/.ssh/id_ed25519";
gui.enable = true; gui.enable = true;
theme = { theme = {
colors = (import ../../colorscheme/gruvbox).dark; colors = (import ../../colorscheme/gruvbox-dark).dark;
dark = true; dark = true;
}; };
mail.user = globals.user; mail.user = globals.user;
nixpkgs.overlays = [ firefox-darwin.overlay ] ++ overlays;
# Set registry to flake packages, used for nix X commands
nix.registry.nixpkgs.flake = nixpkgs;
charm.enable = true; charm.enable = true;
neovim.enable = true; neovim.enable = true;
mail.enable = true; mail.enable = true;
mail.aerc.enable = true; mail.aerc.enable = true;
mail.himalaya.enable = true; mail.himalaya.enable = false;
kitty.enable = true; kitty.enable = true;
discord.enable = true; discord.enable = true;
firefox.enable = true; firefox.enable = true;

View File

@ -3,9 +3,7 @@
{ inputs, system, overlays, ... }: { inputs, system, overlays, ... }:
with inputs; inputs.nixos-generators.nixosGenerate {
nixos-generators.nixosGenerate {
inherit system; inherit system;
format = "install-iso"; format = "install-iso";
modules = [{ modules = [{
@ -34,9 +32,7 @@ nixos-generators.nixosGenerate {
curl curl
(import ../../modules/common/neovim/package { (import ../../modules/common/neovim/package {
inherit pkgs; inherit pkgs;
# colors = import ../../colorscheme/gruvbox.dark.neovimConfig { colors = (import ../../colorscheme/gruvbox).dark;
# inherit pkgs;
# };
}) })
]; ];
nix.extraOptions = '' nix.extraOptions = ''

View File

@ -3,47 +3,93 @@
{ inputs, globals, overlays, ... }: { inputs, globals, overlays, ... }:
with inputs; inputs.nixpkgs.lib.nixosSystem {
nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { }; specialArgs = { };
modules = [ modules = [
./hardware-configuration.nix globals
inputs.home-manager.nixosModules.home-manager
inputs.disko.nixosModules.disko
../../modules/common ../../modules/common
../../modules/nixos ../../modules/nixos
(removeAttrs globals [ "mail.server" ])
wsl.nixosModules.wsl
home-manager.nixosModules.home-manager
disko.nixosModules.disko
{ {
nixpkgs.overlays = overlays;
# Hardware
server = true; server = true;
physical = true;
networking.hostName = "swan"; networking.hostName = "swan";
# head -c 8 /etc/machine-id # Not sure what's necessary but too afraid to remove anything
boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
# Required for transcoding
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelParams = [
"radeon.si_support=0"
"amdgpu.si_support=1"
"radeon.cik_support=0"
"amdgpu.cik_support=1"
"amdgpu.dc=1"
];
# Required binary blobs to boot on this machine
hardware.enableRedistributableFirmware = true;
# Prioritize efficiency over performance
powerManagement.cpuFreqGovernor = "powersave";
# Allow firmware updates
hardware.cpu.intel.updateMicrocode = true;
# ZFS
zfs.enable = true;
# Generated with: head -c 8 /etc/machine-id
networking.hostId = "600279f4"; # Random ID required for ZFS networking.hostId = "600279f4"; # Random ID required for ZFS
zfs.enable = true; # Sets root ext4 filesystem instead of declaring it manually
disko = { disko = {
enableConfig = true; enableConfig = true;
devices = (import ../../disks/root.nix { disk = "/dev/nvme0n1"; }); devices = (import ../../disks/root.nix { disk = "/dev/nvme0n1"; });
# // (import ../../disks/zfs.nix {
# pool = "tank";
# disks = [ "/dev/sda" "/dev/sdb" "/dev/sdc" ];
# });
}; };
# Automatically load the ZFS pool on boot
boot.zfs.extraPools = [ "tank" ]; boot.zfs.extraPools = [ "tank" ];
gui.enable = false; # Theming
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
nixpkgs.overlays = overlays;
neovim.enable = true;
caddy.enable = true;
streamServer = "stream.masu.rs";
nextcloudServer = "cloud.masu.rs";
bookServer = "books.masu.rs";
samba.enable = true;
# Server doesn't require GUI
gui.enable = false;
# Still require colors for programs like Neovim, K9S
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
# Programs and services
neovim.enable = true;
cloudflare.enable = true;
dotfiles.enable = true;
arrs.enable = true;
services.bind.enable = true;
services.caddy.enable = true;
services.jellyfin.enable = true;
services.nextcloud.enable = true;
services.calibre-web.enable = true;
services.openssh.enable = true;
services.prometheus.enable = false;
services.vmagent.enable = true;
services.samba.enable = true;
# Allows private remote access over the internet
cloudflareTunnel = {
enable = true;
id = "646754ac-2149-4a58-b51a-e1d0a1f3ade2";
credentialsFile = ../../private/cloudflared-swan.age;
ca =
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCHF/UMtJqPFrf6f6GRY0ZFnkCW7b6sYgUTjTtNfRj1RdmNic1NoJZql7y6BrqQinZvy7nsr1UFDNWoHn6ah3tg= open-ssh-ca@cloudflareaccess.org";
};
# Send regular backups and litestream for DBs to an S3-like bucket
backup.s3 = { backup.s3 = {
endpoint = "s3.us-west-002.backblazeb2.com"; endpoint = "s3.us-west-002.backblazeb2.com";
bucket = "noahmasur-backup"; bucket = "noahmasur-backup";
@ -53,12 +99,6 @@ nixpkgs.lib.nixosSystem {
# Disable passwords, only use SSH key # Disable passwords, only use SSH key
publicKey = publicKey =
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s"; "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
# Clone dotfiles
dotfiles.enable = true;
# services.nfs.server.enable = true;
} }
]; ];
} }

View File

@ -1,39 +0,0 @@
# 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" "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 = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -3,39 +3,90 @@
{ inputs, globals, overlays, ... }: { inputs, globals, overlays, ... }:
with inputs; inputs.nixpkgs.lib.nixosSystem {
nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { };
modules = [ modules = [
./hardware-configuration.nix globals
inputs.home-manager.nixosModules.home-manager
../../modules/common ../../modules/common
../../modules/nixos ../../modules/nixos
globals
wsl.nixosModules.wsl
home-manager.nixosModules.home-manager
{ {
nixpkgs.overlays = overlays;
# Hardware
physical = true; physical = true;
networking.hostName = "tempest"; networking.hostName = "tempest";
nixpkgs.overlays = [ nur.overlay ] ++ overlays;
# Set registry to flake packages, used for nix X commands # Not sure what's necessary but too afraid to remove anything
nix.registry.nixpkgs.flake = nixpkgs; boot.initrd.availableKernelModules =
identityFile = "/home/${globals.user}/.ssh/id_ed25519"; [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
# Graphics and VMs
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ "kvm-amd" ];
services.xserver.videoDrivers = [ "amdgpu" ];
# Required binary blobs to boot on this machine
hardware.enableRedistributableFirmware = true;
# Prioritize performance over efficiency
powerManagement.cpuFreqGovernor = "performance";
# Allow firmware updates
hardware.cpu.amd.updateMicrocode = true;
# Helps reduce GPU fan noise under idle loads
hardware.fancontrol.enable = true;
hardware.fancontrol.config = ''
# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=10
DEVPATH=hwmon0=devices/pci0000:00/0000:00:03.1/0000:06:00.0/0000:07:00.0/0000:08:00.0
DEVNAME=hwmon0=amdgpu
FCTEMPS=hwmon0/pwm1=hwmon0/temp1_input
FCFANS= hwmon0/pwm1=hwmon0/fan1_input
MINTEMP=hwmon0/pwm1=50
MAXTEMP=hwmon0/pwm1=70
MINSTART=hwmon0/pwm1=100
MINSTOP=hwmon0/pwm1=10
MINPWM=hwmon0/pwm1=10
MAXPWM=hwmon0/pwm1=240
'';
# File systems must be declared in order to boot
# This is the root filesystem containing NixOS
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
# This is the boot filesystem for Grub
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
# Secrets must be prepared ahead before deploying
passwordHash = inputs.nixpkgs.lib.fileContents ../../misc/password.sha512;
# Theming
# Turn on all features related to desktop and graphical applications
gui.enable = true; gui.enable = true;
# Set the system-wide theme, also used for non-graphical programs
theme = { theme = {
colors = (import ../../colorscheme/gruvbox).dark; colors = (import ../../colorscheme/gruvbox-dark).dark;
dark = true; dark = true;
}; };
wallpaper = "${wallpapers}/gruvbox/road.jpg"; wallpaper = "${inputs.wallpapers}/gruvbox/road.jpg";
gtk.theme.name = nixpkgs.lib.mkDefault "Adwaita-dark"; gtk.theme.name = inputs.nixpkgs.lib.mkDefault "Adwaita-dark";
passwordHash = nixpkgs.lib.fileContents ../../password.sha512;
wsl.enable = false;
publicKey = null;
# Programs and services
charm.enable = true; charm.enable = true;
neovim.enable = true; neovim.enable = true;
media.enable = true; media.enable = true;
dotfiles.enable = true;
firefox.enable = true; firefox.enable = true;
kitty.enable = true; kitty.enable = true;
_1password.enable = true; _1password.enable = true;
@ -46,18 +97,35 @@ nixpkgs.lib.nixosSystem {
mail.aerc.enable = true; mail.aerc.enable = true;
mail.himalaya.enable = true; mail.himalaya.enable = true;
keybase.enable = true; keybase.enable = true;
# mullvad.enable = true; mullvad.enable = false;
nixlang.enable = true; nixlang.enable = true;
dotfiles.enable = true;
yt-dlp.enable = true; yt-dlp.enable = true;
gaming = { gaming = {
dwarf-fortress.enable = true;
enable = true; enable = true;
steam.enable = true; steam.enable = true;
legendary.enable = true; legendary.enable = true;
lutris.enable = true; lutris.enable = true;
leagueoflegends.enable = true; leagueoflegends.enable = true;
ryujinx.enable = true;
}; };
services.vmagent.enable = true; # Enables Prometheus metrics
services.openssh.enable =
true; # Required for Cloudflare tunnel and identity file
# Allows private remote access over the internet
cloudflareTunnel = {
enable = true;
id = "ac133a82-31fb-480c-942a-cdbcd4c58173";
credentialsFile = ../../private/cloudflared-tempest.age;
ca =
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPY6C0HmdFCaxYtJxFr3qV4/1X4Q8KrYQ1hlme3u1hJXK+xW+lc9Y9glWHrhiTKilB7carYTB80US0O47gI5yU4= open-ssh-ca@cloudflareaccess.org";
};
# Allows requests to force machine to wake up
# This network interface might change, needs to be set specifically for each machine.
# Or set usePredictableInterfaceNames = false
networking.interfaces.enp5s0.wakeOnLan.enable = true;
} }
]; ];

View File

@ -1,40 +0,0 @@
# 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, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
services.xserver.videoDrivers = [ "amdgpu" ];
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp5s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true;
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

21
misc/README.md Normal file
View File

@ -0,0 +1,21 @@
# Miscellaneous
These files contain important data sourced by the configuration, or simply
information to store for safekeeping later.
---
Creating hashed password for [password.sha512](./password.sha512):
```
mkpasswd -m sha-512
```
---
Getting key for [public-keys](./public-keys):
```
ssh-keyscan -t ed25519 <hostname>
```

23
misc/libratbag-profile Normal file
View File

@ -0,0 +1,23 @@
Profile 1: (active)
Name: n/a
Report Rate: 1000Hz
Resolutions:
0: 400dpi (active) (default)
1: 800dpi
2: 1600dpi
3: 2400dpi
4: 0dpi
Button: 0 is mapped to 'button 1'
Button: 1 is mapped to 'button 2'
Button: 2 is mapped to 'button 3'
Button: 3 is mapped to 'button 4'
Button: 4 is mapped to 'button 5'
Button: 5 is mapped to macro '↕F11'
Button: 6 is mapped to macro '↕VOLUMEDOWN'
Button: 7 is mapped to macro '↕VOLUMEUP'
Button: 8 is mapped to 'unknown'
Button: 9 is mapped to 'wheel-right'
Button: 10 is mapped to 'wheel-left'
LED: 0, depth: monochrome, mode: on, color: 000000
LED: 1, depth: monochrome, mode: on, color: 000000
LED: 2, depth: monochrome, mode: on, color: 000000

View File

@ -1,5 +1,6 @@
# Scan hosts: ssh-keyscan -t ed25519 <hostnames> # Scan hosts: ssh-keyscan -t ed25519 <hostnames>
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s tempest ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s personal
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHVknmPi7sG6ES0G0jcsvebzKGWWaMfJTYgvOue6EULI flame ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHVknmPi7sG6ES0G0jcsvebzKGWWaMfJTYgvOue6EULI flame
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ9mwXlZnIALt9SnH3FOZvdgHLM5ZqwYUERXBbM7Rwh6 swan ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ9mwXlZnIALt9SnH3FOZvdgHLM5ZqwYUERXBbM7Rwh6 swan
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC3yHivgEXr2ecwe58h9bkhwTYivf3GwL8xenQKMeiUb tempest

9
modules/README.md Normal file
View File

@ -0,0 +1,9 @@
# Modules
| Module | Purpose |
| --- | --- |
| [common](./common/default.nix) | User programs and OS-agnostic configuration |
| [darwin](./darwin/default.nix) | macOS-specific configuration |
| [nixos](./nixos/default.nix) | NixOS-specific configuration |
| [wsl](./wsl/default.nix) | WSL-specific configuration |

View File

@ -7,7 +7,6 @@
./firefox.nix ./firefox.nix
./kitty.nix ./kitty.nix
./media.nix ./media.nix
./nautilus.nix
./obsidian.nix ./obsidian.nix
./qbittorrent.nix ./qbittorrent.nix
./slack.nix ./slack.nix

View File

@ -16,6 +16,7 @@
unfreePackages = [ unfreePackages = [
(lib.mkIf config._1password.enable "onepassword-password-manager") (lib.mkIf config._1password.enable "onepassword-password-manager")
"okta-browser-plugin" "okta-browser-plugin"
"wappalyzer"
]; ];
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
@ -33,7 +34,6 @@
vimium vimium
multi-account-containers multi-account-containers
facebook-container facebook-container
temporary-containers
(lib.mkIf config._1password.enable onepassword-password-manager) (lib.mkIf config._1password.enable onepassword-password-manager)
okta-browser-plugin okta-browser-plugin
sponsorblock sponsorblock
@ -71,6 +71,10 @@
"layout.css.color-mix.enabled" = true; "layout.css.color-mix.enabled" = true;
"ui.systemUsesDarkTheme" = "ui.systemUsesDarkTheme" =
if config.theme.dark == true then 1 else 0; if config.theme.dark == true then 1 else 0;
"media.ffmpeg.vaapi.enabled" =
true; # Enable hardware video acceleration
"cookiebanners.ui.desktop.enabled" = true; # Reject cookie popups
"svg.context-properties.content.enabled" = true; # Sidebery styling
}; };
userChrome = '' userChrome = ''
:root { :root {
@ -157,6 +161,24 @@
}; };
}; };
xsession.windowManager.i3.config.keybindings =
lib.mkIf pkgs.stdenv.isLinux {
"${
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
}+Shift+b" = "exec ${
# Don't name the script `firefox` or it will affect grep
builtins.toString (pkgs.writeShellScript "focus-ff.sh" ''
count=$(ps aux | grep -c firefox)
if [ "$count" -eq 1 ]; then
i3-msg "exec --no-startup-id firefox"
sleep 0.5
fi
i3-msg "[class=firefox] focus"
'')
}";
};
}; };
}; };

View File

@ -10,16 +10,40 @@
}; };
config = lib.mkIf (config.gui.enable && config.kitty.enable) { config = lib.mkIf (config.gui.enable && config.kitty.enable) {
# Set the Rofi-Systemd terminal for viewing logs
# Using optionalAttrs because only available in NixOS
environment = { } // lib.attrsets.optionalAttrs
(builtins.hasAttr "sessionVariables" config.environment) {
sessionVariables.ROFI_SYSTEMD_TERM = "${pkgs.kitty}/bin/kitty";
};
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
# xsession.windowManager.i3.config.terminal = "kitty";
# programs.rofi.terminal = "${pkgs.kitty}/bin/kitty"; # Set the i3 terminal
xsession.windowManager.i3.config.terminal =
lib.mkIf pkgs.stdenv.isLinux "kitty";
# Set the Rofi terminal for running programs
programs.rofi.terminal =
lib.mkIf pkgs.stdenv.isLinux "${pkgs.kitty}/bin/kitty";
# Display images in the terminal
programs.fish.shellAliases = {
icat = "kitty +kitten icat";
ssh = "kitty +kitten ssh";
};
programs.kitty = { programs.kitty = {
enable = true; enable = true;
environment = { }; environment = { };
extraConfig = ""; extraConfig = "";
font.size = 14; font.size = 14;
keybindings = { keybindings = {
# Use shift+enter to complete text suggestions in fish
"shift+enter" = "send_text all \\x1F"; "shift+enter" = "send_text all \\x1F";
# Easy fullscreen toggle (for macOS)
"super+f" = "toggle_fullscreen"; "super+f" = "toggle_fullscreen";
}; };
settings = { settings = {
@ -70,8 +94,6 @@
# Scrollback # Scrollback
scrolling_lines = 10000; scrolling_lines = 10000;
scrollback_pager_history_size = 10; # MB scrollback_pager_history_size = 10; # MB
scrollback_pager = ''
${pkgs.neovim}/bin/nvim -c 'setlocal nonumber nolist showtabline=0 foldcolumn=0|Man!' -c "autocmd VimEnter * normal G" -'';
# Window # Window
window_padding_width = 6; window_padding_width = 6;
@ -79,7 +101,7 @@
tab_bar_edge = "top"; tab_bar_edge = "top";
tab_bar_style = "slant"; tab_bar_style = "slant";
# Audio # Disable audio
enable_audio_bell = false; enable_audio_bell = false;
}; };
}; };

View File

@ -12,22 +12,43 @@
config = lib.mkIf (config.gui.enable && config.media.enable) { config = lib.mkIf (config.gui.enable && config.media.enable) {
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
home.packages = with pkgs; [ home.packages = with pkgs; [
mpv # Video viewer nsxiv # Image viewer
sxiv # Image viewer
mupdf # PDF viewer mupdf # PDF viewer
zathura # PDF viewer zathura # PDF viewer
]; ];
# Set default for opening PDFs # Video player
programs.mpv = {
enable = true;
bindings = { };
config = {
image-display-duration = 2; # For cycling through images
hwdec = "auto-safe"; # Attempt to use GPU decoding for video
};
scripts = [
# Automatically load playlist entries before and after current file
pkgs.mpvScripts.autoload
# Delete current file after quitting
pkgs.mpvScripts.mpv-delete-file
];
};
# Set default programs for opening PDFs and other media
xdg.mimeApps = { xdg.mimeApps = {
associations.added = { associations.added = {
"application/pdf" = [ "pwmt.zathura-cb.desktop" ]; "application/pdf" = [ "pwmt.zathura-cb.desktop" ];
"image/*" = [ "sxiv.desktop" ]; "image/jpeg" = [ "nsxiv.desktop" ];
"image/*" = [ "nsxiv.desktop" ];
};
associations.removed = {
"application/pdf" = [ "mupdf.desktop" "wine-extension-pdf.desktop" ];
}; };
associations.removed = { "application/pdf" = [ "mupdf.desktop" ]; };
defaultApplications = { defaultApplications = {
"application/pdf" = [ "pwmt.zathura-cb.desktop" ]; "application/pdf" = [ "pwmt.zathura-cb.desktop" ];
"image/*" = [ "sxiv.desktop" ]; "image/jpeg" = [ "nsxiv.desktop" ];
"image/*" = [ "nsxiv.desktop" ];
}; };
}; };

View File

@ -1,34 +0,0 @@
{ config, pkgs, lib, ... }: {
options = {
nautilus = {
enable = lib.mkEnableOption {
description = "Enable Nautilus file manager.";
default = false;
};
};
};
# Install Nautilus file manager
config = lib.mkIf (config.gui.enable && config.nautilus.enable) {
home-manager.users.${config.user} = {
home.packages = with pkgs; [
gnome.nautilus
gnome.sushi # Quick preview with spacebar
];
# Set default for opening directories
xdg.mimeApps.defaultApplications."inode/directory" =
[ "nautilus.desktop" ];
programs.fish.functions = {
qr = {
body =
"${pkgs.qrencode}/bin/qrencode $argv[1] -o /tmp/qr.png | ${pkgs.gnome.sushi}/bin/sushi /tmp/qr.png";
};
};
};
};
}

View File

@ -14,6 +14,10 @@
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
home.packages = with pkgs; [ obsidian ]; home.packages = with pkgs; [ obsidian ];
}; };
# Broken on 2023-04-16
nixpkgs.config.permittedInsecurePackages = [ "electron-21.4.0" ];
}; };
} }

View File

@ -44,11 +44,6 @@
default = true; default = true;
}; };
}; };
# colorscheme = lib.mkOption {
# type = types.attrs;
# description = "Base16 color scheme";
# };
homePath = lib.mkOption { homePath = lib.mkOption {
type = lib.types.path; type = lib.types.path;
description = "Path of user's home directory."; description = "Path of user's home directory.";
@ -57,7 +52,6 @@
else else
"/home/${config.user}"); "/home/${config.user}");
}; };
dotfilesPath = lib.mkOption { dotfilesPath = lib.mkOption {
type = lib.types.path; type = lib.types.path;
description = "Path of dotfiles repository."; description = "Path of dotfiles repository.";
@ -65,13 +59,47 @@
}; };
dotfilesRepo = lib.mkOption { dotfilesRepo = lib.mkOption {
type = lib.types.str; type = lib.types.str;
description = "Link to dotfiles repository."; description = "Link to dotfiles repository HTTPS URL.";
}; };
unfreePackages = lib.mkOption { unfreePackages = lib.mkOption {
type = lib.types.listOf lib.types.str; type = lib.types.listOf lib.types.str;
description = "List of unfree packages to allow."; description = "List of unfree packages to allow.";
default = [ ]; default = [ ];
}; };
hostnames = {
git = lib.mkOption {
type = lib.types.str;
description = "Hostname for git server (Gitea).";
};
metrics = lib.mkOption {
type = lib.types.str;
description = "Hostname for metrics server.";
};
prometheus = lib.mkOption {
type = lib.types.str;
description = "Hostname for Prometheus server.";
};
secrets = lib.mkOption {
type = lib.types.str;
description = "Hostname for passwords and secrets (Vaultwarden).";
};
stream = lib.mkOption {
type = lib.types.str;
description = "Hostname for video/media library (Jellyfin).";
};
content = lib.mkOption {
type = lib.types.str;
description = "Hostname for personal content system (Nextcloud).";
};
books = lib.mkOption {
type = lib.types.str;
description = "Hostname for books library (Calibre-Web).";
};
download = lib.mkOption {
type = lib.types.str;
description = "Hostname for download services.";
};
};
}; };
config = let stateVersion = "23.05"; config = let stateVersion = "23.05";
@ -85,9 +113,16 @@
warn-dirty = false warn-dirty = false
''; '';
gc = {
automatic = true;
options = "--delete-older-than 7d";
};
settings = { settings = {
# Add community Cachix to binary cache # Add community Cachix to binary cache
# Don't use with macOS because blocked by corporate firewall
builders-use-substitutes = true;
substituters = lib.mkIf (!pkgs.stdenv.isDarwin) substituters = lib.mkIf (!pkgs.stdenv.isDarwin)
[ "https://nix-community.cachix.org" ]; [ "https://nix-community.cachix.org" ];
trusted-public-keys = lib.mkIf (!pkgs.stdenv.isDarwin) [ trusted-public-keys = lib.mkIf (!pkgs.stdenv.isDarwin) [
@ -95,7 +130,8 @@
]; ];
# Scans and hard links identical files in the store # Scans and hard links identical files in the store
auto-optimise-store = true; # Not working with macOS: https://github.com/NixOS/nix/issues/7273
auto-optimise-store = lib.mkIf (!pkgs.stdenv.isDarwin) true;
}; };

View File

@ -154,22 +154,20 @@
general.unsafe-accounts-conf = true; general.unsafe-accounts-conf = true;
viewer = { pager = "${pkgs.less}/bin/less -R"; }; viewer = { pager = "${pkgs.less}/bin/less -R"; };
filters = { filters = {
"text/plain" = "text/plain" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
"${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/share/aerc/filters/colorize";
"text/calendar" = "text/calendar" =
"${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/share/aerc/filters/calendar"; "${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/libexec/aerc/filters/calendar";
"text/html" = "text/html" =
"${pkgs.aerc}/share/aerc/filters/html"; # Requires w3m, dante "${pkgs.aerc}/libexec/aerc/filters/html | ${pkgs.aerc}/libexec/aerc/filters/colorize"; # Requires w3m, dante
# "text/html" =
# "${pkgs.aerc}/share/aerc/filters/html | ${pkgs.aerc}/share/aerc/filters/colorize";
# "text/*" = # "text/*" =
# ''${pkgs.bat}/bin/bat -fP --file-name="$AERC_FILENAME "''; # ''${pkgs.bat}/bin/bat -fP --file-name="$AERC_FILENAME "'';
"message/delivery-status" = "message/delivery-status" =
"${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/share/aerc/filters/colorize"; "${pkgs.aerc}/libexec/aerc/filters/colorize";
"message/rfc822" = "message/rfc822" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
"${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/share/aerc/filters/colorize";
"application/x-sh" = "${pkgs.bat}/bin/bat -fP -l sh"; "application/x-sh" = "${pkgs.bat}/bin/bat -fP -l sh";
"application/pdf" = "${pkgs.zathura}/bin/zathura -"; "application/pdf" = "${pkgs.zathura}/bin/zathura -";
"audio/*" = "${pkgs.mpv}/bin/mpv -";
"image/*" = "${pkgs.feh}/bin/feh -";
}; };
}; };
}; };
@ -181,6 +179,27 @@
}; };
}; };
xdg.desktopEntries.aerc = lib.mkIf pkgs.stdenv.isLinux {
name = "aerc";
exec = "kitty aerc %u";
};
xsession.windowManager.i3.config.keybindings =
lib.mkIf pkgs.stdenv.isLinux {
"${
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
}+Shift+e" = "exec ${
# Don't name the script `aerc` or it will affect grep
builtins.toString (pkgs.writeShellScript "focus-mail.sh" ''
count=$(ps aux | grep -c aerc)
if [ "$count" -eq 1 ]; then
i3-msg "exec --no-startup-id kitty --class aerc aerc"
sleep 0.25
fi
i3-msg "[class=aerc] focus"
'')
}";
};
programs.fish.shellAbbrs = { ae = "aerc"; }; programs.fish.shellAbbrs = { ae = "aerc"; };
}; };

View File

@ -1,6 +1,6 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
imports = [ ./himalaya.nix ./aerc.nix ]; imports = [ ./himalaya.nix ./aerc.nix ./system.nix ];
options = { options = {
mail.enable = lib.mkEnableOption "Mail service."; mail.enable = lib.mkEnableOption "Mail service.";
@ -10,21 +10,49 @@
default = config.user; default = config.user;
}; };
mail.server = lib.mkOption { mail.server = lib.mkOption {
type = lib.types.str; type = lib.types.nullOr lib.types.str;
description = "Server name for the email address."; description = "Server name for the email address.";
}; };
mail.imapHost = lib.mkOption {
type = lib.types.nullOr lib.types.str;
description = "Server host for IMAP (reading mail).";
};
mail.smtpHost = lib.mkOption {
type = lib.types.nullOr lib.types.str;
description = "Server host for SMTP (sending mail).";
};
}; };
config = lib.mkIf config.mail.enable { config = lib.mkIf config.mail.enable {
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
programs.mbsync = { enable = true; }; programs.mbsync = { enable = true; };
# Automatically check for mail and keep files synced locally
services.mbsync = lib.mkIf pkgs.stdenv.isLinux { services.mbsync = lib.mkIf pkgs.stdenv.isLinux {
enable = true; enable = true;
frequency = "*:0/5"; frequency = "*:0/5";
postExec = "${pkgs.notmuch}/bin/notmuch new";
}; };
# Used to watch for new mail and trigger sync
services.imapnotify.enable = pkgs.stdenv.isLinux;
# Allows sending email from CLI/sendmail
programs.msmtp.enable = true;
# Better local mail search
programs.notmuch = {
enable = true;
new.ignore =
[ ".mbsyncstate.lock" ".mbsyncstate.journal" ".mbsyncstate.new" ];
};
accounts.email = { accounts.email = {
# Where email files are stored
maildirBasePath = "${config.homePath}/mail"; maildirBasePath = "${config.homePath}/mail";
accounts = { accounts = {
home = let address = "${config.mail.user}@${config.mail.server}"; home = let address = "${config.mail.user}@${config.mail.server}";
in { in {
@ -37,40 +65,53 @@
"hey" "hey"
"admin" "admin"
]; ];
# Options for contact completion
alot = { }; alot = { };
flavor = "plain";
folders = { };
getmail = { };
imap = { imap = {
host = "imap.purelymail.com"; host = config.mail.imapHost;
port = 993; port = 993;
tls.enable = true; tls.enable = true;
}; };
# Watch for mail and run notifications or sync
imapnotify = { imapnotify = {
enable = false; enable = true;
boxes = [ ]; boxes = [ "Inbox" ];
onNotify = ""; onNotify = "${pkgs.isync}/bin/mbsync -a";
onNotifyPost = ""; onNotifyPost = lib.mkIf
config.home-manager.users.${config.user}.services.dunst.enable
"${pkgs.libnotify}/bin/notify-send 'New mail arrived'";
}; };
# Name of the directory in maildir for this account
maildir = { path = "main"; }; maildir = { path = "main"; };
# Bi-directional syncing options for local files
mbsync = { mbsync = {
enable = true; enable = true;
create = "maildir"; create = "both";
expunge = "none"; expunge = "both";
remove = "none"; remove = "both";
patterns = [ "*" ]; patterns = [ "*" ];
extraConfig.channel = { extraConfig.channel = {
CopyArrivalDate = "yes"; # Sync time of original message CopyArrivalDate = "yes"; # Sync time of original message
}; };
}; };
mu.enable = false;
notmuch.enable = false; # Enable indexing
notmuch.enable = true;
# Used to login and send and receive emails
passwordCommand = passwordCommand =
"${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${ "${pkgs.age}/bin/age --decrypt --identity ~/.ssh/id_ed25519 ${
builtins.toString ../../../private/mailpass.age pkgs.writeText "mailpass.age"
(builtins.readFile ../../../private/mailpass.age)
}"; }";
smtp = { smtp = {
host = "smtp.purelymail.com"; host = config.mail.smtpHost;
port = 465; port = 465;
tls.enable = true; tls.enable = true;
}; };

View File

@ -0,0 +1,34 @@
{ config, pkgs, lib, ... }: {
config = lib.mkIf (config.mail.enable || config.server) {
home-manager.users.${config.user} = {
programs.msmtp.enable = true;
# The system user for sending automatic notifications
accounts.email.accounts.system =
let address = "system@${config.mail.server}";
in {
userName = address;
realName = "NixOS System";
primary = !config.mail.enable; # Only primary if mail not enabled
inherit address;
passwordCommand =
"${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${
pkgs.writeText "mailpass-system.age"
(builtins.readFile ../../../private/mailpass-system.age)
}";
msmtp.enable = true;
smtp = {
host = config.mail.smtpHost;
port = 465;
tls.enable = true;
};
};
};
};
}

View File

@ -1,4 +1,7 @@
{ pkgs, ... }: { { pkgs, ... }: {
# Plugin for aligning text programmatically
plugins = [ pkgs.vimPlugins.tabular ]; plugins = [ pkgs.vimPlugins.tabular ];
lua = '' lua = ''
-- Align -- Align

View File

@ -1,4 +1,7 @@
{ pkgs, ... }: { { pkgs, ... }: {
# Shows buffers in a VSCode-style tab layout
plugins = [ plugins = [
pkgs.vimPlugins.bufferline-nvim pkgs.vimPlugins.bufferline-nvim
pkgs.vimPlugins.vim-bbye # Better closing of buffers pkgs.vimPlugins.vim-bbye # Better closing of buffers

View File

@ -0,0 +1,22 @@
{ pkgs, lib, config, ... }: {
# Sets Neovim colors based on Nix colorscheme
options.colors = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
description = "Attrset of base16 colorscheme key value pairs.";
};
config = {
plugins = [ pkgs.vimPlugins.nvim-base16 ];
setup.base16-colorscheme = config.colors;
# Telescope isn't working, shut off for now
lua = ''
require('base16-colorscheme').with_config {
telescope = false,
}
'';
};
}

View File

@ -24,12 +24,14 @@
end end
''; '';
# Enable Luasnip snippet completion
snippet.expand = dsl.rawLua '' snippet.expand = dsl.rawLua ''
function(args) function(args)
require("luasnip").lsp_expand(args.body) require("luasnip").lsp_expand(args.body)
end end
''; '';
# Basic completion keybinds
mapping = { mapping = {
"['<C-n>']" = dsl.rawLua "['<C-n>']" = dsl.rawLua
"require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert })"; "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert })";
@ -64,24 +66,26 @@
''; '';
}; };
# These are where the completion engine gets its suggestions
sources = [ sources = [
{ name = "nvim_lua"; } { name = "nvim_lua"; } # Fills in common Neovim lua functions
{ name = "nvim_lsp"; } { name = "nvim_lsp"; } # LSP results
{ name = "luasnip"; } { name = "luasnip"; } # Snippets
{ name = "path"; } { name = "path"; } # Shell completion from current PATH
{ {
name = "buffer"; name = "buffer"; # Grep for text from the current text buffer
keyword_length = 3; keyword_length = 3;
max_item_count = 10; max_item_count = 10;
} }
{ {
name = "rg"; name = "rg"; # Grep for text from the current directory
keyword_length = 6; keyword_length = 6;
max_item_count = 10; max_item_count = 10;
option = { additional_arguments = "--ignore-case"; }; option = { additional_arguments = "--ignore-case"; };
} }
]; ];
# Styling of the completion menu
formatting = { formatting = {
fields = [ "kind" "abbr" "menu" ]; fields = [ "kind" "abbr" "menu" ];
format = dsl.rawLua '' format = dsl.rawLua ''
@ -135,6 +139,13 @@
}; };
lua = '' lua = ''
-- Load snippets
-- Check status: :lua require("luasnip").log.open()
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load({ paths = { "${
builtins.toString pkgs.vscode-terraform-snippets
}" } })
-- Use buffer source for `/` -- Use buffer source for `/`
require('cmp').setup.cmdline("/", { require('cmp').setup.cmdline("/", {
sources = { sources = {

View File

@ -29,11 +29,14 @@
lua = '' lua = ''
${builtins.readFile ./lsp.lua} ${builtins.readFile ./lsp.lua}
-- Prevent infinite log size (change this when debugging)
vim.lsp.set_log_level("off")
require("null-ls").setup({ require("null-ls").setup({
sources = { sources = {
require("null-ls").builtins.formatting.stylua.with({ command = "${pkgs.stylua}/bin/stylua" }), require("null-ls").builtins.formatting.stylua.with({ command = "${pkgs.stylua}/bin/stylua" }),
require("null-ls").builtins.formatting.black.with({ command = "${pkgs.black}/bin/black" }), require("null-ls").builtins.formatting.black.with({ command = "${pkgs.black}/bin/black" }),
require("null-ls").builtins.diagnostics.flake8.with({ command = "${pkgs.python310Packages.flake8}/bin/flake8" }), require("null-ls").builtins.diagnostics.ruff.with({ command = "${pkgs.ruff}/bin/ruff" }),
require("null-ls").builtins.formatting.fish_indent.with({ command = "${pkgs.fish}/bin/fish_indent" }), require("null-ls").builtins.formatting.fish_indent.with({ command = "${pkgs.fish}/bin/fish_indent" }),
require("null-ls").builtins.formatting.nixfmt.with({ command = "${pkgs.nixfmt}/bin/nixfmt" }), require("null-ls").builtins.formatting.nixfmt.with({ command = "${pkgs.nixfmt}/bin/nixfmt" }),
require("null-ls").builtins.formatting.rustfmt.with({ command = "${pkgs.rustfmt}/bin/rustfmt" }), require("null-ls").builtins.formatting.rustfmt.with({ command = "${pkgs.rustfmt}/bin/rustfmt" }),
@ -50,6 +53,7 @@
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then if client.supports_method("textDocument/formatting") then
-- Auto-format on save
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", { vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup, group = augroup,
@ -58,6 +62,12 @@
vim.lsp.buf.format({ bufnr = bufnr }) vim.lsp.buf.format({ bufnr = bufnr })
end, end,
}) })
-- Use internal formatting for bindings like gq.
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
vim.bo[args.buf].formatexpr = nil
end,
})
end end
end, end,
}) })

View File

@ -5,13 +5,16 @@
pkgs.vimPlugins.vim-fugitive # Git commands pkgs.vimPlugins.vim-fugitive # Git commands
pkgs.vimPlugins.vim-repeat # Better repeat using . pkgs.vimPlugins.vim-repeat # Better repeat using .
pkgs.vimPlugins.comment-nvim # Smart comment commands pkgs.vimPlugins.comment-nvim # Smart comment commands
pkgs.vimPlugins.impatient-nvim # Faster load times
pkgs.vimPlugins.glow-nvim # Markdown preview popup pkgs.vimPlugins.glow-nvim # Markdown preview popup
pkgs.vimPlugins.nvim-colorizer-lua # Hex color previews pkgs.vimPlugins.nvim-colorizer-lua # Hex color previews
pkgs.vimPlugins.which-key-nvim # Keybind helper
]; ];
# Initialize some plugins
setup.Comment = { }; setup.Comment = { };
setup.colorizer = { }; setup.colorizer = { };
setup.glow = { };
setup.which-key = { };
vim.o = { vim.o = {
termguicolors = true; # Set to truecolor termguicolors = true; # Set to truecolor
@ -41,17 +44,23 @@
relativenumber = true; # Relative numbers instead of absolute relativenumber = true; # Relative numbers instead of absolute
}; };
# For which-key-nvim
vim.o.timeout = true;
vim.o.timeoutlen = 300;
# Better backup, swap and undo storage # Better backup, swap and undo storage
vim.o.backup = true; # Easier to recover and more secure vim.o.backup = true; # Easier to recover and more secure
vim.bo.swapfile = false; # Instead of swaps, create backups vim.bo.swapfile = false; # Instead of swaps, create backups
vim.bo.undofile = true; # Keeps undos after quit vim.bo.undofile = true; # Keeps undos after quit
vim.o.backupdir = dsl.rawLua ''vim.fn.stdpath("cache") .. "/backup"''; vim.o.backupdir =
dsl.rawLua ''vim.fn.expand("~/.local/state/nvim/backup//")'';
vim.o.undodir = dsl.rawLua ''vim.fn.expand("~/.local/state/nvim/undo//")'';
# Required for nvim-cmp completion # Required for nvim-cmp completion
vim.opt.completeopt = [ "menu" "menuone" "noselect" ]; vim.opt.completeopt = [ "menu" "menuone" "noselect" ];
lua = lib.mkBefore '' lua = lib.mkBefore ''
require("impatient") vim.loader.enable()
${builtins.readFile ../lua/keybinds.lua}; ${builtins.readFile ../lua/keybinds.lua};
${builtins.readFile ../lua/settings.lua}; ${builtins.readFile ../lua/settings.lua};
''; '';

View File

@ -2,7 +2,7 @@
plugins = [ pkgs.vimPlugins.lualine-nvim ]; plugins = [ pkgs.vimPlugins.lualine-nvim ];
setup.lualine = { setup.lualine = {
options = { options = {
theme = "gruvbox"; theme = "base16";
icons_enabled = true; icons_enabled = true;
}; };
}; };

View File

@ -1,26 +1,40 @@
{ pkgs, ... }: { { pkgs, lib, ... }: {
plugins = [ plugins = [
(pkgs.vimPlugins.nvim-treesitter.withPlugins (_plugins: (pkgs.vimPlugins.nvim-treesitter.withPlugins (_plugins:
with pkgs.tree-sitter-grammars; [ with pkgs.tree-sitter-grammars; [
tree-sitter-hcl tree-sitter-bash
tree-sitter-python
tree-sitter-lua
tree-sitter-nix
tree-sitter-fish tree-sitter-fish
tree-sitter-hcl
tree-sitter-ini
tree-sitter-json
tree-sitter-lua
tree-sitter-markdown
tree-sitter-markdown-inline
tree-sitter-nix
tree-sitter-puppet
tree-sitter-python
tree-sitter-rasi
tree-sitter-toml tree-sitter-toml
tree-sitter-yaml tree-sitter-yaml
tree-sitter-json
])) ]))
pkgs.vimPlugins.vim-matchup # Better % jumping in languages pkgs.vimPlugins.vim-matchup # Better % jumping in languages
pkgs.vimPlugins.playground # Tree-sitter experimenting
pkgs.vimPlugins.nginx-vim pkgs.vimPlugins.nginx-vim
pkgs.vimPlugins.vim-helm pkgs.vimPlugins.vim-helm
pkgs.vimPlugins.vim-puppet pkgs.baleia-nvim # Clean ANSI from kitty scrollback
# pkgs.hmts-nvim # Tree-sitter injections for home-manager
(pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nmasur";
version = "0.1";
src = ../plugin;
})
]; ];
setup."nvim-treesitter.configs" = { setup."nvim-treesitter.configs" = {
highlight = { enable = true; }; highlight = { enable = true; };
indent = { enable = true; }; indent = { enable = true; };
matchup = { enable = true; }; # Uses vim-matchup
textobjects = { textobjects = {
select = { select = {
@ -49,4 +63,10 @@
}; };
}; };
# Use mkAfter to ensure tree-sitter is already loaded
lua = lib.mkAfter ''
-- Use HCL parser with .tf files
vim.treesitter.language.register('hcl', 'terraform')
'';
} }

View File

@ -13,6 +13,7 @@ vim.keymap.set("n", "<Leader>gf", telescope.git_bcommits)
vim.keymap.set("n", "<Leader>gb", telescope.git_branches) vim.keymap.set("n", "<Leader>gb", telescope.git_branches)
vim.keymap.set("n", "<Leader>gs", telescope.git_status) vim.keymap.set("n", "<Leader>gs", telescope.git_status)
vim.keymap.set("n", "<Leader>s", telescope.current_buffer_fuzzy_find) vim.keymap.set("n", "<Leader>s", telescope.current_buffer_fuzzy_find)
vim.keymap.set("n", "<Leader>rr", telescope.resume)
vim.keymap.set("n", "<Leader>N", function() vim.keymap.set("n", "<Leader>N", function()
local opts = { local opts = {
@ -45,7 +46,7 @@ end)
vim.keymap.set("n", "<Leader>fz", require("telescope").extensions.zoxide.list) vim.keymap.set("n", "<Leader>fz", require("telescope").extensions.zoxide.list)
-- Project -- Project
require("telescope").load_extension("project") require("telescope").load_extension("projects")
vim.keymap.set("n", "<C-p>", function() vim.keymap.set("n", "<C-p>", function()
local opts = require("telescope.themes").get_ivy({ local opts = require("telescope.themes").get_ivy({
layout_config = { layout_config = {
@ -54,7 +55,7 @@ vim.keymap.set("n", "<C-p>", function()
}, },
}, },
}) })
require("telescope").extensions.project.project(opts) require("telescope").extensions.projects.projects(opts)
end) end)
-- File browser -- File browser

View File

@ -1,8 +1,10 @@
{ pkgs, dsl, ... }: { { pkgs, dsl, ... }: {
# Telescope is a fuzzy finder that can work with different sub-plugins
plugins = [ plugins = [
pkgs.vimPlugins.telescope-nvim pkgs.vimPlugins.telescope-nvim
pkgs.vimPlugins.telescope-project-nvim pkgs.vimPlugins.project-nvim
pkgs.vimPlugins.telescope-fzy-native-nvim pkgs.vimPlugins.telescope-fzy-native-nvim
pkgs.vimPlugins.telescope-file-browser-nvim pkgs.vimPlugins.telescope-file-browser-nvim
pkgs.vimPlugins.telescope-zoxide pkgs.vimPlugins.telescope-zoxide
@ -25,10 +27,11 @@
extensions = { extensions = {
fzy_native = { }; fzy_native = { };
zoxide = { }; zoxide = { };
project = { base_dirs = [ "~/dev" ]; };
}; };
}; };
setup.project_nvim = { };
lua = builtins.readFile ./telescope.lua; lua = builtins.readFile ./telescope.lua;
} }

View File

@ -12,6 +12,8 @@ vim.api.nvim_create_autocmd("TermOpen", {
end, end,
}) })
-- These are all the different types of terminals we can trigger
local terminal = require("toggleterm.terminal").Terminal local terminal = require("toggleterm.terminal").Terminal
local basicterminal = terminal:new() local basicterminal = terminal:new()

View File

@ -1,5 +1,7 @@
{ pkgs, dsl, ... }: { { pkgs, dsl, ... }: {
# Toggleterm provides a floating terminal inside the editor for quick access
plugins = [ pkgs.vimPlugins.toggleterm-nvim ]; plugins = [ pkgs.vimPlugins.toggleterm-nvim ];
use.toggleterm.setup = dsl.callWith { use.toggleterm.setup = dsl.callWith {

View File

@ -1,5 +1,7 @@
{ pkgs, dsl, ... }: { { pkgs, dsl, ... }: {
# This plugin creates a side drawer for navigating the current project
plugins = [ pkgs.vimPlugins.nvim-tree-lua pkgs.vimPlugins.nvim-web-devicons ]; plugins = [ pkgs.vimPlugins.nvim-tree-lua pkgs.vimPlugins.nvim-web-devicons ];
# Disable netrw eagerly # Disable netrw eagerly
@ -10,14 +12,16 @@
}; };
setup.nvim-tree = { setup.nvim-tree = {
disable_netrw = true; disable_netrw = true; # Disable the built-in file manager
hijack_netrw = true; hijack_netrw = true; # Works as the file manager
update_focused_file = { sync_root_with_cwd = true; # Change project whenever currend dir changes
respect_buf_cwd = true; # Change to exact location of focused buffer
update_focused_file = { # Change project based on the focused buffer
enable = true; enable = true;
update_cwd = true; update_root = true;
ignore_list = { }; ignore_list = { };
}; };
diagnostics = { diagnostics = { # Enable LSP and linter integration
enable = true; enable = true;
icons = { icons = {
hint = ""; hint = "";
@ -26,7 +30,7 @@
error = ""; error = "";
}; };
}; };
renderer = { renderer = { # Show files with changes vs. current commit
icons = { icons = {
glyphs = { glyphs = {
git = { git = {
@ -41,35 +45,32 @@
}; };
}; };
}; };
view = { # Set keybinds and initialize program
on_attach = dsl.rawLua ''
function (bufnr)
local api = require('nvim-tree.api')
local function opts(desc)
return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
end
api.config.mappings.default_on_attach(bufnr)
vim.keymap.set('n', 'l', api.node.open.edit, opts('Open'))
vim.keymap.set('n', '<CR>', api.node.open.edit, opts('Open'))
vim.keymap.set('n', 'o', api.node.open.edit, opts('Open'))
vim.keymap.set('n', 'h', api.node.navigate.parent_close, opts('Close Directory'))
vim.keymap.set('n', 'v', api.node.open.vertical, opts('Open: Vertical Split'))
end
'';
view = { # Set look and feel
width = 30; width = 30;
hide_root_folder = false; hide_root_folder = false;
side = "left"; side = "left";
mappings = {
custom_only = false;
list = [
{
key = [ "l" "<CR>" "o" ];
cb = dsl.rawLua
"require('nvim-tree.config').nvim_tree_callback('edit')";
}
{
key = "h";
cb = dsl.rawLua
"require('nvim-tree.config').nvim_tree_callback('close_node')";
}
{
key = "v";
cb = dsl.rawLua
"require('nvim-tree.config').nvim_tree_callback('vsplit')";
}
];
};
number = false; number = false;
relativenumber = false; relativenumber = false;
}; };
}; };
# Toggle the sidebar
lua = '' lua = ''
vim.keymap.set("n", "<Leader>e", ":NvimTreeFindFileToggle<CR>", { silent = true }) vim.keymap.set("n", "<Leader>e", ":NvimTreeFindFileToggle<CR>", { silent = true })
''; '';

View File

@ -4,7 +4,7 @@ let
neovim = import ./package { neovim = import ./package {
inherit pkgs; inherit pkgs;
colors = import config.theme.colors.neovimConfig { inherit pkgs; }; colors = config.theme.colors;
}; };
in { in {
@ -18,11 +18,17 @@ in {
home.packages = [ neovim ]; home.packages = [ neovim ];
# Use Neovim as the editor for git commit messages
programs.git.extraConfig.core.editor = "nvim"; programs.git.extraConfig.core.editor = "nvim";
programs.jujutsu.settings.ui.editor = "nvim";
# Set Neovim as the default app for text editing and manual pages
home.sessionVariables = { home.sessionVariables = {
EDITOR = "nvim"; EDITOR = "nvim";
MANPAGER = "nvim +Man!"; MANPAGER = "nvim +Man!";
}; };
# Create quick aliases for launching Neovim
programs.fish = { programs.fish = {
shellAliases = { vim = "nvim"; }; shellAliases = { vim = "nvim"; };
shellAbbrs = { shellAbbrs = {
@ -31,22 +37,28 @@ in {
vll = "nvim -c 'Telescope oldfiles'"; vll = "nvim -c 'Telescope oldfiles'";
}; };
}; };
programs.kitty.settings.scrollback_pager = lib.mkForce ''
${neovim}/bin/nvim -c 'setlocal nonumber nolist showtabline=0 foldcolumn=0|Man!' -c "autocmd VimEnter * normal G" -'';
# Set Neovim as the kitty terminal "scrollback" (vi mode) option.
# Requires removing some of the ANSI escape codes that are sent to the
# scrollback using sed and baleia, as well as removing several
# unnecessary features.
programs.kitty.settings.scrollback_pager = ''
$SHELL -c 'sed -r "s/[[:cntrl:]]\]133;[AC]..//g" | ${neovim}/bin/nvim -c "setlocal nonumber norelativenumber nolist laststatus=0" -c "lua baleia = require(\"baleia\").setup({}); baleia.once(0)" -c "map <silent> q :qa!<CR>" -c "autocmd VimEnter * normal G"' '';
# Create a desktop option for launching Neovim from a file manager
# (Requires launching the terminal and then executing Neovim)
xdg.desktopEntries.nvim = lib.mkIf pkgs.stdenv.isLinux { xdg.desktopEntries.nvim = lib.mkIf pkgs.stdenv.isLinux {
name = "Neovim wrapper"; name = "Neovim wrapper";
exec = "kitty nvim %F"; exec = "kitty nvim %F";
mimeType = [ "text/plain" "text/markdown" ];
}; };
xdg.mimeApps = lib.mkIf pkgs.stdenv.isLinux { xdg.mimeApps.defaultApplications = lib.mkIf pkgs.stdenv.isLinux {
defaultApplications."text/markdown" = [ "nvim.desktop" ]; "text/plain" = [ "nvim.desktop" ];
"text/markdown" = [ "nvim.desktop" ];
}; };
}; };
# # Used for icons in Vim
# fonts.fonts = with pkgs; [ nerdfonts ];
}; };
} }

View File

@ -1,4 +0,0 @@
require("packer_init")
require("settings")
require("keybinds")
require("background")

View File

@ -39,7 +39,7 @@ key("n", "<Leader>fs", ":write<CR>")
key("n", "<Leader>fd", ":lcd %:p:h<CR>", { silent = true }) key("n", "<Leader>fd", ":lcd %:p:h<CR>", { silent = true })
key("n", "<Leader>fu", ":lcd ..<CR>", { silent = true }) key("n", "<Leader>fu", ":lcd ..<CR>", { silent = true })
key("n", "<Leader><Tab>", ":b#<CR>", { silent = true }) key("n", "<Leader><Tab>", ":b#<CR>", { silent = true })
key("n", "<Leader>gr", ":!gh repo view -w<CR><CR>", { silent = true }) key("n", "<Leader>gr", ":!gh browse %<CR><CR>", { silent = true })
key("n", "<Leader>tt", [[<Cmd>exe 'edit $NOTES_PATH/journal/'.strftime("%Y-%m-%d_%a").'.md'<CR>]]) key("n", "<Leader>tt", [[<Cmd>exe 'edit $NOTES_PATH/journal/'.strftime("%Y-%m-%d_%a").'.md'<CR>]])
key("n", "<Leader>jj", ":!journal<CR>:e<CR>") key("n", "<Leader>jj", ":!journal<CR>:e<CR>")
@ -48,11 +48,6 @@ key("n", "<Leader>wv", ":vsplit<CR>")
key("n", "<Leader>wh", ":split<CR>") key("n", "<Leader>wh", ":split<CR>")
key("n", "<Leader>wm", ":only<CR>") key("n", "<Leader>wm", ":only<CR>")
-- Vimrc editing
key("n", "<Leader>rr", ":luafile $HOME/.config/nvim/init.lua<CR>")
key("n", "<Leader>rp", ":luafile $HOME/.config/nvim/init.lua<CR>:PackerInstall<CR>:")
key("n", "<Leader>rc", ":luafile $HOME/.config/nvim/init.lua<CR>:PackerCompile<CR>")
-- Keep cursor in place -- Keep cursor in place
key("n", "n", "nzz") key("n", "n", "nzz")
key("n", "N", "Nzz") key("n", "N", "Nzz")
@ -70,6 +65,12 @@ key("n", "<C-Down>", ":resize -2<CR>", { silent = true })
key("n", "<C-Left>", ":vertical resize -2<CR>", { silent = true }) key("n", "<C-Left>", ":vertical resize -2<CR>", { silent = true })
key("n", "<C-Right>", ":vertical resize +2<CR>", { silent = true }) key("n", "<C-Right>", ":vertical resize +2<CR>", { silent = true })
-- Quickfix
key("n", "]q", ":cnext<CR>")
key("n", "[q", ":cprevious<CR>")
key("n", "co", ":copen<CR>")
key("n", "cq", ":cclose<CR>")
-- Other -- Other
key("n", "<A-CR>", ":noh<CR>", { silent = true }) --- Clear search in VimWiki key("n", "<A-CR>", ":noh<CR>", { silent = true }) --- Clear search in VimWiki
key("n", "Y", "y$") --- Copy to end of line key("n", "Y", "y$") --- Copy to end of line

View File

@ -1,164 +0,0 @@
-- =======================================================================
-- Completion System
-- =======================================================================
local M = {}
M.packer = function(use)
-- Completion sources
use("hrsh7th/cmp-nvim-lsp") --- Language server completion plugin
use("hrsh7th/cmp-buffer") --- Generic text completion
use("hrsh7th/cmp-path") --- Local file completion
use("hrsh7th/cmp-cmdline") --- Command line completion
use("hrsh7th/cmp-nvim-lua") --- Nvim lua api completion
use("saadparwaiz1/cmp_luasnip") --- Luasnip completion
use("lukas-reineke/cmp-rg") --- Ripgrep completion
use("rafamadriz/friendly-snippets") -- Lots of pre-generated snippets
-- Completion engine
use({
"hrsh7th/nvim-cmp",
requires = { "L3MON4D3/LuaSnip" },
config = function()
local cmp = require("cmp")
local kind_icons = {
Text = "",
Method = "m",
Function = "",
Constructor = "",
Field = "",
Variable = "",
Class = "",
Interface = "",
Module = "",
Property = "",
Unit = "",
Value = "",
Enum = "",
Keyword = "",
Snippet = "",
Color = "",
File = "",
Reference = "",
Folder = "",
EnumMember = "",
Constant = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
}
cmp.setup({
-- Only enable on non-prompt buffers
-- So don't use in telescope
enabled = function()
if vim.bo.buftype == "prompt" then
return false
end
return true
end,
-- Setup snippet completion
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
-- Setup completion keybinds
mapping = {
["<C-n>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
["<C-p>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
["<C-d>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
["<C-e>"] = cmp.mapping(cmp.mapping.abort(), { "i", "c" }),
["<Esc>"] = function(_)
cmp.mapping({
i = cmp.mapping.abort(),
c = cmp.mapping.close(),
})
vim.cmd("stopinsert") --- Abort and leave insert mode
end,
["<CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Insert,
select = true,
}),
["<C-r>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}),
["<C-l>"] = cmp.mapping(function(_)
if require("luasnip").expand_or_jumpable() then
require("luasnip").expand_or_jump()
end
end, { "i", "s" }),
},
-- Setup completion engines
sources = {
{ name = "nvim_lua" },
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "path" },
{ name = "buffer", keyword_length = 3, max_item_count = 10 },
{
name = "rg",
keyword_length = 6,
max_item_count = 10,
option = { additional_arguments = "--ignore-case" },
},
},
-- Visual presentation
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
vim_item.menu = ({
luasnip = "[Snippet]",
buffer = "[Buffer]",
path = "[Path]",
rg = "[Grep]",
nvim_lsp = "[LSP]",
nvim_lua = "[Lua]",
})[entry.source.name]
return vim_item
end,
},
-- Docs
-- window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
-- },
-- Extra features
experimental = {
native_menu = false, --- Use cmp menu instead of Vim menu
ghost_text = true, --- Show preview auto-completion
},
})
-- Use buffer source for `/`
cmp.setup.cmdline("/", {
sources = {
{ name = "buffer", keyword_length = 5 },
},
})
-- Use cmdline & path source for ':'
cmp.setup.cmdline(":", {
sources = cmp.config.sources({
{ name = "path" },
}, {
{ name = "cmdline" },
}),
})
end,
})
end
return M

View File

@ -1,153 +0,0 @@
-- =======================================================================
-- Language Server
-- =======================================================================
local M = {}
M.packer = function(use)
-- Language server engine
use({
"neovim/nvim-lspconfig",
requires = { "hrsh7th/cmp-nvim-lsp" },
config = function()
local function on_path(program)
return vim.fn.executable(program) == 1
end
local capabilities = require("cmp_nvim_lsp").default_capabilities()
if on_path("lua-language-server") then
require("lspconfig").sumneko_lua.setup({
capabilities = capabilities,
-- Turn off errors for vim global variable
settings = {
Lua = {
diagnostics = {
globals = { "vim", "hs" },
},
},
},
})
end
if on_path("rust-analyzer") then
require("lspconfig").rust_analyzer.setup({ capabilities = capabilities })
end
if on_path("tflint") then
require("lspconfig").tflint.setup({ capabilities = capabilities })
end
if on_path("terraform-ls") then
require("lspconfig").terraformls.setup({ capabilities = capabilities })
end
if on_path("pyright") then
require("lspconfig").pyright.setup({
on_attach = function()
-- set keymaps (requires 0.7.0)
-- vim.keymap.set("n", "", "", {buffer=0})
end,
capabilities = capabilities,
})
end
if on_path("nil") then
require("lspconfig").nil_ls.setup({ capabilities = capabilities })
end
vim.keymap.set("n", "gd", vim.lsp.buf.definition)
vim.keymap.set("n", "gT", vim.lsp.buf.type_definition)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation)
vim.keymap.set("n", "gh", vim.lsp.buf.hover)
-- vim.keymap.set("n", "gr", telescope.lsp_references)
vim.keymap.set("n", "<Leader>R", vim.lsp.buf.rename)
vim.keymap.set("n", "]e", vim.diagnostic.goto_next)
vim.keymap.set("n", "[e", vim.diagnostic.goto_prev)
vim.keymap.set("n", "<Leader>de", vim.diagnostic.open_float)
vim.keymap.set("n", "<Leader>E", vim.lsp.buf.code_action)
end,
})
-- Pretty highlights
use("folke/lsp-colors.nvim")
-- Linting
use({
"jose-elias-alvarez/null-ls.nvim",
branch = "main",
requires = {
"nvim-lua/plenary.nvim",
"neovim/nvim-lspconfig",
},
config = function()
local function on_path(program)
return vim.fn.executable(program) == 1
end
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
require("null-ls").setup({
sources = {
require("null-ls").builtins.formatting.stylua.with({
condition = function()
return on_path("stylua")
end,
}),
require("null-ls").builtins.formatting.black.with({
condition = function()
return on_path("black")
end,
}),
require("null-ls").builtins.diagnostics.flake8.with({
condition = function()
return on_path("flake8")
end,
}),
require("null-ls").builtins.formatting.fish_indent.with({
condition = function()
return on_path("fish_indent")
end,
}),
require("null-ls").builtins.formatting.nixfmt.with({
condition = function()
return on_path("nixfmt")
end,
}),
require("null-ls").builtins.formatting.rustfmt.with({
condition = function()
return on_path("rustfmt")
end,
}),
require("null-ls").builtins.diagnostics.shellcheck.with({
condition = function()
return on_path("shellcheck")
end,
}),
require("null-ls").builtins.formatting.shfmt.with({
extra_args = { "-i", "4", "-ci" },
condition = function()
return on_path("shfmt")
end,
}),
require("null-ls").builtins.formatting.terraform_fmt.with({
condition = function()
return on_path("terraform")
end,
}),
-- require("null-ls").builtins.diagnostics.luacheck,
-- require("null-ls").builtins.diagnostics.markdownlint,
-- require("null-ls").builtins.diagnostics.pylint,
},
-- Format on save
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({ bufnr = bufnr })
end,
})
end
end,
})
end,
})
end
return M

View File

@ -1,67 +0,0 @@
local M = {}
M.packer = function(use)
-- Important tweaks
use("tpope/vim-surround") --- Manipulate parentheses
-- Convenience tweaks
use("tpope/vim-eunuch") --- File manipulation in Vim
use("tpope/vim-vinegar") --- Fixes netrw file explorer
use("tpope/vim-fugitive") --- Git commands and syntax
use("tpope/vim-repeat") --- Actually repeat using .
-- Use gc or gcc to add comments
use({
"numToStr/Comment.nvim",
config = function()
require("Comment").setup()
end,
})
-- Alignment tool
use({
"godlygeek/tabular",
config = function()
vim.keymap.set("", "<Leader>ta", ":Tabularize /")
vim.keymap.set("", "<Leader>t#", ":Tabularize /#<CR>")
vim.keymap.set("", "<Leader>tl", ":Tabularize /---<CR>")
end,
})
-- Markdown renderer / wiki notes
-- use("vimwiki/vimwiki")
use({
"jakewvincent/mkdnflow.nvim",
config = function()
require("mkdnflow").setup({
modules = {
bib = false,
conceal = true,
folds = false,
},
perspective = {
priority = "current",
fallback = "first",
nvim_wd_heel = false, -- Don't change working dir
},
links = {
style = "markdown",
conceal = true,
},
wrap = true,
to_do = {
symbols = { " ", "-", "x" },
},
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
callback = function()
vim.o.autowriteall = true -- Save in new buffer
vim.o.wrapmargin = 79 -- Wrap text automatically
end,
})
end,
})
end
return M

View File

@ -1,13 +0,0 @@
local M = {}
M.packer = function(use)
-- Startup speed hacks
use({
"lewis6991/impatient.nvim",
config = function()
require("impatient")
end,
})
end
return M

View File

@ -1,72 +0,0 @@
-- =======================================================================
-- Syntax
-- =======================================================================
local M = {}
M.packer = function(use)
-- Syntax engine
use({
"nvim-treesitter/nvim-treesitter",
commit = "9ada5f70f98d51e9e3e76018e783b39fd1cd28f7",
run = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"hcl",
"python",
"lua",
"nix",
"fish",
"toml",
"yaml",
"json",
},
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
})
end,
})
-- Syntax-aware Textobjects
use({
"nvim-treesitter/nvim-treesitter-textobjects",
requires = { "nvim-treesitter/nvim-treesitter" },
config = function()
require("nvim-treesitter.configs").setup({
textobjects = {
select = {
enable = true,
lookahead = true, -- Jump forward automatically
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["al"] = "@loop.outer",
["il"] = "@loop.inner",
["aa"] = "@call.outer",
["ia"] = "@call.inner",
["ar"] = "@parameter.outer",
["ir"] = "@parameter.inner",
["aC"] = "@comment.outer",
["iC"] = "@comment.outer",
["a/"] = "@comment.outer",
["i/"] = "@comment.outer",
["a;"] = "@statement.outer",
["i;"] = "@statement.outer",
},
},
},
})
end,
})
-- Additional syntax sources
use("chr4/nginx.vim") --- Nginx syntax
use("towolf/vim-helm") --- Helm syntax
use("rodjek/vim-puppet") --- Puppet syntax
end
return M

View File

@ -1,139 +0,0 @@
-- =======================================================================
-- Fuzzy Launcher
-- =======================================================================
local M = {}
M.packer = function(use)
use({
"nvim-telescope/telescope.nvim",
branch = "master",
requires = { "nvim-lua/plenary.nvim" },
config = function()
-- Telescope: quit instantly with escape
local actions = require("telescope.actions")
require("telescope").setup({
defaults = {
mappings = {
i = {
["<esc>"] = actions.close,
["<C-h>"] = "which_key",
},
},
},
pickers = {
find_files = { theme = "ivy" },
oldfiles = { theme = "ivy" },
buffers = { theme = "dropdown" },
},
extensions = {
fzy_native = {},
zoxide = {},
project = {
base_dirs = { "~/dev" },
},
},
})
local telescope = require("telescope.builtin")
vim.keymap.set("n", "<Leader>k", telescope.keymaps)
vim.keymap.set("n", "<Leader>/", telescope.live_grep)
vim.keymap.set("n", "<Leader>ff", telescope.find_files)
vim.keymap.set("n", "<Leader>fp", telescope.git_files)
vim.keymap.set("n", "<Leader>fw", telescope.grep_string)
vim.keymap.set("n", "<Leader>b", telescope.buffers)
vim.keymap.set("n", "<Leader>hh", telescope.help_tags)
vim.keymap.set("n", "<Leader>fr", telescope.oldfiles)
vim.keymap.set("n", "<Leader>cc", telescope.commands)
vim.keymap.set("n", "<Leader>gc", telescope.git_commits)
vim.keymap.set("n", "<Leader>gf", telescope.git_bcommits)
vim.keymap.set("n", "<Leader>gb", telescope.git_branches)
vim.keymap.set("n", "<Leader>gs", telescope.git_status)
vim.keymap.set("n", "<Leader>s", telescope.current_buffer_fuzzy_find)
vim.keymap.set("n", "<Leader>N", function()
local opts = {
prompt_title = "Search Notes",
cwd = "$NOTES_PATH",
}
telescope.live_grep(opts)
end)
vim.keymap.set("n", "<Leader>fN", function()
local opts = {
prompt_title = "Find Notes",
cwd = "$NOTES_PATH",
}
telescope.find_files(opts)
end)
vim.keymap.set("n", "<Leader>cr", function()
local opts = require("telescope.themes").get_ivy({
layout_config = {
bottom_pane = {
height = 15,
},
},
})
telescope.command_history(opts)
end)
end,
})
-- Faster sorting
use("nvim-telescope/telescope-fzy-native.nvim")
-- Jump around tmux sessions
-- use("camgraff/telescope-tmux.nvim")
-- Jump directories
use({
"jvgrootveld/telescope-zoxide",
requires = { "nvim-lua/popup.nvim", "nvim-telescope/telescope.nvim" },
config = function()
vim.keymap.set("n", "<Leader>fz", require("telescope").extensions.zoxide.list)
end,
})
-- Jump projects
use({
"nvim-telescope/telescope-project.nvim",
requires = { "nvim-telescope/telescope.nvim" },
config = function()
require("telescope").load_extension("project")
vim.keymap.set("n", "<C-p>", function()
local opts = require("telescope.themes").get_ivy({
layout_config = {
bottom_pane = {
height = 10,
},
},
})
require("telescope").extensions.project.project(opts)
end)
end,
})
-- File browser
use({
"nvim-telescope/telescope-file-browser.nvim",
requires = { "nvim-telescope/telescope.nvim" },
config = function()
require("telescope").load_extension("file_browser")
vim.keymap.set("n", "<Leader>fa", require("telescope").extensions.file_browser.file_browser)
vim.keymap.set("n", "<Leader>fD", function()
local opts = {
prompt_title = "Find Downloads",
cwd = "~/downloads",
}
require("telescope").extensions.file_browser.file_browser(opts)
end)
end,
})
end
return M

View File

@ -1,79 +0,0 @@
local M = {}
M.packer = function(use)
use({
"akinsho/toggleterm.nvim",
tag = "v2.1.0",
config = function()
require("toggleterm").setup({
open_mapping = [[<c-\>]],
hide_numbers = true,
direction = "float",
})
vim.keymap.set("t", "<A-CR>", "<C-\\><C-n>") --- Exit terminal mode
-- Only set these keymaps for toggleterm
vim.api.nvim_create_autocmd("TermOpen", {
pattern = "term://*toggleterm#*",
callback = function()
-- vim.keymap.set("t", "<Esc>", "<C-\\><C-n>") --- Exit terminal mode
vim.keymap.set("t", "<C-h>", "<C-\\><C-n><C-w>h")
vim.keymap.set("t", "<C-j>", "<C-\\><C-n><C-w>j")
vim.keymap.set("t", "<C-k>", "<C-\\><C-n><C-w>k")
vim.keymap.set("t", "<C-l>", "<C-\\><C-n><C-w>l")
end,
})
local terminal = require("toggleterm.terminal").Terminal
local basicterminal = terminal:new()
function TERM_TOGGLE()
basicterminal:toggle()
end
local nixpkgs = terminal:new({ cmd = "nix repl '<nixpkgs>'" })
function NIXPKGS_TOGGLE()
nixpkgs:toggle()
end
local gitwatch = terminal:new({ cmd = "fish --interactive --init-command 'gh run watch'" })
function GITWATCH_TOGGLE()
gitwatch:toggle()
end
local k9s = terminal:new({ cmd = "k9s" })
function K9S_TOGGLE()
k9s:toggle()
end
vim.keymap.set("n", "<Leader>t", TERM_TOGGLE)
vim.keymap.set("n", "<Leader>P", NIXPKGS_TOGGLE)
vim.keymap.set("n", "<Leader>gw", GITWATCH_TOGGLE)
vim.keymap.set("n", "<Leader>9", K9S_TOGGLE)
end,
})
-- Connect to telescope
-- use({
-- "https://git.sr.ht/~havi/telescope-toggleterm.nvim",
-- event = "TermOpen",
-- requires = {
-- "akinsho/nvim-toggleterm.lua",
-- "nvim-telescope/telescope.nvim",
-- "nvim-lua/popup.nvim",
-- "nvim-lua/plenary.nvim",
-- },
-- config = function()
-- require("telescope").load_extension("toggleterm")
-- require("telescope-toggleterm").setup({
-- telescope_mappings = {
-- -- <ctrl-c> : kill the terminal buffer (default) .
-- ["<C-c>"] = require("telescope-toggleterm").actions.exit_terminal,
-- },
-- })
-- end,
-- })
end
return M

View File

@ -1,164 +0,0 @@
local M = {}
M.packer = function(use)
-- Git next to line numbers
use({
"lewis6991/gitsigns.nvim",
branch = "main",
requires = { "nvim-lua/plenary.nvim" },
config = function()
local gitsigns = require("gitsigns")
gitsigns.setup()
vim.keymap.set("n", "<Leader>gB", gitsigns.blame_line)
vim.keymap.set("n", "<Leader>gp", gitsigns.preview_hunk)
vim.keymap.set("v", "<Leader>gp", gitsigns.preview_hunk)
vim.keymap.set("n", "<Leader>gd", gitsigns.diffthis)
vim.keymap.set("v", "<Leader>gd", gitsigns.diffthis)
vim.keymap.set("n", "<Leader>rgf", gitsigns.reset_buffer)
vim.keymap.set("v", "<Leader>hs", gitsigns.stage_hunk)
vim.keymap.set("v", "<Leader>hr", gitsigns.reset_hunk)
vim.keymap.set("v", "<Leader>hr", gitsigns.reset_hunk)
-- Navigation
vim.keymap.set("n", "]g", function()
if vim.wo.diff then
return "]g"
end
vim.schedule(function()
gitsigns.next_hunk()
end)
return "<Ignore>"
end, { expr = true })
vim.keymap.set("n", "[g", function()
if vim.wo.diff then
return "[g"
end
vim.schedule(function()
gitsigns.prev_hunk()
end)
return "<Ignore>"
end, { expr = true })
end,
})
-- Status bar
use({
"hoob3rt/lualine.nvim",
requires = { "kyazdani42/nvim-web-devicons", opt = true },
config = function()
require("lualine").setup({
options = {
theme = "gruvbox",
icons_enabled = true,
},
})
end,
})
-- Buffer line ("tabs")
use({
"akinsho/bufferline.nvim",
tag = "v2.4.0",
requires = { "kyazdani42/nvim-web-devicons", "moll/vim-bbye" },
config = function()
require("bufferline").setup({
options = {
diagnostics = "nvim_lsp",
always_show_bufferline = false,
separator_style = "slant",
offsets = { { filetype = "NvimTree" } },
},
})
-- Move buffers
vim.keymap.set("n", "L", ":BufferLineCycleNext<CR>", { silent = true })
vim.keymap.set("n", "H", ":BufferLineCyclePrev<CR>", { silent = true })
-- Kill buffer
vim.keymap.set("n", "<Leader>x", " :Bdelete<CR>", { silent = true })
-- Shift buffers
-- vim.keymap.set("n", "<C-L>", ":BufferLineMoveNext<CR>")
-- vim.keymap.set("i", "<C-L>", "<Esc>:BufferLineMoveNext<CR>i")
-- vim.keymap.set("n", "<C-H>", ":BufferLineMovePrev<CR>")
-- vim.keymap.set("i", "<C-H>", "<Esc>:BufferLineMovePrev<CR>i")
end,
})
-- File explorer
use({
"kyazdani42/nvim-tree.lua",
requires = { "kyazdani42/nvim-web-devicons" },
config = function()
require("nvim-tree").setup({
disable_netrw = true,
hijack_netrw = true,
update_focused_file = {
enable = true,
update_cwd = true,
ignore_list = {},
},
diagnostics = {
enable = true,
icons = {
hint = "",
info = "",
warning = "",
error = "",
},
},
renderer = {
icons = {
glyphs = {
git = {
unstaged = "~",
staged = "+",
unmerged = "",
renamed = "",
deleted = "",
untracked = "?",
ignored = "",
},
},
},
},
view = {
width = 30,
hide_root_folder = false,
side = "left",
mappings = {
custom_only = false,
list = {
{
key = { "l", "<CR>", "o" },
cb = require("nvim-tree.config").nvim_tree_callback("edit"),
},
{ key = "h", cb = require("nvim-tree.config").nvim_tree_callback("close_node") },
{ key = "v", cb = require("nvim-tree.config").nvim_tree_callback("vsplit") },
},
},
number = false,
relativenumber = false,
},
})
vim.keymap.set("n", "<Leader>e", ":NvimTreeFindFileToggle<CR>", { silent = true })
-- https://github.com/kyazdani42/nvim-tree.lua/commit/fb8735e96cecf004fbefb086ce85371d003c5129
vim.g.loaded = 1
vim.g.loaded_netrwPlugin = 1
end,
})
-- Markdown pretty view
use("ellisonleao/glow.nvim")
-- Hex color previews
use({
"norcalli/nvim-colorizer.lua",
config = function()
require("colorizer").setup()
end,
})
end
return M

View File

@ -1,34 +0,0 @@
-- Bootstrap the Packer plugin manager
local fn = vim.fn
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
PACKER_BOOTSTRAP = fn.system({
"git",
"clone",
"--depth",
"1",
"https://github.com/wbthomason/packer.nvim",
install_path,
})
end
require("packer").startup(function(use)
-- Maintain plugin manager
use("wbthomason/packer.nvim")
-- Include other files initialized by packer
require("packer.speed").packer(use)
require("packer.misc").packer(use)
require("packer.colors").packer(use)
require("packer.visuals").packer(use)
require("packer.lsp").packer(use)
require("packer.completion").packer(use)
require("packer.syntax").packer(use)
require("packer.telescope").packer(use)
require("packer.toggleterm").packer(use)
-- Auto-install after bootstrapping
if PACKER_BOOTSTRAP then
require("packer").sync()
end
end)

View File

@ -4,8 +4,9 @@
vim.filetype.add({ vim.filetype.add({
pattern = { pattern = {
[".*%.tfvars"] = "hcl", [".*%.tfvars"] = "terraform",
[".*%.tf"] = "hcl", [".*%.tf"] = "terraform",
[".*%.rasi"] = "rasi",
}, },
}) })

View File

@ -26,13 +26,17 @@
# ] ++ extraConfig; # ] ++ extraConfig;
# } # }
{ pkgs, colors ? { }, ... }: { pkgs, colors, ... }:
# Comes from nix2vim overlay:
# https://github.com/gytis-ivaskevicius/nix2vim/blob/master/lib/neovim-builder.nix
pkgs.neovimBuilder { pkgs.neovimBuilder {
package = pkgs.neovim-unwrapped; package = pkgs.neovim-unwrapped;
inherit colors;
imports = [ imports = [
../config/align.nix ../config/align.nix
../config/bufferline.nix ../config/bufferline.nix
../config/colors.nix
../config/completion.nix ../config/completion.nix
../config/gitsigns.nix ../config/gitsigns.nix
../config/lsp.nix ../config/lsp.nix
@ -42,6 +46,5 @@ pkgs.neovimBuilder {
../config/telescope.nix ../config/telescope.nix
../config/toggleterm.nix ../config/toggleterm.nix
../config/tree.nix ../config/tree.nix
colors
]; ];
} }

View File

@ -0,0 +1,8 @@
expression: (apply_expression
function: (apply_expression
function: (select_expression
attrpath: (attrpath) @writeshell (#match? @writeshell "^writeShell.*$")
)
)
(indented_string_expression) @bash
)

View File

@ -1,5 +1,7 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
# Allows me to make sure I can work on my dotfiles locally
options.dotfiles.enable = lib.mkEnableOption "Clone dotfiles."; options.dotfiles.enable = lib.mkEnableOption "Clone dotfiles.";
config = lib.mkIf config.dotfiles.enable { config = lib.mkIf config.dotfiles.enable {
@ -14,13 +16,8 @@
[ "writeBoundary" ] '' [ "writeBoundary" ] ''
if [ ! -d "${config.dotfilesPath}" ]; then if [ ! -d "${config.dotfilesPath}" ]; then
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}") $DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}")
$DRY_RUN_CMD ${pkgs.git}/bin/git \
# Force HTTPS because anonymous SSH doesn't work clone ${config.dotfilesRepo} "${config.dotfilesPath}"
GIT_CONFIG_COUNT=1 \
GIT_CONFIG_KEY_0="url.https://github.com/.insteadOf" \
GIT_CONFIG_VALUE_0="git@github.com:" \
$DRY_RUN_CMD \
${pkgs.git}/bin/git clone ${config.dotfilesRepo} "${config.dotfilesPath}"
fi fi
''; '';

View File

@ -1,5 +1,8 @@
{ config, ... }: { { config, ... }: {
# This is just a placeholder as I expect to interact with my notes in a
# certain location
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
home.sessionVariables = { home.sessionVariables = {

View File

@ -0,0 +1,20 @@
{ config, pkgs, lib, ... }: {
config = {
home-manager.users.${config.user} = {
programs.bash = {
enable = true;
shellAliases =
config.home-manager.users.${config.user}.programs.fish.shellAliases;
initExtra = "";
profileExtra = "";
};
programs.starship.enableBashIntegration = false;
programs.zoxide.enableBashIntegration = true;
programs.fzf.enableBashIntegration = true;
};
};
}

View File

@ -0,0 +1,26 @@
#!/bin/sh
# Stop all containers
if [ "$(docker ps -a -q)" ]; then
echo "Stopping docker containers..."
docker stop "$(docker ps -a -q)"
else
echo "No running docker containers."
fi
# Remove all stopped containers
if [ "$(docker ps -a -q)" ]; then
echo "Removing docker containers..."
docker rm "$(docker ps -a -q)"
else
echo "No stopped docker containers."
fi
# Remove all untagged images
if docker images | grep -q "^<none>"; then
docker rmi "$(docker images | grep "^<none>" | awk '{print $3}')"
else
echo "No untagged docker images."
fi
echo "Cleaned up docker."

View File

@ -1,5 +1,7 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
# Convenience utilities from charm.sh
options.charm.enable = lib.mkEnableOption "Charm utilities."; options.charm.enable = lib.mkEnableOption "Charm utilities.";
config.home-manager.users.${config.user} = lib.mkIf config.charm.enable { config.home-manager.users.${config.user} = lib.mkIf config.charm.enable {
@ -8,6 +10,7 @@
glow # Markdown previews glow # Markdown previews
skate # Key-value store skate # Key-value store
charm # Manage account and filesystem charm # Manage account and filesystem
pop # Send emails from a TUI
]; ];
}; };

View File

@ -1,11 +1,13 @@
{ ... }: { { ... }: {
imports = [ imports = [
./bash
./charm.nix ./charm.nix
./direnv.nix ./direnv.nix
./fish ./fish
./fzf.nix ./fzf.nix
./git.nix ./git.nix
./github.nix ./github.nix
./jujutsu.nix
./nixpkgs.nix ./nixpkgs.nix
./starship.nix ./starship.nix
./utilities.nix ./utilities.nix

View File

@ -1,5 +1,6 @@
{ config, ... }: { { config, ... }: {
# Enables quickly entering Nix shells when changing directories
home-manager.users.${config.user}.programs.direnv = { home-manager.users.${config.user}.programs.direnv = {
enable = true; enable = true;
nix-direnv.enable = true; nix-direnv.enable = true;

View File

@ -1,18 +1,24 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
users.users.${config.user}.shell = pkgs.fish; users.users.${config.user}.shell = pkgs.fish;
programs.fish.enable = programs.fish.enable = true; # Needed for LightDM to remember username
true; # Needed for LightDM to remember username (TODO: fix)
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
# Packages used in abbreviations and aliases # Packages used in abbreviations and aliases
home.packages = with pkgs; [ curl exa ]; home.packages = with pkgs; [ curl ];
programs.fish = { programs.fish = {
enable = true; enable = true;
shellAliases = { shellAliases = {
ls = "exa";
# Version of bash which works much better on the terminal
bash = "${pkgs.bashInteractive}/bin/bash";
# Use eza (exa) instead of ls for fancier output
ls = "${pkgs.eza}/bin/eza --group";
# Move files to XDG trash on the commandline
trash = lib.mkIf pkgs.stdenv.isLinux "${pkgs.trash-cli}/bin/trash-put"; trash = lib.mkIf pkgs.stdenv.isLinux "${pkgs.trash-cli}/bin/trash-put";
}; };
functions = { functions = {
@ -76,7 +82,6 @@
set -g fish_cursor_replace_one underscore set -g fish_cursor_replace_one underscore
''; '';
loginShellInit = ""; loginShellInit = "";
shellAliases = { };
shellAbbrs = { shellAbbrs = {
# Directory aliases # Directory aliases

View File

@ -14,7 +14,7 @@ bind -M insert \cp projects
bind -M default \cp projects bind -M default \cp projects
bind -M insert \x1F accept-autosuggestion bind -M insert \x1F accept-autosuggestion
bind -M default \x1F accept-autosuggestion bind -M default \x1F accept-autosuggestion
bind -M insert \cn 'commandline -r "nix run nixpkgs#"' bind -M insert \cn 'commandline -r "nix shell nixpkgs#"'
bind -M default \cn 'commandline -r "nix run nixpkgs#"' bind -M default \cn 'commandline -r "nix shell nixpkgs#"'
bind -M insert \x11F nix-fzf bind -M insert \x11F nix-fzf
bind -M default \x11F nix-fzf bind -M default \x11F nix-fzf

View File

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

View File

@ -1,5 +1,7 @@
{ config, ... }: { { config, ... }: {
# FZF is a fuzzy-finder for the terminal
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
programs.fzf.enable = true; programs.fzf.enable = true;
@ -13,9 +15,8 @@
fd \ fd \
--search-path $HOME/dev \ --search-path $HOME/dev \
--type directory \ --type directory \
--hidden \ --exact-depth 2 \
"^.git\$" \ | sed 's/\\/$//' \
| xargs dirname \
| fzf \ | fzf \
--delimiter '/' \ --delimiter '/' \
--with-nth 6.. \ --with-nth 6.. \

View File

@ -31,6 +31,7 @@ in {
pager = { branch = "false"; }; pager = { branch = "false"; };
safe = { directory = config.dotfilesPath; }; safe = { directory = config.dotfilesPath; };
pull = { ff = "only"; }; pull = { ff = "only"; };
push = { autoSetupRemote = "true"; };
init = { defaultBranch = "master"; }; init = { defaultBranch = "master"; };
}; };
ignores = [ ".direnv/**" "result" ]; ignores = [ ".direnv/**" "result" ];
@ -50,7 +51,6 @@ in {
gcae = "git commit --amend"; gcae = "git commit --amend";
gu = "git pull"; gu = "git pull";
gp = "git push"; gp = "git push";
gpp = "git-push-upstream";
gl = "git log --graph --decorate --oneline -20"; gl = "git log --graph --decorate --oneline -20";
gll = "git log --graph --decorate --oneline"; gll = "git log --graph --decorate --oneline";
gco = "git checkout"; gco = "git checkout";
@ -113,10 +113,6 @@ in {
git-history = { git-history = {
body = builtins.readFile ./fish/functions/git-history.fish; body = builtins.readFile ./fish/functions/git-history.fish;
}; };
git-push-upstream = {
description = "Create upstream branch";
body = builtins.readFile ./fish/functions/git-push-upstream.fish;
};
uncommitted = { uncommitted = {
description = "Find uncommitted git repos"; description = "Find uncommitted git repos";
body = builtins.readFile ./fish/functions/uncommitted.fish; body = builtins.readFile ./fish/functions/uncommitted.fish;

View File

@ -5,7 +5,7 @@
programs.gh = programs.gh =
lib.mkIf config.home-manager.users.${config.user}.programs.git.enable { lib.mkIf config.home-manager.users.${config.user}.programs.git.enable {
enable = true; enable = true;
enableGitCredentialHelper = true; gitCredentialHelper.enable = true;
settings.git_protocol = "https"; settings.git_protocol = "https";
}; };
@ -19,6 +19,9 @@
grf = "gh run view --log-failed"; grf = "gh run view --log-failed";
grl = "gh run view --log"; grl = "gh run view --log";
ghpr = "gh pr create && sleep 3 && gh run watch"; ghpr = "gh pr create && sleep 3 && gh run watch";
# https://github.com/cli/cli/discussions/4067
prs = "gh search prs --state=open --review-requested=@me";
}; };
functions = { functions = {
repos = { repos = {

View File

@ -0,0 +1,21 @@
{ config, ... }: {
config = {
home-manager.users.${config.user}.programs.jujutsu = {
enable = true;
enableFishIntegration = true;
# https://github.com/martinvonz/jj/blob/main/docs/config.md
settings = {
user = {
name = config.home-manager.users.${config.user}.programs.git.userName;
email =
config.home-manager.users.${config.user}.programs.git.userEmail;
};
};
};
};
}

View File

@ -67,6 +67,15 @@
# Set channel to flake packages, used for nix-shell commands # Set channel to flake packages, used for nix-shell commands
nixPath = [ "nixpkgs=${pkgs.path}" ]; nixPath = [ "nixpkgs=${pkgs.path}" ];
# Set registry to this flake's packages, used for nix X commands
registry.nixpkgs.to = {
type = "path";
path = builtins.toString pkgs.path;
};
# For security, only allow specific users
settings.allowed-users = [ "@wheel" config.user ];
}; };
} }

View File

@ -1,4 +1,4 @@
{ config, lib, ... }: { { config, pkgs, lib, ... }: {
home-manager.users.${config.user}.programs.starship = { home-manager.users.${config.user}.programs.starship = {
enable = true; enable = true;
@ -21,7 +21,7 @@
}; };
cmd_duration = { cmd_duration = {
min_time = 5000; min_time = 5000;
show_notifications = true; show_notifications = if pkgs.stdenv.isLinux then false else true;
min_time_to_notify = 30000; min_time_to_notify = 30000;
format = "[$duration]($style) "; format = "[$duration]($style) ";
}; };

View File

@ -18,21 +18,26 @@ in {
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
home.packages = with pkgs; [ home.packages = with pkgs; [
unzip # Extract zips age # Encryption
bc # Calculator
dig # DNS lookup
fd # find
htop # Show system processes
killall # Force quit
inetutils # Includes telnet, whois
jq # JSON manipulation
lf # File viewer
qrencode # Generate qr codes
rsync # Copy folders rsync # Copy folders
ripgrep # grep ripgrep # grep
fd # find
sd # sed sd # sed
jq # JSON manipulation
tealdeer # Cheatsheets tealdeer # Cheatsheets
tree # View directory hierarchy tree # View directory hierarchy
htop # Show system processes
qrencode # Generate qr codes
vimv-rs # Batch rename files vimv-rs # Batch rename files
dig # DNS lookup unzip # Extract zips
lf # File viewer dua # File sizes (du)
inetutils # Includes telnet, whois du-dust # Disk usage tree (ncdu)
age # Encryption duf # Basic disk information (df)
]; ];
programs.zoxide.enable = true; # Shortcut jump command programs.zoxide.enable = true; # Shortcut jump command
@ -45,11 +50,10 @@ in {
programs.bat = { programs.bat = {
enable = true; # cat replacement enable = true; # cat replacement
config = { theme = config.theme.colors.batTheme; }; config = {
theme = config.theme.colors.batTheme;
pager = "less -R"; # Don't auto-exit if one screen
}; };
programs.fish.shellAbbrs = {
cat = "bat"; # Swap cat with bat
}; };
programs.fish.functions = { programs.fish.functions = {

View File

@ -2,6 +2,7 @@
imports = [ imports = [
./alacritty.nix ./alacritty.nix
./fish.nix
./fonts.nix ./fonts.nix
./hammerspoon.nix ./hammerspoon.nix
./homebrew.nix ./homebrew.nix

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