Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
71ef79dd52 | |||
b2c3dba781 |
@ -63,7 +63,7 @@
|
||||
"m3tam3re@m3-kratos-vm" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
||||
extraSpecialArgs = {inherit inputs outputs;};
|
||||
modules = [./home/m3tam3re/m3tam3re.nix];
|
||||
modules = [./home/m3tam3re/m3-kratos.nix];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, lib, outputs, pkgs, ... }: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
outputs,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
nixpkgs = {
|
||||
# You can add overlays here
|
||||
overlays = [
|
||||
@ -29,7 +35,7 @@
|
||||
nix = {
|
||||
package = lib.mkDefault pkgs.nix;
|
||||
settings = {
|
||||
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
warn-dirty = false;
|
||||
};
|
||||
};
|
||||
|
@ -7,6 +7,7 @@
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./extraServices
|
||||
./users
|
||||
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
|
||||
# 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
|
||||
];
|
||||
}
|
Reference in New Issue
Block a user