Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure oh-my-zsh custom folder through home-manager #1224

Closed
piegamesde opened this issue May 8, 2020 · 4 comments
Closed

Configure oh-my-zsh custom folder through home-manager #1224

piegamesde opened this issue May 8, 2020 · 4 comments

Comments

@piegamesde
Copy link
Contributor

Currently, programs.zsh.oh-my-zsh.custom simply contains the path to a oh-my-zsh custom directory. It'd be way cooler if I could also specify the content of that directory from home-manager, similar to programs.zsh.plugins.

@chisui
Copy link
Contributor

chisui commented Mar 1, 2021

I do this like this:

{ config, pkgs, ... }:
let
  agnoster-nix-theme = builtins.fetchurl {
    url = "https://gist.githubusercontent.com/chisui/0d12bd51a5fd8e6bb52e6e6a43d31d5e/raw/a97b74ce17c5f1befabe266ccf02a972cab2911b/agnoster-nix.zsh-theme";
    sha256 = "1m7qqrp8z0glnq81c9ldzmm0r42rgdmw8nk9hvssbjphx5khk6z7";
  };
  customDir = pkgs.stdenv.mkDerivation {
    name = "oh-my-zsh-custom-dir";
    phases = [ "buildPhase" ];
    buildPhase = ''
      mkdir -p $out/themes
      cp ${agnoster-nix-theme} $out/themes/agnoster-nix.zsh-theme
    '';
  };
in {
  programs.zsh = {
    enable = true;
    ...
    oh-my-zsh = {
      enable = true;
      plugins = [ "git" ];
      theme = "agnoster-nix";
      custom = "${customDir}";
    };
  };
}

@stale
Copy link

stale bot commented May 31, 2021

Thank you for your contribution! I marked this issue as stale due to inactivity. If this remains inactive for another 7 days, I will close this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

  • If this is resolved, please consider closing it so that the maintainers know not to focus on this.
  • If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

  • If you are also experiencing this issue, please add details of your situation to help with the debugging process.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

If you have nothing of substance to add, please refrain from commenting and allow the bot close the issue. Also, don't be afraid to manually close an issue, even if it holds valuable information.

Closed issues stay in the system for people to search, read, cross-reference, or even reopen--nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

@stale stale bot added the status: stale label May 31, 2021
@stale stale bot closed this as completed Jun 7, 2021
@kirinnee
Copy link

kirinnee commented Feb 1, 2022

Sorry to revive this thread, but would this still be possible? In the case, I'm trying to add a custom plugin go-task-completions, but there's no real way of doing this since the $ZSH_CUSTOM="" is exported after the plugins=(... ) within the .zshrc when using home-manager.

The around is currently using extraConfig to emulate the custom option, which defeats the existence of the custom options

@chisui
Copy link
Contributor

chisui commented Feb 2, 2022

Why do you need to use ZSH_CUSTOM for that? Couldn't you just add something like this:

let
  go-task-completion = fetchGitHub {
    
  };
in {
  programs.zsh.oh-my-zsh.extraConfig = ''
    fpath+=${go-task-completion}
  '';
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants