Configuring powerleve10k with nixos flakes and home manager

I’m unable to copy the .p10k.zsh file into my nix config for it to initialize it as such.

I’ve followed this.

The relevant parts of home.nix looks like this.

programs.zsh = {
    enable = true;
    zplug = {
      enable = true;
      plugins = [
        { name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } 
      ];
    };
  };
  home.file.".p10k.zsh".text = builtins.readFile ./.p10k.zsh;

Any pointers on how to setup this is appreciated. The reason this is required as the .zshrc is read only and can’t be written into by p10k.

Here’s how I do that with home.nix. I don’t use the program.zsh though… Seems unnecessary since I’m just copying dotfiles.

  home.file = {
    ".aliases" = {
      source = ../../dotfiles/aliases;
    };
    ".p10k.zsh" = {
      source = ../../dotfiles/p10k.zsh;
      executable = true;
    };
    ".zshrc" = {
      source = ../../dotfiles/zshrc;
      executable = true;
    };
     ".scripts" = {
      source = ../../scripts;
      executable = true;
      recursive = true;
    };
1 Like