Skip to content

Commit

Permalink
users: otavio: use nix-colors for base16-shell replacement
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Salvador <[email protected]>
  • Loading branch information
otavio committed Nov 21, 2022
1 parent 195d4ae commit 5ce8f87
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 17 deletions.
51 changes: 51 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
inputs.nixpkgs.follows = "nixpkgs";
};

nix-colors.url = "github:misterio77/nix-colors";

emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
Expand Down
6 changes: 5 additions & 1 deletion users/otavio/home/base.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ config, pkgs, inputs, ... }:
let
local-scripts = pkgs.stdenv.mkDerivation {
name = "local-scripts";
Expand All @@ -10,6 +10,10 @@ let
};
in
{
imports = [ inputs.nix-colors.homeManagerModule ];

colorScheme = inputs.nix-colors.colorSchemes.default-dark;

programs.home-manager.enable = true;

home.stateVersion = "22.11";
Expand Down
21 changes: 5 additions & 16 deletions users/otavio/home/zsh.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
{ config, pkgs, ... }:
{ config, pkgs, inputs, ... }:
let
base16-shell = pkgs.stdenv.mkDerivation {
name = "base16-shell";
src = pkgs.fetchFromGitHub {
owner = "base16-project";
repo = "base16-shell";
rev = "41848241532fd60cdda222cc8f7b2bbead9fb50d";
sha256 = "sha256-rkgH8J6RgI3ej04z4gPFHMabaBRZKeaXIHhk0HxXMHo=";
};

installPhase = ''
mkdir -p $out/share/base16-shell
cp -r * $out/share/base16-shell/
'';
};

bitbake-completion = pkgs.stdenv.mkDerivation {
name = "bitbake-completion";
src = pkgs.fetchFromGitHub {
Expand All @@ -29,6 +14,8 @@ let
cp -r * $out/share/bitbake-completion/
'';
};

inherit (inputs.nix-colors.lib-contrib { inherit pkgs; }) shellThemeFromScheme;
in
{
home.packages = with pkgs; [
Expand Down Expand Up @@ -116,6 +103,8 @@ in
[ -s "$BASE16_SHELL_PATH/profile_helper.sh" ] && \
source "$BASE16_SHELL_PATH/profile_helper.sh"
[ -n "$PS1" ] && set_theme ayu-dark
source ${shellThemeFromScheme { scheme = config.colorScheme; }}
'';

initExtra = ''
Expand Down

0 comments on commit 5ce8f87

Please sign in to comment.