Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/welteki/nixos-lxd-container
Run a NixOS lxd container
https://github.com/welteki/nixos-lxd-container
Last synced: 28 days ago
JSON representation
Run a NixOS lxd container
- Host: GitHub
- URL: https://github.com/welteki/nixos-lxd-container
- Owner: welteki
- Created: 2021-07-06T10:23:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-01T10:41:34.000Z (almost 2 years ago)
- Last Synced: 2024-08-08T18:22:37.998Z (3 months ago)
- Language: Nix
- Size: 6.84 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starred - welteki/nixos-lxd-container - Run a NixOS lxd container (others)
README
# NixOS LXD Containers
Run NixOS containers in lxd.This flake provides a configuration to build a NixOS image for use with LXD.
> The configuration takes some settings from [this pull request](https://github.com/NixOS/nixpkgs/pull/120965) by [mkg20001](https://github.com/mkg20001) awaiting its merge.
## Prerequisites
- Install [nixos-generators](https://github.com/nix-community/nixos-generators):
```
nix shell github:nix-community/nixos-generators
```
- Enable lxd by adding `virtualisation.lxd.enable = true;` to your NixOS configuration.## Running a NixOS container
Generate an image for lxd:
```
lxc image import --alias nixos \
$(nixos-generate -f lxc-metadata) \
$(nixos-generate --flake github:welteki/nixos-lxd-container#lxc -f lxc)
```Launch a container:
```
lxc launch nixos nixos-container -c security.nesting=true
```Access its root shell:
```
lxc exec nixos-container bash
```