Update docker/podman config
This commit is contained in:
parent
d703b4dec0
commit
0c1291d3fd
7 changed files with 85 additions and 72 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
options,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
@ -41,7 +40,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
extraOptions = lib.mkIf (options ? config.sops.secrets.access.path) ''
|
extraOptions = lib.mkIf (config ? sops.secrets && config.sops.secrets ? access.path) ''
|
||||||
!include ${config.sops.secrets.access.path}
|
!include ${config.sops.secrets.access.path}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
79
modules/programs/containers.nix
Normal file
79
modules/programs/containers.nix
Normal file
|
|
@ -0,0 +1,79 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
options,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
options.mods.containers = {
|
||||||
|
variant = lib.mkOption {
|
||||||
|
default = "";
|
||||||
|
example = "podman";
|
||||||
|
type = lib.types.enum [
|
||||||
|
""
|
||||||
|
"podman"
|
||||||
|
"docker"
|
||||||
|
];
|
||||||
|
description = "Enables and configures a containerization solution: podman/docker";
|
||||||
|
};
|
||||||
|
podmanPackages = lib.mkOption {
|
||||||
|
default = with pkgs; [
|
||||||
|
podman-tui
|
||||||
|
podman-compose
|
||||||
|
];
|
||||||
|
example = [ ];
|
||||||
|
type = with lib.types; listOf package;
|
||||||
|
description = "Podman packages";
|
||||||
|
};
|
||||||
|
dockerPackages = lib.mkOption {
|
||||||
|
default = with pkgs; [
|
||||||
|
docker-compose
|
||||||
|
];
|
||||||
|
example = [ ];
|
||||||
|
type = with lib.types; listOf package;
|
||||||
|
description = "Docker packages";
|
||||||
|
};
|
||||||
|
combinedPackages = lib.mkOption {
|
||||||
|
default = with pkgs; [
|
||||||
|
dive
|
||||||
|
];
|
||||||
|
example = [ ];
|
||||||
|
type = with lib.types; listOf package;
|
||||||
|
description = "Container packages";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = (
|
||||||
|
lib.optionalAttrs (options ? environment.systemPackages) {
|
||||||
|
environment.systemPackages =
|
||||||
|
(lib.lists.optionals (
|
||||||
|
config.mods.containers.variant == "podman"
|
||||||
|
) config.mods.containers.podmanPackages)
|
||||||
|
++ (lib.lists.optionals (
|
||||||
|
config.mods.containers.variant == "docker"
|
||||||
|
) config.mods.containers.dockerPackages)
|
||||||
|
++ (lib.lists.optionals (
|
||||||
|
config.mods.containers.variant == "podman" || config.mods.containers.variant == "docker"
|
||||||
|
) config.mods.containers.combinedPackages);
|
||||||
|
virtualisation =
|
||||||
|
if (config.mods.containers.variant == "podman") then
|
||||||
|
{
|
||||||
|
containers.enable = true;
|
||||||
|
podman = {
|
||||||
|
enable = true;
|
||||||
|
dockerCompat = true;
|
||||||
|
defaultNetwork.settings.dns_enabled = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else if (config.mods.containers.variant == "docker") then
|
||||||
|
{
|
||||||
|
containers.enable = true;
|
||||||
|
docker = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ };
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
./bluetooth.nix
|
./bluetooth.nix
|
||||||
./browser
|
./browser
|
||||||
./coding.nix
|
./coding.nix
|
||||||
|
./containers.nix
|
||||||
./drives.nix
|
./drives.nix
|
||||||
./fish.nix
|
./fish.nix
|
||||||
./flatpak.nix
|
./flatpak.nix
|
||||||
|
|
@ -22,12 +23,11 @@
|
||||||
./keepassxc.nix
|
./keepassxc.nix
|
||||||
./kitty.nix
|
./kitty.nix
|
||||||
./media.nix
|
./media.nix
|
||||||
|
./mime.nix
|
||||||
./ncspot.nix
|
./ncspot.nix
|
||||||
./nextcloud.nix
|
./nextcloud.nix
|
||||||
./oxi
|
./oxi
|
||||||
./piper.nix
|
./piper.nix
|
||||||
./podman.nix
|
|
||||||
./docker.nix
|
|
||||||
./printing.nix
|
./printing.nix
|
||||||
./scripts.nix
|
./scripts.nix
|
||||||
./sddm.nix
|
./sddm.nix
|
||||||
|
|
@ -36,7 +36,6 @@
|
||||||
./stylix.nix
|
./stylix.nix
|
||||||
./teams.nix
|
./teams.nix
|
||||||
./virtualbox.nix
|
./virtualbox.nix
|
||||||
./mime.nix
|
|
||||||
./xkb.nix
|
./xkb.nix
|
||||||
./xone.nix
|
./xone.nix
|
||||||
./yazi
|
./yazi
|
||||||
|
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
options,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
# TODO make exclusive with docker
|
|
||||||
options.mods.docker = {
|
|
||||||
enable = lib.mkOption {
|
|
||||||
default = false;
|
|
||||||
example = false;
|
|
||||||
type = lib.types.bool;
|
|
||||||
description = "Enables and configures docker";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
config = lib.mkIf config.mods.docker.enable (
|
|
||||||
lib.optionalAttrs (options ? virtualisation.docker) {
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
docker-compose
|
|
||||||
dive
|
|
||||||
];
|
|
||||||
virtualisation = {
|
|
||||||
containers.enable = true;
|
|
||||||
docker = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -64,6 +64,8 @@
|
||||||
abbr --add cat 'bat'
|
abbr --add cat 'bat'
|
||||||
abbr --add find 'fd'
|
abbr --add find 'fd'
|
||||||
abbr --add rm 'rip'
|
abbr --add rm 'rip'
|
||||||
|
abbr --add cp 'fcp'
|
||||||
|
abbr --add cd 'z'
|
||||||
|
|
||||||
set fish_greeting
|
set fish_greeting
|
||||||
# pwd based on the value of _ZO_RESOLVE_SYMLINKS.
|
# pwd based on the value of _ZO_RESOLVE_SYMLINKS.
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,6 @@
|
||||||
if config.mods.homePackages.useDefaultPackages then
|
if config.mods.homePackages.useDefaultPackages then
|
||||||
with pkgs;
|
with pkgs;
|
||||||
[
|
[
|
||||||
# TODO add fcp once fixed....
|
|
||||||
(lib.mkIf config.mods.homePackages.ncspot ncspot)
|
(lib.mkIf config.mods.homePackages.ncspot ncspot)
|
||||||
(lib.mkIf config.mods.homePackages.vesktop vesktop)
|
(lib.mkIf config.mods.homePackages.vesktop vesktop)
|
||||||
(lib.mkIf config.mods.homePackages.nextcloudClient nextcloud-client)
|
(lib.mkIf config.mods.homePackages.nextcloudClient nextcloud-client)
|
||||||
|
|
@ -120,6 +119,7 @@
|
||||||
pulseaudio
|
pulseaudio
|
||||||
libsForQt5.qt5ct
|
libsForQt5.qt5ct
|
||||||
qt6ct
|
qt6ct
|
||||||
|
fcp
|
||||||
ripgrep
|
ripgrep
|
||||||
rm-improved
|
rm-improved
|
||||||
system-config-printer
|
system-config-printer
|
||||||
|
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
options,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
options.mods.podman = {
|
|
||||||
enable = lib.mkOption {
|
|
||||||
default = true;
|
|
||||||
example = false;
|
|
||||||
type = lib.types.bool;
|
|
||||||
description = "Enables and configures podman";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
config = lib.mkIf config.mods.podman.enable (
|
|
||||||
lib.optionalAttrs (options ? virtualisation.podman) {
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
podman-tui
|
|
||||||
podman-compose
|
|
||||||
dive
|
|
||||||
];
|
|
||||||
virtualisation = {
|
|
||||||
containers.enable = true;
|
|
||||||
podman = {
|
|
||||||
enable = true;
|
|
||||||
dockerCompat = true;
|
|
||||||
defaultNetwork.settings.dns_enabled = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue