mirror of
https://gitlab.com/rensa-nix/devtools.git
synced 2026-02-02 07:15:08 +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": {
|
"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": {
|
||||||
|
|
|
||||||
|
|
@ -4,32 +4,22 @@
|
||||||
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")
|
||||||
name = "cog-alias";
|
"cocogitto needs to be version 6.4 or higher to support the --config param";
|
||||||
destination = "/bin/${cfg.alias}";
|
pkgs.writeTextFile {
|
||||||
executable = true;
|
name = "cog-alias";
|
||||||
text =
|
destination = "/bin/${cfg.alias}";
|
||||||
# sh
|
executable = true;
|
||||||
''
|
text =
|
||||||
${cocogitto}/bin/cog --config "${configFile}" ''${@:1}
|
# sh
|
||||||
'';
|
''
|
||||||
};
|
${pkgs.cocogitto}/bin/cog --config "${configFile}" ''${@:1}
|
||||||
|
'';
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
options.cocogitto = {
|
options.cocogitto = {
|
||||||
enable =
|
enable =
|
||||||
|
|
|
||||||
|
|
@ -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";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue