Skip to content

Commit 0dfc458

Browse files
authored
feat: loadNixOSRPi function (#129)
1 parent 6b26971 commit 0dfc458

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

lib/default.nix

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,28 @@ let
360360
};
361361
};
362362

363+
loadNixOSRPi =
364+
hostName: path:
365+
let
366+
nixos-raspberrypi =
367+
inputs.nixos-raspberrypi
368+
or (throw ''${path} depends on nixos-raspberrypi. To fix this, add `inputs.nixos-raspberrypi.url = "github:nvmd/nixos-raspberrypi";` to your flake'');
369+
in
370+
{
371+
class = "nixos";
372+
value = nixos-raspberrypi.lib.nixosSystem {
373+
modules = [
374+
perSystemModule
375+
path
376+
]
377+
++ mkHomeUsersModule hostName home-manager.nixosModules.default;
378+
specialArgs = specialArgs // {
379+
inherit hostName;
380+
nixos-raspberrypi = inputs.nixos-raspberrypi;
381+
};
382+
};
383+
};
384+
363385
loadNixDarwin =
364386
hostName: path:
365387
let
@@ -407,6 +429,8 @@ let
407429
loadDefault name (path + "/default.nix")
408430
else if builtins.pathExists (path + "/configuration.nix") then
409431
loadNixOS name (path + "/configuration.nix")
432+
else if builtins.pathExists (path + "/rpi-configuration.nix") then
433+
loadNixOSRPi name (path + "/rpi-configuration.nix")
410434
else if builtins.pathExists (path + "/darwin-configuration.nix") then
411435
loadNixDarwin name (path + "/darwin-configuration.nix")
412436
else if builtins.pathExists (path + "/system-configuration.nix") then

0 commit comments

Comments
 (0)