diff --git a/flake.lock b/flake.lock index e580fee..0b95a3f 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "base16-schemes": { + "flake": false, + "locked": { + "lastModified": 1654895891, + "narHash": "sha256-xYYmZkHnyLCUBAkqkZ7v1Lc5m39857MukQLMRtGuvdk=", + "owner": "base16-project", + "repo": "base16-schemes", + "rev": "7c247f734eac7f04518c6e28d098635ee8dcabf5", + "type": "github" + }, + "original": { + "owner": "base16-project", + "repo": "base16-schemes", + "type": "github" + } + }, "colmena": { "inputs": { "flake-compat": "flake-compat", @@ -103,6 +119,25 @@ "type": "github" } }, + "nix-colors": { + "inputs": { + "base16-schemes": "base16-schemes", + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1667165773, + "narHash": "sha256-47gEPN7UKrNM+a3OKAFtNQeyc1/sSPgDm3OGCgphCyo=", + "owner": "misterio77", + "repo": "nix-colors", + "rev": "a58fb210eb285920ec10f204d007185b3629cadc", + "type": "github" + }, + "original": { + "owner": "misterio77", + "repo": "nix-colors", + "type": "github" + } + }, "nix-eval-jobs": { "inputs": { "flake-utils": [ @@ -144,12 +179,28 @@ "type": "indirect" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1655599917, + "narHash": "sha256-kjZbt5WdTrnjMxL79okg9TCoRUdADG50x/TWozbyTsE=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "5fb55578aa2f1a502d636a8ac71aece57cb730bb", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "root": { "inputs": { "colmena": "colmena", "emacs-overlay": "emacs-overlay", "flake-utils": "flake-utils", "home-manager": "home-manager", + "nix-colors": "nix-colors", "nixpkgs": "nixpkgs", "sops-nix": "sops-nix" } diff --git a/flake.nix b/flake.nix index d8461fd..babf8fa 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; diff --git a/users/otavio/home/base.nix b/users/otavio/home/base.nix index c88bea0..495ce2e 100644 --- a/users/otavio/home/base.nix +++ b/users/otavio/home/base.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, inputs, ... }: let local-scripts = pkgs.stdenv.mkDerivation { name = "local-scripts"; @@ -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"; diff --git a/users/otavio/home/zsh.nix b/users/otavio/home/zsh.nix index 720fc80..354b1e7 100644 --- a/users/otavio/home/zsh.nix +++ b/users/otavio/home/zsh.nix @@ -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 { @@ -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; [ @@ -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 = ''