Compare commits

...

583 commits

Author SHA1 Message Date
Bruno BELANYI 8e56077d94 WIP: home: vim: notify
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-11 10:38:42 +01:00
Bruno BELANYI 30c676e20b home: vim: sort plugin list
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-11 10:08:25 +01:00
Bruno BELANYI ed24bebc04 home: wm: i3bar: show microphone status
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-09 12:09:43 +01:00
Bruno BELANYI 23c4256769 home: vim: telescope: add LSP handler
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-08 20:57:28 +01:00
Bruno BELANYI 4e9764920a home: vim: move 'on_attach' to 'ambroisie.lsp' 2022-03-08 20:20:22 +01:00
Bruno BELANYI 3fc0201dfa home: vim: lspconfig: use actual 'lspconfig' name 2022-03-08 20:18:02 +01:00
Bruno BELANYI d5527912a3 modules: services: matrix: use 'settings'
All checks were successful
continuous-integration/drone/push Build is passing
The unstructured attributes are hard-deprecated.
2022-03-08 11:56:32 +01:00
Bruno BELANYI 44b2034135 flake: bump inputs
Some checks failed
continuous-integration/drone/push Build is failing
2022-03-08 10:41:35 +01:00
Bruno BELANYI 6f7f49dc13 home: vim: completion: do not use tab to select
I would rather have my actual preferred mappings, <C-n> and <C-p>, for
that.
2022-03-08 10:41:35 +01:00
Bruno BELANYI d39c0419b7 home: vim: lualine: remove 'fzf' integration
I do not use 'fzf' anymore.
2022-03-08 10:41:35 +01:00
Bruno BELANYI e4622dd6ea home: vim: configure 'luasnip' 2022-03-08 10:41:35 +01:00
Bruno BELANYI 52e0a2fd0f home: vim: add 'friendly-snippets' 2022-03-08 10:41:35 +01:00
Bruno BELANYI d5e50b5389 home: vim: completion: remove up/down mappings
I do not use arrow keys, why bother with them.
2022-03-08 10:41:35 +01:00
Bruno BELANYI fdf1f1617f home: vim: add 'nvim-ts-context-commentstring' 2022-03-08 10:41:35 +01:00
Bruno BELANYI be3391285a home: vim: comparison: stronger priority hint 2022-03-08 10:41:35 +01:00
Bruno BELANYI 435e56d53a home: vim: completion: configure snippets 2022-03-08 10:41:35 +01:00
Bruno BELANYI df92d1c562 home: vim: sort plugin list 2022-03-08 10:41:35 +01:00
Bruno BELANYI 8d1535e261 home: vim: add 'luasnip' 2022-03-08 10:41:35 +01:00
Bruno BELANYI 2df0940665 home: vim: completion: add mapping to scroll docs 2022-03-08 10:41:35 +01:00
Bruno BELANYI 3e0a5ef1a4 home: vim: completion: add 'cmp-under-comparator' 2022-03-08 10:41:35 +01:00
Bruno BELANYI 52722fb408 home: vim: completion: explicit mappings
This is basically a copy-paste of the default mappings, with some small
amount of customization.
2022-03-08 10:41:35 +01:00
Bruno BELANYI 93a3a4fb6b home: vim: configure 'dressing-nvim' 2022-03-08 10:41:35 +01:00
Bruno BELANYI 1834a7002b home: vim: add 'dressing-nvim' 2022-03-08 10:41:35 +01:00
Bruno BELANYI bcbc9af372 home: vim: telescope: set-up 'fzf' matching 2022-03-08 10:41:35 +01:00
Bruno BELANYI 1be9eb517b home: vim: add 'telescope' grep mappings 2022-03-08 10:41:35 +01:00
Bruno BELANYI 16fc677509 home: vim: replace 'fzf' with 'telescope'
I like the fact that it uses built-in buffers to preview files.

It also has more inertia behind it, tighter integrations in the
ecosystem.
2022-03-08 10:41:35 +01:00
Bruno BELANYI bf7184c260 home: packages: add 'fd' 2022-03-08 10:41:35 +01:00
Bruno BELANYI 4627350311 home: packages: add 'ripgrep' 2022-03-08 10:41:35 +01:00
Bruno BELANYI 9ef35f06df home: vim: completion: limit 'buffer' suggestions
Otherwise it gets overwhelming, and most are useless.
2022-03-08 10:41:35 +01:00
Bruno BELANYI 5b7fa7c09a home: vim: completion: use better order 2022-03-08 10:41:35 +01:00
Bruno BELANYI a49e66da80 home: vim: completion: use native menu 2022-03-08 10:41:35 +01:00
Bruno BELANYI 35d96e1e69 home: vim: configure 'nvim-cmp' for LSP 2022-03-08 10:41:35 +01:00
Bruno BELANYI 05e7883dab home: vim: add 'cmp-nvim-lsp' 2022-03-08 10:41:35 +01:00
Bruno BELANYI 273618ff94 home: vim: configure 'nvim-cmp' 2022-03-08 10:41:35 +01:00
Bruno BELANYI 25967e21f1 home: vim: add 'nvim-cmp' 2022-03-04 17:40:30 +01:00
Bruno BELANYI 3df2ad0f1f home: vim: git: more visual mappings
I cannot use the functions directly, as I would need to calculate the
current selections begin and end points and use them as arguments.

To be investigated.
2022-03-04 17:40:30 +01:00
Bruno BELANYI 57e5def998 home: vim: git: 'gitsigns' mappings are per buffer 2022-03-04 17:40:30 +01:00
Bruno BELANYI c5d9396a7d home: vim: git: use more appropriate mapping names 2022-03-04 17:40:30 +01:00
Bruno BELANYI 5263942970 home: vim: lsp: add diagnostic mappings 2022-03-04 17:40:30 +01:00
Bruno BELANYI cd20914370 home: vim: lsp: add workspace mappings 2022-03-04 17:40:30 +01:00
Bruno BELANYI 04761da664 home: vim: add 'dump' utility function 2022-03-04 17:40:30 +01:00
Bruno BELANYI 14d9837b07 home: vim: remove 'fastfold'
I don't think I need it anymore, neovim improves the native performance
well enough.
2022-03-04 17:40:30 +01:00
Bruno BELANYI adedb42a99 home: vim: add mappings for LSP functionality 2022-03-04 17:40:30 +01:00
Bruno BELANYI 38c140ee86 home: vim: don't use 'nixpkgs-fmt' with 'rnix' 2022-03-04 17:40:30 +01:00
Bruno BELANYI d36f01d937 home: vim: add 'rnix' LSP configuration 2022-03-04 17:40:30 +01:00
Bruno BELANYI 62f93a852a home: vim: add 'clang-tools' to vim package
It includes both `clangd` and `clang-format`, even though I'm mostly
looking for the later.
2022-03-04 17:40:30 +01:00
Bruno BELANYI 080d08bb13 home: vim: add linters & formatters to vim package
I use them so often, I basically always want them available.
2022-03-04 17:40:30 +01:00
Bruno BELANYI 6da1c47472 home: vim: add 'shellcheck' code actions 2022-03-04 17:40:30 +01:00
Bruno BELANYI 9c023b78a3 home: vim: rename 'git'-related settings file
Now that it contains more settings than just 'gitsigns'.
2022-03-04 17:40:30 +01:00
Bruno BELANYI 3d6580f52b home: vim: centralise 'git'-related mappings 2022-03-04 17:40:30 +01:00
Bruno BELANYI f34f2fc706 home: vim: configure 'gitsigns'
And remove some unused mappings, or adapt them to 'gitsigns'.
2022-03-04 17:40:30 +01:00
Bruno BELANYI 95df872916 home: vim: add 'gitsigns-nvim' 2022-03-04 17:40:30 +01:00
Bruno BELANYI 3e86aa5ef4 home: bat: use 'gruvbox-dark' theme
To match my `vim` configuration.
2022-03-04 17:40:30 +01:00
Bruno BELANYI f2f2b2a98a home: vim: prefer 'clangd' to 'clang-format'
Only use `clang-format` if `clangd` is not available, as its formatting
is otherwise built into the LSP server.
2022-03-04 17:40:30 +01:00
Bruno BELANYI 842489a986 home: vim: use 'unimpaired' mappings for quickfix 2022-03-04 17:40:30 +01:00
Bruno BELANYI 4cecb8b987 home: zsh: add 'zsh-completions' when enabled
Notably useful for `git-revise`.
2022-03-04 17:40:30 +01:00
Bruno BELANYI bc56292544 home: zsh: refactor 'mkIf' block 2022-03-04 17:40:30 +01:00
Bruno BELANYI c259fe87a0 home: zsh: use packaged 'fast-syntax-highlighting' 2022-03-04 17:40:30 +01:00
Bruno BELANYI 508b30eadd home: vim: show LSP progress in status line 2022-03-04 17:40:30 +01:00
Bruno BELANYI 605da54f24 home: vim: switch to 'lualine' 2022-03-04 17:40:30 +01:00
Bruno BELANYI 213d698d56 home: vim: add function to list LSP client names 2022-03-04 17:40:30 +01:00
Bruno BELANYI c5fff38942 home: vim: remove unused 'gruvbox' configuration 2022-03-04 17:40:30 +01:00
Bruno BELANYI e3b0f9d38f home: vim: move diagnostics config to 'on_attach' 2022-03-04 17:40:30 +01:00
Bruno BELANYI af56bc76cf home: vim: add 'clangd' LSP configuration 2022-03-04 17:40:30 +01:00
Bruno BELANYI 7a9760b0cd home: vim: add 'rust-analyzer' LSP configuration 2022-03-04 17:40:30 +01:00
Bruno BELANYI e8ffddedef home: vim: add basic LSP configuration
Trying it out with `pyright` for now.
2022-03-04 17:40:30 +01:00
Bruno BELANYI 44dae3a940 home: vim: move LSP-related 'on_attach' to 'utils'
As it will be shared between `null-ls` and `lspconfig`, it makes sense
to put it there.
2022-03-04 14:54:14 +01:00
Bruno BELANYI b79cee6eee home: vim: add diagnostic navigation mappings 2022-03-04 14:51:44 +01:00
Bruno BELANYI 56156e1fe4 home: vim: do not use 'ftplugin' for 'null-ls'
Unfortunately, this registers the sources many times...

I fear that I will have to settle for a centralised configuration for
LSP-related options.
2022-03-04 14:14:30 +01:00
Bruno BELANYI f551c4fc30 home: vim: only use 'null-ls' sources if available
This avoids the big red warning on each file that tries to use those
sources...
2022-03-03 18:15:28 +01:00
Bruno BELANYI f854c49c29 home: vim: add 'ambroisie.utils' lua module 2022-03-03 18:15:28 +01:00
Bruno BELANYI ae7c2d921b home: vim: add statement objects/moves
And document it.
2022-03-03 18:15:28 +01:00
Bruno BELANYI a96fb22d4d home: vim: document 'tree-sitter' moves 2022-03-03 18:15:28 +01:00
Bruno BELANYI bd5a15ebe7 home: vim: add 'tree-sitter' moves 2022-03-03 18:15:28 +01:00
Bruno BELANYI d26b9f2537 home: vim: document 'treesitter-textobjects' maps
By using 'which-key'.
2022-03-03 18:15:28 +01:00
Bruno BELANYI b7b3387df7 home: vim: add 'treesitter-textobjects' 2022-03-03 18:15:28 +01:00
Bruno BELANYI be84a4a6fa home: vim: remove mapping to run 'make' 2022-03-03 18:15:28 +01:00
Bruno BELANYI bbc47b6683 home: vim: document 'commentary' mappings
By using 'which-key'.
2022-03-03 18:15:28 +01:00
Bruno BELANYI 416a4ca0d6 home: vim: document 'unimpaired' mappings
By using 'which-key'.
2022-03-03 18:15:28 +01:00
Bruno BELANYI 19889f4cbf home: vim: use 'which-key' 2022-03-03 18:15:28 +01:00
Bruno BELANYI fa836d7df9 home: vim: add 'which-key-nvim' 2022-03-02 12:30:53 +01:00
Bruno BELANYI 8b985cda84 home: vim: move leader mappings to 'init.vim' 2022-03-02 12:30:53 +01:00
Bruno BELANYI 0478efa817 home: vim: remove unused mappings
The beancount mappings are absolutely unused.

The `Y` mapping is built in NeoVim nowadays.
2022-03-02 12:30:53 +01:00
Bruno BELANYI 87f255d265 home: vim: remove unimpaired mappings
I do not use `azerty` anymore, no need for those.
2022-03-02 12:30:53 +01:00
Bruno BELANYI b9e5273672 home: vim: remove 'lsp_lines'
I like the hovering behaviour better, it's less "in your face".

I might revisit the idea in the future, as a toggled mapping.
2022-03-02 12:30:53 +01:00
Bruno BELANYI dd3bfc74fa home: vim: show diagnostics on hover
Ideally, I want the following features:
* diagnostic icons in the sign column always,
* virtual text on the current line only
* switch to hover window and/or lsp_lines display through a mapping
2022-03-02 12:30:53 +01:00
Bruno BELANYI 5dd9d1c6d0 home: vim: configure short 'CursorHold' timeout 2022-03-02 12:30:53 +01:00
Bruno BELANYI d87fd7b9e1 home: vim: configure diagnostics further
This is not only 'lsp_lines' configuration anymore, but the whole
display of diagnostics.
2022-03-02 12:30:53 +01:00
Bruno BELANYI 01d7ead121 home: vim: add 'nvim-treesitter'
IMHO, this is *very* colorful, I might not end up using the highlighting
after all.

Let's see if I get used to it after a little while.
2022-03-02 12:30:53 +01:00
Bruno BELANYI e701dd06ea home: vim: make python formatting faster 2022-03-02 12:30:53 +01:00
Bruno BELANYI faa8ae6d1e home: vim: add 'lsp_lines'
I dislike the diagnostics *next* to affected lines.

This looks neater, though the best look would be a simple hover window
or status line message instead, like ALE used to do.

It might grow on me however.
2022-03-02 12:30:53 +01:00
Bruno BELANYI 729f60c471 home: vim: configure 'null-ls' for 'nix' 2022-03-02 12:30:53 +01:00
Bruno BELANYI d7a9783ceb home: vim: keep space after shell redirections 2022-03-02 12:30:53 +01:00
Bruno BELANYI f54fbcf793 home: vim: show error codes from 'shellcheck' 2022-03-02 12:30:53 +01:00
Bruno BELANYI 4b92a3fda9 home: vim: configure 'null-ls' for 'python' 2022-03-02 12:30:53 +01:00
Bruno BELANYI 5947ec4217 home: vim: configure 'null-ls' for 'cpp' 2022-03-02 12:30:53 +01:00
Bruno BELANYI bb512cf838 home: vim: configure 'null-ls' for 'c' 2022-03-02 12:30:53 +01:00
Bruno BELANYI 3aa859861e home: vim: add formatting on save with 'null-ls' 2022-03-02 12:30:53 +01:00
Bruno BELANYI 60b87c90fc home: vim: configure 'null-ls' for 'haskell' 2022-03-02 12:30:53 +01:00
Bruno BELANYI 5f06b43ad4 home: vim: configure 'null-ls' for 'zsh' 2022-03-02 12:30:53 +01:00
Bruno BELANYI 58470804d6 home: vim: configure 'null-ls' for 'sh' 2022-03-02 12:30:53 +01:00
Bruno BELANYI 58bf5b6b1c home: vim: configure 'null-ls' for 'bash' 2022-03-02 12:30:53 +01:00
Bruno BELANYI 367dc1e5a5 home: vim: add 'null-ls' 2022-03-02 12:30:53 +01:00
Bruno BELANYI d9a2c12d3f home: vim: configure 'lightline-lsp'
This pretty much replace 'lightline-ale' for me now.

At least it will, once I have configured some LSP clients.
2022-03-02 12:30:53 +01:00
Bruno BELANYI f73f59b06c home: vim: add 'lightline-lsp' 2022-03-02 12:30:53 +01:00
Bruno BELANYI cb389b71b1 home: vim: remove 'quickfixed' functionality
I never use it anymore...
2022-03-02 12:13:13 +01:00
Bruno BELANYI 4382904060 home: vim: remove 'ALE' configuration
First step to modernising my configuration to use the native LSP client
instead.
2022-03-02 12:13:13 +01:00
Bruno BELANYI 5ce5057d0f flake: bump inputs
And do not use 'pipewire-media-session' which is deprecated.
2022-03-02 12:13:13 +01:00
Bruno BELANYI d2e410de56 home: vim: fix icon for read-only files 2022-02-23 21:06:12 +01:00
Bruno BELANYI 1819c7077d flake: bump inputs
All checks were successful
continuous-integration/drone/push Build is passing
2022-02-21 18:53:56 +01:00
Bruno BELANYI 44ed078606 home: wm: i3: only boost volume on 'Shift' mapping
All checks were successful
continuous-integration/drone/push Build is passing
2022-02-18 12:22:51 +01:00
Bruno BELANYI 305b0b985c pkgs: change-audio: 0.2.0 -> 0.3.0
Only boost audio beyond 100% if specifically asked for.
2022-02-18 12:22:51 +01:00
Bruno BELANYI 27448ac60a home: tmux: fix yanking configuration
All checks were successful
continuous-integration/drone/push Build is passing
Use `tmux-yank` when a GUI is enabled, otherwise use the internal tmux
buffer.

In both cases, stay in copy mode after yanking.
2022-02-08 17:25:44 +01:00
Bruno BELANYI f73edd9f8d modules: system: nix: use structural 'settings'
All checks were successful
continuous-integration/drone/push Build is passing
Instead of a stringly-typed `extraOptions`.
2022-02-08 14:32:00 +01:00
Bruno BELANYI e57ebf4317 home: firefox: tridactyl: fix HN comment folding
All checks were successful
continuous-integration/drone/push Build is passing
2022-02-07 17:00:18 +01:00
Bruno BELANYI e8adbb5b20 home: firefox: tridactyl: fix DDG mapping
All checks were successful
continuous-integration/drone/push Build is passing
Taken straight from upstream's sample configuration.
2022-02-07 15:51:56 +01:00
Bruno BELANYI 6d1d0c9488 home: packages: add 'mosh'
All checks were successful
continuous-integration/drone/push Build is passing
2022-02-07 15:00:52 +01:00
Bruno BELANYI 61cd9cb1a2 flake: bump inputs 2022-02-07 14:49:06 +01:00
Bruno BELANYI d6acc175de home: wm: i3bar: show volume when muted 2022-02-03 11:40:24 +01:00
Bruno BELANYI 9dd3dceb83 home: ssh: add 'work' host
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-25 15:53:01 +01:00
Bruno BELANYI 633a422532 home: firefox: remove 'i-dont-care-about-cookies'
Should be superseded by Consent-O-Matic now.
2022-01-25 15:53:01 +01:00
Bruno BELANYI b082057170 home: firefox: add 'consent-o-matic' 2022-01-25 15:53:01 +01:00
Bruno BELANYI 50c927fea3 flake: bump inputs
Also change a removed package alias' name.
2022-01-25 15:53:01 +01:00
Bruno BELANYI 42cb742976 modules: system: packages: remove some packages
All checks were successful
continuous-integration/drone/push Build is passing
They either belong in a nix shell or are taken care of by other
configurations.
2022-01-14 15:06:55 +01:00
Bruno BELANYI 5558642d32 modules: services: nginx: use 'acme.default.email'
All checks were successful
continuous-integration/drone/push Build is passing
The option `security.acme.email` has been deprecated.
2022-01-14 13:30:22 +01:00
Bruno BELANYI a66441d496 pkgs: add psst 2022-01-14 13:27:17 +01:00
Bruno BELANYI 702bfafe73 home: firefox: trydactyl: ignore prime video 2022-01-14 13:24:09 +01:00
Bruno BELANYI f4b860d915 machines: porthos: services: disable nzbhydra
Same deal as jackett: prowlarr has been working perfectly adequately for
a while now.
2022-01-14 13:24:09 +01:00
Bruno BELANYI b565518e2d machines: porthos: services: disable jackett
Prowlarr has been humming along just fine, and works even better than
jackett.
2022-01-14 13:24:09 +01:00
Bruno BELANYI 15a093ff61 modules: system: add podman 2022-01-14 13:24:09 +01:00
Bruno BELANYI 06e7134ae0 machines: aramis: home: enable discord
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-09 22:19:28 +01:00
Bruno BELANYI d2db3e52c2 home: add discord 2022-01-09 22:19:07 +01:00
Bruno BELANYI 9c009b40eb home: wm: change default screen-lock timeout
5 minutes is too short.
2022-01-07 08:55:58 +01:00
Bruno BELANYI dc8d4c2802 flake: bump inputs 2022-01-07 08:55:58 +01:00
Bruno BELANYI afc78bac2a machines: aramis: home: add teams package
Unfortunately, it is the preferred communication method at $WORK.
2022-01-07 08:55:58 +01:00
Bruno BELANYI 3a313812b8 modules: system: nix: add inputs to NIX_PATH 2022-01-07 08:55:58 +01:00
Bruno BELANYI 876dacab85 home: vim: cut back on fzf mappings
I only ever use the buffer and files regularly.
2021-12-22 23:34:46 +01:00
Bruno BELANYI d71a99083c modules: services: nextcloud: upgrade version
All checks were successful
continuous-integration/drone/push Build is passing
2021-12-07 19:11:32 +01:00
Bruno BELANYI 5f3d9b3a22 flake: bump inputs
And use renamed option for agenix identities.
2021-12-07 19:11:32 +01:00
Bruno BELANYI 0becdd4b99 home: git: do not change metadata color
All checks were successful
continuous-integration/drone/push Build is passing
2021-12-06 21:24:31 +01:00
Bruno BELANYI 555c474b88 flake: bump inputs
All checks were successful
continuous-integration/drone/push Build is passing
And make my configuration build after the removed option from
`programs.direnv` in home-manager.
2021-11-30 15:41:14 +01:00
Bruno BELANYI 0bf893c8a0 home: restart services automatically (again)
All checks were successful
continuous-integration/drone/push Build is passing
I think my issue was *not* related to this, so I might as well keep
using it since it does seem useful in the long run.

This reverts commit a94f349dde.
2021-11-30 15:41:14 +01:00
Bruno BELANYI 925b872305 home: git: switch to 'delta'
All checks were successful
continuous-integration/drone/push Build is passing
Now that my issue with it has been resolved [1], let's switch to the
more mature tool.

This also solves a small issue that I had with `diff-highlight` which is
that non-highlighted text should not be boldened.

[1]: https://github.com/dandavison/delta/issues/544
2021-11-29 17:50:07 +01:00
Bruno BELANYI 2b5fedadd2 home: git: use diff-highlight in interactive diffs
Now even `git log -p` and `git add -p` can use the more readable diffs.
2021-11-29 13:13:48 +01:00
Bruno BELANYI c7c38865e9 modules: system: nix: don't change daemon niceness
This option doesn't really work the way it should anyway [1].

This reverts commit cbf6ea9ac9.

