Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion home/core/docker.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{ pkgs, ... }:
{
# Dockerクライアント設定(~/.docker/config.jsonとDOCKER_CONFIG)を
# home-managerで宣言的に管理する。
# このモジュールはパッケージを入れないのでdocker-clientは別途入れる。
# config.jsonがNixストアへの読み取り専用リンクになるため、
# docker loginが必要になったらsettings.credsStoreでcredential helperを宣言する。
programs.docker-cli.enable = true;

home.packages = with pkgs; [
act
docker-client
docker-client # clientOnlyなdockerパッケージ。buildx(BuildKit)とcomposeプラグイン同梱。
docker-compose-language-service
dockerfile-language-server
hadolint
Expand Down
15 changes: 15 additions & 0 deletions nixos/native-linux/docker.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ username, ... }:
{
# rootless Dockerを使う。
# 常時rootで動くデーモンを避けるため。
# podmanではなくDockerなのはBuildKitがそのまま動いてほしいから。
# nixpkgsのdockerパッケージはbuildx(BuildKit)とcomposeプラグインを同梱している。
virtualisation.docker.rootless = {
Comment thread
ncaq marked this conversation as resolved.
enable = true;
# DOCKER_HOSTをrootlessソケット(unix://$XDG_RUNTIME_DIR/docker.sock)に向ける。
setSocketVariable = true;
};
Comment thread
ncaq marked this conversation as resolved.

# rootlessコンテナ内のuid/gidマッピングに必要なsubuid/subgidを自動割り当てする。
users.users.${username}.autoSubUidGidRange = true;
}
Loading