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

nixos/home-assistant: Imperial unit system deprecated, cannot set new option #373674

Open
3 tasks done
NullCub3 opened this issue Jan 14, 2025 · 1 comment
Open
3 tasks done
Labels
0.kind: bug Something is broken 3.skill: good-first-bug This seems like it's fixable by a non-expert 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS

Comments

@NullCub3
Copy link
Contributor

NullCub3 commented Jan 14, 2025

Nixpkgs version

  • Unstable (25.05)

Describe the bug

Setting services.home-assistant.config.homeassistant.unit_system to imperial causes the following error to be shown inside of home assistant:

The imperial unit system is deprecated
Warning ⸱ Reported by Home Assistant Core Integration
The imperial unit system is deprecated and your system is currently using us customary. Please update your configuration to use the us customary unit system and reload the core configuration to fix this issue.

The correct value to use is us_customary but setting the option to that throws an error while trying to build the config:

error: A definition for option `services.home-assistant.config.homeassistant.unit_system' is not of type `null or one of "metric", "imperial"'. Definition values:
       - In `/nix/store/bc3d7zgqpx1g9vhjf0mi95ajy2kvjc7y-source/nixosModules/home-assistant.nix': "us_customary"

Steps to reproduce

  1. Set services.home-assistant.config.homeassistant.unit_system to imperial
  2. Warning about deprecation
  3. Set services.home-assistant.config.homeassistant.unit_system to us_customary
  4. Get error building configuration

Expected behaviour

Setting unit_system to us_customary should not throw an error

Screenshots

image

Relevant log output

No response

Additional context

home-assistant/core#130979
https://www.home-assistant.io/integrations/homeassistant/#unit_system

I am running nixos-24.11 for my main system but using the home-assistant package and module from nixos-unstable (As described in the wiki)

System metadata

  • system: "x86_64-linux"
  • host os: Linux 6.6.71, NixOS, 24.11 (Vicuna), 24.11pre-git
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Lix, like Nix) 2.91.1 System type: x86_64-linux Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/nullcube/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/nullcube/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/nullcube/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/nullcube/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/6dxshp2qaas92v7d36baf7y95q0v98dn-lix-2.91.1/share
  • nixpkgs: /nix/store/zd5dgszslv09jzybcpf25gpl12s6r2d9-source

Notify maintainers

@Mic92 @fabaff @mweinelt


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

@NullCub3 NullCub3 added 0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS labels Jan 14, 2025
@SigmaSquadron
Copy link
Contributor

Looks like all this needs is a tiny change in the assertion, so I'm marking this as a good first issue.

This is the line that needs to be changed:

type = types.nullOr (types.enum [ "metric" "imperial" ]);

@SigmaSquadron SigmaSquadron added the 3.skill: good-first-bug This seems like it's fixable by a non-expert label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 3.skill: good-first-bug This seems like it's fixable by a non-expert 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Projects
None yet
Development

No branches or pull requests

2 participants