Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cameronraysmith/nixpod
⎈ containerized multiuser nix 🏘 ❄️
https://github.com/cameronraysmith/nixpod
container-image containerd containers devcontainer devpod dotfiles home-manager k8s kubernetes nix nix-flake oci oci-image
Last synced: 7 days ago
JSON representation
⎈ containerized multiuser nix 🏘 ❄️
- Host: GitHub
- URL: https://github.com/cameronraysmith/nixpod
- Owner: cameronraysmith
- License: agpl-3.0
- Created: 2023-09-06T05:58:57.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-29T17:39:58.000Z (4 months ago)
- Last Synced: 2024-10-29T18:59:17.278Z (4 months ago)
- Topics: container-image, containerd, containers, devcontainer, devpod, dotfiles, home-manager, k8s, kubernetes, nix, nix-flake, oci, oci-image
- Language: Nix
- Homepage:
- Size: 355 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
Using [nix](https://github.com/NixOS/nix), [home-manager](https://github.com/nix-community/home-manager), and [nixpkgs](https://github.com/NixOS/nixpkgs) [dockerTools](https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-dockerTools), [nixpod](https://ghcr.io/cameronraysmith/nixpod) provides a containerized or containerizable drop-in user configuration on any platform where the [nix](https://github.com/NixOS/nix) package manager is already, or can be, [installed](https://nix.dev/install-nix.html). This is intended to include, but is not limited to, scenarios like those involving [kubernetes ephemeral containers](https://kubernetes.io/docs/concepts/workloads/pods/ephemeral-containers/) via images like [netshoot](https://github.com/nicolaka/netshoot), which might be used for debugging purposes adjacent to otherwise minimal container images. See the [github packages associated to this repository](https://github.com/cameronraysmith?tab=packages&repo_name=nixpod) for the containers currently built in the [nixpod CID](https://github.com/cameronraysmith/nixpod/blob/main/.github/workflows/cid.yaml).
This repository originally contained a [nix flake](https://zero-to-nix.com/concepts/flakes) that essentially integrated a few parts of [srid/nixos-config](https://github.com/srid/nixos-config) into [juspay/nix-dev-home](https://github.com/juspay/nix-dev-home). These were merged upstream in [juspay/nix-dev-home#7](https://github.com/juspay/nix-dev-home/pull/7), so you might want to look there.
## Testing
> [!NOTE]
> This repository previously supported building containers exclusively via [Containerfiles](https://github.com/cameronraysmith/nixpod/blob/main/containers/Containerfile.debnix). Currently it uses [pkgs.dockerTools](https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-dockerTools) and the Containerfiles are only retained for comparison. Other excellent tools for building container images with nix that may be supported in the future are [nix2container](https://github.com/nlewo/nix2container) and [nix-snapshotter](https://github.com/pdtpartners/nix-snapshotter).### direnv and dev shell
If you have [direnv](https://github.com/direnv/direnv) installed and configured you probably know what to do. If you do not and you would like to use the [nix dev shell](https://nixos.wiki/wiki/Flakes#Super_fast_nix-shell), which will install [just](https://github.com/casey/just) using nix, you can execute `nix develop`. If the [container `builder` specified in the justfile](justfile) is already installed on your `PATH` with necessary daemon running and available,
```bash
nix develop
just container_command_type="runflake" container-run
```should pull or build the container image in [containers/Containerfile.debnix](./containers/Containerfile.debnix) and run the flake in that image. If you want to force a local rebuild run `just container-build`.
Note that just `just` will print help and you can run `just -n ` first for a dry run.
See comments in the [justfile](justfile) for additional details.### macOS
If you have a container image manager compatible with macOS installed, such as docker or rancher desktop, and you prefer not to use the [nix dev shell](#direnv-and-dev-shell), you can probably (with docker desktop for example)
```bash
open -a Docker
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install just
just container_command_type="runflake" container-run
```however, please see [rust](https://www.rust-lang.org/tools/install) and [just](https://github.com/casey/just#installation) for details if you prefer another installation method like [homebrew](https://formulae.brew.sh/formula/just).
## Experimenting
If you want to simply run a distribution of this flake in a container image, you can execute
```bash
just container_type="container" container_command="zsh" container-run
```### docker
If you're using docker as the `builder`, this will execute a series of commands like
```bash
docker pull ghcr.io/cameronraysmith/nixpod:latest
docker run -it --rm ghcr.io/cameronraysmith/nixpod:latest
```See the [justfile](justfile) for details.
## Acknowledgements
- see credits of [cameronraysmith/nix-config](https://github.com/cameronraysmith/nix-config)
- [cloudwatt/nix-container-images](https://github.com/cloudwatt/nix-container-images)
- [nlewo/nix2container](https://github.com/nlewo/nix2container)
- [DeterminateSystems/nix-installer](https://github.com/DeterminateSystems/nix-installer)
- [pdtpartners/nix-snapshotter](https://github.com/pdtpartners/nix-snapshotter)
- [snowfallorg](https://github.com/snowfallorg)
- [srid/nixos-config](https://github.com/srid/nixos-config)