From f36a7a2a7ce9f90948d2a8f82f45ccedf9863f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Sat, 22 Jul 2023 23:49:06 +0200 Subject: [PATCH] feat(nix-on-droid): use nice bash prompt --- configs/bash.nix | 4 ++-- flake.nix | 7 ++++++- systems/moto-g5/configuration.nix | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/configs/bash.nix b/configs/bash.nix index 56c7e421..8cedc47a 100644 --- a/configs/bash.nix +++ b/configs/bash.nix @@ -1,7 +1,7 @@ -{ +{pkgs, ...}: { programs.bash = { promptInit = '' - PS1="$(tput bold)\w \$([[ \$? == 0 ]] && echo \"\[\033[1;32m\]\" || echo \"\[\033[1;31m\]\")\$$(tput sgr0) "''; + PS1="$(${pkgs.ncurses}/bin/tput bold)\w \$([[ \$? == 0 ]] && echo \"\[\033[1;32m\]\" || echo \"\[\033[1;31m\]\")\$$(${pkgs.ncurses}/bin/tput sgr0) "''; interactiveShellInit = '' set -o vi ''; diff --git a/flake.nix b/flake.nix index 07bd1553..cac5ef4a 100644 --- a/flake.nix +++ b/flake.nix @@ -106,8 +106,13 @@ }; nixOnDroidConfigurations = { - motoG5 = nix-on-droid.lib.nixOnDroidConfiguration { + moto-g5 = nix-on-droid.lib.nixOnDroidConfiguration { modules = [systems/moto-g5/configuration.nix]; + pkgs = import nixpkgs { + system = "aarch64-linux"; + overlays = [nix-on-droid.overlays.default]; + }; + home-manager-path = home-manager.outPath; }; }; diff --git a/systems/moto-g5/configuration.nix b/systems/moto-g5/configuration.nix index edcd6414..1f569cac 100644 --- a/systems/moto-g5/configuration.nix +++ b/systems/moto-g5/configuration.nix @@ -11,6 +11,7 @@ in { openssh curl findutils + coreutils utillinux gnugrep gnused @@ -27,6 +28,22 @@ in { '') ]; + home-manager = { + useGlobalPkgs = true; + backupFileExtension = "hm-bak"; + config = {pkgs, ...}: { + home.stateVersion = "23.05"; + programs.bash = { + enable = true; + profileExtra = '' + ${(import ../../configs/bash.nix {inherit pkgs;}).programs.bash.promptInit} + ''; + }; + }; + }; + + user.shell = "${pkgs.bash}/bin/bash"; + environment.etcBackupExtension = ".bak"; system.stateVersion = "23.05";