From 95b66d8c45b1fda87e63938fbdc0e31d5035f204 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Sun, 12 Jan 2025 13:02:40 +0100 Subject: [PATCH] Create nix shell Remove more devenv stuff --- .envrc | 4 +--- README.md | 5 +++++ flake.nix | 33 +++++++++++++++++++++------------ 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.envrc b/.envrc index 5bf8fc1..3550a30 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1 @@ -source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0=" - -use devenv \ No newline at end of file +use flake diff --git a/README.md b/README.md index 05761ac..09a749d 100644 --- a/README.md +++ b/README.md @@ -1 +1,6 @@ # Blog + +```bash +$ cd src +$ jekyll serve +``` diff --git a/flake.nix b/flake.nix index fa4e156..5f3c659 100644 --- a/flake.nix +++ b/flake.nix @@ -6,8 +6,12 @@ flutils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs, flutils}: flutils.lib.eachDefaultSystem (system: - let + outputs = { + nixpkgs, + flutils, + ... + }: + flutils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; gems = pkgs.bundlerEnv { @@ -17,23 +21,24 @@ patch-feed-date = pkgs.stdenv.mkDerivation { name = "path-feed-date"; - propagatedBuildInputs = [ pkgs.python3 ]; + propagatedBuildInputs = [pkgs.python3]; dontUnpack = true; installPhase = "install -Dm755 ${./patch-feed-date.py} $out/bin/patch-feed-date"; }; - in - { - packages = { + + buildInputs = [ + gems + gems.wrappedRuby + patch-feed-date + ]; + in { + packages = rec { + default = static-website; static-website = pkgs.stdenv.mkDerivation { name = "blog"; src = ./src; sourceRoot = "src"; - - buildInputs = [ - gems - gems.wrappedRuby - patch-feed-date - ]; + inherit buildInputs; buildPhase = '' bundle exec jekyll build --future @@ -46,5 +51,9 @@ ''; }; }; + + devShells.default = pkgs.mkShell { + inherit buildInputs; + }; }); }