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

[QA] How to use? #3

Open
x-0D opened this issue Dec 8, 2024 · 4 comments
Open

[QA] How to use? #3

x-0D opened this issue Dec 8, 2024 · 4 comments

Comments

@x-0D
Copy link

x-0D commented Dec 8, 2024

I configured nixos-fhs/dev (because stable won't work, ln /lib failed) within flakes as described in guide. how i can access global fhs? how, as example, i can access pacman and install sofware i need ? I'm trying to solve use case, where old custom linux distro packed in oci container are installed as global fhs inside NixOS.

configuration.nix snippet

{
  ...
  virtualisation.podman.enable = true;
  services.fhs-compat = {
    enable = true;
    # persistent = true;
    distro = "debian";
    # other options here
  };
  ...
}

flake.nix

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
    fhs.url = "github:GermanBread/nixos-fhs/dev";
  };
  outputs = { self, nixpkgs, fhs }: {
    nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        fhs.nixosModules.default
        ./configuration.nix
      ];
    };
  };
}

looks like it works as expacted, but i don't understand, how to use it.

[root@nixos:/home/appleroot]# systemctl status manage-global-fhs-env.service
● manage-global-fhs-env.service - Global FHS environment
     Loaded: loaded (/etc/systemd/system/manage-global-fhs-env.service; enabled; preset: ignored)
     Active: active (exited) since Sun 2024-12-08 19:07:50 MSK; 9min ago
 Invocation: 56cad2b919c243aeb67d8c7ca007ace6
    Process: 4909 ExecStart=/nix/store/xvqknsda3g6kby1ky2bfk42jdjhv8xqs-unit-script-manage-global-fhs-env-sta>
   Main PID: 4909 (code=exited, status=0/SUCCESS)
         IP: 46.4M in, 79.9K out
         IO: 53.6M read, 31.8M written
   Mem peak: 354.1M
        CPU: 7.488s

дек 08 19:08:02 nixos bootstrap[5149]: [102B blob data]
дек 08 19:08:02 nixos bootstrap[5149]: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
дек 08 19:08:02 nixos manage-global-fhs-env-start[5064]: 0 upgraded, 0 newly installed, 0 to remove and 0 not>
дек 08 19:08:02 nixos podman[5064]: 2024-12-08 19:08:02.347284745 +0300 MSK m=+4.361588746 container died 19c>
дек 08 19:08:02 nixos podman[5250]: 2024-12-08 19:08:02.583637109 +0300 MSK m=+0.231560137 container cleanup >
дек 08 19:08:02 nixos manage-global-fhs-env-start[4909]: Purging unwanted directories
дек 08 19:08:02 nixos manage-global-fhs-env-start[4909]: Cloning tree
дек 08 19:08:03 nixos manage-global-fhs-env-start[5296]: bootstrap
дек 08 19:08:03 nixos manage-global-fhs-env-start[4909]: Saving service state
дек 08 19:08:03 nixos manage-global-fhs-env-start[4909]: /.fhs is ready
@GermanBread
Copy link
Owner

i can access pacman and install sofware i need ?

The point of this module is to declare the packages you need.

If you need to run pacman, run it in the module hooks.

@GermanBread
Copy link
Owner

Also: I highly suggest you use nix-ld instead of this module.

nix-ld works just as well in my experience ;)

@x-0D
Copy link
Author

x-0D commented Dec 9, 2024

The point of this module is to declare the packages you need.

So, how you use global fhs? Maybe some use-case flake.nix files or something else for showing the way. Are you using it with nix-ld? Or just chroot into /.fhs? I just need some breadcrumbs to understand how i can use it.

(It looks just like i need to containerlessly emulate other distro. If it is, i'll try to get to work systemd services and kernel modules, so i can "boot into fhs" with it's Display Manager with, in my case, custom login provider)

@GermanBread
Copy link
Owner

So, how you use global fhs?

The idea behind this module is that you can just run unpatched executables.

Are you using it with nix-ld?

I stopped using my module in favor of nix-ld.

I'll try to get to work systemd services and kernel modules, so i can "boot into fhs" with it's Display Manager with, in my case, custom login provider.

Feel free to try, but keep in mind that this goes beyond the project's goals. You will be on your own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants