This commit is contained in:
dusk 2022-07-30 14:30:02 +03:00
parent 3f0caa133a
commit daaaa5bd05
Signed by: dusk
GPG Key ID: 1D8F8FAF2294D6EA
4 changed files with 35 additions and 20 deletions

View File

@ -25,11 +25,11 @@
]
},
"locked": {
"lastModified": 1659159625,
"narHash": "sha256-TElL1iaIY/xrIX+JYsppKWa510R8aJDXWQJxjpyCVxo=",
"lastModified": 1659180517,
"narHash": "sha256-JHgu5lnXDPjYDbxxbYTZtUMtg0HMF3j8ZmryEw1Iw+A=",
"owner": "yusdacra",
"repo": "html.nix",
"rev": "5bca7064e4de141f85b14a2c5262f204ac5f56bd",
"rev": "54b5c7f003c31a171da27f37c7ba1fbb0f38381d",
"type": "github"
},
"original": {

View File

@ -9,31 +9,45 @@
flakeUtils.url = "github:numtide/flake-utils";
};
outputs = { htmlNix, flakeUtils, nixpkgs, ... }@inputs:
outputs = {
htmlNix,
flakeUtils,
nixpkgs,
...
} @ inputs:
with flakeUtils.lib;
eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs.lib) mapAttrsRecursive hasSuffix last pipe;
eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
lib = htmlNix.lib.${system};
site = local: lib.pkgsLib.mkSiteFrom {
inherit local;
src = ./.;
templater = lib.templaters.basic;
};
in
rec {
inherit (builtins) readFile;
ssgLib = htmlNix.lib.${system}.pkgsLib;
htmlLib = htmlNix.lib;
site = local:
ssgLib.mkSiteFrom {
inherit local;
src = ./.;
templater = ctx:
htmlLib.templaters.basic
(
ctx
// {
indexContent = builtins.readFile ./main-content.html;
resources = {
"gaze-office.webp" = ./resources/GazeOfficeIcon.webp;
};
}
);
};
in rec {
apps = {
website = mkApp {
drv = lib.pkgsLib.mkServeFromSite (site true);
drv = ssgLib.mkServeFromSite (site true);
name = "serve";
};
};
packages = {
website = lib.pkgsLib.mkSitePath (site false);
website = ssgLib.mkSitePath (site false);
};
defaultPackage = packages.website;
defaultApp = apps.website;
});
}

1
main-content.html Normal file
View File

@ -0,0 +1 @@
<img src="resources/gaze-office.webp" style="position: relative; display: block; margin: auto;">

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB