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

how to nix run on a module #158

Open
hmajid2301 opened this issue Jan 17, 2025 · 2 comments
Open

how to nix run on a module #158

hmajid2301 opened this issue Jan 17, 2025 · 2 comments

Comments

@hmajid2301
Copy link

Hey,

Apologises if this is a silly question, but I'm wondering what is the best way to expose my Neovim config as an output. So that other people could do say nix run .#neovim

My flake.nix (https://gitlab.com/hmajid2301/nixicle/-/blob/main/flake.nix) looks something like this:

    lib.mkFlake {
      channels-config = {
        allowUnfree = true;
      };

     # ...

      overlays = with inputs; [
        nixgl.overlay
        nur.overlays.default
        nix-topology.overlays.default
      ];

      deploy = lib.mkDeploy {inherit (inputs) self;};

      checks =
        builtins.mapAttrs
        (system: deploy-lib:
          deploy-lib.deployChecks inputs.self.deploy)
        inputs.deploy-rs.lib;

      topology = with inputs; let
        host = self.nixosConfigurations.${builtins.head (builtins.attrNames self.nixosConfigurations)};
      in
        import nix-topology {
          inherit (host) pkgs; # Only this package set must include nix-topology.overlays.default
          modules = [
            (import ./topology {
              inherit (host) config;
            })
            {inherit (self) nixosConfigurations;}
          ];
        };
    };

My Neovim config is currently a module at modules/home/cli/editors/neovim, link to config: https://gitlab.com/hmajid2301/nixicle/-/tree/main/modules/home/cli/editors/neovim

Any help would be greatly appreciated.

@Cucumberrbob
Copy link

I'm not sure on the specifics of nix-cats, but what worked for me with my Nixvim configuration was splitting it out into a different flake, and then using the package from the outputs of that flake in my home.packages.

This is how the creator of this project does it in their nix config.

@hmajid2301
Copy link
Author

yeh i saw that, i was wondering if there was a way to do in the same flake.

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