diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..a2663f9 --- /dev/null +++ b/default.nix @@ -0,0 +1,12 @@ +(import ( + let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + nodeName = lock.nodes.root.inputs.flake-compat; + in + fetchTarball { + url = + lock.nodes.${nodeName}.locked.url + or "https://github.com/NixOS/flake-compat/archive/${lock.nodes.${nodeName}.locked.rev}.tar.gz"; + sha256 = lock.nodes.${nodeName}.locked.narHash; + } +) { src = ./.; }).outputs.packages.${builtins.currentSystem} diff --git a/flake.lock b/flake.lock index 5d8ec75..ee2258b 100644 --- a/flake.lock +++ b/flake.lock @@ -36,6 +36,22 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -89,10 +105,10 @@ "inputs": { "crane": "crane", "fenix": "fenix", + "flake-compat": "flake-compat", "flake-parts": "flake-parts", "nixpkgs": "nixpkgs", "rust-manifest": "rust-manifest", - "systems": "systems", "typst": "typst" } }, @@ -125,21 +141,6 @@ "url": "https://static.rust-lang.org/dist/channel-rust-1.91.0.toml" } }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "typst": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 8131c6f..a780642 100644 --- a/flake.nix +++ b/flake.nix @@ -1,8 +1,14 @@ { + description = "Typst - a modern typesetting system"; + inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; - systems.url = "github:nix-systems/default"; + + flake-compat = { + url = "github:NixOS/flake-compat"; + flake = false; + }; typst = { url = "github:typst/typst/0.14"; @@ -32,7 +38,7 @@ ... }: flake-parts.lib.mkFlake { inherit inputs; } { - systems = import inputs.systems; + systems = inputs.nixpkgs.lib.systems.flakeExposed; imports = [ inputs.flake-parts.flakeModules.easyOverlay diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..692cd4d --- /dev/null +++ b/shell.nix @@ -0,0 +1,12 @@ +(import ( + let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + nodeName = lock.nodes.root.inputs.flake-compat; + in + fetchTarball { + url = + lock.nodes.${nodeName}.locked.url + or "https://github.com/NixOS/flake-compat/archive/${lock.nodes.${nodeName}.locked.rev}.tar.gz"; + sha256 = lock.nodes.${nodeName}.locked.narHash; + } +) { src = ./.; }).shellNix