Something went wrong. Try again.
Mirror of: https://code.martials.no/martin/nixos-configuration
nix sops hyprland
Something went wrong. Try again.
1.3 kB · 51 lines
Nix
at this-works
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152{ config, lib, pkgs, ...}:let cfg = config.my.virtualisation;in{ options.my.virtualisation = { enable = lib.mkEnableOption "Enable virtualisation"; backend = lib.mkOption { type = lib.types.enum [ "podman" "docker" ]; default = "podman"; description = "The backend to use for virtualisation"; }; };
config = lib.mkIf cfg.enable { virtualisation = { containers.enable = true; podman = lib.mkIf (cfg.backend == "podman") { enable = true; # Create a `docker` alias for podman, to use it as a drop-in replacement dockerCompat = true; # Required for containers under podman-compose to be able to talk to each other. defaultNetwork.settings.dns_enabled = true; }; docker = lib.mkIf (cfg.backend == "docker") { enable = true; # Warning: Changing will cause containers to be inaccessible storageDriver = "btrfs"; rootless = { enable = true; setSocketVariable = true; }; }; };
environment.systemPackages = with pkgs; lib.optionals (cfg.backend == "podman") [ podman-tui # status of containers in the terminal podman-compose # start group of containers for dev ]; };}