From 166d7a8e729a9f9a76b4d6000cd0c938afb9e97d Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Sun, 16 May 2021 23:23:08 +0300 Subject: [PATCH] feat: switch to html nix --- .gitignore | 2 +- .gitlab-ci.yml | 12 +++--- .gitmodules | 3 -- config.toml | 32 +-------------- content/_index.md | 4 -- content/info/_index.md | 2 - docker/Dockerfile | 3 -- flake.lock | 64 +++++++++++++++++++++++++++++ flake.nix | 31 ++++++++++++++ {content/info => pages}/about.md | 10 ++--- {content/info => pages}/projects.md | 8 ++-- posts/2021-05-16_Hello world!.md | 1 + themes/after-dark | 1 - 13 files changed, 112 insertions(+), 61 deletions(-) delete mode 100644 .gitmodules delete mode 100644 content/_index.md delete mode 100644 content/info/_index.md delete mode 100644 docker/Dockerfile create mode 100644 flake.lock create mode 100644 flake.nix rename {content/info => pages}/about.md (79%) rename {content/info => pages}/projects.md (97%) create mode 100644 posts/2021-05-16_Hello world!.md delete mode 160000 themes/after-dark diff --git a/.gitignore b/.gitignore index a48cf0d..e2f5dd2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -public +result \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 99c7f0b..beab54f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,15 +1,17 @@ -image: yusdacra/website:latest +image: yusdacra/nix-flake:latest -variables: - GIT_SUBMODULE_STRATEGY: recursive +before_script: + - . /bin/pre-build.sh pages: stage: deploy script: - - zola build + - nix build -L --show-trace artifacts: paths: - - public + - result only: - master +after_script: + - ./bin/post-build.sh \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 40d1610..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "themes/after-dark"] - path = themes/after-dark - url = https://github.com/yusdacra/after-dark.git diff --git a/config.toml b/config.toml index 9f01eb7..6f70212 100644 --- a/config.toml +++ b/config.toml @@ -1,31 +1 @@ -# The URL the site will be built for -base_url = "https://yusdacra.gitlab.io" -title = "yusdacra's stuff" - -# Whether to automatically compile all Sass files in the sass directory -compile_sass = true - -# Whether to do syntax highlighting -# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola -highlight_code = true - -# Whether to build a search index to be used later on by a JavaScript library -build_search_index = true -generate_rss = true - -check_external_links = true - -taxonomies = [ - {name = "categories", rss = true}, - {name = "tags", rss = true}, -] - -theme = "after-dark" - -[extra] -# Put all your custom variables here -after_dark_menu = [ - { name = "posts", url = "$BASE_URL" }, - { name = "about me", url = "$BASE_URL/info/about" }, - { name = "projects", url = "$BASE_URL/info/projects" }, -] +title = "yusdacra's stuff" \ No newline at end of file diff --git a/content/_index.md b/content/_index.md deleted file mode 100644 index 42d8574..0000000 --- a/content/_index.md +++ /dev/null @@ -1,4 +0,0 @@ -+++ -title = "posts" -paginate_by = 5 -+++ diff --git a/content/info/_index.md b/content/info/_index.md deleted file mode 100644 index ac36e06..0000000 --- a/content/info/_index.md +++ /dev/null @@ -1,2 +0,0 @@ -+++ -+++ diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index c8d3ce0..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM alpine:edge -RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing zola - diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..61d2a8e --- /dev/null +++ b/flake.lock @@ -0,0 +1,64 @@ +{ + "nodes": { + "flakeUtils": { + "locked": { + "lastModified": 1620759905, + "narHash": "sha256-WiyWawrgmyN0EdmiHyG2V+fqReiVi8bM9cRdMaKQOFg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b543720b25df6ffdfcf9227afafc5b8c1fabfae8", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "htmlNix": { + "inputs": { + "flakeUtils": [ + "flakeUtils" + ], + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1621196554, + "narHash": "sha256-8VI+5fOItvoX0oVLi0aUfrZ+SIJ76M2yHoJ/kerNvdk=", + "owner": "yusdacra", + "repo": "html.nix", + "rev": "27f5d1bd67e5f0a74b713acd49a2e8e5ef5b3c36", + "type": "github" + }, + "original": { + "owner": "yusdacra", + "repo": "html.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1621084586, + "narHash": "sha256-raHuJ7ohDLDPqohJzZxhaER7sSh4/1xR6YcUYMj3c3E=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e83b3f3394834c41c0d25017f6808d65c3d6f880", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flakeUtils": "flakeUtils", + "htmlNix": "htmlNix" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f6d77e6 --- /dev/null +++ b/flake.nix @@ -0,0 +1,31 @@ +{ + inputs = { + htmlNix = { + url = "github:yusdacra/html.nix"; + inputs.flakeUtils.follows = "flakeUtils"; + }; + flakeUtils.url = "github:numtide/flake-utils"; + }; + + outputs = { htmlNix, flakeUtils, ... }@inputs: + with flakeUtils.lib; + eachDefaultSystem (system: + let + lib = htmlNix.lib.${system}; + ownTemplater = x: x; + site = lib.pkgsLib.mkSiteFrom { src = ./.; templater = context: ownTemplater (lib.templaters.basic context); }; + in + rec { + apps = { + website = mkApp { + drv = lib.pkgsLib.mkServeFromSite site; + name = "serve"; + }; + }; + packages = { + website = lib.pkgsLib.mkSitePath site; + }; + defaultPackage = packages.website; + defaultApp = apps.website; + }); +} diff --git a/content/info/about.md b/pages/about.md similarity index 79% rename from content/info/about.md rename to pages/about.md index 7cbc269..c53a852 100644 --- a/content/info/about.md +++ b/pages/about.md @@ -1,6 +1,4 @@ -+++ -title = "about me" -+++ +# # About Hello. This is where I post about stuff. Feel free to send an e-mail or DM me on Matrix if you have anything to ask. @@ -12,11 +10,11 @@ Feel free to send an e-mail or DM me on Matrix if you have anything to ask. - GitLab: - GitHub: -## Bio +## ## Bio -I mainly work with Rust and Dart (with Flutter). My main areas of interest are +I mainly work with Rust and Nix. My main areas of interest are embedded, operating systems and game development, although I'm open to -anything else as well. I also work with C++ (mostly for Arduino), +anything else as well. I also work with Flutter, C++ (mostly for Arduino), GDScript (for Godot Engine), Kotlin (for my application's native Android needs that Flutter can't satisfy, mostly backend). I have worked with C# and Unity for about 5 years. diff --git a/content/info/projects.md b/pages/projects.md similarity index 97% rename from content/info/projects.md rename to pages/projects.md index 946155c..c55c866 100644 --- a/content/info/projects.md +++ b/pages/projects.md @@ -1,8 +1,6 @@ -+++ -title = "projects" -+++ +# # Projects -## Projects I contribute(d) to +## ## Projects I contribute(d) to - [Veloren](https://gitlab.com/veloren/veloren) and it's [Book](https://gitlab.com/veloren/book) - Veloren is a multiplayer voxel RPG written in Rust. @@ -21,7 +19,7 @@ title = "projects" ---- -## Projects I maintain +## ## Projects I maintain - [rust-nix-templater](https://github.com/yusdacra/rust-nix-templater) and [nix-cargo-integration](https://github.com/yusdacra/nix-cargo-integration) - `nix-cargo-integration` allows easy and convenient integration of Cargo projects with Nix. diff --git a/posts/2021-05-16_Hello world!.md b/posts/2021-05-16_Hello world!.md new file mode 100644 index 0000000..a211a64 --- /dev/null +++ b/posts/2021-05-16_Hello world!.md @@ -0,0 +1 @@ +First! \ No newline at end of file diff --git a/themes/after-dark b/themes/after-dark deleted file mode 160000 index 5f60774..0000000 --- a/themes/after-dark +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5f60774597cf6b5e2b480989ad296023e36da450