[1]: https://github.com/NixOS/nixpkgs/pull/138741
2021-11-23 18:53:11 +01:00
Bruno BELANYI 5150bad300 flake: agenix has renamed its branch to 'main' 2021-11-23 17:08:46 +01:00
Bruno BELANYI 6f643052e1 home: wm: i3: show notification on toggling mute
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-12 10:21:25 +01:00
Bruno BELANYI 119504d0b5 pkgs: change-audio: 0.1.2 -> 0.2.0
Allow muting microphone and speakers, with refactor to make it DRY.
2021-11-12 10:17:42 +01:00
Bruno BELANYI 2d7f01f035 pkgs: change-audio: 0.1.1 -> 0.1.2
Show if volume is currently muted.
2021-11-12 09:52:22 +01:00
Bruno BELANYI 6ebfa1a8cc flake: enable shellcheck pre-commit hook
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-12 09:42:39 +01:00
Bruno BELANYI 7d31aa93db pkgs: change-audio: 0.1.0 -> 0.1.1
Fix issue with not showing notification at 0% volume.
2021-11-12 09:40:37 +01:00
Bruno BELANYI cef430ed39 home: tmux: remove tmux service
All checks were successful
continuous-integration/drone/push Build is passing
Turns out it is more trouble than it is worth trying to make this work:
with the secure socket problem etc...

The first start up is fast enough for me in the end.

This reverts commit cc21d84808.
2021-11-09 15:32:59 +01:00
Bruno BELANYI 4c5b556bb8 flake: bump inputs
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-09 15:16:20 +01:00
Bruno BELANYI 10d35f73c8 modules: services: nginx-sso: always rewrite conf
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-06 15:43:00 +01:00
Bruno BELANYI 4491eaea49 modules: services: paperless: backup 'dataDir' 2021-11-05 17:03:52 +01:00
Bruno BELANYI 5f47ec564c modules: services: calibre-web: use 'dataDir' 2021-11-05 17:03:52 +01:00
Bruno BELANYI 6633405e42 modules: services: pirate: sort 'ports' values 2021-11-05 17:03:52 +01:00
Bruno BELANYI 21f0199791 machines: porthos: services: use 'lohr.sshKeyFile'
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-05 16:59:11 +01:00
Bruno BELANYI 7c1f379d82 modules: services: lohr: declarative ssh key 2021-11-05 16:59:11 +01:00
Bruno BELANYI e91ebb24f0 modules: secrets: lohr: add 'ssh-key' 2021-11-05 15:31:59 +01:00
Bruno BELANYI a602cf4143 profiles: wm: remove unused argument
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-05 14:58:58 +01:00
Bruno BELANYI e428895ba7 profiles: gtk: remove unused argument 2021-11-05 14:58:58 +01:00
Bruno BELANYI e7ff83b1bb pkgs: dragger: remove unused argument 2021-11-05 14:58:58 +01:00
Bruno BELANYI 79265008d2 modules: services: nginx: remove unused argument 2021-11-05 14:58:58 +01:00
Bruno BELANYI 74a5c50fbe modules: services: drone: remove unused arguments 2021-11-05 14:58:58 +01:00
Bruno BELANYI 680eeffd3a machines: porthos: users: remove unused let block 2021-11-05 14:58:58 +01:00
Bruno BELANYI 9b4a92895f home: wm: dunst: replace deprecated 'geometry'
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-04 16:35:06 +01:00
Bruno BELANYI 2af0fe542f home: wm: i3: use packaged scripts
Instead of inlining them in the configuration, use an actual package for
those.
2021-11-04 16:35:06 +01:00
Bruno BELANYI fe455ffe9f pkgs: add change-audio 2021-11-04 16:35:06 +01:00
Bruno BELANYI f6381b14b0 pkgs: add change-backlight 2021-11-04 16:35:06 +01:00
Bruno BELANYI 7dc177cf44 home: wm: i3: avoid loading icon on notifications
Because my script are obviously not startup id aware, hovering on the
notification leads to having a loading cursor.
2021-11-03 17:57:33 +01:00
Bruno BELANYI da4acebdde home: wm: i3: notify when changing audio volume 2021-11-03 17:50:28 +01:00
Bruno BELANYI 3f7fb26b8f home: wm: i3: extract 'notify-send' variable
It is used in multiple scripts, might as well centralise it.
2021-11-03 17:49:47 +01:00
Bruno BELANYI ddeeb974a4 modules: services: backup: remove deprecated name
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-03 17:16:40 +01:00
Bruno BELANYI ea6c3727be flake: bump inputs
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-03 14:10:18 +01:00
Bruno BELANYI 40ec169d6e flake: remove gnupg from devShell
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-03 14:10:18 +01:00
Bruno BELANYI a94f349dde home: do not restart services automatically
Turns out it is *not* ideal when modifying my WM configuration in any
way... Having i3 restart due to changing a keybinding is not great.

This reverts commit 6bec62073b.
2021-11-03 14:10:18 +01:00
Bruno BELANYI b83f28f2ba home: wm: i3: use 'i3status-rust.package' value 2021-11-03 14:10:18 +01:00
Bruno BELANYI 148d6609ec flake: bump inputs 2021-11-03 14:10:18 +01:00
Bruno BELANYI 14e4e681aa home: wm: screen-lock: rename changed option 2021-10-22 13:15:22 +02:00
Bruno BELANYI 3058636c87 modules: home: forward inputs to home-manager
This will be useful if and when I end up adding inputs with home-manager
modules defined.
2021-10-22 13:06:53 +02:00
Bruno BELANYI 6bec62073b home: start services when switching
All checks were successful
continuous-integration/drone/push Build is passing
As I use home-manager with its NixOS module, I do not see the message
suggesting to start the services otherwise.
2021-10-21 16:42:15 +02:00
Bruno BELANYI 5241bce29b project: readme: mention manual prowlarr step
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-18 19:48:50 +02:00
Bruno BELANYI 4f11cf3a9a machines: porthos: services: enable prowlarr 2021-10-18 19:48:50 +02:00
Bruno BELANYI 927dd9e02a modules: services: indexers: add prowlarr 2021-10-18 19:48:50 +02:00
Bruno BELANYI 9582f8403e flake: bump inputs 2021-10-18 19:48:50 +02:00
Bruno BELANYI df1bc0d0d5 modules: services: indexers: refactor
This is cleaner and more correct.
2021-10-18 19:48:50 +02:00
Bruno BELANYI 760e24a356 modules: services: indexers: fix typo 2021-10-18 19:48:50 +02:00
Bruno BELANYI c280f0cae8 pkgs: unified-hosts-lists: 3.8.5 -> 3.9.11
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-18 19:28:46 +02:00
Bruno BELANYI cbf6ea9ac9 modules: system: nix: change nix build niceness
19 is the lowest priority.
2021-10-18 18:49:03 +02:00
Bruno BELANYI 8edef9d528 home: wm: i3bar: add bluetooth blocks
All checks were successful
continuous-integration/drone/push Build is passing
I have decided that the potential security and privacy risk of exposing
my MAC addresses is fine by me.

My earphones and headphones do not seem to expose their battery level,
would need more investigation.
2021-10-18 15:51:15 +02:00
Bruno BELANYI 708d60bcc6 home: git: rewrite gitlab URLs to use ssh
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-18 14:45:23 +02:00
Bruno BELANYI 5e438f9e77 home: git: rewrite github URLs to use ssh 2021-10-18 14:44:19 +02:00
Bruno BELANYI 9e33f4ca82 home: git: rewrite personal gitea URLs to use ssh 2021-10-18 14:44:08 +02:00
Bruno BELANYI c55708ab54 home: wm: i3bar: use dynamic width on music block
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-16 18:07:07 +02:00
Bruno BELANYI 6c25380d5d machines: aramis: networking: remove 'domain'
All checks were successful
continuous-integration/drone/push Build is passing
Now that services handle subdomains through my Nginx abstraction, we can
remove this.
2021-10-16 14:56:15 +02:00
Bruno BELANYI 537fa5c909 home: wm: i3: add 'rofi-bluetooth' binding
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-15 17:19:12 +02:00
Bruno BELANYI 8a8256e555 home: tmux: add binding for block selection 2021-10-15 17:13:02 +02:00
Bruno BELANYI 9117df1e72 home: wm: i3: don't add 'dragger' through profile 2021-10-15 17:12:24 +02:00
Bruno BELANYI 296833651a pkgs: add rofi-bluetooth 2021-10-15 17:09:03 +02:00
Bruno BELANYI 158d39bb6e pkgs: sort packages alphabetically 2021-10-15 17:01:40 +02:00
Bruno BELANYI b1cff1b8a3 home: git: add git-related packages when enabled
All checks were successful
continuous-integration/drone/push Build is passing
Instead of adding them in the general packages section.
2021-10-13 15:36:28 +02:00
Bruno BELANYI e475855e18 home: git: inline EPITA configuration include 2021-10-13 15:36:28 +02:00
Bruno BELANYI ef07c9ff43 modules: services: nginx: use 'mkMailAccount' 2021-10-13 15:36:28 +02:00
Bruno BELANYI 111ee136c8 home: git: use 'mkMailAccount' 2021-10-13 15:36:28 +02:00
Bruno BELANYI 8d8904ccef home: mail: accounts: use 'mkMailAccount' 2021-10-12 17:55:37 +02:00
Bruno BELANYI 97fa58c220 lib: strings: add 'mkMailAddress' 2021-10-12 17:53:23 +02:00
Bruno BELANYI ce5a8a20b9 lib: add strings 2021-10-12 17:53:10 +02:00
Bruno BELANYI b298607ea7 home: git: add 'git' alias
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-12 16:33:33 +02:00
Bruno BELANYI d918bf279d modules: services: wireguard: add 'milady'
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-10 17:16:29 +02:00
Bruno BELANYI 6f3bee895c modules: secrets: wireguard: add 'milady' 2021-10-10 17:16:29 +02:00
Bruno BELANYI 069987f47e pkgs: dragger: change platforms to linux
All checks were successful
continuous-integration/drone/push Build is passing
I haven't tested it on darwin, and it just so happens that some
dependency is broken on that system (breaking `nix flake check`)...

Will revisit this later in case I ever happen to use a darwin system.
2021-10-08 19:39:43 +02:00
Bruno BELANYI 971b6e9b65 profiles: wm: add 'dragger' when a WM is set up 2021-10-08 15:06:33 +02:00
Bruno BELANYI 8c103a2261 home: gammastep: fix typo 2021-10-08 15:03:45 +02:00
Bruno BELANYI 76f33fbd57 flake: use 'recurseIntoAttrs' in 'pkgs' overlay 2021-10-08 15:00:46 +02:00
Bruno BELANYI 7d787a2770 pkgs: add dragger
Some checks failed
continuous-integration/drone/push Build is failing
2021-10-08 14:59:03 +02:00
Bruno BELANYI 323e99bbb0 home: xdg: make gdb store history in XDG_DATA_HOME
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-08 12:46:00 +02:00
Bruno BELANYI 8569a8eb55 home: firefox: add 'reddit-comment-collapser' 2021-10-06 09:48:20 +02:00
Bruno BELANYI 6d393fdef2 home: firefox: re-organise module 2021-10-06 09:48:20 +02:00
Bruno BELANYI a85922b3b3 home: firefox: add 'refined-github' 2021-10-06 09:48:20 +02:00
Bruno BELANYI d1cd5bfa32 overlays: add sabnzbd-fix-missing-dependencies
All checks were successful
continuous-integration/drone/push Build is passing
While waiting for my PR to fix this [1].

[1]: https://github.com/NixOS/nixpkgs/pull/140478
2021-10-04 15:01:39 +02:00
Bruno BELANYI d64a867afc flake: bump inputs 2021-10-04 14:45:41 +02:00
Bruno BELANYI cc21d84808 home: tmux: add tmux service
All checks were successful
continuous-integration/drone/push Build is passing
The service definition is pretty awful, but it deals with the secure
socket correctly...

This avoids having a small lapse when starting the very first shell of a
session, which must first launch the server.
2021-09-30 16:58:44 +02:00
Bruno BELANYI 84cdc30037 home: tmux: make history longer
We got tons of RAM!
2021-09-30 16:47:52 +02:00
Bruno BELANYI 07cf0fa4da home: wm: i3: launch tmux when starting terminal
All checks were successful
continuous-integration/drone/push Build is passing
Similarly to the `zsh` snippet, launch tmux unless I explicitly do not
want it.

The reason I also add it in `i3` is to make the launch happen sooner,
and to avoid doing double work on some shell startup shenanigans if I
can.
2021-09-30 15:38:43 +02:00
Bruno BELANYI 24de1890fc home: zsh: launch tmux when starting a shell 2021-09-30 15:34:16 +02:00
Bruno BELANYI 4055ef17f0 home: vim: switch back to gruvbox theme
All checks were successful
continuous-integration/drone/push Build is passing
Onedark is too annoying to deal with, and I still like gruvbox's colors
best.
2021-09-29 18:50:33 +02:00
Bruno BELANYI 7ce69233c1 flake: bump inputs 2021-09-29 17:37:15 +02:00
Bruno BELANYI 9f86615e77 profiles: gtk: new best practices for dconf
All checks were successful
continuous-integration/drone/push Build is passing
2021-09-27 17:07:47 +02:00
Bruno BELANYI e805496588 modules: secrets: fix permission for grafana
All checks were successful
continuous-integration/drone/push Build is passing
2021-09-26 23:09:33 +02:00
Bruno BELANYI 3201445c08 modules: secrets: fix permission of 'matrix/mail' 2021-09-26 23:09:33 +02:00
Bruno BELANYI 30eaefc1d1 modules: secrets: add 'owner' logic 2021-09-26 23:09:33 +02:00
Bruno BELANYI 5f41bb1647 modules: secrets: remove 'with lib;' 2021-09-26 23:09:33 +02:00
Bruno BELANYI fec4956063 secrets: move into 'modules' 2021-09-26 23:09:33 +02:00
Bruno BELANYI a62c0ad126 project: bootstrap: retrieve agenix key 2021-09-26 23:09:33 +02:00
Bruno BELANYI 2cc13dddb5 ci: use 'nix flake check'
Now that I am using agenix, secrets stays encrypted at rest.
2021-09-26 23:09:33 +02:00
Bruno BELANYI de92358bc0 flake: remove 'git-crypt' 2021-09-26 23:09:33 +02:00
Bruno BELANYI 167db81c6c secrets: remove git-crypt 2021-09-26 23:09:33 +02:00
Bruno BELANYI 738d1760c3 secrets: remove git-crypt secrets 2021-09-26 23:09:33 +02:00
Bruno BELANYI e962d4c574 modules: services: nginx: sso: use runtime secrets 2021-09-26 23:09:33 +02:00
Bruno BELANYI 1c0d671fff machines: porthos: services: switch to agenix
The prep-work should be done now, time to hit the switch.
2021-09-26 23:09:32 +02:00
Bruno BELANYI 3bf3980e45 modules: services: nginx: allow sso secret files
This is in preparation of the migration to agenix, which does not allow
access to the secrets at build time.
2021-09-26 23:09:32 +02:00
Bruno BELANYI f6faa11ff7 home: put modules into folders 2021-09-26 23:09:32 +02:00
Bruno BELANYI 67090494e2 home: terminal: put modules into folders 2021-09-26 23:09:32 +02:00
Bruno BELANYI 0d44b3b9f2 home: x: put modules into folders 2021-09-26 23:09:32 +02:00
Bruno BELANYI 37c20529c1 home: wm: put modules into folders 2021-09-26 23:09:32 +02:00
Bruno BELANYI 2449a96652 home: mail: put modules into folders 2021-09-26 23:09:32 +02:00
Bruno BELANYI 8a9337710f home: firefox: put modules into folders 2021-09-26 23:09:32 +02:00
Bruno BELANYI 7b75ea43ad profiles: put modules into folders 2021-09-26 23:09:32 +02:00
Bruno BELANYI fb6e2afe89 modules: services: drone: split into files
This is cleaner to read.
2021-09-26 23:09:32 +02:00
Bruno BELANYI 51067582e0 modules: services: put modules into folders 2021-09-26 23:09:32 +02:00
Bruno BELANYI 78ade4c605 modules: hardware: put modules into folders 2021-09-26 23:09:32 +02:00
Bruno BELANYI 5c2921e00d modules: system: put modules into folders 2021-09-26 23:09:32 +02:00
Bruno BELANYI 62a18cd3f6 modules: programs: put modules into folders 2021-09-26 23:09:32 +02:00
Bruno BELANYI c6cc64e156 modules: home: put into folder 2021-09-26 23:09:32 +02:00
Bruno BELANYI 875a3d8587 machines: porthos: users: use clear-text ssh key 2021-09-26 23:09:32 +02:00
Bruno BELANYI 409e0ef357 modules: system: users: use agenix secrets 2021-09-26 23:09:32 +02:00
Bruno BELANYI b6af754199 modules: services: wireguard: use agenix secrets 2021-09-26 23:09:32 +02:00
Bruno BELANYI ca5e5a53cd modules: services: nginx: use 'credentialsFile'
In preparation for the migration to agenix.
2021-09-26 23:09:32 +02:00
Bruno BELANYI ba10af0644 modules: services: matrix: use 'mailConfigFile'
In preparation of the migration to agenix.
2021-09-26 23:09:32 +02:00
Bruno BELANYI 0f2c20e51d modules: services: paperless: use 'secretKeyFile'
In preparation for the migration to agenix.
2021-09-26 23:09:32 +02:00
Bruno BELANYI ca218730ff modules: services: nextcloud: use 'credentialsfile'
In preparation for the migration to agenix.
2021-09-26 23:09:32 +02:00
Bruno BELANYI ac5fd7f472 modules: services: miniflux: use 'credentialsFiles'
In preparation for the migration to agenix.
2021-09-26 23:09:32 +02:00
Bruno BELANYI db37cea907 modules: services: transmission: secrets w/ file
In preparation for the migration to using agenix.
2021-09-26 23:09:31 +02:00
Bruno BELANYI 1cf93825b2 secrets: register agenix secrets automatically 2021-09-26 23:09:31 +02:00
Bruno BELANYI 8a2aad9b54 secrets: migrate to agenix
It is finally time to graduate to an actually secure, stateless
solution.
2021-09-26 23:09:31 +02:00
Bruno BELANYI 018394b61d secrets: import 'agenix' module 2021-09-25 13:31:43 +02:00
Bruno BELANYI 1e3c633c72 flake: add 'agenix' 2021-09-25 13:30:51 +02:00
Bruno BELANYI df302465c9 home: remove unused 'secrets' module 2021-09-25 13:27:01 +02:00
Bruno BELANYI 673ead7863 home: ssh: add missing 'mkIf cfg.enable'
All checks were successful
continuous-integration/drone/push Build is passing
2021-09-24 01:21:57 +02:00
Bruno BELANYI 3d10461a6e home: remove unused arguments 2021-09-24 01:21:57 +02:00
Bruno BELANYI 75312c747b modules: remove unused arguments 2021-09-24 01:21:57 +02:00
Bruno BELANYI 68be7743ad machines: remove unused arguments 2021-09-24 01:21:57 +02:00
Bruno BELANYI 9d362655e2 pkgs: remove unused arguments 2021-09-24 01:21:57 +02:00
Bruno BELANYI 604b99a7ac lib: remove 'with self;' 2021-09-24 01:21:57 +02:00
Bruno BELANYI 8467fda721 lib: modules: refactor 'mapModules'
Introduce the recursive version of this function, then refactor to
reduce repetition.
2021-09-24 01:21:57 +02:00
Bruno BELANYI bad9b8a06b lib: modules: document 'mapModules' 2021-09-24 00:26:28 +02:00
Bruno BELANYI 2d26b36e31 modules: services: nginx: use 'recursiveMerge'
All checks were successful
continuous-integration/drone/push Build is passing
2021-09-23 22:11:25 +02:00
Bruno BELANYI c93a9e5a98 home: wm: i3: use 'recursiveMerge' 2021-09-23 22:11:25 +02:00
Bruno BELANYI 3fa14ebe71 lib: attrs: add 'recursiveMerge' 2021-09-23 22:11:25 +02:00
Bruno BELANYI bd1a2000fe modules: system: users: use 'initialHashedPassword'
This is the better option to use in case I want to have a stateless
system.
2021-09-23 21:30:24 +02:00
Bruno BELANYI 4a0c10b897 modules: system: users: use 'ambroisie' password
Do not rely on `my.user.name` which could be changed to a value not
available in the secrets.
2021-09-23 21:28:29 +02:00
Bruno BELANYI 9f3811ea3b modules: programs: steam: respect XDG conventions
All checks were successful
continuous-integration/drone/push Build is passing
Steam wants to pollute HOME with `.steam*` files and folders, which are
useless and annoying.

We want to make sure the wrappers are preferred when installing, so use
`lib.hiPrio` to ensure they get chosen.
2021-09-15 19:23:24 +02:00
Bruno BELANYI 5c95ba1113 machines: aramis: programs: enable steam 2021-09-15 19:23:24 +02:00
Bruno BELANYI 37bb7fd625 modules: programs: add steam 2021-09-15 19:23:24 +02:00
Bruno BELANYI 45321072fc modules: add 'programs' directory 2021-09-15 16:48:10 +02:00
Bruno BELANYI ed456c999d modules: system: remove 'media'
All checks were successful
continuous-integration/drone/push Build is passing
It was not the idiomatic way to do this.
2021-09-15 16:10:06 +02:00
Bruno BELANYI ad848ef89d pkgs: make use of scoping
This is the way to make sure `callPackage` picks up my custom packages
to be used in the set.
2021-09-15 15:33:18 +02:00
Bruno BELANYI 680d0c9f37 home: gdb: add nix store to safe path
For now, the nix store path is hard-coded rather than substituted.

