1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat(nix-on-droid): use nice bash prompt

This commit is contained in:
2023-07-22 23:49:06 +02:00
parent 915695cb0b
commit 45972f524b
3 changed files with 26 additions and 3 deletions

View File

@@ -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
'';

View File

@@ -32,6 +32,7 @@
menstruation-telegram.inputs.menstruation-backend.follows = "menstruation-backend";
menstruation-telegram.inputs.nixpkgs.follows = "nixpkgs-old";
nix-on-droid.inputs.nixpkgs.follows = "nixpkgs";
nix-on-droid.inputs.home-manager.follows = "home-manager";
nixinate.inputs.nixpkgs.follows = "nixpkgs";
recht.inputs.flake-utils.follows = "flake-utils";
recht.inputs.nixpkgs.follows = "nixpkgs";
@@ -106,8 +107,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;
};
};

View File

@@ -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";