keycloak-theme/flake.nix
2024-11-13 17:58:58 +01:00

55 lines
1.7 KiB
Nix

{
description = "Keycloak pub.solar theme";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
devshell.url = "github:numtide/devshell";
devshell.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, flake-utils, devshell, nixpkgs }:
let
pkgs = import nixpkgs {
overlays = [
devshell.overlay
(import ./overlay.nix)
];
};
in
flake-utils.lib.simpleFlake {
inherit self nixpkgs;
name = "keycloak-theme-pub-solar";
overlay = ./overlay.nix;
preOverlays = [ devshell.overlays.default ];
shell = { pkgs }:
let
google-font-downloader = with pkgs; writeShellScriptBin "google-font-downloader" ''
echo "Attempting to fetch $1"
${nodejs}/bin/npx google-font-downloader -- $1
rm ./common/resources/scss/typography.scss
echo "/* To regenerate this file, run $ google-font-downloader '$1' */" >> ./common/resources/scss/typography.scss
echo "" >> ./common/resources/scss/typography.scss
cat ./google-fonts-*.css >> ./common/resources/scss/typography.scss
rm ./google-fonts-*.css
mv fonts ./common/resources/fonts
'';
in
pkgs.devshell.mkShell {
imports = [ ];
# Add additional packages you'd like to be available in your devshell
# PATH here
devshell.packages = [
google-font-downloader
pkgs.nodejs
pkgs.nodePackages.typescript
pkgs.nodePackages.typescript-language-server
pkgs.nodePackages.vue-language-server
];
};
};
}