From 14fb2d732b265437ac681bee23e54958f2d4d8a6 Mon Sep 17 00:00:00 2001 From: SomeGuyNamedMy Date: Mon, 26 Jun 2023 15:58:25 -0400 Subject: [PATCH 1/2] add flake.nix --- flake.lock | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 45 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..15b10ad --- /dev/null +++ b/flake.lock @@ -0,0 +1,59 @@ +{ + "nodes": { + "flake-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": { + "locked": { + "lastModified": 1687701825, + "narHash": "sha256-aMC9hqsf+4tJL7aJWSdEUurW2TsjxtDcJBwM9Y4FIYM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "07059ee2fa34f1598758839b9af87eae7f7ae6ea", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..da83d01 --- /dev/null +++ b/flake.nix @@ -0,0 +1,45 @@ +{ + description = "Native Gtk client for Lemmy"; + + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in { + packages = rec { + lemoa = pkgs.rustPlatform.buildRustPackage { + pname = "lemoa"; + version = "0.1.0"; + src = ./.; + buildInputs = with pkgs; [ + openssl + gtk4 + libadwaita + ]; + nativeBuildInputs = with pkgs; [ + openssl + pkg-config + gtk4 + libadwaita + ]; + cargoLock = { + lockFile = ./Cargo.lock; + outputHashes = { + "lemmy_api_common-0.18.0" = "sha256-l4UNO5Obx73nOiVnl6dc+sw2tekDLn2ixTs1GwqdE8I="; + }; + }; + meta = with pkgs.lib; { + description = "Native Gtk client for Lemmy"; + homepage = "https://github.com/lemmygtk/lemoa"; + license = with licenses; [ + gpl3 + ]; + }; + }; + default = lemoa; + }; + }); +} From 042cbc11b2be518c94877cc079f0c9f6a6c62240 Mon Sep 17 00:00:00 2001 From: SomeGuyNamedMy Date: Mon, 26 Jun 2023 16:02:54 -0400 Subject: [PATCH 2/2] add nix develop support --- flake.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/flake.nix b/flake.nix index da83d01..583acf9 100644 --- a/flake.nix +++ b/flake.nix @@ -41,5 +41,20 @@ }; default = lemoa; }; + + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + openssl + pkg-config + gtk4 + libadwaita + + #rust + cargo + rustc + rust-analyzer + rustfmt + ]; + }; }); }