-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add feature: containerization #7
Milestone
Comments
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules =
[ ({ pkgs, ... }: {
boot.isContainer = true;
# Let 'nixos-version --json' know about the Git revision
# of this flake.
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
# Network configuration.
networking.useDHCP = false;
networking.firewall.allowedTCPPorts = [ 80 ];
# Enable a web server.
services.httpd = {
enable = true;
adminAddr = "[email protected]";
};
})
];
}; nixos-container create <name> --flake .
nixos-container start <name>
nixos-container run <name> -- uname -a
nixos-container show-ip <name> |
error: syntax error, unexpected '=', expecting ';'
at /nix/store/2yfdc4izlb4820w3l8sdyzjaimkssvmj-source/flake.nix:9:33:
8| outputs = { self, nixpkgs, utils, naersk }:
9| nixosConfigurations.container = nixpkgs.lib.nixosSystem {
| ^
10| system = "x86_64-linux";
|
Closed
fixed in #17 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We typically wrap our applications in a Docker image and deploy to some service that natively runs containers.
... can accept public traffic
... we have root access to via SSH
https://nixos.wiki/wiki/NixOS_Containers
https://nix.dev/tutorials/nixos/building-and-running-docker-images.html
The text was updated successfully, but these errors were encountered: