Skip to content

Snowfall Lib v2 Migration

Snowfall Lib v2 adds a large amount of features and has made a few breaking changes that are in the benefit of overall user experience. To migrate from v1 to v2, see the following steps.

Namespace

The overlay-package-namespace option has been removed in favor of using snowfall.namespace.

inputs.snowfall-lib.mkFlake {
# Before:
# overlay-package-namespace = "my-namespace";
# After:
snowfall.namespace = "my-namespace";
}

In addition, packages and your flake library now default to the internal namespace. This means that any internal flake packages or library helpers must be accessed via this namespace.

let
my-lib = lib.${namespace};
my-pkgs = pkgs.${namespace};
in
...

Aliases

Output aliases are no longer automatically remapped from strings returned from outputs-builder. Instead, use the new alias option to configure aliases.

inputs.snowfall-lib.mkFlake {
# Before:
# outputs-builder = channels: {
# packages.default = "my-package";
# };
# After:
alias.packages.default = "my-package";
}

Modules

Multiple types of modules are now supported, including nix-darwin and Home-Manager. When upgrading to Snowfall Lib v2, you will need to move your existing modules into modules/nixos in order to continue using them. Darwin and Home-Manager modules can be placed in modules/darwin and modules/home-manager respectively.

External Modules

Modules must now be added to a specific system or system type. Previously Snowfall Lib assumed modules were all compatible NixOS modules. This has been extended to also support Darwin modules.

my-input.nixosModules.my-module
inputs.snowfall-lib.mkFlake {
# Before:
# systems.modules = with inputs; [
# };
# After:
systems.modules.nixos = with inputs; [
my-input.nixosModules.my-module
};
systems.modules.darwin = with inputs; [
my-input.darwinModules.my-module
};
}

lib.snowfall.*

The default arguments for many functions (particularly modules and system) have been updated to support multiple different platforms like Darwin and Home Manager. Please verify that you are now expecting to use the most recent, new structure imposed by Snowfall Lib.