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

openhab: init at 2.5.9 and NixOS module [WIP] #63814

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

peterhoeg
Copy link
Member

Motivation for this change

openHAB is a pretty nifty home-automation tool.

This is still very much a WIP.

Cc: @dotlambda might be interested

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@ivan
Copy link
Member

ivan commented Sep 6, 2019

For the author, reviewers, and committers: this PR was scanned and appears to add a use of the deprecated types.string, which emits a warning as of #66346. Before merging, please change this to another type, possibly:

  • types.str for a single string where merging does not make sense, or cannot work
  • types.lines for multi-line configuration or scripts where merging is possible
  • types.listOf types.str for a mergeable list of strings

@peterhoeg peterhoeg changed the title openhab: init at 2.4.0 and NixOS module [WIP] openhab: init at 2.5.2 and NixOS module [WIP] Mar 10, 2020
@peterhoeg
Copy link
Member Author

@GrahamcOfBorg eval

type = types.package;
example = literalExample ''
pkgs.openhab.override {
withAddons = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The openhab package doesn't appear to have a withAddons attribute. Did it get removed, but this documentation hasn't been updated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using this module with withAddons - it's definitely there.

@Thra11
Copy link
Member

Thra11 commented Apr 20, 2020

I don't know much when it comes to java or openhab, so this may be a problem with my config...
When attempting to communicate with a certain ZWave thing, openhab produces the following error:

Apr 20 21:03:14 hostname openhab[6853]: [mmandclass.ZWaveSecurityCommandClass] - NODE 4: Error building derived keys {}
Apr 20 21:03:14 hostname openhab[6853]: java.security.NoSuchAlgorithmException: Cannot find any provider supporting AES/ECB/NoPadding
Apr 20 21:03:14 hostname openhab[6853]:         at javax.crypto.Cipher.getInstance(Cipher.java:539) ~[?:1.8.0_242]
Apr 20 21:03:14 hostname openhab[6853]:         at org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveSecurityCommandClass.setupNetworkKey(ZWaveSecurityCommandClass.java:464) [bundleFile:?]
Apr 20 21:03:14 hostname openhab[6853]:         at org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveSecurityCommandClass.setNetworkKey(ZWaveSecurityCommandClass.java:418) [bundleFile:?]
Apr 20 21:03:14 hostname openhab[6853]:         at org.openhab.binding.zwave.internal.protocol.ZWaveController$ZWaveInitNodeThread.run(ZWaveController.java:450) [bundleFile:?]

After reading your comment about missing crypto providers in openjdk, and seeing various references to openjdk not shipping with a JCE implementation, I was ready to write it off as unsupported with openjdk. However, I tried calling the same java function on its own, outside of openhab, and it appears to work:

> nix-shell -p openjdk8 --run "jrunscript -e 'print (javax.crypto.Cipher.getInstance(\"AES/ECB/NoPadding\"));'"
javax.crypto.Cipher@4722ef0c

As far as I can tell, they're both using the same openjdk8, but one of them can't find its crypto provider.

@peterhoeg peterhoeg changed the title openhab: init at 2.5.2 and NixOS module [WIP] openhab: init at 2.5.9 and NixOS module [WIP] Oct 5, 2020
@ryantm ryantm marked this pull request as draft October 23, 2020 03:06
@stale
Copy link

stale bot commented Apr 26, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 26, 2021
@WhittlesJr
Copy link
Contributor

2021 bump. Openhab 3 is out now, and I'd love to have that.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 29, 2021
@SuperSandro2000 SuperSandro2000 added 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md and removed 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md labels Apr 29, 2021
@peterhoeg
Copy link
Member Author

peterhoeg commented Apr 30, 2021 via email

@WhittlesJr
Copy link
Contributor

I would personally be fine with just taking what you've built more or less as-is, and working towards making it more generic over time. Would it be possible to at least see what you have in a gist or something?

@stale
Copy link

stale bot commented Nov 9, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 9, 2021
@WhittlesJr
Copy link
Contributor

Bump

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 14, 2021
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 19, 2022
@peterhoeg
Copy link
Member Author

I do apologize to everyone who's been waiting for this. I'm currently flakyfying this so people can get started on it. I've been using openHAB since way before this draft PR - it's great!

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 30, 2022
@spacefrogg
Copy link
Contributor

@peterhoeg Ping. Do you happen to have your opinionated configuration publicly available somehow? I would volunteer to strip and streamline this to make it acceptable to nixpkgs.

@frederictobiasc
Copy link
Contributor

@peterhoeg ping.

@peterhoeg
Copy link
Member Author

peterhoeg commented Apr 21, 2023 via email

@frederictobiasc
Copy link
Contributor

You can take a look here:

https://gitlab.com/peterhoeg/openhab-flake

Hi, has anyone managed to get the module running? lib/openhab.nix seems broken.

@peterhoeg
Copy link
Member Author

peterhoeg commented Sep 6, 2023 via email

@peterhoeg
Copy link
Member Author

For everyone who is monitoring this, we managed to put a small team together at the hackday at nixcon to work on this and we now have the flake in a state where it can be used to bring up openhab with all the plumbing (but not much else) - most importantly there is no documentation/examples of any kind.

I am aiming for a "developer release" with in the next few weeks at which point we will make a proper announcement, but you are all very welcome to drop by and have a look at https://github.com/peterhoeg/openhab-flake.

On a site note - it's phenomenal to collaborate with others on something when you're sitting right next to each other.

@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants