From 177c2de3f7c2b1cee8dbea4acaa896a334ba3162 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 3 May 2024 00:15:35 +0200 Subject: feat: add css --- default.nix | 7 ++++++- frontend/templates/index.tmpl | 1 + justfile | 5 ++++- nix/sources.json | 13 +++++++++++++ shell.nix | 1 + 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index 0697abc..bcd04db 100644 --- a/default.nix +++ b/default.nix @@ -8,7 +8,12 @@ in ]; } ) -}: { +}: +{ + css = pkgs.fetchurl { + inherit (sources.simple-css) url sha256; + }; + searchix = pkgs.buildGoApplication { pname = "searchix"; version = "0.1"; diff --git a/frontend/templates/index.tmpl b/frontend/templates/index.tmpl index fd9cc8f..4b545cb 100644 --- a/frontend/templates/index.tmpl +++ b/frontend/templates/index.tmpl @@ -3,6 +3,7 @@ Searchix +

Searchix

diff --git a/justfile b/justfile index 45a5f11..a24dc88 100644 --- a/justfile +++ b/justfile @@ -1,6 +1,9 @@ default: @just --list --justfile {{ justfile() }} --unsorted +prepare: + ln -sf $(nix-build --no-out-link -A css) frontend/static/style.css + checkformat: gofmt -d . goimports -d . @@ -15,5 +18,5 @@ fix: precommit: nix-build -A pre-commit-check -dev: +dev: prepare wgo run ./serve/ --live diff --git a/nix/sources.json b/nix/sources.json index 1f2d396..1534db4 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -34,5 +34,18 @@ "type": "tarball", "url": "https://github.com/NixOS/nixpkgs/archive/58a1abdbae3217ca6b702f03d3b35125d88a2994.tar.gz", "url_template": "https://github.com///archive/.tar.gz" + }, + "simple-css": { + "branch": "main", + "description": "Mostly-reasonable HTML Styles.", + "homepage": "", + "owner": "kevquirk", + "repo": "simple.css", + "rev": "89787585fc44e6023f2b5e6f78a3e3ca8c60b10a", + "sha256": "1q35vvq932x3r02zycr2plfkzd8x5plzlwk71cl6gxpwvq26jhbx", + "type": "file", + "url": "https://raw.githubusercontent.com/kevquirk/simple.css/v2.3.0/simple.css", + "url_template": "https://raw.githubusercontent.com///v/simple.css", + "version": "2.3.0" } } diff --git a/shell.nix b/shell.nix index 2c635ad..28fc5ba 100644 --- a/shell.nix +++ b/shell.nix @@ -29,6 +29,7 @@ pkgs.mkShell { ]; shellHook = '' ${searchix.pre-commit-check.shellHook} + css=${searchix.css}/ ''; buildInputs = searchix.pre-commit-check.enabledPackages; } -- cgit 1.4.1