You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all!
I'm trying to figure out how to use the devshell API for something a bit less trivial than exposing a new package.
Specifically, I'm trying to setup a hook to transform a file and setup the dev environment.
More specifically, I'd like to be able to parameterize my secrets.nix file to be able to use nixpkgs.lib functions while relying on the flake's fixed inputs.
So I want my secrets.nix file to be a function that accepts a pkgs/channels arg pointing to the flake's channels/nixpkgs input. Then I need to expose a nix file containing an AttrSet to use the agenix cli.
So I guess somewhere in my devshell configs I need to do something like this:
{ self, pkgs, extraModulesPath, inputs, channels, ... }:
...
{
evaluatedSecretsConf = let
secrets = pkgs.lib.generators.toPretty { multiline = true; } (import ../secrets/secrets.nix { inherit pkgs });
in
builtins.toFile "secrets.nix" secrets;
# make derivation to wrap agenix with "RULES=${evaluatedSecretsConf}"
# or otherwise provide the evaluated secrets config path to agenix
}
Now, between the basic nix flake devshell API, the numtide/devshell which digga is using, and digga's own devshell API, I'm a bit lost.
Can somebody help guide me through the layers of the onion?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all!
I'm trying to figure out how to use the devshell API for something a bit less trivial than exposing a new package.
Specifically, I'm trying to setup a hook to transform a file and setup the dev environment.
More specifically, I'd like to be able to parameterize my secrets.nix file to be able to use nixpkgs.lib functions while relying on the flake's fixed inputs.
So I want my secrets.nix file to be a function that accepts a pkgs/channels arg pointing to the flake's channels/nixpkgs input. Then I need to expose a nix file containing an AttrSet to use the agenix cli.
So I guess somewhere in my devshell configs I need to do something like this:
Now, between the basic nix flake devshell API, the numtide/devshell which digga is using, and digga's own devshell API, I'm a bit lost.
Can somebody help guide me through the layers of the onion?
Thanks all!
Beta Was this translation helpful? Give feedback.
All reactions