Skip to content

Using stable and unstable channels with flakes #1538

@timsofteng

Description

@timsofteng

Hello. Can you help me please with multi channels issue?
I want to use packages from stable and unstable bracnches in home manager.
I'm using flakes.
How can i do it? What i need to add to my flake.nix and how I can use it inside home-manager?

Here is my flake.nix config:

`{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.09";
inputs.nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";

inputs.home-manager.url = "github:nix-community/home-manager/master";
inputs.home-manager.inputs.nixpkgs.follows = "/nixpkgs";

outputs = inputs: {

nixosConfigurations.nixos = inputs.nixpkgs.lib.nixosSystem {
  system = "x86_64-linux";
  # Things in this set are passed to modules and accessible
  # in the top-level arguments (e.g. `{ pkgs, lib, inputs, ... }:`).
  specialArgs = {
    inherit inputs;
  };
  modules = [
    inputs.home-manager.nixosModules.home-manager

    ({ pkgs, ... }: {
      nix.extraOptions = "experimental-features = nix-command flakes";
      nix.package = pkgs.nixFlakes;
      nix.registry.nixpkgs.flake = inputs.nixpkgs;
      
      home-manager.useGlobalPkgs = true;

    })

    ./configuration.nix
  ];
};

};
}`

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