From 4f387146f58fee9fd7aafabdb378019ea1786bd8 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Wed, 22 Mar 2023 20:11:12 +0100 Subject: package typst --- flake.lock | 133 +++++++++++++++++++++++++++++++++++++++++++++++------- flake.nix | 18 +++++--- home/packages.nix | 2 +- pkgs/overlay.nix | 7 +++ pkgs/typst.nix | 18 ++++++++ 5 files changed, 154 insertions(+), 24 deletions(-) create mode 100644 pkgs/typst.nix diff --git a/flake.lock b/flake.lock index 78b579b..3d5e7fb 100644 --- a/flake.lock +++ b/flake.lock @@ -48,9 +48,32 @@ "url": "ssh://cgit/~/blog" } }, - "deploy-rs": { + "crane": { "inputs": { "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1679461034, + "narHash": "sha256-pX4jF5hfEfBGlKw2yDJj9FjvVxmMdGgqKe1I+Vbail8=", + "owner": "ipetkov", + "repo": "crane", + "rev": "ec69da697357cfe7d9e8653b0cfbe73eaecca34b", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "deploy-rs": { + "inputs": { + "flake-compat": "flake-compat_2", "nixpkgs": [ "nixpkgs" ], @@ -72,7 +95,7 @@ }, "emacs-overlay": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "nixpkgs": "nixpkgs" }, "locked": { @@ -104,6 +127,22 @@ } }, "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1668681692, @@ -119,7 +158,7 @@ "type": "github" } }, - "flake-compat_2": { + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1668681692, @@ -136,6 +175,21 @@ } }, "flake-utils": { + "locked": { + "lastModified": 1676283394, + "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "locked": { "lastModified": 1667395993, "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", @@ -150,21 +204,19 @@ "type": "github" } }, - "freiraum": { - "flake": false, + "flake-utils_3": { "locked": { - "lastModified": 1671499903, - "narHash": "sha256-TbTDy2PHHYHTNS5XWJk0wBVf2AkMxuPwNUJ6sDjEHM8=", - "ref": "network", - "rev": "b9e51c9eec9ddafdfbb0ef9e9c9896b3015f0ce8", - "revCount": 3, - "type": "git", - "url": "https://git.infra4future.de/stuebinm/22f3-roomplans" + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" }, "original": { - "ref": "network", - "type": "git", - "url": "https://git.infra4future.de/stuebinm/22f3-roomplans" + "owner": "numtide", + "repo": "flake-utils", + "type": "github" } }, "gtfsBooks": { @@ -340,10 +392,10 @@ "inputs": { "almanac": "almanac", "blog": "blog", + "crane": "crane", "deploy-rs": "deploy-rs", "emacs-overlay": "emacs-overlay", "feeds": "feeds", - "freiraum": "freiraum", "gtfsBooks": "gtfsBooks", "home-manager": "home-manager", "isabelle-utils": "isabelle-utils", @@ -351,6 +403,7 @@ "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable", "playground": "playground", + "rust-overlay": "rust-overlay_2", "showrt": "showrt", "simple-nixos-mailserver": "simple-nixos-mailserver", "tracktrain": "tracktrain", @@ -359,6 +412,52 @@ "walint": "walint" } }, + "rust-overlay": { + "inputs": { + "flake-utils": [ + "crane", + "flake-utils" + ], + "nixpkgs": [ + "crane", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1677812689, + "narHash": "sha256-EakqhgRnjVeYJv5+BJx/NZ7/eFTMBxc4AhICUNquhUg=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "e53e8853aa7b0688bc270e9e6a681d22e01cf299", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_2": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1679451618, + "narHash": "sha256-gWFYRgmeT+8xDYHK4HSuCY9Pi7mSxC+2illHrmDkG7A=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "a89d328ca7d106c3fdbbd072b6c7088ab5b798a3", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "showrt": { "flake": false, "locked": { @@ -379,7 +478,7 @@ "simple-nixos-mailserver": { "inputs": { "blobs": "blobs", - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "nixpkgs": "nixpkgs_3", "nixpkgs-22_11": "nixpkgs-22_11", "utils": "utils_3" diff --git a/flake.nix b/flake.nix index 5ccd370..8aaa8ef 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,11 @@ simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master"; emacs-overlay.url = "gitlab:nix-community/emacs-overlay?rev=d938b780a3d8072aeac0178c46121060079ff217"; + crane.url = "github:ipetkov/crane"; + crane.inputs.nixpkgs.follows = "nixpkgs"; + rust-overlay.url = "github:oxalica/rust-overlay"; + rust-overlay.inputs.nixpkgs.follows = "nixpkgs"; + uplcg.url = "git+https://stuebinm.eu/git/uplcg?ref=main"; uplcg.flake = false; tracktrain.url = "git+https://stuebinm.eu/git/tracktrain?ref=main"; @@ -38,16 +43,17 @@ gtfsBooks.flake = false; walint.url = "git+https://stuebinm.eu/git/walint?ref=playground"; walint.flake = false; - - freiraum.url = "git+https://git.infra4future.de/stuebinm/22f3-roomplans?ref=network"; - freiraum.flake = false; }; outputs = { self, deploy-rs, ... }@inputs: let nixpkgs = import inputs.nixpkgs { system = "x86_64-linux"; - overlays = [ self.overlays.default ]; + overlays = [ + inputs.rust-overlay.overlays.default + inputs.crane.overlays.default + self.overlays.default + ]; }; mkConfig = imports: config: inputs.nixpkgs.lib.nixosSystem rec { @@ -111,9 +117,9 @@ home-minimal = self.homeConfigurations.stuebinm-minimal.activationPackage; overlays.default = final: prev: - import ./pkgs/overlay.nix final prev; + import ./pkgs/overlay.nix { inherit inputs; } final prev; packages.x86_64-linux = { - inherit (nixpkgs) galmon-core galmon-full glitchtip; + inherit (nixpkgs) galmon-core galmon-full glitchtip typst; }; }; } diff --git a/home/packages.nix b/home/packages.nix index 163a2d7..840e138 100644 --- a/home/packages.nix +++ b/home/packages.nix @@ -46,7 +46,7 @@ in gst_all_1.gstreamer vimiv-qt # LaTeX & documents texlive.combined.scheme-full xournal pandoc zathura pdfpc - poppler_utils + poppler_utils typst # general cli utils extras.almanac libnotify grim slurp wl-clipboard extras.showrt extras.kijetesantakaluotokieni mpc_cli duf dufs progress hledger diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index ada5d47..75e8cfc 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -1,8 +1,10 @@ +{ inputs, ... }: self: super: { galmon-core = self.callPackage (import ./galmon.nix {}) {}; galmon-full = self.callPackage (import ./galmon.nix { buildAll = true; }) {}; + glitchtip = (self.callPackage ./glitchtip.nix { python = super.python310.override ({ packageOverrides = self: super: { @@ -10,4 +12,9 @@ self: super: }; }); }); + + typst = self.callPackage ./typst.nix { + craneLib = (inputs.crane.mkLib self).overrideToolchain + self.rust-bin.stable.latest.default; + }; } diff --git a/pkgs/typst.nix b/pkgs/typst.nix new file mode 100644 index 0000000..0290899 --- /dev/null +++ b/pkgs/typst.nix @@ -0,0 +1,18 @@ +{ craneLib, fetchFromGitHub, lib, git }: + +craneLib.buildPackage rec { + pname = "typst-cli"; + version = "22-03-21-2"; + + cargoExtraArgs = "-p typst-cli"; + src = fetchFromGitHub { + owner = "typst"; + repo = "typst"; + sha256 = "sha256-JvVuTOnonHWDkT2MSQUVUuL23dS7fRDzQhqLpHE9pZw="; + rev = version; + leaveDotGit = true; + }; + + # the build.rs script wants a version hash from git. + buildInputs = [ git ]; +} -- cgit v1.2.3