This is useful for pretty-printing C++ types compiled with a different
C++ library from my gdb.
2021-09-03 17:34:39 +02:00
Bruno BELANYI 9a06108603 git: remove duplicate ignore directive
All checks were successful
continuous-integration/drone/push Build is passing
2021-09-01 14:52:38 +02:00
Bruno BELANYI c8633abf6d flake: use 'nativeBuildInputs' 2021-09-01 14:51:27 +02:00
Bruno BELANYI aceb4ef901 pkgs: unified-hosts-lists: do not set 'phases'
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-31 20:11:11 +02:00
Bruno BELANYI 5937d43993 pkgs: unbound-zones-adblock: do not set 'phases' 2021-08-31 20:11:00 +02:00
Bruno BELANYI add6326fdf pkgs: matrix-notifier: do not set 'phases' 2021-08-31 20:10:41 +02:00
Bruno BELANYI b0e4475586 pkgs: i3-get-window-criteria: do not set 'phases' 2021-08-31 20:08:22 +02:00
Bruno BELANYI 5c1dd6500a pkgs: havm: use 'nativeBuildInputs'
This is the correct one to use for a compiler like 'ghc'.
2021-08-31 19:50:44 +02:00
Bruno BELANYI 60e977611c pkgs: diff-flake: do not set 'phases' 2021-08-31 19:03:33 +02:00
Bruno BELANYI 99462199bd pkgs: comma: do not set 'phases' 2021-08-31 19:03:25 +02:00
Bruno BELANYI 4fe18ff4cd pkgs: comma: give path to source directly 2021-08-31 19:03:24 +02:00
Bruno BELANYI 02ffbcf970 pkgs: bw-pass: do not set 'phases' 2021-08-31 18:59:05 +02:00
Bruno BELANYI 878c92b67e pkgs: havm: use 'checkInputs' for test dependency 2021-08-31 18:44:17 +02:00
Bruno BELANYI 8596ce8638 home: wm: i3bar: remove redundant '%' 2021-08-31 18:31:32 +02:00
Bruno BELANYI 808058d576 modules: services: paperless: proxy websockets 2021-08-31 13:52:11 +02:00
Bruno BELANYI 8ffad5d41b machines: porthos: services: enable paperless 2021-08-31 13:52:11 +02:00
Bruno BELANYI 52706ab4c4 modules: services: paperless: add admin password
This is a fallback in case SSO stops working...
2021-08-31 13:52:11 +02:00
Bruno BELANYI 5ae7b593e4 secrets: add paperless password
To be used as a fallback.
2021-08-31 13:52:11 +02:00
Bruno BELANYI 87613a9163 modules: services: add paperless 2021-08-31 13:52:11 +02:00
Bruno BELANYI 47d19e5b3f secrets: add paperless 2021-08-31 13:52:11 +02:00
Bruno BELANYI a78091c57c flake: bump inputs 2021-08-31 13:52:10 +02:00
Bruno BELANYI 9aba0d3ce0 home: pager: remove lesspipe
I don't use it anymore.
2021-08-30 21:23:13 +02:00
Bruno BELANYI 78064bb2a1 modules: services: nginx: nginx-sso verbose logs
All checks were successful
continuous-integration/drone/push Build is passing
For some reason it still doesn't appear in the systemd log...
2021-08-30 17:38:25 +02:00
Bruno BELANYI 70af0ba99a modules: services: nginx: add SSO 2021-08-30 17:36:39 +02:00
Bruno BELANYI dc2a3610a6 modules: services: nginx: enable explicitly 2021-08-30 17:36:39 +02:00
Bruno BELANYI 894b571745 secrets: add sso 2021-08-30 17:36:39 +02:00
Bruno BELANYI 2049e7a2c5 secrets: allow lists in types 2021-08-30 15:35:00 +02:00
Bruno BELANYI 7032ddef37 modules: services: use new nginx wrapper
All checks were successful
continuous-integration/drone/push Build is passing
And when not possible, document why.

Note for the future: there is some repetition in some modules to
configure the correct value of the subdomain, which I happen to know
will line up correctly thanks to the nginx wrapper. A good way to
refactor this in the future would involve avoiding this repetition,
allowing use to query the correct domain in some way...
2021-08-26 15:54:13 +02:00
Bruno BELANYI 81e12969eb modules: services: nginx: overhaul modularity
This should be all that's needed for almost all my services.
2021-08-26 15:54:13 +02:00
Bruno BELANYI b97eff2479 lib: lists: add countValues 2021-08-26 15:54:13 +02:00
Bruno BELANYI 4f742b69f2 lib: lists: add 'mapFilter' 2021-08-26 15:54:13 +02:00
Bruno BELANYI 11fbbd62eb home: zsh: clean-up blank in history
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-25 12:51:38 +02:00
Bruno BELANYI d21087ddcd home: zsh: append to history
Otherwise the file is replaced rather than appended to.
2021-08-25 12:44:42 +02:00
Bruno BELANYI 3919a87d9e home: zsh: do not share history accross shells
It's more annoying than helpful...
2021-08-25 12:22:36 +02:00
Bruno BELANYI 3fd487bbd2 home: gdb: fix configuration path
All checks were successful
continuous-integration/drone/push Build is passing
Turns out the latest version of `gdb` does not yet look for its
configuration in `XDG_CONFIG_HOME`...
2021-08-22 15:02:57 +02:00
Bruno BELANYI 5916ae631d home: gdb: add rr 2021-08-21 01:13:14 +02:00
Bruno BELANYI 1a436fd962 home: gdb: fix auto-load safe path 2021-08-20 21:22:27 +02:00
Bruno BELANYI a48303e66d home: add gdb
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-20 20:03:51 +02:00
Bruno BELANYI 30fc01b5ae modules: services: nextcloud: exclude previews
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-19 14:27:40 +02:00
Bruno BELANYI 13684ecdc4 modules: services: backup: make it verbose 2021-08-19 14:27:40 +02:00
Bruno BELANYI fe720b2de3 machines: porthos: services: enable navidrome
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-19 12:23:06 +02:00
Bruno BELANYI ec6b31f4a6 modules: services: add navidrome 2021-08-19 12:23:06 +02:00
Bruno BELANYI 1335bbfe9d flake: bump inputs
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-19 11:49:41 +02:00
Bruno BELANYI 2cc1925346 modules: services: backup: fix exclude files
All checks were successful
continuous-integration/drone/push Build is passing
I was using the wrong option... Somehow it didn't error out.
2021-08-09 20:08:43 +02:00
Bruno BELANYI eb0c5d5895 pkgs: add drone-scp
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-08 18:03:19 +02:00
Bruno BELANYI 8c298c26f9 pkgs: unified-hosts-lists: 3.6.4 -> 3.8.5
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-07 12:29:41 +02:00
Bruno BELANYI 55a04cfac3 pkgs: bw-pass: report errors to stderr
Useful in case the script can't prompt using `rofi`.
2021-07-31 20:17:37 +02:00
Bruno BELANYI 1783c2838b modules: services: tlp: add power scaling 2021-07-31 16:56:20 +02:00
Bruno BELANYI e215f7aa1d modules: services: nextcloud: upgrade version
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-29 13:42:28 +02:00
Bruno BELANYI afb683f1cf flake: bump inputs
And update package names for grafana dashboards to avoid breaking the
config.
2021-07-29 13:42:28 +02:00
Bruno BELANYI c320387746 modules: services: postgres: upgrade version 2021-07-29 13:03:10 +02:00
Bruno BELANYI bbb1231ad3 modules: services: postgres: add migration script
The process to upgrade is:

* Make sure the version number of the script is one major version over
  the service version.

* Activate the script, rebuild configuration.

* Run `upgrade-pg-cluster` as `root`. One can give arguments like
  `--link` or `--jobs 4` to speedup the process. See documentation for
  some details.

* Change package to new version once the upgrade is finished, rebuild
  configuration.

* Optionally, `ANALYZE` the new database.
2021-07-29 13:02:49 +02:00
Bruno BELANYI 9f00d8a38e modules: services: add postgresql
Enable the service itself in other modules when needed, but pin the
package in a single place.
2021-07-29 12:43:28 +02:00
Bruno BELANYI 820b52314f modules: services: monitoring: add scrape interval
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-15 18:54:07 +02:00
Bruno BELANYI a3293277d9 flake: flatten and filter packages w/ flake-utils
All checks were successful
continuous-integration/drone/push Build is passing
Instead of my home-grown solution, use one that has been upstreamed.
2021-07-14 21:49:31 +02:00
Bruno BELANYI 2ecd417a68 machines: porthos: services: enable monitoring
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-13 19:17:33 +02:00
Bruno BELANYI 4e8045716c secrets: add monitoring password 2021-07-13 19:17:33 +02:00
Bruno BELANYI e060476f32 modules: services: add monitoring dashboard 2021-07-13 19:17:33 +02:00
Bruno BELANYI 2458ddf59d modules: services: add monitoring
This includes a dashboard to monitor system ressources, using
Prometheus.
2021-07-13 19:17:33 +02:00
Bruno BELANYI 8927b3182f flake: bump inputs 2021-07-13 19:08:54 +02:00
Bruno BELANYI f2dfeeb35b home: git: use topological order in log
It is the one that makes most sense, rather than some kind of date
order...
2021-07-13 17:50:44 +02:00
Bruno BELANYI 971b610cd5 modules: services: matrix: SSL only for server
This is a requirement anyway for homeservers, and the `forceSSL` option
tried to create a redirect for non-SSL traffic, except the `listen`
option only provided SSL endpoints anyway, so this resulted in
additional rules in the nginx config looking like this:

```nginx
server {
        server_name matrix.belanyi.fr ;
        location /.well-known/acme-challenge {
                root /var/lib/acme/acme-challenge;
                auth_basic off;
        }
        location / {
                return 301 https://$host$request_uri;
        }
}
```
2021-07-13 17:43:31 +02:00
Bruno BELANYI 21f48b5f71 pkgs: bw-pass: change password prompt
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-04 11:52:07 +02:00
Bruno BELANYI a3edf2548b overlays: transgui: correctly use previous patches 2021-07-04 11:52:07 +02:00
Bruno BELANYI ea7b064546 home: direnv: update to new option name
All checks were successful
continuous-integration/drone/push Build is passing
And enable the flakes option.

I don't actually use this on my own projects, but it could be useful for
other projects that I contribute to.
2021-06-30 20:08:07 +02:00
Bruno BELANYI ff8e64d601 home: mail: add himalaya
This mail client is very KISS. I like it.
2021-06-30 20:08:06 +02:00
Bruno BELANYI 791109c3c1 flake: bump inputs 2021-06-30 20:07:55 +02:00
Bruno BELANYI 6eb3942270 home: firefox: add sponsorblock
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-27 19:51:04 +02:00
Bruno BELANYI 2232062fd9 home: secrets: use more specific type
I will amend it if I need more types, but for now this is fine.
2021-06-27 19:48:42 +02:00
Bruno BELANYI d6e9f9786d secrets: use more specific type
I will amend it if I need more types, but for now this is fine.
2021-06-27 19:48:26 +02:00
Bruno BELANYI 5abe4e929e modules: hardware: sound: refactor options
All checks were successful
continuous-integration/drone/push Build is passing
Do not enable ALSA when using pipewire. Ensure that both pulseaudio and
pipewire are not configured at the same time.
2021-06-27 01:59:07 +02:00
Bruno BELANYI 57717d70ef home: wm: i3: also toggle xss-lock 2021-06-26 18:38:11 +02:00
Bruno BELANYI 7a382368e8 modules: move home configuration from flake 2021-06-25 20:46:36 +02:00
Bruno BELANYI 0f17123d09 modules: change username configuration option
It makes more sense to have a `my.user` option.
2021-06-25 20:45:36 +02:00
Bruno BELANYI c6d21493ef home: zsh: explicitly set history save size
All checks were successful
continuous-integration/drone/push Build is passing
Turns out the `history.save` limit is for what is *loaded into memory*,
not what is written to disk.
2021-06-23 23:14:05 +02:00
Bruno BELANYI 5cebb9b54b home: zsh: explicitly opt out of extended history 2021-06-23 23:13:39 +02:00
Bruno BELANYI 92c2748747 home: wm: dunst: use rofi as 'dmenu' when enabled 2021-06-23 23:08:23 +02:00
Bruno BELANYI 4cae294cf5 home: wm: i3: enable rofi bindings when applicable 2021-06-23 23:06:15 +02:00
Bruno BELANYI 23c6093c36 home: wm: dunst: add line wrapping
All checks were successful
continuous-integration/drone/push Build is passing
Once again, trying to make them actually readable.
2021-06-22 19:48:03 +02:00
Bruno BELANYI 3fdcfb5b5f home: wm: dunst: add max icon size
All checks were successful
continuous-integration/drone/push Build is passing
Otherwise I end up with icons that are way too big...
2021-06-22 19:39:35 +02:00
Bruno BELANYI c9418cc4d3 pkgs: matrix-notifier: 0.1.2 -> 0.2.0
All checks were successful
continuous-integration/drone/push Build is passing
`pandoc` is now a dependency.
2021-06-16 21:19:09 +02:00
Bruno BELANYI cd02cbff45 pkgs: use 'lib' as first input
All checks were successful
continuous-integration/drone/push Build is passing
This is the idiomatic style in nixpkgs.
2021-06-16 20:13:25 +02:00
Bruno BELANYI daa69a54fa modules: services: indexers: limit Jackett memory
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-15 21:25:56 +02:00
Bruno BELANYI 212dd299e2 pkgs: matrix-notifier: 0.1.0 -> 0.1.2
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-15 18:42:13 +02:00
Bruno BELANYI cff3811cad home: wm: screen-lock: use actual assertion
All checks were successful
continuous-integration/drone/push Build is passing
Instead of hijacking the type verification, use an assertion.
2021-06-15 17:45:17 +02:00
Bruno BELANYI 8f266245ee modules: system: add boot
And enable mounting `/tmp` as tmpfs by default.
2021-06-14 16:41:28 +02:00
Bruno BELANYI b8be3d80a8 ci: migrate to 'exec' runner
All checks were successful
continuous-integration/drone/push Build is passing
Now that I have written a script to do the Matrix notification, I can do
that.
2021-06-13 18:38:09 +02:00
Bruno BELANYI b04c1b09ea pkgs: add matrix-notifier 2021-06-13 18:37:11 +02:00
Bruno BELANYI 3a471433ed home: secrets: clean-up 'default.nix'
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-12 20:35:28 +02:00
Bruno BELANYI f8325cc9c7 secrets: clean-up 'default.nix' 2021-06-12 20:35:06 +02:00
Bruno BELANYI cd1173d2f6 flake: filter 'packages' on system 2021-06-12 19:56:17 +02:00
Bruno BELANYI e319eaf09f pkgs: bw-pass: fix 'meta.platforms'
This makes use of 'keyutils' which only works on Linux.
2021-06-12 19:30:25 +02:00
Bruno BELANYI e6ba569b36 modules: system: documentation: include POSIX man
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-12 13:23:09 +02:00
Bruno BELANYI ee21de5b94 modules: services: matrix: add mail configuration
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-09 19:14:09 +02:00
Bruno BELANYI 6614b47546 secrets: matrix: add mail configuration 2021-06-09 19:14:09 +02:00
Bruno BELANYI 06c53620f8 modules: services: matrix: enable spaces 2021-06-09 18:33:54 +02:00
Bruno BELANYI d43045c6d6 modules: services: matrix: add SMS verification 2021-06-09 18:32:59 +02:00
Bruno BELANYI 6113ad154d home: firefox: tridactyl: add tabduplicate mapping
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2021-06-07 17:56:46 +02:00
Bruno BELANYI e8982b8bc9 machines: aramis: profiles: enable devices 2021-06-07 17:56:46 +02:00
Bruno BELANYI 7684489c9a profiles: add devices 2021-06-07 17:56:46 +02:00
Bruno BELANYI 1994ef2b1b modules: hardware: add mx-ergo
This adds the ability to scroll using the ball, which is way better.
2021-06-07 17:56:46 +02:00
Bruno BELANYI a434016252 home: wm: i3: remove 'udiskie' and 'flameshot'
It makes more sense to activate those at the `profile` level.
2021-06-03 17:34:16 +02:00
Bruno BELANYI 1794eefd30 profiles: wm: enable 'i3' helpers
`flameshot` and `udiskie` provide some functionnality that would usually
be found in an actual DE.

It makes more sense to activate them here instead of in the home
configuration, so I will remove it in the next commit.
2021-06-03 17:33:13 +02:00
Bruno BELANYI 29437d3e3f home: wm: i3: move script generation out-of-line
This makes for a cleaner configuration file.
2021-06-03 17:18:33 +02:00
Bruno BELANYI a827a34501 git: ignore generated pre-commit configuration
All checks were successful
continuous-integration/drone/push Build is passing
2021-05-31 23:06:37 +02:00
Bruno BELANYI 610b0f2f4b nix: evaluate shell hooks
This activates the pre-commit-hook configuration.
2021-05-31 23:06:20 +02:00
Bruno BELANYI 59cb038045 flake: add pre-commit-hooks
Instead of havin the tool manage versions, use a pinned version.
2021-05-31 23:04:08 +02:00
Bruno BELANYI 15db81eb3b flake: change format 2021-05-31 23:02:32 +02:00
Bruno BELANYI 24efa3edca machines: aramis: hardware: enable trackpoint 2021-05-31 20:30:36 +02:00
Bruno BELANYI 2fe4f1faad modules: home: use 'username' config value 2021-05-30 01:31:05 +02:00
Bruno BELANYI 4f1f687eea flake: use 'username' config value 2021-05-30 01:20:14 +02:00
Bruno BELANYI b90be0acdf home: zsh: remove trailing whitespace
All checks were successful
continuous-integration/drone/push Build is passing
2021-05-30 00:46:09 +02:00
Bruno BELANYI ea4c699b81 modules: system: users: make it configurable
Notably, make use of my global 'username' option.
2021-05-30 00:46:09 +02:00
Bruno BELANYI 8efe75295d modules: add option to specify username
Given that I use it in plenty of places, it makes sense to place it
there for reference in other modules.
2021-05-30 00:46:09 +02:00
Bruno BELANYI 2d9b11406a modules: system: packages: make it configurable 2021-05-30 00:46:09 +02:00
Bruno BELANYI 003c08cb09 modules: system: nix: make it configurable 2021-05-30 00:46:09 +02:00
Bruno BELANYI 6728b50d3a modules: system: language: make it configurable 2021-05-30 00:46:09 +02:00
Bruno BELANYI 2eaf3bf2c7 modules: system: move 'packages' 2021-05-29 16:58:44 +02:00
Bruno BELANYI 0077ce1f94 modules: system: move 'nix' 2021-05-29 16:58:44 +02:00
Bruno BELANYI 14d9fc89f1 modules: system: move 'documentation' 2021-05-29 16:58:44 +02:00
Bruno BELANYI f660bf94e9 modules: system: move 'language' 2021-05-29 16:58:44 +02:00
Bruno BELANYI 3b9f01e780 modules: system: move 'users' 2021-05-29 16:58:44 +02:00
Bruno BELANYI 60f1e693d1 modules: system: move 'media' 2021-05-29 16:56:15 +02:00
Bruno BELANYI ce4b0b8c90 modules: add 'system' directory 2021-05-29 16:56:15 +02:00
Bruno BELANYI d2704b17fe modules: move 'services' into subfolder 2021-05-29 16:56:15 +02:00
Bruno BELANYI 31f8ec6e98 modules: hardware: move 'upower' 2021-05-29 16:56:15 +02:00
Bruno BELANYI af67d04992 modules: hardware: move 'sound' 2021-05-29 16:56:15 +02:00
Bruno BELANYI f9bcf79430 modules: hardware: move 'networking' 2021-05-29 16:56:15 +02:00
Bruno BELANYI b0cc830467 modules: hardware: move 'ergodox' 2021-05-29 16:56:15 +02:00
Bruno BELANYI 9b054d10c7 modules: hardware: move 'bluetooth' 2021-05-29 16:56:15 +02:00
Bruno BELANYI e81aaa8ebc modules: add 'hardware' directory 2021-05-29 16:56:15 +02:00
Bruno BELANYI 737b5e797b modules: ergodox: remove useless group clause
The `zsa` module already add the group itself.
2021-05-29 16:15:20 +02:00
Bruno BELANYI 6728b5b949 flake: bump inputs
All checks were successful
continuous-integration/drone/push Build is passing
2021-05-29 12:23:01 +02:00
Bruno BELANYI 2999ba7c0b services: jellyfin: fix proxy configuration
All checks were successful
continuous-integration/drone/push Build is passing
2021-05-28 11:38:28 +02:00
Bruno BELANYI 1ac9f0cc8c home: comma: configure custom 'nixpkgs' flake
All checks were successful
continuous-integration/drone/push Build is passing
This makes use of my pinned `pkgs` flake from the registry by default.
2021-05-27 21:50:27 +02:00
Bruno BELANYI 6074958292 home: extract 'comma' into its own module 2021-05-27 21:49:24 +02:00
Bruno BELANYI da21e7a6f2 pkgs: comma: allow override which nixpkgs is used
This is useful for me to use my pinned `pkgs` instead.
2021-05-27 21:42:41 +02:00
Bruno BELANYI 395f15f181 pkgs: add volantes-cursors 2021-05-27 19:57:31 +02:00
Bruno BELANYI 059831b532 home: x: cursor: switch to Vimix
All checks were successful
continuous-integration/drone/push Build is passing
2021-05-27 19:15:52 +02:00
Bruno BELANYI 76d165343e pkgs: add vimix-cursors 2021-05-27 19:15:52 +02:00
Bruno BELANYI f66da6fee6 home: git: add 'pick' alias
All checks were successful
continuous-integration/drone/push Build is passing
I wanted to name it 'pickaxe' but for a curious reason, it does not seem
to be working when I use that alias...

I am trying to find a second alias name for `git log -p -S`, which only
shows commits that change the number of occurrences of its pickaxe in
the file. Whereas `-G` shows any commit involving the pickaxe in its
diff.
2021-05-25 23:13:35 +02:00
Bruno BELANYI ca1c7962ea machines: aramis: sound: switch to pipewire
The support for mSBC means I should get better audio on my QC35.
2021-05-25 23:13:35 +02:00
Bruno BELANYI 796df5475e home: wm: i3: use pamixer for audio control
This can be used with either pipewire and pulseaudio without having to
install all of pulseaudio.
2021-05-25 23:13:35 +02:00
Bruno BELANYI 414606b58e modules: bluetooth: add pipewire codecs 2021-05-25 23:13:35 +02:00
Bruno BELANYI 931b67fdb2 modules: sound: add pipewire configuration 2021-05-25 18:19:52 +02:00
Bruno BELANYI 8b4966fcbe machines: aramis: sound: use common module 2021-05-25 18:19:52 +02:00
Bruno BELANYI a508db48c9 modules: add sound
I will probably want to share this configuration between multiple
machines in the future.
2021-05-25 18:19:52 +02:00
Bruno BELANYI 406eeea9f6 services: podgrab: remove mention of merged PR
All checks were successful
continuous-integration/drone/push Build is passing
2021-05-23 00:32:59 +02:00
Bruno BELANYI 9d3d86365c project: readme: mention manual flood config
All checks were successful
continuous-integration/drone/push Build is passing
2021-05-23 00:14:26 +02:00
Bruno BELANYI 78d77890de machines: porthos: services: enable flood
Some checks failed
continuous-integration/drone/push Build is failing
2021-05-22 23:59:27 +02:00
Bruno BELANYI a33fbc6659 services: add flood 2021-05-22 23:59:27 +02:00
Bruno BELANYI b134aedff0 home: wm: i3bar: invert baclight icon
Because I am using an emoji font, it looks better that way.
2021-05-22 23:59:27 +02:00
Bruno BELANYI d31e293cef home: mail: add msmtp 2021-05-22 23:49:57 +02:00
Bruno BELANYI 182ec2a4db home: add mail and accounts configuration 2021-05-22 23:49:57 +02:00
Bruno BELANYI 81647c5a02 home: terminal: use 'cfg.terminal' for TERMINAL 2021-05-22 23:49:57 +02:00
Bruno BELANYI 8a8f7387f4 pkgs: add bw-pass
Until `rbw` gets support for Yubikey 2FA, I still need a decent way to
query for my passwords on the command line...

