From 577054a9e52278dbc920a206a3256f2769acc38a Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 11 Aug 2023 19:55:56 +0100 Subject: [PATCH] feat(zsh): show ASCII logo in a new terminal --- flake.nix | 4 ++-- logo.txt | 13 +++++++++++++ system/nixos/default.nix | 4 ++-- system/nixos/home-manager.nix | 4 ++-- system/shared/home-manager.nix | 10 +++++++++- system/wsl2/default.nix | 4 ++-- 6 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 logo.txt diff --git a/flake.nix b/flake.nix index 327aa81..ea410f4 100644 --- a/flake.nix +++ b/flake.nix @@ -11,8 +11,8 @@ system = "x86_64-linux"; username = "opdavies"; - nixos-system = import ./system/nixos { inherit inputs username; }; - wsl-system = import ./system/wsl2 { inherit inputs system username; }; + nixos-system = import ./system/nixos { inherit inputs self username; }; + wsl-system = import ./system/wsl2 { inherit inputs self system username; }; in flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "x86_64-linux" ]; diff --git a/logo.txt b/logo.txt new file mode 100644 index 0000000..f1553b8 --- /dev/null +++ b/logo.txt @@ -0,0 +1,13 @@ + + ⠀⠀⠀⠀⠀⠀⣀⣤⣤⣤⣤⣤⣤⣀⢀⣠⣤⡶⠾⠿⠿⠿⠷⣶⣤⣀⠀⠀⠀⠀ + ⠀⠀⠀⣠⣶⠟⠋⠉⠀⠀⢀⣤⣭⠝⠻⣶⣅⠀⠀⠀⡀⠀⠀⠀⠉⠻⣷⣄⠀⠀ + ⠀⠀⣾⡿⠀⠀⠀⢠⣴⣶⣾⣿⡄⠀⠀⢨⣿⣷⡿⠿⠿⢿⣷⣦⠀⠀⠈⢿⣦⠀ + ⠀⣾⠏⠀⠀⣠⡾⠟⠉⠉⠉⠉⠻⣷⣄⠹⣿⡁⠀⠀⠀⠀⠈⠹⣷⡀⠀⠈⣿⡄ + ⣸⡏⠀⠀⣰⡟⠁⠀⠀⠀⠀⠀⠀⠈⢻⣆⢻⣧⠀⠀⠀⠀⠀⠀⠸⣷⠀⠀⢸⣷ + ⣿⡇⠀⠀⣿⡃⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠀⢻⣇⠀⠀⠀⠀⠀⠀⣿⠀⠀⢸⣿ + ⢻⡇⠀⠀⢿⣇⠀⠀⠀⠀⠀⠀⠀⠀⣸⡟⠀⠈⣿⣆⠀⠀⠀⢀⣼⡟⠀⠀⣼⡇ + ⠘⣿⡄⠀⠈⢻⣦⣀⠀⠀⠀⠀⣀⣴⠟⣿⡄⢠⣿⣿⣄⣤⣶⠟⠋⠀⢀⣴⡟⠀ + ⠀⠹⣿⡀⠀⠈⠙⠿⣿⣧⣼⣿⠿⠋⠀⠹⣧⢻⠋⠹⠟⠋⠉⠀⠀⣠⣼⠟⠁⠀ + ⠀⠀⠈⠻⣦⣄⡀⠀⠀⠀⠀⠀⠀⢀⣠⣶⢻⣧⠀⠀⢀⣀⣤⣶⠿⠋⠁⠀⠀⠀ + ⠀⠀⠀⠀⠈⠙⠻⠿⠶⣶⣶⠶⠿⠛⠋⠀⠀⢻⣷⠾⠛⠋⠁⠀⠀⠀⠀⠀⠀⠀ + diff --git a/system/nixos/default.nix b/system/nixos/default.nix index 3e66571..8ba0292 100644 --- a/system/nixos/default.nix +++ b/system/nixos/default.nix @@ -1,4 +1,4 @@ -{ inputs, username }: +{ inputs, self, username }: { desktop }: @@ -10,7 +10,7 @@ inputs.nixpkgs.lib.nixosSystem { modules = [ inputs.home-manager.nixosModules.home-manager { home-manager = { - extraSpecialArgs = { inherit inputs desktop username; }; + extraSpecialArgs = { inherit inputs desktop self username; }; useGlobalPkgs = true; useUserPackages = true; users."${username}" = import ./home-manager.nix; diff --git a/system/nixos/home-manager.nix b/system/nixos/home-manager.nix index f5d5ed7..0cce006 100644 --- a/system/nixos/home-manager.nix +++ b/system/nixos/home-manager.nix @@ -1,8 +1,8 @@ -{ inputs, desktop, username, config, pkgs, ... }: +{ inputs, config, desktop, pkgs, self, username, ... }: let desktop-config = import ./home-manager-desktop.nix { inherit config inputs pkgs; }; - shared-config = import ../shared/home-manager.nix { inherit inputs pkgs username; }; + shared-config = import ../shared/home-manager.nix { inherit inputs pkgs self username; }; shared-packages = import ../shared/home-manager-packages.nix { inherit inputs pkgs; }; in { diff --git a/system/shared/home-manager.nix b/system/shared/home-manager.nix index c9a902c..707026e 100644 --- a/system/shared/home-manager.nix +++ b/system/shared/home-manager.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, username }: +{ inputs, pkgs, self, username }: let vim-astro = pkgs.vimUtils.buildVimPlugin { @@ -207,12 +207,20 @@ in }; }; + home.file."logo.txt" = { + source = pkgs.copyPathToStore "${self}/logo.txt"; + target = "logo.txt"; + }; + programs.zsh = { enable = true; enableCompletion = false; dotDir = ".config/zsh"; initExtra = '' + # Show the logo at the start of each prompt. + cat ~/logo.txt + # Plugins source "''${ZPLUG_REPOS}/robbyrussell/oh-my-zsh/plugins/git/git.plugin.zsh" source "''${ZPLUG_REPOS}/robbyrussell/oh-my-zsh/plugins/vi-mode/vi-mode.plugin.zsh" diff --git a/system/wsl2/default.nix b/system/wsl2/default.nix index 7fcdc50..0122404 100644 --- a/system/wsl2/default.nix +++ b/system/wsl2/default.nix @@ -1,9 +1,9 @@ -{ inputs, system, username }: +{ inputs, self, system, username }: let pkgs = inputs.nixpkgs.legacyPackages."${system}"; - shared-config = import ../shared/home-manager.nix { inherit inputs pkgs username; }; + shared-config = import ../shared/home-manager.nix { inherit inputs pkgs self username; }; shared-packages = import ../shared/home-manager-packages.nix { inherit inputs pkgs; }; in inputs.home-manager.lib.homeManagerConfiguration {