Skip to content

Commit

Permalink
passing condition instead of list
Browse files Browse the repository at this point in the history
  • Loading branch information
orzklv committed Jun 30, 2024
1 parent 31a9e95 commit 3baeba5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
20 changes: 9 additions & 11 deletions modules/nixos/boot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@
};
};

mirrors =
lib.mkIf config.boot.bios.mirrors
!= [] {
boot.loader.grub.mirroredBoots = [
{
devices = config.boot.bios.mirrors;
path = "/boot";
}
];
};
mirrors = lib.mkIf (config.boot.bios.mirrors != []) {
boot.loader.grub.mirroredBoots = [
{
devices = config.boot.bios.mirrors;
path = "/boot";
}
];
};

cfg = lib.mkIf config.boot.bios.enable {
boot.loader.grub.enable = true;
Expand Down Expand Up @@ -59,7 +57,7 @@ in {
type = lib.types.bool;
default = false;
description = "Enable UEFI boot.";
};
};
};
};

Expand Down
3 changes: 2 additions & 1 deletion modules/nixos/network.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
}: let
gateway = ip: let
parts = lib.splitString "." ip;
in lib.concatStringsSep "." (lib.take 3 parts ++ ["1"]);
in
lib.concatStringsSep "." (lib.take 3 parts ++ ["1"]);

ipv4 = lib.mkIf config.networking.ipv4.enable {
networking = {
Expand Down

0 comments on commit 3baeba5

Please sign in to comment.