Skip to content

Commit

Permalink
feat(nixos): init console module (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anomalocaridid authored Mar 13, 2024
1 parent 948fe71 commit 18419d5
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 0 deletions.
20 changes: 20 additions & 0 deletions _sources/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,26 @@
},
"version": "5e36ca599f4aa41bdd87fbf2c5aae4397ac55074"
},
"palette": {
"cargoLocks": null,
"date": "2024-01-02",
"extract": null,
"name": "palette",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "catppuccin",
"repo": "palette",
"rev": "7f103c3e11f7f705ee1fb8ac430d90a798bbdfcb",
"sha256": "sha256-W1Bj/407i2XT7CmCBoFe2PCe10MB8lmnEQsWXSrJ6zg=",
"type": "github"
},
"version": "7f103c3e11f7f705ee1fb8ac430d90a798bbdfcb"
},
"polybar": {
"cargoLocks": null,
"date": "2022-10-05",
Expand Down
12 changes: 12 additions & 0 deletions _sources/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,18 @@
};
date = "2023-12-31";
};
palette = {
pname = "palette";
version = "7f103c3e11f7f705ee1fb8ac430d90a798bbdfcb";
src = fetchFromGitHub {
owner = "catppuccin";
repo = "palette";
rev = "7f103c3e11f7f705ee1fb8ac430d90a798bbdfcb";
fetchSubmodules = false;
sha256 = "sha256-W1Bj/407i2XT7CmCBoFe2PCe10MB8lmnEQsWXSrJ6zg=";
};
date = "2024-01-02";
};
polybar = {
pname = "polybar";
version = "9ee66f83335404186ce979bac32fcf3cd047396a";
Expand Down
38 changes: 38 additions & 0 deletions modules/nixos/console.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{ config
, lib
, sources
, ...
}:
let
cfg = config.console.catppuccin;
enable = cfg.enable && config.console.enable;
palette = (lib.importJSON "${sources.palette}/palette.json").${cfg.flavour}.colors;
in
{
options.console.catppuccin =
lib.ctp.mkCatppuccinOpt "console";

config.console.colors = lib.mkIf enable (
# Manually populate with colors from catppuccin/tty
# Make sure to strip initial # from hex codes
map (color: (builtins.substring 1 6 palette.${color}.hex)) [
"base"
"red"
"green"
"yellow"
"blue"
"pink"
"teal"
"subtext1"

"surface2"
"red"
"green"
"yellow"
"blue"
"pink"
"teal"
"subtext0"
]
);
}
4 changes: 4 additions & 0 deletions nvfetcher.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ fetch.github = "catppuccin/micro"
src.git = "https://github.com/catppuccin/nvim.git"
fetch.github = "catppuccin/nvim"

[palette]
src.git = "https://github.com/catppuccin/palette"
fetch.github = "catppuccin/palette"

[polybar]
src.git = "https://github.com/catppuccin/polybar.git"
fetch.github = "catppuccin/polybar"
Expand Down
2 changes: 2 additions & 0 deletions test.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ in

boot.loader.grub = ctpEnable;

console = ctpEnable;

programs.dconf.enable = true; # required for gtk

virtualisation = {
Expand Down

0 comments on commit 18419d5

Please sign in to comment.