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
11 changes: 9 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,16 @@ jobs:
- uses: actions/checkout@v6
- run: nix build --print-build-logs .#homeConfigurations.samueles.activationPackage

hm-docker:
hm-docker-x86:
runs-on: ubuntu-24.04
steps:
- uses: cachix/install-nix-action@v31
- uses: actions/checkout@v6
- run: nix build --print-build-logs .#homeConfigurations.agent.activationPackage
- run: nix build --print-build-logs .#homeConfigurations.agent-amd64.activationPackage

hm-docker-arm:
runs-on: ubuntu-24.04-arm
steps:
- uses: cachix/install-nix-action@v31
- uses: actions/checkout@v6
- run: nix build --print-build-logs .#homeConfigurations.agent-arm64.activationPackage
18 changes: 15 additions & 3 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
name: flake.lock
- run: nix build --print-build-logs .#homeConfigurations.samueles.activationPackage

hm-docker:
hm-docker-x86:
needs: lock
runs-on: ubuntu-24.04
steps:
Expand All @@ -64,15 +64,27 @@ jobs:
- uses: actions/download-artifact@v7
with:
name: flake.lock
- run: nix build --print-build-logs .#homeConfigurations.agent.activationPackage
- run: nix build --print-build-logs .#homeConfigurations.agent-amd64.activationPackage

hm-docker-arm:
needs: lock
runs-on: ubuntu-24.04-arm
steps:
- uses: cachix/install-nix-action@v31
- uses: actions/checkout@v6
- uses: actions/download-artifact@v7
with:
name: flake.lock
- run: nix build --print-build-logs .#homeConfigurations.agent-arm64.activationPackage

pr:
needs:
- lock
- nixos
- hm-nixos
- hm-macos
- hm-docker
- hm-docker-x86
- hm-docker-arm
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
Expand Down
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
FROM ubuntu
ARG TARGETARCH
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y curl git sudo xz-utils
RUN useradd -m -s /bin/bash agent \
&& usermod -aG sudo agent \
RUN useradd -m -s /bin/bash agent-${TARGETARCH} \
&& usermod -aG sudo agent-${TARGETARCH} \
&& mkdir -m 0755 /nix \
&& chown agent /nix
USER agent
&& chown agent-${TARGETARCH} /nix
USER agent-${TARGETARCH}
RUN curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install | sh -s -- --no-daemon \
&& mkdir -p ~/.config/nix \
&& echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf
ENV USER=agent
ENV PATH=/home/agent/.nix-profile/bin:$PATH
ENV USER=agent-${TARGETARCH}
ENV PATH=/home/agent-${TARGETARCH}/.nix-profile/bin:$PATH
RUN git clone https://github.com/samestep/env.git ~/github/samestep/env \
&& ln -fsT ~/github/samestep/env ~/.config/home-manager \
&& nix run ~/github/samestep/env#home-manager -- init --switch -b backup
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ ln -fsT ~/github/samestep/env ~/.config/home-manager
nix run ~/github/samestep/env#home-manager -- init --switch --impure
```

## [Docker](docker)
## Docker ([x86](docker-x86) and [ARM](docker-arm))

This repo also contains a dedicated Home Manager config for use in an x86 Ubuntu Docker container; for instance:
This repo also contains dedicated Home Manager configs for use in an Ubuntu Docker container; for instance:

```sh
docker build . -t agent
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
config,
pkgs,
...
}:
{ config, pkgs, ... }:
let
util = import ../../util.nix { inherit config pkgs; };
in
Expand All @@ -13,13 +9,13 @@ in
# # https://nix-community.github.io/home-manager/release-notes.xhtml
stateVersion = "25.11";

username = "agent";
homeDirectory = "/home/agent";
username = "agent-arm64";
homeDirectory = "/home/agent-arm64";

packages = util.packages;

file = util.file // {
".codex/config.toml" = util.symlink "docker/codex/config.toml";
".codex/config.toml" = util.symlink "codex/config.toml";
};
};

Expand Down
25 changes: 25 additions & 0 deletions docker-x86/home-manager/home.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{ config, pkgs, ... }:
let
util = import ../../util.nix { inherit config pkgs; };
in
{
nixpkgs = util.nixpkgs;

home = {
# # https://nix-community.github.io/home-manager/release-notes.xhtml
stateVersion = "25.11";

username = "agent-amd64";
homeDirectory = "/home/agent-amd64";

packages = util.packages;

file = util.file // {
".codex/config.toml" = util.symlink "codex/config.toml";
};
};

programs = util.programs // {
bash.enable = true; # Necessary for aliases and Starship to work.
};
}
14 changes: 12 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,25 @@
};
modules = [ ./ubuntu/home-manager/home.nix ];
};
"agent" = home-manager.lib.homeManagerConfiguration {
"agent-amd64" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [
npc.overlays.default
moss.overlays.default
];
};
modules = [ ./docker/home-manager/home.nix ];
modules = [ ./docker-x86/home-manager/home.nix ];
};
"agent-arm64" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "aarch64-linux";
overlays = [
npc.overlays.default
moss.overlays.default
];
};
modules = [ ./docker-arm/home-manager/home.nix ];
};
};
devShells =
Expand Down