⬆️ switch from flake-utils to flake-parts + add systems as flake

This commit is contained in:
Laureηt 2024-01-01 12:15:53 +01:00
parent 66ef6665d5
commit b958156905
Signed by: Laurent
SSH key fingerprint: SHA256:kZEpW8cMJ54PDeCvOhzreNr4FSh6R13CMGH/POoO8DI
2 changed files with 59 additions and 134 deletions

View file

@ -1,68 +1,48 @@
{ {
"nodes": { "nodes": {
"crane": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs-lib": [
"typst",
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1698166613, "lastModified": 1701473968,
"narHash": "sha256-y4rdN4flxRiROqNi1waMYIZj/Fs7L2OrszFk/1ry9vU=", "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=",
"owner": "ipetkov",
"repo": "crane",
"rev": "b7db46f0f1751f7b1d1911f6be7daf568ad5bc65",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1696343447,
"narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "flake-parts", "owner": "hercules-ci",
"type": "indirect" "repo": "flake-parts",
"type": "github"
} }
}, },
"flake-utils": { "font-awesome": {
"inputs": { "flake": false,
"systems": "systems"
},
"locked": { "locked": {
"lastModified": 1694529238, "lastModified": 1688375479,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "narHash": "sha256-h9LZum2f9+rZ4l4hjcmE49gDLVlbJUkRi1xSbJLVAGg=",
"owner": "numtide", "owner": "duskmoon314",
"repo": "flake-utils", "repo": "typst-fontawesome",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "rev": "1a0fcdca90ee07f297294c9c56fbcf3114340a47",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "owner": "duskmoon314",
"repo": "flake-utils", "repo": "typst-fontawesome",
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1700612854, "lastModified": 1703637592,
"narHash": "sha256-yrQ8osMD+vDLGFX7pcwsY/Qr5PUd6OmDMYJZzZi0+zc=", "narHash": "sha256-8MXjxU0RfFfzl57Zy3OfXCITS0qWDNLzlBAdwxGZwfY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "19cbff58383a4ae384dea4d1d0c823d72b49d614", "rev": "cfc3698c31b1fb9cdcf10f36c9643460264d0ca8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -72,45 +52,12 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1696019113,
"narHash": "sha256-X3+DKYWJm93DRSdC5M6K5hLqzSya9BjibtBsuARoPco=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f5892ddac112a1e9b3612c39af1b72987ee5783a",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1698318101,
"narHash": "sha256-gUihHt3yPD7bVqg+k/UVHgngyaJ3DMEBchbymBMvK1E=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "63678e9f3d3afecfeafa0acead6239cdb447574c",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-parts": "flake-parts",
"font-awesome": "font-awesome",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"typst": "typst" "systems": "systems"
} }
}, },
"systems": { "systems": {
@ -127,42 +74,6 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"typst": {
"inputs": {
"crane": "crane",
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs_2",
"systems": "systems_2"
},
"locked": {
"lastModified": 1700840283,
"narHash": "sha256-ZueG6hz0W92izpJUkLcNQP+s06hGpHp9r/zx7nweYMc=",
"owner": "typst",
"repo": "typst",
"rev": "2f795b5c07171affa0709195a9dae3ed5c0afbeb",
"type": "github"
},
"original": {
"owner": "typst",
"repo": "typst",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -1,23 +1,41 @@
{ {
inputs = { inputs = {
typst.url = "github:typst/typst"; nixpkgs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils"; };
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
systems = {
url = "github:nix-systems/default";
}; };
outputs = { self, nixpkgs, typst, flake-utils }: font-awesome = {
flake-utils.lib.eachDefaultSystem (system: url = "github:duskmoon314/typst-fontawesome";
let flake = false;
pkgs = import nixpkgs {
inherit system;
overlays = [ typst.overlays.default ];
}; };
fonts_path = with pkgs; };
lib.concatStringsSep ":" [ lato font-awesome raleway ];
outputs = {
self,
nixpkgs,
flake-parts,
...
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = import inputs.systems;
perSystem = {
pkgs,
system,
...
}: let
fonts_path = with pkgs; lib.concatStringsSep ":" [lato font-awesome raleway];
in { in {
devShell = pkgs.mkShell { devShells.default = pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
typst-dev typst
typstfmt typstfmt
typst-lsp typst-lsp
typst-live typst-live
@ -31,17 +49,12 @@
name = "resume"; name = "resume";
dontUnpack = true; dontUnpack = true;
buildInputs = with pkgs; [ typst-dev ]; buildInputs = with pkgs; [typst];
TYPST_FONT_PATHS = fonts_path; TYPST_FONT_PATHS = fonts_path;
src = ./.; src = ./.;
fontawesome = pkgs.fetchFromGitHub { fontawesome = inputs.font-awesome;
owner = "duskmoon314";
repo = "typst-fontawesome";
rev = "1a0fcdca90ee07f297294c9c56fbcf3114340a47";
hash = "sha256-h9LZum2f9+rZ4l4hjcmE49gDLVlbJUkRi1xSbJLVAGg=";
};
buildPhase = '' buildPhase = ''
# copy sources # copy sources
@ -61,5 +74,6 @@
cp resume.pdf $out/resume.pdf cp resume.pdf $out/resume.pdf
''; '';
}; };
}); };
};
} }