Add Catppuccin theme, home-manage sops-nix integration and update

system modules
This commit is contained in:
Jo 2025-05-12 00:20:08 +02:00
parent fa3bbb2f6f
commit 4dd0860251
12 changed files with 298 additions and 19 deletions

70
flake.lock generated
View file

@ -1,5 +1,25 @@
{ {
"nodes": { "nodes": {
"catppuccin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1746650299,
"narHash": "sha256-4+pxk1KcSH8ww3tgN808nNJ3E7Q8gNWI+U0sesW7mBQ=",
"owner": "catppuccin",
"repo": "nix",
"rev": "f746600f15b69df05c84e3037749a3be5b1276d1",
"type": "github"
},
"original": {
"owner": "catppuccin",
"repo": "nix",
"type": "github"
}
},
"easy-hosts": { "easy-hosts": {
"locked": { "locked": {
"lastModified": 1743693165, "lastModified": 1743693165,
@ -42,11 +62,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1745494811, "lastModified": 1746727295,
"narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=", "narHash": "sha256-0364XVBdfEA8rWfqEPvsgBqGFfq5r9LAo9CS9tvT7tg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be", "rev": "a51598236f23c89e59ee77eb8e0614358b0e896c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -57,11 +77,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1745391562, "lastModified": 1746461020,
"narHash": "sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo=", "narHash": "sha256-7+pG1I9jvxNlmln4YgnlW4o+w0TZX24k688mibiFDUE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7", "rev": "3730d8a308f94996a9ba7c7138ede69c1b9ac4ae",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -71,12 +91,48 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1744868846,
"narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ebe4301cbd8f81c4f8d3244b3632338bbeb6d49c",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"catppuccin": "catppuccin",
"easy-hosts": "easy-hosts", "easy-hosts": "easy-hosts",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs",
"sops-nix": "sops-nix"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1746485181,
"narHash": "sha256-PxrrSFLaC7YuItShxmYbMgSuFFuwxBB+qsl9BZUnRvg=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "e93ee1d900ad264d65e9701a5c6f895683433386",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
} }
} }
}, },

View file

