Nix config outside NixOS

So I’m trying to make a development environment that’s easily reproducible (staying away from home-manager currently to understand Nix better). After enough searching around I figured out how to make a few custom derivations, use buildEnv for package sets, and use ~/.config/nixpkgs/config.nix to do overrides. I’m working now to setup zsh and oh-my-zsh which have a ton of configuration options, but the only documentation I can find seems to suggest adding them to configuration.nix, which is a NixOS option I can’t use.

Currently my code looks something like this:

let 
  pkgs = import <nixpkgs> {};
in {
  allowUnfree = true;

  programs = {
      zsh = {
        enable = true;
        promptInit = "source ${pkgs.zsh-powerlevel9k}/share/zsh-powerlevel9k/powerlevel9k.zsh-theme";
        ohMyZsh = {
            enable = true;
            plugins = ["autojump"];
            theme = "powerlevel9k/powerlevel9k";
        };
      };
  };

  packageOverrides = pkgs: with pkgs; rec {
    all = buildEnv {
      name = "all";
      paths = with pkgs; [
        tmuxinator
        zsh
        oh-my-zsh
        autojump
        ...
      ];
    };
  };
}

My understanding so far is that within ~/.config/nixpkgs/config.nix, there should be a single config set which contains things like the overrides function and corresponds to documentation examples of config.programs.zsh.enable, etc. However, nothing I write in that programs section affects or causes a different ouput of any of my programs.

What am I missing? How can I affect the configuration options listed here (https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/zsh/zsh.nix)?

You are trying to use NixOS modules without using NixOS. That is currently not possible, those options are not used in config.nix. You may be interested in home-manager.

Thanks! I decided to do custom derivations instead that just make the repos available in .nix-profile/share and then link to them from my home zshrc. Config is in more than one place but I needed the symlinks anyways and this is still pretty simple and automated.