mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 10:58:02 +00:00
36 lines
898 B
Nix
36 lines
898 B
Nix
{ inputs }:
|
|
|
|
{ config, lib, ... }:
|
|
|
|
let
|
|
inputs' = inputs // {
|
|
nixpkgs = inputs.${config.nixpkgs.branch};
|
|
home-manager = inputs.${config.homeManagerBranch};
|
|
};
|
|
|
|
flakeInputName = name:
|
|
if name == "self" then "config" else name;
|
|
in
|
|
{
|
|
config.modules = [(
|
|
{ lib, ... }: {
|
|
# I want to capture the usual flakes to its exact version so we're
|
|
# making them available to our system. This will also prevent the
|
|
# annoying downloads since it always get the latest revision.
|
|
nix.registry =
|
|
lib.mapAttrs'
|
|
(name: flake:
|
|
lib.nameValuePair (flakeInputName name) { inherit flake; })
|
|
inputs';
|
|
|
|
nix.settings.nix-path =
|
|
(lib.mapAttrsToList
|
|
(name: source: "${flakeInputName name}=${source}")
|
|
inputs'
|
|
++ [
|
|
"/nix/var/nix/profiles/per-user/root/channels"
|
|
]);
|
|
}
|
|
)];
|
|
}
|