mirror of
https://gitlab.com/rensa-nix/devtools.git
synced 2026-02-01 23:05:07 +01:00
chore: update cocogitto module to use nixpkgs package, assert version
update flakes
This commit is contained in:
parent
d609fd52fb
commit
5c8712f48c
3 changed files with 20 additions and 31 deletions
12
flake.lock
generated
12
flake.lock
generated
|
|
@ -2,11 +2,11 @@
|
|||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1757487488,
|
||||
"narHash": "sha256-zwE/e7CuPJUWKdvvTCB7iunV4E/+G0lKfv4kk/5Izdg=",
|
||||
"lastModified": 1766070988,
|
||||
"narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ab0f3607a6c7486ea22229b92ed2d355f1482ee0",
|
||||
"rev": "c6245e83d836d0433170a16eb185cefe0572f8b8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -37,11 +37,11 @@
|
|||
},
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1756370106,
|
||||
"narHash": "sha256-l84ojcHuQWBwn4BRxQsMMfQpcq/Az/sHh/hSqFgVtyg=",
|
||||
"lastModified": 1758738378,
|
||||
"narHash": "sha256-NjzqdvQCDDdObEBH8x/vdhbdhrIB+N9E570uCdksGHY=",
|
||||
"owner": "rensa-nix",
|
||||
"repo": "core",
|
||||
"rev": "9c1a29fa9ba7cbbb78b9e47eb8afbcd29303a3b4",
|
||||
"rev": "abe19f9f13aff41de2b63304545c87d193d19ef4",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -4,32 +4,22 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption mkIf types;
|
||||
inherit (lib) mkEnableOption mkOption mkIf types assertMsg versionAtLeast;
|
||||
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;
|
||||
cogAlias = pkgs.writeTextFile {
|
||||
name = "cog-alias";
|
||||
destination = "/bin/${cfg.alias}";
|
||||
executable = true;
|
||||
text =
|
||||
# sh
|
||||
''
|
||||
${cocogitto}/bin/cog --config "${configFile}" ''${@:1}
|
||||
'';
|
||||
};
|
||||
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";
|
||||
destination = "/bin/${cfg.alias}";
|
||||
executable = true;
|
||||
text =
|
||||
# sh
|
||||
''
|
||||
${pkgs.cocogitto}/bin/cog --config "${configFile}" ''${@:1}
|
||||
'';
|
||||
};
|
||||
in {
|
||||
options.cocogitto = {
|
||||
enable =
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ in {
|
|||
};
|
||||
|
||||
lefthook.config = {
|
||||
skip_output = ["meta" "execution_out"];
|
||||
"pre-commit" = {
|
||||
parallel = true;
|
||||
jobs = [
|
||||
|
|
@ -45,7 +44,7 @@ in {
|
|||
{
|
||||
name = "soonix";
|
||||
stage_fixed = true;
|
||||
run = "${soonix.shellHookFile}";
|
||||
run = "${soonix.packages."soonix:update"}/bin/soonix:update";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue