⬆️ 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": {
"crane": {
"flake-parts": {
"inputs": {
"nixpkgs": [
"typst",
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1698166613,
"narHash": "sha256-y4rdN4flxRiROqNi1waMYIZj/Fs7L2OrszFk/1ry9vU=",
"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=",
"lastModified": 1701473968,
"narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4",
"rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5",
"type": "github"
},
"original": {
"id": "flake-parts",
"type": "indirect"
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"font-awesome": {
"flake": false,
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"lastModified": 1688375479,
"narHash": "sha256-h9LZum2f9+rZ4l4hjcmE49gDLVlbJUkRi1xSbJLVAGg=",
"owner": "duskmoon314",
"repo": "typst-fontawesome",
"rev": "1a0fcdca90ee07f297294c9c56fbcf3114340a47",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"owner": "duskmoon314",
"repo": "typst-fontawesome",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1700612854,
"narHash": "sha256-yrQ8osMD+vDLGFX7pcwsY/Qr5PUd6OmDMYJZzZi0+zc=",
"lastModified": 1703637592,
"narHash": "sha256-8MXjxU0RfFfzl57Zy3OfXCITS0qWDNLzlBAdwxGZwfY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "19cbff58383a4ae384dea4d1d0c823d72b49d614",
"rev": "cfc3698c31b1fb9cdcf10f36c9643460264d0ca8",
"type": "github"
},
"original": {
@ -72,45 +52,12 @@
"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": {
"inputs": {
"flake-utils": "flake-utils",
"flake-parts": "flake-parts",
"font-awesome": "font-awesome",
"nixpkgs": "nixpkgs",
"typst": "typst"
"systems": "systems"
}
},
"systems": {
@ -127,42 +74,6 @@
"repo": "default",
"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",

View file

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