Skip to content

Instructions unclear with home-manager managed as a flake #65

@golddranks

Description

@golddranks

The README seems to show how to install vscode-server as a system-level module, with flakes or channels. I'm trying to install it to just one user, with home-manager managed as a flake.

I expect that I need to specify vscode-server.url = "github:nix-community/nixos-vscode-server"; as my input in .config/home-manager/flake.nix. The next problem is, how am I supposed to "install" or enable the module to be able to enable the service in ~/.config/nixpkgs/home.nix? I tried to add it to the modules list, but got a "vscode-server is a flake" error. Next, I reasoned that the module is an output of the flake, but this backfires too.

{
  description = "Home Manager configuration of kon";

  inputs = {
    # Specify the source of Home Manager and Nixpkgs.
    nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
    home-manager = {
      url = "github:nix-community/home-manager/release-23.05";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    vscode-server.url = "github:nix-community/nixos-vscode-server";
  };

  outputs = { nixpkgs, home-manager, vscode-server, ... }:
    let
      system = "x86_64-linux";
      pkgs = nixpkgs.legacyPackages.${system};
    in {
      homeConfigurations."kon" = home-manager.lib.homeManagerConfiguration {
        inherit pkgs;

        # Specify your home configuration modules here, for example,
        # the path to your home.nix.
        modules = [
          ./home.nix
          vscode-server.nixosModules.default  # I'm trying to specify the vscode-server "module" here, but this doesn't seem to work.
        ];

        # Optionally use extraSpecialArgs
        # to pass through arguments to home.nix
      };
    };
}

I'm lost how to proceed, please help. (And let's possibly, update the README too, I think that using flakes with home-manager is getting more and more common!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions