From a9b9444fc9f138647948aa069b3d5625227e0bee Mon Sep 17 00:00:00 2001 From: Rachel Lambda Samuelsson Date: Sat, 9 Dec 2023 12:31:15 +0100 Subject: [PATCH] nix building --- _config.yml | 3 ++- shell.nix => deps.nix | 8 +------- flake.nix | 21 ++++++++++++++++----- 3 files changed, 19 insertions(+), 13 deletions(-) rename shell.nix => deps.nix (97%) diff --git a/_config.yml b/_config.yml index 415f306..4ac19b0 100644 --- a/_config.yml +++ b/_config.yml @@ -12,9 +12,10 @@ exclude: - "*.agdai" - "readme.md" - "LICENSE" - - "shell.nix" + - "deps.nix" - "flake.nix" - "flake.lock" + - "result" katex: rendering_options: diff --git a/shell.nix b/deps.nix similarity index 97% rename from shell.nix rename to deps.nix index 470fb35..dff8b6b 100644 --- a/shell.nix +++ b/deps.nix @@ -96,10 +96,4 @@ with pkgs; let webrick ]); in -mkShell { - packages = [ - nodejs - ]; - - inputsFrom = [ rubyEnv ]; -} +rubyEnv.gems diff --git a/flake.nix b/flake.nix index 659b80a..d5f8ed3 100644 --- a/flake.nix +++ b/flake.nix @@ -6,9 +6,20 @@ }; outputs = { self, nixpkgs, flake-utils }: - flake-utils.lib.eachDefaultSystem (sys: { - devShells.default = import ./shell.nix { - pkgs = nixpkgs.legacyPackages.${sys}; - }; - }); + flake-utils.lib.eachDefaultSystem (sys: + let pkgs = nixpkgs.legacyPackages.${sys}; + deps = import ./deps.nix { inherit pkgs; }; + in { + devShells.default = pkgs.mkShell { + packages = deps; + }; + packages.default = pkgs.stdenv.mkDerivation { + name = "rachel.cafe"; + buildInputs = deps; + src = ./.; + buildPhase = '' + JEKYLL_ENV=production jekyll build -d $out + ''; + }; + }); }