@ -30,6 +30,11 @@
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
catppuccin = {
url = "github:catppuccin/nix";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = {flake-parts, ...} @ inputs: outputs = {flake-parts, ...} @ inputs:

View file

@ -1,4 +1,8 @@
{pkgs, ...}: { {pkgs, ...}: {
puzzlevision = {
themes.catppuccin.enable = true;
};
home.packages = with pkgs; [ home.packages = with pkgs; [
zed-editor zed-editor
firefox firefox

View file

@ -18,7 +18,7 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
sops.secrets.wakatime-cfg = { sops.secrets.wakatime-cfg = {
format = "binary"; format = "binary";
sopsFile = "${self.outPath}/${osConfig.networking.hostname}/secrets/wakatime.cfg"; sopsFile = "${self.outPath}/x86_64-nixos/${osConfig.networking.hostname}/secrets/wakatime.cfg";
path = "/home/${config.home.homeDirectory}/.wakatime.cfg"; path = "/home/${config.home.homeDirectory}/.wakatime.cfg";
}; };

View file

@ -44,7 +44,7 @@ in {
enable-blur = mkOpt bool false "Whether to enable blur-my-shell application blur."; enable-blur = mkOpt bool false "Whether to enable blur-my-shell application blur.";
}; };
}; };
wallpaper = mkOpt str (builtins.toString ../wallpapers/mountain_tower_sunset.jpg) "Specify the path of your prefered Gnome wallpaper."; wallpaper = mkOpt str (builtins.toString ../wallpapers/catppuccin/mountain_tower_sunset.jpg) "Specify the path of your prefered Gnome wallpaper.";
}; };
config = mkIf osConfig.${namespace}.desktop.gnome.enable { config = mkIf osConfig.${namespace}.desktop.gnome.enable {

View file

@ -0,0 +1,5 @@
{config, ...}: {
sops = {
age.keyFile = "/home/${config.home.username}/.sops-nix/key.txt";
};
}

View file

@ -0,0 +1,33 @@
{
lib,
self,
config,
osConfig,
namespace,
...
}: let
inherit (lib) mkEnableOption types mkIf;
inherit (self.lib) mkOpt;
cfg = config.${namespace}.themes.catppuccin;
in {
options.${namespace}.themes.catppuccin = {
enable = mkEnableOption "the Catppuccin theme, globally.";
accent = mkOpt types.str "blue" "The accent colour to use.";
flavor = mkOpt types.str "macchiato" "The flavor to use.";
};
config = mkIf cfg.enable {
catppuccin = {
enable = true;
accent = cfg.accent;
flavor = cfg.flavor;
cursors.enable = true;
cursors.accent = cfg.accent;
cursors.flavor = cfg.flavor;
};
${namespace}.themes.catppuccin.gtk.enable = mkIf osConfig.${namespace}.desktop.gnome.enable true;
};
}

View file

@ -0,0 +1,167 @@
{
lib,
pkgs,
config,
namespace,
...
}: let
inherit (lib) mkEnableOption mkIf;
catppuccinCfg = config.${namespace}.themes.catppuccin;
css = pkgs.writeTextFile {
name = "gtk-css";
text = ''
@define-color accent_color ${catppuccinCfg.palette.blue.hex};
@define-color accent_bg_color ${catppuccinCfg.palette.blue.hex};
@define-color accent_fg_color ${catppuccinCfg.palette.base.hex};
@define-color destructive_color ${catppuccinCfg.palette.red.hex};
@define-color destructive_bg_color ${catppuccinCfg.palette.red.hex};
@define-color destructive_fg_color ${catppuccinCfg.palette.base.hex};
@define-color success_color ${catppuccinCfg.palette.green.hex};
@define-color success_bg_color ${catppuccinCfg.palette.green.hex};
@define-color success_fg_color ${catppuccinCfg.palette.base.hex};
@define-color warning_color ${catppuccinCfg.palette.mauve.hex};
@define-color warning_bg_color ${catppuccinCfg.palette.mauve.hex};
@define-color warning_fg_color ${catppuccinCfg.palette.base.hex};
@define-color error_color ${catppuccinCfg.palette.red.hex};
@define-color error_bg_color ${catppuccinCfg.palette.red.hex};
@define-color error_fg_color ${catppuccinCfg.palette.base.hex};
@define-color window_bg_color ${catppuccinCfg.palette.mantle.hex};
@define-color window_fg_color ${catppuccinCfg.palette.text.hex};
@define-color view_bg_color ${catppuccinCfg.palette.mantle.hex};
@define-color view_fg_color ${catppuccinCfg.palette.text.hex};
@define-color headerbar_bg_color ${catppuccinCfg.palette.mantle.hex};
@define-color headerbar_fg_color ${catppuccinCfg.palette.text.hex};
@define-color headerbar_border_color rgba(${builtins.toString catppuccinCfg.palette.base.rgb.r}, ${builtins.toString catppuccinCfg.palette.base.rgb.g}, ${builtins.toString catppuccinCfg.palette.base.rgb.b}, 0.7);
@define-color headerbar_backdrop_color @window_bg_color;
@define-color headerbar_shade_color rgba(0, 0, 0, 0.07);
@define-color headerbar_darker_shade_color rgba(0, 0, 0, 0.07);
@define-color sidebar_bg_color ${catppuccinCfg.palette.base.hex};
@define-color sidebar_fg_color ${catppuccinCfg.palette.text.hex};
@define-color sidebar_backdrop_color @window_bg_color;
@define-color sidebar_shade_color rgba(0, 0, 0, 0.07);
@define-color secondary_sidebar_bg_color @sidebar_bg_color;
@define-color secondary_sidebar_fg_color @sidebar_fg_color;
@define-color secondary_sidebar_backdrop_color @sidebar_backdrop_color;
@define-color secondary_sidebar_shade_color @sidebar_shade_color;
@define-color card_bg_color ${catppuccinCfg.palette.base.hex};
@define-color card_fg_color ${catppuccinCfg.palette.text.hex};
@define-color card_shade_color rgba(0, 0, 0, 0.07);
@define-color dialog_bg_color ${catppuccinCfg.palette.mantle.hex};
@define-color dialog_fg_color ${catppuccinCfg.palette.text.hex};
@define-color popover_bg_color ${catppuccinCfg.palette.mantle.hex};
@define-color popover_fg_color ${catppuccinCfg.palette.text.hex};
@define-color popover_shade_color rgba(0, 0, 0, 0.07);
@define-color shade_color rgba(0, 0, 0, 0.07);
@define-color scrollbar_outline_color ${catppuccinCfg.palette.surface0.hex};
@define-color blue_1 ${catppuccinCfg.palette.blue.hex};
@define-color blue_2 ${catppuccinCfg.palette.blue.hex};
@define-color blue_3 ${catppuccinCfg.palette.blue.hex};
@define-color blue_4 ${catppuccinCfg.palette.blue.hex};
@define-color blue_5 ${catppuccinCfg.palette.blue.hex};
@define-color green_1 ${catppuccinCfg.palette.green.hex};
@define-color green_2 ${catppuccinCfg.palette.green.hex};
@define-color green_3 ${catppuccinCfg.palette.green.hex};
@define-color green_4 ${catppuccinCfg.palette.green.hex};
@define-color green_5 ${catppuccinCfg.palette.green.hex};
@define-color yellow_1 ${catppuccinCfg.palette.yellow.hex};
@define-color yellow_2 ${catppuccinCfg.palette.yellow.hex};
@define-color yellow_3 ${catppuccinCfg.palette.yellow.hex};
@define-color yellow_4 ${catppuccinCfg.palette.yellow.hex};
@define-color yellow_5 ${catppuccinCfg.palette.yellow.hex};
@define-color orange_1 ${catppuccinCfg.palette.peach.hex};
@define-color orange_2 ${catppuccinCfg.palette.peach.hex};
@define-color orange_3 ${catppuccinCfg.palette.peach.hex};
@define-color orange_4 ${catppuccinCfg.palette.peach.hex};
@define-color orange_5 ${catppuccinCfg.palette.peach.hex};
@define-color red_1 ${catppuccinCfg.palette.red.hex};
@define-color red_2 ${catppuccinCfg.palette.red.hex};
@define-color red_3 ${catppuccinCfg.palette.red.hex};
@define-color red_4 ${catppuccinCfg.palette.red.hex};
@define-color red_5 ${catppuccinCfg.palette.red.hex};
@define-color purple_1 ${catppuccinCfg.palette.mauve.hex};
@define-color purple_2 ${catppuccinCfg.palette.mauve.hex};
@define-color purple_3 ${catppuccinCfg.palette.mauve.hex};
@define-color purple_4 ${catppuccinCfg.palette.mauve.hex};
@define-color purple_5 ${catppuccinCfg.palette.mauve.hex};
@define-color brown_1 ${catppuccinCfg.palette.flamingo.hex};
@define-color brown_2 ${catppuccinCfg.palette.flamingo.hex};
@define-color brown_3 ${catppuccinCfg.palette.flamingo.hex};
@define-color brown_4 ${catppuccinCfg.palette.flamingo.hex};
@define-color brown_5 ${catppuccinCfg.palette.flamingo.hex};
@define-color light_1 ${catppuccinCfg.palette.mantle.hex};
@define-color light_2 ${catppuccinCfg.palette.mantle.hex};
@define-color light_3 ${catppuccinCfg.palette.mantle.hex};
@define-color light_4 ${catppuccinCfg.palette.mantle.hex};
@define-color light_5 ${catppuccinCfg.palette.mantle.hex};
@define-color dark_1 ${catppuccinCfg.palette.mantle.hex};
@define-color dark_2 ${catppuccinCfg.palette.mantle.hex};
@define-color dark_3 ${catppuccinCfg.palette.mantle.hex};
@define-color dark_4 ${catppuccinCfg.palette.mantle.hex};
@define-color dark_5 ${catppuccinCfg.palette.mantle.hex};
'';
};
cfg = config.${namespace}.themes.catppuccin.gtk;
in {
options.${namespace}.themes.catppuccin.gtk = {enable = mkEnableOption "Enable the Catppuccin theme for GTK";};
config = mkIf cfg.enable {
home.packages = with pkgs; [
(colloid-gtk-theme.override {
themeVariants = ["default"];
colorVariants = ["dark"];
sizeVariants = ["standard"];
tweaks = ["catppuccin"];
})
];
gtk = {
enable = true;
font = {
name = "Poppins";
size = 12;
package = pkgs.poppins;
};
theme = {
name = "adw-gtk3-dark";
package = pkgs.adw-gtk3;
};
gtk3 = {
extraCss = ''@import url("${css}");'';
extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
};
gtk4 = {
extraCss = ''@import url("${css}");'';
};
};
catppuccin = {
gtk = {
icon = {
enable = true;
accent = "blue";
flavor = "macchiato";
};
};
};
dconf.settings = {
"org/gnome/shell/extensions/user-theme" = {
name = "Colloid-Dark-Catppuccin";
};
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
cursor-theme = "catppuccin-macchiato-blue-cursors";
};
};
};
}

View file

@ -0,0 +1,14 @@
{
lib,
pkgs,
config,
namespace,
...
}: let
inherit (lib) mkOption mkIf;
palette = (pkgs.lib.importJSON (config.catppuccin.sources.palette + "/palette.json")).${config.catppuccin.flavor}.colors;
in {
options.${namespace}.themes.catppuccin.palette = mkOption {type = lib.types.attrsOf lib.types.raw;};
config.${namespace}.themes.catppuccin.palette = mkIf config.${namespace}.themes.catppuccin.enable palette;
}

View file

@ -13,13 +13,13 @@
in { in {
options.${namespace}.system.shell = { options.${namespace}.system.shell = {
enable = mkEnableOption "custom user shells."; enable = mkEnableOption "custom user shells.";
installed = mkOpt types.listOf types.package [pkgs.fish] "List of shell packages to install"; installed = mkOpt (types.listOf types.package) [pkgs.fish] "List of shell packages to install";
default = mkOpt types.str "fish" "Set a custom shell as the default for all users."; default = mkOpt types.str "fish" "Set a custom shell as the default for all users.";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.shells = cfg.installed; environment.shells = cfg.installed;
users.defaultUserShell = pkgs.${cfg.shell.type}; users.defaultUserShell = pkgs.${cfg.default};
programs.${cfg.shell.type}.enable = true; programs.${cfg.default}.enable = true;
}; };
} }

View file

@ -3,6 +3,7 @@
self, self,
pkgs, pkgs,
config, config,
inputs,
... ...
}: let }: let
inherit (lib) types mkEnableOption mkOption mkIf; inherit (lib) types mkEnableOption mkOption mkIf;
@ -66,7 +67,7 @@ in {
mkIf (userConfig.enable && homeConfigExists username) ( mkIf (userConfig.enable && homeConfigExists username) (
{osConfig, ...}: { {osConfig, ...}: {
# Import user home configuration and general home modules # Import user home configuration and general home modules
imports = [(getHomeConfigPath username)] ++ homeModules; imports = [(getHomeConfigPath username) inputs.sops-nix.homeManagerModules.sops inputs.catppuccin.homeModules.default] ++ homeModules;
home.stateVersion = lib.mkDefault osConfig.system.stateVersion; home.stateVersion = lib.mkDefault osConfig.system.stateVersion;
} }

View file

@ -4,12 +4,6 @@
]; ];
puzzlevision = { puzzlevision = {
users.cyn = {
enable = true;
password = "cynical"; # For testing only, replace with sops secret before production use
extraGroups = ["wheel"];
};
users.jo = { users.jo = {
enable = true; enable = true;
password = "jo"; # For testing only, replace with sops secret before production use password = "jo"; # For testing only, replace with sops secret before production use