Modularizing system configuration #3

Merged
wymiller merged 10 commits from modular into master 2024-12-27 00:27:25 -06:00
5 changed files with 39 additions and 47 deletions
Showing only changes of commit b6653cee0b - Show all commits

View File

@ -1,4 +1,8 @@
{...}: {
{
pkgs,
lib,
...
}: {
imports = [
./core.nix
./fonts.nix

View File

@ -1,14 +1,14 @@
{
pkgs,
lib,
...
}: {
fonts.packages = with pkgs;
[
noto-fonts
noto-fonts-emoji
liberation_ttf
noto-fonts-cjk
monaspace
]
++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts);
fonts.packages = with pkgs; [
nerdfonts
noto-fonts
noto-fonts-emoji
liberation_ttf
noto-fonts-cjk-sans
monaspace
];
}

View File

@ -44,7 +44,6 @@
firefox
wttrbar
cliphist
xivlauncher
patchelf
];
@ -108,18 +107,16 @@
powertop.enable = false;
};
podman = {
podman = {
enable = true;
extraPackages = with pkgs; [
docker-credential-helpers
toolbox
cosign
crane
podman-tui
podman-desktop
];
};
containers.podman = {
enable = true;
extraPackages = with pkgs; [
docker-credential-helpers
toolbox
cosign
crane
podman-tui
podman-desktop
];
};
customNetworking = {

View File

@ -168,9 +168,8 @@
system.stateVersion = 5;
containers.podman = {
enable = false;
enable = true;
extraPackages = with pkgs; [
podman
docker-credential-helpers
cosign
crane

View File

@ -4,37 +4,29 @@
pkgs,
...
}: let
cfg = config.containers;
cfg = config.containers.podman;
in {
options.containers = {
podman = {
enable = lib.mkEnableOption "Podman container runtime";
dockerCompat = lib.mkEnableOption "Enable Docker compatibility";
extraPackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [];
description = "Additional packages to install when Podman is enabled";
description = "Additional container-related packages to install";
};
};
};
config = lib.mkIf cfg.enable (lib.attrsets.optionalAttrs (config.nixpkgs.hostPlatform.isLinux) {
virtualisation.podman = {
enable = true;
dockerCompat = cfg.dockerCompat;
enableOnBoot = true;
defaultNetwork.settings.dns_enabled = true;
};
}
// {
environment.systemPackages =
[
pkgs.podman-compose
pkgs.buildah
pkgs.skopeo
pkgs.dive
pkgs.container-diff
]
++ cfg.extraPackages;
});
config = lib.mkIf cfg.enable {
environment.systemPackages =
[
pkgs.podman
pkgs.podman-compose
pkgs.buildah
pkgs.skopeo
pkgs.dive
]
++ cfg.extraPackages;
};
}