diff --git a/configs/shells.nix b/configs/shells.nix index 62912bd..192883f 100644 --- a/configs/shells.nix +++ b/configs/shells.nix @@ -1,13 +1,69 @@ { pkgs, ... }: { environment.shellAliases = { - ns = "nix-shell --command zsh"; + ns = "nix-shell --command fish"; ":r" = ''echo "You stupid!"''; nixi = ''nix repl ""''; }; environment.interactiveShellInit = "export PATH=$PATH:$HOME/.local/bin:$HOME/.cargo/bin"; + programs.fish = { + enable = true; + interactiveShellInit = '' + function take + mkdir $argv + and cd $argv[-1] + end + ''; + promptInit = '' + function fish_right_prompt --description 'Write out the right prompt' + set -g __fish_git_prompt_show_informative_status 1 + set -g __fish_git_prompt_hide_untrackedfiles 1 + + set -g __fish_git_prompt_color_branch magenta + set -g __fish_git_prompt_showupstream "informative" + set -g __fish_git_prompt_char_upstream_ahead "↑" + set -g __fish_git_prompt_char_upstream_behind "↓" + set -g __fish_git_prompt_char_upstream_prefix "" + + set -g __fish_git_prompt_char_stagedstate "●" + set -g __fish_git_prompt_char_dirtystate "✚" + set -g __fish_git_prompt_char_untrackedfiles "…" + set -g __fish_git_prompt_char_conflictedstate "✖" + set -g __fish_git_prompt_char_cleanstate "✔" + + set -g __fish_git_prompt_color_dirtystate blue + set -g __fish_git_prompt_color_stagedstate yellow + set -g __fish_git_prompt_color_invalidstate red + set -g __fish_git_prompt_color_untrackedfiles $fish_color_normal + set -g __fish_git_prompt_color_cleanstate green + echo -n -s (__fish_git_prompt) + end + + function fish_prompt --description 'Write out the prompt' + set color_cwd blue + set -l suffix + set -l color_suffix + switch "$USER" + case root toor + set suffix '#' + case '*' + set suffix '>' + if test $IN_NIX_SHELL + set suffix 'λ' + end + end + if test $status -eq 0 + set color_suffix green + else + set color_suffix red + end + echo -n -s (set_color --bold $color_cwd) (prompt_pwd) (set_color normal) " " (set_color --bold $color_suffix) "$suffix " (set_color normal) + end + ''; + }; + programs.zsh = { enable = true; enableCompletion = true; diff --git a/packages/onedrive.nix b/packages/onedrive.nix new file mode 100644 index 0000000..cc13024 --- /dev/null +++ b/packages/onedrive.nix @@ -0,0 +1,12 @@ +{ stdenv, dmd, curl, sqlite, fetchFromGitHub }: +stdenv.mkDerivation { + name = "onedrive"; + version = "v1.1.3"; + src = fetchFromGitHub { + owner = "skilion"; + repo = "onedrive"; + rev = "945251f7f2e95ae85001efb6eab85d6176bac75e"; + sha256 = "16iajb61b09gdqly85h6h7ap385ihk0az3mimkj277yc08rv68d0"; + }; + buildInputs = [ dmd curl sqlite ]; +}