changed login shell to fern, added fern configuration
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
./starship.nix
|
||||
./userpkgs.nix
|
||||
./zsh
|
||||
./fern
|
||||
./swaync.nix
|
||||
./hyprland.nix
|
||||
./waybar.nix
|
||||
|
||||
32
modules/home/environment/fern/aliases.nix
Normal file
32
modules/home/environment/fern/aliases.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{ lib, config, self, ... }:
|
||||
{
|
||||
programs.fern = {
|
||||
aliases = {
|
||||
mv = "mv -v";
|
||||
cp = "cp -vr";
|
||||
gt = "gtrash";
|
||||
gtp = "playshellsound ${self}/assets/sound/rm.wav";
|
||||
sr = "source ~/.fernrc";
|
||||
psg = "ps aux | grep -v grep | grep -i -e VSZ -e";
|
||||
mkdir = "mkdir -p";
|
||||
pk = "pkill -9 -f";
|
||||
svc = "sudo systemctl";
|
||||
svcu = "systemctl --user";
|
||||
iv = "invoke";
|
||||
cfgfilecount = ''find ".\.nix" $FLAKEPATH | wc -l | toilet -f 3d | lolcat'';
|
||||
vide = "neovide";
|
||||
vi = "nvim";
|
||||
mkexe = "chmod +x";
|
||||
shortdate = "date +%m-%d-%y";
|
||||
suvi = "sudoedit";
|
||||
suvide = "EDITOR=neovide; suvi";
|
||||
rustdev = "nix develop github:km-clay/devshells#rust";
|
||||
|
||||
ga = "playshellsound ${self}/assets/sound/gitadd.wav; git add";
|
||||
gcomm = "gitcommit_sfx";
|
||||
gpush = "gitpush_sfx";
|
||||
gpull = "gitpull_sfx";
|
||||
grebase = "gitrebase_sfx";
|
||||
};
|
||||
};
|
||||
}
|
||||
10
modules/home/environment/fern/default.nix
Normal file
10
modules/home/environment/fern/default.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./env.nix
|
||||
./aliases.nix
|
||||
./extraconfig.nix
|
||||
./options.nix
|
||||
];
|
||||
}
|
||||
18
modules/home/environment/fern/env.nix
Normal file
18
modules/home/environment/fern/env.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ lib, config, ... }:
|
||||
{
|
||||
programs.fern = {
|
||||
environmentVars = {
|
||||
SOUNDS_ENABLED = "true";
|
||||
EDITOR = "nvim";
|
||||
SUDO_EDITOR = "nvim";
|
||||
VISUAL = "nvim";
|
||||
LANG = "en_US.UTF-8";
|
||||
BROWSER = "firefox";
|
||||
FLAKEPATH = "$HOME/.sysflake";
|
||||
STEAMPATH = "$HOME/.local/share/Steam";
|
||||
|
||||
FZF_DEFAULT_COMMAND = "fd";
|
||||
FZF_DEFAULT_OPTS = "--height 40% --layout=reverse --border";
|
||||
};
|
||||
};
|
||||
}
|
||||
174
modules/home/environment/fern/extraconfig.nix
Normal file
174
modules/home/environment/fern/extraconfig.nix
Normal file
@@ -0,0 +1,174 @@
|
||||
{ lib, config, self, pkgs, ... }:
|
||||
let
|
||||
shellsound = "${pkgs.myScripts.playshellsound}/bin/playshellsound";
|
||||
color-commit = "${pkgs.myScripts.color-commit}/bin/color-commit";
|
||||
sndpath = "${self}/assets/sound";
|
||||
in
|
||||
{
|
||||
programs.fern = {
|
||||
settings.extraPreConfig = ''
|
||||
prompt_topline() {
|
||||
if [ "$?" -eq "0" ]; then
|
||||
last_cmd_status="\e[1;32m\e[0m"
|
||||
else
|
||||
last_cmd_status="\e[1;31m\e[0m"
|
||||
fi
|
||||
user_and_host="\e[1m$USER\e[1;36m@\e[1;31m$HOST\e[0m"
|
||||
last_runtime_raw="$(echo -p "\t")"
|
||||
if [ -z "$last_runtime_raw" ]; then
|
||||
last_cmd_runtime=""
|
||||
last_cmd_status=""
|
||||
else
|
||||
last_cmd_runtime="\e[1;38;2;249;226;175m $(echo -p "\T")\e[0m"
|
||||
fi
|
||||
echo -n "$user_and_host $last_cmd_runtime $last_cmd_status\n"
|
||||
}
|
||||
|
||||
prompt_midline() {
|
||||
git rev-parse --is-inside-work-tree > /dev/null 2>&1 || return
|
||||
|
||||
status="$(git status --porcelain 2>/dev/null)"
|
||||
gitsigns=""
|
||||
|
||||
[ -n "$status" ] && echo "$status" | command grep -q '^ [MADR]' && gitsigns="$gitsigns!"
|
||||
[ -n "$status" ] && echo "$status" | command grep -q '^??' && gitsigns="$gitsigns?"
|
||||
[ -n "$status" ] && echo "$status" | command grep -q '^[MADR]' && gitsigns="$gitsigns+"
|
||||
|
||||
ahead="$(git rev-list --count @{upstream}..HEAD 2>/dev/null)"
|
||||
behind="$(git rev-list --count HEAD..@{upstream} 2>/dev/null)"
|
||||
[ $ahead -gt 0 ] && gitsigns="$gitsigns↑"
|
||||
[ $behind -gt 0 ] && gitsigns="$gitsigns↓"
|
||||
|
||||
branch="$(git branch --show-current 2>/dev/null)"
|
||||
|
||||
if [ -n "$gitsigns" ] || [ -n "$branch" ]; then
|
||||
if [ -n "$gitsigns" ]; then
|
||||
gitsigns="\e[1;31m[$gitsigns]"
|
||||
fi
|
||||
echo -n "\e[0mon \e[1;35m ''${branch}$gitsigns\e[0m\n"
|
||||
fi
|
||||
}
|
||||
|
||||
prompt_botline() {
|
||||
echo -p "\e[1;36m\W\e[1;32m/"
|
||||
}
|
||||
|
||||
prompt() {
|
||||
top="$(prompt_topline)"
|
||||
mid="$(prompt_midline)"
|
||||
bot="$(prompt_botline)"
|
||||
dollar="$(echo -p "\$ ")"
|
||||
dollar="$(echo -e "\e[1;32m$dollar\e[0m")"
|
||||
echo -en "$top$mid$bot\n$dollar"
|
||||
}
|
||||
|
||||
export PS1="\n\!prompt "
|
||||
'';
|
||||
settings.extraPostConfig = ''
|
||||
encrypt() {
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: encrypt <text> [recipient]"
|
||||
return 1
|
||||
fi
|
||||
if [ -z "$2" ]; then
|
||||
gpg --encrypt --armor -r "$1"
|
||||
else
|
||||
echo "$1" | gpg --encrypt --armor -r "$2"
|
||||
fi
|
||||
}
|
||||
decrypt() {
|
||||
if [ -z "$1" ]; then
|
||||
gpg --decrypt --quiet 2>/dev/null
|
||||
else
|
||||
echo "$1" | gpg --decrypt --quiet
|
||||
fi
|
||||
}
|
||||
|
||||
viflake() {
|
||||
(
|
||||
while ! [ -f ./flake.nix ]; do
|
||||
builtin cd ..
|
||||
if [ "$PWD" = "/" ]; then
|
||||
echo "No flake.nix found in this directory or any parent directories."
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
nvim ./flake.nix
|
||||
)
|
||||
}
|
||||
|
||||
nvim() {
|
||||
${shellsound} ${sndpath}/nvim.wav
|
||||
command nvim "$@"
|
||||
}
|
||||
neovide() {
|
||||
${shellsound} ${sndpath}/nvim.wav
|
||||
command neovide "$@"
|
||||
}
|
||||
grimblast() {
|
||||
if command grimblast "$@"; then
|
||||
${shellsound} ${sndpath}/screenshot.wav
|
||||
fi
|
||||
}
|
||||
gitcheckout_sfx() {
|
||||
if git checkout "$@"; then
|
||||
${shellsound} ${sndpath}/gitcheckout.wav
|
||||
else
|
||||
${shellsound} ${sndpath}/error.wav
|
||||
fi
|
||||
}
|
||||
gitrebase_sfx() {
|
||||
if git rebase "$@"; then
|
||||
${shellsound} ${sndpath}/gitrebase.wav
|
||||
else
|
||||
${shellsound} ${sndpath}/error.wav
|
||||
fi
|
||||
}
|
||||
gitcommit_sfx() {
|
||||
output="$(git commit "$@")"
|
||||
if [ "$?" -eq "0" ]; then
|
||||
${shellsound} ${sndpath}/gitcommit.wav
|
||||
echo "$output" | ${color-commit}
|
||||
return 0
|
||||
else
|
||||
${shellsound} ${sndpath}/error.wav
|
||||
echo "$output"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
gitpush_sfx() {
|
||||
if git push "$@"; then
|
||||
${shellsound} ${sndpath}/gitpush.wav
|
||||
else
|
||||
${shellsound} ${sndpath}/error.wav
|
||||
fi
|
||||
}
|
||||
gitpull_sfx() {
|
||||
if git pull "$@"; then
|
||||
${shellsound} ${sndpath}/gitpull.wav
|
||||
else
|
||||
${shellsound} ${sndpath}/error.wav
|
||||
fi
|
||||
}
|
||||
|
||||
ls() {
|
||||
eza -1 --group-directories-first --icons "$@"
|
||||
${shellsound} ${sndpath}/ls.wav
|
||||
}
|
||||
|
||||
mkcd() {
|
||||
command mkdir -p "$1" && builtin cd "$1"
|
||||
}
|
||||
|
||||
cd() {
|
||||
eza -1 --group-directories-first --icons "$@" 2> /dev/null
|
||||
builtin cd "$@"
|
||||
${shellsound} ${sndpath}/cd.wav
|
||||
}
|
||||
|
||||
if [ "$0" = "-fern" ]; then
|
||||
${shellsound} $FLAKEPATH/assets/sound/login.wav
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
12
modules/home/environment/fern/options.nix
Normal file
12
modules/home/environment/fern/options.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
{
|
||||
programs.fern = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
autocd = true;
|
||||
autoHistory = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -43,7 +43,7 @@ in {
|
||||
config = lib.mkIf config.movOpts.envConfig.hyprlandConfig.enable {
|
||||
home.packages = with pkgs; [
|
||||
swaybg
|
||||
inputs.hypr-contrib.packages.${pkgs.system}.grimblast
|
||||
inputs.hypr-contrib.packages.${pkgs.stdenv.hostPlatform.system}.grimblast
|
||||
hyprpicker
|
||||
grim
|
||||
slurp
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ lib, config, pkgs, inputs, ... }:
|
||||
let
|
||||
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
|
||||
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system};
|
||||
scheme = config.lib.stylix.colors;
|
||||
in {
|
||||
imports = [ inputs.spicetify-nix.homeManagerModules.default ];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ lib, config, pkgs, self, ... }:
|
||||
{ inputs, lib, config, pkgs, self, ... }:
|
||||
|
||||
let
|
||||
scripts = with pkgs; [
|
||||
|
||||
Reference in New Issue
Block a user