refactor: use lib.optionals instead of if...then...else...

This commit is contained in:
Ryan Yin
2024-03-08 22:53:49 +08:00
parent 54c2240be6
commit 3247e4a8e6
5 changed files with 129 additions and 136 deletions

View File

@@ -1,4 +1,8 @@
{pkgs, ...}: {
{
lib,
pkgs,
...
}: {
home.packages = with pkgs;
[
# general tools
@@ -26,12 +30,10 @@
aliyun-cli
]
++ (
if pkgs.stdenv.isLinux
then [
lib.optionals pkgs.stdenv.isLinux [
# cloud tools that nix do not have cache for.
terraform
terraformer # generate terraform configs from existing cloud resources
]
else []
);
}