diff --git a/flake.nix b/flake.nix index 8d54441..09ef00a 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,5 @@ { description = "Soothing pastel theme for Nix"; - inputs = {}; outputs = { self }: { nixosModules.default = import ./nixos; homeManagerModules.default = import ./home-manager; diff --git a/home-manager/bat.nix b/home-manager/bat.nix index d967386..8571baa 100644 --- a/home-manager/bat.nix +++ b/home-manager/bat.nix @@ -1,6 +1,8 @@ -{ config, pkgs, lib, ... }: { +{ config, pkgs, lib, ... }: +let cfg = config.programs.bat.catppuccin; in +{ options.programs.bat.catppuccin = { - enable = lib.mkEnableOption "Catppuccin"; + enable = lib.mkEnableOption "Catppuccin theme"; flavour = lib.mkOption { type = lib.types.enum [ "latte" "frappe" "macchiato" "mocha" ]; default = config.catppuccin.flavour; @@ -8,13 +10,8 @@ }; }; - config = let - cfg = config.programs.bat.catppuccin; - in - { - home.activation = { - batCache = "${pkgs.bat}/bin/bat cache --build"; - }; + config = { + home.activation.batCache = "${pkgs.bat}/bin/bat cache --build"; programs.bat = lib.mkIf cfg.enable { enable = true; diff --git a/home-manager/default.nix b/home-manager/default.nix index 692c52c..9ba6b77 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -1,6 +1,7 @@ { config, pkgs, lib, ... }: { imports = [ ./bat.nix + ./starship.nix ]; options.catppuccin = { flavour = lib.mkOption { diff --git a/home-manager/starship.nix b/home-manager/starship.nix new file mode 100644 index 0000000..ea02684 --- /dev/null +++ b/home-manager/starship.nix @@ -0,0 +1,25 @@ +{ config, pkgs, lib, ... }: +let cfg = config.programs.starship.catppuccin; in +{ + options.programs.starship.catppuccin = { + enable = lib.mkEnableOption "Catppuccin theme"; + flavour = lib.mkOption { + type = lib.types.enum [ "latte" "frappe" "macchiato" "mocha" ]; + default = config.catppuccin.flavour; + description = "Catppuccin flavour for starship"; + }; + }; + + config.programs.starship.settings = lib.mkIf cfg.enable + ({ + format = lib.mkDefault "$all"; + palette = "catppuccin_${cfg.flavour}"; + } // builtins.fromTOML (builtins.readFile + (pkgs.fetchFromGitHub + { + owner = "catppuccin"; + repo = "starship"; + rev = "3e3e54410c3189053f4da7a7043261361a1ed1bc"; + sha256 = "sha256-soEBVlq3ULeiZFAdQYMRFuswIIhI9bclIU8WXjxd7oY="; + } + /palettes/${cfg.flavour}.toml))); +} diff --git a/nixos/default.nix b/nixos/default.nix index 908fef4..baa56cb 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -1 +1 @@ -{ pkgs, lib, ... }: {} +{ pkgs, lib, ... }: { }