modules: system: packages: make it configurable

This commit is contained in:
Bruno BELANYI 2021-05-29 20:34:38 +02:00
parent 003c08cb09
commit 2d9b11406a

View file

@ -1,9 +1,16 @@
# Common packages
{ config, pkgs, ... }:
{ config, lib, pkgs, ... }:
let
cfg = config.my.system.packages;
in
{
# List packages installed in system profile. To search, run:
# $ nix search wget
options.my.system.packages = with lib; {
enable = my.mkDisableOption "packages configuration";
allowUnfree = my.mkDisableOption "allow unfree packages";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
git
git-crypt
@ -12,12 +19,18 @@
wget
];
programs.vim.defaultEditor = true; # Modal editing is life
programs.zsh = {
programs = {
vim.defaultEditor = true; # Modal editing is life
zsh = {
enable = true; # Use integrations
# Disable global compinit when a user config exists
enableGlobalCompInit = !config.my.home.zsh.enable;
};
};
nixpkgs.config.allowUnfree = true; # Because I don't care *that* much.
nixpkgs.config = {
allowUnfree = cfg.allowUnfree; # Because I don't care *that* much.
};
};
}