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"; xdg-runtime-dir = "/tmp/xdg-rt";
mkPkgs = system: import nixpkgs { system = system; config.allowUnfree = true; }; mkPkgs = system: import nixpkgs { system = system; config.allowUnfree = true; };
mkHome = {username, home-dir, system, pkgs} : import ./home.nix { mkHome = {username, home-dir, prompt-color, system, pkgs} : import ./home.nix {
inherit username home-dir pkgs xdg-runtime-dir; inherit username home-dir prompt-color pkgs xdg-runtime-dir;
kak-pkg = kak.packages.${system}.kak; kak-pkg = kak.packages.${system}.kak;
unispect = unispect.packages.${system}.unispect; unispect = unispect.packages.${system}.unispect;
@ -55,6 +55,7 @@
home = mkHome { home = mkHome {
username = "xenia"; username = "xenia";
home-dir = "/Users/xenia"; home-dir = "/Users/xenia";
prompt-color = 172;
inherit system pkgs; inherit system pkgs;
}; };
laptop = mkLaptop { inherit system pkgs; }; laptop = mkLaptop { inherit system pkgs; };
@ -76,6 +77,7 @@
home = mkHome { home = mkHome {
username = "coral"; username = "coral";
home-dir = "/home/coral"; home-dir = "/home/coral";
prompt-color = 197;
inherit system pkgs; inherit system pkgs;
}; };
in home-manager.lib.homeManagerConfiguration { 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 let
kak = import ./kak.nix { kak = kak-pkg; inherit pkgs; }; kak = import ./kak.nix { kak = kak-pkg; inherit pkgs; };
@ -73,12 +73,13 @@ in rec {
LC_ALL = "en_US.UTF-8"; LC_ALL = "en_US.UTF-8";
ARCHFLAGS = "-arch arm64"; ARCHFLAGS = "-arch arm64";
RPROMPT = ""; 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 # 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 = initExtra =
'' ''
export PROMPT='$( export PROMPT='$(
BG=172 BG=$PROMPT_COLOR
FG=0 FG=0
if [ ! -z $NIX_BUILD_CORES ] ; then if [ ! -z $NIX_BUILD_CORES ] ; then
BG=56 BG=56