diff --git a/flake.nix b/flake.nix index 676e437a..e0acc049 100644 --- a/flake.nix +++ b/flake.nix @@ -18,18 +18,6 @@ font-flake.url = "github:redyf/font-flake"; # waybar-hyprland.url = "github:hyprwm/hyprland"; # Neve.url = "github:redyf/Neve"; - # nur.url = "github:nix-community/NUR"; - - # git+ssh://git@git.example.com/User/repo.git if you're using private repos - # berkeley = { - # url = "git+ssh://git@github.com/redyf/berkeley.git"; - # flake = false; - # }; - - # monolisa-script = { - # url = "git+ssh://git@github.com/redyf/test2.git"; - # flake = false; - # }; }; outputs = { diff --git a/home/redyf/cli-apps/starship/bloated.nix b/home/redyf/cli-apps/starship/bloated.nix new file mode 100644 index 00000000..91dd8d0c --- /dev/null +++ b/home/redyf/cli-apps/starship/bloated.nix @@ -0,0 +1,137 @@ +let + inherit + (builtins) + concatStringsSep + ; + vertical = "║"; +in { + add_newline = false; + format = concatStringsSep "" [ + "\n" + "[╓](bold)" + "$fill" + "\n" + vertical + "$username" + "$hostname" + "$kubernetes" + "$vcsh" + "$git_branch" + "$git_commit" + "$git_state" + "$git_metrics" + "$git_status" + "$hg_branch" + "$docker_context" + "$package" + "$cmake" + "$dart" + "$deno" + "$direnv" + "$dotnet" + "$elixir" + "$elm" + "$erlang" + "$golang" + "$helm" + "$java" + "$julia" + "$kotlin" + "$nim" + "$nodejs" + "$ocaml" + "$perl" + "$php" + "$purescript" + "$python" + "$red" + "$ruby" + "$rust" + "$scala" + "$swift" + "$terraform" + "$vlang" + "$vagrant" + "$zig" + "$nix_shell" + "\${custom.mob}" + "$conda" + "$memory_usage" + "$aws" + "$gcloud" + "$openstack" + "$env_var" + "$crystal" + "$cmd_duration" + "$lua" + "$jobs" + "$battery" + "\n" + vertical + "$directory" + "\n" + vertical + "$status" + " [ $shell](bold)" + "$shlvl" + "$character" + ]; + fill = { + symbol = "─"; + style = "bold"; + }; + directory = { + truncation_length = 0; + format = " [ : $path]($style)[$read_only]($read_only_style) "; + }; + direnv.disabled = false; + shell.disabled = false; + shlvl = { + disabled = false; + threshold = 2; + style = "bold red"; + symbol = ""; + }; + status = { + disabled = false; + symbol = " "; + }; + username = { + show_always = true; + format = " [ $user]($style) "; + }; + git_branch = {format = "[$symbol$branch]($style) ";}; + nix_shell = { + format = "via [$symbol$state]($style) "; + }; + custom.mob = { + command = "echo $MOB_TIMER_ROOM"; + format = "[ ($output)]($style) "; + when = "[[ -v MOB_TIMER_ROOM ]]"; + }; + + # https://starship.rs/presets/nerd-font.html + aws.symbol = " "; + conda.symbol = " "; + dart.symbol = " "; + directory.read_only = " "; + docker_context.symbol = " "; + elixir.symbol = " "; + elm.symbol = " "; + git_branch.symbol = " "; + golang.symbol = " "; + hg_branch.symbol = " "; + java.symbol = " "; + julia.symbol = " "; + memory_usage.symbol = "󰍛 "; + nim.symbol = " "; + nix_shell.symbol = " "; + package.symbol = "󰏗 "; + perl.symbol = " "; + php.symbol = " "; + python.symbol = " "; + ruby.symbol = " "; + rust.symbol = " "; + scala.symbol = " "; + swift.symbol = "ﯣ "; +} diff --git a/home/redyf/cli-apps/starship/default.nix b/home/redyf/cli-apps/starship/default.nix index 7d07078b..7e1578bf 100644 --- a/home/redyf/cli-apps/starship/default.nix +++ b/home/redyf/cli-apps/starship/default.nix @@ -1,279 +1,12 @@ {pkgs, ...}: { - home.packages = with pkgs; [starship]; programs.starship = let - flavour = "macchiato"; # One of `latte`, `frappe`, `macchiato`, or `mocha` + mochaPreset = import ./mocha.nix; + oxocarbonPreset = import ./oxocarbon.nix; + bloatedPreset = import ./bloated.nix; + catppuccinPreset = import ./catppuccin.nix {inherit pkgs;}; in { enable = true; enableZshIntegration = true; - settings = - # Catppuccin - { - scan_timeout = 30; - command_timeout = 2000; - add_newline = false; - line_break.disabled = false; - right_format = '' - $all - ''; - character = { - success_symbol = "[](#cbced3)"; - error_symbol = "[](#dd6777) "; - vicmd_symbol = "[](#ecd3a0)"; - # format = "$symbol[ ](bold #b4befe) "; - format = "$symbol[λ ](bold #b4befe) "; - }; - - # format = '' - # $directory$git_branch$git_state$git_metrics$dart$lua$nodejs$package$python$rust$nix_shell$custom - # $character - # ''; - - format = '' - $directory - $character - ''; - - palette = "catppuccin_${flavour}"; - - aws = { - format = "on [$symbol($profile )(\($region) )]($style)"; - style = "bold blue"; - symbol = " "; - }; - - dart = { - format = "via [$symbol($version )]($style)"; - symbol = "[]($style) "; - style = "bold blue"; - }; - - direnv = { - format = "[$symbol$loaded/$allowed]($style) "; - symbol = "direnv "; - style = "bold orange"; - disabled = true; - }; - - docker_context = { - disabled = true; - }; - - elixir = { - format = "via [$symbol($version \(OTP $otp_version\) )]($style)"; - symbol = " "; - style = "bold purple"; - }; - - git_branch = { - format = "on [$symbol$branch(:$remote_branch)]($style) "; - symbol = " "; - style = "bold purple"; - }; - - git_commit = { - format = "[\($hash$tag\)]($style) "; - commit_hash_length = 7; - style = "bold green"; - }; - - golang = { - format = "via [$symbol($version )]($style)"; - style = "bold blue"; - symbol = "[ ]($style)"; - }; - - haskell = { - format = "via [$symbol($version )]($style)"; - symbol = "λ "; - style = "bold purple"; - }; - - kubernetes = { - symbol = "☸ "; - disabled = false; - detect_files = ["Dockerfile"]; - format = "[$context(\[$namespace\])]($style) "; - }; - - lua = { - format = "via [$symbol($version )]($style)"; - symbol = "[]($style) "; - style = "bold blue"; - }; - - nix_shell = { - format = "via [$symbol$state( \($name\))]($style) "; - symbol = "󱄅 "; - style = "bold blue"; - disabled = false; - }; - - nodejs = { - format = "via [$symbol($version )]($style)"; - style = "bold green"; - symbol = " "; - version_format = "v$raw(blue)"; - }; - - ocaml = { - format = "via [$symbol($version )(\($switch_indicator$switch_name\) )]($style)"; - symbol = "🐫 "; - style = "bold yellow"; - version_format = "v$raw"; - }; - - package = { - format = "is [$symbol$version]($style) "; - symbol = " "; - style = "bold 208"; - }; - - python = { - format = "via [$symbol$pyenv_prefix($version )(\($virtualenv\) )]($style)"; - symbol = "[]($style) "; - style = "bold blue"; - }; - - rust = { - format = "via [$symbol($version )]($style)"; - symbol = "[]($style) "; - style = "bold #f74b00"; - }; - - shell = { - disabled = true; - zsh_indicator = "zsh"; - }; - - custom = { - nix = { - disabled = true; - detect_files = ["flake.nix" "default.nix" "shell.nix"]; - # format = "via [$symbol nix-shell]($style) "; - # command = '' - # if [ -e flake.nix ] || [ -e default.nix ] || [ -e shell.nix ]; then - # echo " (nix-shell)" - # fi - # ''; - format = "[$symbol$output]($style)"; - style = "bold blue"; - symbol = "[](bold blue) "; - }; - }; - - username = { - show_always = false; - style_user = "bold bg:none fg:#7aa2f7"; - format = "[$user]($style)"; - }; - - hostname = { - disabled = true; - ssh_only = false; - style = "bold bg:none fg:#CDD6F4"; - format = "@[$hostname]($style) "; - }; - - directory = { - read_only = " "; - truncation_length = 3; - truncation_symbol = "./"; - # style = "bold bg:none fg:#7aa2f7"; - style = "bold bg:none fg:#b4befe"; - # style = "bold bg:none fg:#ec6a88"; - }; - - time = { - disabled = true; - use_12hr = true; - time_range = "-"; - time_format = "%R"; - utc_time_offset = "local"; - format = "[ $time 󰥔]($style) "; - style = "bold #393939"; - }; - } - // builtins.fromTOML (builtins.readFile (pkgs.fetchFromGitHub - { - owner = "catppuccin"; - repo = "starship"; - rev = "HEAD"; - sha256 = "sha256-KzXO4dqpufxTew064ZLp3zKIXBwbF8Bi+I0Xa63j/lI="; - } - + /palettes/${flavour}.toml)); + settings = oxocarbonPreset; }; - # Mocha - # { - # add_newline = false; - # format = '' - # [](#b4befe)[  ](bg:#b4befe fg:black)[](bg:black fg:#b4befe)$directory[](black) $git_branch$nix_shell - # $character - # ''; - # directory = { - # format = "[ $path ]($style)"; - # style = "bg:black"; - # truncate_to_repo = false; - # }; - # git_branch = { - # style = "bold yellow"; - # }; - # character = { - # success_symbol = "[🠚 ](bold #b4befe)"; - # error_symbol = "[🠚 ](bold #dd6777)"; - # }; - # nix_shell = { - # symbol = "[](bold #7aa2f7) "; - # }; - # }; - # Oxocarbon - # { - # scan_timeout = 10; - # add_newline = true; - # line_break.disabled = false; - # format = "$symbol[󰉊 ](bold #ee5396) $directory$character"; - # right_format = "$time"; - # character = { - # success_symbol = "[󰅂 ](bold #393939)"; - # error_symbol = "[󰅂 ](bold #393939)"; - # vicmd_symbol = "[󰅂 ](bold #393939)"; - # }; - # username = { - # show_always = false; - # style_user = "bold bg:none fg:#7aa2f7"; - # format = "[$user]($style)"; - # }; - # - # hostname = { - # disabled = true; - # ssh_only = false; - # style = "bold bg:none fg:#CDD6F4"; - # format = "@[$hostname]($style) "; - # }; - # - # directory = { - # read_only = " "; - # truncation_length = 3; - # truncation_symbol = "./"; - # style = "bold bg:none fg:#393939"; - # }; - # - # time = { - # disabled = false; - # use_12hr = true; - # time_range = "-"; - # time_format = "%R"; - # utc_time_offset = "local"; - # format = "[ $time 󰥔]($style) "; - # style = "bold #393939"; - # }; - # - # nix_shell = { - # disabled = false; - # heuristic = false; - # impure_msg = "[impure-shell](red)"; - # pure_msg = "[pure-shell](green)"; - # unknown_msg = "[unknown-shell](yellow)"; - # }; - # }; - # }; } diff --git a/home/redyf/cli-apps/starship/macchiato.nix b/home/redyf/cli-apps/starship/macchiato.nix new file mode 100644 index 00000000..84fa0450 --- /dev/null +++ b/home/redyf/cli-apps/starship/macchiato.nix @@ -0,0 +1,201 @@ +{pkgs}: let + flavour = "macchiato"; # One of `latte`, `frappe`, `macchiato`, or `mocha` +in + { + scan_timeout = 30; + command_timeout = 2000; + add_newline = false; + line_break.disabled = false; + right_format = '' + $all + ''; + character = { + success_symbol = "[](#cbced3)"; + error_symbol = "[](#dd6777) "; + vicmd_symbol = "[](#ecd3a0)"; + # format = "$symbol[ ](bold #b4befe) "; + # format = "$symbol[λ ](bold #b4befe) "; + format = "$symbol[>](#b4befe) "; + }; + + format = '' + $directory$git_branch$git_state$git_metrics$dart$lua$nodejs$package$python$rust$nix_shell$custom + $character + ''; + + # format = '' + # $username$git_branch$git_state$git_status$git_commit$git_metrics$nix_shell$aws + # $directory$character + # ''; + + palette = "catppuccin_${flavour}"; + + aws = { + format = "on [$symbol($profile )(\($region) )]($style)"; + style = "bold blue"; + symbol = " "; + }; + + dart = { + format = "via [$symbol($version )]($style)"; + symbol = "[]($style) "; + style = "bold blue"; + }; + + direnv = { + format = "[$symbol$loaded/$allowed]($style) "; + symbol = "direnv "; + style = "bold orange"; + disabled = true; + }; + + docker_context = { + disabled = true; + }; + + elixir = { + format = "via [$symbol($version \(OTP $otp_version\) )]($style)"; + symbol = " "; + style = "bold purple"; + }; + + git_branch = { + format = "on [$symbol$branch(:$remote_branch)]($style) "; + symbol = " "; + style = "bold purple"; + }; + + git_commit = { + format = "[\($hash$tag\)]($style) "; + commit_hash_length = 7; + style = "bold green"; + }; + + golang = { + format = "via [$symbol($version )]($style)"; + style = "bold blue"; + symbol = "[ ]($style)"; + }; + + haskell = { + format = "via [$symbol($version )]($style)"; + symbol = "λ "; + style = "bold purple"; + }; + + kubernetes = { + symbol = "☸ "; + disabled = false; + detect_files = ["Dockerfile"]; + format = "[$context(\[$namespace\])]($style) "; + }; + + lua = { + format = "via [$symbol($version )]($style)"; + symbol = "[]($style) "; + style = "bold blue"; + }; + + nix_shell = { + symbol = " "; + format = "via [$symbol$state]($style) "; + # symbol = "󱄅 "; + # format = "via [$symbol$state( \($name\))]($style) "; + style = "bold blue"; + disabled = false; + }; + + nodejs = { + format = "via [$symbol($version )]($style)"; + style = "bold green"; + symbol = " "; + version_format = "v$raw(blue)"; + }; + + ocaml = { + format = "via [$symbol($version )(\($switch_indicator$switch_name\) )]($style)"; + symbol = "🐫 "; + style = "bold yellow"; + version_format = "v$raw"; + }; + + package = { + format = "is [$symbol$version]($style) "; + symbol = " "; + style = "bold 208"; + }; + + python = { + format = "via [$symbol$pyenv_prefix($version )(\($virtualenv\) )]($style)"; + symbol = "[]($style) "; + style = "bold blue"; + }; + + rust = { + format = "via [$symbol($version )]($style)"; + symbol = "[]($style) "; + style = "bold #f74b00"; + }; + + shell = { + disabled = true; + zsh_indicator = "zsh"; + }; + + custom = { + nix = { + disabled = true; + detect_files = ["flake.nix" "default.nix" "shell.nix"]; + # format = "via [$symbol nix-shell]($style) "; + # command = '' + # if [ -e flake.nix ] || [ -e default.nix ] || [ -e shell.nix ]; then + # echo " (nix-shell)" + # fi + # ''; + format = "[$symbol$output]($style)"; + style = "bold blue"; + symbol = "[](bold blue) "; + }; + }; + + username = { + show_always = true; + # style_user = "bold bg:none fg:#7aa2f7"; + # format = "[$user]($style)"; + format = "[ $user]($style) "; + }; + + hostname = { + disabled = true; + ssh_only = false; + style = "bold bg:none fg:#CDD6F4"; + format = "@[$hostname]($style) "; + }; + + directory = { + read_only = " "; + truncation_length = 3; + truncation_symbol = "./"; + # style = "bold bg:none fg:#7aa2f7"; + style = "bold bg:none fg:#b4befe"; + # style = "bold bg:none fg:#ec6a88"; + }; + + time = { + disabled = true; + use_12hr = true; + time_range = "-"; + time_format = "%R"; + utc_time_offset = "local"; + format = "[ $time 󰥔]($style) "; + style = "bold #393939"; + }; + } + // builtins.fromTOML (builtins.readFile (pkgs.fetchFromGitHub + { + owner = "catppuccin"; + repo = "starship"; + rev = "HEAD"; + sha256 = "sha256-KzXO4dqpufxTew064ZLp3zKIXBwbF8Bi+I0Xa63j/lI="; + } + + /palettes/${flavour}.toml)) diff --git a/home/redyf/cli-apps/starship/mocha.nix b/home/redyf/cli-apps/starship/mocha.nix new file mode 100644 index 00000000..941eb1a6 --- /dev/null +++ b/home/redyf/cli-apps/starship/mocha.nix @@ -0,0 +1,22 @@ +{ + add_newline = false; + format = '' + [](#b4befe)[  ](bg:#b4befe fg:black)[](bg:black fg:#b4befe)$directory[](black) $git_branch$nix_shell + $character + ''; + directory = { + format = "[ $path ]($style)"; + style = "bg:black"; + truncate_to_repo = false; + }; + git_branch = { + style = "bold yellow"; + }; + character = { + success_symbol = "[🠚 ](bold #b4befe)"; + error_symbol = "[🠚 ](bold #dd6777)"; + }; + nix_shell = { + symbol = "[](bold #7aa2f7) "; + }; +} diff --git a/home/redyf/cli-apps/starship/oxocarbon.nix b/home/redyf/cli-apps/starship/oxocarbon.nix new file mode 100644 index 00000000..f54ea161 --- /dev/null +++ b/home/redyf/cli-apps/starship/oxocarbon.nix @@ -0,0 +1,49 @@ +{ + scan_timeout = 10; + add_newline = true; + line_break.disabled = false; + format = "$symbol[󰉊 ](bold #ee5396) $directory$character"; + right_format = "$time"; + character = { + success_symbol = "[󰅂 ](bold #393939)"; + error_symbol = "[󰅂 ](bold #393939)"; + vicmd_symbol = "[󰅂 ](bold #393939)"; + }; + username = { + show_always = false; + style_user = "bold bg:none fg:#7aa2f7"; + format = "[$user]($style)"; + }; + + hostname = { + disabled = true; + ssh_only = false; + style = "bold bg:none fg:#CDD6F4"; + format = "@[$hostname]($style) "; + }; + + directory = { + read_only = " "; + truncation_length = 3; + truncation_symbol = "./"; + style = "bold bg:none fg:#393939"; + }; + + time = { + disabled = false; + use_12hr = true; + time_range = "-"; + time_format = "%R"; + utc_time_offset = "local"; + format = "[ $time 󰥔]($style) "; + style = "bold #393939"; + }; + + nix_shell = { + disabled = false; + heuristic = false; + impure_msg = "[impure-shell](red)"; + pure_msg = "[pure-shell](green)"; + unknown_msg = "[unknown-shell](yellow)"; + }; +} diff --git a/home/redyf/system/nix/default.nix b/home/redyf/system/nix/default.nix index 95cbeed7..3221d7d7 100644 --- a/home/redyf/system/nix/default.nix +++ b/home/redyf/system/nix/default.nix @@ -4,5 +4,6 @@ statix alejandra nix-init + nixpkgs-review ]; } diff --git a/hosts/redyf/configuration.nix b/hosts/redyf/configuration.nix index c3704ee0..7f6c5a8d 100644 --- a/hosts/redyf/configuration.nix +++ b/hosts/redyf/configuration.nix @@ -93,6 +93,9 @@ in { # avoid checking if IP is already taken to boot a few seconds faster dhcpcd.extraConfig = "noarp"; hostName = "redyf"; # Define your hostname. + firewall = { + enable = true; + }; # wireless.enable = true; # Enables wireless support via wpa_supplicant. # Configure network proxy if necessary # proxy.default = "http://user:password@proxy:port/"; @@ -158,10 +161,8 @@ in { base16Scheme = "${pkgs.base16-schemes}/share/themes/${theme}.yaml"; fonts = { monospace = { - # package = with pkgs; nerdfonts.override {fonts = ["FiraCode"];}; - # name = "FiraCode Nerd Font Mono Med"; package = with pkgs; inputs.font-flake.packages.${system}.sf-mono; - name = "Liga SFMono Nerd Font"; + name = "Liga SFMono Nerd Font Medium"; }; sansSerif = { package = pkgs.dejavu_fonts; @@ -293,11 +294,11 @@ in { ''; }; desktopManager = { - xfce.enable = false; + xfce.enable = true; }; windowManager = { awesome = { - enable = true; + enable = false; luaModules = with pkgs.luaPackages; [ luarocks ]; diff --git a/shells/default/default.nix b/shells/default/default.nix deleted file mode 100644 index a0230900..00000000 --- a/shells/default/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{pkgs, ...}: -pkgs.mkShell { - nativeBuildInputs = with pkgs; [ - treefmt - - alejandra - python310Packages.mdformat - shfmt - ]; -} diff --git a/shells/go/shell.nix b/shells/go/shell.nix deleted file mode 100644 index 513a8904..00000000 --- a/shells/go/shell.nix +++ /dev/null @@ -1,6 +0,0 @@ -{pkgs ? import {}}: -pkgs.mkShell { - nativeBuildInputs = with pkgs; [ - go - ]; -} diff --git a/shells/java/shell.nix b/shells/java/shell.nix deleted file mode 100644 index 427da20e..00000000 --- a/shells/java/shell.nix +++ /dev/null @@ -1,18 +0,0 @@ -{pkgs ? import {}}: -pkgs.mkShell { - nativeBuildInputs = with pkgs; [ - # TODO: Disabled some of them to install with mason - jdk # Java dev kit - # jdt-language-server # Jdtls integration - # checkstyle # Linter - # google-java-format # Formatter - # vscode-extensions.vscjava.vscode-java-debug - # vscode-extensions.vscjava.vscode-java-test - maven # Build automation tool for java - # gradle # Enterprise-grade build system - # spring-boot-cli - ]; - shellHook = '' - echo "Environment is ready" | ${pkgs.lolcat}/bin/lolcat; - ''; -} diff --git a/shells/js/shell.nix b/shells/js/shell.nix deleted file mode 100644 index 54e32ff6..00000000 --- a/shells/js/shell.nix +++ /dev/null @@ -1,15 +0,0 @@ -{pkgs ? import {}}: -pkgs.mkShell { - nativeBuildInputs = with pkgs; [ - bun - nodejs - typescript - nodePackages.npm # Package manager - nodePackages_latest.pnpm - nodePackages_latest.ts-node - nodePackages_latest.dotenv-cli - ]; - shellHook = '' - echo "Environment is ready" | ${pkgs.lolcat}/bin/lolcat; - ''; -} diff --git a/shells/lua/shell.nix b/shells/lua/shell.nix deleted file mode 100644 index 05885daa..00000000 --- a/shells/lua/shell.nix +++ /dev/null @@ -1,13 +0,0 @@ -{pkgs ? import {}}: -pkgs.mkShell { - nativeBuildInputs = with pkgs; [ - lua # Lua programming language - stylua # Lua formatter - selene # Lua linter written in rust - lua-language-server # Lua LSP - luajitPackages.luarocks-nix # Package manager for Lua on Nix - ]; - shellHook = '' - echo "Environment is ready" | ${pkgs.lolcat}/bin/lolcat; - ''; -} diff --git a/shells/python/default.nix b/shells/python/default.nix deleted file mode 100644 index 62680ea0..00000000 --- a/shells/python/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{pkgs ? import {}}: -pkgs.mkShell { - buildInputs = with pkgs.python311Packages; [ - pip - pypresence - ]; - shellHook = '' - echo "Environment is ready" | ${pkgs.lolcat}/bin/lolcat; - ''; -} diff --git a/shells/rust/shell.nix b/shells/rust/shell.nix deleted file mode 100644 index 81f30a35..00000000 --- a/shells/rust/shell.nix +++ /dev/null @@ -1,15 +0,0 @@ -{pkgs ? import {}}: -pkgs.mkShell { - nativeBuildInputs = with pkgs; [ - cargo # Downloads your Rust project's dependencies and builds your project - clippy # A bunch of lints to catch common mistakes and improve your Rust code - lldb # A next-generation high-performance debugger - rust-analyzer # Lsp for rust - rustc # Compiler for rust - rustfmt # Formatter for rust language - # rustup # The Rust toolchain installer - ]; - shellHook = '' - echo "Environment is ready" | ${pkgs.lolcat}/bin/lolcat; - ''; -}