From 8364b718729d8887747ce28562ab8f71e242a068 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sat, 9 Nov 2024 01:09:07 -0800 Subject: [PATCH] nix package + small tweaks for release --- default.nix | 6 +++- flake.lock | 51 ++++++++++++++++++++++++++++--- flake.nix | 12 ++++++-- pagefind.ts | 4 +-- public/favicon.svg | 26 +++++++++++++++- src/config/io/generateTypeData.ts | 22 ++++++++----- src/styles/main-page.css | 19 +++++++++++- 7 files changed, 121 insertions(+), 19 deletions(-) diff --git a/default.nix b/default.nix index ceaf318..c0868e1 100644 --- a/default.nix +++ b/default.nix @@ -6,6 +6,7 @@ yarn-berry, nodejs_22, cacert, + quickshell-types ? null, }: stdenv.mkDerivation (final: let nodeModules = stdenv.mkDerivation { pname = "${final.pname}-node_modules"; @@ -50,7 +51,7 @@ outputHashMode = "recursive"; outputHashAlgo = "sha256"; - outputHash = "rKoDjvG5t+aQRrzAz0eTifPtL3zmWAu/emxXWd1ocxM="; + outputHash = "tZ4xuA7uNnMIEpSUmQ5TAWPdvRGFJWIgWyBa1QFFWWU="; }; in { pname = "quickshell-web"; @@ -72,9 +73,12 @@ in { EOF cp -r ${nodeModules} node_modules + chmod +rw -R node_modules ''; buildPhase = '' + ${if quickshell-types != null then "export SECRET_MODULES_PATH=${quickshell-types}" else ""} + echo SECRET_MODULES_PATH: $SECRET_MODULES_PATH HOME=$(pwd)/garbage-tooling yarn build ''; diff --git a/flake.lock b/flake.lock index 9a1efd0..055073c 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1727348695, - "narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=", + "lastModified": 1730785428, + "narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", + "rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7", "type": "github" }, "original": { @@ -15,9 +15,52 @@ "type": "indirect" } }, + "quickshell": { + "inputs": { + "nixpkgs": [ + "quickshell-docs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730842284, + "narHash": "sha256-s0doicDkqzCqHvplBnjWPJtGJwajjDdfVkmmPu32l6Q=", + "ref": "refs/heads/master", + "rev": "b528be94260b572919ff47d2f5e3150ebc1ee3e9", + "revCount": 368, + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell" + }, + "original": { + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell" + } + }, + "quickshell-docs": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "quickshell": "quickshell" + }, + "locked": { + "lastModified": 1731140797, + "narHash": "sha256-ovpoYKNzGViJbl8Pqi+gtmKIOKQXS0dCK65pShyS64s=", + "ref": "refs/heads/master", + "rev": "bc2c0d5d2c3941fb4c7ba7fafc91a41a65af6728", + "revCount": 89, + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell-docs" + }, + "original": { + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell-docs" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "quickshell-docs": "quickshell-docs" } } }, diff --git a/flake.nix b/flake.nix index 2bb8982..b6e915c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,15 +1,23 @@ { inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; + + quickshell-docs = { + url = "git+https://git.outfoxxed.me/quickshell/quickshell-docs"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs }: let + outputs = { self, nixpkgs, quickshell-docs }: let forEachSystem = fn: nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: fn system nixpkgs.legacyPackages.${system}); in { packages = forEachSystem (system: pkgs: rec { - quickshell-web = pkgs.callPackage ./default.nix {}; + quickshell-web = pkgs.callPackage ./default.nix { + quickshell-types = quickshell-docs.packages.${system}.quickshell-types; + }; + default = quickshell-web; }); }; diff --git a/pagefind.ts b/pagefind.ts index c097d92..0f074da 100644 --- a/pagefind.ts +++ b/pagefind.ts @@ -13,8 +13,8 @@ export default function pagefind(): AstroIntegration { const relativeDir = relative(cwd, targetDir); return new Promise(resolve => { spawn( - "yarn dlx", - ["-q", "pagefind", "--site", relativeDir], + "yarn", + ["pagefind", "--site", relativeDir], { stdio: "inherit", shell: true, diff --git a/public/favicon.svg b/public/favicon.svg index ee539d4..bf2a3d6 100644 --- a/public/favicon.svg +++ b/public/favicon.svg @@ -1 +1,25 @@ - \ No newline at end of file + + + + + + diff --git a/src/config/io/generateTypeData.ts b/src/config/io/generateTypeData.ts index 8d2cf0f..91986c5 100644 --- a/src/config/io/generateTypeData.ts +++ b/src/config/io/generateTypeData.ts @@ -3,8 +3,20 @@ import path from "node:path"; import type { RouteData, dirData } from "./types"; +function modulesPath() { + const modulesPath = import.meta.env.SECRET_MODULES_PATH; + + if (!modulesPath || modulesPath === "") { + throw new Error( + "Cannot generate types, missing SECRET_MODULES_PATH" + ); + } + + return modulesPath; +} + async function readSubdir(subdir: string): Promise { - const fullpath = path.join(process.cwd(), "modules", subdir); + const fullpath = path.join(modulesPath(), subdir); const filenames = await fs.readdir(fullpath); const data = await Promise.all( @@ -31,13 +43,7 @@ async function readSubdir(subdir: string): Promise { } async function generateTypeData(): Promise { - const mainDir = import.meta.env.SECRET_MODULES_PATH; - - if (!mainDir || mainDir === "") { - throw new Error( - "Cannot generate types, missing SECRET_MODULES_PATH" - ); - } + const mainDir = modulesPath(); const subdirs = await fs.readdir(mainDir, { withFileTypes: true, diff --git a/src/styles/main-page.css b/src/styles/main-page.css index 132a27b..bafb19b 100644 --- a/src/styles/main-page.css +++ b/src/styles/main-page.css @@ -121,7 +121,7 @@ html.dark .main-page_hero-text { } } -html.dark .main-page_link-card { +/*html.dark .main-page_link-card { background-color: transparent; border-color: transparent; @@ -168,6 +168,23 @@ html.dark .main-page_link-card { } } } +}*/ + +html.dark .main-page_link-card { + background-color: hsl(var(--green) 38 25); + color: hsl(194 0 100); + + &:hover { + background-color: hsl(var(--green) 48 35); + } + + &.main-page_bluecard { + background-color: hsl(var(--blue) 38 25); + + &:hover { + background-color: hsl(var(--blue) 48 35); + } + } } .baselayout footer {