Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d2e35626d2 |
@@ -1,6 +1,8 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./program_list.nix
|
||||
|
||||
./audio
|
||||
./browsers
|
||||
./development
|
||||
|
||||
27
modules/programs/program_list.nix
Normal file
27
modules/programs/program_list.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ config, pkgs, lib, ...}:
|
||||
let
|
||||
addProgram = name: requiredCapabilities: extraConfig: {
|
||||
options.custom.programs_list.${name} = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable ${name}";
|
||||
};
|
||||
|
||||
config = lib.mkIf
|
||||
(
|
||||
(config.custom.programs.${name} or false)
|
||||
&& (builtins.all (capability: config.capabilities.${capability}.available or false) requiredCapabilities)
|
||||
)
|
||||
(
|
||||
{ environment.systemPackages = [ pkgs.${name} ]; }
|
||||
// extraConfig
|
||||
);
|
||||
};
|
||||
|
||||
firefox = addProgram "firefox" [ "display" ];
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
firefox
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user