hello everyone! noob here…
so, about -> follows 'nixpkgs'
…
what should one use that for, if a flake works just fine without it? is it for compilation tools or something? because if every flake uses its own built-in, independent compilation tools, does that mean that with PKG.inputs.nixpkgs.follows = "nixpkgs"
one can use system packages and compilation tools instead? okay, then, how do i even know that it does, indeed, do exactly that? i.e. how do i see if it builds / compiles using my own compilers from my systemPackages
/ nixpkgs
? or did i get that completely wrong and am a fool? e.g.:
inputs = {
# ...
yazi.url = "github:sxyazi/yazi"; # necessary for installation
# yazi.inputs.nixpkgs.follows = "nixpkgs"; # not necessary?!
};
sometimes, the latter line could lead to compilation errors and to hash mismatches in fixed-output derivations. but why?
how does one know when is it possible to use a PKG.inputs.nixpkgs.follows = "nixpkgs"
? do you actually have to look at each and every flake to see if it supports it?
okay, here is another one: i just want A package from a flake which is NOT in the main nixpkgs
repo (is that how you say it?). a singular package. that’s it. is this the bare minimum for unstable?
flake.nix
{
description = "help me"; # is *description* even required?
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
yazi.url = "github:sxyazi/yazi"; # file manager
};
outputs = {
self,
nixpkgs,
# yazi, # do you need this output? why?
...
} @inputs: # sorry what? WHAT IS THIS?!?!
# sometimes they do even THIS:
# @inputs: let inherit (self) outputs; in # WTF?!
{ nixosConfigurations.HOST = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; # LEGACY?! do you still need this?
specialArgs = {
inherit inputs; # why? why? whyyyy?!
# or
# inherit inputs outputs PKG; # please help me
# or
# inherit inputs nixpkgs; # i am utterly lost
};
# ...
# sometimes people have more stuff HERE
# ...
modules = [
./configuration.nix # understandable
# ./hardware-configuration.nix # NOT understandable!!
# yazi.nixosModules.default # unnecessary? why would you want this?
];
};
};
# ...
# again, some people have EVEN MORE stuff down here!
# ...
}
configuration.nix
{
config, # config = { }
lib, # mkDefault mkForce
pkgs,
inputs, # flakes
...
}:
{
# ...
environment.systemPackages = {
inputs.yazi.packages.${pkgs.system}.default;
# okay, SLOW DOWN. what is all of this:
# ${pkgs.system}?
# is it the same as
# ${pkgs.stdenv.hostPlatform.system}?
# next, why doesnt it work without *inputs.*?!
# in some guides they just tell you to
# "place the pkgs.PKG in *systemPackages*"
# but it never worked!
};
# ...
}
lastly, this question bothers me the most. could be a little silly, but i do need to ask this:
for example, i am NOT using nixos-unstable
, rather, i am using nixos-unstable-small
. do you have to accommodate for the prefix or not? for example:
inputs = {
# nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-small.url = "github:nixos/nixpkgs/nixos-unstable-small";
yazi.url = "github:sxyazi/yazi";
yazi.inputs.nixpkgs.follows = "nixpkgs-small"; # is that right?
};
i just really want to understand this before i go ahead and try home-manager. which has like 3 different ways of installation inside a flake.nix
: the external .nix file configuration, the nixosModules
configuration - the one that is strangely without the equals mark before { }
, and a separate homeConfigurations."USER@HOST" = home-manager.lib.homeManagerConfiguration
- all of them are just… infinitely interesting.
sorry, it surely is quite a bit silly, but, yeah… thanks in advance!!!