Compare commits
10 commits
630b559cc1
...
84bf107f49
Author | SHA1 | Date | |
---|---|---|---|
84bf107f49 | |||
c2d446f07d | |||
2434f0038f | |||
326ef12cfe | |||
847491e797 | |||
4ffde6b6bc | |||
|
96cf8b4a05 | ||
|
4e08dd54fb | ||
|
65f2a8a364 | ||
|
bad96d3fab |
14 changed files with 139 additions and 129 deletions
2
.github/workflows/update-locks.yml
vendored
2
.github/workflows/update-locks.yml
vendored
|
@ -23,7 +23,7 @@ jobs:
|
|||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@V27
|
||||
|
||||
- uses: DeterminateSystems/update-flake-lock@v23
|
||||
- uses: DeterminateSystems/update-flake-lock@v24
|
||||
with:
|
||||
path-to-flake-dir: "./dev"
|
||||
commit-msg: "chore: update dev flake inputs"
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
"type": "Git",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "catppuccin",
|
||||
"owner": "rose-pine",
|
||||
"repo": "alacritty"
|
||||
},
|
||||
"branch": "main",
|
||||
"revision": "343cf8d65459ac8f6449cc98dd3648bcbd7e3766",
|
||||
"url": "https://github.com/catppuccin/alacritty/archive/343cf8d65459ac8f6449cc98dd3648bcbd7e3766.tar.gz",
|
||||
"hash": "1nh29kkviqp0mz0w7cjmxcp5lgmd4hg5r67fzrvgkg9wgcfidig4"
|
||||
"revision": "3c3e36eb5225b0eb6f1aa989f9d9e783a5b47a83",
|
||||
"url": "https://github.com/rose-pine/alacritty/archive/3c3e36eb5225b0eb6f1aa989f9d9e783a5b47a83.tar.gz",
|
||||
"hash": "1b9ff2a1mmhagmajvq49p2mrb22skdcq3hx6d6pjgk2vxvhhfkrd"
|
||||
},
|
||||
"bat": {
|
||||
"type": "Git",
|
||||
|
@ -316,13 +316,13 @@
|
|||
"type": "Git",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "catppuccin",
|
||||
"owner": "rose-pine",
|
||||
"repo": "palette"
|
||||
},
|
||||
"branch": "main",
|
||||
"revision": "cf765d2269d8a4391355b7f6a6dffe580c69e1c2",
|
||||
"url": "https://github.com/catppuccin/palette/archive/cf765d2269d8a4391355b7f6a6dffe580c69e1c2.tar.gz",
|
||||
"hash": "1i3swy8qlqqfkjh2c3rb6qb2cdggvcgcakwn1z6wk9yjbvh6vsrp"
|
||||
"revision": "d5bbdaaed9b5ad575bce5d924a5a5032f16d8450",
|
||||
"url": "https://github.com/rose-pine/palette/archive/d5bbdaaed9b5ad575bce5d924a5a5032f16d8450.tar.gz",
|
||||
"hash": "12zqwps9l7r1dil7in6x0gv6i4cp10915ydy5ydalwrryywp84z3"
|
||||
},
|
||||
"polybar": {
|
||||
"type": "Git",
|
||||
|
@ -420,6 +420,18 @@
|
|||
"url": "https://github.com/catppuccin/swaylock/archive/77246bbbbf8926bdb8962cffab6616bc2b9e8a06.tar.gz",
|
||||
"hash": "02nql7ry71fxlhj0vsbsxi3jrmfajxmapr9gg0mzp0k0bxwqxa00"
|
||||
},
|
||||
"tm-theme": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "rose-pine",
|
||||
"repo": "tm-theme"
|
||||
},
|
||||
"branch": "main",
|
||||
"revision": "c4235f9a65fd180ac0f5e4396e3a86e21a0884ec",
|
||||
"url": "https://github.com/rose-pine/tm-theme/archive/c4235f9a65fd180ac0f5e4396e3a86e21a0884ec.tar.gz",
|
||||
"hash": "19k0r1mrhqhlf1xfzvd1q8ihpic86f84kbmgy0m314w3w9cbqf4f"
|
||||
},
|
||||
"tmux": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
|
@ -494,4 +506,4 @@
|
|||
}
|
||||
},
|
||||
"version": 3
|
||||
}
|
||||
}
|
|
@ -185,7 +185,6 @@ For [standalone installations](https://nix-community.github.io/home-manager/inde
|
|||
cava.catppuccin.enable = false;
|
||||
gh-dash.catppuccin.enable = false;
|
||||
imv.catppuccin.enable = false;
|
||||
kitty.catppuccin.enable = false; # IFD is introduced by home-manager
|
||||
swaylock.catppuccin.enable = false;
|
||||
};
|
||||
|
||||
|
|
|
@ -16,12 +16,12 @@ repo_name="${1:-}"
|
|||
branch_name="${2:-main}"
|
||||
|
||||
if [ "${repo_name:-}" = "" ]; then
|
||||
echo "error: a repository name is required!" >&2
|
||||
echo "$_usage"
|
||||
exit 1
|
||||
echo "error: a repository name is required!" >&2
|
||||
echo "$_usage"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
npins add github \
|
||||
catppuccin "$repo_name" \
|
||||
rose-pine "$repo_name" \
|
||||
--directory ./.sources \
|
||||
--branch "$branch_name"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
description = "Soothing pastel theme for Nix";
|
||||
description = "Soho vibes for Nix";
|
||||
|
||||
outputs = _: {
|
||||
homeManagerModules.catppuccin = import ./modules/home-manager;
|
||||
nixosModules.catppuccin = import ./modules/nixos;
|
||||
homeManagerModules.rose-pine = import ./modules/home-manager;
|
||||
nixosModules.rose-pine = import ./modules/nixos;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,13 +1,18 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (config.catppuccin) sources;
|
||||
cfg = config.programs.alacritty.catppuccin;
|
||||
enable = cfg.enable && config.programs.alacritty.enable;
|
||||
in
|
||||
{
|
||||
options.programs.alacritty.catppuccin = lib.ctp.mkCatppuccinOpt { name = "alacritty"; };
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (config.rose-pine) sources;
|
||||
cfg = config.programs.alacritty.rose-pine;
|
||||
enable = cfg.enable && config.programs.alacritty.enable;
|
||||
in {
|
||||
options.programs.alacritty.rose-pine = lib.rp.mkRosePineOpt {name = "alacritty";};
|
||||
|
||||
config = lib.mkIf enable {
|
||||
programs.alacritty.settings = lib.importTOML "${sources.alacritty}/catppuccin-${cfg.flavor}.toml";
|
||||
programs.alacritty.settings =
|
||||
if (cfg.flavor == "main")
|
||||
then lib.importTOML "${sources.alacritty}/dist/rose-pine.toml"
|
||||
else lib.importTOML "${sources.alacritty}/dist/rose-pine-${cfg.flavor}.toml";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
[
|
||||
./aerc.nix
|
||||
./alacritty.nix
|
||||
./bat.nix
|
||||
./bottom.nix
|
||||
|
|
|
@ -1,20 +1,25 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (config.catppuccin) sources;
|
||||
cfg = config.programs.bat.catppuccin;
|
||||
enable = cfg.enable && config.programs.bat.enable;
|
||||
themeName = "Catppuccin ${lib.ctp.mkUpper cfg.flavor}";
|
||||
in
|
||||
{
|
||||
options.programs.bat.catppuccin = lib.ctp.mkCatppuccinOpt { name = "bat"; };
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (config.rose-pine) sources;
|
||||
cfg = config.programs.bat.rose-pine;
|
||||
enable = cfg.enable && config.programs.bat.enable;
|
||||
themeName =
|
||||
if (cfg.flavor == "main")
|
||||
then "rose-pine"
|
||||
else "rose-pine-${cfg.flavor}";
|
||||
in {
|
||||
options.programs.bat.rose-pine = lib.rp.mkRosePineOpt {name = "bat";};
|
||||
|
||||
config = lib.mkIf enable {
|
||||
programs.bat = {
|
||||
config.theme = themeName;
|
||||
|
||||
themes.${themeName} = {
|
||||
src = sources.bat;
|
||||
file = "themes/${themeName}.tmTheme";
|
||||
src = sources.tm-theme;
|
||||
file = "dist/themes/${themeName}.tmTheme";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -18,9 +18,14 @@ in
|
|||
};
|
||||
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
source = [ "${sources.hyprland}/themes/${cfg.flavor}.conf" ];
|
||||
"$accent" = "\$${cfg.accent}";
|
||||
"$accentAlpha" = "\$${cfg.accent}Alpha";
|
||||
source = [
|
||||
"${sources.hyprland}/themes/${cfg.flavor}.conf"
|
||||
# Define accents in file to ensure they appear before user vars
|
||||
(builtins.toFile "hyprland-${cfg.accent}-accent.conf" ''
|
||||
$accent = ''$${cfg.accent}
|
||||
$accentAlpha = ''$${cfg.accent}Alpha
|
||||
'')
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -11,9 +11,14 @@ in
|
|||
|
||||
config = lib.mkIf enable {
|
||||
programs.hyprlock.settings = {
|
||||
source = [ "${sources.hyprland}/themes/${cfg.flavor}.conf" ];
|
||||
"$accent" = "\$${cfg.accent}";
|
||||
"$accentAlpha" = "\$${cfg.accent}Alpha";
|
||||
source = [
|
||||
"${sources.hyprland}/themes/${cfg.flavor}.conf"
|
||||
# Define accents in file to ensure they appear before user vars
|
||||
(builtins.toFile "hyprland-${cfg.accent}-accent.conf" ''
|
||||
$accent = ''$${cfg.accent}
|
||||
$accentAlpha = ''$${cfg.accent}Alpha
|
||||
'')
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,54 +3,42 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
}: let
|
||||
# this is a recursive attribute with all the functions below
|
||||
inherit (lib) ctp;
|
||||
in
|
||||
{
|
||||
inherit (lib) rp;
|
||||
in {
|
||||
# string -> type -> string -> a
|
||||
# this is an internal function and shouldn't be
|
||||
# used unless you know what you're doing. it takes
|
||||
# a string (the name of the property, i.e., flavor
|
||||
# or accent), the type of the property, the name of
|
||||
# the module, followed by local config attrset
|
||||
mkBasicOpt =
|
||||
attr: type: name:
|
||||
mkBasicOpt = attr: type: name:
|
||||
lib.mkOption {
|
||||
inherit type;
|
||||
default = config.catppuccin.${attr};
|
||||
description = "Catppuccin ${attr} for ${name}";
|
||||
default = config.rose-pine.${attr};
|
||||
description = "Rose Pine ${attr} for ${name}";
|
||||
};
|
||||
|
||||
# string -> a
|
||||
# this creates a flavor option for modules
|
||||
# the first string should be the name of the module,
|
||||
# followed by the local config attrset
|
||||
mkFlavorOpt = ctp.mkBasicOpt "flavor" ctp.types.flavorOption;
|
||||
mkFlavorOpt = rp.mkBasicOpt "flavor" rp.types.flavorOption;
|
||||
|
||||
types = {
|
||||
flavorOption = lib.types.enum [
|
||||
"latte"
|
||||
"frappe"
|
||||
"macchiato"
|
||||
"mocha"
|
||||
"dawn"
|
||||
"moon"
|
||||
"main"
|
||||
];
|
||||
accentOption = lib.types.enum [
|
||||
"blue"
|
||||
"flamingo"
|
||||
"green"
|
||||
"lavender"
|
||||
"maroon"
|
||||
"mauve"
|
||||
"peach"
|
||||
"pink"
|
||||
"red"
|
||||
"rosewater"
|
||||
"sapphire"
|
||||
"sky"
|
||||
"teal"
|
||||
"yellow"
|
||||
"love"
|
||||
"gold"
|
||||
"rose"
|
||||
"pine"
|
||||
"foam"
|
||||
"iris"
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -58,51 +46,43 @@ in
|
|||
# this capitalizes the first letter in a string,
|
||||
# which is sometimes needed in order to format
|
||||
# the names of themes correctly
|
||||
mkUpper =
|
||||
str:
|
||||
mkUpper = str:
|
||||
(lib.toUpper (builtins.substring 0 1 str)) + (builtins.substring 1 (builtins.stringLength str) str);
|
||||
|
||||
# a -> path -> a
|
||||
# fromJSON but for yaml (and without readFile)
|
||||
# a should be the local pkgs attrset
|
||||
fromYaml =
|
||||
file:
|
||||
let
|
||||
# convert to json
|
||||
json = pkgs.runCommand "converted.json" { } ''
|
||||
${lib.getExe pkgs.yj} < ${file} > $out
|
||||
'';
|
||||
in
|
||||
fromYaml = file: let
|
||||
# convert to json
|
||||
json = pkgs.runCommand "converted.json" {} ''
|
||||
${lib.getExe pkgs.yj} < ${file} > $out
|
||||
'';
|
||||
in
|
||||
builtins.fromJSON (builtins.readFile json);
|
||||
|
||||
# a -> path -> a
|
||||
# fromJSON but for ini (and without readFile)
|
||||
# a should be the local pkgs attrset
|
||||
fromINI =
|
||||
file:
|
||||
let
|
||||
# convert to json
|
||||
json = pkgs.runCommand "converted.json" { } ''
|
||||
${lib.getExe pkgs.jc} --ini < ${file} > $out
|
||||
'';
|
||||
in
|
||||
fromINI = file: let
|
||||
# convert to json
|
||||
json = pkgs.runCommand "converted.json" {} ''
|
||||
${lib.getExe pkgs.jc} --ini < ${file} > $out
|
||||
'';
|
||||
in
|
||||
builtins.fromJSON (builtins.readFile json);
|
||||
|
||||
# a -> path -> a
|
||||
# fromJSON but for raw ini (and without readFile)
|
||||
# a should be the local pkgs attrset
|
||||
fromINIRaw =
|
||||
file:
|
||||
let
|
||||
inherit (builtins) fromJSON readFile;
|
||||
fromINIRaw = file: let
|
||||
inherit (builtins) fromJSON readFile;
|
||||
|
||||
# convert to json
|
||||
json =
|
||||
with pkgs;
|
||||
runCommand "converted.json" { } ''
|
||||
${jc}/bin/jc --ini -r < ${file} > $out
|
||||
'';
|
||||
in
|
||||
# convert to json
|
||||
json = with pkgs;
|
||||
runCommand "converted.json" {} ''
|
||||
${jc}/bin/jc --ini -r < ${file} > $out
|
||||
'';
|
||||
in
|
||||
fromJSON (readFile json);
|
||||
|
||||
# string -> a
|
||||
|
@ -111,24 +91,24 @@ in
|
|||
# of the module, while `enableDefault` is a boolean
|
||||
# representing the default of the created `enable`
|
||||
# option
|
||||
mkCatppuccinOpt =
|
||||
{
|
||||
name,
|
||||
enableDefault ? config.catppuccin.enable,
|
||||
}:
|
||||
{
|
||||
enable = lib.mkEnableOption "Catppuccin theme for ${name}" // {
|
||||
mkRosePineOpt = {
|
||||
name,
|
||||
enableDefault ? config.rose-pine.enable,
|
||||
}: {
|
||||
enable =
|
||||
lib.mkEnableOption "Rose Pine theme for ${name}"
|
||||
// {
|
||||
default = enableDefault;
|
||||
};
|
||||
|
||||
flavor = ctp.mkFlavorOpt name;
|
||||
};
|
||||
flavor = rp.mkFlavorOpt name;
|
||||
};
|
||||
|
||||
# string -> a
|
||||
# this creates an accent option for modules
|
||||
# the first string should be the name of the module,
|
||||
# followed by the local config attrset
|
||||
mkAccentOpt = ctp.mkBasicOpt "accent" ctp.types.accentOption;
|
||||
mkAccentOpt = rp.mkBasicOpt "accent" rp.types.accentOption;
|
||||
|
||||
# a -> a -> a
|
||||
# see https://nlewo.github.io/nixos-manual-sphinx/development/option-types.xml.html
|
||||
|
@ -140,23 +120,22 @@ in
|
|||
# returns the current release version of nixos or home-manager. throws an evaluation error if neither are
|
||||
# found
|
||||
getModuleRelease =
|
||||
config.home.version.release or config.system.nixos.release
|
||||
or (throw "Couldn't determine release version!");
|
||||
config.home.version.release
|
||||
or config.system.nixos.release
|
||||
or (throw "Couldn't determine release version!");
|
||||
|
||||
# string -> a -> a
|
||||
# if the current module release is less than `minVersion`, all options are made no-ops with
|
||||
# `lib.mkSinkUndeclaredOptions`
|
||||
mkVersionedOpts =
|
||||
minVersion: option:
|
||||
if lib.versionAtLeast ctp.getModuleRelease minVersion then
|
||||
option
|
||||
else
|
||||
lib.mkSinkUndeclaredOptions { };
|
||||
mkVersionedOpts = minVersion: option:
|
||||
if lib.versionAtLeast rp.getModuleRelease minVersion
|
||||
then option
|
||||
else lib.mkSinkUndeclaredOptions {};
|
||||
|
||||
# string -> a
|
||||
# this is to ensure users are running a supported version of nixos/home-manager
|
||||
assertMinimumVersion = version: {
|
||||
assertion = lib.versionAtLeast ctp.getModuleRelease version;
|
||||
message = "`catppuccin/nix` requires at least version ${version} of NixOS/home-manager";
|
||||
assertion = lib.versionAtLeast rp.getModuleRelease version;
|
||||
message = "`rose-pine/nix` requires at least version ${version} of NixOS/home-manager";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
}:
|
||||
lib.extend (
|
||||
final: _: {
|
||||
ctp = import ./. {
|
||||
rp = import ./. {
|
||||
inherit config pkgs;
|
||||
lib = final;
|
||||
};
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
catppuccin = {
|
||||
{pkgs, ...}: {
|
||||
rose-pine = {
|
||||
enable = true;
|
||||
sources = {
|
||||
# this is used to ensure that we are able to apply
|
||||
# source overrides without breaking the other sources
|
||||
palette = pkgs.fetchFromGitHub {
|
||||
owner = "catppuccin";
|
||||
owner = "rose-pine";
|
||||
repo = "palette";
|
||||
rev = "16726028c518b0b94841de57cf51f14c095d43d8"; # refs/tags/1.1.1~1
|
||||
hash = "sha256-qZjMlZFTzJotOYjURRQMsiOdR2XGGba8XzXwx4+v9tk=";
|
||||
rev = "d5bbdaaed9b5ad575bce5d924a5a5032f16d8450"; # refs/tags/4.0.1
|
||||
hash = "12zqwps9l7r1dil7in6x0gv6i4cp10915ydy5ydalwrryywp84z3";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
{lib, ...}: {
|
||||
imports = [
|
||||
../modules/home-manager
|
||||
./common.nix
|
||||
|
@ -17,6 +16,7 @@
|
|||
i18n.inputMethod.enabled = "fcitx5";
|
||||
|
||||
programs = {
|
||||
aerc.enable = true;
|
||||
alacritty.enable = true;
|
||||
bat.enable = true;
|
||||
bottom.enable = true;
|
||||
|
@ -35,7 +35,7 @@
|
|||
gitui.enable = true;
|
||||
# this is enabled by default already, but still
|
||||
# listing explicitly so we know it's tested
|
||||
glamour.catppuccin.enable = true;
|
||||
glamour.rose-pine.enable = true;
|
||||
helix.enable = true;
|
||||
hyprlock.enable = true;
|
||||
imv.enable = true;
|
||||
|
|
Loading…
Reference in a new issue