Skip to content
Snippets Groups Projects
Verified Commit b95196c3 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: update git-commit script, and test build #5

parent 29452e0b
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,15 @@ tasks: ...@@ -23,6 +23,15 @@ tasks:
- source/**/*.mod - source/**/*.mod
- dist/** - dist/**
release:
desc: Commit changes (update version, hashes, etc.)
aliases:
- cc
cmds:
- update-hashes || true
- git-commit
- update-version
update-code: update-code:
desc: Update the code, calculate hashes and update version desc: Update the code, calculate hashes and update version
aliases: aliases:
......
...@@ -87,21 +87,6 @@ ...@@ -87,21 +87,6 @@
"type": "github" "type": "github"
} }
}, },
"git-commit": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1,
"narHash": "sha256-8hXrOA8SKy//ctoL1poIhJwuT7G4rvVu7FguROzEoDg=",
"path": "./git-commit",
"type": "path"
},
"original": {
"path": "./git-commit",
"type": "path"
}
},
"gitignore": { "gitignore": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
...@@ -179,25 +164,6 @@ ...@@ -179,25 +164,6 @@
"type": "github" "type": "github"
} }
}, },
"nix-templates": {
"inputs": {
"git-commit": "git-commit",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1704993617,
"narHash": "sha256-++u7I3KCDgP+JhW70k5tiLfBESWVSKdVK7aei0G+mR8=",
"ref": "refs/heads/master",
"rev": "e63b1d6ae5526158fa2a1f4cd53b0ea4f4c93573",
"revCount": 18,
"type": "git",
"url": "https://gitlab.schukai.com/schukai/entwicklung/nix-flakes"
},
"original": {
"type": "git",
"url": "https://gitlab.schukai.com/schukai/entwicklung/nix-flakes"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1678875422, "lastModified": 1678875422,
...@@ -265,36 +231,6 @@ ...@@ -265,36 +231,6 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1704874635,
"narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.11",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1706373441,
"narHash": "sha256-S1hbgNbVYhuY2L05OANWqmRzj4cElcbLuIkXTb69xkk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "56911ef3403a9318b7621ce745f5452fb9ef6867",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.11",
"type": "indirect"
}
},
"nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1706373441, "lastModified": 1706373441,
"narHash": "sha256-S1hbgNbVYhuY2L05OANWqmRzj4cElcbLuIkXTb69xkk=", "narHash": "sha256-S1hbgNbVYhuY2L05OANWqmRzj4cElcbLuIkXTb69xkk=",
...@@ -310,7 +246,7 @@ ...@@ -310,7 +246,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_5": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1705856552, "lastModified": 1705856552,
"narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=", "narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=",
...@@ -326,7 +262,7 @@ ...@@ -326,7 +262,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_6": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1704145853, "lastModified": 1704145853,
"narHash": "sha256-G/1AMt9ibpeMlcxvD1vNaC8imGaK+g7zZ99e29BLgWw=", "narHash": "sha256-G/1AMt9ibpeMlcxvD1vNaC8imGaK+g7zZ99e29BLgWw=",
...@@ -375,10 +311,9 @@ ...@@ -375,10 +311,9 @@
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"flake-root": "flake-root", "flake-root": "flake-root",
"mk-shell-bin": "mk-shell-bin", "mk-shell-bin": "mk-shell-bin",
"nix-templates": "nix-templates", "nixpkgs": "nixpkgs_2",
"nixpkgs": "nixpkgs_4",
"treefmt-nix": "treefmt-nix", "treefmt-nix": "treefmt-nix",
"versionsTool": "versionsTool" "versions-tool": "versions-tool"
} }
}, },
"systems": { "systems": {
...@@ -398,7 +333,7 @@ ...@@ -398,7 +333,7 @@
}, },
"treefmt-nix": { "treefmt-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_5" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1706462057, "lastModified": 1706462057,
...@@ -414,9 +349,9 @@ ...@@ -414,9 +349,9 @@
"type": "github" "type": "github"
} }
}, },
"versionsTool": { "versions-tool": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
"lastModified": 1704542622, "lastModified": 1704542622,
......
...@@ -7,8 +7,7 @@ ...@@ -7,8 +7,7 @@
mk-shell-bin.url = "github:rrbutani/nix-mk-shell-bin"; mk-shell-bin.url = "github:rrbutani/nix-mk-shell-bin";
flake-root.url = "github:srid/flake-root"; flake-root.url = "github:srid/flake-root";
treefmt-nix.url = "github:numtide/treefmt-nix"; treefmt-nix.url = "github:numtide/treefmt-nix";
versionsTool.url = "git+https://gitlab.schukai.com/oss/utilities/version.git"; versions-tool.url = "git+https://gitlab.schukai.com/oss/utilities/version.git";
nix-templates.url = "git+https://gitlab.schukai.com/schukai/entwicklung/nix-flakes";
}; };
nixConfig = { nixConfig = {
...@@ -19,8 +18,7 @@ ...@@ -19,8 +18,7 @@
outputs = inputs @ { outputs = inputs @ {
self, self,
flake-parts, flake-parts,
versionsTool, versions-tool,
nix-templates,
... ...
}: }:
flake-parts.lib.mkFlake {inherit inputs;} { flake-parts.lib.mkFlake {inherit inputs;} {
...@@ -130,7 +128,7 @@ ...@@ -130,7 +128,7 @@
name = projectDefinition.name; name = projectDefinition.name;
scripts = let scripts = let
versionsTool = inputs.versionsTool.defaultPackage."${builtins.currentSystem}"; versions-tool = inputs.versions-tool.defaultPackage."${builtins.currentSystem}";
workingDirectory = builtins.getEnv "PWD"; workingDirectory = builtins.getEnv "PWD";
in { in {
...@@ -155,7 +153,11 @@ ...@@ -155,7 +153,11 @@
}; };
update-version.exec = import ./system/scripts/update-version.nix { update-version.exec = import ./system/scripts/update-version.nix {
inherit pkgs config buildRoot projectDefinition versionsTool workingDirectory; inherit pkgs config buildRoot projectDefinition versions-tool workingDirectory;
};
git-commit.exec = import ./system/scripts/git-commit.nix {
inherit pkgs;
}; };
}; };
...@@ -163,8 +165,7 @@ ...@@ -163,8 +165,7 @@
]; ];
packages = with pkgs; [ packages = with pkgs; [
inputs.versionsTool.defaultPackage."${builtins.currentSystem}" inputs.versions-tool.defaultPackage."${builtins.currentSystem}"
inputs.nix-templates.packages."${builtins.currentSystem}".git-commit
nodePackages.prettier-plugin-toml nodePackages.prettier-plugin-toml
nodePackages.prettier nodePackages.prettier
go-task go-task
......
{pkgs, ...}: let
common = import ./common.nix {inherit pkgs;};
nix-flakes = builtins.getFlake "git+https://gitlab.schukai.com/schukai/entwicklung/nix-flakes";
in ''
#!${pkgs.bash}/bin/bash
${common}
${nix-flakes.packages.${builtins.currentSystem}.git-commit}/bin/git-commit
''
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
pkgs, pkgs,
buildRoot, buildRoot,
projectDefinition, projectDefinition,
versionsTool, versions-tool,
workingDirectory, workingDirectory,
... ...
}: let }: let
...@@ -14,7 +14,7 @@ in '' ...@@ -14,7 +14,7 @@ in ''
${common} ${common}
cmd=${versionsTool}/bin/version cmd=${versions-tool}/bin/version
echo_step "Getting current commit hash" echo_step "Getting current commit hash"
HASH=$(${pkgs.git}/bin/git -C ${workingDirectory}/ rev-parse --short HEAD) HASH=$(${pkgs.git}/bin/git -C ${workingDirectory}/ rev-parse --short HEAD)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment