From f2c1b79720f7d9ccd22d288defc1804e77c10087 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 15 Feb 2026 01:45:31 +0900 Subject: chore: update flake --- flake.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 866c8d1..8d32a8c 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Decidedly Unimplemented C compiler, a toy C compiler"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; systems.url = "github:nix-systems/x86_64-linux"; @@ -31,10 +31,20 @@ pkgs = import nixpkgs { inherit system; }; treefmt = treefmt-nix.lib.evalModule pkgs ./treefmt.nix; in + let + version = + let + versionFileContent = builtins.readFile ./src/version.h; + matches = builtins.match ''.*DUCC_VERSION "([^"]+)".*'' versionFileContent; + in + builtins.head matches; + in { + formatter = treefmt.config.build.wrapper; + packages.default = pkgs.stdenv.mkDerivation { pname = "ducc"; - version = "0.4.0"; + inherit version; src = ./.; # Disable some kinds of hardening to disable GCC optimization. # cf. https://nixos.wiki/wiki/C#Hardening_flags @@ -64,8 +74,6 @@ )" ''; }; - - formatter = treefmt.config.build.wrapper; } ); } -- cgit v1.3-1-g0d28