Skip to content

Add a way to disable the NixOS module #311

@axelkar

Description

@axelkar

Currently you have this where I'd have to rely on assertions:

config = mkIf (cfg.secrets != {}) (mkMerge [

I currently have to do this to disable agenix:

let
  cfg = config.repo.common.secrets;
  ragenix = import inputs.ragenix.nixosModules.default;
  agenix-rekey = import "${inputs.agenix-rekey}/modules/agenix-rekey.nix" pkgs;
in {
  imports = [
    # Hacky workaround since the modules don't have enable options
    ({ pkgs, ... }@args: ragenix args // {
       config = lib.mkIf cfg (ragenix args).config;
    })
    ({ pkgs, ... }@args: agenix-rekey args // {
       config = lib.mkIf cfg (agenix-rekey args).config;
    })
  ];

Now the reason I need to disable agenix is because I import its module in all hosts in my config repo but live boot images don't have anything I could put into hostPubkey (and it just adds bloat)

oddlama/agenix-rekey#72

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions