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 rbld -t for checking if the code syntax is valid #54

Open
llakala opened this issue Oct 3, 2024 · 3 comments
Open

Add rbld -t for checking if the code syntax is valid #54

llakala opened this issue Oct 3, 2024 · 3 comments
Labels
feature A flake input minor Small change to something

Comments

@llakala
Copy link
Owner

llakala commented Oct 3, 2024

Done via nix eval /etc/nixos#nixosConfigurations.framework.config.system.build.toplevel. Just checks that the code is syntactically correct, doesn't activate it or anything.

Unfortunately, for this to work, we'd need access to the current host. I could do this manually like I handle $CONFIG_DIRECTORY, but honestly, I should really just move the rbld script to within a nix file.

@llakala llakala added feature A flake input minor Small change to something labels Oct 3, 2024
@llakala
Copy link
Owner Author

llakala commented Oct 4, 2024

rbld script has been moved into a nix file as of 2a8f2da. And, syntax highlighting works, but only within Helix (this is good, makes me stop using VSCode). We can now add this functionality easily, and anything else.

@llakala
Copy link
Owner Author

llakala commented Oct 5, 2024

Yet another abstraction: the rebuild script has been moved to its own repo. However, I'm facing lots of theoretical questions now, like:

  • Should I provide an argument for setting the config directory?
  • How should I provide an argument for setting the config directory?
  • What if the user uses unstable by default, and stable as a secondary package set? Do I need an option for rbld -f?
  • Does the rbld -f functionality even make sense within the rbld function?
  • Why am I worrying about all these things for a project with zero stars?

This issue may languish a bit until I feel more comfortable with the state of the script.

@llakala
Copy link
Owner Author

llakala commented Oct 7, 2024

Progress:

  • We can now pass a config directory via -d. It's set to /etc/nixos if no path is passed. Ideally, we'd add a custom error here to check that the directory exists, has a flake, and a git repo, rather than getting an inscrutable error.
  • We're planning on splitting the flake commands off into a separate function, unify. unify stands for: "Update NixOS Inputs For Yourself".
  • Positional parameters bad. Once above is done, the commands should ideally only take arguments. We can then work on adding more arguments, for things like specifying the flake inputs we care about.
  • ADD DOCUMENTATION. it's not that hard.

Once all that is done, we can work on new functionality, and implement stuff like rbld -t.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A flake input minor Small change to something
Projects
None yet
Development

No branches or pull requests

1 participant