diff --git a/Makefile b/Makefile index 4fe46de..1bc4d7b 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,16 @@ -.PHONY = build +.PHONY: build build: build-openring hugo -.PHONY = build-openring +.PHONY: build-openring build-openring: ./bin/openring-create --input assets/templates/openring-input.html --output layouts/partials/openring.html -.PHONY = serve -serve: - ls assets/templates/openring-input.html | entr make build-openring& hugo serve --buildFuture --verboseLog +.PHONY: serve +serve: build-openring + ls assets/templates/openring-input.html | LAST_COMMIT_DATE=$(git log -1 --format=%cI) hugo serve --buildFuture --verboseLog -.PHONY = update +.PHONY: update update: curl --silent --location https://api.github.com/repos/foo-dogsquared/hugo-theme-more-contentful/commits | jq '.[0].sha' --raw-output | xargs --replace='{}' hugo mod get -u "github.com/foo-dogsquared/hugo-theme-more-contentful@{}" && hugo mod tidy curl --silent --location https://api.github.com/repos/foo-dogsquared/hugo-web-feeds/commits | jq '.[0].sha' --raw-output | xargs --replace='{}' hugo mod get -u "github.com/foo-dogsquared/hugo-web-feeds@{}" && hugo mod tidy diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..0115882 --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1645652565, + "narHash": "sha256-yVQN2Wi8xSSpuj6JTck/6IOJ40hNvmoReMvFY86xd9w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4275a321beab5a71872fb7a5fe5da511bb2bec73", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-21.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..687232d --- /dev/null +++ b/flake.nix @@ -0,0 +1,17 @@ +{ + description = "Basic flake template for setting up this project."; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = inputs@{ self, nixpkgs, ... }: + let systems = inputs.flake-utils.lib.defaultSystems; + in inputs.flake-utils.lib.eachSystem systems (system: + let pkgs = import nixpkgs { inherit system; }; + in { + devShell = + import ./nix/shell.nix { inherit pkgs; }; + }); +} diff --git a/shell.nix b/shell.nix index 4eb650b..90a4f62 100644 --- a/shell.nix +++ b/shell.nix @@ -1,42 +1,11 @@ -let - # See https://nixos.wiki/wiki/FAQ/Pinning_Nixpkgs for more information on pinning - nixpkgs = builtins.fetchTarball { - # Descriptive name to make the store path easier to identify - name = "nixpkgs-unstable-2020-11-07"; - # Commit hash for nixos-unstable as of 2019-02-26 - url = https://github.com/NixOS/nixpkgs/archive/c54c614000644ecf9b8f8e9c873cfa91d1c05bf1.tar.gz; - # Hash obtained using `nix-prefetch-url --unpack ` - sha256 = "19xmsj1dhq25arhsfx0sl3r1y0zgpzfwhybc5dsxr1szh71wz3xs"; - }; -in -{ pkgs ? import {} }: +{ pkgs ? import { } }: with pkgs; -let - openring = buildGoModule rec { - pname = "openring"; - version = "af9038b5"; - - src = fetchgit { - url = "https://git.sr.ht/~sircmpwn/openring"; - rev = "af9038b5bbf8d0bac9f401ccab263990df900dab"; - sha256 = "1r8vnqbsrjrafva12v5cbv4229qsx7z5lp19zhqzky9chais4c9k"; - }; - - vendorSha256 = "sha256-BbBTmkGyLrIWphXC+dBaHaVzHuXRZ+4N/Jt2k3nF7Z4="; - - subPackages = [ "." ]; - - meta = with stdenv.lib; { - description = "Tool for generating a webring from a list of RSS feeds."; - homepage = "https://git.sr.ht/~sircmpwn/openring"; - license = licenses.gpl3; - }; - }; -in mkShell { - buildInputs = [ + packages = [ + curl + cacert asciidoctor entr git @@ -44,11 +13,12 @@ mkShell { hugo jq openring + gnumake ]; shellHook = '' - chmod +x ./bin --recursive go version hugo version + asciidoctor --version ''; }