treewide: add and use option nixowos.allowAddingPackages
This commit is contained in:
parent
0144d9667b
commit
b91af8f6f7
5 changed files with 20 additions and 11 deletions
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
|
|
@ -7,4 +8,8 @@
|
|||
./defaults
|
||||
./nvidia.nix
|
||||
];
|
||||
|
||||
options.nixowos = {
|
||||
allowAddingPackages = lib.mkEnableOption "adding to `environment.systemPackages`";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,9 +25,11 @@ in
|
|||
# source: https://nix.dev/manual/nix/2.26/command-ref/new-cli/nix3-store-optimise
|
||||
nix.settings.auto-optimise-store = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
nixd
|
||||
nixfmt
|
||||
];
|
||||
environment.systemPackages =
|
||||
with pkgs;
|
||||
lib.mkIf config.nixowos.allowAddingPackages [
|
||||
nixd
|
||||
nixfmt
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,11 +26,13 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
kdePackages.plasma-keyboard
|
||||
kdePackages.qtvirtualkeyboard
|
||||
wl-clipboard
|
||||
];
|
||||
environment.systemPackages =
|
||||
with pkgs;
|
||||
lib.mkIf config.nixowos.allowAddingPackages [
|
||||
kdePackages.plasma-keyboard
|
||||
kdePackages.qtvirtualkeyboard
|
||||
wl-clipboard
|
||||
];
|
||||
|
||||
environment.interactiveShellInit =
|
||||
lib.mkIf cfg.startOnFirstTTY
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ in
|
|||
nixos-rebuild = /* sh */ "nixos-rebuild --ask-sudo-password";
|
||||
};
|
||||
|
||||
environment.systemPackages = cfg.extraPackages;
|
||||
environment.systemPackages = lib.mkIf config.nixowos.allowAddingPackages cfg.extraPackages;
|
||||
|
||||
# enter dev env on cd
|
||||
programs.direnv = lib.mkDefault {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ in
|
|||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
environment.systemPackages = cfg.extraPackages;
|
||||
environment.systemPackages = lib.mkIf config.nixowos.allowAddingPackages cfg.extraPackages;
|
||||
|
||||
boot.loader.grub = lib.mkDefault {
|
||||
# modern installation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue