feat(nix): add comprehensive nix flake#426
Conversation
|
Hey, thanks! The only thing I can review in this PR is the .gitignore file and it looks good. Everything else is too much nix for me. Maybe @Adda0 can have a look as he is maintaining the nix builds. |
|
Heya. Sure. While I am by no means an expert on the Nix ecosystem, I will have a look. Looks reasonable on a first glance. |
|
Thank you for the reviews and for the development of |
|
I am glad this is getting rid of the |
|
I'm +1 on having support for stable-nix You can still use flake-compat in default.nix and shell.nix like this: https://github.com/vic/den/blob/d114d8b8d0f4c809a7057a7cef35e6d8648dcdaf/nix/template-packages.nix#L5 Just use a fixed rev and sha. |
It is still there, not just in a file which was used to keep track of version changes on a single file. you'd still have to make vendorHash value empty and build to get the new vendored hash when adding dependencies. |
|
Now that we are talking about dependencies, you could also remove |
I was thinking of using mod2nix but it seems a good part of the community has moved to just using buildGoModule. I believe some people said that it was using an old version of go but this could be resolved via an overlay. Open to suggestions. |
|
Using buildGoModule is fine for this repo, it is not a complicated Go compilation setup. Let's keep with standard buildGoModule and avoid adding more dependencies. Our flake could, however, have a tiny package (a This is what I do we could have this script inside the development environment, and it could be run either manually (we could have a simple .bash script doing this) or we could have a GH action that runs |
Wouldn't having the |
scripting to write into the plain-text file might be easier, or use |
Got it; that's a good point and it's nice to have |
|
Thank you for the detailed review @vic, I learned a lot from this! Addressed all PR comments + tested all features locally + edge cases, and now this PR is ready for a final review. |
@idursun would that be of value to you ? if so we maybe @doprz is interested in providing another PR after this one?
yes, same workflow would work with your dockered nix. |
|
Last thing. I used |
Hm, looks like the markdown formatter messed up the issues templates. Can we either skip those files via treefmt config or remove md formatting ? |
|
Don't know how to revert my approval at GH, haha. |
Make another review and select "request changes". |
vic
left a comment
There was a problem hiding this comment.
make sure md files frontmatter are not modified
c530d1d to
f2c548e
Compare
Done. I went with prettier and only for markdown files and it works as expected. It also formatted |
|
I'm not really sure about all the formatting changes, they are not related to the title of this PR. Maybe we could work that on another PR if any. I'd prefer the toml files to be keep as they are, since having spaces aids people visually (and these toml files will also be read by users as reference so we need them to be as understandable and easy to read as possible). Can we keep this PR focused on the nix stuff ? EDIT: we'd also have to assume that Nix is just a convenience here, the main maintainer probably does not know how to run the nix formatters, if he agrees to keep formatters checks in place it'd be better to have a normal treefmt.yaml file and instructions on how to run treefmt outside the nix env. So we can have formatting not only on the nix environment. |
|
Ok. Dropping the formatting commit and commenting out the formatters. Other than that, I think we're done with this PR. |
bf1badd to
f2c548e
Compare
There was a problem hiding this comment.
While I am no expert, @vic most definitely is. ❤️ Amazing work. Not much more to say here. Mostly nits.
However, I feel like this PR should only touch the Nix stuff. Everything else (editorconfig, even nixfmt, formatting) should come with different PRs so @idursun can decide themselves whether they want the changes or not. If all the changes are desired, than I see no problem with the PR.
Highly educational Nix structure, too 👍
f2c548e to
baf85ea
Compare
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [idursun/jjui](https://github.com/idursun/jjui) | patch | `v0.9.8` → `v0.9.9` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>idursun/jjui (idursun/jjui)</summary> ### [`v0.9.9`](https://github.com/idursun/jjui/releases/tag/v0.9.9) [Compare Source](idursun/jjui@v0.9.8...v0.9.9) ### Release Notes Another release with small improvements and bug fixes. Thanks to all contributors! #### 🎉 New Features ##### Custom Commands & Lua API Enhancements - **Custom Commands with Sequence Keys** ([#​420](idursun/jjui#420)) - Added `key_sequence` property allowing custom commands to be invoked with multiple key presses in sequence - Added `desc` property for command descriptions - Introduced sequence overlay UI showing available key sequences when first key is pressed - Example: `key_sequence = ["w", "b", "l"]` - **Lua API: Choose Method and UI** ([#​427](idursun/jjui#427)) ([#​442](idursun/jjui#442)) - New `choose()` function for interactive selection prompts in Lua scripts - New `input()` function to prompt users for text input with customizable title and prompt - New `split_lines()` function for text processing - **Lua API: Await on Operation Results** ([#​422](idursun/jjui#422)) - `start_inline_describe()` now returns boolean indicating if operation was applied or cancelled - Enables conditional command execution based on user actions - Fixes [#​310](idursun/jjui#310) - **Lua API: Interactive Commands** ([commit 8b257263](idursun/jjui@8b257263)) - Added `jj_interactive` Lua function for interactive jj command execution ##### Navigation & UI Improvements - **Ace Jump for Operations** ([#​445](idursun/jjui#445)) - Pressing 'f' in set\_parents/duplicate/rebase/squash modes now triggers ace jump - After jump completes, returns to the original operation mode instead of normal mode - Closes [#​394](idursun/jjui#394) - **Preview Width Variable** ([#​452](idursun/jjui#452)) - Added `$preview_width` placeholder variable for preview commands - Exposes actual view width (in columns) to enable tools like delta to use `--side-by-side` correctly - Width updates dynamically when preview pane is resized - Similar to fzf's `$FZF_PREVIEW_COLUMNS` - **Configurable Flash Message Display Time** ([#​456](idursun/jjui#456)) - New config key: `ui.flash_message_display_seconds` (default: 4) - Special value `0` means messages display until manually dismissed - Fixes [#​455](idursun/jjui#455) - **Page Up/Down Key Configuration** ([#​437](idursun/jjui#437)) - ScrollUp/Down keys now registered in config instead of hardcoded - Keys exposed to configuration for customization - Fixes [#​360](idursun/jjui#360) ##### SSH & Authentication - **SSH Askpass Support** ([#​423](idursun/jjui#423)) - New `[ssh] hijack_askpass` setting to prompt for SSH passphrases/PINs within jjui - Works on Linux and macOS - Properly handles prompt overriding and cancellation - Fixes [#​100](idursun/jjui#100) #### 🐛 Bug Fixes - **Exec Command History** ([#​458](idursun/jjui#458)) - Fixed issue where selected command history wasn't applied in exec mode - Input value now properly updated when selecting from fuzzy/regex suggestions - Selected commands correctly saved to history - **Menu Pagination Display** ([#​446](idursun/jjui#446)) - Fixed incorrect `%d/%d` pagination display - Height now calculated before pagination render - Added tab/shift+tab to short help menu - Fixes [#​444](idursun/jjui#444) - **Flash Message Width** ([#​432](idursun/jjui#432)) - Added maxWidth (50% of screen) to flash message rendering - Messages now properly line-wrap instead of extending beyond window width - **Operation Log Refresh** ([#​431](idursun/jjui#431)) - Operation log now returns Refresh and SelectionChanged messages upon closing - Fixes [#​430](idursun/jjui#430) - **Custom Commands List Sorting** ([commit 3fa9783a](idursun/jjui@3fa9783a)) - Fixed custom commands list to use stable sort - Fixes [#​424](idursun/jjui#424) - **JJ Error Pass-through** ([#​421](idursun/jjui#421)) - jjui now properly passes through stderr from jj commands - Error messages are more informative and show actual jj errors - **Navigation Message Display** ([commit 94a4a874](idursun/jjui@94a4a874)) - Navigation messages now only shown for paged scrolls #### What's Changed - main: pass through jj error by [@​baggiiiie](https://github.com/baggiiiie) in [#​421](idursun/jjui#421) - feat(lua): add ability to await on operation results (cancelled/applied) by [@​idursun](https://github.com/idursun) in [#​422](idursun/jjui#422) - oplog: return Refresh and SelectionChanged upon oplog closing by [@​baggiiiie](https://github.com/baggiiiie) in [#​431](idursun/jjui#431) - feat(nix): add comprehensive nix flake by [@​doprz](https://github.com/doprz) in [#​426](idursun/jjui#426) - Add option to hijack SSH Askpass to prompt for passphrase/pin by [@​oliverpool](https://github.com/oliverpool) in [#​423](idursun/jjui#423) - feat(lua): add choose method and ui by [@​idursun](https://github.com/idursun) in [#​427](idursun/jjui#427) - flash: add maxWidth to flash msg rendering by [@​baggiiiie](https://github.com/baggiiiie) in [#​432](idursun/jjui#432) - keys: add pageup/down to keys config by [@​baggiiiie](https://github.com/baggiiiie) in [#​437](idursun/jjui#437) - chore(github): Add Adda0 as an automatic reviewer for Nix-related changes by [@​Adda0](https://github.com/Adda0) in [#​440](idursun/jjui#440) - feat: add .editorconfig by [@​doprz](https://github.com/doprz) in [#​434](idursun/jjui#434) - Add input and log to custom\_commands API by [@​ArnaudBger](https://github.com/ArnaudBger) in [#​442](idursun/jjui#442) - oplog,list: refactor scrolling with Scrollable/StreamableList interface by [@​baggiiiie](https://github.com/baggiiiie) in [#​429](idursun/jjui#429) - menu: calculate height before pagination render by [@​baggiiiie](https://github.com/baggiiiie) in [#​446](idursun/jjui#446) - operations: enable ace jump for set\_parents/duplicate/rebase/squash by [@​baggiiiie](https://github.com/baggiiiie) in [#​445](idursun/jjui#445) - feat: make flash message display time configurable by [@​living180](https://github.com/living180) in [#​456](idursun/jjui#456) - feat: add $width variable for preview commands by [@​pablospe](https://github.com/pablospe) in [#​452](idursun/jjui#452) - status: fix exec command history not applied by [@​baggiiiie](https://github.com/baggiiiie) in [#​458](idursun/jjui#458) #### New Contributors - [@​doprz](https://github.com/doprz) made their first contribution in [#​426](idursun/jjui#426) - [@​oliverpool](https://github.com/oliverpool) made their first contribution in [#​423](idursun/jjui#423) - [@​living180](https://github.com/living180) made their first contribution in [#​456](idursun/jjui#456) - [@​pablospe](https://github.com/pablospe) made their first contribution in [#​452](idursun/jjui#452) **Full Changelog**: <idursun/jjui@v0.9.8...v0.9.9> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi43NS4xIiwidXBkYXRlZEluVmVyIjoiNDIuNzUuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
Features:
lib.fileset.unionsforpkgs.buildGoModulepkgs.writeShellApplicationfor vendorHash as an appflake.nixinto modulesjjuipackage with override supportnixpkgs.lib.systems.flakeExposedJJUI_CONF_DIRenv var notice/warningnix develop,nix run, andnix build.gitignore.envrcfor nix flake usersREADME.mdCODEOWNERSfileTODO: