initial commit
This commit is contained in:
commit
b887bc4863
13
.gitignore
vendored
Normal file
13
.gitignore
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
# Generated files by hugo
|
||||
/public/
|
||||
/resources/_gen/
|
||||
/assets/jsconfig.json
|
||||
hugo_stats.json
|
||||
|
||||
# Temporary lock file while building
|
||||
/.hugo_build.lock
|
||||
|
||||
# Nix
|
||||
.direnv/
|
||||
/result
|
||||
/themes/
|
6
archetypes/default.md
Normal file
6
archetypes/default.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
title: "{{ replace .Name "-" " " | title }}"
|
||||
date: {{ .Date }}
|
||||
draft: true
|
||||
---
|
||||
|
5
config.toml
Normal file
5
config.toml
Normal file
@ -0,0 +1,5 @@
|
||||
baseURL = 'http://example.org/'
|
||||
languageCode = 'en-us'
|
||||
title = 'My New Hugo Site'
|
||||
|
||||
theme = 'nostyleplease'
|
7
content/posts/my-first-post.md
Normal file
7
content/posts/my-first-post.md
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
title: "My First Post"
|
||||
date: 2023-08-17T15:49:41+02:00
|
||||
draft: true
|
||||
---
|
||||
|
||||
# This is a test
|
78
flake.lock
generated
Normal file
78
flake.lock
generated
Normal file
@ -0,0 +1,78 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1689068808,
|
||||
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1692207601,
|
||||
"narHash": "sha256-tfPGNKQcJT1cvT6ufqO/7ydYNL6mcJClvzbrzhKjB80=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b30c68669df77d981ce4aefd6b9d378563f6fc4e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-23.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nostyleplease": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1682750457,
|
||||
"narHash": "sha256-ks98fcijlwIn8dA9SF/gNMQ5kYmI816gGhfPDpU+18Y=",
|
||||
"owner": "Masellum",
|
||||
"repo": "hugo-theme-nostyleplease",
|
||||
"rev": "1f0773883f3454c3154585a3458c039775415b79",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Masellum",
|
||||
"repo": "hugo-theme-nostyleplease",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nostyleplease": "nostyleplease"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
58
flake.nix
Normal file
58
flake.nix
Normal file
@ -0,0 +1,58 @@
|
||||
{
|
||||
description = "A very basic flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
nostyleplease = {
|
||||
url = "github:Masellum/hugo-theme-nostyleplease";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
nostyleplease,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
packages.default = pkgs.stdenv.mkDerivation {
|
||||
name = "blog";
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "Kristian's personal blog";
|
||||
platforms = platforms.all;
|
||||
};
|
||||
|
||||
# Exclude themes and public folder from build sources
|
||||
src = builtins.filterSource (path: type:
|
||||
!(type
|
||||
== "directory"
|
||||
&& (baseNameOf path == "themes" || baseNameOf path == "public")))
|
||||
./.;
|
||||
|
||||
# Link theme to themes folder and build
|
||||
buildPhase = ''
|
||||
mkdir -p themes
|
||||
ln -s ${nostyleplease} themes/nostyleplease
|
||||
${pkgs.hugo}/bin/hugo --minify
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
cp -r public $out
|
||||
'';
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [hugo];
|
||||
# Link theme to themes folder
|
||||
shellHook = ''
|
||||
mkdir -p themes
|
||||
ln -sf ${nostyleplease} themes/nostyleplease
|
||||
'';
|
||||
};
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user