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

Add basic NixOS support #1586

Open
ferki opened this issue May 4, 2023 · 2 comments
Open

Add basic NixOS support #1586

ferki opened this issue May 4, 2023 · 2 comments
Labels
feature request A suggested idea for the project

Comments

@ferki
Copy link
Member

ferki commented May 4, 2023

As

maintainer

I would like to

make the test suite of Rex pass in NixOS

so I can

enable users to use basic Rex features on these systems

Additional context

We have previously experimented with this together with @qbit, and the results are in the nixos branch.

Describe the solution you would like

I would like to focus on making sure that at least the test suite is passing on NixOS, and Rex can recognize NixOS systems.

Preliminary results suggest it's not that far as we initially thought, and some of the slight changes required for this may also add general benefits (e.g. not assuming path for common CLI tools).

Further support, like package and service management may be added separately (even outside Rex core as a separate CPAN distribution).

Describe alternatives you have considered

One alternative is to add only generic changes to Rex core, without the bits specific to NixOS. That would still make Rex code more robust when having to handle more unexpected/esoteric system.

@ferki ferki added the feature request A suggested idea for the project label May 4, 2023
@qbit
Copy link

qbit commented May 4, 2023

Steps to test this branch on NixOS (unstable):

shell.nix

with (import <nixpkgs> { });
mkShell {
  buildInputs = with perlPackages; [
    FileShareDirInstall
    ParallelForkManager
    StringEscape
    SubOverride
    TestDeep
    TestException
    TestOutput
    TestUseAllModules
    TestWarnings

    rsync
  ];

  checkInputs = [ coreutils ];

  nativeBuildInputs = with pkgs.perlPackages; [
    ParallelForkManager
    installShellFiles

    pkgs.git
    pkgs.perl
    pkgs.rsync
    pkgs.lsb-release
    pkgs.coreutils
  ];

  propagatedBuildInputs = with perlPackages; [
    AWSSignature4
    DataValidateIP
    DevelCaller
    DigestHMAC
    FileLibMagic
    HashMerge
    HTTPMessage
    IOPty
    IOString
    JSONMaybeXS
    LWP
    NetOpenSSH
    NetSFTPForeign
    SortNaturally
    TermReadKey
    TextGlob
    URI
    XMLSimple
    YAML
  ];
}

Place shell.nix in the root of the source tree (checked out in the nixos branch) and run nix-shell.

Run the tests with:

env GIT_CONFIG_SYSTEM="" prove -lr t/

@ferki
Copy link
Member Author

ferki commented Jul 30, 2023

@qbit: I rebased the nixos branch on top of current mainline, and I believe prepending the env GIT_CONFIG_SYSTEM="" is not needed anymore for the test suite to pass where there is a global/system git config present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A suggested idea for the project
Projects
None yet
Development

No branches or pull requests

2 participants