This wrapper program should be good enough for basic usage with programs
that need a password command.
2021-05-22 23:49:57 +02:00
Bruno BELANYI f2b20c65a8 modules: nix: expose pinned nixpkgs as 'pkgs'
That way if I do want to use that latest version, I can still use
`nixpkgs#<whatever>`.
2021-05-22 23:49:57 +02:00
Bruno BELANYI cc37713839 home: firefox: tridactyl: fix Reddit URL rewriter 2021-05-22 23:49:57 +02:00
Bruno BELANYI e80485018c home: firefox: add ff2mpv
This allows watching videos using mpv via a simple button.
2021-05-22 23:49:57 +02:00
Bruno BELANYI 15abb291ef machines: aramis: home: enable mpv 2021-05-22 23:49:57 +02:00
Bruno BELANYI fb56631ef3 home: add mpv 2021-05-22 23:49:57 +02:00
Bruno BELANYI 9113290161 pkgs: add ff2mpv-go 2021-05-22 23:49:57 +02:00
Bruno BELANYI 943ea20b16 services: podgrab: switch to upstream service 2021-05-22 23:49:57 +02:00
Bruno BELANYI 129fcdd42c pkgs: remove podgrab
Now that it has been merged upstream, no reason to keep it.
2021-05-22 23:49:02 +02:00
Bruno BELANYI d086af7e00 modules: nix: pin flake registry to common inputs 2021-05-22 23:47:27 +02:00
Bruno BELANYI e4d8a4d4b2 flake: inject 'inputs' into NixOS configuration 2021-05-22 23:47:27 +02:00
Bruno BELANYI 1a5dd0b91c home: wm: rofi: configure terminal 2021-05-22 23:47:27 +02:00
Bruno BELANYI 02c2a23ee5 profiles: laptop: enable TLP 2021-05-22 23:47:27 +02:00
Bruno BELANYI f6ace9d438 services: add TLP 2021-05-22 23:47:27 +02:00
Bruno BELANYI 2a0b5b7802 pkgs: add myself as maintainer to all packages 2021-05-22 23:47:27 +02:00
Bruno BELANYI 2c596395b0 home: add nix-index 2021-05-22 23:47:27 +02:00
Bruno BELANYI 986701d1c8 services: adblock: use new 'settings' option
This shows that I have not upgraded the server in a while...
2021-05-22 23:47:27 +02:00
Bruno BELANYI ee33ab11c6 flake: bump inputs 2021-05-20 17:55:45 +02:00
Bruno BELANYI 7d0a772cce home: firefox: tridactyl: fix parent URL on Reddit
All checks were successful
continuous-integration/drone/push Build is passing
2021-05-16 00:03:59 +02:00
Bruno BELANYI 97ee498405 home: packages: add 'comma' to common package set 2021-05-16 00:03:59 +02:00
Bruno BELANYI e5fdfd6c44 pkgs: add comma 2021-05-16 00:03:59 +02:00
Bruno BELANYI 76148d75b8 machines: aramis: services: remove gnupg-agent
The one configured by home-manager is more appropriate.
2021-05-16 00:03:59 +02:00
Bruno BELANYI 9e6bc604f3 home: x: add 'xsel' package
I like it better than 'xclip'.
2021-05-16 00:03:59 +02:00
Bruno BELANYI b4d3b06fbf home: zsh: make history ten times bigger 2021-05-16 00:03:59 +02:00
Bruno BELANYI 8de23feee7 profiles: laptop: enable power-alert 2021-05-16 00:03:59 +02:00
Bruno BELANYI 0fc3bf3096 home: add power-alert 2021-05-16 00:03:59 +02:00
Bruno BELANYI 7d48b0edab profiles: laptop: enable upower 2021-05-16 00:03:59 +02:00
Bruno BELANYI d23ad8f5e1 modules: add upower 2021-05-16 00:03:59 +02:00
Bruno BELANYI f3764ce20e home: pager: fix colorized man pages
Turns out that sessionVariables are not being set at the proper time for
use with `tput`.

This commit also cleans up a bit how the config was being set.
2021-05-16 00:03:59 +02:00
Bruno BELANYI f9d849c5da home: wm: i3bar: add 'backlight' block 2021-05-16 00:03:59 +02:00
Bruno BELANYI 59e833a55b home: wm: i3bar: remove gammastep block
It doesn't seem to be working well with my setup...
2021-05-16 00:03:59 +02:00
Bruno BELANYI 03130ed9ee home: wm: i3: use 'brightnessctl' 2021-05-16 00:03:59 +02:00
Bruno BELANYI ac4cf0c1a2 home: wm: i3: fix screen-related mappings 2021-05-16 00:03:59 +02:00
Bruno BELANYI fab93a5f2f modules: users: simplify 'groupsIfExist' 2021-05-16 00:03:59 +02:00
Bruno BELANYI f04368a71e machines: porthos: set timezone 2021-05-16 00:03:59 +02:00
Bruno BELANYI 30ce91557d machines: aramis: use laptop profile 2021-05-16 00:03:59 +02:00
Bruno BELANYI d46f66842f profiles: add laptop 2021-05-16 00:03:59 +02:00
Bruno BELANYI 737484dcfe machines: aramis: use X profile 2021-05-16 00:03:59 +02:00
Bruno BELANYI 125935ac0f profiles: add X 2021-05-16 00:03:59 +02:00
Bruno BELANYI e786eaddde machines: aramis: use gtk profile 2021-05-16 00:03:59 +02:00
Bruno BELANYI e211ac7d73 profiles: add gtk 2021-05-16 00:03:59 +02:00
Bruno BELANYI 3f50abcbe0 machines: aramis: use wm profile 2021-05-16 00:03:59 +02:00
Bruno BELANYI 1c2193d698 profiles: add wm 2021-05-16 00:03:59 +02:00
Bruno BELANYI 12b3397a20 modules: bluetooth: fix documentation 2021-05-16 00:03:59 +02:00
Bruno BELANYI ca620a4eb6 machines: aramis: enable bluetooth profile 2021-05-16 00:03:59 +02:00
Bruno BELANYI 885b45d39c profiles: add bluetooth 2021-05-16 00:03:59 +02:00
Bruno BELANYI 0c943d8430 flake: add profiles folder
This will be used for configurations that either consolidates multiple options
that make sens to use together, or span accross system and home configuration.
2021-05-16 00:03:59 +02:00
Bruno BELANYI 79dfb3a979 home: gtk: do not set font size
Turns out that I do not like how it interferes with Firefox's
rendering... I should probably investigate this in the future if I want
to use this option.
2021-05-16 00:03:59 +02:00
Bruno BELANYI 00a5d1b076 machines: aramis: home: enable GTK
In order to not have an error at activation, dconf must be made
available to the dbus service.
2021-05-10 00:31:01 +02:00
Bruno BELANYI 5e193b3a42 home: add gtk 2021-05-10 00:31:01 +02:00
Bruno BELANYI bf9de874ce machines: aramis: home: add transgui 2021-05-10 00:31:01 +02:00
Bruno BELANYI 5aaa497653 overlays: add transgui-fix-duplicate-status
Upstream is being slow in merging the patch...
2021-05-10 00:31:01 +02:00
Bruno BELANYI 3887a86650 flake: add overlays folder 2021-05-10 00:31:01 +02:00
Bruno BELANYI f57fd32088 machines: aramis: home: add jellyfin-media-player 2021-05-10 00:31:01 +02:00
Bruno BELANYI 1c147613e4 home: terminal: export TERMINAL when appropriate
This is used by some programs, like 'rofi' to launch terminal programs.
2021-05-10 00:31:01 +02:00
Bruno BELANYI 15190d4b50 pkgs: i3-get-window-criteria: remove whitespace 2021-05-10 00:31:01 +02:00
Bruno BELANYI 5f7d2c74bc home: wm: i3: add i3-get-window-criteria package 2021-05-10 00:31:01 +02:00
Bruno BELANYI 53dd04a0b7 pkgs: add i3-get-window-criteria 2021-05-10 00:31:01 +02:00
Bruno BELANYI 86ab6bf17a machines: aramis: home: enable feh 2021-05-10 00:31:01 +02:00
Bruno BELANYI 6008ac470c home: add feh 2021-05-10 00:31:01 +02:00
Bruno BELANYI 717c628ff1 machines: aramis: home: set up background
`i3` inherits its background from `lightdm`.
2021-05-10 00:31:01 +02:00
Bruno BELANYI 749ef9f072 home: packages: add 'file' to common package set 2021-05-10 00:31:01 +02:00
Bruno BELANYI a0c63f00f9 home: pager: add colored man page support 2021-05-10 00:31:01 +02:00
Bruno BELANYI d9734dd505 machines: aramis: add some additional packages 2021-05-10 00:31:01 +02:00
Bruno BELANYI 4225bdd103 home: packages: add option for additional packages 2021-05-10 00:31:01 +02:00
Bruno BELANYI 3a07cffa14 modules: documentation: add linux man pages option
I want to be able to read about syscalls or the C library.
2021-05-10 00:31:01 +02:00
Bruno BELANYI 06f9f423e9 modules: documentation: use 'mkDisableOption'
The documentation module already gates behind 'documentation.enable' for
the other options.
2021-05-10 00:31:01 +02:00
Bruno BELANYI ad1d907c25 home: x: add cursor
I would like to check out alternative themes. Notably Quintom [1],
Volantes [2], and Vimix [3].

[1]: https://gitlab.com/Burning_Cube/quintom-cursor-theme
[2]: https://github.com/varlesh/volantes-cursors
[3]: https://github.com/vinceliuice/Vimix-cursors
2021-05-10 00:31:01 +02:00
Bruno BELANYI ef0f4bdca5 machines: aramis: home: enable bluetooth 2021-05-10 00:31:01 +02:00
Bruno BELANYI b4d002033a home: add bluetooth 2021-05-10 00:31:01 +02:00
Bruno BELANYI 8837c7c33c home: wm: i3bar: use FontAwesome5 for icons 2021-05-10 00:31:01 +02:00
Bruno BELANYI f4cc68a650 home: wm: i3: use new 'fonts' option type 2021-05-10 00:31:01 +02:00
Bruno BELANYI 79525013b0 flake: bump inputs 2021-05-10 00:31:01 +02:00
Bruno BELANYI 2b8d01f056 machines: aramis: enable bluetooth 2021-05-10 00:31:01 +02:00
Bruno BELANYI b115d94cd6 modules: add bluetooth 2021-05-10 00:31:01 +02:00
Bruno BELANYI 1022601602 machines: aramis: networking: use wireless option 2021-05-10 00:31:01 +02:00
Bruno BELANYI 376e60d71e modules: networking: add 'wireless' option 2021-05-10 00:31:01 +02:00
Bruno BELANYI a03db294fe machines: aramis: install: exit on error 2021-05-10 00:31:01 +02:00
Bruno BELANYI f2b9040175 machines: aramis: home: enable nm-applet 2021-05-10 00:31:01 +02:00
Bruno BELANYI b1e8664e32 home: add nm-applet 2021-05-10 00:31:01 +02:00
Bruno BELANYI b61aca7def modules: users: add myself to 'networkmanager' 2021-05-08 17:14:13 +02:00
Bruno BELANYI d388a379d4 machine: aramis: networking: use networkmanager
I consider WiFi configurations to be ephemeral
2021-05-08 17:14:13 +02:00
Bruno BELANYI 3402b92784 home: gammastep: show tray icon 2021-05-08 17:14:13 +02:00
Bruno BELANYI b55466b791 home: gammastep: change default night temperature
I want the colour to be warmer, and blues even more attenuated.
2021-05-08 17:14:13 +02:00
Bruno BELANYI 036d59ec11 home: wm: i3: add mic mute media key 2021-05-08 17:14:13 +02:00
Bruno BELANYI f89e1ba3e9 home: wm: i3: fix audio media keys 2021-05-08 17:14:13 +02:00
Bruno BELANYI 8788deac5e home: wm: i3bar: extend width of music block 2021-05-08 17:14:13 +02:00
Bruno BELANYI 676cd03c9c home: wm: i3bar: show temperature block by default 2021-05-08 17:14:13 +02:00
Bruno BELANYI e329e7a59a home: zsh: enable VTE integration when appropriate 2021-05-08 17:14:13 +02:00
Bruno BELANYI 98a8e068ea machines: aramis: services: enable wireguard 2021-05-08 17:14:13 +02:00
Bruno BELANYI f5fcd2a7a6 home: wm: screen-lock: add 'notify.delay' setting 2021-05-08 17:14:13 +02:00
Bruno BELANYI 1b9b598662 home: wm: screen-lock: add corner delay setting 2021-05-08 17:14:13 +02:00
Bruno BELANYI 05e0cd4e1f modules: users: reformat 2021-05-08 17:14:13 +02:00
Bruno BELANYI 9973e0d32f home: firefox: add form-history-control extension 2021-05-08 17:14:13 +02:00
Bruno BELANYI 8231e8feaa home: wm: i3: use keycode for shutdown mapping
The motivation for using keycodes for all those mappings is to allow
switch to an actual french keyboard layout it still be able to move
through workspaces etc...
2021-05-08 17:14:13 +02:00
Bruno BELANYI 8dc89846b2 machines: aramis: home: use GTK pinentry
I do have a graphical session, I can afford to be "fancy"
2021-05-08 17:14:13 +02:00
Bruno BELANYI 5a32160954 home: gpg: make pinentry configurable 2021-05-08 17:14:13 +02:00
Bruno BELANYI 6612d0226a modules: packages: prefer user compinit to global
This should make the shell startup faster.
2021-05-08 17:14:13 +02:00
Bruno BELANYI 75e3d9bf70 project: bootstrap: unlock BW when logged in 2021-05-08 17:14:13 +02:00
Bruno BELANYI 9dbfb65c27 home: wm: i3: add display bindings 2021-05-08 17:14:13 +02:00
Bruno BELANYI f8d6447ac4 home: wm: i3: add dunst bindings 2021-05-08 17:14:13 +02:00
Bruno BELANYI 185781a4e2 home: wm: i3: add binding to toggle xautolock 2021-05-08 17:14:13 +02:00
Bruno BELANYI cdc29efafc home: wm: screen-lock: add xautolock options 2021-05-08 17:14:13 +02:00
Bruno BELANYI 9f6c614c9f home: wm: add screen-lock 2021-05-08 17:14:13 +02:00
Bruno BELANYI 54a20058fb home: wm: dunst: add configuration 2021-05-08 17:14:13 +02:00
Bruno BELANYI 6bad81a644 home: wm: add dunst 2021-05-08 17:14:13 +02:00
Bruno BELANYI 971ee359ce home: wm: use explicit 'enable' options
This is so that I can explicitly enable them if I were to use Wayland
and Sway, given that they should be compatible with both environment.

This also means that putting them in `/home/x/` would a misnomer... Will
revisit this if and when I try out Wayland and sway...
2021-05-08 17:14:13 +02:00
Bruno BELANYI c175964630 modules: users: add myself to 'video' and 'audio' 2021-05-08 17:14:13 +02:00
Bruno BELANYI 046391e26e home: wm: i3bar: hide music block when not playing 2021-05-08 17:14:13 +02:00
Bruno BELANYI b32fec2c63 home: wm: i3bar: add gammastep block if enabled 2021-05-08 17:14:13 +02:00
Bruno BELANYI 3ec448bf03 machines: aramis: home: enable gammastep 2021-05-08 17:14:13 +02:00
Bruno BELANYI c3c44bceb6 home: add gammastep 2021-05-08 17:14:13 +02:00
Bruno BELANYI e1240c188e home: firefox: add tridactyl 2021-05-08 17:14:13 +02:00
Bruno BELANYI d5b3b95827 home: firefox: use tridactyl-native when enabled 2021-05-08 17:14:13 +02:00
Bruno BELANYI c17b5f4004 machines: aramis: home: enable firefox 2021-05-08 17:14:13 +02:00
Bruno BELANYI e06edc8f47 home: add firefox 2021-05-08 17:14:13 +02:00
Bruno BELANYI 4d04dd9b9b home: wm: i3: use udiskie service 2021-05-08 17:14:13 +02:00
Bruno BELANYI e6b810b5a1 home: add udiskie 2021-05-08 17:14:13 +02:00
Bruno BELANYI 595720dcd4 home: wm: i3: use flameshot service directly
Instead of starting `flameshot` with `i3`, use the provided service.
2021-05-08 17:14:13 +02:00
Bruno BELANYI e6fb00ce9a home: add flameshot 2021-05-08 17:14:13 +02:00
Bruno BELANYI d01b7963cd machines: aramis: home: enable zathura 2021-05-08 17:14:13 +02:00
Bruno BELANYI 646768c3b7 home: add zathura 2021-05-08 17:14:13 +02:00
Bruno BELANYI b254e0f7ac machines: aramis: home: enable termite 2021-05-08 17:14:13 +02:00
Bruno BELANYI fee045d82c home: wm: i3: use 'my.home.terminal' explicitly 2021-05-08 17:14:13 +02:00
Bruno BELANYI 76b17e924a home: terminal: add termite 2021-05-08 17:14:13 +02:00
Bruno BELANYI 9fe78a5a70 home: add terminal
This module abstracts away the color configuration.
2021-05-08 17:14:13 +02:00
Bruno BELANYI 90ccf42779 home: wm: i3: add configuration 2021-05-08 17:14:13 +02:00
Bruno BELANYI cdbe16e703 home: wm: add rofi 2021-05-08 17:14:13 +02:00
Bruno BELANYI 1da8177ea2 home: wm: add i3bar 2021-05-08 17:14:13 +02:00
Bruno BELANYI fe9f468e06 machines: aramis: home: enable X & i3 2021-05-08 17:14:13 +02:00
Bruno BELANYI 45cb955433 machines: aramis: add home configuration 2021-05-08 17:14:13 +02:00
Bruno BELANYI b6fb77fc34 modules: add home
This makes setting and referring to my home-manager options easier.
2021-05-08 17:14:13 +02:00
Bruno BELANYI f57cfda767 home: wm: add i3
This is only the basic default configuration. The full configuration
will come later.

I am not a fan of `wm.windowManager`, I might rename that option at some
point.
2021-05-08 17:14:13 +02:00
Bruno BELANYI 5427f15a17 home: add X keyboard configuration 2021-05-08 17:14:13 +02:00
Bruno BELANYI 6acf9f4a19 machines: add aramis 2021-05-08 17:14:13 +02:00
Bruno BELANYI cd7c8e2172 lib: attrs: add renaming functions 2021-05-08 17:14:13 +02:00
Bruno BELANYI e0b0f44a9a lib: attrs: document functions 2021-05-08 17:14:13 +02:00
Bruno BELANYI bd53470e46 lib: attrs: add genAttrs' function 2021-05-08 17:14:13 +02:00
Bruno BELANYI f634f1b2ed flake: refactor handling of shared modules 2021-05-08 17:14:13 +02:00
Bruno BELANYI dc052386d1 machine: aramis: add installer script
This is the first time that I am setting up LVM-on-LUKS with NixOS, so a
VM came in handy to test it out.
2021-05-08 17:14:13 +02:00
292 changed files with 6909 additions and 1793 deletions

View file

@ -1,24 +1,27 @@
---
kind: pipeline
name: check config
type: exec
name: NixOS config check
steps:
- name: format check
image: nixos/nix
commands:
- nix-shell -p nixpkgs-fmt --run 'nixpkgs-fmt . --check'
- name: nix flake check
commands:
- nix flake check
- name: notify
image: plugins/matrix
settings:
homeserver:
from_secret: matrix_homeserver
roomid:
from_secret: matrix_roomid
username:
from_secret: matrix_username
password:
from_secret: matrix_password
trigger:
status:
- failure
- success
- name: notifiy
commands:
- nix run .#matrix-notifier
environment:
ADDRESS:
from_secret: matrix_homeserver
ROOM:
from_secret: matrix_roomid
USER:
from_secret: matrix_username
PASS:
from_secret: matrix_password
when:
status:
- failure
- success
...

1
.envrc
View file

