diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b713556 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1792116957, + "narHash": "sha256-EjZqHKObBfIOeHZnMRVV87HB3pPq/WBkmRJWyFxmZu8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f20cd90e28fe0403873f473b29e42662cd86e8c4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2e60f5c --- /dev/null +++ b/flake.nix @@ -0,0 +1,26 @@ +{ + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + + outputs = { self, nixpkgs }: + let + systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; + forAll = nixpkgs.lib.genAttrs systems; + in { + packages = forAll (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { + default = pkgs.rustPlatform.buildRustPackage { + pname = "drift"; + version = "0.1.0"; + src = ./.; + cargoLock.lockFile = ./Cargo.lock; + nativeBuildInputs = [ pkgs.makeWrapper ]; + postInstall = '' + wrapProgram $out/bin/drift \ + --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.mpv pkgs.yt-dlp ]} + ''; + meta.mainProgram = "drift"; + }; + }); + }; +} diff --git a/src/app.rs b/src/app.rs index 7c1b53c..0d4f26d 100644 --- a/src/app.rs +++ b/src/app.rs @@ -9,7 +9,7 @@ use ratatui::widgets::TableState; use crate::command::{self, Amount, Command, COMMAND_NAMES}; use crate::config::{self, Config}; use crate::lyrics::{self, Lyrics}; -use crate::model::{fmt_time, split_artists, RepeatMode, Track}; +use crate::model::{split_artists, RepeatMode, Track}; use crate::player::{Player, PlayerEvent}; use crate::session::Session; use crate::store::Store; diff --git a/src/ui.rs b/src/ui.rs index 26f2878..c3cfa98 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -1,7 +1,7 @@ use ratatui::layout::{Alignment, Constraint, Layout, Margin, Rect}; use ratatui::style::{Color, Modifier, Style, Stylize}; use ratatui::text::{Line, Span}; -use ratatui::widgets::{Block, BorderType, Cell, Clear, Paragraph, Row, Table, Tabs, Wrap}; +use ratatui::widgets::{Block, BorderType, Cell, Clear, Paragraph, Row, Table, Wrap}; use ratatui::Frame; use crate::app::{App, Level, LyricsState, MenuAction, Mode, PlayState, View, NO_KEY};