Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flake updates and default port #1

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

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

5 changes: 3 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
in
naersk'.buildPackage {
src = ./.;
meta.mainProgram = "mprisqueeze";
};

in
Expand All @@ -26,10 +27,10 @@
in
{
# For `nix build` & `nix run`:
defaultPackage = derivation pkgs;
packages.default = derivation pkgs;

# For `nix develop`:
devShell = pkgs.mkShell {
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs;
[
cargo
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ mod mpris;
struct Options {
#[arg(short = 'H', long, help = "LMS hostname")]
hostname: Option<String>,
#[arg(short = 'P', long, help = "LMS port")]
port: Option<u16>,
#[arg(short = 'P', long, help = "LMS port", default_value_t = 9000)]
port: u16,
#[arg(short, long, default_value = "SqueezeLite", help = "Player name")]
player_name: String,
#[arg(
Expand Down Expand Up @@ -120,7 +120,7 @@ async fn main() -> Result<()> {
let (hostname, port) = match options {
Options {
hostname: Some(ref hostname),
port: Some(port),
port,
..
} => (hostname.clone(), port),
_ => {
Expand Down
Loading