chore: update cocogitto module to use nixpkgs package, assert version

update flakes
This commit is contained in:
technofab 2025-12-20 14:37:26 +01:00
parent d609fd52fb
commit 5c8712f48c
Signed by: technofab
SSH key fingerprint: SHA256:bV4h88OqS/AxjbPn66uUdvK9JsgIW4tv3vwJQ8tpMqQ
3 changed files with 20 additions and 31 deletions

12
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1757487488, "lastModified": 1766070988,
"narHash": "sha256-zwE/e7CuPJUWKdvvTCB7iunV4E/+G0lKfv4kk/5Izdg=", "narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ab0f3607a6c7486ea22229b92ed2d355f1482ee0", "rev": "c6245e83d836d0433170a16eb185cefe0572f8b8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -37,11 +37,11 @@
}, },
"locked": { "locked": {
"dir": "lib", "dir": "lib",
"lastModified": 1756370106, "lastModified": 1758738378,
"narHash": "sha256-l84ojcHuQWBwn4BRxQsMMfQpcq/Az/sHh/hSqFgVtyg=", "narHash": "sha256-NjzqdvQCDDdObEBH8x/vdhbdhrIB+N9E570uCdksGHY=",
"owner": "rensa-nix", "owner": "rensa-nix",
"repo": "core", "repo": "core",
"rev": "9c1a29fa9ba7cbbb78b9e47eb8afbcd29303a3b4", "rev": "abe19f9f13aff41de2b63304545c87d193d19ef4",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {

View file

@ -4,30 +4,20 @@
config, config,
... ...
}: let }: let
inherit (lib) mkEnableOption mkOption mkIf types; inherit (lib) mkEnableOption mkOption mkIf types assertMsg versionAtLeast;
cfg = config.cocogitto; cfg = config.cocogitto;
# we need a newer version than in nixpkgs, since the PR which adds `--config`
# didn't land in a release yet
cocogitto = pkgs.cocogitto.overrideAttrs (_prev: {
version = "2025-09-11";
src = pkgs.fetchFromGitHub {
owner = "oknozor";
repo = "cocogitto";
rev = "031cc238cb3e3e8aa3a525c1df089c3e70020efc";
hash = "sha256-fyhugacBLJPMqHWxoxBTFhIE3wHDB9xdrqJYzJc36I0=";
};
});
configFile = (pkgs.formats.toml {}).generate "cog.toml" cfg.config; configFile = (pkgs.formats.toml {}).generate "cog.toml" cfg.config;
cogAlias = pkgs.writeTextFile { cogAlias = assert assertMsg (versionAtLeast pkgs.cocogitto.version "6.4")
"cocogitto needs to be version 6.4 or higher to support the --config param";
pkgs.writeTextFile {
name = "cog-alias"; name = "cog-alias";
destination = "/bin/${cfg.alias}"; destination = "/bin/${cfg.alias}";
executable = true; executable = true;
text = text =
# sh # sh
'' ''
${cocogitto}/bin/cog --config "${configFile}" ''${@:1} ${pkgs.cocogitto}/bin/cog --config "${configFile}" ''${@:1}
''; '';
}; };
in { in {

View file

@ -32,7 +32,6 @@ in {
}; };
lefthook.config = { lefthook.config = {
skip_output = ["meta" "execution_out"];
"pre-commit" = { "pre-commit" = {
parallel = true; parallel = true;
jobs = [ jobs = [
@ -45,7 +44,7 @@ in {
{ {
name = "soonix"; name = "soonix";
stage_fixed = true; stage_fixed = true;
run = "${soonix.shellHookFile}"; run = "${soonix.packages."soonix:update"}/bin/soonix:update";
} }
]; ];
}; };