Skip to content

Commit

Permalink
Add nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
Samasaur1 committed Jul 26, 2023
1 parent 3e41390 commit 86e0caa
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,3 +1,4 @@
/target
/files
/previews
/previews
result
43 changes: 43 additions & 0 deletions default.nix
@@ -0,0 +1,43 @@
{ lib
, rustPlatform
, pkg-config
, libgit2
, openssl
, zlib
, stdenv
, darwin
}:

rustPlatform.buildRustPackage rec {
pname = "remote-text-server";
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;

src = ./.;

cargoHash = "sha256-g6QiGH9eqC/mrGzeZOJ5wqm5V5D2xsDm4OOyzmE4sqM=";

nativeBuildInputs = [
pkg-config
];

buildInputs = [
libgit2
openssl
zlib
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.IOKit
darwin.apple_sdk.frameworks.Security
];

env = {
OPENSSL_NO_VENDOR = true;
VERGEN_IDEMPOTENT = true;
};

meta = with lib; {
description = "The server-side software for Remote Text";
homepage = "https://github.com/Remote-Text/remote-text-server";
license = with licenses; [ ];
maintainers = with maintainers; [ ];
};
}
25 changes: 25 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions flake.nix
@@ -0,0 +1,12 @@
{
description = "The server-side software for Remote Text";

outputs = { nixpkgs, ... }:
let
forAllSystems = gen:
nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed
(system: gen nixpkgs.legacyPackages.${system});
in {
packages = forAllSystems (pkgs: { default = pkgs.callPackage ./. { }; });
};
}

0 comments on commit 86e0caa

Please sign in to comment.