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

chore: packaging

parent 0d4cd39b
No related branches found
No related tags found
No related merge requests found
{
"nodes": {
"nix-filter": {
"locked": {
"lastModified": 1687178632,
"narHash": "sha256-HS7YR5erss0JCaUijPeyg2XrisEb959FIct3n2TMGbE=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "d90c75e8319d0dd9be67d933d8eb9d0894ec9174",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "nix-filter",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1688679045,
......@@ -25,50 +10,14 @@
"type": "github"
},
"original": {
"owner": "NixOS",
"id": "nixpkgs",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
"type": "indirect"
}
},
"root": {
"inputs": {
"nix-filter": "nix-filter",
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1687709756,
"narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
"nixpkgs": "nixpkgs"
}
}
},
......
{
description = "Bob: The HTML and HTML fragment builder";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
utils.url = github:numtide/flake-utils;
nix-filter.url = github:numtide/nix-filter;
};
description = "Bob: The HTML and HTML fragment builder";
# Nixpkgs / NixOS version to use.
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
outputs = {self, nixpkgs, utils, nix-filter }:
let
# to work with older version of flakes
# to work with older version of flakes
lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
# Generate a user-friendly version number.
#version = builtins.substring 0 8 lastModifiedDate;
rootPath = ./.;
releaseJson = builtins.fromJSON (builtins.readFile "${rootPath}/release.json");
version = releaseJson.version;
# System types to support.
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
......@@ -20,15 +27,22 @@
# Nixpkgs instantiated for supported system types.
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
rootPath = ./.;
releaseJson = builtins.fromJSON (builtins.readFile "${rootPath}/release.json");
currentVersion = releaseJson.version;
in (utils.lib.eachDefaultSystem (system: rec {
packages.app = nixpkgs.legacyPackages.${system}.buildGoModule {
pname = "bob";
version = currentVersion;
in
{
# Provide some binary packages for selected system types.
packages = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in
{
bob = pkgs.buildGoModule {
pname = "bob";
inherit version;
# In 'nix develop', we don't need a copy of the source tree
# in the Nix store.
src = ././application/source;
......@@ -41,20 +55,35 @@
# it should be "out-of-band" with other tooling (eg. gomod2nix).
# To begin with it is recommended to set this, but one must
# remeber to bump this hash when your dependencies change.
#vendorSha256 = nixpkgs.legacyPackages.${system}.lib.fakeSha256;
#vendorSha256 = pkgs.lib.fakeSha256;
vendorSha256 = "sha256-XdB+u94Rqsb29jVs4miyOq1NEYaVJHWFXg6QebFJzNQ=";
doCheck = false;
meta = with nixpkgs.legacyPackages.${system}.lib; {
description = "Bob: The HTML and HTML fragment builder";
homepage = "https://gitlab.schukai.com/oss/bob";
license = licenses.mit;
maintainers = with maintainers; [ "schukai GmbH" ];
};
};
};
defaultPackage = packages.app;
}));
});
# Add dependencies that are only needed for development
devShells = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in
{
default = pkgs.mkShell {
buildInputs = with pkgs; [ go gopls gotools go-tools ];
};
});
# The default package for 'nix build'. This makes sense if the
# flake provides only one package or there is a clear "main"
# package.
defaultPackage = forAllSystems (system: self.packages.${system}.bob);
};
}
{"version":"0.6.1"}
{"version":"0.6.2"}
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