-
Notifications
You must be signed in to change notification settings - Fork 172
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
feat: Add a Nix Flake with a devShell, NixOS module, and home-manager module to configure Shell Plugins #435
Conversation
…DefaultSystem` lambda
Hmm, I wasn't able to test according to the |
Sure thing, I'll send you a message on slack 👍 |
Functionally tested as a new Nix user on Mac:
Question: could we only have go and goals installed at the level of the shell-plugin directory, and then when I cd out of this directory, I don't have go installed anymore? From my understanding this is one possibility for Nix UX, right?
After running
|
Yep, that's the idea of Nix. I don't have any toolchains installed globally (like If you use direnv or nix-direnv (more optimized with extra caching for Nix stuff), you can create a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a Nix user myself, so take this approval with a grain of salt from a functional review perspective.
That said, from a code review perspective using the documentation and this code, I don't see any issues.
Just popping in to say thanks for adding this! After a little bit of figuring out (first time adding a module to Home Manager), it works great! Plugins are much easier to manage, and keep track of now! |
Overview
The
flake.nix
added does two things:devShell
so Nix users can just runnix develop
or usedirenv
to have a Go environment set up to build the plugins.home-manager
module (users will choose one or the other) to configure 1Password Shell Plugins via Nix; this only works if you're using Nix to manage your shell config, but if you're deep into Nix enough to be using Flakes, you probably are managing your shell config with Nix, too.With this flake as an input to your own flake, you would then be able to configure 1Password Shell Plugins with the following:
Type of change
Related Issue(s)
How To Test
Create a
home-manager
Nix flake that manages your shell configuration:flake.nix
./home.nix
If you're on macOS, you will need to install
home-manager
manually as well: https://nix-community.github.io/home-manager/index.xhtml#sec-install-standaloneOn NixOS, you can manage
home-manager
as a NixOS module instead.For standalone
home-manage
installation, runhome-manager switch --flake ~/path/to/flake-directory/.#my-config
to apply the configuration. If you're on NixOS and using a flake to managehome-manager
as a NixOS module, you can just runsudo nixos-rebuild switch --flake ~/path/to/flake-directory/.#my-config
Changelog
Add a
flake.nix
that provides adevShell
for contributors as well as a NixOS andhome-manager
module that can be used to configure 1Password Shell Plugins via Nix.