video8
This commit is contained in:
parent
6a0334cd38
commit
b2c3dba781
@ -7,6 +7,7 @@
|
|||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
|
./extraServices
|
||||||
./users
|
./users
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
];
|
];
|
||||||
|
5
hosts/common/extraServices/default.nix
Normal file
5
hosts/common/extraServices/default.nix
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./podman.nix
|
||||||
|
];
|
||||||
|
}
|
32
hosts/common/extraServices/podman.nix
Normal file
32
hosts/common/extraServices/podman.nix
Normal 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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
@ -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;
|
||||||
}
|
}
|
||||||
|
5
hosts/m3-kratos/services/containers/default.nix
Normal file
5
hosts/m3-kratos/services/containers/default.nix
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./echo.nix
|
||||||
|
];
|
||||||
|
}
|
12
hosts/m3-kratos/services/containers/echo.nix
Normal file
12
hosts/m3-kratos/services/containers/echo.nix
Normal 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
|
||||||
|
'';
|
||||||
|
}
|
5
hosts/m3-kratos/services/default.nix
Normal file
5
hosts/m3-kratos/services/default.nix
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./containers
|
||||||
|
];
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user