I just started using nixos and have a basic understanding of how the nix language works. I have been using Misterio nixos config with home manager
In my flake.nix, I was able to use the neovim nightly overlay, I define the URL where the flake is on github, and use the inputs inside overlays. This allows me to define the neovim package and it gives me the neovim inside the neovim-nightly repository version.
I am trying to do the same thing for the devenv package, it is only available in unstable and inside the devenv repository there is a flake.
I am unable to define inputs.devenv.overlay. I am still confused to why this does not work, if there is something inside flake.nix that lets it become an overlay? or if I am doing this wrong or if there is a better way.
flake.nix
{
description = "Your new nix config";
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
# You can access packages and modules from different nixpkgs revs
# at the same time. Here's an working example:
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'.
# Home manager
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# TODO: Add any other flake you might need
hardware.url = "github:nixos/nixos-hardware";
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
devenv.url = "github:cachix/devenv";
# Shameless plug: looking for a way to nixify your themes and make
# everything match nicely? Try nix-colors!
# nix-colors.url = "github:misterio77/nix-colors";
};
......
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"me@asus" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;};
modules = [
# > Our main home-manager configuration file <
./home-manager/home.nix
];
};
};
};
}
home.nix
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
# You can import other home-manager modules here
imports = [
# If you want to use modules your own flake exports (from modules/home-manager):
# outputs.homeManagerModules.example
# Or modules exported from other flakes (such as nix-colors):
# inputs.nix-colors.homeManagerModules.default
# You can also split up your configuration and import pieces of it here:
# ./nvim.nix
];
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
# You can also add overlays exported from other flakes:
inputs.neovim-nightly-overlay.overlay
# inputs.devenv.overlay <--- problem is here
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
# Workaround for https://github.com/nix-community/home-manager/issues/2942
allowUnfreePredicate = _: true;
permittedInsecurePackages = [
"electron-25.9.0"
];
};
};
home = {
username = "me";
homeDirectory = "/home/me";
packages = with pkgs; [
# browsers
firefox
neovim
#devenv
];
};
# Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
home.stateVersion = "23.11";
}