diff --git a/home-manager/opdavies/PW05CH3L.nix b/home-manager/opdavies/PW05CH3L.nix index d581f5d0..67c1b384 100644 --- a/home-manager/opdavies/PW05CH3L.nix +++ b/home-manager/opdavies/PW05CH3L.nix @@ -5,7 +5,6 @@ features = { cli = { - starship.enable = true; zsh.enable = true; }; }; diff --git a/home-manager/opdavies/nixedo.nix b/home-manager/opdavies/nixedo.nix index 91959735..3680f7c2 100644 --- a/home-manager/opdavies/nixedo.nix +++ b/home-manager/opdavies/nixedo.nix @@ -8,7 +8,6 @@ ]; features.cli = { - starship.enable = true; zsh.enable = true; }; diff --git a/home-manager/opdavies/t480.nix b/home-manager/opdavies/t480.nix index 6f2ca71b..1d4d5ceb 100644 --- a/home-manager/opdavies/t480.nix +++ b/home-manager/opdavies/t480.nix @@ -8,7 +8,6 @@ features = { cli = { - starship.enable = true; zsh.enable = true; }; }; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 56240fc8..a5d35e48 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -1,6 +1,5 @@ { imports = [ - ./starship.nix ./zsh ]; } diff --git a/modules/home-manager/starship.nix b/modules/home-manager/starship.nix deleted file mode 100644 index 57cc4f6d..00000000 --- a/modules/home-manager/starship.nix +++ /dev/null @@ -1,187 +0,0 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = config.features.cli.starship; -in -{ - options.features.cli.starship.enable = mkEnableOption "Enable starship"; - - config = mkIf cfg.enable { - programs.starship = - let - inherit (builtins) concatStringsSep; - in - { - enable = true; - enableZshIntegration = true; - - settings = { - add_newline = false; - - # https://starship.rs/config/#prompt - format = concatStringsSep "" [ - "\n" - "$username" - "$hostname" - "$directory" - "$vcsh" - "$git_branch" - "$git_status" - "$git_metrics" - "$docker_context" - "$nodejs" - "$php" - "$terraform" - "$nix_shell" - "$direnv" - "\${custom.mob}" - "$memory_usage" - "$cmd_duration" - "$lua" - "$status" - "$character" - ]; - - cmd_duration.disabled = true; - direnv.disabled = false; - directory.format = "[$path]($style) "; - git_status.disabled = true; - nix_shell.disabled = true; - nodejs.disabled = true; - php.disabled = true; - username.disabled = true; - - custom = { - mob = { - command = "echo $MOB_TIMER_ROOM"; - format = "[($output)]($style) "; - when = "[[ -v MOB_TIMER_ROOM ]]"; - }; - }; - - # https://starship.rs/presets/plain-text - aws.symbol = "aws "; - azure.symbol = "az "; - bun.symbol = "bun "; - c.symbol = "C "; - character = { - success_symbol = "[>](bold green)"; - error_symbol = "[x](bold red)"; - vimcmd_symbol = "[<](bold green)"; - }; - cobol.symbol = "cobol "; - conda.symbol = "conda "; - crystal.symbol = "cr "; - cmake.symbol = "cmake "; - daml.symbol = "daml "; - dart.symbol = "dart "; - deno.symbol = "deno "; - dotnet.symbol = ".NET "; - directory.read_only = " ro"; - docker_context.symbol = "docker "; - elixir.symbol = "exs "; - elm.symbol = "elm "; - fennel.symbol = "fnl "; - fossil_branch.symbol = "fossil "; - gcloud.symbol = "gcp "; - git_branch.symbol = "git "; - git_commit.tag_symbol = " tag "; - git_status = { - ahead = ">"; - behind = "<"; - diverged = "<>"; - renamed = "r"; - deleted = "x"; - }; - gleam.symbol = "gleam "; - golang.symbol = "go "; - gradle.symbol = "gradle "; - guix_shell.symbol = "guix "; - hg_branch.symbol = "hg "; - java.symbol = "java "; - julia.symbol = "jl "; - kotlin.symbol = "kt "; - lua.symbol = "lua "; - nodejs.symbol = "nodejs "; - memory_usage.symbol = "memory "; - meson.symbol = "meson "; - nats.symbol = "nats "; - nim.symbol = "nim "; - nix_shell.symbol = "nix "; - ocaml.symbol = "ml "; - opa.symbol = "opa "; - os.symbols = { - AIX = "aix "; - Alpaquita = "alq "; - AlmaLinux = "alma "; - Alpine = "alp "; - Amazon = "amz "; - Android = "andr "; - Arch = "rch "; - Artix = "atx "; - CentOS = "cent "; - Debian = "deb "; - DragonFly = "dfbsd "; - Emscripten = "emsc "; - EndeavourOS = "ndev "; - Fedora = "fed "; - FreeBSD = "fbsd "; - Garuda = "garu "; - Gentoo = "gent "; - HardenedBSD = "hbsd "; - Illumos = "lum "; - Kali = "kali "; - Linux = "lnx "; - Mabox = "mbox "; - Macos = "mac "; - Manjaro = "mjo "; - Mariner = "mrn "; - MidnightBSD = "mid "; - Mint = "mint "; - NetBSD = "nbsd "; - NixOS = "nix "; - OpenBSD = "obsd "; - OpenCloudOS = "ocos "; - openEuler = "oeul "; - openSUSE = "osuse "; - OracleLinux = "orac "; - Pop = "pop "; - Raspbian = "rasp "; - Redhat = "rhl "; - RedHatEnterprise = "rhel "; - RockyLinux = "rky "; - Redox = "redox "; - Solus = "sol "; - SUSE = "suse "; - Ubuntu = "ubnt "; - Ultramarine = "ultm "; - Unknown = "unk "; - Void = "void "; - Windows = "win "; - }; - package.symbol = "pkg "; - perl.symbol = "pl "; - php.symbol = "php "; - pijul_channel.symbol = "pijul "; - pulumi.symbol = "pulumi "; - purescript.symbol = "purs "; - python.symbol = "py "; - quarto.symbol = "quarto "; - raku.symbol = "raku "; - ruby.symbol = "rb "; - rust.symbol = "rs "; - scala.symbol = "scala "; - spack.symbol = "spack "; - solidity.symbol = "solidity "; - status.symbol = "[x](bold red) "; - sudo.symbol = "sudo "; - swift.symbol = "swift "; - typst.symbol = "typst "; - terraform.symbol = "terraform "; - zig.symbol = "zig "; - }; - }; - }; -} diff --git a/modules2/starship/format.nix b/modules2/starship/format.nix new file mode 100644 index 00000000..eeed3818 --- /dev/null +++ b/modules2/starship/format.nix @@ -0,0 +1,27 @@ +{ lib, ... }: + +{ + # https://starship.rs/config/#prompt + flake.modules.homeManager.base.programs.starship.settings.format = lib.concatStringsSep "" [ + "\n" + "$username" + "$hostname" + "$directory" + "$vcsh" + "$git_branch" + "$git_status" + "$git_metrics" + "$docker_context" + "$nodejs" + "$php" + "$terraform" + "$nix_shell" + "$direnv" + "\${custom.mob}" + "$memory_usage" + "$cmd_duration" + "$lua" + "$status" + "$character" + ]; +} diff --git a/modules2/starship/mob.nix b/modules2/starship/mob.nix new file mode 100644 index 00000000..fd59ab88 --- /dev/null +++ b/modules2/starship/mob.nix @@ -0,0 +1,7 @@ +{ + flake.modules.homeManager.base.programs.starship.settings.custom.mob = { + command = "echo $MOB_TIMER_ROOM"; + format = "[($output)]($style) "; + when = "[[ -v MOB_TIMER_ROOM ]]"; + }; +} diff --git a/modules2/starship/newline.nix b/modules2/starship/newline.nix new file mode 100644 index 00000000..80920b5a --- /dev/null +++ b/modules2/starship/newline.nix @@ -0,0 +1,3 @@ +{ + flake.modules.homeManager.base.programs.starship.settings.add_newline = false; +} diff --git a/modules2/starship/settings.nix b/modules2/starship/settings.nix new file mode 100644 index 00000000..26b1efe7 --- /dev/null +++ b/modules2/starship/settings.nix @@ -0,0 +1,133 @@ +{ + flake.modules.homeManager.base.programs.starship.settings = { + cmd_duration.disabled = true; + direnv.disabled = false; + directory.format = "[$path]($style) "; + git_status.disabled = true; + nix_shell.disabled = true; + nodejs.disabled = true; + php.disabled = true; + username.disabled = true; + + # https://starship.rs/presets/plain-text + aws.symbol = "aws "; + azure.symbol = "az "; + bun.symbol = "bun "; + c.symbol = "C "; + character = { + success_symbol = "[>](bold green)"; + error_symbol = "[x](bold red)"; + vimcmd_symbol = "[<](bold green)"; + }; + cobol.symbol = "cobol "; + conda.symbol = "conda "; + crystal.symbol = "cr "; + cmake.symbol = "cmake "; + daml.symbol = "daml "; + dart.symbol = "dart "; + deno.symbol = "deno "; + dotnet.symbol = ".NET "; + directory.read_only = " ro"; + docker_context.symbol = "docker "; + elixir.symbol = "exs "; + elm.symbol = "elm "; + fennel.symbol = "fnl "; + fossil_branch.symbol = "fossil "; + gcloud.symbol = "gcp "; + git_branch.symbol = "git "; + git_commit.tag_symbol = " tag "; + git_status = { + ahead = ">"; + behind = "<"; + diverged = "<>"; + renamed = "r"; + deleted = "x"; + }; + gleam.symbol = "gleam "; + golang.symbol = "go "; + gradle.symbol = "gradle "; + guix_shell.symbol = "guix "; + hg_branch.symbol = "hg "; + java.symbol = "java "; + julia.symbol = "jl "; + kotlin.symbol = "kt "; + lua.symbol = "lua "; + nodejs.symbol = "nodejs "; + memory_usage.symbol = "memory "; + meson.symbol = "meson "; + nats.symbol = "nats "; + nim.symbol = "nim "; + nix_shell.symbol = "nix "; + ocaml.symbol = "ml "; + opa.symbol = "opa "; + os.symbols = { + AIX = "aix "; + Alpaquita = "alq "; + AlmaLinux = "alma "; + Alpine = "alp "; + Amazon = "amz "; + Android = "andr "; + Arch = "rch "; + Artix = "atx "; + CentOS = "cent "; + Debian = "deb "; + DragonFly = "dfbsd "; + Emscripten = "emsc "; + EndeavourOS = "ndev "; + Fedora = "fed "; + FreeBSD = "fbsd "; + Garuda = "garu "; + Gentoo = "gent "; + HardenedBSD = "hbsd "; + Illumos = "lum "; + Kali = "kali "; + Linux = "lnx "; + Mabox = "mbox "; + Macos = "mac "; + Manjaro = "mjo "; + Mariner = "mrn "; + MidnightBSD = "mid "; + Mint = "mint "; + NetBSD = "nbsd "; + NixOS = "nix "; + OpenBSD = "obsd "; + OpenCloudOS = "ocos "; + openEuler = "oeul "; + openSUSE = "osuse "; + OracleLinux = "orac "; + Pop = "pop "; + Raspbian = "rasp "; + Redhat = "rhl "; + RedHatEnterprise = "rhel "; + RockyLinux = "rky "; + Redox = "redox "; + Solus = "sol "; + SUSE = "suse "; + Ubuntu = "ubnt "; + Ultramarine = "ultm "; + Unknown = "unk "; + Void = "void "; + Windows = "win "; + }; + package.symbol = "pkg "; + perl.symbol = "pl "; + php.symbol = "php "; + pijul_channel.symbol = "pijul "; + pulumi.symbol = "pulumi "; + purescript.symbol = "purs "; + python.symbol = "py "; + quarto.symbol = "quarto "; + raku.symbol = "raku "; + ruby.symbol = "rb "; + rust.symbol = "rs "; + scala.symbol = "scala "; + spack.symbol = "spack "; + solidity.symbol = "solidity "; + status.symbol = "[x](bold red) "; + sudo.symbol = "sudo "; + swift.symbol = "swift "; + typst.symbol = "typst "; + terraform.symbol = "terraform "; + zig.symbol = "zig "; + }; +} diff --git a/modules2/starship/starship.nix b/modules2/starship/starship.nix new file mode 100644 index 00000000..5839e22c --- /dev/null +++ b/modules2/starship/starship.nix @@ -0,0 +1,3 @@ +{ + flake.modules.homeManager.base.programs.starship.enable = true; +} diff --git a/modules2/starship/zsh.nix b/modules2/starship/zsh.nix new file mode 100644 index 00000000..f9114042 --- /dev/null +++ b/modules2/starship/zsh.nix @@ -0,0 +1,3 @@ +{ + flake.modules.homeManager.base.programs.starship.enableZshIntegration = true; +}