diff --git a/.envrc b/.envrc index b915ba0..5edf0c2 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1,4 @@ +watch_file rust-toolchain.toml use flake dotenv_if_exists diff --git a/Cargo.lock b/Cargo.lock index 3d2fe83..20ed766 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -421,7 +421,7 @@ dependencies = [ [[package]] name = "ha-now-playing" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anyhow", "async-tungstenite", diff --git a/Cargo.toml b/Cargo.toml index 3e5c36a..eab2466 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,10 @@ [package] name = "ha-now-playing" description = "Retrieves the state of a media_player entity from Home Assistant" -version = "0.4.3" +version = "0.4.4" authors = ["Erwin Boskma "] edition = "2021" +include = ["src/**/*"] [dependencies] anyhow = "1.0.56" diff --git a/flake.lock b/flake.lock index bfda706..f98a0a8 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1651574473, - "narHash": "sha256-wQhFORvRjo8LB2hTmETmv6cbyKGDPbfWqvZ/0chnDE4=", + "lastModified": 1662220400, + "narHash": "sha256-9o2OGQqu4xyLZP9K6kNe1pTHnyPz0Wr3raGYnr9AIgY=", "owner": "nmattia", "repo": "naersk", - "rev": "f21309b38e1da0d61b881b6b6d41b81c1aed4e1d", + "rev": "6944160c19cb591eb85bbf9b2f2768a935623ed3", "type": "github" }, "original": { @@ -23,11 +23,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1652172129, - "narHash": "sha256-8e2JMrswaKe02P8rYfvIMoc59pNuw6h/GYu8DBE1c+0=", + "lastModified": 1667482890, + "narHash": "sha256-pua0jp87iwN7NBY5/ypx0s9L9CG49Ju/NI4wGwurHc4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f419dc5763c2b3c5580e396dea065b6d8b58ee27", + "rev": "a2a777538d971c6b01c6e54af89ddd6567c055e8", "type": "github" }, "original": { @@ -55,11 +55,11 @@ ] }, "locked": { - "lastModified": 1652236937, - "narHash": "sha256-anMSkIvaxB3jV74nTvPcE8fH7bZ5LPuc2wXGvt50Oe0=", + "lastModified": 1667616267, + "narHash": "sha256-EYzGCJaTNTSbUk5sa2i4/dn71YtE6uvZb9syL8GH1U0=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "18c816d2d10317f4a8816925a12cb4bbdd0821de", + "rev": "a785c5db0ab1b10e6ba04b7240628aea9615e9ad", "type": "github" }, "original": { @@ -70,11 +70,11 @@ }, "utils": { "locked": { - "lastModified": 1649676176, - "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 7478b2b..0635c23 100644 --- a/flake.nix +++ b/flake.nix @@ -28,7 +28,7 @@ pkgs.openssl ]; nativeBuildInputs = [ - pkgs.pkg-config + pkgs.pkgconf ]; in rec { diff --git a/src/main.rs b/src/main.rs index 7f4fc8b..f72a524 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,30 +18,36 @@ mod output; #[clap(version, author, about)] struct Opts { /// Home Assistant host - #[clap(short, long)] + #[clap(short, long, env = "HNP_HOST")] host: String, /// Media player entity ID - #[clap(short, long)] + #[clap(short, long, env = "HNP_ENTITY")] entity: String, /// API token - #[clap(short, long, env)] + #[clap(short, long, env = "HNP_TOKEN")] token: Option, /// File with the API token - #[clap(long, env)] + #[clap(long, env, env = "HNP_TOKEN_FILE")] token_file: Option, /// Use HTTP instead of HTTPS - #[clap(short, long)] + #[clap(short, long, env = "HNP_INSECURE")] insecure: bool, /// Output format - #[clap(arg_enum, short, long, default_value = "waybar")] + #[clap( + arg_enum, + short, + long, + env = "HNP_OUTPUT_FORMAT", + default_value = "waybar" + )] format: output::OutputFormat, - #[clap(short, long)] + #[clap(short, long, env = "HNP_DEBUG")] debug: bool, #[clap(subcommand)]