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

haskellPackages.git-annex: Add shellPath for the git-annex-shell. #161002

Merged
merged 1 commit into from
Feb 20, 2022

Conversation

Chobbes
Copy link
Contributor

@Chobbes Chobbes commented Feb 20, 2022

Motivation for this change

Git annex comes with a shell (/bin/git-annex-shell), which can be used as a restricted login shell.

https://git-annex.branchable.com/git-annex-shell/

Unfortunately, you can't set a user's shell to pkgs.haskellPackages.git-annex because it was missing the shellPath attribute. Now you can!

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@@ -92,6 +92,8 @@ self: super: {
rm -r $out/doc/?ndroid*
'';
};

passthru.shellPath = "/bin/git-annex-shell";
Copy link
Member

@cdepillabout cdepillabout Feb 20, 2022

Choose a reason for hiding this comment

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

Could you add a short comment here explaining this? (Basically just what you said in the body of your PR)

And could you change the base branch from master to haskell-updates? We try to send all haskell-related PRs to the haskell-updates branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, one sec.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cdepillabout donezo! :)

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Feb 20, 2022
@Chobbes Chobbes changed the base branch from master to haskell-updates February 20, 2022 04:58
@cdepillabout
Copy link
Member

@ofborg build haskellPackages.git-annex git-annex

@cdepillabout
Copy link
Member

Uh-oh, it looks like git-annex doesn't currently build on haskell-updates:

$ nix-build -A git-annex
error: Package ‘hslua-module-version-1.0.1’ in /home/illabout/git/nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix:141350 is marked as broken, refusing to evaluate.

       a) To temporarily allow broken packages, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_BROKEN=1

        Note: For `nix shell`, `nix build`, `nix develop` or any other Nix 2.4+
        (Flake) command, `--impure` must be passed in order to read this
        environment variable.

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

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowBroken = true; }
       to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)

This is likely because we are currently in the process of updating to GHC-9.0.2: #160733

@Chobbes are you interested in trying to fix this up?

@sternenseemann
Copy link
Member

sternenseemann commented Feb 20, 2022 via email

@Chobbes
Copy link
Contributor Author

Chobbes commented Feb 20, 2022

Not sure what you want me to do. I have tested that it still builds in master, and that I can set the shell appropriately for a user. In the version based off of haskell-updates the attribute is set:

nix-repl> outputs.legacyPackages.x86_64-linux.haskellPackages.git-annex.passthru.shellPath
"/bin/git-annex-shell"

I don't really know anything about the migration to ghc-9.0.2, so I'm not really interested in fixing that up (though, if somebody wants to point me in the right direction I might look into it in the future --- but probably not soon, unless this will be a quick fix).

Should I set this branch to be based on master again? Will that get the changes merged sooner?

@sternenseemann
Copy link
Member

Yes, presumably it'd be stuck on haskell-updates for a bit, so targeting master may be prudent.

@Chobbes
Copy link
Contributor Author

Chobbes commented Feb 20, 2022 via email

@Chobbes Chobbes changed the base branch from haskell-updates to master February 20, 2022 18:29
@github-actions github-actions bot removed 6.topic: policy discussion 8.has: documentation 6.topic: python 6.topic: ocaml 6.topic: kernel The Linux kernel 6.topic: erlang 8.has: changelog 6.topic: nim Nim programing language 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: emacs Text editor 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: fetch 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: vim 6.topic: golang 6.topic: qt/kde 6.topic: cinnamon Desktop environment labels Feb 20, 2022
Git annex provides a login shell for restricted access:
https://git-annex.branchable.com/git-annex-shell/

This was not exposed with `passthru.shellPath` before, so you could
not set a user's shell to `haskellPackages.git-annex` declaratively
before this change.
@Chobbes
Copy link
Contributor Author

Chobbes commented Feb 20, 2022

Alright, I got this pointed back at master, and tested building my system with it and it seems good to go :). Thanks for all the help, I appreciate it! Let me know if I need to make any further changes.

@sternenseemann
Copy link
Member

@ofborg build git-annex

@sternenseemann sternenseemann merged commit dae6f96 into NixOS:master Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: haskell 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants