From 5b05931782c4ba098ecb38d015eba7fea145d1e1 Mon Sep 17 00:00:00 2001 From: xenia Date: Thu, 19 Oct 2023 00:21:53 +0200 Subject: [PATCH] Different prompt-colors per system --- flake.nix | 6 ++++-- home.nix | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 5e67f95a..5fbe4ea1 100644 --- a/flake.nix +++ b/flake.nix @@ -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 { diff --git a/home.nix b/home.nix index c66ec0d6..a505e189 100644 --- a/home.nix +++ b/home.nix @@ -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