diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 09de341..150df2a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,10 @@ # build dir builddir* +# nix +result +.direnv + # Workspaces *.code-workspace diff --git a/README.md b/README.md index 9739e5d..82b691f 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,11 @@ yay -S cassette-git pamac install cassette-git ``` +### NixOS +```shell +nix run github:Rirusha/Cassette +``` + ## Установка в Windows Способы установки приложения в Windows описаны [здесь](docs/INSTALLATION_ON_WINDOWS.md). diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..9eadad2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1720542800, + "narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "feb2849fdeb70028c70d73b848214b00d324a497", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "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..ff1f084 --- /dev/null +++ b/flake.nix @@ -0,0 +1,69 @@ +{ + description = "GTK4/Adwaita application that allows you to use Yandex Music service on Linux operating systems"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { + self, + nixpkgs, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem + ( + system: let + pkgs = import nixpkgs {inherit system;}; + + nativeBuildInputs = with pkgs; [ + blueprint-compiler + desktop-file-utils + meson + ninja + pkg-config + vala + ]; + + buildInputs = with pkgs; [ + glib-networking + gst_all_1.gst-plugins-bad + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + gst_all_1.gstreamer + gtk4 + json-glib + libadwaita + libgee + libsoup_3 + libxml2 + sqlite + webkitgtk_6_0 + ]; + in { + packages.default = pkgs.stdenv.mkDerivation { + name = "cassette"; + src = self; + + mesonFlags = [ + "-Dprofile=development" + ]; + + nativeBuildInputs = with pkgs; + [ + wrapGAppsHook4 + git + ] + ++ nativeBuildInputs; + + inherit buildInputs; + + strictDeps = true; + }; + devShells.default = pkgs.mkShell { + packages = with pkgs; [alejandra] ++ nativeBuildInputs ++ buildInputs; + }; + } + ); +}