nix-config/common/flakes.nix
Zuckerberg 68bd3b26b2
Some checks failed
Check Flake / check-flake (push) Failing after 41m22s
Update nixpkgs
2024-03-17 08:55:44 -06:00

25 lines
529 B
Nix

{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.nix.flakes;
in
{
options.nix.flakes = {
enable = mkEnableOption "use nix flakes";
};
config = mkIf cfg.enable {
nix = {
extraOptions = ''
experimental-features = nix-command flakes
'';
# pin nixpkgs for system commands such as "nix shell"
registry.nixpkgs.flake = config.inputs.nixpkgs;
# pin system nixpkgs to the same version as the flake input
nixPath = [ "nixpkgs=${config.inputs.nixpkgs}" ];
};
};
}