From 436c6b498b3f8f64f725e1cb79696df4dfab5313 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 5 Sep 2021 14:28:40 +0200 Subject: Flakeify --- flake.lock | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 43 +++++++++++++++++++++++++++++++++++++++++++ shell.nix | 20 -------------------- 3 files changed, 105 insertions(+), 20 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix delete mode 100644 shell.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..3eb910f --- /dev/null +++ b/flake.lock @@ -0,0 +1,62 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1629379628, + "narHash": "sha256-dI8wpEo7wIVWoTUk2oyWFUnlVHNKLs+ren1TqITN1mI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a1007637cea374bd1bafd754cfd5388894c49129", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-21.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1629271619, + "narHash": "sha256-by9D3OkEKk4rOzJIMbC0uP2wP3Bt81auP5xmbmPg2a8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7bbca9877caed472c6b5866ea09302cfcdce3dbf", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-21.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "pkgs-personal": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1629652608, + "narHash": "sha256-eNcsdqMyK/Q3P0Tj16uDNcQzKIFf4CJkM7qTq3BdtF0=", + "ref": "master", + "rev": "fb63603b5eec859c84464e1a7f6f14931303f679", + "revCount": 52, + "type": "git", + "url": "https://code.kummerlaender.eu/pkgs" + }, + "original": { + "type": "git", + "url": "https://code.kummerlaender.eu/pkgs" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "pkgs-personal": "pkgs-personal" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5eee081 --- /dev/null +++ b/flake.nix @@ -0,0 +1,43 @@ +{ + description = "static site generator for tree.kummerlaender.eu"; + + inputs = { + nixpkgs.url = github:NixOS/nixpkgs/nixos-21.05; + pkgs-personal.url = git+https://code.kummerlaender.eu/pkgs; + }; + + outputs = { self, nixpkgs, pkgs-personal, ... }: let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + in { + devShell.x86_64-linux = pkgs.mkShell { + buildInputs = [ + pkgs.pandoc + pkgs.highlight + pkgs-personal.katex-wrapper + pkgs-personal.make-xslt + ]; + }; + + generate = content: pkgs.stdenv.mkDerivation { + name = "tree.kummerlaender.eu"; + + src = ./.; + + LANG = "en_US.UTF-8"; + + buildInputs = [ + pkgs.pandoc + pkgs.highlight + pkgs-personal.katex-wrapper + pkgs-personal.make-xslt + ]; + + installPhase = '' + cp -r ${content} source/00_content + make-xslt + mkdir $out + cp -Lr target/99_result/* $out + ''; + }; + }; +} diff --git a/shell.nix b/shell.nix deleted file mode 100644 index e442c1c..0000000 --- a/shell.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ system ? builtins.currentSystem }: - -let - pkgs = import { inherit system; }; - mypkgs = import (fetchTarball "https://pkgs.kummerlaender.eu/nixexprs.tar.gz") { }; - -in pkgs.stdenv.mkDerivation rec { - name = "tree.kummerlaender.eu"; - - buildInputs = [ - pkgs.pandoc - pkgs.highlight - mypkgs.katex-wrapper - mypkgs.make-xslt - ]; - - shellHook = '' - export NIX_SHELL_NAME="${name}" - ''; -} -- cgit v1.2.3