# Author: Euxane TRAN-GIRARD # Licence: EUPL-1.2 { inputs = { # For Nim 2.2.0 (necessary for generics, also better C compiler on master) # https://github.com/NixOS/nixpkgs/pull/346578 nixpkgs.url = "github:NixOS/nixpkgs/7b2fbd2"; flake-utils.url = "github:numtide/flake-utils"; flaky-utils.url = "git+https://cgit.euxane.net/flaky-utils"; }; outputs = { self, nixpkgs, flake-utils, flaky-utils }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; in { devShell = flaky-utils.lib.mkDevShell { inherit pkgs; tools = with pkgs; [ nim nrpl nim-atlas nimble nimlangserver nim_lk ]; prePrompt = '' echo " to exit this development shell." ''; shell = null; }; packages.default = pkgs.stdenv.mkDerivation (final: { pname = "tickwatch"; meta.mainProgram = final.pname; version = "SNAPSHOT"; src = ./.; buildInputs = [ pkgs.nim ]; buildPhase = '' export VERSION=${final.version} nim c --nimcache:. -d:release main.nim ''; doCheck = true; checkPhase = '' nim r --nimcache:. -d:test main.nim ''; installPhase = '' mkdir -p $out/bin mv main $out/bin/${final.meta.mainProgram} ''; }); }); }