NixOS Containers: Difference between revisions

m Resolving https://wiki.nixos.org/wiki/Talk:NixOS_Containers#when_using_nftables
DHCP (talk | contribs)
m update system.stateVersion to 26.05
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:


See [[Docker]] page for OCI container (Docker, Podman) configuration.
See [[Docker]] page for OCI container (Docker, Podman) configuration.
=== Host Configuration ===
For all of the examples below to work, you'll have to enable virtualization and the use of containers in your host systems nix configuration.
{{file|3=boot.enableContainers = true;
virtualisation.containers.enable = true;|name=/etc/nixos/configuration.nix|lang=nix}}


=== Configuration ===
=== Configuration ===
Line 44: Line 39:
     services.resolved.enable = true;
     services.resolved.enable = true;


     system.stateVersion = "24.11";
     system.stateVersion = "26.05";
   };
   };
};|name=/etc/nixos/configuration.nix|lang=nix}}
};|name=/etc/nixos/configuration.nix|lang=nix}}
Line 292: Line 287:
     { config, pkgs, lib, ... }:
     { config, pkgs, lib, ... }:
     {
     {
       system.stateVersion = "25.11";
       system.stateVersion = "26.05";
        
        
       networking = {
       networking = {
Line 327: Line 322:
       };
       };
        
        
       system.stateVersion = "25.11";
       system.stateVersion = "26.05";
        
        
       networking = {
       networking = {