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 shell.nix for Nix(OS) users #18

Merged
merged 23 commits into from
Apr 13, 2021
Merged

Conversation

enderger
Copy link
Contributor

This PR adds a shell.nix file for Nix(OS) users. In Nix, a shell.nix file is used to create a development environment with certain packages installed, in this case just Golang.

@driusan
Copy link
Owner

driusan commented Mar 14, 2021

Thanks! Unfortunately, I've never used NixOS so I'm not really capable of reviewing this.

Is this a manually created file or one that's generated by some kind of tool? If it's manually created, maybe it could be tangled from a markdown block. That way, the text could include some explanation and links to relevant documentation included for people who are new to Nix (like myself.)

@enderger
Copy link
Contributor Author

enderger commented Mar 14, 2021

This is a manually created file, I’ll explain:

  1. { pkgs ? import <nixpkgs> {} }: tells Nix to store the package collection as a variable called pkgs
  2. pkgs.mkShell uses that variable to allow you to use nix-shell to allow developers to access a shell with the environment defined in the brackets.
  3. buildInputs = with pkgs; [ go ]; tells Nix to have Golang installed in the shell.

I may be able to convert it to a Markdown block, however I’m not sure where to put that block.

@enderger
Copy link
Contributor Author

I added a version which can be compiled from lmt, describing what it does.

@enderger enderger requested a review from driusan April 1, 2021 02:28
@@ -9,7 +9,7 @@ a little help from the Go standard library `path/filepath` functions.

We'll get the directory of the string, and if it's not "." (filepath.Dir
returns ".", not "" for empty paths) call `os.MkdirAll` on it in order to create
the directory before creating the file.
the directory before creating the file
Copy link
Owner

Choose a reason for hiding this comment

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

Why did you remove this punctuation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, sorry about that. My master branch had some temporary changes made while testing the actions PR.

@driusan
Copy link
Owner

driusan commented Apr 1, 2021

I'm still not sure I understand what the shell.nix is for, but I'm willing to take it on faith that it's useful for Nix users and merge this after the unrelated punctuation change is fixed.

You can also add yourself to the credits at the end of the README if you'd like.

@driusan driusan merged commit ad92ea3 into driusan:master Apr 13, 2021
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.

3 participants