Skip to content

Commit 18419d5

Browse files
feat(nixos): init console module (#69)
1 parent 948fe71 commit 18419d5

File tree

5 files changed

+76
-0
lines changed

5 files changed

+76
-0
lines changed

_sources/generated.json

+20
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,26 @@
299299
},
300300
"version": "5e36ca599f4aa41bdd87fbf2c5aae4397ac55074"
301301
},
302+
"palette": {
303+
"cargoLocks": null,
304+
"date": "2024-01-02",
305+
"extract": null,
306+
"name": "palette",
307+
"passthru": null,
308+
"pinned": false,
309+
"src": {
310+
"deepClone": false,
311+
"fetchSubmodules": false,
312+
"leaveDotGit": false,
313+
"name": null,
314+
"owner": "catppuccin",
315+
"repo": "palette",
316+
"rev": "7f103c3e11f7f705ee1fb8ac430d90a798bbdfcb",
317+
"sha256": "sha256-W1Bj/407i2XT7CmCBoFe2PCe10MB8lmnEQsWXSrJ6zg=",
318+
"type": "github"
319+
},
320+
"version": "7f103c3e11f7f705ee1fb8ac430d90a798bbdfcb"
321+
},
302322
"polybar": {
303323
"cargoLocks": null,
304324
"date": "2022-10-05",

_sources/generated.nix

+12
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,18 @@
181181
};
182182
date = "2023-12-31";
183183
};
184+
palette = {
185+
pname = "palette";
186+
version = "7f103c3e11f7f705ee1fb8ac430d90a798bbdfcb";
187+
src = fetchFromGitHub {
188+
owner = "catppuccin";
189+
repo = "palette";
190+
rev = "7f103c3e11f7f705ee1fb8ac430d90a798bbdfcb";
191+
fetchSubmodules = false;
192+
sha256 = "sha256-W1Bj/407i2XT7CmCBoFe2PCe10MB8lmnEQsWXSrJ6zg=";
193+
};
194+
date = "2024-01-02";
195+
};
184196
polybar = {
185197
pname = "polybar";
186198
version = "9ee66f83335404186ce979bac32fcf3cd047396a";

modules/nixos/console.nix

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{ config
2+
, lib
3+
, sources
4+
, ...
5+
}:
6+
let
7+
cfg = config.console.catppuccin;
8+
enable = cfg.enable && config.console.enable;
9+
palette = (lib.importJSON "${sources.palette}/palette.json").${cfg.flavour}.colors;
10+
in
11+
{
12+
options.console.catppuccin =
13+
lib.ctp.mkCatppuccinOpt "console";
14+
15+
config.console.colors = lib.mkIf enable (
16+
# Manually populate with colors from catppuccin/tty
17+
# Make sure to strip initial # from hex codes
18+
map (color: (builtins.substring 1 6 palette.${color}.hex)) [
19+
"base"
20+
"red"
21+
"green"
22+
"yellow"
23+
"blue"
24+
"pink"
25+
"teal"
26+
"subtext1"
27+
28+
"surface2"
29+
"red"
30+
"green"
31+
"yellow"
32+
"blue"
33+
"pink"
34+
"teal"
35+
"subtext0"
36+
]
37+
);
38+
}

nvfetcher.toml

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ fetch.github = "catppuccin/micro"
5858
src.git = "https://github.com/catppuccin/nvim.git"
5959
fetch.github = "catppuccin/nvim"
6060

61+
[palette]
62+
src.git = "https://github.com/catppuccin/palette"
63+
fetch.github = "catppuccin/palette"
64+
6165
[polybar]
6266
src.git = "https://github.com/catppuccin/polybar.git"
6367
fetch.github = "catppuccin/polybar"

test.nix

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ in
2828

2929
boot.loader.grub = ctpEnable;
3030

31+
console = ctpEnable;
32+
3133
programs.dconf.enable = true; # required for gtk
3234

3335
virtualisation = {

0 commit comments

Comments
 (0)