some more cleanup and started crafting new prompt
This commit is contained in:
parent
2f24f85e44
commit
25d02e5d3a
5 changed files with 35 additions and 20 deletions
|
@ -1,4 +1,4 @@
|
||||||
{pkgs, ...}: {
|
pkgs: {
|
||||||
enable = true;
|
enable = true;
|
||||||
profiles = {
|
profiles = {
|
||||||
"default" = {
|
"default" = {
|
||||||
|
|
|
@ -15,10 +15,7 @@ in
|
||||||
|
|
||||||
services.greetd = {
|
services.greetd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = import ./greetd.nix {
|
settings = import ./greetd.nix pkgs config;
|
||||||
config = config;
|
|
||||||
pkgs = pkgs;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.niri = {
|
programs.niri = {
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
{
|
pkgs: config: let
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (config) conf;
|
inherit (config) conf;
|
||||||
niri = config.programs.niri.package;
|
niri = config.programs.niri.package;
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -70,22 +70,22 @@ in {
|
||||||
|
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
plugins = with pkgs.fishPlugins; [
|
|
||||||
|
plugins = [
|
||||||
{
|
{
|
||||||
name = "pure";
|
name = "pure";
|
||||||
src = pure.src;
|
src = pkgs.fishPlugins.pure.src;
|
||||||
}
|
}
|
||||||
{
|
|
||||||
name = "bass";
|
|
||||||
src = bass.src;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
interactiveShellInit = concatMapStrings (x: "set --universal " + x + "\n") [
|
|
||||||
"pure_enable_nixdevshell true"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
functions = {
|
functions = {
|
||||||
run = "nix run nixpkgs#$argv[1] -- $argv[2..]";
|
run = {
|
||||||
|
body = "nix run nixpkgs#$argv[1] -- $argv[2..]";
|
||||||
|
};
|
||||||
|
|
||||||
|
fish_prompt = {
|
||||||
|
body = builtins.readFile ./prompt.fish;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
shellAbbrs = {
|
shellAbbrs = {
|
||||||
|
|
22
modules/utils/prompt.fish
Normal file
22
modules/utils/prompt.fish
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
set -l last_status $status
|
||||||
|
|
||||||
|
set -l stat
|
||||||
|
if test $last_status -ne 0
|
||||||
|
set stat (set_color -o red)"[$last_status] "(set_color normal)
|
||||||
|
end
|
||||||
|
|
||||||
|
set -l path (set_color -i blue)(prompt_pwd -D 4096)(set_color normal)
|
||||||
|
|
||||||
|
set -l prompt (set_color -o magenta)"> "(set_color normal)
|
||||||
|
|
||||||
|
set -l nix
|
||||||
|
if test -n "$IN_NIX_SHELL"
|
||||||
|
set nix (set_color white)"❄ "(set_color normal)
|
||||||
|
end
|
||||||
|
|
||||||
|
set -l ssh
|
||||||
|
if test -n "$SSH_CLIENT"
|
||||||
|
set ssh (set_color brblack)"$USER@$hostname"
|
||||||
|
end
|
||||||
|
|
||||||
|
string join "" -- $stat $path \n $nix $prompt
|
Loading…
Add table
Reference in a new issue