@ -6,3 +6,4 @@ use_flake() {
ulimit -s unlimited # Bypass current bug in `nix` flakes evaluation
use flake
eval "$shellHooks"

View file

@ -1,4 +0,0 @@
# Do not edit this file. To specify the files to encrypt, create your own
# .gitattributes file in the directory where your files are.
* !filter !diff
*.gpg binary

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/.pre-commit-config.yaml

View file

@ -1,21 +0,0 @@
repos:
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: 'v2.3.0'
hooks:
- id: 'trailing-whitespace'
- id: 'end-of-file-fixer'
- id: 'check-yaml'
- id: 'check-added-large-files'
- repo: 'https://github.com/jumanjihouse/pre-commit-hooks'
rev: '2.1.4'
hooks:
- id: 'forbid-binary'
- repo: 'local'
hooks:
- id: 'nixpkgs-fmt'
name: 'nixpkgs-fmt'
description: 'Format nix code with nixpkgs-fmt'
entry: 'nixpkgs-fmt'
language: 'system'
files: '\.nix$'
always_run: true

View file

@ -17,7 +17,8 @@ Secondly, take care of a few manual steps:
* Configure Gitea and Drone
* Configure Lohr webhook and SSH key
* Configure Jellyfin
* Configure Jackett and NZBHydra2
* Configure Prowlarr,Jackett and NZBHydra2
* Configure Sonarr, Radarr, Bazarr
* Configure Transmission's webui port
* Configure Quassel user
* Configure Flood account

View file

@ -58,6 +58,8 @@ get_ssh() {
get_doc "SysAdmin/SSH" "shared-key-public" "$HOME/.ssh/shared_rsa.pub" 644
get_doc "SysAdmin/SSH" "shared-key-private" "$HOME/.ssh/shared_rsa" 600
get_doc "SysAdmin/SSH" "agenix-public" "$HOME/.ssh/id_ed25519.pub" 644
get_doc "SysAdmin/SSH" "agenix-private" "$HOME/.ssh/id_ed25519" 600
}
get_pgp() {
@ -78,7 +80,7 @@ get_pgp() {
}
get_creds() {
BW_SESSION="$(bw login --raw)"
BW_SESSION="$(bw login --raw || bw unlock --raw)"
export BW_SESSION
get_ssh

View file

@ -1,12 +1,33 @@
{
"nodes": {
"agenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1646105662,
"narHash": "sha256-jdXCZbGZL0SWWi29GnAOFHUh/QvvP0IyaVLv1ZTDkBI=",
"owner": "ryantm",
"repo": "agenix",
"rev": "297cd58b418249240b9f1f155d52b1b17f292884",
"type": "github"
},
"original": {
"owner": "ryantm",
"ref": "main",
"repo": "agenix",
"type": "github"
}
},
"futils": {
"locked": {
"lastModified": 1619345332,
"narHash": "sha256-qHnQkEp1uklKTpx3MvKtY6xzgcqXDsz5nLilbbuL+3A=",
"lastModified": 1644229661,
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "2ebf2558e5bf978c7fb8ea927dfaed8fefab2e28",
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
"type": "github"
},
"original": {
@ -23,11 +44,11 @@
]
},
"locked": {
"lastModified": 1619558193,
"narHash": "sha256-DljP5/9EX0eXEPhzCUFqFEHkkcFuXJBx1PTgcv0OgyM=",
"lastModified": 1646559628,
"narHash": "sha256-WDoqxH/IPTV8CkI15wwzvXYgXq9UPr8xd8WKziuaynw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "18ad12d52b8cebbb57013865eec2be5125de050a",
"rev": "afe96e7433c513bf82375d41473c57d1f66b4e68",
"type": "github"
},
"original": {
@ -39,11 +60,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1619464443,
"narHash": "sha256-R7WAb8EnkIJxxaF6GTHUPytjonhB4Zm0iatyWoW169A=",
"lastModified": 1646497237,
"narHash": "sha256-Ccpot1h/rV8MgcngDp5OrdmLTMaUTbStZTR5/sI7zW0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17",
"rev": "062a0c5437b68f950b081bbfc8a699d57a4ee026",
"type": "github"
},
"original": {
@ -55,11 +76,11 @@
},
"nur": {
"locked": {
"lastModified": 1619628114,
"narHash": "sha256-s3pQyvMfXVmbQOX224yOWQf6zi8406sShFF4u17LVQ0=",
"lastModified": 1646721260,
"narHash": "sha256-r8ZWtEwiRxLKOtsT2yvU9Rs1oqL/RsSkPkgupXsw1bU=",
"owner": "nix-community",
"repo": "NUR",
"rev": "0615e756dc14986c4968fa478c0bd080d621cb2b",
"rev": "25adb63e9381cb0342cdbe2d2d56266f4974a2c5",
"type": "github"
},
"original": {
@ -69,12 +90,38 @@
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-utils": [
"futils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1646153636,
"narHash": "sha256-AlWHMzK+xJ1mG267FdT8dCq/HvLCA6jwmx2ZUy5O8tY=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "b6bc0b21e1617e2b07d8205e7fae7224036dfa4b",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "master",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"agenix": "agenix",
"futils": "futils",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"nur": "nur"
"nur": "nur",
"pre-commit-hooks": "pre-commit-hooks"
}
}
},

114
flake.nix
View file

@ -1,6 +1,16 @@
{
description = "NixOS configuration with flakes";
inputs = {
agenix = {
type = "github";
owner = "ryantm";
repo = "agenix";
ref = "main";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
futils = {
type = "github";
owner = "numtide";
@ -31,9 +41,29 @@
repo = "NUR";
ref = "master";
};
pre-commit-hooks = {
type = "github";
owner = "cachix";
repo = "pre-commit-hooks.nix";
ref = "master";
inputs = {
flake-utils.follows = "futils";
nixpkgs.follows = "nixpkgs";
};
};
};
outputs = { self, futils, home-manager, nixpkgs, nur } @ inputs:
outputs =
inputs @
{ self
, agenix
, futils
, home-manager
, nixpkgs
, nur
, pre-commit-hooks
}:
let
inherit (futils.lib) eachDefaultSystem;
@ -51,58 +81,84 @@
nur.overlay
];
}
home-manager.nixosModules.home-manager
{
home-manager.users.ambroisie = import ./home;
# Nix Flakes compatibility
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
# Include generic settings
./modules
# Include bundles of settings
./profiles
];
buildHost = name: system: lib.nixosSystem {
inherit system;
modules = defaultModules ++ [
(./. + "/${name}.nix")
(./. + "/machines/${name}")
];
specialArgs = {
# Use my extended lib in NixOS configuration
inherit lib;
# Inject inputs to use them in global registry
inherit inputs;
};
};
in
eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
rec {
apps = {
diff-flake = futils.lib.mkApp { drv = packages.diff-flake; };
let
pkgs = nixpkgs.legacyPackages.${system};
in
rec {
apps = {
diff-flake = futils.lib.mkApp { drv = packages.diff-flake; };
};
checks = {
pre-commit = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixpkgs-fmt = {
enable = true;
};
shellcheck = {
enable = true;
};
};
};
};
defaultApp = apps.diff-flake;
defaultApp = apps.diff-flake;
devShell = pkgs.mkShell {
name = "NixOS-config";
buildInputs = with pkgs; [
git-crypt
gitAndTools.pre-commit
gnupg
nixpkgs-fmt
];
};
devShell = pkgs.mkShell {
name = "NixOS-config";
packages = import ./pkgs { inherit pkgs; };
}) // {
nativeBuildInputs = with pkgs; [
gitAndTools.pre-commit
nixpkgs-fmt
];
inherit (self.checks.${system}.pre-commit) shellHook;
};
packages =
let
inherit (futils.lib) filterPackages flattenTree;
packages = import ./pkgs { inherit pkgs; };
flattenedPackages = flattenTree packages;
finalPackages = filterPackages system flattenedPackages;
in
finalPackages;
}) // {
overlay = self.overlays.pkgs;
overlays = {
overlays = import ./overlays // {
lib = final: prev: { inherit lib; };
pkgs = final: prev: { ambroisie = import ./pkgs { pkgs = prev; }; };
pkgs = final: prev: {
ambroisie = prev.recurseIntoAttrs (import ./pkgs { pkgs = prev; });
};
};
nixosConfigurations = lib.mapAttrs buildHost {
aramis = "x86_64-linux";
porthos = "x86_64-linux";
};
};

View file

@ -10,6 +10,8 @@ in
config.programs.bat = lib.mkIf cfg.enable {
enable = true;
config = {
theme = "gruvbox-dark";
pager = with config.home.sessionVariables; "${PAGER} ${LESS}";
};
};

View file

@ -0,0 +1,19 @@
{ config, lib, ... }:
let
cfg = config.my.home.bluetooth;
in
{
options.my.home.bluetooth = with lib; {
enable = mkEnableOption "bluetooth configuration";
};
config = lib.mkIf cfg.enable {
services.blueman-applet = {
enable = true;
};
services.mpris-proxy = {
enable = true;
};
};
}

29
home/comma/default.nix Normal file
View file

@ -0,0 +1,29 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.comma;
in
{
options.my.home.comma = with lib; {
enable = my.mkDisableOption "comma configuration";
pkgsFlake = mkOption {
type = types.str;
default = "pkgs";
example = "nixpkgs";
description = ''
Which flake from the registry should be used with
<command>nix shell</command>.
'';
};
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
ambroisie.comma
];
home.sessionVariables = {
COMMA_PKGS_FLAKE = cfg.pkgsFlake;
};
};
}

View file

@ -1,20 +1,38 @@
{ ... }:
{
imports = [
./bat.nix
./direnv.nix
./documentation.nix
./bat
./bluetooth
./comma
./direnv
./discord
./documentation
./feh
./firefox
./flameshot
./gammastep
./gdb
./git
./gpg.nix
./htop.nix
./jq.nix
./packages.nix
./pager.nix
./secrets # Home-manager specific secrets
./ssh.nix
./tmux.nix
./gpg
./gtk
./htop
./jq
./mail
./mpv
./nix-index
./nm-applet
./packages
./pager
./power-alert
./ssh
./terminal
./tmux
./udiskie
./vim
./xdg.nix
./wm
./x
./xdg
./zathura
./zsh
];
@ -23,4 +41,7 @@
# Who am I?
home.username = "ambroisie";
# Start services automatically
systemd.user.startServices = "sd-switch";
}

View file

@ -9,7 +9,9 @@ in
config.programs.direnv = lib.mkIf cfg.enable {
enable = true;
# A better `use_nix`
enableNixDirenvIntegration = true;
nix-direnv = {
# A better `use_nix`
enable = true;
};
};
}

23
home/discord/default.nix Normal file
View file

@ -0,0 +1,23 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.discord;
jsonFormat = pkgs.formats.json { };
in
{
options.my.home.discord = with lib; {
enable = mkEnableOption "discord configuration";
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
discord
];
xdg.configFile."discord/settings.json".source =
jsonFormat.generate "discord.json" {
# Do not keep me from using the app just to force an update
SKIP_HOST_UPDATE = true;
};
};
}

13
home/feh/default.nix Normal file
View file

@ -0,0 +1,13 @@
{ config, lib, ... }:
let
cfg = config.my.home.feh;
in
{
options.my.home.feh = with lib; {
enable = mkEnableOption "feh configuration";
};
config.programs.feh = lib.mkIf cfg.enable {
enable = true;
};
}

84
home/firefox/default.nix Normal file
View file

@ -0,0 +1,84 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.firefox;
in
{
imports = [
./tridactyl
];
options.my.home.firefox = with lib; {
enable = mkEnableOption "firefox configuration";
tridactyl = {
enable = mkOption {
type = types.bool;
description = "tridactyl configuration";
example = false;
default = config.my.home.firefox.enable;
};
};
ff2mpv = {
enable = mkOption {
type = types.bool;
description = "ff2mpv configuration";
example = false;
default = config.my.home.mpv.enable;
};
};
};
config.programs.firefox = lib.mkIf cfg.enable {
enable = true;
package = pkgs.firefox.override {
cfg = {
enableTridactylNative = cfg.tridactyl.enable;
};
extraNativeMessagingHosts = with pkgs; ([ ]
# Watch videos using mpv
++ lib.optional cfg.ff2mpv.enable ambroisie.ff2mpv-go
);
};
profiles = {
default = {
id = 0;
settings = {
"browser.bookmarks.showMobileBookmarks" = true; # Mobile bookmarks
"browser.download.useDownloadDir" = false; # Ask for download location
"browser.in-content.dark-mode" = true; # Dark mode
"browser.newtabpage.activity-stream.feeds.section.topstories" = false; # Disable top stories
"browser.newtabpage.activity-stream.feeds.sections" = false;
"browser.newtabpage.activity-stream.feeds.system.topstories" = false; # Disable top stories
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false; # Disable pocket
"extensions.pocket.enabled" = false; # Disable pocket
"media.eme.enabled" = true; # Enable DRM
"media.gmp-widevinecdm.visible" = true; # Enable DRM
"media.gmp-widevinecdm.enabled" = true; # Enable DRM
"signon.autofillForms" = false; # Disable built-in form-filling
"signon.rememberSignons" = false; # Disable built-in password manager
"ui.systemUsesDarkTheme" = true; # Dark mode
};
};
};
extensions = with pkgs.nur.repos.rycee.firefox-addons; ([
bitwarden
consent-o-matic
form-history-control
https-everywhere
reddit-comment-collapser
reddit-enhancement-suite
refined-github
sponsorblock
ublock-origin
]
++ lib.optional (cfg.tridactyl.enable) tridactyl
++ lib.optional (cfg.ff2mpv.enable) ff2mpv
);
};
}

View file

@ -0,0 +1,9 @@
{ config, lib, ... }:
let
cfg = config.my.home.firefox.tridactyl;
in
{
config = lib.mkIf cfg.enable {
xdg.configFile."tridactyl/tridactylrc".source = ./tridactylrc;
};
}

View file

@ -0,0 +1,76 @@
" Shamelessly taken from bovine3dom's example configuration file from the docs
" Basics {{{
" Use dark color scheme
colorscheme dark
" Make tridactyl open Vim in my prefered terminal
" FIXME: make it follow my prefered terminal
set editorcmd termite --class tridactyl_editor -e 'vim %f'
" }}}
" Binds {{{
" Reddit et al. {{{
" Toggle comments on Reddit, Hacker News, Lobste.rs
bind ;c hint -c [class*="expand"],[class*="togg"],[class="comment_folder"]
" Make `gu` take me back to subreddit from comments
bindurl reddit.com gu urlparent 3
" Only hint search results on Google
bindurl www.google.com f hint -Jc #search div:not(.action-menu) > a
bindurl www.google.com F hint -Jbc #search div:not(.action-menu) > a
" Only hint search results on DuckDuckGo
bindurl ^https://duckduckgo.com f hint -Jc [class~=result__a]
bindurl ^https://duckduckgo.com F hint -Jbc [class~=result__a]
" Only hint item pages on Hacker News
bindurl news.ycombinator.com ;f hint -Jc .age > a
bindurl news.ycombinator.com ;F hint -Jtc .age > a
" }}}
" Better bindings {{{
" Handy multiwindow binds
bind gd tabdetach
bind gD composite tabduplicate; tabdetach
" Duplicate a tab without detaching window
bind <Space>d tabduplicate
" Make yy use canonical links on the few websites that support them
bind yy clipboard yankcanon
" }}}
" Search {{{
" Case insensitive only if fully lowercase
set findcase smart
" Search forward/backward
bind / fillcmdline find
bind ? fillcmdline find -?
" Go to next/previous match
bind n findnext 1
bind N findnext -1
" Because :nohls never works
bind <Space><Space> nohlsearch
" Use browser's native find when using Ctrl-F
unbind <C-f>
" }}}
" }}}
" Redirections {{{
" Always redirect Reddit to the old site
autocmd DocStart ^http(s?)://www.reddit.com js tri.excmds.urlmodify("-t", "www", "old")
" }}}
" Disabled websites {{{
blacklistadd netflix.com
blacklistadd primevideo.com
blacklistadd jellyfin.belanyi.fr
" }}}
" vim: set filetype=vim foldmethod=marker:

View file

@ -0,0 +1,13 @@
{ config, lib, ... }:
let
cfg = config.my.home.flameshot;
in
{
options.my.home.flameshot = with lib; {
enable = mkEnableOption "flameshot configuration";
};
config.services.flameshot = lib.mkIf cfg.enable {
enable = true;
};
}

View file

@ -0,0 +1,44 @@
{ config, lib, ... }:
let
cfg = config.my.home.gammastep;
mkTempOption = with lib; description: default: mkOption {
inherit description default;
type = types.int;
example = 1000;
};
mkTimeOption = with lib; description: default: mkOption {
inherit description default;
type = types.str;
example = "12:00-14:00";
};
in
{
options.my.home.gammastep = with lib; {
enable = mkEnableOption "gammastep configuration";
temperature = {
day = mkTempOption "Colour temperature to use during the day" 6500;
night = mkTempOption "Colour temperature to use during the night" 2000;
};
times = {
dawn = mkTimeOption "Dawn time" "6:00-7:30";
dusk = mkTimeOption "Dusk time" "18:30-20:00";
};
};
config.services.gammastep = lib.mkIf cfg.enable {
enable = true;
tray = true;
dawnTime = cfg.times.dawn;
duskTime = cfg.times.dusk;
temperature = {
inherit (cfg.temperature) day night;
};
};
}

42
home/gdb/default.nix Normal file
View file

@ -0,0 +1,42 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.gdb;
in
{
options.my.home.gdb = with lib; {
enable = my.mkDisableOption "gdb configuration";
rr = {
enable = my.mkDisableOption "rr configuration";
package = mkOption {
type = types.package;
default = pkgs.rr;
defaultText = literalExample "pkgs.rr";
description = ''
Package providing rr
'';
};
};
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
home.packages = with pkgs; [
gdb
];
# FIXME: waiting for commit 64aaad6349d2b2c45063a5383f877ce9a3a0c354
xdg.configFile."gdb/gdbinit".source = ./gdbinit;
# FIXME: remove once `gdb` is updated from version 10.2
home.file.".gdbinit".source = ./gdbinit;
})
(lib.mkIf cfg.rr.enable {
home.packages = [
cfg.rr.package
];
})
];
}

24
home/gdb/gdbinit Normal file
View file

@ -0,0 +1,24 @@
# Keep a history of all commands in each directory
set history save on
# Enable those pretty-printers
enable pretty-printer
# Pretty formatting of structures
set print pretty on
# Show derived type based on VTable
set print object on
# Show static members
set print static-members on
# Show VTable
set print vtbl on
# Demangle types
set print demangle on
# Read python scrips in the load path
set auto-load python-scripts
# Allow autoloading project-local .gdbinit files
set auto-load safe-path ~/git/
# Allow autoloading from the Nix store
set auto-load safe-path /nix/store

View file

@ -24,3 +24,7 @@ compile_commands.json
# Swap and backup files
*~
~.swp
# Direnv files
.envrc
.direnv/

View file

