From b4349d659c7630e224fbbfaaf863ddb629375ad1 Mon Sep 17 00:00:00 2001 From: Linshu Yang <46046648+profetia@users.noreply.github.com> Date: Sat, 15 Mar 2025 22:02:21 +0800 Subject: [PATCH] Add nix flake config (#69) --- flake.lock | 61 +++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..21b8bc7c --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1738961098, + "narHash": "sha256-yWNBf6VDW38tl179FEuJ0qukthVfB02kv+mRsfUsWC0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "a3eaf5e8eca7cab680b964138fb79073704aca75", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..e7b30250 --- /dev/null +++ b/flake.nix @@ -0,0 +1,72 @@ +{ + description = "Flake for Clice"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + tomlplusplus = pkgs.tomlplusplus.overrideAttrs ( + oldAttrs: { + mesonFlags = oldAttrs.mesonFlags or [] ++ [ + "-Dbuild_examples=false" + "-Dbuild_tests=false" + "-Dcompile_library=false" + ]; + + postInstall = oldAttrs.postInstall or "" + '' + cat > "$out/share/pkgconfig/toml++.pc" <