Skip to content

Add Nix flake, devshell, package, and wrapper script#18

Open
spikespaz wants to merge 18 commits intoR-O-C-K-E-T:mainfrom
spikespaz-contrib:nix-flake
Open

Add Nix flake, devshell, package, and wrapper script#18
spikespaz wants to merge 18 commits intoR-O-C-K-E-T:mainfrom
spikespaz-contrib:nix-flake

Conversation

@spikespaz
Copy link

I have added a Nix flake to this repository that includes a package description, and a development shell, as well as some of the standard tricks for Nix users.

I have also added a wrapper (cli.nix) so that if a user wants this installed on their system, they can install the package factorio-sat-cli and get one command, factorio-sat, instead of many scripts on their PATH.

There is a significant change to the Python codebase, it fetches assets from $XDG_DATA_HOME. I made those changes a while ago now; if you want me to rebase to make a change, I can.

  • nix run github:spikespaz-contrib/factorio-sat will run the wrapper, and show you all of the commands. Then, pass arguments after --, such as nix run github:spikespaz-contrib/factorio-sat -- belt_balancer, which will show the help for the belt_balancer script.
  • nix build github:spikespaz-contrib/factorio-sat will fetch dependencies and install the scripts to ./result/bin. This is not the CLI wrapper.
  • nix build 'github:spikespaz-contrib/factorio-sat#factorio-sat-cli' will build the CLI wrapper, which lives at ./result/bin/factorio-sat. There are no other scripts or dependencies in bin, the CLI script is self-contained.
  • nix develop github:spikespaz-contrib/factorio-sat will put you in a shell with all dependencies and the interpreter. This shell is dual-purpose: it provides the development environment yes, but users can also run this command to get the scripts temporarily on their PATH.
  • nix develop (in locally cloned repository) will open the development shell, same as before. Again, this can be used to work on Factorio-SAT itself, or to just run the scripts from PATH.

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.

1 participant

Comments