]> Untitled Git - lemmy.git/commitdiff
eliminate git submodule when used as a Nix flake
authorself <self@awful.systems>
Mon, 21 Aug 2023 14:34:46 +0000 (07:34 -0700)
committerself <self@awful.systems>
Mon, 21 Aug 2023 14:41:18 +0000 (07:41 -0700)
default.nix
flake.lock
flake.nix

index 6c261161c20dd7489628db1959368ce6d1a2267f..06a1d68411090291aff260c5d9a92b5dfcafeb9f 100644 (file)
@@ -1,5 +1,5 @@
 { lib, stdenv, rustPlatform, fetchFromGitHub, openssl, postgresql, libiconv
-, Security, protobuf, rustfmt, nixosTests }:
+, Security, protobuf, rustfmt, nixosTests, lemmy-translations }:
 
 rustPlatform.buildRustPackage rec {
   version = "0.18.2";
@@ -11,6 +11,10 @@ rustPlatform.buildRustPackage rec {
     echo 'pub const VERSION: &str = "${version}";' > crates/utils/src/version.rs
   '';
 
+  preBuild = ''
+    ln -sf ${lemmy-translations} crates/utils/translations
+  '';
+
   cargoSha256 = "sha256-2HWz6gYRo4YkXQz4V5COY2vpCu/PD8kKxzDG21YjYbo=";
 
   buildInputs = [ postgresql ]
index 2719ce3f87e7149eb5c2d49439b8e39bdbae202b..75ba315309437c97417cc8291f77dcb44112ea93 100644 (file)
         "type": "github"
       }
     },
+    "lemmy-translations": {
+      "flake": false,
+      "locked": {
+        "lastModified": 1690314617,
+        "narHash": "sha256-fkv6l6/888XOdxZ8Y0P+Ww/y+8Wh4F8SIStncAmifu8=",
+        "owner": "lemmynet",
+        "repo": "lemmy-translations",
+        "rev": "68d14665d4f854fc20f9117636b5cde7176e91dd",
+        "type": "github"
+      },
+      "original": {
+        "owner": "lemmynet",
+        "repo": "lemmy-translations",
+        "type": "github"
+      }
+    },
     "nixpkgs": {
       "locked": {
         "lastModified": 1690031011,
@@ -36,6 +52,7 @@
     "root": {
       "inputs": {
         "flake-utils": "flake-utils",
+        "lemmy-translations": "lemmy-translations",
         "nixpkgs": "nixpkgs"
       }
     },
index 81cb3dd10572694dd23593960ca9b01cd887e751..aac53e91119542f2fcd9367eb26d07fdd4b323fc 100644 (file)
--- a/flake.nix
+++ b/flake.nix
@@ -4,15 +4,20 @@
   inputs = {
     nixpkgs.url = "nixpkgs/nixos-unstable";
     flake-utils.url = "github:numtide/flake-utils";
+    lemmy-translations = {
+      url = "github:lemmynet/lemmy-translations";
+      flake = false;
+    };
   };
 
-  outputs = { self, nixpkgs, flake-utils }:
+  outputs = { self, nixpkgs, flake-utils, lemmy-translations }:
 
     flake-utils.lib.eachDefaultSystem (system:
       let pkgs = nixpkgs.legacyPackages.${system};
       in {
         packages = {
           lemmy-server = (pkgs.callPackage ./default.nix {
+            inherit lemmy-translations;
             libiconv = null;
             Security = null;
           });