From a7cb13f15ab6d62fc45cf447cfe807d92bda4812 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Mon, 8 Jul 2024 16:26:51 -0500 Subject: [PATCH] WIP --- .gitignore | 1 + flake.nix | 10 +++++++--- nix/packages/stylesheet.nix | 12 ++++++++++++ package-lock.json | 6 ------ src/{stylus/styles.css => style.css} | 0 5 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 nix/packages/stylesheet.nix delete mode 100644 package-lock.json rename src/{stylus/styles.css => style.css} (100%) diff --git a/.gitignore b/.gitignore index a13e811..69701db 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /resources /public /node_modules +/result /.netlify diff --git a/flake.nix b/flake.nix index 16c533b..93b0b05 100644 --- a/flake.nix +++ b/flake.nix @@ -6,14 +6,18 @@ self, }: let systems = ["aarch64-linux" "aarch64-darwin" "x86_64-darwin" "x86_64-linux"]; - forAllSystems = nixpkgs.lib.genAttrs systems; + genSystemAttrs = nixpkgs.lib.genAttrs systems; pkgsFor = system: import nixpkgs {inherit system;}; - pkgsForAllSystems = f: (forAllSystems (system: f (pkgsFor system))); + pkgsGen = f: (genSystemAttrs (system: (f (pkgsFor system)))); buildDeps = pkgs: with pkgs; [hugo tailwindcss]; infraDeps = pkgs: with pkgs; [netlify-cli]; in { - devShells = pkgsForAllSystems (pkgs: { + packages = pkgsGen (pkgs: { + stylesheet = pkgs.callPackage ./nix/packages/stylesheet.nix {}; + }); + + devShells = pkgsGen (pkgs: { default = pkgs.mkShell { buildInputs = (buildDeps pkgs) ++ (infraDeps pkgs); }; diff --git a/nix/packages/stylesheet.nix b/nix/packages/stylesheet.nix new file mode 100644 index 0000000..b45c99d --- /dev/null +++ b/nix/packages/stylesheet.nix @@ -0,0 +1,12 @@ +{ + stdenvNoCC, + tailwindcss, +}: +stdenvNoCC.mkDerivation { + pname = "stylesheet"; + version = "1.0.0"; + src = ../..; + buildPhase = '' + ${tailwindcss}/bin/tailwindcss --input ./src/style.css --output $out/style.css + ''; +} diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index f41368d..0000000 --- a/package-lock.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "site.lyte.dev", - "lockfileVersion": 3, - "requires": true, - "packages": {} -} diff --git a/src/stylus/styles.css b/src/style.css similarity index 100% rename from src/stylus/styles.css rename to src/style.css