diff --git a/flake.lock b/flake.lock index b25f4a9..76fd099 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,25 @@ { "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": { "locked": { "lastModified": 1743693165, @@ -42,11 +62,11 @@ ] }, "locked": { - "lastModified": 1745494811, - "narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=", + "lastModified": 1746727295, + "narHash": "sha256-0364XVBdfEA8rWfqEPvsgBqGFfq5r9LAo9CS9tvT7tg=", "owner": "nix-community", "repo": "home-manager", - "rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be", + "rev": "a51598236f23c89e59ee77eb8e0614358b0e896c", "type": "github" }, "original": { @@ -57,11 +77,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1745391562, - "narHash": "sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo=", + "lastModified": 1746461020, + "narHash": "sha256-7+pG1I9jvxNlmln4YgnlW4o+w0TZX24k688mibiFDUE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7", + "rev": "3730d8a308f94996a9ba7c7138ede69c1b9ac4ae", "type": "github" }, "original": { @@ -71,12 +91,48 @@ "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": { "inputs": { + "catppuccin": "catppuccin", "easy-hosts": "easy-hosts", "flake-parts": "flake-parts", "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" } } }, diff --git a/flake.nix b/flake.nix index 3787ddf..2933e6e 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,11 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + + catppuccin = { + url = "github:catppuccin/nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = {flake-parts, ...} @ inputs: diff --git a/homes/x86_64-linux/jo/default.nix b/homes/x86_64-linux/jo/default.nix index bd62c1a..39536ca 100644 --- a/homes/x86_64-linux/jo/default.nix +++ b/homes/x86_64-linux/jo/default.nix @@ -1,4 +1,8 @@ {pkgs, ...}: { + puzzlevision = { + themes.catppuccin.enable = true; + }; + home.packages = with pkgs; [ zed-editor firefox diff --git a/modules/home/app/zed/default.nix b/modules/home/app/zed/default.nix index c0e8e3d..e930080 100644 --- a/modules/home/app/zed/default.nix +++ b/modules/home/app/zed/default.nix @@ -18,7 +18,7 @@ in { config = mkIf cfg.enable { sops.secrets.wakatime-cfg = { 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"; }; diff --git a/modules/home/desktop/gnome/default.nix b/modules/home/desktop/gnome/default.nix index aed83e5..734425d 100644 --- a/modules/home/desktop/gnome/default.nix +++ b/modules/home/desktop/gnome/default.nix @@ -44,7 +44,7 @@ in { 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 { diff --git a/modules/home/security/sops/default.nix b/modules/home/security/sops/default.nix new file mode 100644 index 0000000..eb9d437 --- /dev/null +++ b/modules/home/security/sops/default.nix @@ -0,0 +1,5 @@ +{config, ...}: { + sops = { + age.keyFile = "/home/${config.home.username}/.sops-nix/key.txt"; + }; +} diff --git a/modules/home/themes/catppuccin/default.nix b/modules/home/themes/catppuccin/default.nix new file mode 100644 index 0000000..7e49943 --- /dev/null +++ b/modules/home/themes/catppuccin/default.nix @@ -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; + }; +} diff --git a/modules/home/themes/catppuccin/gtk/default.nix b/modules/home/themes/catppuccin/gtk/default.nix new file mode 100644 index 0000000..e172ca4 --- /dev/null +++ b/modules/home/themes/catppuccin/gtk/default.nix @@ -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"; + }; + }; + }; +} diff --git a/modules/home/themes/catppuccin/palette/default.nix b/modules/home/themes/catppuccin/palette/default.nix new file mode 100644 index 0000000..6fdff23 --- /dev/null +++ b/modules/home/themes/catppuccin/palette/default.nix @@ -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; +} diff --git a/modules/nixos/system/shell/default.nix b/modules/nixos/system/shell/default.nix index d47951d..0ae1ef6 100644 --- a/modules/nixos/system/shell/default.nix +++ b/modules/nixos/system/shell/default.nix @@ -13,13 +13,13 @@ in { options.${namespace}.system.shell = { 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."; }; config = mkIf cfg.enable { environment.shells = cfg.installed; - users.defaultUserShell = pkgs.${cfg.shell.type}; - programs.${cfg.shell.type}.enable = true; + users.defaultUserShell = pkgs.${cfg.default}; + programs.${cfg.default}.enable = true; }; } diff --git a/modules/nixos/users/default.nix b/modules/nixos/users/default.nix index 4d91d25..8ca18d4 100644 --- a/modules/nixos/users/default.nix +++ b/modules/nixos/users/default.nix @@ -3,6 +3,7 @@ self, pkgs, config, + inputs, ... }: let inherit (lib) types mkEnableOption mkOption mkIf; @@ -66,7 +67,7 @@ in { mkIf (userConfig.enable && homeConfigExists username) ( {osConfig, ...}: { # 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; } diff --git a/systems/x86_64-nixos/puzzlevision/default.nix b/systems/x86_64-nixos/puzzlevision/default.nix index d61aa5f..a2a5752 100644 --- a/systems/x86_64-nixos/puzzlevision/default.nix +++ b/systems/x86_64-nixos/puzzlevision/default.nix @@ -4,12 +4,6 @@ ]; puzzlevision = { - users.cyn = { - enable = true; - password = "cynical"; # For testing only, replace with sops secret before production use - extraGroups = ["wheel"]; - }; - users.jo = { enable = true; password = "jo"; # For testing only, replace with sops secret before production use