mirror of
https://github.com/foo-dogsquared/website.git
synced 2025-01-30 22:57:59 +00:00
Update "Speeding up NixOS package search on the terminal"
This commit is contained in:
parent
75271c821b
commit
1ef2d8aaf5
@ -5,7 +5,7 @@ publishdate: 2023-11-10T00:00:00+00:00
|
|||||||
|
|
||||||
= Speeding up NixOS package search on the terminal
|
= Speeding up NixOS package search on the terminal
|
||||||
Gabriel Arazas <foodogsquared@foodogsquared.one>
|
Gabriel Arazas <foodogsquared@foodogsquared.one>
|
||||||
v1.0.1, 2023-11-10: Minor changes to wording and update nix.conf caption
|
v1.1.0, 2023-11-10: Fix erroneous code
|
||||||
|
|
||||||
:doccontentref: refs/heads/content/posts/2023-11-10-speeding-up-nix-package-search-on-the-terminal
|
:doccontentref: refs/heads/content/posts/2023-11-10-speeding-up-nix-package-search-on-the-terminal
|
||||||
|
|
||||||
@ -168,20 +168,7 @@ We can basically set the system registry like so.
|
|||||||
.Showing how to set `nix.registry`
|
.Showing how to set `nix.registry`
|
||||||
[source, nix]
|
[source, nix]
|
||||||
----
|
----
|
||||||
{
|
include::git:{doccontentref}~2[path=flake.nix]
|
||||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
|
|
||||||
inputs.nixos-stable.url = "github:NixOS/nixos-23.05";
|
|
||||||
inputs.nixos-unstable.url = "github:NixOS/nixos-unstable";
|
|
||||||
|
|
||||||
outputs = inputs@{ nixpkgs, ... }: {
|
|
||||||
nixosConfigurations.desktop = nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
modules = [
|
|
||||||
{ nix.registry = inputs; }
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
----
|
----
|
||||||
|
|
||||||
Once we rebuild our NixOS system with `nixos-rebuild`, we should now see our flake inputs included in the system registry.
|
Once we rebuild our NixOS system with `nixos-rebuild`, we should now see our flake inputs included in the system registry.
|
||||||
@ -211,7 +198,9 @@ If you want, you can remove it like in the following snippet.
|
|||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
modules = [
|
modules = [
|
||||||
({ config, lib, ... }: {
|
({ config, lib, ... }: {
|
||||||
nix.registry = lib.removeAttrs inputs [ "self" ];
|
nix.registry = lib.mapAttrs
|
||||||
|
(_: flake: { inherit flake; })
|
||||||
|
(lib.attrsets.removeAttrs inputs [ "self" ]);
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user