notfed
July 24, 2021, 7:36pm
1
I’m using NiXOS+Home Manager, I use zsh
and I’d like to use a custom theme, custom.zsh-theme
.
In non-NixOS-land this means placing the theme file in $HOME/. oh-my-zsh/themes
, then setting $ZSH_THEME
to, in this case, “custom”.
But in NixOS, this directory points to the read-only path /nix/store/.../oh-my-zsh/...
.
How do I do it?
austin
July 25, 2021, 4:58am
2
notfed
July 25, 2021, 4:13pm
3
Ok, so let’s say I do programs.zsh.ohJMyZsh.theme = "custom"
. It’s going to complain because “custom” doesn’t exist, right? How do I get my custom theme into the themes directory?
I don’t know (because I don’t use zsh and have never used ohmyzsh or home-manager) but:
HM already appears to have an option for customizing ohmyzsh
ohmyzsh already has a theme customization subsection on their wiki
A github code search turns up multiple ways others are already using this, including:
https://github.com/maxdevjs/dotfiles-nixos/blob/bf32db080e5a8f802c383f06aa9b9e6714d26e7a/shells/zsh.nix#L14-L17
and
1 Like
notfed
July 26, 2021, 3:20am
5
This worked. Thank you for helping me love NixOS!
1 Like
This is how I made it work with Spaceship:
{ lib, config, pkgs, ... }: {
home.packages = with pkgs; [
zsh
spaceship-prompt
];
programs.zsh = {
enable = true;
initExtra = ''
source ${pkgs.spaceship-prompt}/share/zsh/themes/spaceship.zsh-theme;
'';
}