Update flake to flake-parts

This commit is contained in:
Martin Pander
2026-02-23 21:30:53 +01:00
parent b46aced2c7
commit 6b1418fc71
3 changed files with 47 additions and 52 deletions

View File

@@ -2,18 +2,16 @@
description = "Tasksquire";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
tasksquire = pkgs.buildGoModule {
perSystem = { config, self', inputs', pkgs, system, ... }: {
packages.tasksquire = pkgs.buildGoModule {
pname = "tasksquire";
version = "0.1.0";
src = ./.;
@@ -32,13 +30,13 @@
mainProgram = "tasksquire";
};
};
in
{
packages.default = tasksquire;
packages.tasksquire = tasksquire;
apps.default = flake-utils.lib.mkApp { drv = tasksquire; };
# Set the default package
packages.default = self'.packages.tasksquire;
# Development shell
devShells.default = pkgs.mkShell {
inputsFrom = [ self'.packages.tasksquire ];
buildInputs = with pkgs; [
go_1_24
gcc
@@ -50,14 +48,9 @@
go-tools
gotests
delve
taskwarrior3
timewarrior
];
CGO_CFLAGS = "-O";
};
# Backward compatibility
devShell = self.devShells.${system}.default;
});
};
};
}