apply home.zsh to root

This commit is contained in:
2023-06-09 21:23:19 +08:00
parent 76796e78f1
commit 4e0dc66b46
6 changed files with 56 additions and 47 deletions

View File

@@ -114,7 +114,8 @@
./modules/virtualisation/kvm_guest.nix
./modules/virtualisation/kvm_host.nix
./modules/virtualisation/waydroid.nix
./home/basic.nix
./modules/home/root.nix
./modules/home/chn.nix
];
};
};

View File

@@ -1,46 +0,0 @@
{
config.home-manager =
{
useGlobalPkgs = true;
useUserPackages = true;
users.chn = { pkgs, ... }:
{
home.stateVersion = "22.11";
programs.zsh =
{
enable = true;
initExtraBeforeCompInit =
''
# p10k instant prompt
P10K_INSTANT_PROMPT="$XDG_CACHE_HOME/p10k-instant-prompt-''${(%):-%n}.zsh"
[[ ! -r "$P10K_INSTANT_PROMPT" ]] || source "$P10K_INSTANT_PROMPT"
HYPHEN_INSENSITIVE="true"
'';
plugins =
[
{
file = "powerlevel10k.zsh-theme";
name = "powerlevel10k";
src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
}
{
file = "p10k.zsh";
name = "powerlevel10k-config";
src = ./p10k-config;
}
{
name = "zsh-exa";
src = pkgs.fetchFromGitHub
{
owner = "ptavares";
repo = "zsh-exa";
rev = "0.2.3";
sha256 = "0vn3iv9d3c1a4rigq2xm52x8zjaxlza1pd90bw9mbbkl9iq8766r";
};
}
];
};
};
};
}

7
modules/home/chn.nix Normal file
View File

@@ -0,0 +1,7 @@
{
config.home-manager.users.chn = { pkgs, ... }:
{
home.stateVersion = "22.11";
programs.zsh = import ./zsh.nix { inherit pkgs; };
};
}

12
modules/home/root.nix Normal file
View File

@@ -0,0 +1,12 @@
{
config.home-manager =
{
useGlobalPkgs = true;
useUserPackages = true;
users.root = { pkgs, ... }:
{
home.stateVersion = "22.11";
programs.zsh = import ./zsh.nix { inherit pkgs; };
};
};
}

35
modules/home/zsh.nix Normal file
View File

@@ -0,0 +1,35 @@
{ pkgs }:
{
enable = true;
initExtraBeforeCompInit =
''
# p10k instant prompt
P10K_INSTANT_PROMPT="$XDG_CACHE_HOME/p10k-instant-prompt-''${(%):-%n}.zsh"
[[ ! -r "$P10K_INSTANT_PROMPT" ]] || source "$P10K_INSTANT_PROMPT"
HYPHEN_INSENSITIVE="true"
'';
plugins =
[
{
file = "powerlevel10k.zsh-theme";
name = "powerlevel10k";
src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
}
{
file = "p10k.zsh";
name = "powerlevel10k-config";
src = ./p10k-config;
}
{
name = "zsh-exa";
src = pkgs.fetchFromGitHub
{
owner = "ptavares";
repo = "zsh-exa";
rev = "0.2.3";
sha256 = "0vn3iv9d3c1a4rigq2xm52x8zjaxlza1pd90bw9mbbkl9iq8766r";
};
}
];
}