From 3d6eff03b128abd6fdd154f40e610359d41e69fd Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Fri, 6 Sep 2024 15:28:06 +0200 Subject: [PATCH] add stylix module back --- flake.lock | 279 +++++++++++++++++++++++++++-- flake.nix | 11 +- home/base/gnome/default.nix | 8 - home/base/programs/nixvim/core.nix | 4 + hosts/common/default.nix | 1 - hosts/common/theme.nix | 7 - hosts/vamos/default.nix | 5 +- modules/default.nix | 1 + modules/stylix.nix | 46 +++++ 9 files changed, 325 insertions(+), 37 deletions(-) delete mode 100644 hosts/common/theme.nix create mode 100644 modules/stylix.nix diff --git a/flake.lock b/flake.lock index 57b3da5..f325220 100644 --- a/flake.lock +++ b/flake.lock @@ -1,17 +1,116 @@ { "nodes": { - "catppuccin": { + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, "locked": { - "lastModified": 1725509983, - "narHash": "sha256-NHCgHVqumPraFJnLrkanoLDuhOoUHUvRhvp/RIHJR+A=", - "owner": "catppuccin", - "repo": "nix", - "rev": "45745fe5960acaefef2b60f3455bcac6a0ca6bc9", + "lastModified": 1708890466, + "narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "665b3c6748534eb766c777298721cece9453fdae", "type": "github" }, "original": { - "owner": "catppuccin", - "repo": "nix", + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1622559957, + "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "type": "github" + } + }, + "base16-foot": { + "flake": false, + "locked": { + "lastModified": 1696725948, + "narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=", + "owner": "tinted-theming", + "repo": "base16-foot", + "rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-foot", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1720809814, + "narHash": "sha256-numb3xigRGnr/deF7wdjBwVg7fpbTH7reFDkJ75AJkY=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "34f41987bec14c0f3f6b2155c19787b1f6489625", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-kitty": { + "flake": false, + "locked": { + "lastModified": 1665001328, + "narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=", + "owner": "kdrag0n", + "repo": "base16-kitty", + "rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805", + "type": "github" + }, + "original": { + "owner": "kdrag0n", + "repo": "base16-kitty", + "type": "github" + } + }, + "base16-tmux": { + "flake": false, + "locked": { + "lastModified": 1696725902, + "narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=", + "owner": "tinted-theming", + "repo": "base16-tmux", + "rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-tmux", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1716150083, + "narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", "type": "github" } }, @@ -50,6 +149,22 @@ "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -91,7 +206,28 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_2" + "systems": [ + "stylix", + "systems" + ] + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_3" }, "locked": { "lastModified": 1710146030, @@ -124,6 +260,22 @@ "type": "github" } }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1689549921, + "narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, "git-hooks": { "inputs": { "flake-compat": [ @@ -176,6 +328,23 @@ "type": "github" } }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1713702291, + "narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "46.1", + "repo": "gnome-shell", + "type": "github" + } + }, "harfbuzz": { "flake": false, "locked": { @@ -200,11 +369,11 @@ ] }, "locked": { - "lastModified": 1725180166, - "narHash": "sha256-fzssXuGR/mCeGbzM1ExaTqDz7QDGta3WA4jJsZyRruo=", + "lastModified": 1725627831, + "narHash": "sha256-MIaU+T3DIowKvy1esp2owm3EgeyVgWFEoJ5jwAJIyvc=", "owner": "nix-community", "repo": "home-manager", - "rev": "471e3eb0a114265bcd62d11d58ba8d3421ee68eb", + "rev": "7d569851e95e8b360a3d7a2f52c5fc6a597a7657", "type": "github" }, "original": { @@ -234,6 +403,27 @@ "type": "github" } }, + "home-manager_3": { + "inputs": { + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724435763, + "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "libpng": { "flake": false, "locked": { @@ -319,6 +509,22 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1725194671, + "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixvim": { "inputs": { "devshell": "devshell", @@ -371,13 +577,13 @@ }, "root": { "inputs": { - "catppuccin": "catppuccin", "home-manager": "home-manager", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nixvim": "nixvim", "shells": "shells", "sops-nix": "sops-nix", + "stylix": "stylix", "wezterm": "wezterm" } }, @@ -440,6 +646,36 @@ "type": "github" } }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-foot": "base16-foot", + "base16-helix": "base16-helix", + "base16-kitty": "base16-kitty", + "base16-tmux": "base16-tmux", + "base16-vim": "base16-vim", + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_2", + "gnome-shell": "gnome-shell", + "home-manager": "home-manager_3", + "nixpkgs": "nixpkgs_2", + "systems": "systems_2" + }, + "locked": { + "lastModified": 1725290973, + "narHash": "sha256-+jwXF9KI0HfvDgpsoJGvOdfOGGSKOrID1wQB79zjUbo=", + "owner": "danth", + "repo": "stylix", + "rev": "ef81ad9e85e60420cc83d4642619c14b57139d33", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "stylix", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, @@ -470,6 +706,21 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -493,7 +744,7 @@ }, "wezterm": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "freetype2": "freetype2", "harfbuzz": "harfbuzz", "libpng": "libpng", diff --git a/flake.nix b/flake.nix index ab9c5dc..1ab631f 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,7 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - catppuccin.url = "github:catppuccin/nix"; + stylix.url = "github:danth/stylix"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -26,7 +26,7 @@ nixos-hardware.url = "github:NixOS/nixos-hardware"; }; - outputs = { nixpkgs, nixos-hardware, home-manager, nixvim, sops-nix, catppuccin, ... }@inputs: + outputs = { nixpkgs, home-manager, nixvim, sops-nix, stylix, ... }@inputs: let username = "nezia"; system = "x86_64-linux"; @@ -37,13 +37,12 @@ ./hosts/${hostname} sops-nix.nixosModules.sops - catppuccin.nixosModules.catppuccin + stylix.nixosModules.stylix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.sharedModules = [ - catppuccin.homeManagerModules.catppuccin nixvim.homeManagerModules.nixvim ]; home-manager.extraSpecialArgs = { inherit inputs; }; @@ -53,8 +52,8 @@ configureSystem = hostname: homeConfig: nixpkgs.lib.nixosSystem { system = system; - modules = commonModules hostname ++ [ { home-manager.users."${username}" = import homeConfig; } ] - ++ (if hostname == "vamos" then [ nixos-hardware.nixosModules.framework-13-7040-amd ] else []); + modules = commonModules hostname ++ [ { home-manager.users."${username}" = import homeConfig; } ]; + specialArgs = {inherit inputs; }; }; in { nixosConfigurations = { diff --git a/home/base/gnome/default.nix b/home/base/gnome/default.nix index 1fa00d6..bf16521 100644 --- a/home/base/gnome/default.nix +++ b/home/base/gnome/default.nix @@ -17,13 +17,5 @@ home.packages = with pkgs.gnomeExtensions; [ appindicator ]; - gtk = { - enable = true; - catppuccin = { - enable = true; - flavor = "frappe"; - gnomeShellTheme = true; - }; - }; } diff --git a/home/base/programs/nixvim/core.nix b/home/base/programs/nixvim/core.nix index 99e61d0..6be779e 100644 --- a/home/base/programs/nixvim/core.nix +++ b/home/base/programs/nixvim/core.nix @@ -10,6 +10,10 @@ performance.byteCompileLua.enable = true; + colorschemes.catppuccin = { + enable = true; + settings.flavour = "frappe"; + }; clipboard.providers.wl-copy.enable = true; globals.mapleader = " "; diff --git a/hosts/common/default.nix b/hosts/common/default.nix index d01731a..14aa126 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -4,7 +4,6 @@ ./system ./syncthing ./sops.nix - ./theme.nix ]; modules.gnome.enable = true; } diff --git a/hosts/common/theme.nix b/hosts/common/theme.nix deleted file mode 100644 index e89b2a0..0000000 --- a/hosts/common/theme.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: -{ - catppuccin = { - enable = true; - flavor = "frappe"; - }; -} diff --git a/hosts/vamos/default.nix b/hosts/vamos/default.nix index 11220ef..7ea1f5a 100644 --- a/hosts/vamos/default.nix +++ b/hosts/vamos/default.nix @@ -1,8 +1,9 @@ -{ ... }: +{ inputs, ... }: { imports = [ ./hardware-configuration.nix + inputs.nixos-hardware.nixosModules.framework-13-7040-amd ]; services.fprintd.enable = true; @@ -21,5 +22,7 @@ }; }; }; + modules.gnome.enable = true; + modules.stylix.enable = true; } diff --git a/modules/default.nix b/modules/default.nix index 87f3045..1242244 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -4,5 +4,6 @@ _: ./nvidia.nix ./gnome.nix ./gaming.nix + ./stylix.nix ]; } diff --git a/modules/stylix.nix b/modules/stylix.nix new file mode 100644 index 0000000..c5b9d30 --- /dev/null +++ b/modules/stylix.nix @@ -0,0 +1,46 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.modules.stylix; +in + { + options = { + modules.stylix = { + enable = lib.mkEnableOption "Enable the stylix module"; + }; + }; + config = lib.mkIf cfg.enable { + stylix = { + enable = true; + polarity = "dark"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-frappe.yaml"; + cursor = { + name = "catppuccin-frappe-lavender-cursors"; + package = pkgs.catppuccin-cursors.frappeLavender; + }; + fonts = { + serif = { + package = pkgs.noto-fonts; + name = "Noto Serif"; + }; + sansSerif = { + package = pkgs.noto-fonts; + name = "Noto Sans"; + }; + monospace = { + package = pkgs.nerdfonts.override { fonts = [ "Monaspace" ]; }; + name = "MonaspiceNe Nerd Font Mono"; + }; + emoji = { + package = pkgs.noto-fonts-color-emoji; + name = "Noto Color Emoji"; + }; + sizes = { + terminal = 14; + applications = 12; + desktop = 12; + }; + }; + image = lib.mkDefault ../wallpapers/nix-wallpaper-nineish-catppuccin-frappe-alt.svg; + }; + }; +}