i3blocks: search for config in correct system directory#21839
Merged
7c6f434c merged 1 commit intoNixOS:masterfrom Jan 13, 2017
Merged
i3blocks: search for config in correct system directory#218397c6f434c merged 1 commit intoNixOS:masterfrom
7c6f434c merged 1 commit intoNixOS:masterfrom
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. |
Member
|
The platforms should actually be |
|
@7c6f434c: Maybe https://github.com/NixOS/nixpkgs/blob/master/lib/platforms.nix |
Member
|
@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 |
Member
|
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:
|
Member
|
`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 :-) |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
SYSCONFDIRvariable 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.confconfigfile. We want this set to
/etc, so that/etc/i3blocks.confwill be automatically loaded if it exists, as specified in the
manpage.
During installPhase, it specifies the location that the sample
i3blocks.confshould 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.confin 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=/etcduring buildPhase.A minor stylistic fix (correcting a usage of
makeFlagstobuildFlags) has also been applied in this commit.Motivation for this change
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandboxinnix.confon non-NixOS)
nix-shell -p nox --run "nox-review wip"./result/bin/)