Move all templates into flake inputs (#165)

This reduces our reliance on import-from-derivation, so evaluation is faster.
This commit is contained in:
Bernardo Meurer 2023-10-10 05:44:54 -04:00 committed by GitHub
parent c3c9f4784b
commit b42555850b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 202 additions and 51 deletions

View file

@ -18,6 +18,134 @@
"type": "github"
}
},
"base16-alacritty": {
"flake": false,
"locked": {
"lastModified": 1674275109,
"narHash": "sha256-Adwx9yP70I6mJrjjODOgZJjt4OPPe8gJu7UuBboXO4M=",
"owner": "aarowill",
"repo": "base16-alacritty",
"rev": "63d8ae5dfefe5db825dd4c699d0cdc2fc2c3eaf7",
"type": "github"
},
"original": {
"owner": "aarowill",
"repo": "base16-alacritty",
"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": 1696727917,
"narHash": "sha256-FVrbPk+NtMra0jtlC5oxyNchbm8FosmvXIatkRbYy1g=",
"owner": "tinted-theming",
"repo": "base16-helix",
"rev": "dbe1480d99fe80f08df7970e471fac24c05f2ddb",
"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": 1663659192,
"narHash": "sha256-uJvaYYDMXvoo0fhBZUhN8WBXeJ87SRgof6GEK2efFT0=",
"owner": "chriskempson",
"repo": "base16-vim",
"rev": "3be3cd82cd31acfcab9a41bad853d9c68d30478d",
"type": "github"
},
"original": {
"owner": "chriskempson",
"repo": "base16-vim",
"type": "github"
}
},
"base16-xresources": {
"flake": false,
"locked": {
"lastModified": 1696726575,
"narHash": "sha256-btDlG5hF+CRM4NWJ7dRwQJYy0GTAYsg9B56kJ9uUeUk=",
"owner": "tinted-theming",
"repo": "base16-xresources",
"rev": "98d029dbb19fbc7e8c3e3b3fba0d4f946b5da760",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-xresources",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
@ -89,6 +217,14 @@
"root": {
"inputs": {
"base16": "base16",
"base16-alacritty": "base16-alacritty",
"base16-fish": "base16-fish",
"base16-foot": "base16-foot",
"base16-helix": "base16-helix",
"base16-kitty": "base16-kitty",
"base16-tmux": "base16-tmux",
"base16-vim": "base16-vim",
"base16-xresources": "base16-xresources",
"flake-compat": "flake-compat",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"

View file

@ -13,6 +13,40 @@
url = "github:edolstra/flake-compat";
flake = false;
};
# Templates
base16-alacritty = {
url = "github:aarowill/base16-alacritty";
flake = false;
};
base16-fish = {
url = "github:tomyun/base16-fish";
flake = false;
};
base16-foot = {
url = "github:tinted-theming/base16-foot";
flake = false;
};
base16-helix = {
url = "github:tinted-theming/base16-helix";
flake = false;
};
base16-kitty = {
url = "github:kdrag0n/base16-kitty";
flake = false;
};
base16-tmux = {
url = "github:tinted-theming/base16-tmux";
flake = false;
};
base16-vim = {
url = "github:chriskempson/base16-vim";
flake = false;
};
base16-xresources = {
url = "github:tinted-theming/base16-xresources";
flake = false;
};
};
outputs =
@ -39,7 +73,7 @@
nixosModules.stylix = { pkgs, ... }@args: {
imports = [
(import ./stylix/nixos {
(import ./stylix/nixos inputs {
inherit (self.packages.${pkgs.system}) palette-generator;
base16 = base16.lib args;
homeManagerModule = self.homeManagerModules.stylix;
@ -49,7 +83,7 @@
homeManagerModules.stylix = { pkgs, ... }@args: {
imports = [
(import ./stylix/hm {
(import ./stylix/hm inputs {
inherit (self.packages.${pkgs.system}) palette-generator;
base16 = base16.lib args;
})
@ -58,7 +92,7 @@
darwinModules.stylix = { pkgs, ... }@args: {
imports = [
(import ./stylix/darwin {
(import ./stylix/darwin inputs {
inherit (self.packages.${pkgs.system}) palette-generator;
base16 = base16.lib args;
homeManagerModule = self.homeManagerModules.stylix;

View file

@ -4,12 +4,7 @@ with config.stylix.fonts;
let
themeFile = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "aarowill";
repo = "base16-alacritty";
rev = "914727e48ebf3eab1574e23ca0db0ecd0e5fe9d0";
sha256 = "sha256-oDsuiKx8gt+Ov7hZ9PibIQtE81IRSLO+n5N99WeiK34=";
};
templateRepo = config.lib.stylix.templates.base16-alacritty;
};
in
{

View file

@ -2,12 +2,7 @@
let
theme = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "tomyun";
repo = "base16-fish";
rev = "7f647967fddedaf803191bc9113b13d2071dc3cf";
sha256 = "IGUbLjsmmAvB9UKGkR7oqdpjeVEfzt83GpyBkrZf2O4=";
};
templateRepo = config.lib.stylix.templates.base16-fish;
};
in ''
source ${theme}

View file

@ -4,12 +4,7 @@ let
cfg = config.stylix.targets.foot;
theme = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "tinted-theming";
repo = "base16-foot";
rev = "22579065fbe21361b64d80bae798666efaa85ce0";
sha256 = "gb43UufuN6iRu6MfTZP+a3GUUQ+hKa5e6G4IiWEc68A=";
};
templateRepo = config.lib.stylix.templates.base16-foot;
};
in {

View file

@ -2,12 +2,7 @@
let
theme = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "tinted-theming";
repo = "base16-helix";
rev = "3e391da3aaf2fa43dc9cfb67e4e6216c7ce163dc";
sha256 = "elhPirlFx9UaZGTht9jFl8lLfT4Af38ITTPJT90yrHs=";
};
templateRepo = config.lib.stylix.templates.base16-helix;
};
# Removing the background exposes transparency from the terminal. The

View file

@ -3,12 +3,7 @@
let
cfg = config.stylix.targets.kitty;
theme = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "kdrag0n";
repo = "base16-kitty";
rev = "06bb401fa9a0ffb84365905ffbb959ae5bf40805";
sha256 = "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=";
};
templateRepo = config.lib.stylix.templates.base16-kitty;
target = if cfg.variant256Colors then "default-256" else "default";
};
in {

View file

@ -2,12 +2,7 @@
let
theme = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "tinted-theming";
repo = "base16-tmux";
rev = "30fc84afc723e027d4497a284fcae3cb75097441";
sha256 = "JJ/eRqTayuEKrL9MBe943HpKy7yLyd2Dmes58KN1jdk=";
};
templateRepo = config.lib.stylix.templates.base16-tmux;
};
in {

View file

@ -4,12 +4,7 @@ with lib;
let
themeFile = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "chriskempson";
repo = "base16-vim";
rev = "6191622d5806d4448fa2285047936bdcee57a098";
sha256 = "6FsT87qcl9GBxgxrPx2bPULIMA/O8TRxHaN49qMM4uM=";
};
templateRepo = config.lib.stylix.templates.base16-vim;
};
themePlugin = pkgs.vimUtils.buildVimPlugin {

View file

@ -4,12 +4,7 @@ with config.stylix.fonts;
let
themeFile = config.lib.stylix.colors {
templateRepo = pkgs.fetchFromGitHub {
owner = "tinted-theming";
repo = "base16-xresources";
rev = "6711cf4fa61e903e52ef6eac186b83e04a0397d8";
sha256 = "sha256-WazWviLhQRCyF9EBi2IDn9h8wrKc00PpqtltFDpUP5Q=";
};
templateRepo = config.lib.stylix.templates.base16-xresources;
};
in
{

View file

@ -1,3 +1,4 @@
inputs:
{ palette-generator, base16, homeManagerModule }:
{ options, config, lib, ... }:
@ -10,6 +11,7 @@ in {
../target.nix
./fonts.nix
(import ./palette.nix { inherit palette-generator base16; })
(import ../templates.nix inputs)
] ++ autoload;
options.stylix.homeManagerIntegration = {

View file

@ -1,3 +1,4 @@
inputs:
{ palette-generator, base16 }:
{ config, lib, ... }:
@ -10,5 +11,6 @@ in {
../opacity.nix
./fonts.nix
(import ./palette.nix { inherit palette-generator base16; })
(import ../templates.nix inputs)
] ++ autoload;
}

View file

@ -1,3 +1,4 @@
inputs:
{ palette-generator, base16, homeManagerModule }:
{ options, config, lib, ... }:
@ -11,6 +12,7 @@ in {
../opacity.nix
./fonts.nix
(import ./palette.nix { inherit palette-generator base16; })
(import ../templates.nix inputs)
] ++ autoload;
options.stylix.homeManagerIntegration = {

15
stylix/templates.nix Normal file
View file

@ -0,0 +1,15 @@
inputs:
{
config.lib.stylix.templates = {
inherit (inputs)
base16-alacritty
base16-fish
base16-foot
base16-helix
base16-kitty
base16-tmux
base16-vim
base16-xresources
;
};
}