Skip to content

NixOS module netrc-file setting conflicts with custom settings #90

Description

@hallettj

Hi! I was looking at setting up the NixOS module in this repo; but I ran into a conflict between the module's netrc-file setting, and a custom setting I have for the same option. I'm using some private Cachix repos where the recommended setup is to write repo credentials to the netrc file. (Here's my setup.) Attempting to use the Determinate Systems module leads to a conflict with my Cachix configuration.

I could fix the conflict by setting a higher priority in my Cachix config. But that would override the Determinate Systems setting so I wouldn't get managed credentials for Flakehub. As things stand I don't see a way to get netrc settings for both systems.

As far as I can tell Nix doesn't accept multiple paths for netrc-file. I tried this, and got authentication errors from Cachix. So although my custom netrc-file setting is a list for some reason, I don't think that is correct. I think that changing the Determinate Systems setting to a list as well would appear to fix the conflict, but would not supply the expected credentials to Nix requests.

I thought about setting up a custom netrc file that imports /nix/var/determinate/netrc, but netrc does not appear to support any kind of import directive.

My suggestion is to add an option for users to specify custom netrc content that will be written into /nix/var/determinate/netrc. For example,

nix.netrc-files = [config.sops.secrets.netrc.path];
# or
determinate.netrc-files = [config.sops.secrets.netrc.path];

Since netrc is used for credentials I think that encrypted content using sops are agenix will be common. That means that the option would have to accept file paths instead of, or in addition to string values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions