From e35f4802482043f0819f475e576f57a29213cc32 Mon Sep 17 00:00:00 2001 From: Martin Pander Date: Sat, 7 Feb 2026 20:32:52 +0100 Subject: [PATCH] Update flake --- flake.lock | 12 +++++----- flake.nix | 65 +++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 51 insertions(+), 26 deletions(-) diff --git a/flake.lock b/flake.lock index 38a70dd..24fd1d1 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1715787315, - "narHash": "sha256-cYApT0NXJfqBkKcci7D9Kr4CBYZKOQKDYA23q8XNuWg=", + "lastModified": 1770197578, + "narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "33d1e753c82ffc557b4a585c77de43d4c922ebb5", + "rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 0e65656..5a34ff1 100644 --- a/flake.nix +++ b/flake.nix @@ -13,27 +13,52 @@ inherit system; }; - buildDeps = with pkgs; [ - go_1_22 - gcc - ]; + tasksquire = pkgs.buildGoModule { + pname = "tasksquire"; + version = "0.1.0"; + src = ./.; - devDeps = with pkgs; buildDeps ++ [ - gotools - golangci-lint - gopls - go-outline - gopkgs - go-tools - gotests - delve - ]; - in - { - devShell = pkgs.mkShell { - buildInputs = devDeps; - CGO_CFLAGS="-O"; + # Update this hash when dependencies change. + # You can get the correct hash by running `nix build`. + vendorHash = "sha256-fDzQuKBZPkOATMMnYcFv/aJP62XDhL9LjM/UYre9JQ4="; + + ldflags = [ "-s" "-w" ]; + + nativeBuildInputs = with pkgs; [ + taskwarrior3 + timewarrior + ]; + + meta = with pkgs.lib; { + description = "A Terminal User Interface (TUI) for Taskwarrior"; + mainProgram = "tasksquire"; + }; }; + in + { + packages.default = tasksquire; + packages.tasksquire = tasksquire; + apps.default = flake-utils.lib.mkApp { drv = tasksquire; }; + + devShells.default = pkgs.mkShell { + buildInputs = with pkgs; [ + go_1_24 + gcc + gotools + golangci-lint + gopls + go-outline + gopkgs + go-tools + gotests + delve + taskwarrior3 + timewarrior + ]; + CGO_CFLAGS = "-O"; + }; + + # Backward compatibility + devShell = self.devShells.${system}.default; }); } -