From d89d4cfbbcfa4cf23fcc5218eeebfd368be791dc Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 27 Apr 2023 07:46:17 +0000 Subject: [PATCH] chore: fix local build --- flake.lock | 8 ++++---- flake.nix | 5 +++-- nix/uniworx/backend.nix | 7 +++++-- nix/uniworx/default.nix | 6 +++--- shell.nix | 6 ++++-- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/flake.lock b/flake.lock index e7a89f7ca..fc47a42ff 100644 --- a/flake.lock +++ b/flake.lock @@ -942,16 +942,16 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1680296362, - "narHash": "sha256-zI8rKfSoRf261clT5Fi5M+buLyN1z5FgWFgnPHgJd1Y=", + "lastModified": 1628953589, + "narHash": "sha256-k9iFFwHvqKFBjCL2tOsJGlpzWRd0UQvsGSTDInCrkRM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ff40c8086733f2104d416b6ffd4770068a1fd43f", + "rev": "283d622397539f196416657da9dc804a4ca89846", "type": "github" }, "original": { "owner": "NixOS", - "ref": "master", + "ref": "283d622397539f196416657da9dc804a4ca89846", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index b8529dd39..f5a697b3c 100644 --- a/flake.nix +++ b/flake.nix @@ -12,7 +12,8 @@ type = "github"; owner = "NixOS"; repo = "nixpkgs"; - ref = "master"; + # ref = "master"; + ref = "283d622397539f196416657da9dc804a4ca89846"; }; flake-utils = { type = "github"; @@ -113,7 +114,7 @@ (import ./nix/maildev) haskell-nix.overlay - (import ./nix/uniworx { inherit inputs frontendSource backendSource; }) + (import ./nix/uniworx { inherit inputs frontendSource backendSource; gitRevision = if self ? rev then self.rev else null; }) (import ./nix/docker { inherit self; }) (import ./nix/parse-changelog.nix {}) ]; diff --git a/nix/uniworx/backend.nix b/nix/uniworx/backend.nix index f9681a0aa..03fdb8431 100644 --- a/nix/uniworx/backend.nix +++ b/nix/uniworx/backend.nix @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: 2022 Gregor Kleen ,Steffen Jost +# SPDX-FileCopyrightText: 2022-2023 Gregor Kleen , Steffen Jost # # SPDX-License-Identifier: AGPL-3.0-or-later -{ inputs, backendSource, ... }: final: prev: +{ inputs, backendSource, gitRevision ? null, ... }: final: prev: with prev.lib; @@ -66,6 +66,9 @@ in { ''; preBuild = '' export TZDIR=${final.tzdata}/share/zoneinfo + ${optionalString (gitRevision != null) '' + export GIT_REVISION=${gitRevision} + ''} ''; components.library.build-tools = with final.pkgs; [ llvm_9 ]; components.exes.uniworx.build-tools = with final.pkgs; [ llvm_9 ]; diff --git a/nix/uniworx/default.nix b/nix/uniworx/default.nix index 6ecf41bc8..e1b31af28 100644 --- a/nix/uniworx/default.nix +++ b/nix/uniworx/default.nix @@ -1,10 +1,10 @@ -# SPDX-FileCopyrightText: 2022 Gregor Kleen +# SPDX-FileCopyrightText: 2022-2023 Gregor Kleen # # SPDX-License-Identifier: AGPL-3.0-or-later -{ inputs, frontendSource, backendSource }: final: prev: prev.lib.composeManyExtensions [ +{ inputs, frontendSource, backendSource, gitRevision ? null }: final: prev: prev.lib.composeManyExtensions [ (import ./node-dependencies.nix { inherit inputs; }) (import ./well-known.nix { inherit frontendSource; }) (import ./frontend.nix { inherit frontendSource; }) - (import ./backend.nix { inherit backendSource inputs; }) + (import ./backend.nix { inherit backendSource inputs gitRevision; }) ] final prev diff --git a/shell.nix b/shell.nix index fefbd66c3..c7e1f9f8d 100644 --- a/shell.nix +++ b/shell.nix @@ -268,12 +268,14 @@ in pkgs.mkShell { ${pkgs.lib.optionalString (nixpkgsPath != null) '' export NIX_PATH=nixpkgs=${nixpkgsPath} ''} + + export CHROME_BIN=${pkgs.chromium}/bin/chromium ''; nativeBuildInputs = [develop inDevelop killallUni2work diffRunning] ++ (with pkgs; - [ nodejs-14_x postgresql_12 openldap chromium exiftool memcached minio minio-client + [ nodejs-14_x postgresql_12 openldap exiftool memcached minio minio-client gup reuse pre-commit - node2nix + # node2nix # busybox # for print services, but interferes with build commands in develop-shell htop pdftk # pdftk just for testing pdf-passwords