Files
chiasson-nix/modules/system/packages.nix
T
2026-05-08 19:05:10 -03:00

52 lines
1.4 KiB
Nix

{ ... }: {
flake.nixosModules.systemPackagesDefaults =
{ config, lib, pkgs, ... }:
let
cfg = config.chiasson.system;
in
{
options.chiasson.system.defaultPackages = {
enabled = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Enable shared default CLI/system package set.";
};
packages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = with pkgs; [
git
wget
unzip
jq
pfetch
];
description = "Default packages to install on all hosts.";
};
};
options.chiasson.system.extraPackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [ ];
description = "Additional packages to install on all hosts.";
};
options.chiasson.system.allowUnfree = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Allow unfree packages from nixpkgs.";
};
config = lib.mkMerge [
(lib.mkIf cfg.defaultPackages.enabled {
environment.systemPackages = cfg.defaultPackages.packages;
})
(lib.mkIf (cfg.extraPackages != [ ]) {
environment.systemPackages = cfg.extraPackages;
})
{
nixpkgs.config.allowUnfree = cfg.allowUnfree;
}
];
};
}