diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-03-31 23:44:59 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-04-01 00:00:07 +0200 |
commit | 2bb1c6d4948eecbdacea1267ee0a132aa88a7b5c (patch) | |
tree | d9894056cafdf83fd7edb7b785ac6076cdc177cc /templates | |
parent | refactor(flake): Move some nix code out of flake.nix (diff) | |
download | flake-templates-2bb1c6d4948eecbdacea1267ee0a132aa88a7b5c.tar.gz flake-templates-2bb1c6d4948eecbdacea1267ee0a132aa88a7b5c.zip |
fix(templates): Update already done templates with improvements from new ones
Diffstat (limited to '')
-rw-r--r-- | templates/awk/.envrc | 2 | ||||
-rw-r--r-- | templates/awk/.licensure.yml | 11 | ||||
-rw-r--r-- | templates/awk/cog.toml | 4 | ||||
-rw-r--r-- | templates/awk/flake.nix | 13 | ||||
-rw-r--r-- | templates/c/.envrc | 3 | ||||
-rw-r--r-- | templates/c/.licensure.yml | 7 | ||||
-rw-r--r-- | templates/c/cog.toml | 9 | ||||
-rw-r--r-- | templates/c/flake.nix | 16 | ||||
-rw-r--r-- | templates/rust/.envrc | 3 | ||||
-rw-r--r-- | templates/rust/.licensure.yml | 7 | ||||
-rw-r--r-- | templates/rust/cog.toml | 2 | ||||
-rw-r--r-- | templates/rust/flake.nix | 2 |
12 files changed, 60 insertions, 19 deletions
diff --git a/templates/awk/.envrc b/templates/awk/.envrc index 96eca6b..3bc1085 100644 --- a/templates/awk/.envrc +++ b/templates/awk/.envrc @@ -1,6 +1,8 @@ use flake || use nix watch_file flake.nix +PATH_add ./scripts + if on_git_branch; then echo && git status --short --branch && echo && git fetch --verbose diff --git a/templates/awk/.licensure.yml b/templates/awk/.licensure.yml index e62adb0..e1f5a01 100644 --- a/templates/awk/.licensure.yml +++ b/templates/awk/.licensure.yml @@ -32,9 +32,9 @@ licenses: # A list of authors who hold copyright over these files authors: # Provide either your full name or company name for copyright purposes - - name: TODO + - name: Benedikt Peetz # Optionally provide email for copyright purposes - email: "TODO" + email: "benedikt.peetz@b-peetz.de" # The template that will be rendered to generate the header before # comment characters are applied. Available variables are: @@ -144,6 +144,13 @@ comments: comment_char: ";;;" trailing_lines: 1 + - extensions: + - tex + commenter: + type: line + comment_char: "%" + trailing_lines: 1 + # The extension string "any" is special and so will match any file # extensions. Commenter configurations are always checked in the # order they are defined, so if any is used it should be the last diff --git a/templates/awk/cog.toml b/templates/awk/cog.toml index 677e20a..1157b91 100644 --- a/templates/awk/cog.toml +++ b/templates/awk/cog.toml @@ -2,13 +2,11 @@ tag_prefix = "v" branch_whitelist = ["main", "prime"] ignore_merge_commits = false -[commit_types] - pre_bump_hooks = [ "nix flake check", # verify the project builds "./scripts/renew_copyright_header.sh", # update the license header in each file "nix fmt", # format - "flake_version_update --version v{{version}} --input-file flake.nix", + "flake_version_update --version v{{version}} --input-file flake.nix", # update the version in the flake.nix file ] post_bump_hooks = [ "git push", diff --git a/templates/awk/flake.nix b/templates/awk/flake.nix index aeacf3b..144a17e 100644 --- a/templates/awk/flake.nix +++ b/templates/awk/flake.nix @@ -53,8 +53,8 @@ man_number = "1"; # TODO change if necessary pname = "TODO"; - in { - packages.default = pkgs.stdenv.mkDerivation { + + build = pkgs.stdenv.mkDerivation { inherit version pname; src = ./.; @@ -82,8 +82,12 @@ chmod +x $out/bin/${pname} ''; }; - - checks.formatting = treefmtEval.config.build.check self; + in { + packages.default = build; + checks = { + inherit build; + formatting = treefmtEval.config.build.check self; + }; formatter = treefmtEval.config.build.wrapper; devShells.default = pkgs.mkShell { @@ -92,6 +96,7 @@ flake_version_update.packages."${system}".default gawk + licensure ]; }; }); diff --git a/templates/c/.envrc b/templates/c/.envrc index 77f9235..8f9d5d7 100644 --- a/templates/c/.envrc +++ b/templates/c/.envrc @@ -1,7 +1,8 @@ use flake || use nix watch_file flake.nix -PATH_add ./target/ +PATH_add ./target +PATH_add ./scripts if on_git_branch; then echo && git status --short --branch && diff --git a/templates/c/.licensure.yml b/templates/c/.licensure.yml index 6c8dcfc..e1f5a01 100644 --- a/templates/c/.licensure.yml +++ b/templates/c/.licensure.yml @@ -144,6 +144,13 @@ comments: comment_char: ";;;" trailing_lines: 1 + - extensions: + - tex + commenter: + type: line + comment_char: "%" + trailing_lines: 1 + # The extension string "any" is special and so will match any file # extensions. Commenter configurations are always checked in the # order they are defined, so if any is used it should be the last diff --git a/templates/c/cog.toml b/templates/c/cog.toml index d34ced6..ff2c110 100644 --- a/templates/c/cog.toml +++ b/templates/c/cog.toml @@ -2,12 +2,11 @@ tag_prefix = "v" branch_whitelist = ["main", "prime"] ignore_merge_commits = false -[commit_types] - pre_bump_hooks = [ - "nix flake check", # verify the project builds - "./scripts/renew_copyright_header.sh", # update the license header in each file - "nix fmt", # format + "nix flake check", # verify the project builds + "./scripts/renew_copyright_header.sh", # update the license header in each file + "flake_version_update --version v{{version}} --input-file flake.nix", # update the version in the flake.nix file + "nix fmt", # format ] post_bump_hooks = [ "git push", diff --git a/templates/c/flake.nix b/templates/c/flake.nix index cd4200c..e19bbd4 100644 --- a/templates/c/flake.nix +++ b/templates/c/flake.nix @@ -11,6 +11,15 @@ }; }; + flake_version_update = { + url = "git+https://codeberg.org/soispha/flake_version_update.git"; + inputs = { + systems.follows = "systems"; + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; + }; + # inputs for following systems = { url = "github:nix-systems/x86_64-linux"; # only evaluate for this system @@ -32,6 +41,7 @@ nixpkgs, flake-utils, treefmt-nix, + flake_version_update, ... }: flake-utils.lib.eachDefaultSystem (system: let @@ -40,8 +50,9 @@ nativeBuildInputs = with pkgs; [valgrind pandoc]; treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;}; + # This version is set automatically on `cog bump --auto`; + version = "v0.1.0"; # GUIDING VERSION STRING pname = "TODO"; - version = "0.1"; build = pkgs.stdenv.mkDerivation { inherit pname version; @@ -61,6 +72,9 @@ devShells.default = pkgs.mkShell { packages = with pkgs; [ cocogitto + flake_version_update.packages."${system}".default + + licensure ]; inherit nativeBuildInputs; env = { diff --git a/templates/rust/.envrc b/templates/rust/.envrc index 77f9235..8f9d5d7 100644 --- a/templates/rust/.envrc +++ b/templates/rust/.envrc @@ -1,7 +1,8 @@ use flake || use nix watch_file flake.nix -PATH_add ./target/ +PATH_add ./target +PATH_add ./scripts if on_git_branch; then echo && git status --short --branch && diff --git a/templates/rust/.licensure.yml b/templates/rust/.licensure.yml index 6c8dcfc..e1f5a01 100644 --- a/templates/rust/.licensure.yml +++ b/templates/rust/.licensure.yml @@ -144,6 +144,13 @@ comments: comment_char: ";;;" trailing_lines: 1 + - extensions: + - tex + commenter: + type: line + comment_char: "%" + trailing_lines: 1 + # The extension string "any" is special and so will match any file # extensions. Commenter configurations are always checked in the # order they are defined, so if any is used it should be the last diff --git a/templates/rust/cog.toml b/templates/rust/cog.toml index 2646f07..4902ede 100644 --- a/templates/rust/cog.toml +++ b/templates/rust/cog.toml @@ -2,8 +2,6 @@ tag_prefix = "v" branch_whitelist = ["main", "prime"] ignore_merge_commits = false -[commit_types] - pre_bump_hooks = [ "nix flake check", # verify the project builds "./scripts/renew_copyright_header.sh", # update the license header in each file diff --git a/templates/rust/flake.nix b/templates/rust/flake.nix index 2e65c7d..437b8a9 100644 --- a/templates/rust/flake.nix +++ b/templates/rust/flake.nix @@ -115,6 +115,8 @@ rust_default cargo-edit + + licensure ]; }; }); |