@ -1,34 +1,72 @@
{ config, pkgs, lib, ... }:
let
cfg = config.my.home.git;
inherit (lib.my) mkMailAddress;
in
{
options.my.home.git = with lib.my; {
enable = mkDisableOption "git configuration";
};
config.home.packages = with pkgs.gitAndTools; lib.mkIf cfg.enable [
gitAndTools.git-absorb
gitAndTools.git-revise
gitAndTools.tig
];
config.programs.git = lib.mkIf cfg.enable {
enable = true;
# Who am I?
userEmail = "bruno@belanyi.fr";
userEmail = mkMailAddress "bruno" "belanyi.fr";
userName = "Bruno BELANYI";
# I want the full experience
package = pkgs.gitAndTools.gitFull;
aliases = {
lol = "log --graph --decorate --pretty=oneline --abbrev-commit";
git = "!git";
lol = "log --graph --decorate --pretty=oneline --abbrev-commit --topo-order";
lola = "lol --all";
assume = "update-index --assume-unchanged";
unassume = "update-index --no-assume-unchanged";
assumed = "!git ls-files -v | grep ^h | cut -c 3-";
pick = "log -p -G";
push-new = "!git push -u origin "
+ ''"$(git branch | grep '^* ' | cut -f2- -d' ')"'';
};
lfs.enable = true;
delta = {
enable = true;
options = {
features = "diff-highlight decorations";
# Less jarring style for `diff-highlight` emulation
diff-highlight = {
minus-style = "red";
minus-non-emph-style = "red";
minus-emph-style = "bold red 52";
plus-style = "green";
plus-non-emph-style = "green";
plus-emph-style = "bold green 22";
whitespace-error-style = "reverse red";
};
# Personal preference for easier reading
decorations = {
commit-style = "raw"; # Do not recolor meta information
keep-plus-minus-markers = true;
paging = "always";
};
};
};
# There's more
extraConfig = {
# Makes it a bit more readable
@ -62,13 +100,6 @@ in
whitespace = "red reverse";
};
"color.diff-highlight" = {
oldNormal = "red bold";
oldHighlight = "red bold 52";
newNormal = "green bold";
newHighlight = "green bold 22";
};
commit = {
# Show my changes when writing the message
verbose = true;
@ -89,16 +120,6 @@ in
defaultBranch = "main";
};
pager =
let
diff-highlight = "${pkgs.gitAndTools.gitFull}/share/git/contrib/diff-highlight/diff-highlight";
in
{
diff = "${diff-highlight} | less";
log = "${diff-highlight} | less";
show = "${diff-highlight} | less";
};
pull = {
# Avoid useless merge commits
rebase = true;
@ -114,11 +135,33 @@ in
autoSquash = true;
autoStash = true;
};
url = {
"git@gitea.belanyi.fr:" = {
insteadOf = "https://gitea.belanyi.fr/";
};
"git@github.com:" = {
insteadOf = "https://github.com/";
};
"git@gitlab.com:" = {
insteadOf = "https://gitlab.com/";
};
};
};
# Multiple identities
includes = [
{ path = ./epita.config; condition = "gitdir:~/git/EPITA/"; }
{
condition = "gitdir:~/git/EPITA/";
contents = {
user = {
name = "Bruno BELANYI";
email = mkMailAddress "bruno.belanyi" "epita.fr";
};
};
}
];
ignores =

View file

@ -1,4 +0,0 @@
[user]
email = bruno.belanyi@epita.fr
name = Bruno BELANYI
# vim: set ft=gitconfig:

View file

@ -3,8 +3,15 @@ let
cfg = config.my.home.gpg;
in
{
options.my.home.gpg = with lib.my; {
enable = mkDisableOption "gpg configuration";
options.my.home.gpg = with lib; {
enable = my.mkDisableOption "gpg configuration";
pinentry = mkOption {
type = types.str;
default = "tty";
example = "gtk2";
description = "Which pinentry interface to use";
};
};
config = lib.mkIf cfg.enable {
@ -15,7 +22,7 @@ in
services.gpg-agent = {
enable = true;
enableSshSupport = true; # One agent to rule them all
pinentryFlavor = "tty";
pinentryFlavor = cfg.pinentry;
extraConfig = ''
allow-loopback-pinentry
'';

33
home/gtk/default.nix Normal file
View file

@ -0,0 +1,33 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.gtk;
in
{
options.my.home.gtk = with lib; {
enable = mkEnableOption "GTK configuration";
};
config.gtk = lib.mkIf cfg.enable {
enable = true;
font = {
package = pkgs.dejavu_fonts;
name = "DejaVu Sans";
};
gtk2 = {
# That sweet, sweet clean home that I am always aiming for...
configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
};
iconTheme = {
package = pkgs.gnome.gnome-themes-extra;
name = "Adwaita";
};
theme = {
package = pkgs.gnome.gnome-themes-extra;
name = "Adwaita";
};
};
}

View file

@ -0,0 +1,105 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.mail;
inherit (lib.my) mkMailAddress;
mkConfig = { domain, address, passName, aliases ? [ ], primary ? false }: {
realName = lib.mkDefault "Bruno BELANYI";
userName = lib.mkDefault (mkMailAddress address domain);
passwordCommand =
lib.mkDefault [ "${pkgs.ambroisie.bw-pass}/bin/bw-pass" "Mail" passName ];
address = mkMailAddress address domain;
aliases = builtins.map (lib.flip mkMailAddress domain) aliases;
inherit primary;
himalaya = {
enable = cfg.himalaya.enable;
};
msmtp = {
enable = cfg.msmtp.enable;
};
};
migaduConfig = {
imap = {
host = "imap.migadu.com";
port = 993;
tls = {
enable = true;
};
};
smtp = {
host = "smtp.migadu.com";
port = 465;
tls = {
enable = true;
};
};
};
gmailConfig = {
flavor = "gmail.com";
folders = {
drafts = "[Gmail]/Drafts";
sent = "[Gmail]/Sent Mail";
trash = "[Gmail]/Trash";
};
};
office365Config = {
imap = {
host = "outlook.office365.com";
port = 993;
tls = {
enable = true;
};
};
smtp = {
host = "outlook.office365.com";
port = 587;
tls = {
enable = true;
useStartTls = true;
};
};
};
in
{
config.accounts.email.accounts = {
personal = lib.mkMerge [
# Common configuraton
(mkConfig {
domain = "belanyi.fr";
address = "bruno";
passName = "Migadu";
aliases = [ "admin" "postmaster" ];
primary = true; # This is my primary email
})
migaduConfig
];
gmail = lib.mkMerge [
# Common configuraton
(mkConfig {
domain = "gmail.com";
address = "brunobelanyi";
passName = "GMail";
})
gmailConfig
];
epita = lib.mkMerge [
# Common configuration
(mkConfig {
domain = "epita.fr";
address = "bruno.belanyi";
passName = "EPITA";
})
office365Config
];
};
}

31
home/mail/default.nix Normal file
View file

@ -0,0 +1,31 @@
{ config, lib, ... }:
let
cfg = config.my.home.mail;
mkRelatedOption = desc: lib.mkEnableOption desc // { default = cfg.enable; };
in
{
imports = [
./accounts
./himalaya
./msmtp
];
options.my.home.mail = with lib; {
enable = my.mkDisableOption "email configuration";
himalaya = {
enable = mkRelatedOption "himalaya configuration";
};
msmtp = {
enable = mkRelatedOption "msmtp configuration";
};
};
config = {
accounts.email = {
maildirBasePath = "mail";
};
};
}

View file

@ -0,0 +1,23 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.mail.himalaya;
in
{
config.programs.himalaya = lib.mkIf cfg.enable {
enable = true;
settings = {
notify-cmd =
let
notify-send = "${pkgs.libnotify}/bin/notify-send";
in
pkgs.writeScript "mail-notifier" ''
SENDER="$1"
SUBJECT="$2"
${notify-send} \
-c himalaya \
-- "$(printf 'Received email from %s\n\n%s' "$SENDER" "$SUBJECT")"
'';
};
};
}

View file

@ -0,0 +1,9 @@
{ config, lib, ... }:
let
cfg = config.my.home.mail.msmtp;
in
{
config.programs.msmtp = lib.mkIf cfg.enable {
enable = true;
};
}

19
home/mpv/default.nix Normal file
View file

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.mpv;
in
{
options.my.home.mpv = with lib; {
enable = mkEnableOption "mpv configuration";
};
config = lib.mkIf cfg.enable {
programs.mpv = {
enable = true;
scripts = [
pkgs.mpvScripts.mpris # Allow controlling using media keys
];
};
};
}

View file

@ -0,0 +1,13 @@
{ config, lib, ... }:
let
cfg = config.my.home.nix-index;
in
{
options.my.home.nix-index = with lib.my; {
enable = mkDisableOption "nix-index configuration";
};
config.programs.nix-index = lib.mkIf cfg.enable {
enable = true;
};
}

View file

@ -0,0 +1,13 @@
{ config, lib, ... }:
let
cfg = config.my.home.nm-applet;
in
{
options.my.home.nm-applet = with lib; {
enable = mkEnableOption "network-manager-applet configuration";
};
config.services.network-manager-applet = lib.mkIf cfg.enable {
enable = true;
};
}

View file

@ -1,20 +0,0 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.packages;
in
{
options.my.home.packages = with lib.my; {
enable = mkDisableOption "user packages";
};
config.home.packages = with pkgs; lib.mkIf cfg.enable [
# Git related
gitAndTools.git-absorb
gitAndTools.git-revise
gitAndTools.tig
# Dev work
rr
# Terminal prettiness
termite.terminfo
];
}

28
home/packages/default.nix Normal file
View file

@ -0,0 +1,28 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.packages;
in
{
options.my.home.packages = with lib; {
enable = my.mkDisableOption "user packages";
additionalPackages = mkOption {
type = with types; listOf package;
default = [ ];
example = literalExample ''
with pkgs; [
quasselClient
]
'';
};
};
config.home.packages = with pkgs; lib.mkIf cfg.enable ([
fd
file
mosh
ripgrep
rr
termite.terminfo
] ++ cfg.additionalPackages);
}

View file

@ -1,18 +0,0 @@
{ config, lib, ... }:
let
cfg = config.my.home.pager;
in
{
options.my.home.pager = with lib.my; {
enable = mkDisableOption "pager configuration";
};
config.programs.lesspipe.enable = cfg.enable;
config.home.sessionVariables = lib.mkIf cfg.enable {
# My default pager
PAGER = "less";
# Clear the screen on start and exit
LESS = "-R -+X -c";
};
}

36
home/pager/default.nix Normal file
View file

@ -0,0 +1,36 @@
{ config, lib, ... }:
let
cfg = config.my.home.pager;
in
{
options.my.home.pager = with lib.my; {
enable = mkDisableOption "pager configuration";
};
config = lib.mkIf cfg.enable {
home.sessionVariables = {
# My default pager
PAGER = "less";
# Clear the screen on start and exit
LESS = "-R -+X -c";
};
programs.zsh.localVariables = {
# Colored man pages
LESS_TERMCAP_mb = "$(tput bold; tput setaf 2)";
LESS_TERMCAP_md = "$(tput bold; tput setaf 6)";
LESS_TERMCAP_me = "$(tput sgr0)";
LESS_TERMCAP_so = "$(tput bold; tput setaf 3; tput setab 4)";
LESS_TERMCAP_se = "$(tput rmso; tput sgr0)";
LESS_TERMCAP_us = "$(tput bold; tput setaf 2)";
LESS_TERMCAP_ue = "$(tput rmul; tput sgr0)";
LESS_TERMCAP_mr = "$(tput rev)";
LESS_TERMCAP_mh = "$(tput dim)";
LESS_TERMCAP_ZN = "$(tput ssubm)";
LESS_TERMCAP_ZV = "$(tput rsubm)";
LESS_TERMCAP_ZO = "$(tput ssupm)";
LESS_TERMCAP_ZW = "$(tput rsupm)";
};
};
}

View file

@ -0,0 +1,15 @@
{ config, lib, ... }:
let
cfg = config.my.home.power-alert;
in
{
options.my.home.power-alert = with lib; {
enable = mkEnableOption "power-alert configuration";
};
config = lib.mkIf cfg.enable {
services.poweralertd = {
enable = true;
};
};
}

View file

@ -1,3 +0,0 @@
* filter=git-crypt diff=git-crypt
.gitattributes !filter !diff
/default.nix !filter !diff

Binary file not shown.

View file

@ -1,19 +0,0 @@
{ lib, ... }:
with lib;
let
canaryHash = builtins.hashFile "sha256" ./canary;
expectedHash =
"9df8c065663197b5a1095122d48e140d3677d860343256abd5ab6e4fb4c696ab";
in
if canaryHash != expectedHash then
abort "Secrets are not readable. Have you run `git-crypt unlock`?"
else {
options.my.secrets = mkOption {
type = types.attrs;
};
config.my.secrets = {
# Home-manager secrets go here
};
}

View file

@ -7,7 +7,7 @@ in
enable = mkDisableOption "ssh configuration";
};
config.programs.ssh = {
config.programs.ssh = lib.mkIf cfg.enable {
enable = true;
matchBlocks = {
@ -40,6 +40,12 @@ in
identityFile = "~/.ssh/shared_rsa";
user = "ambroisie";
};
work = {
hostname = "workspaces.dgexsol.fr";
identityFile = "~/.ssh/shared_rsa";
user = "bruno_belanyi";
};
};
extraConfig = ''

61
home/terminal/default.nix Normal file
View file

@ -0,0 +1,61 @@
{ config, lib, ... }:
let
mkColorOption = with lib; description: default: mkOption {
inherit description default;
example = "#abcdef";
type = types.strMatching "#[0-9a-f]{6}";
};
cfg = config.my.home.terminal;
in
{
imports = [
./termite
];
options.my.home = with lib; {
terminal = {
program = mkOption {
type = with types; nullOr (enum [ "termite" ]);
default = null;
example = "termite";
description = "Which terminal to use for home session";
};
colors = {
background = mkColorOption "Background color" "#161616";
foreground = mkColorOption "Foreground color" "#ffffff";
foregroundBold = mkColorOption "Foreground bold color" "#ffffff";
cursor = mkColorOption "Cursor color" "#ffffff";
black = mkColorOption "Black" "#222222";
blackBold = mkColorOption "Black bold" "#666666";
red = mkColorOption "Red" "#e84f4f";
redBold = mkColorOption "Red bold" "#d23d3d";
green = mkColorOption "Green" "#b7ce42";
greenBold = mkColorOption "Green bold" "#bde077";
yellow = mkColorOption "Yellow" "#fea63c";
yellowBold = mkColorOption "Yellow bold" "#ffe863";
blue = mkColorOption "Blue" "#66aabb";
blueBold = mkColorOption "Blue bold" "#aaccbb";
magenta = mkColorOption "Magenta" "#b7416e";
magentaBold = mkColorOption "Magenta bold" "#e16a98";
cyan = mkColorOption "Cyan" "#6d878d";
cyanBold = mkColorOption "Cyan bold" "#42717b";
white = mkColorOption "White" "#dddddd";
whiteBold = mkColorOption "White bold" "#cccccc";
};
};
};
config.home.sessionVariables = lib.mkIf (cfg.program != null) {
TERMINAL = cfg.program;
};
}

View file

@ -0,0 +1,53 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.terminal;
in
{
config = lib.mkIf (cfg.program == "termite") {
programs.termite = {
enable = true;
# Niceties
browser = "${pkgs.xdg-utils}/bin/xdg-open";
clickableUrl = true;
dynamicTitle = true;
fullscreen = false;
mouseAutohide = true;
urgentOnBell = true;
# Look and feel
allowBold = true;
audibleBell = false;
cursorBlink = "system";
font = "Monospace 9";
scrollbar = "off";
# Colors
backgroundColor = cfg.colors.background;
cursorColor = cfg.colors.cursor;
foregroundColor = cfg.colors.foreground;
foregroundBoldColor = cfg.colors.foregroundBold;
colorsExtra = with cfg.colors; ''
# Normal colors
color0 = ${black}
color1 = ${red}
color2 = ${green}
color3 = ${yellow}
color4 = ${blue}
color5 = ${magenta}
color6 = ${cyan}
color7 = ${white}
# Bold colors
color8 = ${blackBold}
color9 = ${redBold}
color10 = ${greenBold}
color11 = ${yellowBold}
color12 = ${blueBold}
color13 = ${magentaBold}
color14 = ${cyanBold}
color15 = ${whiteBold}
'';
};
};
}

View file

@ -1,6 +1,7 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.tmux;
hasGUI = config.my.home.x.enable || (config.my.home.wm != null);
in
{
options.my.home.tmux = with lib.my; {
@ -13,7 +14,7 @@ in
keyMode = "vi"; # Home-row keys and other niceties
clock24 = true; # I'm one of those heathens
escapeTime = 0; # Let vim do its thing instead
historyLimit = 5000; # Bigger buffer
historyLimit = 50000; # Bigger buffer
terminal = "tmux-256color"; # I want accurate termcap info
plugins = with pkgs.tmuxPlugins; [
@ -23,8 +24,16 @@ in
pain-control
# Better session management
sessionist
# X clipboard integration
yank
(lib.optionalAttrs hasGUI {
# X clipboard integration
plugin = yank;
extraConfig = ''
# Use 'clipboard' because of misbehaving apps (e.g: firefox)
set -g @yank_selection_mouse 'clipboard'
# Stay in copy mode after yanking
set -g @yank_action 'copy-pipe'
'';
})
{
# Show when prefix has been pressed
plugin = prefix-highlight;
@ -41,7 +50,13 @@ in
extraConfig = ''
# Better vim mode
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
${
lib.optionalString
(!hasGUI)
"bind-key -T copy-mode-vi 'y' send -X copy-selection"
}
# Block selection in vim mode
bind-key -Tcopy-mode-vi 'C-v' send -X begin-selection \; send -X rectangle-toggle
'';
};
}

13
home/udiskie/default.nix Normal file
View file

@ -0,0 +1,13 @@
{ config, lib, ... }:
let
cfg = config.my.home.udiskie;
in
{
options.my.home.udiskie = with lib; {
enable = mkEnableOption "udiskie configuration";
};
config.services.udiskie = lib.mkIf cfg.enable {
enable = true;
};
}

View file

@ -1,14 +0,0 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use shfmt as ALE fixer for bash
let b:ale_fixers=[ 'shfmt' ]
let b:undo_ftplugin.='|unlet! b:ale_fixers'
" Indent with 4 spaces, simplify script, indent switch cases, use Bash variant
let b:ale_sh_shfmt_options='-i 4 -s -ci -ln bash'
let b:undo_ftplugin.='|unlet! b:ale_sh_shfmt_options'
" Use bash dialect explicitly, require explicit empty string test
let b:ale_sh_shellcheck_options='-s bash -o avoid-nullary-conditions'
let b:undo_ftplugin.='|unlet! b:ale_sh_shellcheck_options'

View file

@ -7,7 +7,3 @@ let b:undo_ftplugin.='|setlocal shiftwidth<'
" Have automatic padding of transactions so that decimal is on 52nd column
let g:beancount_separator_col=52
" Automatic padding for transactions
nnoremap <buffer> <leader>= :AlignCommodity<CR>
vnoremap <buffer> <leader>= :AlignCommodity<CR>

View file

@ -1,14 +0,0 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" More warnings and the usual version in flags for Clang
let b:ale_c_clang_options='-Wall -Wextra -pedantic -std=c99'
let b:undo_ftplugin.='|unlet! b:ale_c_clang_options'
" More warnings and the usual version in flags for GCC
let b:ale_c_gcc_options='-Wall -Wextra -pedantic -std=c99'
let b:undo_ftplugin.='|unlet! b:ale_c_gcc_options'
" Use compile_commands.json to look for additional flags
let b:ale_c_parse_compile_commands=1
let b:undo_ftplugin.='|unlet! b:ale_c_parse_compile_commands'

View file

@ -1,14 +0,0 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" More warnings and the usual version in flags for Clang
let b:ale_cpp_clang_options='-Wall -Wextra -pedantic -std=c++17'
let b:undo_ftplugin.='|unlet! b:ale_cpp_clang_options'
" More warnings and the usual version in flags for GCC
let b:ale_cpp_gcc_options='-Wall -Wextra -pedantic -std=c++17'
let b:undo_ftplugin.='|unlet! b:ale_cpp_gcc_options'
" Use compile_commands.json to look for additional flags
let b:ale_c_parse_compile_commands=1
let b:undo_ftplugin.='|unlet! b:ale_c_parse_compile_commands'

View file

@ -1,6 +0,0 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use my desired ALE fixer for D
let b:ale_fixers=[ 'dfmt' ]
let b:undo_ftplugin.='|unlet! b:ale_fixers'

View file

@ -1,2 +0,0 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()

View file

@ -5,26 +5,6 @@ call ftplugined#check_undo_ft()
setlocal shiftwidth=2
let b:undo_ftplugin.='|setlocal shiftwidth<'
" Use my desired ALE fixers for Haskell
let b:ale_fixers=[ 'brittany' ]
let b:undo_ftplugin.='|unlet! b:ale_fixers'
" Use stack-managed `hlint`
let b:ale_haskell_hlint_executable='stack'
let b:undo_ftplugin.='|unlet! b:ale_haskell_hlint_executable'
" Use stack-managed `brittany`
let b:ale_haskell_brittany_executable='stack'
let b:undo_ftplugin.='|unlet! b:ale_haskell_brittany_executable'
" Use dynamic libraries because of Arch linux, with default ALE options
let b:ale_haskell_ghc_options='--dynamic -fno-code -v0'
let b:undo_ftplugin.='|unlet! b:ale_haskell_ghc_options'
" Automatically format files when saving them
let b:ale_fix_on_save=1
let b:undo_ftplugin='|unlet! b:ale_lint_on_save'
" Change max length of a line to 100 for this buffer to match official guidelines
setlocal colorcolumn=100
let b:undo_ftplugin.='|setlocal colorcolumn<'

View file

@ -1,6 +0,0 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use my desired ALE fixer for JSON
let b:ale_fixers=[ 'jq' ]
let b:undo_ftplugin.='|unlet! b:ale_fixers'

View file

@ -1,10 +1,6 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Let ALE know that I want Markdown linters
let b:ale_linter_aliases=[ 'markdown' ]
let b:undo_ftplugin.='|unlet! b:ale_linter_aliases'
" Use a small indentation value on Pandoc files
setlocal shiftwidth=2
let b:undo_ftplugin.='|setlocal shiftwidth<'

View file

@ -1,40 +0,0 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use my desired ALE fixers for python
let b:ale_fixers=[ 'black', 'isort' ]
let b:undo_ftplugin.='|unlet! b:ale_fixers'
" Use my desired ALE linters for python
let b:ale_linters=[ 'flake8', 'mypy', 'pylint', 'pyls' ]
let b:undo_ftplugin.='|unlet! b:ale_linters'
" Use pyls inside the python environment if needed
let b:ale_python_pyls_auto_pipenv=1
let b:undo_ftplugin.='|unlet! b:ale_python_pyls_auto_pipenv'
" Disable pycodestyle checks from pyls because I'm already using flake8
let b:ale_python_pyls_config={
\ 'pyls': {
\ 'plugins': {
\ 'pycodestyle': {
\ 'enabled': v:false
\ },
\ },
\ },
\ }
let b:undo_ftplugin.='|unlet! b:ale_python_pyls_config'
" Don't use mypy to check for syntax errors
let b:ale_python_mypy_ignore_invalid_syntax=1
let b:undo_ftplugin.='|unlet! b:ale_python_mypy_ignore_invalid_syntax'
" Use mypy inside the python environment if needed
let b:ale_python_mypy_auto_pipenv=1
let b:undo_ftplugin.='|unlet! b:ale_python_mypy_auto_pipenv'
" Automatically format files when saving them
let b:ale_fix_on_save=1
let b:undo_ftplugin='|unlet! b:ale_lint_on_save'
" Change max length of a line to 88 for this buffer to match black's settings
setlocal colorcolumn=88
let b:undo_ftplugin.='|setlocal colorcolumn<'

View file

@ -1,8 +0,0 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use h/l to go to the previous/next non-empty quickfix or location list
nnoremap <silent> <buffer> h :call quickfixed#older()<CR>
let b:undo_ftplugin.='|nunmap <buffer> h'
nnoremap <silent> <buffer> l :call quickfixed#newer()<CR>
let b:undo_ftplugin.='|nunmap <buffer> l'

View file

@ -1,31 +1,6 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Check tests too
let b:ale_rust_cargo_check_tests=1
let b:undo_ftplugin='|unlet! b:ale_rust_cargo_check_tests'
" Check examples too
let b:ale_rust_cargo_check_examples=1
let b:undo_ftplugin='|unlet! b:ale_rust_cargo_check_examples'
" Use clippy if it's available instead of just cargo check
let b:ale_rust_cargo_use_clippy=executable('cargo-clippy')
let b:undo_ftplugin='|unlet! b:ale_rust_cargo_use_clippy'
" Use rust-analyzer instead of RLS as a linter
let b:ale_linters=[ 'cargo', 'analyzer' ]
let b:undo_ftplugin='|unlet! b:ale_linters'
" Use rustfmt as ALE fixer for rust
let b:ale_fixers=[ 'rustfmt' ]
let b:undo_ftplugin.='|unlet! b:ale_fixers'
" Automatically format files when saving them
let b:ale_fix_on_save=1
let b:undo_ftplugin='|unlet! b:ale_lint_on_save'
" Change max length of a line to 99 for this buffer to match official guidelines
setlocal colorcolumn=99
let b:undo_ftplugin.='|setlocal colorcolumn<'

View file

@ -1,14 +0,0 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use shfmt as ALE fixer for sh
let b:ale_fixers=[ 'shfmt' ]
let b:undo_ftplugin.='|unlet! b:ale_fixers'
" Indent with 4 spaces, simplify the code, indent switch cases, use POSIX
let b:ale_sh_shfmt_options='-i 4 -s -ci -ln posix'
let b:undo_ftplugin.='|unlet! b:ale_sh_shfmt_options'
" Require explicit empty string test
let b:ale_sh_shellcheck_options='-o avoid-nullary-conditions'
let b:undo_ftplugin.='|unlet! b:ale_sh_shellcheck_options'

View file

@ -1,14 +0,0 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use shfmt as ALE fixer for zsh
let b:ale_fixers=[ 'shfmt' ]
let b:undo_ftplugin.='|unlet! b:ale_fixers'
" Indent with 4 spaces, simplify script, indent switch cases, use Bash variant
let b:ale_sh_shfmt_options='-i 4 -s -ci -ln bash'
let b:undo_ftplugin.='|unlet! b:ale_sh_shfmt_options'
" Use bash dialect explicitly, require explicit empty string test
let b:ale_sh_shellcheck_options='-s bash -o avoid-nullary-conditions'
let b:undo_ftplugin.='|unlet! b:ale_sh_shellcheck_options'

View file

@ -1,2 +0,0 @@
" Use ALE LSP-powered symbol information
nnoremap <Leader>K :ALEHover<CR>

View file

@ -0,0 +1,12 @@
lua << EOF
local wk = require("which-key")
local keys = {
name = "Comment/uncomment",
c = "Current line",
u = "Uncomment the current and adjacent commented lines",
["gc"] = "Uncomment the current and adjacent commented lines",
}
wk.register(keys, { prefix = "gc" })
EOF

View file

@ -1,10 +0,0 @@
" Visual bindings for merging diffs as in normal mode
xnoremap dp :diffput<cr>
xnoremap do :diffget<cr>
" Open status window
nnoremap <Leader>gs :Gstatus<CR>
" Open diff view of current buffer: the up/left window is the current index
nnoremap <Leader>gd :Gdiffsplit!<CR>
" Open current file log in new tab, populate its location list with history
nnoremap <Leader>gl :sp<CR><C-w>T:Gllog --follow -- %:p<CR>

View file

@ -1,38 +0,0 @@
" Only git-tracked files, Vim needs to be in a Git repository
nnoremap <Leader>fg :GFiles<CR>
" All files
nnoremap <Leader>ff :Files<CR>
" Currently open buffers
nnoremap <Leader>fb :Buffers<CR>
" Buffer history
nnoremap <Leader>fh :History<CR>
" Tags in buffer
nnoremap <Leader>ft :BTags<CR>
" Tags in all project files
nnoremap <Leader>fT :Tags<CR>
" Snippets for the current fileytpe (using Ultisnips)
nnoremap <Leader>fs :Snippets<CR>
" All available commands
nnoremap <Leader>f: :Commands<CR>
" All commits (using fugitive)
nnoremap <Leader>fc :Commits<CR>
" All commits for the current buffer (using fugitive)
nnoremap <Leader>fC :BCommits<CR>
" Select normal mode mapping by searching for its name
nmap <Leader><Tab> <Plug>(fzf-maps-n)
" Select visual mode mapping by searching for its name
xmap <Leader><Tab> <Plug>(fzf-maps-x)
" Select operator pending mode mapping by searching for its name
omap <Leader><Tab> <Plug>(fzf-maps-o)

View file

@ -1,8 +1,9 @@
" Yank until the end of line with Y, to be more consistent with D and C
nnoremap Y y$
lua << EOF
local wk = require("which-key")
" Run make silently, then skip the 'Press ENTER to continue'
noremap <Leader>m :silent! :make! \| :redraw!<CR>
local keys = {
["<leader>"] = { "<cmd>nohls<CR>", "Clear search highlight" },
}
" Remove search-highlighting
noremap <Leader><Leader> :nohls<CR>
wk.register(keys, { prefix = "<leader>" })
EOF

View file

@ -1,11 +0,0 @@
" Next and previous in quick-fix list
nmap <Leader>fn <Plug>(qf_qf_next)
nmap <Leader>fp <Plug>(qf_qf_previous)
" Next and previous in location list
nmap <Leader>ln <Plug>(qf_loc_next)
nmap <Leader>lp <Plug>(qf_loc_previous)
" Toggle quick-fix and location lists
nmap <Leader>tf <Plug>(qf_qf_toggle)
nmap <Leader>tl <Plug>(qf_loc_toggle)

View file

@ -0,0 +1,20 @@
lua << EOF
local wk = require("which-key")
local telescope = require("telescope")
local telescope_builtin = require("telescope.builtin")
local keys = {
f = {
name = "Fuzzy finder",
b = { telescope_builtin.buffers, "Open buffers" },
f = { telescope_builtin.git_files, "Git tracked files" },
F = { telescope_builtin.find_files, "Files" },
g = { telescope_builtin.live_grep, "Grep string" },
G = { telescope_builtin.grep_string, "Grep string under cursor" },
n = { telescope.extensions.notify.notify, "Notification history" },
},
}
wk.register(keys, { prefix = "<leader>" })
EOF

View file

@ -0,0 +1,32 @@
lua << EOF
local wk = require("which-key")
local motions = {
["]m"] = "Next method start",
["]M"] = "Next method end",
["]S"] = "Next statement start",
["]]"] = "Next class start",
["]["] = "Next class end",
["[m"] = "Previous method start",
["[M"] = "Previous method end",
["[S"] = "Previous statement start",
["[["] = "Previous class start",
["[]"] = "Previous class end",
}
local objects = {
["aa"] = "a parameter",
["ia"] = "inner parameter",
["ab"] = "a block",
["ib"] = "inner block",
["ac"] = "a class",
["ic"] = "inner class",
["af"] = "a function",
["if"] = "inner function",
["ak"] = "a comment",
["aS"] = "a statement",
}
wk.register(motions, { mode = "n" })
wk.register(objects, { mode = "o" })
EOF

View file

@ -1,7 +1,125 @@
" Better fr layout mappings for vim-unimpaired and other '[' and ']' commands
nmap ( [
nmap ) ]
omap ( [
omap ) ]
xmap ( [
xmap ) ]
lua << EOF
local wk = require("which-key")
local keys = {
-- Edition and navigation mappins
["["] = {
name = "Previous",
["<space>"] = "Insert blank line above",
["<C-L>"] = "Previous location list file",
["<C-Q>"] = "Previous quickfix list file",
["<C-T>"] = "Previous tag in preview window",
a = "Previous argument",
A = "First argument",
b = "Previous buffer",
B = "First buffer",
e = "Exchange previous line",
f = "Previous file in directory",
l = "Previous location list entry",
L = "First Location list entry",
n = "Previous conflict marker/diff hunk",
p = "Paste line above",
P = "Paste line above",
q = "Previous quickfix list entry",
Q = "First quickfix list entry",
t = "Previous matching tag",
T = "First matching tag",
z = "Previous fold",
-- Encoding
C = "C string encode",
u = "URL encode",
x = "XML encode",
y = "C string encode",
-- Custom
d = { vim.diagnostic.goto_prev, "Previous diagnostic" }
},
["]"] = {
name = "Next",
["<space>"] = "Insert blank line below",
["<C-L>"] = "Next location list file",
["<C-Q>"] = "Next quickfix list file",
["<C-T>"] = "Next tag in preview window",
a = "Next argument",
A = "Last argument",
b = "Next buffer",
B = "Last buffer",
e = "Exchange next line",
f = "Next file in directory",
l = "Next location list entry",
L = "Last Location list entry",
n = "Next conflict marker/diff hunk",
p = "Paste line below",
P = "Paste line below",
q = "Next quickfix list entry",
Q = "Last quickfix list entry",
t = "Next matching tag",
T = "Last matching tag",
z = "Next fold",
-- Decoding
C = "C string decode",
u = "URL decode",
x = "XML decode",
y = "C string decode",
-- Custom
d = { vim.diagnostic.goto_next, "Next diagnostic" }
},
-- Option mappings
["[o"] = {
name = "Enable option",
b = "Light background",
c = "Cursor line",
d = "Diff",
e = { "<cmd>lwindow<CR>", "Location list" },
f = { "<cmd>cwindow<CR>", "Quickfix list" },
h = "Search high-lighting",
i = "Case insensitive search",
l = "List mode",
n = "Line numbers",
r = "Relative line numbers",
u = "Cursor column",
v = "Virtual editing",
w = "Text wrapping",
x = "Cursor line and column",
z = "Spell checking",
},
["]o"] = {
name = "Option off",
b = "Light background",
c = "Cursor line",
d = "Diff",
e = { "<cmd>lclose<CR>", "Location list" },
f = { "<cmd>cclose<CR>", "Quickfix list" },
h = "Search high-lighting",
i = "Case insensitive search",
l = "List mode",
n = "Line numbers",
r = "Relative line numbers",
u = "Cursor column",
v = "Virtual editing",
w = "Text wrapping",
x = "Cursor line and column",
z = "Spell checking",
},
["yo"] = {
name = "Option toggle",
b = "Light background",
c = "Cursor line",
d = "Diff",
e = { "<Plug>(qf_loc_toggle)", "Location list" },
f = { "<Plug>(qf_qf_toggle)", "Quickfix list" },
h = "Search high-lighting",
i = "Case insensitive search",
l = "List mode",
n = "Line numbers",
r = "Relative line numbers",
u = "Cursor column",
v = "Virtual editing",
w = "Text wrapping",
x = "Cursor line and column",
z = "Spell checking",
},
}
wk.register(keys)
EOF

View file

@ -1,68 +0,0 @@
" Taken from the Vimways article
function! s:isLocation()
" Get dictionary of properties of the current window
let wininfo = filter(getwininfo(), {i,v -> v.winnr == winnr()})[0]
return wininfo.loclist
endfunction
function! s:length()
" Get the size of the current quickfix/location list
return len(s:isLocation() ? getloclist(0) : getqflist())
endfunction
function! s:getProperty(key, ...)
" getqflist() and getloclist() expect a dictionary argument
" If a 2nd argument has been passed in, use it as the value, else 0
let l:what = {a:key : a:0 ? a:1 : 0}
let l:listdict = s:isLocation() ? getloclist(0, l:what) : getqflist(l:what)
return get(l:listdict, a:key)
endfunction
function! s:isFirst()
return s:getProperty('nr') <= 1
endfunction
function! s:isLast()
return s:getProperty('nr') == s:getProperty('nr', '$')
endfunction
function! s:history(goNewer)
" Build the command: one of colder/cnewer/lolder/lnewer
let l:cmd = (s:isLocation() ? 'l' : 'c') . (a:goNewer ? 'newer' : 'older')
" Apply the cmd repeatedly until we hit a non-empty list, or first/last list
" is reached
while 1
if (a:goNewer && s:isLast()) || (!a:goNewer && s:isFirst()) | break | endif
" Run the command. Use :silent to suppress message-history output.
" Note that the :try wrapper is no longer necessary
silent execute l:cmd
if s:length() | break | endif
endwhile
" Echo a description of the new quickfix / location list.
" And make it look like a rainbow.
let l:nr = s:getProperty('nr')
let l:last = s:getProperty('nr', '$')
echohl MoreMsg | echon '('
echohl Identifier | echon l:nr
if l:last > 1
echohl LineNr | echon ' of '
echohl Identifier | echon l:last
endif
echohl MoreMsg | echon ') '
echohl MoreMsg | echon '['
echohl Identifier | echon s:length()
echohl MoreMsg | echon '] '
echohl Normal | echon s:getProperty('title')
echohl None
endfunction
function! quickfixed#older()
call s:history(0)
endfunction
function! quickfixed#newer()
call s:history(1)
endfunction

View file

@ -13,6 +13,7 @@ let
"after"
"autoload"
"ftdetect"
"lua"
"plugin"
];
in
@ -30,11 +31,9 @@ in
plugins = with pkgs.vimPlugins; [
# Theming
lightline-vim # Fancy status bar
{
plugin = onedark-vim; # Nice dark theme
optional = true; # Needs to be `packadd`-ed manually...
}
vim-gruvbox8 # Nice dark theme
lualine-nvim # A lua-based status line
lualine-lsp-progress # Show progress for LSP servers
# tpope essentials
vim-commentary # Easy comments
@ -57,20 +56,53 @@ in
vim-toml
# General enhancements
fastfold # Better folding
vim-qf # Better quick-fix list
# Other wrappers
fzfWrapper # The vim plugin inside the 'fzf' package
fzf-vim # Fuzzy commands
git-messenger-vim # A simple blame window
# LSP and linting
ale # Asynchronous Linting Engine
lightline-ale # Status bar integration
lsp_lines-nvim # Show diagnostics *over* regions
null-ls-nvim # LSP integration for linters and formatters
(nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars)) # Better highlighting
nvim-treesitter-textobjects # More textobjects
nvim-ts-context-commentstring # Comment string in nested language blocks
plenary-nvim # 'null-ls', 'telescope' dependency
# Completion
nvim-cmp # Completion engine
cmp-buffer # Words from open buffers
cmp-nvim-lsp # LSP suggestions
cmp-nvim-lua # NeoVim lua API
cmp-path # Path name suggestions
cmp-under-comparator # Sort items that start with '_' lower
friendly-snippets # LSP snippets collection
luasnip # Snippet manager compatible with LSP
# UX improvements
dressing-nvim # Integrate native UI hooks with Telescope etc...
gitsigns-nvim # Fast git UI integration
nvim-notify # Better notification API
telescope-fzf-native-nvim # Use 'fzf' fuzzy matching algorithm
telescope-lsp-handlers-nvim # Use 'telescope' for various LSP actions
telescope-nvim # Fuzzy finder interface
which-key-nvim # Show available mappings
];
extraConfig = builtins.readFile ./init.vim;
# Linters, formatters, etc...
extraPackages = with pkgs; [
# C/C++
clang-tools
# Nix
nixpkgs-fmt
# Shell
shellcheck
shfmt
];
};
config.xdg.configFile = lib.mkIf cfg.enable configFiles;

View file

@ -13,6 +13,13 @@ set wildmenu
" Enable syntax high-lighting and file-type specific plugins
syntax on
filetype plugin indent on
" Map leader to space (needs the noremap trick to avoid moving the cursor)
nnoremap <Space> <Nop>
let mapleader=" "
" Map localleader to '!' (if I want to filter text, I use visual mode)
let maplocalleader="!"
" }}}
" Indentation configuration {{{
@ -65,13 +72,18 @@ set lazyredraw
" Timeout quickly on shortcuts, I can't wait two seconds to delete in visual
set timeoutlen=500
" Timeout quickly for CursorHold events (and also swap file)
set updatetime=250
" Set dark mode by default
set background=dark
" Load it manually because of autoload functions...
packadd! onedark-vim
" Use onedark
colorscheme onedark
" Include plug-in integration
let g:gruvbox_plugin_hi_groups=1
" Include filetype integration
let g:gruvbox_filetype_hi_groups=1
" Use my preferred colorscheme
colorscheme gruvbox8
" }}}
" Search parameters {{{

View file

@ -0,0 +1,83 @@
local M = {}
-- shared LSP configuration callback
-- @param client native client configuration
-- @param bufnr int? buffer number of the attched client
M.on_attach = function(client, bufnr)
-- Diagnostics
vim.diagnostic.config({
-- Disable virtual test next to affected regions
virtual_text = false,
-- Show diagnostics signs
signs = true,
-- Underline offending regions
underline = true,
-- Do not bother me in the middle of insertion
update_in_insert = false,
-- Show highest severity first
severity_sort = true,
})
vim.cmd([[
augroup DiagnosticsHover
autocmd! * <buffer>
" Show diagnostics on "hover"
autocmd CursorHold,CursorHoldI <buffer> lua vim.diagnostic.open_float(nil, {focus=false, scope="cursor"})
augroup END
]])
-- Format on save
if client.resolved_capabilities.document_formatting then
vim.cmd([[
augroup LspFormatting
autocmd! * <buffer>
autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()
augroup END
]])
end
-- Mappings
local wk = require("which-key")
local function list_workspace_folders()
local utils = require("ambroisie.utils")
utils.dump(vim.lsp.buf.list_workspace_folders())
end
local function show_line_diagnostics()
vim.diagnostic.open_float(nil, { scope="line" })
end
local function show_buffer_diagnostics()
vim.diagnostic.open_float(nil, { scope="buffer" })
end
local keys = {
K = { vim.lsp.buf.hover, "Show symbol information" },
["gd"] = { vim.lsp.buf.definition, "Go to definition" },
["gD"] = { vim.lsp.buf.declaration, "Go to declaration" },
["gi"] = { vim.lsp.buf.implementation, "Go to implementation" },
["gr"] = { vim.lsp.buf.references, "List all references" },
["<leader>c"] = {
name = "Code",
a = { vim.lsp.buf.code_action, "Code actions" },
d = { show_line_diagnostics, "Show line diagnostics" },
D = { show_buffer_diagnostics, "Show buffer diagnostics" },
r = { vim.lsp.buf.rename, "Rename symbol" },
s = { vim.lsp.buf.signature_help, "Show signature" },
t = { vim.lsp.buf.type_definition, "Go to type definition" },
w = {
name = "Workspace",
a = { vim.lsp.buf.add_workspace_folder, "Add folder to workspace" },
l = { list_workspace_folders, "List folders in workspace" },
r = { vim.lsp.buf.remove_workspace_folder, "Remove folder from workspace" },
},
},
}
wk.register(keys, { buffer = bufnr })
end
return M

View file

@ -0,0 +1,37 @@
local M = {}
-- pretty print lua object
-- @param obj any object to pretty print
M.dump = function(obj)
print(vim.inspect(obj))
end
--- checks if a given command is executable
---@param cmd string? command to check
---@return boolean executable
M.is_executable = function(cmd)
return cmd and vim.fn.executable(cmd) == 1
end
--- return a function that checks if a given command is executable
---@param cmd string? command to check
---@return fun(cmd: string): boolean executable
M.is_executable_condition = function(cmd)
return function() return M.is_executable(cmd) end
end
-- list all active LSP clients for current buffer
-- @param bufnr int? buffer number
-- @return table all active LSP client names
M.list_lsp_clients = function(bufnr)
local clients = vim.lsp.buf_get_clients(bufnr)
local names = {}
for _, client in ipairs(clients) do
table.insert(names, client.name)
end
return names
end
return M

View file

@ -1,6 +0,0 @@
" Map leader to space (needs the noremap trick to avoid moving the cursor)
nnoremap <Space> <Nop>
let mapleader=" "
" Map localleader to '!' (if I want to filter text, I use visual mode)
let maplocalleader="!"

View file

@ -1,24 +0,0 @@
" Always display the sign column to avoid moving the buffer all the time
let g:ale_sign_column_always=1
" Change the way ALE display messages
let g:ale_echo_msg_info_str='I'
let g:ale_echo_msg_warning_str='W'
let g:ale_echo_msg_error_str='E'
" The message displayed in the command line area
let g:ale_echo_msg_format='[%linter%][%severity%]%(code):% %s'
" The message displayed in the location list
let g:ale_loclist_msg_format='[%linter%]%(code):% %s'
" Don't lint every time I change the buffer
let g:ale_lint_on_text_changed=0
" Don't lint on leaving insert mode
let g:ale_lint_on_insert_leave=0
" Don't lint on entering a buffer
let g:ale_lint_on_enter=0
" Do lint on save
let g:ale_lint_on_save=1
" Lint on changing the filetype
let g:ale_lint_on_filetype_changed=1

View file

@ -0,0 +1,61 @@
" Show completion menu in all cases, and don't select anything
set completeopt=menu,menuone,noselect
lua << EOF
local cmp = require("cmp")
local cmp_under_comparator = require("cmp-under-comparator")
local luasnip = require("luasnip")
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = {
["<Tab>"] = function(fallback)
if luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end,
["<S-Tab>"] = function(fallback)
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end,
["<C-n>"] = cmp.mapping(cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), { "i", "c" }),
["<C-p>"] = cmp.mapping(cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), { "i", "c" }),
["<C-d>"] = cmp.mapping.scroll_docs(-5),
["<C-f>"] = cmp.mapping.scroll_docs(5),
["<C-y>"] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = false }),
["<C-e>"] = cmp.mapping.abort(),
},
view = {
entries = "native",
},
sources = {
{ name = "path", priority_weight = 110 },
{ name = "nvim_lsp", priority_weight = 100 },
{ name = "nvim_lua", priority_weight = 90 },
{ name = "luasnip", priority_weight = 80 },
{ name = "buffer", max_item_count = 5, priority_weight = 50 },
},
sorting = {
priority_weight = 100,
comparators = {
cmp.config.compare.offset,
cmp.config.compare.exact,
cmp.config.compare.score,
cmp_under_comparator.under,
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order,
},
},
})
EOF

