Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a flake output for the helix cogs #7

Merged

Conversation

MatrixManAtYrService
Copy link

@MatrixManAtYrService MatrixManAtYrService commented Sep 16, 2024

You can already ask the flake to build helix for you, this PR adds the ability to build the helix cogs also:

❯ nix build .#helix-cogs
❯ ls result/cogs/helix
╭───┬─────────────────────────────────────┬──────┬─────────╮
│ # │                name                 │ type │  size   │
├───┼─────────────────────────────────────┼──────┼─────────┤
│ 0 │ result/cogs/helix/commands.scm      │ file │ 14.8 KB │
│ 1 │ result/cogs/helix/misc.scm          │ file │  1.8 KB │
│ 2 │ result/cogs/helix/static.scm        │ file │ 42.5 KB │
│ 3 │ result/cogs/helix/configuration.scm │ file │  6.5 KB │
│ 4 │ result/cogs/helix/editor.scm        │ file │  1.8 KB │
╰───┴─────────────────────────────────────┴──────┴─────────╯

By default, cargo xtask code-gen modifies ~/.config. I find this easy to lose track of. For instance, I had plugins working on one machine and not on the other and I was scratching my head about what was different between those machines.

This change makes it easy to just get the cogs without modifying my config, which is handy for creating dev environments which are isolated from the rest of my system (like this one, which is a work in progress).

@MatrixManAtYrService MatrixManAtYrService changed the base branch from master to steel-event-system September 16, 2024 04:02
These are necessary for creating dev environments which use the plugin
system.  Making them a flake output makes it easy to get them without
having `cargo xtask code-gen` modify your ~/.config directory.
std::fs::create_dir_all(&target_directory).unwrap_or_else(|err| {
panic!("Failed to create directory {:?}: {}", target_directory, err)
});
eprintln!("Created directory: {:?}", target_directory);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that both if these are unlikely cases. Most users have a dir ~/.config, so they'll never see these. I was in a build sandbox where those files didn't exist and it wasn't obvious why the file generation was failing or where the generated files were ending up. These messages helped me, I figured I'd leave them here just in case others end up with the same confusion.

Copy link

@evanrichter evanrichter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@Talia-12
Copy link

Talia-12 commented Oct 9, 2024

I'm using this now in my config with no issues

@mattwparas mattwparas merged commit 29ce6ff into mattwparas:steel-event-system Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants