Compare commits
No commits in common. "8626e1e2f1d4e1a18d117014fb682e12ee1fe490" and "a8a62dde7fd6e52a33b107b0d44342b12efe8dd1" have entirely different histories.
8626e1e2f1
...
a8a62dde7f
@ -8,7 +8,7 @@ This is a WIP Flake that can install SMCs fonts. Currently, the following are su
|
|||||||
4. Gayathri
|
4. Gayathri
|
||||||
|
|
||||||
*NOTE* I am not that familiar with nix flakes yet. This repo will see a lot more activity and perhaps significant change in structure in the near future.
|
*NOTE* I am not that familiar with nix flakes yet. This repo will see a lot more activity and perhaps significant change in structure in the near future.
|
||||||
|
|
||||||
## Using with a flakes+home-manager based nixOS setup
|
## Using with a flakes+home-manager based nixOS setup
|
||||||
|
|
||||||
In the inputs section
|
In the inputs section
|
||||||
|
82
default.nix
82
default.nix
@ -1,77 +1,7 @@
|
|||||||
{ stdenv, fetchzip, lib
|
{ pkgs, ... }:
|
||||||
# To select only certain fonts, put a list of strings to `fonts`: every key in
|
|
||||||
# ./shas.nix is an optional font
|
|
||||||
, fonts ? [ ] }:
|
|
||||||
|
|
||||||
let
|
{
|
||||||
# both of these files are generated via ./update.sh
|
manjari = pkgs.callPackage ./manjari { };
|
||||||
version = "version-20241013";
|
anjali-old-lipi = pkgs.callPackage ./anjali-old-lipi { };
|
||||||
fontsShas = import ./shas.nix;
|
chilanka = pkgs.callPackage ./chilanka { };
|
||||||
knownFonts = builtins.attrNames fontsShas;
|
}
|
||||||
selectedFonts = if (fonts == [ ]) then
|
|
||||||
knownFonts
|
|
||||||
else
|
|
||||||
let unknown = lib.subtractLists knownFonts fonts;
|
|
||||||
in if (unknown != [ ]) then
|
|
||||||
throw "Unknown font(s): ${lib.concatStringsSep " " unknown}"
|
|
||||||
else
|
|
||||||
fonts;
|
|
||||||
|
|
||||||
# Filter the fonts by selectedFonts list
|
|
||||||
filteredFonts =
|
|
||||||
builtins.filter (fontName: builtins.elem fontName selectedFonts)
|
|
||||||
(builtins.attrNames fontsShas);
|
|
||||||
|
|
||||||
# Function to generate a list of srcs that look like
|
|
||||||
# [
|
|
||||||
# (fetchurl {
|
|
||||||
# name = "namezzxs"
|
|
||||||
# url = "";
|
|
||||||
# sha256 = "sha256-abc123...";
|
|
||||||
# })
|
|
||||||
# (fetchurl {
|
|
||||||
# name = "namezzxy"
|
|
||||||
# url = "";
|
|
||||||
# sha256 = "sha256-def456...";
|
|
||||||
# })
|
|
||||||
# ]
|
|
||||||
generateUrls = fontAttrs: fontName:
|
|
||||||
builtins.map (variant:
|
|
||||||
let sha = fontAttrs.${variant};
|
|
||||||
in fetchzip {
|
|
||||||
name = "${fontName}-${variant}";
|
|
||||||
url = "https://smc.org.in/downloads/fonts/${fontName}/${variant}.zip";
|
|
||||||
sha256 = sha;
|
|
||||||
stripRoot = false;
|
|
||||||
}) (builtins.attrNames fontAttrs);
|
|
||||||
|
|
||||||
# Generate srcs for the filtered fonts
|
|
||||||
srcs = builtins.concatLists
|
|
||||||
(builtins.map (fontName: generateUrls fontsShas.${fontName} fontName)
|
|
||||||
filteredFonts);
|
|
||||||
|
|
||||||
in stdenv.mkDerivation (finalAttrs: {
|
|
||||||
inherit version;
|
|
||||||
inherit srcs;
|
|
||||||
pname = "smc-fonts";
|
|
||||||
sourceRoot = ".";
|
|
||||||
buildPhase = ''
|
|
||||||
echo "selected fonts are ${toString selectedFonts}"
|
|
||||||
ls *.otf *.ttf
|
|
||||||
'';
|
|
||||||
installPhase = ''
|
|
||||||
find -name \*.otf -exec mkdir -p $out/share/fonts/opentype/SMCFonts \; -exec mv {} $out/share/fonts/opentype/SMCFonts \;
|
|
||||||
find -name \*.ttf -exec mkdir -p $out/share/fonts/truetype/SMCFonts \; -exec mv {} $out/share/fonts/truetype/SMCFonts \;
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "SMC typefaces";
|
|
||||||
longDescription = ''
|
|
||||||
Swathanthra Malayalam Computing.
|
|
||||||
'';
|
|
||||||
homepage = "https://smc.org.in/";
|
|
||||||
license = licenses.ofl;
|
|
||||||
platforms = platforms.all;
|
|
||||||
maintainers = with maintainers; [ aashiks ];
|
|
||||||
};
|
|
||||||
})
|
|
||||||
|
@ -20,11 +20,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1728492678,
|
"lastModified": 1721924956,
|
||||||
"narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=",
|
"narHash": "sha256-Sb1jlyRO+N8jBXEX9Pg9Z1Qb8Bw9QyOgLDNMEpmjZ2M=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7",
|
"rev": "5ad6a14c6bf098e98800b091668718c336effc95",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
32
flake.nix
32
flake.nix
@ -11,20 +11,28 @@
|
|||||||
flake-utils.lib.eachDefaultSystem (system:
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
fonts-smc = pkgs.callPackage ./default.nix { };
|
font-smc-manjari = pkgs.callPackage ./manjari/default.nix { };
|
||||||
# font-smc-manjari = pkgs.callPackage ./manjari/default.nix { };
|
font-smc-anjali-old-lipi =
|
||||||
# font-smc-anjali-old-lipi =
|
pkgs.callPackage ./anjali-old-lipi/default.nix { };
|
||||||
# pkgs.callPackage ./anjali-old-lipi/default.nix { };
|
font-smc-chilanka = pkgs.callPackage ./chilanka/default.nix { };
|
||||||
# font-smc-chilanka = pkgs.callPackage ./chilanka/default.nix { };
|
font-smc-gayathri = pkgs.callPackage ./gayathri/default.nix { };
|
||||||
# font-smc-gayathri = pkgs.callPackage ./gayathri/default.nix { };
|
|
||||||
in rec {
|
in rec {
|
||||||
packages = {
|
packages = {
|
||||||
smc-fonts = fonts-smc;
|
smc-anjali-old-lipi = font-smc-anjali-old-lipi;
|
||||||
# smc-anjali-old-lipi = font-smc-anjali-old-lipi;
|
smc-manjari = font-smc-manjari;
|
||||||
# smc-manjari = font-smc-manjari;
|
smc-chilanka = font-smc-chilanka;
|
||||||
# smc-chilanka = font-smc-chilanka;
|
smc-gayathri = font-smc-gayathri;
|
||||||
# smc-gayathri = font-smc-gayathri;
|
|
||||||
default = fonts-smc;
|
all = pkgs.symlinkJoin {
|
||||||
|
name = "all";
|
||||||
|
paths = [
|
||||||
|
font-smc-anjali-old-lipi
|
||||||
|
font-smc-chilanka
|
||||||
|
font-smc-manjari
|
||||||
|
font-smc-gayathri
|
||||||
|
];
|
||||||
|
};
|
||||||
|
default = packages.all;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
52
shas.nix
52
shas.nix
@ -1,52 +0,0 @@
|
|||||||
{
|
|
||||||
|
|
||||||
# Font name , variant and sha
|
|
||||||
"anjalioldlipi" = {
|
|
||||||
"anjalioldlipi" = "sha256-c3ScpdN2h39Q6GLFL97pBBGrsillcMXmhlGilOAdF1w=";
|
|
||||||
};
|
|
||||||
"chilanka" = {
|
|
||||||
"chilanka" = "sha256-z+pRvm/8alA3TbUBuR4oDD/kpvuXJTqOBlzXEKBZvnE=";
|
|
||||||
};
|
|
||||||
"dyuthi" = {
|
|
||||||
"dyuthi" = "sha256-H+2ccvHmlZjtH8KfWBSQKPtMkY/NsydHqFNaTzLS4S8=";
|
|
||||||
};
|
|
||||||
"gayathri" = {
|
|
||||||
"gayathri" = "sha256-p9KZi31Na4hfUuDsKj4OXjc9s6J/8xMeuszlL5oVauQ=";
|
|
||||||
};
|
|
||||||
"karumbi" = {
|
|
||||||
"karumbi" = "sha256-aeKH7CWbJNtkgv1PsaWWxyBZor+UO9q9Cctpc/qnEQU=";
|
|
||||||
};
|
|
||||||
"keraleeyam" = {
|
|
||||||
"keraleeyam" = "sha256-UEhDtBaWof/2C36IapGhtYgdeQInUn+A/UAJIF7+RuA=";
|
|
||||||
};
|
|
||||||
"malini" = {
|
|
||||||
"Malini" = "sha256-LvXf1zAlLvZhn2/peRVjOPjQwG46mMP8Dxuvs4fmK1s=";
|
|
||||||
};
|
|
||||||
"manjari" = {
|
|
||||||
"manjari" = "sha256-Sq/7UOBO54c3id6FMZeOmnZTRceEkMAAN8W+C7v7Mtw=";
|
|
||||||
};
|
|
||||||
"meera" = {
|
|
||||||
"meera" = "sha256-yaqA2gYKc4OJ9YxmvQPUZ3qZFyKj0YciMaUoY1SST4I=";
|
|
||||||
};
|
|
||||||
"nupuram" = {
|
|
||||||
"Nupuram-Arrows-Color" =
|
|
||||||
"sha256-oFsUCu3mDuHok7BXPnb1VdKmqP7DTw6TXKv6iXDknzA=";
|
|
||||||
"Nupuram-Calligraphy" =
|
|
||||||
"sha256-R2fPKe5PZqWu4ftV3/iVZptBhq9rku7EcXQGzGgylns=";
|
|
||||||
"Nupuram-Color" = "sha256-JwanvoGtI3BrG/DxGreo+gVZNGPjLiQA31nheNcuZWw=";
|
|
||||||
"Nupuram-Dots" = "sha256-5V09G4PkDnHHd/oIRe3kHX6BOQ5HuVVcFSlae32bdVs=";
|
|
||||||
};
|
|
||||||
"rachana" = {
|
|
||||||
"rachana" = "sha256-csfMs4B6BD+yap/AaWpm4kQDsR/WNMrym6szM5iZNJo=";
|
|
||||||
};
|
|
||||||
"raghumalayalamsans" = {
|
|
||||||
"raghumalayalamsans" =
|
|
||||||
"sha256-rSM77MiFqRzs67mme8xkJZkw13esB9eG13j8OzytCaA=";
|
|
||||||
};
|
|
||||||
"suruma" = {
|
|
||||||
"suruma" = "sha256-x4ybBr5oCwD5Stu8rRGndOYRzaV6ikE+VnLJ/src+1U=";
|
|
||||||
};
|
|
||||||
"uroob" = {
|
|
||||||
"uroob" = "sha256-IJcKD3cDRMA7G7foKtXtJxOrv6OeOujkq9+uGo+R/dY=";
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user