Different prompt-colors per system

This commit is contained in:
xenia 2023-10-19 00:21:53 +02:00
parent 026bd6d77f
commit 5b05931782
2 changed files with 7 additions and 4 deletions

View File

@ -32,8 +32,8 @@
xdg-runtime-dir = "/tmp/xdg-rt";
mkPkgs = system: import nixpkgs { system = system; config.allowUnfree = true; };
mkHome = {username, home-dir, system, pkgs} : import ./home.nix {
inherit username home-dir pkgs xdg-runtime-dir;
mkHome = {username, home-dir, prompt-color, system, pkgs} : import ./home.nix {
inherit username home-dir prompt-color pkgs xdg-runtime-dir;
kak-pkg = kak.packages.${system}.kak;
unispect = unispect.packages.${system}.unispect;
@ -55,6 +55,7 @@
home = mkHome {
username = "xenia";
home-dir = "/Users/xenia";
prompt-color = 172;
inherit system pkgs;
};
laptop = mkLaptop { inherit system pkgs; };
@ -76,6 +77,7 @@
home = mkHome {
username = "coral";
home-dir = "/home/coral";
prompt-color = 197;
inherit system pkgs;
};
in home-manager.lib.homeManagerConfiguration {

View File

@ -1,4 +1,4 @@
{ pkgs, username, home-dir, xdg-runtime-dir, kak-pkg, unispect, ansi-utils, unambig-path }:
{ pkgs, username, home-dir, prompt-color, xdg-runtime-dir, kak-pkg, unispect, ansi-utils, unambig-path }:
let
kak = import ./kak.nix { kak = kak-pkg; inherit pkgs; };
@ -73,12 +73,13 @@ in rec {
LC_ALL = "en_US.UTF-8";
ARCHFLAGS = "-arch arm64";
RPROMPT = "";
PROMPT_COLOR = prompt-color;
};
# We put PROMPT in initExtra instead of localVariables.PROMPT because nix puts the string in double quotes, whereas we want single quotes for the command to run each time
initExtra =
''
export PROMPT='$(
BG=172
BG=$PROMPT_COLOR
FG=0
if [ ! -z $NIX_BUILD_CORES ] ; then
BG=56