about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--default.nix7
-rw-r--r--frontend/templates/index.tmpl1
-rw-r--r--justfile5
-rw-r--r--nix/sources.json13
-rw-r--r--shell.nix1
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 @@
   <head>
     <meta charset="UTF-8" />
     <title>Searchix</title>
+    <link href="/static/style.css" rel="stylesheet"/>
   </head>
   <body>
     <h1>Searchix</h1>
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/<owner>/<repo>/archive/<rev>.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/<owner>/<repo>/v<version>/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;
 }