View file

@ -0,0 +1,8 @@
lua << EOF
local dressing = require("dressing")
dressing.setup({
-- Use a relative prompt size
prefer_width = 0.4,
})
EOF

View file

@ -1,8 +0,0 @@
" Use a floating window when availble
if has('nvim-0.4.0') || has("patch-8.2.0191")
let g:fzf_layout = { 'window': {
\ 'width': 0.9,
\ 'height': 0.7,
\ 'highlight': 'Comment',
\ 'rounded': v:false } }
endif

View file

@ -0,0 +1,66 @@
lua << EOF
local gitsigns = require('gitsigns')
gitsigns.setup({
-- I dislike the full-green sign column when this happens
attach_to_untracked = false,
current_line_blame_opts = {
-- Show the blame quickly
delay = 100,
},
on_attach = function(bufnr)
local wk = require("which-key")
local keys = {
-- Navigation
["[c"] = { "&diff ? '[c' : '<cmd>Gitsigns prev_hunk<CR>'", "Previous hunk/diff", expr = true },
["]c"] = { "&diff ? ']c' : '<cmd>Gitsigns next_hunk<CR>'", "Next hunk/diff", expr = true },
-- Commands
["<leader>g"] = {
name = "Git",
-- Actions
b = { gitsigns.toggle_current_line_blame, "Toggle blame virtual text" },
d = { gitsigns.diffthis, "Diff buffer" },
D = { function() gitsigns.diffthis("~") end, "Diff buffer against last commit" },
g = { "<cmd>Git<CR>", "Git status" },
h = { gitsigns.toggle_deleted, "Show deleted hunks" },
L = { "<cmd>:sp<CR><C-w>T:Gllog --follow -- %:p<CR>", "Current buffer log" },
m = { "<Plug>(git-messenger)", "Current line blame" },
p = { gitsigns.preview_hunk, "Preview hunk" },
r = { gitsigns.reset_hunk, "Restore hunk" },
R = { gitsigns.reset_buffer, "Restore buffer" },
s = { gitsigns.stage_hunk, "Stage hunk" },
S = { gitsigns.stage_buffer, "Stage buffer" },
u = { gitsigns.undo_stage_hunk, "Undo stage hunk" },
["["] = { gitsigns.prev_hunk, "Previous hunk" },
["]"] = { gitsigns.next_hunk, "Next hunk" },
},
}
local objects = {
["ih"] = { gitsigns.select_hunk, "Git hunk" },
}
local visual = {
["ih"] = { gitsigns.select_hunk, "Git hunk" },
-- Only the actual command can make use of the visual selection...
["<leader>g"] = {
name = "Git",
p = { ":Gitsigns preview_hunk<CR>", "Preview selection" },
r = { ":Gitsigns reset_hunk<CR>", "Restore selection" },
s = { ":Gitsigns stage_hunk<CR>", "Stage selection" },
u = { ":Gitsigns undo_stage_hunk<CR>", "Undo stage selection" },
},
}
wk.register(keys, { buffer = bufnr })
wk.register(objects, { buffer = bufnr, mode = "o" })
wk.register(visual, { buffer = bufnr, mode = "x" })
end,
})
EOF

View file

@ -1,5 +0,0 @@
" Use the high-contrast theme
let g:gruvbox_contrast_dark='hard'
" Enable italics because urxvt supports them
let g:gruvbox_italic=1

View file

@ -1,81 +0,0 @@
" Initialise light-line setting structure
let g:lightline={}
" Use the wombat colorscheme
let g:lightline.colorscheme='onedark'
" Status-line for active buffer
let g:lightline.active={
\ 'left': [
\ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ],
\ [ 'spell' ],
\ ],
\ 'right': [
\ [ 'lineinfo' ],
\ [ 'percent' ],
\ [ 'fileformat', 'fileencoding', 'filetype' ],
\ [ 'linter_check', 'linter_errors', 'linter_warn', 'linter_ok' ],
\ [ 'ctags_status' ],
\ ]
\ }
" Status-line for inactive buffer
let g:lightline.inactive={
\ 'left': [
\ [ 'filename' ],
\ ],
\ 'right': [
\ [ 'lineinfo' ],
\ [ 'percent' ],
\ ],
\ }
" Which component should be written using which function
let g:lightline.component_function={
\ 'readonly': 'LightlineReadonly',
\ 'modified': 'LightlineModified',
\ 'gitbranch': 'LightlineFugitive',
\ }
" Which component can be expanded by using which function
let g:lightline.component_expand={
\ 'linter_check': 'lightline#ale#checking',
\ 'linter_warn': 'lightline#ale#warnings',
\ 'linter_errors': 'lightline#ale#errors',
\ 'linter_ok': 'lightline#ale#ok',
\ }
" How to color custom components
let g:lightline.component_type={
\ 'readonly': 'error',
\ 'linter_checking': 'left',
\ 'linter_warn': 'warning',
\ 'linter_errors': 'error',
\ 'linter_ok': 'left',
\ }
" Show pretty icons instead of text for linting status
let g:lightline#ale#indicator_checking='⏳'
let g:lightline#ale#indicator_warnings='◆'
let g:lightline#ale#indicator_errors='✗'
let g:lightline#ale#indicator_ok='✓'
" Show a lock icon when editing a read-only file when it makes sense
function! LightlineReadonly()
return &ft!~?'help\|vimfiler\|netrw' && &readonly ? '' : ''
endfunction
" Show a '+' when the buffer is modified, '-' if not, when it makes sense
function! LightlineModified()
return &ft=~'help\|vimfiler\|netrw' ? '' : &modified ? '+' : &modifiable ? '' : '-'
endfunction
" Show branch name with nice icon in status line, when it makes sense
function! LightlineFugitive()
if &ft!~?'help\|vimfiler\|netrw' && exists('*fugitive#head')
let branch=fugitive#head()
return branch!=#'' ? ' '.branch : ''
endif
return ''
endfunction

View file

@ -0,0 +1,41 @@
lua << EOF
local lspconfig = require("lspconfig")
local lsp = require("ambroisie.lsp")
local utils = require("ambroisie.utils")
-- Inform servers we are able to do completion, snippets, etc...
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
-- C/C++
if utils.is_executable("clangd") then
lspconfig.clangd.setup({
capabilities = capabilities,
on_attach = lsp.on_attach,
})
end
-- Nix
if utils.is_executable("rnix-lsp") then
lspconfig.rnix.setup({
capabilities = capabilities,
on_attach = lsp.on_attach,
})
end
-- Python
if utils.is_executable("pyright") then
lspconfig.pyright.setup({
capabilities = capabilities,
on_attach = lsp.on_attach,
})
end
-- Rust
if utils.is_executable("rust-analyzer") then
lspconfig.rust_analyzer.setup({
capabilities = capabilities,
on_attach = lsp.on_attach,
})
end
EOF

View file

@ -0,0 +1,63 @@
lua << EOF
local lualine = require("lualine")
local utils = require("ambroisie.utils")
local function list_spell_languages()
if not vim.opt.spell:get() then
return ""
end
return table.concat(vim.opt.spelllang:get(), ", ")
end
local function list_lsp_clients()
local client_names = utils.list_lsp_clients()
if #client_names == 0 then
return ""
end
return "[ " .. table.concat(client_names, " ") .. " ]"
end
lualine.setup({
options = {
icons_enabled = false,
section_separators = "",
component_separators = "|",
},
sections = {
lualine_a = {
{ "mode" },
},
lualine_b = {
{ "branch" },
{ "filename", symbols = { readonly = "🔒" } },
},
lualine_c = {
{ list_spell_languages },
{ "lsp_progress" },
},
lualine_x = {
{ list_lsp_clients },
{
"diagnostics",
-- Only use the diagnostics API
sources = { "nvim_diagnostic" },
},
},
lualine_y = {
{ "fileformat" },
{ "encoding" },
{ "filetype" },
},
lualine_z = {
"location",
},
},
extensions = {
"fugitive",
"quickfix",
},
})
EOF

