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
i3blocks: search for config in correct system directory #21839
Conversation
The SYSCONFDIR variable used in the Makefile servers two purposes: 1) During buildPhase, it is hardcoded into the executable as one of the locations that will be searched for the i3blocks.conf config file. We want this set to "/etc", so that "/etc/i3blocks.conf" will be automatically loaded if it exists, as specified in the manpage. 2) During installPhase, it specifies the location that the sample i3blocks.conf should be installed to. We want this to be "$out/etc". Case 2 was already handled correctly, but case 1 was not. This resulted in i3blocks instead searching for i3blocks.conf in the default value of SYSCONFDIR, which is "/usr/local/etc", a directory which generally does not exist on NixOS. This commit remedies this problem by setting SYSCONFDIR=/etc during buildPhase. A minor stylistic fix (correcting a usage of "makeFlags" to "buildFlags" in the expression) has also been applied in this commit.
@kierdavis, thanks for your PR! By analyzing the history of the files in this pull request, we identified @MindTooth and @zimbatm to be potential reviewers. |
The platforms should actually be |
@7c6f434c: Maybe https://github.com/NixOS/nixpkgs/blob/master/lib/platforms.nix |
@7c6f434c: Maybe `unix` would do?
The TravisCI failure is a true failure on Darwin. Can you even run `i3` on macOS?
|
I would guess through XQuartz or something. But not on the base system. Not used to the syntax, but |
Not used to the syntax, but `unix !darwin`, would that work then?
No, it is a simple list of strings and ! is not an operator for list
subtraction.
|
So maybe this then:
|
`platforms = linux ++ freebsd ++ openbsd ++ netbsd ++ illumos;`
Do you actually have any idea if it builds on IllumOS?
Would be fine from practical point of view, I guess — I am not sure
anyone would try building even on OpenBSD anyway.
|
I see what you're getting at, and I'll up a PR :-) |
The
SYSCONFDIR
variable used in the Makefile servers two purposes:During buildPhase, it is hardcoded into the executable as one of
the locations that will be searched for the
i3blocks.conf
configfile. We want this set to
/etc
, so that/etc/i3blocks.conf
will be automatically loaded if it exists, as specified in the
manpage.
During installPhase, it specifies the location that the sample
i3blocks.conf
should be installed to. We want this to be$out/etc
.Case 2 was already handled correctly, but case 1 was not. This resulted
in i3blocks instead searching for
i3blocks.conf
in the default value ofSYSCONFDIR
, which is/usr/local/etc
, a directory which generally doesnot exist on NixOS. This commit remedies this problem by setting
SYSCONFDIR=/etc
during buildPhase.A minor stylistic fix (correcting a usage of
makeFlags
tobuildFlags
) has also been applied in this commit.Motivation for this change
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)