Start working on converting to Nix flakes.

This commit is contained in:
2021-01-05 06:44:58 +00:00
parent 28fcd6e254
commit b3ecef1dcc
3 changed files with 62 additions and 23 deletions

View File

@@ -1,15 +1,12 @@
{ stdenv, lib, hugo, fetchgit, pkgs, nodejs, ruby }:
{ blog-source, blog-source-localized, stdenv, lib, hugo, fetchgit, pkgs, nodejs, ruby }:
let
url = "https://dev.danilafe.com/Web-Projects/blog-static.git";
requiredPackages = import ./required-packages.nix { inherit pkgs nodejs; };
website = settings: stdenv.mkDerivation {
name = "blog-static";
version = settings.rev;
src = fetchgit {
inherit url;
inherit (settings) rev sha256;
};
version = settings.source.rev;
src = settings.source;
urlSub =
let
regexEscape = lib.escape [ "/" "(" ")" "[" "]" "+" "*" "\\" ];
@@ -35,13 +32,13 @@ let
in
{
english = website {
inherit rev sha256;
source = blog-source;
path = ".";
drafts = false;
};
drafts = {
english = website {
inherit rev sha256;
source = blog-source;
path = ".";
drafts = true;
replaceUrl = {
@@ -50,8 +47,7 @@ in
};
};
russian = website {
rev = localizationRev;
sha256 = localizationSha256;
source = blog-source-localized;
path = "ru";
drafts = true;
replaceUrl = {