Skip to content

Commit fa89701

Browse files
Do not overshadow lib in nixosConfigurations output
1 parent c4e4a26 commit fa89701

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

flake.nix

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
inherit system;
8282
overlays = [ self.overlay ];
8383
};
84+
85+
inherit (pkgs) lib;
8486
in {
8587
build-microvm = pkgs.callPackage ./pkgs/build-microvm.nix { inherit self; };
8688
doc = pkgs.callPackage ./pkgs/doc.nix { };
@@ -112,7 +114,7 @@
112114
name = builtins.replaceStrings [ "${system}-" ] [ "" ] systemName;
113115
inherit (nixos.config.microvm) hypervisor;
114116
in
115-
if nixos.pkgs.stdenv.hostPlatform.system == nixpkgs.lib.replaceString "-darwin" "-linux" system
117+
if nixos.pkgs.stdenv.hostPlatform.system == lib.replaceString "-darwin" "-linux" system
116118
then result // {
117119
"${name}" = nixos.config.microvm.runner.${hypervisor};
118120
}
@@ -151,15 +153,17 @@
151153

152154
nixosConfigurations =
153155
let
156+
inherit (nixpkgs) lib;
157+
154158
hypervisorsWith9p = [
155159
"qemu"
156160
# currently broken:
157161
# "crosvm"
158162
];
159163
hypervisorsWithUserNet = [ "qemu" "kvmtool" ];
160164
makeExample = { system, hypervisor, config ? {} }:
161-
nixpkgs.lib.nixosSystem {
162-
system = nixpkgs.lib.replaceString "-darwin" "-linux" system;
165+
lib.nixosSystem {
166+
system = lib.replaceString "-darwin" "-linux" system;
163167

164168
modules = [
165169
self.nixosModules.microvm
@@ -214,7 +218,7 @@
214218
inherit system hypervisor;
215219
};
216220
} //
217-
nixpkgs.lib.optionalAttrs (builtins.elem hypervisor self.lib.hypervisorsWithNetwork) {
221+
lib.optionalAttrs (builtins.elem hypervisor self.lib.hypervisorsWithNetwork) {
218222
"${system}-${hypervisor}-example-with-tap" = makeExample {
219223
inherit system hypervisor;
220224
config = _: {

0 commit comments

Comments
 (0)