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 nix shell #67

Merged
merged 4 commits into from
Jan 21, 2022
Merged

Add nix shell #67

merged 4 commits into from
Jan 21, 2022

Conversation

kubukoz
Copy link
Member

@kubukoz kubukoz commented Jan 21, 2022

This is just for local usage, I did a POC of using the same shell with the same versions in CI (#68) but it only proved my fears - it takes too long for the initial setup so it doesn't really improve the situation much, regardless of how good Nix is at caching (ephemeral runners don't help).

@@ -0,0 +1,2 @@
# Direnv configuration
Copy link
Member Author

Choose a reason for hiding this comment

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

This file is for https://github.com/nix-community/nix-direnv / direnv.net to load the shell once you cd into the directory. Requires first-time approval.

@@ -0,0 +1,42 @@
{
Copy link
Member Author

Choose a reason for hiding this comment

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

Lockfile for the repositories we're using

Comment on lines +19 to +27
welcomeMessage = ''
Welcome to the smithy4s Nix shell! 👋
Available packages:
${builtins.concatStringsSep "\n" (map (n : "- ${n}") shellPackages)}
'';

shellHook = ''
echo "$welcomeMessage"
'';
Copy link
Member Author

Choose a reason for hiding this comment

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

This is how this shows up. Doesn't work if you use direnv and the shell is cached, but it's something.

image

@@ -0,0 +1,12 @@
# For compatibility with non-flake-enabled Nix versions
Copy link
Member Author

Choose a reason for hiding this comment

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

...and certain tools like https://github.com/arrterian/nix-env-selector which don't support flakes yet

Copy link
Contributor

@lewisjkl lewisjkl left a comment

Choose a reason for hiding this comment

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

LGTM

@kubukoz kubukoz merged commit 95429ed into disneystreaming:main Jan 21, 2022
Baccata pushed a commit that referenced this pull request May 10, 2022
* Initialize nix shell

* Show available packages

* Show welcome message

* Add nix instructions to README
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.

2 participants