Skip to content

Update and fix nix package#233

Open
nikp123 wants to merge 7 commits intonbfc-linux:mainfrom
nikp123:main
Open

Update and fix nix package#233
nikp123 wants to merge 7 commits intonbfc-linux:mainfrom
nikp123:main

Conversation

@nikp123
Copy link
Copy Markdown

@nikp123 nikp123 commented Nov 14, 2025

NixOS package will fail to compile due to lack of curl as this project depends on it.

And the Qt UI doesn't seem to be a part of this repo anymore so I will drop it from this package's flake.

NixOS package will fail to compile due to lack of curl as this project depends on it.
Qt was previously a part of this repo, but no longer seems to be.
So we're gonna drop it from this package because it's practically a
noop.

And update the version string to reflect the newest version of this
repo's tags.
@nikp123 nikp123 changed the title Add missing curl dependency in nix flake Update and fix nix package Nov 14, 2025
@nikp123
Copy link
Copy Markdown
Author

nikp123 commented Nov 14, 2025

I'm fine with moving the creation of /etc/nbfc into a separate step, but it shouldn't be a part of the normal makefile install target as it is a step which touches the system configuration and that should be only relegated to package maintainers and users that are manually installing the service.

/etc shouldn't really be added through the Makefile as it breaks the
NixOS philosophy of having package build processes being independent
from your own system configuration.

Instead, it should fall on the package maintainers that they install
those folders instead.
@braph
Copy link
Copy Markdown
Contributor

braph commented Nov 15, 2025

Hello @nikp123,

thank you for contributing.

You are right, creating /etc/nbfc in the Makefile is a bad idea, so removing those lines from the Makefiles is the right approach.

However, I disagree with renaming the package from nbfc-linux to nbfc, as the "orignal project" is already named nbfc.

Also, I noticed the configureFlags where you hard-code /etc. I remember this being an issue back when NBFC-Linux still wrote the fan speeds to /etc/nbfc/nbfc.json. These days NBFC-Linux writes the fan speed state to a state file under /var/lib/nbfc, but tools like nbfc-qt and nbfc-gtk still write to /etc/nbfc/nbfc.json (or wherever the main config is stored) for configuring things.

(The reason I'm bringing this up is because I remember NixOS having a kind of "static" filesystem where you can't modify files in e.g. /etc. Please correct me if I'm wrong.)

So:

  • Rename the package back to nbfc-linux
  • (Maybe) revert the --sysconfdir=/etc

Best regards,

Benjamin

@nikp123
Copy link
Copy Markdown
Author

nikp123 commented Nov 15, 2025

Thanks for the feedback.
Reverting the --sysconfdir=/etc will break the package as nbfc will not start with the etc folder being inside of the Nix store.

(The reason I'm bringing this up is because I remember NixOS having a kind of "static" filesystem where you can't modify files in e.g. /etc. Please correct me if I'm wrong.)

Yes and no. Most Nix packages don't write to /etc directly, however it's not strictly forbidden.
One example is NetworkManager which both reads and writes to /etc/NetworkManager, even inside of NixOS.
However, through the use of options you can make NixOS generate files in your /etc directory, that's probably what you meant, right?

This just offers the option for someone to manually configure the package and then later upgrade to a generated config via NixOS options if they so choose.

However, I have no issue with reverting the name as it was, I didn't think the nbfc-linux was the intended name. Apologies on that. Will be bringing that back shortly.

@bohanubis
Copy link
Copy Markdown

does this work past this commit 7960a1d
I was overriding the flake using

  nixpkgs.overlays = [
    (finaln: oldn: {
      nbfc-linux = inputs.nbfc-linux.packages.x86_64-linux.default.overrideAttrs (final: old: {
        preFixup = "";
        nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.curl];
      });
    })
  ];

if this is still working with latest commit
can it be merged
and best regards
and thanks for the amazing project

It's a non-existant file that breaks the build on NixOS. We need to
remove it for the build process to succeed.
@nikp123
Copy link
Copy Markdown
Author

nikp123 commented Jan 2, 2026

@bohanubis I have updated the remote to a newer version. I haven't ran the program, but I've made sure it builds. The problem was that reverse_nxjson.h got included in Makefile.in that doesn't exist which broke the build. I removed that reference from there and the build now works.

@bohanubis
Copy link
Copy Markdown

@nikp123 I can confirm it works thanks a lot
I hope this gets merged soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants