home: add basic theming (cursor only for now)
This commit is contained in:
parent
65ef3a1217
commit
20d248cb99
@ -4,5 +4,6 @@
|
||||
./wm
|
||||
./nodm.nix
|
||||
./nix.nix
|
||||
./theme.nix
|
||||
];
|
||||
}
|
||||
|
45
home/common/theme.nix
Normal file
45
home/common/theme.nix
Normal file
@ -0,0 +1,45 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.nixfiles.theming;
|
||||
|
||||
mkCtpPackages = flavor: accent: let
|
||||
toCaps = s: with lib.strings; with builtins;
|
||||
(toUpper (substring 0 1 s)) + toLower (substring 1 ((stringLength s)-1) s);
|
||||
inherit (lib.strings) toUpper toLower;
|
||||
in with pkgs; {
|
||||
cursors = catppuccin-cursors."${toLower flavor}${toCaps accent}";
|
||||
cursorName = "Catppuccin-${toCaps flavor}-${toCaps accent}-Cursors";
|
||||
kvantum = catppuccin-kvantum.override { variant = toCaps flavor; accent = toCaps accent; };
|
||||
icons = catppuccin-papirus-folders.override { flavor = toLower flavor; accent = toLower accent; };
|
||||
};
|
||||
|
||||
ctpPackages = with cfg.catppuccin; mkCtpPackages flavor accent;
|
||||
in {
|
||||
options.nixfiles.theming = {
|
||||
enable = lib.mkEnableOption "nixfiles theming options";
|
||||
catppuccin = {
|
||||
flavor = lib.mkOption {
|
||||
description = "Catppuccin flavor";
|
||||
type = lib.types.str;
|
||||
default = "mocha";
|
||||
};
|
||||
accent = lib.mkOption {
|
||||
description = "Catppuccin accent";
|
||||
type = lib.types.str;
|
||||
default = "mauve";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
gtk.enable = true;
|
||||
|
||||
home.pointerCursor = {
|
||||
package = lib.mkDefault ctpPackages.cursors;
|
||||
name = lib.mkDefault ctpPackages.cursorName;
|
||||
size = lib.mkDefault 24;
|
||||
x11.enable = lib.mkDefault true;
|
||||
gtk.enable = lib.mkDefault true;
|
||||
};
|
||||
};
|
||||
}
|
@ -22,6 +22,8 @@ in
|
||||
# Common options for standalone window managers; many of these (or
|
||||
# alternatives thereof) are pulled in by desktop environments.
|
||||
|
||||
nixfiles.theming.enable = lib.mkDefault true;
|
||||
|
||||
qt.enable = true;
|
||||
qt.platformTheme.name = "qtct";
|
||||
qt.style.name = "kvantum";
|
||||
|
@ -84,8 +84,9 @@ in
|
||||
};
|
||||
|
||||
# this fixes a lot of theme weirdness
|
||||
home.file.".icons".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.dataHome}/icons";
|
||||
home.file.".themes".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.dataHome}/themes";
|
||||
# this actually breaks home-manager's icon/theme management
|
||||
# home.file.".icons".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.dataHome}/icons";
|
||||
# home.file.".themes".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.dataHome}/themes";
|
||||
|
||||
# some packages defined here may be redundant with packages on a non-NixOS
|
||||
# home-manager setup, but it's better to have a consistent environment at
|
||||
|
Loading…
x
Reference in New Issue
Block a user