This commit is contained in:
m3tam3re 2024-09-21 16:59:39 +02:00
parent 6a0334cd38
commit b2c3dba781
7 changed files with 67 additions and 1 deletions

View File

@ -7,6 +7,7 @@
... ...
}: { }: {
imports = [ imports = [
./extraServices
./users ./users
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
]; ];

View File

@ -0,0 +1,5 @@
{
imports = [
./podman.nix
];
}

View File

@ -0,0 +1,32 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.extraServices.podman;
in {
options.extraServices.podman.enable = mkEnableOption "enable podman";
config = mkIf cfg.enable {
virtualisation = {
podman = {
enable = true;
dockerCompat = true;
autoPrune = {
enable = true;
dates = "weekly";
flags = [
"--filter=until=24h"
"--filter=label!=important"
];
};
defaultNetwork.settings.dns_enabled = true;
};
};
environment.systemPackages = with pkgs; [
podman-compose
];
};
}

View File

@ -33,5 +33,11 @@
#:w #:w
# networking.hostName = "nixos"; # Define your hostname. # networking.hostName = "nixos"; # Define your hostname.
{ {
imports = [../common ./configuration.nix]; imports = [
../common
./configuration.nix
./services
];
extraServices.podman.enable = true;
} }

View File

@ -0,0 +1,5 @@
{
imports = [
./echo.nix
];
}

View File

@ -0,0 +1,12 @@
{lib, ...}: {
virtualisation.oci-containers.containers."echo-http-service" = {
image = "hashicorp/http-echo";
extraOptions = ["-text='Hello, World!'" "--network=web"];
ports = ["5678:5678"];
};
system.activationScripts.createPodmanNetworkWeb = lib.mkAfter ''
if ! /run/current-system/sw/bin/podman network exists web; then
/run/current-system/sw/bin/podman network create web
fi
'';
}

View File

@ -0,0 +1,5 @@
{
imports = [
./containers
];
}