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

sks,nixos/sks: Various minor improvements #46370

Merged
merged 5 commits into from Sep 8, 2018
Merged

Conversation

primeos
Copy link
Member

@primeos primeos commented Sep 8, 2018

Motivation for this change

Module:

  • Add a webroot option (serve a website by default, makes the setup easier)
  • Explicitly set a group (instead of using 65534/nogroup)
  • Move pkgs.sks from environment.systemPackages to the "sks" user and add pkgs.db

Package:

  • Adapt the output of "sks version" to NixOS
  • Copy the example webpages to $webSamples
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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

The module will now, by default, serve a simple webpage via the built-in
web server (instead of displaying an error message).
Without a group the gid will default to 65534 (2^16 - 2) which maps to
"nogroup". IMO it makes more sense to explicitly set a valid group.

Adding pkgs.sks to environment.systemPackages is not required (IIRC we
want to avoid bloating environment.systemPackages). Instead it seems
like a better idea to make the relevant binaries available to the user
sks and enable useDefaultShell so that "su -l sks" can be used for
manual interaction (that way the files will always have the correct
owner).
That way the built-in web server is usable by default but users can use
$HOME/web directly (instead of having to use a symlink), if they want to
customize the webpage.
@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: sks

Partial log (click to expand)

strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/v4dxj2xl6zl608pbaa8d3anyvkk0x1lb-sks-1.1.6/bin
patching script interpreter paths in /nix/store/v4dxj2xl6zl608pbaa8d3anyvkk0x1lb-sks-1.1.6
/nix/store/v4dxj2xl6zl608pbaa8d3anyvkk0x1lb-sks-1.1.6/bin/sks_build.sh: interpreter directive changed from "/bin/bash" to "/nix/store/czx8vkrb9jdgjyz8qfksh10vrnqa723l-bash-4.4-p23/bin/bash"
checking for references to /build in /nix/store/v4dxj2xl6zl608pbaa8d3anyvkk0x1lb-sks-1.1.6...
shrinking RPATHs of ELF executables and libraries in /nix/store/lkv05nlndr1dd5mn02hsz851kvlv8yrn-sks-1.1.6-webSamples
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/lkv05nlndr1dd5mn02hsz851kvlv8yrn-sks-1.1.6-webSamples
checking for references to /build in /nix/store/lkv05nlndr1dd5mn02hsz851kvlv8yrn-sks-1.1.6-webSamples...
/nix/store/v4dxj2xl6zl608pbaa8d3anyvkk0x1lb-sks-1.1.6

@primeos primeos merged commit b58a230 into NixOS:master Sep 8, 2018
@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: sks

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: sks

Partial log (click to expand)

make[3]: Leaving directory '/build/ocaml-4.02.3/otherlibs/unix'
make[2]: *** [Makefile:763: otherlibrariesopt] Error 2
make[2]: Leaving directory '/build/ocaml-4.02.3'
make[1]: *** [Makefile:276: opt.opt] Error 2
make[1]: Leaving directory '/build/ocaml-4.02.3'
make: *** [Makefile:143: world.opt] Error 2
builder for '/nix/store/n3hzl09dqr6fdy3i8l6cr25bv0gkjr86-ocaml-4.02.3.drv' failed with exit code 2
cannot build derivation '/nix/store/zwyfqgd1mwywmdmnszr952zjijgzspql-camlp4-4.02+6.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/6igvn30222qghy4qnmvmnsnlzfvchzcs-sks-1.1.6.drv': 2 dependencies couldn't be built
error: build of '/nix/store/6igvn30222qghy4qnmvmnsnlzfvchzcs-sks-1.1.6.drv' failed

@primeos primeos mentioned this pull request May 27, 2019
7 tasks
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

2 participants