Refactor additional packages
This commit is contained in:
parent
2e90a3b7a1
commit
b83ccc7bfe
3 changed files with 161 additions and 86 deletions
|
|
@ -26,16 +26,30 @@
|
||||||
Note that these are installed even if base packages is disabled, e.g. you can also use this as the only packages to install.
|
Note that these are installed even if base packages is disabled, e.g. you can also use this as the only packages to install.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
special_programs = lib.mkOption {
|
||||||
|
default = { };
|
||||||
|
example = { };
|
||||||
|
type = with lib.types; attrsOf anything;
|
||||||
|
description = ''
|
||||||
|
special program configuration to be added which require programs.something notation.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
special_services = lib.mkOption {
|
||||||
|
default = { };
|
||||||
|
example = { };
|
||||||
|
type = with lib.types; attrsOf anything;
|
||||||
|
description = ''
|
||||||
|
special services configuration to be added which require an services.something notation.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = (
|
config = lib.optionalAttrs (options ? environment.systemPackages) {
|
||||||
lib.optionalAttrs (options ? environment.systemPackages) {
|
environment.systemPackages =
|
||||||
environment.systemPackages = config.mods.base_packages.additional_packages;
|
if config.mods.base_packages.enable then
|
||||||
}
|
with pkgs;
|
||||||
// (lib.mkIf config.mods.base_packages.enable (
|
[
|
||||||
lib.optionalAttrs (options ? environment.systemPackages) {
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
adwaita-icon-theme
|
adwaita-icon-theme
|
||||||
dbus
|
dbus
|
||||||
dconf
|
dconf
|
||||||
|
|
@ -58,10 +72,15 @@
|
||||||
seahorse
|
seahorse
|
||||||
upower
|
upower
|
||||||
xorg.xkbutils
|
xorg.xkbutils
|
||||||
];
|
]
|
||||||
|
++ config.mods.base_packages.additional_packages
|
||||||
|
else
|
||||||
|
config.mods.base_packages.additional_packages;
|
||||||
|
|
||||||
gtk.iconCache.enable = false;
|
gtk.iconCache.enable = false;
|
||||||
services = {
|
services =
|
||||||
|
if config.mods.base_packages.enable then
|
||||||
|
{
|
||||||
upower.enable = true;
|
upower.enable = true;
|
||||||
dbus = {
|
dbus = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -72,9 +91,14 @@
|
||||||
nssmdns4 = true;
|
nssmdns4 = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
// config.mods.base_packages.special_services
|
||||||
|
else
|
||||||
|
config.mods.base_packages.special_services;
|
||||||
|
|
||||||
programs = {
|
programs =
|
||||||
|
if config.mods.base_packages.enable then
|
||||||
|
{
|
||||||
nix-ld = {
|
nix-ld = {
|
||||||
enable = true;
|
enable = true;
|
||||||
libraries = with pkgs; [
|
libraries = with pkgs; [
|
||||||
|
|
@ -94,8 +118,10 @@
|
||||||
};
|
};
|
||||||
ssh.startAgent = true;
|
ssh.startAgent = true;
|
||||||
gnupg.agent.enable = true;
|
gnupg.agent.enable = true;
|
||||||
};
|
|
||||||
}
|
}
|
||||||
))
|
// config.mods.base_packages.special_programs
|
||||||
);
|
else
|
||||||
|
config.mods.base_packages.special_programs;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,22 @@
|
||||||
Will be installed regardless of default home manager packages are installed.
|
Will be installed regardless of default home manager packages are installed.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
special_programs = lib.mkOption {
|
||||||
|
default = { };
|
||||||
|
example = { };
|
||||||
|
type = with lib.types; attrsOf anything;
|
||||||
|
description = ''
|
||||||
|
special program configuration to be added which require programs.something notation.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
special_services = lib.mkOption {
|
||||||
|
default = { };
|
||||||
|
example = { };
|
||||||
|
type = with lib.types; attrsOf anything;
|
||||||
|
description = ''
|
||||||
|
special services configuration to be added which require an services.something notation.
|
||||||
|
'';
|
||||||
|
};
|
||||||
matrixClient = lib.mkOption {
|
matrixClient = lib.mkOption {
|
||||||
default = pkgs.nheko;
|
default = pkgs.nheko;
|
||||||
example = null;
|
example = null;
|
||||||
|
|
@ -59,13 +75,9 @@
|
||||||
description = "Additional browser -> second to firefox, the only installed browser if firefox is disabled";
|
description = "Additional browser -> second to firefox, the only installed browser if firefox is disabled";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config =
|
config = lib.optionalAttrs (options ? home.packages) {
|
||||||
(lib.optionalAttrs (options ? home.packages) {
|
|
||||||
home.packages = config.mods.home_packages.additional_packages;
|
|
||||||
})
|
|
||||||
// lib.mkIf config.mods.home_packages.useDefaultPackages (
|
|
||||||
lib.optionalAttrs (options ? home.packages) {
|
|
||||||
home.packages =
|
home.packages =
|
||||||
|
if config.mods.home_packages.useDefaultPackages then
|
||||||
with pkgs;
|
with pkgs;
|
||||||
[
|
[
|
||||||
# TODO add fcp once fixed....
|
# TODO add fcp once fixed....
|
||||||
|
|
@ -107,14 +119,24 @@
|
||||||
zenith
|
zenith
|
||||||
zoxide
|
zoxide
|
||||||
]
|
]
|
||||||
++ config.mods.home_packages.additional_packages;
|
++ config.mods.home_packages.additional_packages
|
||||||
|
else
|
||||||
|
config.mods.home_packages.additional_packages;
|
||||||
|
|
||||||
xdg.configFile."direnv/direnv.toml".source = (pkgs.formats.toml { }).generate "direnv" {
|
xdg.configFile."direnv/direnv.toml".source = (pkgs.formats.toml { }).generate "direnv" {
|
||||||
global = {
|
global = {
|
||||||
warn_timeout = "-1s";
|
warn_timeout = "-1s";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
programs =
|
||||||
}
|
if config.mods.home_packages.useDefaultPackages then
|
||||||
);
|
config.mods.home_packages.special_programs
|
||||||
|
else
|
||||||
|
config.mods.home_packages.special_programs;
|
||||||
|
services =
|
||||||
|
if config.mods.home_packages.useDefaultPackages then
|
||||||
|
config.mods.home_packages.special_services
|
||||||
|
else
|
||||||
|
config.mods.home_packages.special_services;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,28 @@
|
||||||
Additional media packages.
|
Additional media packages.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
special_programs = lib.mkOption {
|
||||||
|
default = { };
|
||||||
|
example = { };
|
||||||
|
type = with lib.types; attrsOf anything;
|
||||||
|
description = ''
|
||||||
|
special program configuration to be added which require programs.something notation.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
config = (
|
special_services = lib.mkOption {
|
||||||
lib.optionalAttrs (options ? home.packages) {
|
default = { };
|
||||||
home.packages = config.mods.media.additionalPackages;
|
example = { };
|
||||||
}
|
type = with lib.types; attrsOf anything;
|
||||||
// (lib.mkIf config.mods.media.useBasePackages (
|
description = ''
|
||||||
lib.optionalAttrs (options ? home.packages) {
|
special services configuration to be added which require an services.something notation.
|
||||||
home.packages = with pkgs; [
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = lib.optionalAttrs (options ? home.packages) {
|
||||||
|
home.packages =
|
||||||
|
if config.mods.media.useBasePackages then
|
||||||
|
with pkgs;
|
||||||
|
[
|
||||||
# base audio
|
# base audio
|
||||||
pipewire
|
pipewire
|
||||||
wireplumber
|
wireplumber
|
||||||
|
|
@ -54,10 +68,23 @@
|
||||||
gimp
|
gimp
|
||||||
krita
|
krita
|
||||||
yt-dlp
|
yt-dlp
|
||||||
];
|
]
|
||||||
programs.obs-studio.enable = true;
|
++ config.mods.media.additionalPackages
|
||||||
programs.obs-studio.plugins = with pkgs; [ obs-studio-plugins.obs-vaapi ];
|
else
|
||||||
|
config.mods.media.additionalPackages;
|
||||||
|
programs =
|
||||||
|
if config.mods.media.useBasePackages then
|
||||||
|
{
|
||||||
|
obs-studio.enable = true;
|
||||||
|
obs-studio.plugins = with pkgs; [ obs-studio-plugins.obs-vaapi ];
|
||||||
}
|
}
|
||||||
))
|
// config.mods.media.special_programs
|
||||||
);
|
else
|
||||||
|
config.mods.media.special_programs;
|
||||||
|
services =
|
||||||
|
if config.mods.media.useBasePackages then
|
||||||
|
config.mods.media.special_services
|
||||||
|
else
|
||||||
|
config.mods.media.special_services;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue