From 672d9effe471c442fb8a12ce6328ea3ee59b736c Mon Sep 17 00:00:00 2001 From: Volker Schukai <volker.schukai@schukai.com> Date: Sat, 29 Jul 2023 20:52:27 +0200 Subject: [PATCH] feat: deployment --- devenv.lock | 32 ++++++++++++++++---------------- devenv.nix | 4 +--- flake.nix | 12 +----------- 3 files changed, 18 insertions(+), 30 deletions(-) diff --git a/devenv.lock b/devenv.lock index 6087e5a..1078d34 100644 --- a/devenv.lock +++ b/devenv.lock @@ -3,11 +3,11 @@ "devenv": { "locked": { "dir": "src/modules", - "lastModified": 1689667485, - "narHash": "sha256-tLNoMRSPLlW1D4wgNpSIPUUHd6x1GdjAhETLpRTKnfo=", + "lastModified": 1690638457, + "narHash": "sha256-3EBd8PHd0lbSCMief9eQdzTOvEofnB3koR+Q4wvvDbA=", "owner": "cachix", "repo": "devenv", - "rev": "6f8add968bc12bf81d845eb7dc684a0733bb1518", + "rev": "da313abf0fb6d21210f6d555acabf40425e080f1", "type": "github" }, "original": { @@ -74,11 +74,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1689605451, - "narHash": "sha256-u2qp2k9V1smCfk6rdUcgMKvBj3G9jVvaPHyeXinjN9E=", + "lastModified": 1690558459, + "narHash": "sha256-5W7y1l2cLYPkpJGNlAja7XW2X2o9rjf0O1mo9nxS9jQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "53657afe29748b3e462f1f892287b7e254c26d77", + "rev": "48e82fe1b1c863ee26a33ce9bd39621d2ada0a33", "type": "github" }, "original": { @@ -106,11 +106,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1689605451, - "narHash": "sha256-u2qp2k9V1smCfk6rdUcgMKvBj3G9jVvaPHyeXinjN9E=", + "lastModified": 1690558459, + "narHash": "sha256-5W7y1l2cLYPkpJGNlAja7XW2X2o9rjf0O1mo9nxS9jQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "53657afe29748b3e462f1f892287b7e254c26d77", + "rev": "48e82fe1b1c863ee26a33ce9bd39621d2ada0a33", "type": "github" }, "original": { @@ -130,11 +130,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1689668210, - "narHash": "sha256-XAATwDkaUxH958yXLs1lcEOmU6pSEIkatY3qjqk8X0E=", + "lastModified": 1690628027, + "narHash": "sha256-OTSbA2hM6VmxyZ/4siYPANffMBzIsKu04GLjXcv8ST0=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "eb433bff05b285258be76513add6f6c57b441775", + "rev": "1e2443dd3f669eb65433b2fc26a3065e05a7dc9c", "type": "github" }, "original": { @@ -171,11 +171,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1689585498, - "narHash": "sha256-oNgRghsOrPN7W+fcNL22LsetUvJS21v4Hm/Z1Hbcon4=", + "lastModified": 1690655803, + "narHash": "sha256-b5+SBQTX5W61zQqwS2ySR10hRsVfo2xPGy7dNxefWYI=", "ref": "refs/heads/master", - "rev": "c6f1adc90800afdf3f6a42998fe602228615edae", - "revCount": 27, + "rev": "0b935998c5fe0c32fdfba50df194d415a9eed817", + "revCount": 31, "type": "git", "url": "https://gitlab.schukai.com/oss/utilities/version.git" }, diff --git a/devenv.nix b/devenv.nix index d7c67b5..2215c79 100644 --- a/devenv.nix +++ b/devenv.nix @@ -2,8 +2,6 @@ { pkgs, inputs, phps, lib, config, modulesPath,... }: { - - env.LD_LIBRARY_PATH = lib.makeLibraryPath [ ]; env.APP_NAME = "version"; @@ -84,7 +82,7 @@ fi ${config.devenv.root}/bin/go-compile.sh \ "${config.devenv.root}/source/" \ "${config.devenv.root}/dist"/ \ - "bob" \ + "version" \ "main" \ "''${version}" \ "''${buildDate}" diff --git a/flake.nix b/flake.nix index 595fe94..82eb5b1 100644 --- a/flake.nix +++ b/flake.nix @@ -10,14 +10,7 @@ # 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"); - pversion = releaseJson.version; - # System types to support. supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; @@ -39,7 +32,7 @@ { version = pkgs.buildGoModule { pname = "version"; - version = pversion; + # In 'nix develop', we don't need a copy of the source tree # in the Nix store. src = ././source; @@ -55,8 +48,6 @@ #vendorSha256 = pkgs.lib.fakeSha256; vendorSha256 = "sha256-QmOn3A4CYGuiNqTzoM6+vQlwlSWbOmftJZ3Mx0PFBz0="; - - meta = with nixpkgs.legacyPackages.${system}.lib; { description = "Version is a program that automates and simplifies the process of incrementing version numbers for software projects."; @@ -85,4 +76,3 @@ defaultPackage = forAllSystems (system: self.packages.${system}.version); }; } - -- GitLab