Parcourir la source

build resume with nix flake

Hongrui Fang il y a 2 ans
Parent
commit
56447a785a
3 fichiers modifiés avec 53 ajouts et 0 suppressions
  1. 26 0
      flake.lock
  2. 24 0
      flake.nix
  3. 3 0
      shell.nix

+ 26 - 0
flake.lock

@@ -0,0 +1,26 @@
+{
+  "nodes": {
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1655269044,
+        "narHash": "sha256-VscxTckDD3wSdXsJxkOrdtDo4h4nVD5GutWQmD2uMlM=",
+        "owner": "nixos",
+        "repo": "nixpkgs",
+        "rev": "81ccb11016c0e333f6158ec6af965a47c37e5055",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nixos",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "root": {
+      "inputs": {
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}

+ 24 - 0
flake.nix

@@ -0,0 +1,24 @@
+{
+  inputs = { nixpkgs.url = "github:nixos/nixpkgs"; };
+
+  outputs = { self, nixpkgs }:
+    let
+      supportedSystems = nixpkgs.lib.systems.flakeExposed;
+      perSystem = nixpkgs.lib.genAttrs supportedSystems;
+      pkgsFor = system: import nixpkgs { inherit system; };
+
+      buildResumeFor = system:
+        let pkgs = pkgsFor system;
+        in pkgs.runCommand "build-resume" {
+          nativeBuildInputs = with pkgs; [ pandoc texlive.combined.scheme-context ];
+        } ''
+          cd ${self}
+          make OUT_DIR="$out"
+        '';
+    in {
+      packages.resume = perSystem (system: buildResumeFor system);
+      devShell =
+        perSystem (system: import ./shell.nix { pkgs = pkgsFor system; });
+      defaultPackage = perSystem (system: self.packages.resume.${system});
+    };
+}

+ 3 - 0
shell.nix

@@ -0,0 +1,3 @@
+{ pkgs ? import <nixpkgs> { } }:
+with pkgs;
+mkShell { buildInputs = [ pandoc texlive.combined.scheme-context gnumake ]; }