View file

@ -0,0 +1,3 @@
lua << EOF
require("luasnip.loaders.from_vscode").load()
EOF

View file

@ -0,0 +1,9 @@
lua << EOF
local notify = require("notify")
notify.setup({
stages = "slide",
})
vim.notify = notify
EOF

View file

@ -0,0 +1,119 @@
lua << EOF
local null_ls = require("null-ls")
local lsp = require("ambroisie.lsp")
local utils = require("ambroisie.utils")
null_ls.setup({
on_attach = lsp.on_attach,
})
-- C, C++
null_ls.register({
null_ls.builtins.formatting.clang_format.with({
-- Only used if available, but prefer clangd formatting if available
condition = function()
return utils.is_executable("clang-format") and not utils.is_executable("clangd")
end,
}),
})
-- Haskell
null_ls.register({
null_ls.builtins.formatting.brittany.with({
-- Only used if available
condition = utils.is_executable_condition("brittany"),
}),
})
-- Nix
null_ls.register({
null_ls.builtins.formatting.nixpkgs_fmt.with({
-- Only used if available, but prefer rnix if available
condition = function()
return utils.is_executable("nixpkgs-fmt") and not utils.is_executable("rnix-lsp")
end,
}),
})
-- Python
null_ls.register({
null_ls.builtins.diagnostics.flake8.with({
-- Only used if available
condition = utils.is_executable_condition("flake8"),
}),
null_ls.builtins.diagnostics.mypy.with({
-- Only used if available
condition = utils.is_executable_condition("mypy"),
}),
null_ls.builtins.diagnostics.pylint.with({
-- Only used if available
condition = utils.is_executable_condition("pylint"),
}),
null_ls.builtins.formatting.black.with({
extra_args = { "--fast" },
-- Only used if available
condition = utils.is_executable_condition("black"),
}),
null_ls.builtins.formatting.isort.with({
-- Only used if available
condition = utils.is_executable_condition("isort"),
}),
})
-- Shell (non-POSIX)
null_ls.register({
null_ls.builtins.code_actions.shellcheck.with({
-- Restrict to bash and zsh
filetypes = { "bash", "zsh" },
-- Only used if available
condition = utils.is_executable_condition("shellcheck"),
}),
null_ls.builtins.diagnostics.shellcheck.with({
-- Show error code in message
diagnostics_format = "[#{c}] #{m}",
-- Require explicit empty string test, use bash dialect
extra_args = { "-s", "bash", "-o", "avoid-nullary-conditions" },
-- Restrict to bash and zsh
filetypes = { "bash", "zsh" },
-- Only used if available
condition = utils.is_executable_condition("shellcheck"),
}),
null_ls.builtins.formatting.shfmt.with({
-- Indent with 4 spaces, simplify the code, indent switch cases,
-- add space after redirection, use bash dialect
extra_args = { "-i", "4", "-s", "-ci", "-sr", "-ln", "bash" },
-- Restrict to bash and zsh
filetypes = { "bash", "zsh" },
-- Only used if available
condition = utils.is_executable_condition("shfmt"),
}),
})
-- Shell (POSIX)
null_ls.register({
null_ls.builtins.code_actions.shellcheck.with({
-- Restrict to POSIX sh
filetypes = { "sh" },
-- Only used if available
condition = utils.is_executable_condition("shellcheck"),
}),
null_ls.builtins.diagnostics.shellcheck.with({
-- Show error code in message
diagnostics_format = "[#{c}] #{m}",
-- Require explicit empty string test
extra_args = { "-o", "avoid-nullary-conditions" },
-- Restrict to POSIX sh
filetypes = { "sh" },
-- Only used if available
condition = utils.is_executable_condition("shellcheck"),
}),
null_ls.builtins.formatting.shfmt.with({
-- Indent with 4 spaces, simplify the code, indent switch cases,
-- add space after redirection, use POSIX
extra_args = { "-i", "4", "-s", "-ci", "-sr", "-ln", "posix" },
-- Only used if available
condition = utils.is_executable_condition("shfmt"),
}),
})
EOF

View file

@ -0,0 +1,18 @@
lua << EOF
local telescope = require("telescope")
telescope.setup({
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
},
},
})
telescope.load_extension("fzf")
telescope.load_extension("lsp_handlers")
telescope.load_extension("notify")
EOF

View file

@ -0,0 +1,58 @@
lua << EOF
local ts_config = require("nvim-treesitter.configs")
ts_config.setup({
highlight = {
enable = true,
-- Avoid duplicate highlighting
additional_vim_regex_highlighting = false,
},
indent = {
enable = true,
},
context_commentstring = {
enable = true,
},
textobjects = {
select = {
enable = true,
-- Jump to matching text objects
lookahead = true,
keymaps = {
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
["ab"] = "@block.outer",
["ib"] = "@block.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["af"] = "@function.outer",
["if"] = "@function.inner",
["ak"] = "@comment.outer",
["aS"] = "@statement.outer",
},
},
move = {
enable = true,
-- Add to jump list
set_jumps = true,
goto_next_start = {
["]m"] = "@function.outer",
["]S"] = "@statement.outer",
["]]"] = "@class.outer",
},
goto_next_end = {
["]M"] = "@function.outer",
["]["] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[S"] = "@statement.outer",
["[["] = "@class.outer",
},
goto_previous_end = {
["[M"] = "@function.outer",
["[]"] = "@class.outer",
},
},
},
})
EOF

View file

@ -0,0 +1,4 @@
lua << EOF
local wk = require("which-key")
wk.setup()
EOF

87
home/wm/default.nix Normal file
View file

@ -0,0 +1,87 @@
{ config, lib, pkgs, ... }:
let
mkRelatedOption = description: relatedWMs:
let
isActivatedWm = wm: config.my.home.wm.windowManager == wm;
in
(lib.mkEnableOption description) // {
default = builtins.any isActivatedWm relatedWMs;
};
in
{
imports = [
./dunst
./i3
./i3bar
./rofi
./screen-lock
];
options.my.home.wm = with lib; {
windowManager = mkOption {
type = with types; nullOr (enum [ "i3" ]);
default = null;
example = "i3";
description = "Which window manager to use for home session";
};
dunst = {
enable = mkRelatedOption "dunst configuration" [ "i3" ];
};
i3bar = {
enable = mkRelatedOption "i3bar configuration" [ "i3" ];
};
rofi = {
enable = mkRelatedOption "rofi menu" [ "i3" ];
};
screen-lock = {
enable = mkRelatedOption "automatic X screen locker" [ "i3" ];
command = mkOption {
type = types.str;
default = "${pkgs.i3lock}/bin/i3lock -n -c 000000";
example = "\${pkgs.i3lock}/bin/i3lock -n -i lock.png";
description = "Locker command to run";
};
cornerLock = {
enable = my.mkDisableOption ''
Move mouse to upper-left corner to lock instantly, lower-right corner to
disable auto-lock.
'';
delay = mkOption {
type = types.int;
default = 5;
example = 15;
description = "How many seconds before locking this way";
};
};
notify = {
enable = my.mkDisableOption "Notify when about to lock the screen";
delay = mkOption {
type = types.int;
default = 5;
example = 15;
description = ''
How many seconds in advance should there be a notification.
This value must be at lesser than or equal to `cornerLock.delay`
when both options are enabled.
'';
};
};
timeout = mkOption {
type = types.ints.between 1 60;
default = 15;
example = 1;
description = "Inactive time interval to lock the screen automatically";
};
};
};
}

73
home/wm/dunst/default.nix Normal file
View file

@ -0,0 +1,73 @@
{ config, lib, ... }:
let
cfg = config.my.home.wm.dunst;
in
{
config = lib.mkIf cfg.enable {
services.dunst = {
enable = true;
settings = {
global = {
alignment = "center"; # Put message in the middle of the box
browser = "xdg-open"; # use default browser to open links
dmenu =
lib.mkIf
config.my.home.wm.rofi.enable
"rofi -p dunst -dmenu"; # use rofi for menu
follow = "keyboard"; # follow keyboard focus
font = "Monospace 8"; # Simple looking font
frame_width = 3; # small frame
markup = "full"; # subset of HTML
max_icon_size = 32; # avoid icons that are too big
padding = 6; # distance between text and bubble border
progress_bar = true; # show a progress bar in notification bubbles
separator_color = "frame"; # use frame color to separate bubbles
sort = true; # sort messages by urgency
word_wrap = true; # Break long lines to make them readable
# Fixed size notifications, slightly recessed from the top right
width = 300;
height = 50;
origin = "top-right";
offset = "15x50";
};
urgency_low = {
background = "#191311";
foreground = "#3b7c87";
frame_color = "#3b7c87";
highlight = "#4998a6";
timeout = 10;
};
urgency_normal = {
background = "#191311";
foreground = "#5b8234";
frame_color = "#5b8234";
highlight = "#73a542";
timeout = 10;
};
urgency_critical = {
background = "#191311";
foreground = "#b7472a";
frame_color = "#b7472a";
highlight = "#d25637";
timeout = 0;
};
fullscreen_delay_everything = {
# delay notifications by default
fullscreen = "delay";
};
fullscreen_show_critical = {
# show critical notification
fullscreen = "show";
msg_urgency = "critical";
};
};
};
};
}

376
home/wm/i3/default.nix Normal file
View file

@ -0,0 +1,376 @@
{ config, lib, pkgs, ... }:
let
isEnabled = config.my.home.wm.windowManager == "i3";
terminal =
if config.my.home.terminal.program != null
then config.my.home.terminal.program
else "i3-sensible-terminal";
alt = "Mod1"; # `Alt` key
modifier = "Mod4"; # `Super` key
movementKeys = [ "Left" "Down" "Up" "Right" ];
vimMovementKeys = [ "h" "j" "k" "l" ];
shutdownMode =
"(l)ock, (e)xit, switch_(u)ser, (h)ibernate, (r)eboot, (Shift+s)hutdown";
# Takes an attrset of bindings for movement keys, transforms it to Vim keys
toVimKeyBindings =
let
toVimKeys = builtins.replaceStrings movementKeys vimMovementKeys;
in
lib.my.renameAttrs toVimKeys;
# Takes an attrset of bindings for movement keys, add equivalent Vim keys
addVimKeyBindings = bindings: bindings // (toVimKeyBindings bindings);
# Generate an attrset of movement bindings, using the mapper function
genMovementBindings = f: addVimKeyBindings (lib.my.genAttrs' movementKeys f);
# Used in multiple scripts to show messages through keybindings
notify-send = "${pkgs.libnotify}/bin/notify-send";
# Screen backlight management
changeBacklight = "${pkgs.ambroisie.change-backlight}/bin/change-backlight";
# Audio and volume management
changeAudio = "${pkgs.ambroisie.change-audio}/bin/change-audio";
# Lock management
toggleXautolock =
let
systemctlUser = "${pkgs.systemd}/bin/systemctl --user";
notify = "${notify-send} -u low"
+ " -h string:x-canonical-private-synchronous:xautolock-toggle";
in
pkgs.writeScript "toggle-xautolock" ''
#!/bin/sh
if ${systemctlUser} is-active xautolock-session.service; then
${systemctlUser} stop --user xautolock-session.service
xset s off
${notify} "Disabled Xautolock"
else
${systemctlUser} start xautolock-session.service
xset s on
${notify} "Enabled Xautolock"
fi
'';
in
{
config = lib.mkIf isEnabled {
home.packages = with pkgs; [
ambroisie.dragger # drag-and-drop from the CLI
ambroisie.i3-get-window-criteria # little helper for i3 configuration
arandr # Used by a mapping
pamixer # Used by a mapping
playerctl # Used by a mapping
];
xsession.windowManager.i3 = {
enable = true;
config = {
inherit modifier;
bars =
let
barConfigPath =
config.xdg.configFile."i3status-rust/config-top.toml".target;
i3status-rs =
"${config.programs.i3status-rust.package}/bin/i3status-rs";
in
[
{
statusCommand = "${i3status-rs} ${barConfigPath}";
trayOutput = "primary";
position = "top";
colors = {
background = "#021215";
statusline = "#93a1a1";
separator = "#2aa198";
focusedWorkspace = {
border = "#2aa198";
background = "#073642";
text = "#eee895";
};
activeWorkspace = {
border = "#073642";
background = "#002b36";
text = "#839496";
};
inactiveWorkspace = {
border = "#002b36";
background = "#021215";
text = "#586e75";
};
urgentWorkspace = {
border = "#cb4b16";
background = "#dc322f";
text = "#fdf6e3";
};
};
fonts = {
names = [ "DejaVu Sans Mono" "FontAwesome5Free" ];
size = 8.0;
};
}
];
floating = {
inherit modifier;
criteria = [
{ class = "^tridactyl_editor$"; }
{ class = "^Blueman-.*$"; }
{ title = "^htop$"; }
{ class = "^Thunderbird$"; instance = "Mailnews"; window_role = "filterlist"; }
{ class = "^Pavucontrol.*$"; }
{ class = "^Arandr$"; }
];
};
focus = {
followMouse = true; # It is annoying sometimes, but useful enough to use
mouseWarping = true; # Let's moving around when switching screens
};
fonts = {
names = [ "DejaVu Sans Mono" ];
size = 8.0;
};
# I don't care for i3's default values, I specify them all explicitly
keybindings = lib.my.recursiveMerge [
{
# The basics
"${modifier}+Return" = "exec ${terminal} ${
lib.optionalString config.my.home.tmux.enable "-e tmux new-session"
}";
"${modifier}+Shift+Return" = "exec env TMUX=nil ${terminal}";
"${modifier}+Shift+q" = "kill";
"${modifier}+f" = "fullscreen toggle";
"${modifier}+Shift+c" = "reload";
"${modifier}+Shift+r" = "restart";
"${modifier}+Shift+e" =
"exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
}
{
# Splits
"${modifier}+g" = "split h"; # Horizontally
"${modifier}+v" = "split v"; # Vertically
}
{
# Layouts
"${modifier}+s" = "layout stacking";
"${modifier}+w" = "layout tabbed";
"${modifier}+e" = "layout toggle split";
}
{
# Toggle tiling/floating
"${modifier}+Control+space" = "floating toggle";
# Change focus between tiling/floating
"${modifier}+space" = "focus mode_toggle";
}
{
# Focus parent container
"${modifier}+q" = "focus parent";
# Focus child container
"${modifier}+a" = "focus child";
}
(lib.optionalAttrs config.my.home.wm.rofi.enable {
# Rofi tools
"${modifier}+d" = "exec rofi -show drun -disable-history";
"${modifier}+Shift+d" = "exec rofi -show run -disable-history";
"${modifier}+p" = "exec --no-startup-id flameshot gui";
"${modifier}+Shift+p" = "exec rofi -show emoji";
"${modifier}+b" =
let
inherit (config.my.home.bluetooth) enable;
prog = "${pkgs.ambroisie.rofi-bluetooth}/bin/rofi-bluetooth";
in
lib.mkIf enable "exec ${prog}";
})
(
# Changing container focus
genMovementBindings (
key: lib.nameValuePair
"${modifier}+${key}"
"focus ${lib.toLower key}"
)
)
(
# Changing screen focus
genMovementBindings (
key: lib.nameValuePair
"${modifier}+${alt}+${key}"
"focus output ${lib.toLower key}"
)
)
(
# Moving workspace to another screen
genMovementBindings (
key: lib.nameValuePair
"${modifier}+${alt}+Control+${key}"
"move workspace to output ${lib.toLower key}"
)
)
(
# Moving container to another screen
genMovementBindings (
key: lib.nameValuePair
"${modifier}+${alt}+Shift+${key}"
"move container to output ${lib.toLower key}"
)
)
(addVimKeyBindings {
# Scroll through workspaces on given screen
"${modifier}+Control+Left" = "workspace prev_on_output";
"${modifier}+Control+Right" = "workspace next_on_output";
# Use scratchpad
"${modifier}+Control+Up" = "move to scratchpad";
"${modifier}+Control+Down" = "scratchpad show";
})
(
# Moving floating window
genMovementBindings (
key: lib.nameValuePair
"${modifier}+Shift+${key}"
"move ${lib.toLower key} 10 px"
)
)
{
# Media keys
"XF86AudioRaiseVolume" = "exec --no-startup-id ${changeAudio} up 5";
"XF86AudioLowerVolume" = "exec --no-startup-id ${changeAudio} down 5";
"Control+XF86AudioRaiseVolume" = "exec --no-startup-id ${changeAudio} up 1";
"Control+XF86AudioLowerVolume" = "exec --no-startup-id ${changeAudio} down 1";
"Shift+XF86AudioRaiseVolume" = "exec --no-startup-id ${changeAudio} up --force 5";
"Shift+XF86AudioLowerVolume" = "exec --no-startup-id ${changeAudio} down --force 5";
"Control+Shift+XF86AudioRaiseVolume" = "exec --no-startup-id ${changeAudio} up --force 1";
"Control+Shift+XF86AudioLowerVolume" = "exec --no-startup-id ${changeAudio} down --force 1";
"XF86AudioMute" = "exec --no-startup-id ${changeAudio} toggle";
"XF86AudioMicMute" = "exec --no-startup-id ${changeAudio} toggle mic";
"XF86AudioPlay" = "exec playerctl play-pause";
"XF86AudioNext" = "exec playerctl next";
"XF86AudioPrev" = "exec playerctl previous";
}
{
# Screen management
"XF86Display" = "exec arandr";
"XF86MonBrightnessUp" = "exec --no-startup-id ${changeBacklight} up 10";
"XF86MonBrightnessDown" = "exec --no-startup-id ${changeBacklight} down 10";
"Control+XF86MonBrightnessUp" = "exec --no-startup-id ${changeBacklight} up 1";
"Control+XF86MonBrightnessDown" = "exec --no-startup-id ${changeBacklight} down 1";
}
{
# Sub-modes
"${modifier}+r" = "mode resize";
"${modifier}+Shift+space" = "mode floating";
}
(lib.optionalAttrs config.my.home.wm.screen-lock.enable {
"${modifier}+x" = "exec ${toggleXautolock}";
})
(
let
execDunstctl = "exec ${pkgs.dunst}/bin/dunstctl";
in
lib.optionalAttrs config.my.home.wm.dunst.enable {
"${modifier}+minus" = "${execDunstctl} close";
"${modifier}+Shift+minus" = "${execDunstctl} close-all";
"${modifier}+equal" = "${execDunstctl} history-pop";
}
)
];
keycodebindings =
let
toKeycode = n: if n == 0 then 19 else n + 9;
createWorkspaceBindings = mapping: command:
let
createWorkspaceBinding = num:
lib.nameValuePair
"${mapping}+${toString (toKeycode num)}"
"${command} ${toString num}";
oneToNine = builtins.genList (x: x + 1) 9;
in
lib.my.genAttrs' oneToNine createWorkspaceBinding;
in
lib.my.recursiveMerge [
(createWorkspaceBindings modifier "workspace number")
(createWorkspaceBindings "${modifier}+Shift" "move container to workspace number")
{
"${modifier}+${toString (toKeycode 0)}" = ''mode "${shutdownMode}"'';
}
];
modes =
let
makeModeBindings = attrs: (addVimKeyBindings attrs) // {
"Escape" = "mode default";
"Return" = "mode default";
};
in
{
resize = makeModeBindings {
# Normal movements
"Left" = "resize shrink width 10 px or 10 ppt";
"Down" = "resize grow height 10 px or 10 ppt";
"Up" = "resize shrink height 10 px or 10 ppt";
"Right" = "resize grow width 10 px or 10 ppt";
# Small movements
"Control+Left" = "resize shrink width 1 px or 1 ppt";
"Control+Down" = "resize grow height 1 px or 1 ppt";
"Control+Up" = "resize shrink height 1 px or 1 ppt";
"Control+Right" = "resize grow width 1 px or 1 ppt";
# Big movements
"Shift+Left" = "resize shrink width 100 px or 100 ppt";
"Shift+Down" = "resize grow height 100 px or 100 ppt";
"Shift+Up" = "resize shrink height 100 px or 100 ppt";
"Shift+Right" = "resize grow width 100 px or 100 ppt";
};
floating = makeModeBindings {
# Normal movements
"Left" = "move left 10 px";
"Down" = "move down 10 px";
"Up" = "move up 10 px";
"Right" = "move right 10 px";
# Small movements
"Control+Left" = "move left 1 px";
"Control+Down" = "move down 1 px";
"Control+Up" = "move up 1 px";
"Control+Right" = "move right 1 px";
# Big movements
"Shift+Left" = "move left 100 px";
"Shift+Down" = "move down 100 px";
"Shift+Up" = "move up 100 px";
"Shift+Right" = "move right 100 px";
};
${shutdownMode} = makeModeBindings {
"l" = "exec --no-startup-id loginctl lock-session, mode default";
"s" = "exec --no-startup-id systemctl suspend, mode default";
"u" = "exec --no-startup-id dm-tool switch-to-greeter, mode default";
"e" = "exec --no-startup-id i3-msg exit, mode default";
"h" = "exec --no-startup-id systemctl hibernate, mode default";
"r" = "exec --no-startup-id systemctl reboot, mode default";
"Shift+s" = "exec --no-startup-id systemctl poweroff, mode default";
};
};
startup = [
# FIXME
# { commdand; always; notification; }
];
};
};
};
}

87
home/wm/i3bar/default.nix Normal file
View file

@ -0,0 +1,87 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.wm.i3bar;
in
{
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
alsaUtils # Used by `sound` block
lm_sensors # Used by `temperature` block
font-awesome # Icon font
];
programs.i3status-rust = {
enable = true;
bars = {
top = {
icons = "awesome5";
blocks = builtins.filter (attr: attr != { }) [
{
block = "music";
buttons = [ "prev" "play" "next" ];
max_width = 50;
dynamic_width = true;
hide_when_empty = true;
}
(lib.optionalAttrs config.my.home.bluetooth.enable {
block = "bluetooth";
mac = "4C:87:5D:06:40:D9";
hide_disconnected = true;
format = "Boson {percentage}";
})
(lib.optionalAttrs config.my.home.bluetooth.enable {
block = "bluetooth";
mac = "94:DB:56:00:EE:93";
hide_disconnected = true;
format = "Protons {percentage}";
})
(lib.optionalAttrs config.my.home.bluetooth.enable {
block = "bluetooth";
mac = "F7:78:BA:76:52:F7";
hide_disconnected = true;
format = "MX Ergo {percentage}";
})
{
block = "cpu";
}
{
block = "disk_space";
}
{
block = "net";
format = "{ssid} {ip} {signal_strength}";
}
{
block = "backlight";
invert_icons = true;
}
{
block = "battery";
format = "{percentage} ({time})";
full_format = "{percentage}";
}
{
block = "temperature";
collapsed = false;
}
{
block = "sound";
device_kind = "source"; # Microphone status
format = ""; # Only show icon
}
{
block = "sound";
show_volume_when_muted = true;
}
{
block = "time";
format = "%F %T";
}
];
};
};
};
};
}

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