diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a415272..7d70f67 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ # Generated by soonix, DO NOT EDIT include: -- component: gitlab.com/TECHNOFAB/nix-gitlab-ci/nix-gitlab-ci@3.0.0-alpha.2 +- component: gitlab.com/TECHNOFAB/nix-gitlab-ci/nix-gitlab-ci@3.1.2 inputs: - version: 3.0.0-alpha.2 + version: 3.1.2 diff --git a/.gitlab/renovate.json5 b/.gitlab/renovate.json5 new file mode 100644 index 0000000..15f01d5 --- /dev/null +++ b/.gitlab/renovate.json5 @@ -0,0 +1,26 @@ + +{ + "extends": [ + "config:recommended" + ], + "gitlabci": { + "enabled": false + }, + "lockFileMaintenance": { + "branchTopic": "lock-file-maintenance-{{packageFile}}", + "commitMessageExtra": "({{packageFile}})", + "enabled": true, + "extends": [ + "schedule:monthly" + ] + }, + "nix": { + "enabled": true + }, + "postUpgradeTasks": { + "commands": [ + "nix-portable nix run .#soonix:update" + ], + "executionMode": "branch" + } +} diff --git a/docs/examples.md b/docs/examples.md index 633bad1..7afe5a4 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -6,4 +6,3 @@ DevShell is used in these projects, feel free to take inspiration from them: - [soonix](https://gitlab.com/TECHNOFAB/soonix) - [rensa-core](https://gitlab.com/rensa-nix/core) - [rensa-devtools](https://gitlab.com/rensa-nix/devtools) - diff --git a/docs/index.md b/docs/index.md index 34a1810..9ff5a58 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,4 +12,3 @@ Additional functionality can be added with modules, like [Rensa DevTools](https: - **fast**: due to the NixOS module system it's a bit slower than `pkgs.mkShell`, but only about 10% (still in the tens of milliseconds range) - **minimal**: only contains the bare minimum, the rest should be added with imported modules - **straight forward**: no toml (like numtide/devshell), no abstractions over Nix (like devenv), just a straight forward Nix lib - diff --git a/docs/integrations.md b/docs/integrations.md index edec754..04fb5b6 100644 --- a/docs/integrations.md +++ b/docs/integrations.md @@ -2,4 +2,3 @@ - [soonix](https://soonix.projects.tf/usage/#with-devshell) - [rensa devtools](https://devtools.rensa.projects.tf) - diff --git a/flake.lock b/flake.lock index ea0ade9..85629e5 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1754498491, - "narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=", + "lastModified": 1766902085, + "narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c2ae88e026f9525daf89587f3cbee584b92b6134", + "rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4", "type": "github" }, "original": { @@ -37,16 +37,17 @@ }, "locked": { "dir": "lib", - "lastModified": 1756370106, - "narHash": "sha256-l84ojcHuQWBwn4BRxQsMMfQpcq/Az/sHh/hSqFgVtyg=", + "lastModified": 1766497301, + "narHash": "sha256-W7WeOXMUZROMtbU1qQNWy/yai+k8gG09YACFQ7ImpsQ=", "owner": "rensa-nix", "repo": "core", - "rev": "9c1a29fa9ba7cbbb78b9e47eb8afbcd29303a3b4", + "rev": "e08c48b5db1052bfb8b8dad764e05decc1af893e", "type": "gitlab" }, "original": { "dir": "lib", "owner": "rensa-nix", + "ref": "v0.1.1", "repo": "core", "type": "gitlab" } diff --git a/flake.nix b/flake.nix index 26004fe..d00b76b 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - ren.url = "gitlab:rensa-nix/core?dir=lib"; + ren.url = "gitlab:rensa-nix/core/v0.1.1?dir=lib"; }; outputs = { @@ -24,6 +24,7 @@ (simple "benchmark") (simple "docs") (simple "ci") + (simple "soonix") ]; } { @@ -32,6 +33,7 @@ ["repo" "benchmark"] ["repo" "docs"] ["repo" "ci" "packages"] + ["repo" "soonix" "packages"] ]; }; } diff --git a/nix/repo/devShells.nix b/nix/repo/devShells.nix index fd55a79..8656cb1 100644 --- a/nix/repo/devShells.nix +++ b/nix/repo/devShells.nix @@ -3,22 +3,57 @@ cell, ... }: let - inherit (inputs) pkgs devshell treefmt soonix; - inherit (cell) ci; + inherit (inputs) pkgs devshell treefmt devtools-lib; + inherit (cell) soonix; + treefmtWrapper = treefmt.mkWrapper pkgs { + programs = { + alejandra.enable = true; + deadnix.enable = true; + mdformat.enable = true; + }; + }; in { default = devshell.mkShell { - imports = [soonix.devshellModule]; + imports = [soonix.devshellModule devtools-lib.devshellModule]; packages = [ pkgs.nil - (treefmt.mkWrapper pkgs { - programs = { - alejandra.enable = true; - deadnix.enable = true; - mdformat.enable = true; - }; - }) + treefmtWrapper ]; - soonix.hooks.ci = ci.soonix; + lefthook.config = { + "pre-commit" = { + parallel = true; + jobs = [ + { + name = "treefmt"; + stage_fixed = true; + run = "${treefmtWrapper}/bin/treefmt"; + env.TERM = "dumb"; + } + { + name = "soonix"; + stage_fixed = true; + run = "${soonix.packages."soonix:update"}/bin/soonix:update"; + } + ]; + }; + }; + cocogitto.config = { + tag_prefix = "v"; + ignore_merge_commits = true; + changelog = { + authors = [ + { + username = "TECHNOFAB"; + signature = "technofab"; + } + ]; + path = "CHANGELOG.md"; + template = "remote"; + remote = "gitlab.com"; + repository = "devshell"; + owner = "rensa-nix"; + }; + }; meta = { enableMenu = true; showMenu = "always"; diff --git a/nix/repo/flake.lock b/nix/repo/flake.lock index f9c3570..828c42e 100644 --- a/nix/repo/flake.lock +++ b/nix/repo/flake.lock @@ -1,19 +1,36 @@ { "nodes": { + "devtools-lib": { + "locked": { + "dir": "lib", + "lastModified": 1767214272, + "narHash": "sha256-gvW7flZ60xdv3Z3Ksec5jcRjW2sqRHsGoJdwsNWQVPk=", + "owner": "rensa-nix", + "repo": "devtools", + "rev": "f40e59c32c48cdbf4cbc621c2f0f11e7bb80dbd3", + "type": "gitlab" + }, + "original": { + "dir": "lib", + "owner": "rensa-nix", + "repo": "devtools", + "type": "gitlab" + } + }, "nix-gitlab-ci-lib": { "locked": { "dir": "lib", - "lastModified": 1756974596, - "narHash": "sha256-KxQj76sUqvPNtrqzNWMZeOWqTitc0aFCYj7UZzToiEA=", + "lastModified": 1765444672, + "narHash": "sha256-B0cMjRs9P50ym9Le0VUcRN69Yy6tbV13MXq81tTTEus=", "owner": "TECHNOFAB", "repo": "nix-gitlab-ci", - "rev": "00cf5b83c6c46698fba12a54b9cc15c6d4e5a4dd", + "rev": "8f88a53b5479773cd626420362631bc1da99e677", "type": "gitlab" }, "original": { "dir": "lib", "owner": "TECHNOFAB", - "ref": "3.0.0-alpha.2", + "ref": "3.1.2", "repo": "nix-gitlab-ci", "type": "gitlab" } @@ -54,6 +71,7 @@ }, "root": { "inputs": { + "devtools-lib": "devtools-lib", "nix-gitlab-ci-lib": "nix-gitlab-ci-lib", "nixmkdocs": "nixmkdocs", "nixtest-lib": "nixtest-lib", diff --git a/nix/repo/flake.nix b/nix/repo/flake.nix index 29a15cf..c5313ff 100644 --- a/nix/repo/flake.nix +++ b/nix/repo/flake.nix @@ -3,7 +3,8 @@ nixtest-lib.url = "gitlab:TECHNOFAB/nixtest?dir=lib"; nixmkdocs.url = "gitlab:TECHNOFAB/nixmkdocs?dir=lib"; soonix-lib.url = "gitlab:TECHNOFAB/soonix?dir=lib"; - nix-gitlab-ci-lib.url = "gitlab:TECHNOFAB/nix-gitlab-ci/3.0.0-alpha.2?dir=lib"; + nix-gitlab-ci-lib.url = "gitlab:TECHNOFAB/nix-gitlab-ci/3.1.2?dir=lib"; + devtools-lib.url = "gitlab:rensa-nix/devtools/v0.1.0?dir=lib"; treefmt-nix = { url = "github:numtide/treefmt-nix"; flake = false; diff --git a/nix/repo/soonix.nix b/nix/repo/soonix.nix new file mode 100644 index 0000000..c1381aa --- /dev/null +++ b/nix/repo/soonix.nix @@ -0,0 +1,38 @@ +{ + inputs, + cell, + ... +}: let + inherit (inputs) soonix; + inherit (cell) ci; +in + (soonix.make { + hooks = { + ci = ci.soonix; + renovate = { + output = ".gitlab/renovate.json5"; + data = { + extends = ["config:recommended"]; + postUpgradeTasks = { + commands = [ + "nix-portable nix run .#soonix:update" + ]; + executionMode = "branch"; + }; + lockFileMaintenance = { + enabled = true; + extends = ["schedule:monthly"]; + branchTopic = "lock-file-maintenance-{{packageFile}}"; + commitMessageExtra = "({{packageFile}})"; + }; + nix.enabled = true; + gitlabci.enabled = false; + }; + hook = { + mode = "copy"; + gitignore = false; + }; + opts.format = "json"; + }; + }; + }).config