Skip to content
Discussion options

You must be logged in to vote

Try importing this module:

{ config, lib, withSystem, ... }: {
  _class = "flake"; # imports checking, optional
  flake.pkgsYolo = withSystem "x86_64-linux" ({ pkgs, ... }: pkgs );
  flake.pkgs = lib.mapAttrs 
    (system: config:
      # module arguments don't appear in config, so we use withSystem
      withSystem system ({ pkgs, ... }: pkgs)
    )
    config.allSystems;
}
nix-repl> pkgs.x86_64-linux.hello 
«derivation /nix/store/krmi4k907lh3wfrw3kr5w30ydwhnzrvw-hello-2.12.2.drv»

nix-repl> pkgsYolo.hello
«derivation /nix/store/krmi4k907lh3wfrw3kr5w30ydwhnzrvw-hello-2.12.2.drv»

or if you want to be fancy about it and distribute a module that does stuff like this, you could declare an op…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Nebucatnetzer
Comment options

Answer selected by Nebucatnetzer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants