diff --git a/flake.lock b/flake.lock index ff075e0..3019a6d 100644 --- a/flake.lock +++ b/flake.lock @@ -357,11 +357,11 @@ ] }, "locked": { - "lastModified": 1751986323, - "narHash": "sha256-EuYWd8FMsqAiAtrAB34LBDe8wgixhMtx1O75fprygX0=", + "lastModified": 1754263839, + "narHash": "sha256-ck7lILfCNuunsLvExPI4Pw9OOCJksxXwozum24W8b+8=", "owner": "nix-community", "repo": "home-manager", - "rev": "5751fa774fa61837f35efb82f3b6e105d4c63ced", + "rev": "1d7abbd5454db97e0af51416f4960b3fb64a4773", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 6fc5c56..7616283 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,7 @@ }; inputs = { + # nixpkgs.url = "git+file:///home/christopher/code/opensource/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # Opinionated flake library for better organization without much boilerplate @@ -60,6 +61,7 @@ darwin.inputs.nixpkgs.follows = "nixpkgs"; home-manager = { + # url = "git+file:///home/christopher/code/opensource/home-manager"; url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; diff --git a/homes/x86_64-linux/christopher@cobalt/global/terminal/default.nix b/homes/x86_64-linux/christopher@cobalt/global/terminal/default.nix index 419d993..0185d54 100644 --- a/homes/x86_64-linux/christopher@cobalt/global/terminal/default.nix +++ b/homes/x86_64-linux/christopher@cobalt/global/terminal/default.nix @@ -6,6 +6,7 @@ in { imports = [ ./programs ./shell/aliases.nix + ./shell/prompt.nix ./shell/nu ./shell/zsh ]; diff --git a/homes/x86_64-linux/christopher@cobalt/global/terminal/shell/prompt.nix b/homes/x86_64-linux/christopher@cobalt/global/terminal/shell/prompt.nix new file mode 100644 index 0000000..9aa9aa5 --- /dev/null +++ b/homes/x86_64-linux/christopher@cobalt/global/terminal/shell/prompt.nix @@ -0,0 +1,121 @@ +{...}: let + unicode = code: builtins.fromJSON ''"${code}" ''; +in { + programs.oh-my-posh = { + enable = true; + enableNushellIntegration = true; + enableZshIntegration = true; + + # Original settings taken from `catppuccin_frappe`, and adjusted to my + # likings and usage. + settings = { + "$schema" = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json"; + version = 3; + final_space = true; + + palette = { + os = "#acb0be"; + closer = "p:blue"; + pink = "#f4b8e4"; + lavender = "#babbf1"; + blue = "#8caaee"; + red = "#e78284"; + surface = "#414559"; + }; + + blocks = [ + { + alignment = "left"; + type = "prompt"; + newline = true; + segments = [ + { + foreground = "p:os"; + style = "plain"; + template = "{{ .Icon }} "; + type = "os"; + } + { + foreground = "p:pink"; + style = "plain"; + template = "{{ .Path }} "; + type = "path"; + properties = { + home_icon = "~"; + style = "full"; + mapped_locations = { + "~/code/hausgold/env/projects" = "hg-env"; + "~/code/hausgold" = "hg"; + "~/code/opensource" = "oss"; + "~/code/own" = "own"; + }; + }; + } + { + foreground = "p:blue"; + style = "plain"; + template = "{{ .UserName }}@{{ .HostName }} "; + type = "session"; + } + { + foreground = "p:lavender"; + template = "{{ .HEAD }} "; + style = "plain"; + type = "git"; + properties = { + branch_icon = unicode "\\ue725 "; + cherry_pick_icon = unicode "\\ue29b "; + commit_icon = unicode "\\uf417 "; + merge_icon = unicode "\\ue727 "; + no_commits_icon = unicode "\\uef0c3 "; + rebase_icon = unicode "\\ue728 "; + revert_icon = unicode "\\uf0e2 "; + tag_icon = unicode "\\uf412 "; + fetch_status = false; + fetch_upstream_icon = false; + }; + } + ]; + } + { + alignment = "right"; + type = "prompt"; + segments = [ + { + foreground = "p:red"; + background = "p:surface"; + style = "plain"; + template = unicode "{{ if .Error }}\\uf06d {{ .String }}{{ end }}"; + type = "status"; + properties = { + always_enabled = true; + }; + } + { + foreground = "p:pink"; + style = "plain"; + template = " {{ .FormattedMs }}"; + type = "executiontime"; + properties = { + style = "austin"; + }; + } + ]; + } + { + alignment = "left"; + type = "prompt"; + newline = true; + segments = [ + { + foreground = "p:closer"; + template = "#"; + style = "plain"; + type = "text"; + } + ]; + } + ]; + }; + }; +} diff --git a/homes/x86_64-linux/christopher@cobalt/global/terminal/shell/zsh/default.nix b/homes/x86_64-linux/christopher@cobalt/global/terminal/shell/zsh/default.nix index 71ce799..40504b2 100644 --- a/homes/x86_64-linux/christopher@cobalt/global/terminal/shell/zsh/default.nix +++ b/homes/x86_64-linux/christopher@cobalt/global/terminal/shell/zsh/default.nix @@ -5,14 +5,12 @@ }: { imports = [ ./antigen.nix - ./prompt.nix ]; programs.zoxide.enableZshIntegration = true; programs.zsh = { enable = true; - dotDir = ".config/zsh"; oh-my-zsh.enable = true; shellAliases = config.home.shellAliases; diff --git a/homes/x86_64-linux/christopher@cobalt/global/terminal/shell/zsh/prompt.nix b/homes/x86_64-linux/christopher@cobalt/global/terminal/shell/zsh/prompt.nix deleted file mode 100644 index 305ac85..0000000 --- a/homes/x86_64-linux/christopher@cobalt/global/terminal/shell/zsh/prompt.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - programs.starship.enable = true; - - # (https://starship.rs/guide/) - # Define a Pure-ish prompt - programs.starship.settings = { - format = '' - $username$hostname$directory$git_branch$git_state$git_status$cmd_duration$line_break$character - ''; - - directory.style = "blue"; - - character = { - success_symbol = "[❯](purple)"; - error_symbol = "[❯](red)"; - vimcmd_symbol = "[❮](green)"; - }; - - git_branch = { - format = "[$branch]($style)"; - style = "bright-black"; - }; - - git_status = { - format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)"; - style = "cyan"; - conflicted = "​"; - untracked = "​"; - modified = "​"; - staged = "​"; - renamed = "​"; - deleted = "​"; - stashed = "≡"; - }; - - git_state = { - format = "\([$state( $progress_current/$progress_total)]($style)\) "; - style = "bright-black"; - }; - - cmd_duration = { - format = "[$duration]($style) "; - style = "yellow"; - }; - }; -}