diff --git a/flake.lock b/flake.lock index 6c1b0d6..7f12618 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "base16-schemes": { + "flake": false, + "locked": { + "lastModified": 1689473676, + "narHash": "sha256-L0RhUr9+W5EPWBpLcmkKpUeCEWRs/kLzVMF3Vao2ZU0=", + "owner": "tinted-theming", + "repo": "base16-schemes", + "rev": "d95123ca6377cd849cfdce92c0a24406b0c6a789", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-schemes", + "type": "github" + } + }, "flatpaks": { "inputs": { "nixpkgs": "nixpkgs", @@ -40,6 +56,25 @@ "type": "github" } }, + "nix-colors": { + "inputs": { + "base16-schemes": "base16-schemes", + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1695388192, + "narHash": "sha256-2jelpE7xK+4M7jZNyWL7QYOYegQLYBDQS5bvdo8XRUQ=", + "owner": "misterio77", + "repo": "nix-colors", + "rev": "37227f274b34a3b51649166deb94ce7fec2c6a4c", + "type": "github" + }, + "original": { + "owner": "misterio77", + "repo": "nix-colors", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1701156937, @@ -56,6 +91,21 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1694911725, + "narHash": "sha256-8YqI+YU1DGclEjHsnrrGfqsQg3Wyga1DfTbJrN3Ud0c=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "819180647f428a3826bfc917a54449da1e532ce0", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1703961334, @@ -76,7 +126,8 @@ "inputs": { "flatpaks": "flatpaks", "home-manager": "home-manager", - "nixpkgs": "nixpkgs_2" + "nix-colors": "nix-colors", + "nixpkgs": "nixpkgs_2", } }, "systems": { diff --git a/flake.nix b/flake.nix index 2ce5141..d252af2 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,10 @@ }; flatpaks.url = "github:GermanBread/declarative-flatpak/stable"; - # nix-flatpak.url = "github:gmodena/nix-flatpak"; + + # Used for theming the OS, see modules/home-manager/theme.nix + nix-colors.url = "github:misterio77/nix-colors"; + }; outputs = { self, nixpkgs, home-manager, ... }@inputs: diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index 0b0ad84..4fd9cbd 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -86,7 +86,7 @@ # services.xserver.libinput.enable = true; # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.guz = { + users.users."guz" = { isNormalUser = true; description = "Guz"; extraGroups = [ "networkmanager" "wheel" ]; @@ -99,10 +99,7 @@ home-manager = { extraSpecialArgs = { inherit inputs; }; users = { - "guz".imports = [ - inputs.flatpaks.homeManagerModules.default - ./home.nix - ]; + "guz" = import ./home.nix; }; }; diff --git a/hosts/default/home.nix b/hosts/default/home.nix index a4ee329..10e26ce 100644 --- a/hosts/default/home.nix +++ b/hosts/default/home.nix @@ -1,11 +1,18 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, inputs, ... }: { + imports = [ + inputs.flatpaks.homeManagerModules.default + ../../modules/home-manager/theme.nix + ]; + + # theme.accent = "f38ba8"; # Home Manager needs a bit of information about you and the paths it should # manage. home.username = "guz"; home.homeDirectory = "/home/guz"; + # This value determines the Home Manager release that your configuration is # compatible with. This helps avoid breakage when a new Home Manager release # introduces backwards incompatible changes. diff --git a/modules/home-manager/theme.nix b/modules/home-manager/theme.nix new file mode 100644 index 0000000..428c263 --- /dev/null +++ b/modules/home-manager/theme.nix @@ -0,0 +1,29 @@ +{ config, lib, inputs, ... }: + +let + cfg = config.theme; +in +{ + imports = [ + inputs.nix-colors.homeManagerModules.default + ]; + options.theme = { + accent = lib.mkOption { + type = lib.types.str; + default = "cdd6f4"; + description = "The accent color of Frappuccino"; + }; + accentBase = lib.mkOption { + type = lib.types.str; + default = "magenta"; + description = "The base name for the accent color to be used in the terminal"; + }; + scheme = lib.mkOption { + type = lib.types.path; + default = ../../themes/frappuccino.yaml; + }; + }; + config = { + colorScheme = inputs.nix-colors.lib.schemeFromYAML "frappuccino" (builtins.readFile cfg.scheme); + }; +} diff --git a/themes/frappuccino.yaml b/themes/frappuccino.yaml new file mode 100644 index 0000000..497eceb --- /dev/null +++ b/themes/frappuccino.yaml @@ -0,0 +1,18 @@ +scheme: "Frappuccino (a catppuccin fork)" +author: "https://github.com/Guz013 (Catppuccin: https://github.com/catppuccin/catppuccin" +base00: "111111" # base +base01: "101010" # mantle +base02: "181818" # surface0 +base03: "181818" # surface1 +base04: "181818" # surface2 +base05: "cdd6f4" # text +base06: "f5e0dc" # rosewater +base07: "b4befe" # lavender +base08: "f38ba8" # red +base09: "fab387" # peach +base0A: "f9e2af" # yellow +base0B: "a6e3a1" # green +base0C: "94e2d5" # teal +base0D: "89b4fa" # blue +base0E: "cba6f7" # mauve +base0F: "f2cdcd" # flamingo