Skip to content

Commit

Permalink
wip: test GH action with KVM
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-vtimofeenko committed Mar 22, 2024
1 parent 69a287f commit 6c99166
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions packages/ttydContainer/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,6 @@
let
pkgs = targetPkgs;

fixUpEnv = pkgs.writeShellApplication {
name = "fixup-env";
runtimeInputs = [ pkgs.shadow ];

meta.description = "Performs post-setup updates in the container allowing to use nix command.";

text = ''
mkdir -p /tmp
${pkgs.dockerTools.shadowSetup}
groupadd -r nixbld
for n in $(seq 1 10); do useradd -c "Nix build user $n" -d /var/empty -g nixbld -G nixbld -M -N -r -s "$(command -v nologin)" "nixbld$n"; done
'';
};

nixConfig = pkgs.stdenv.mkDerivation {
name = "nix-conf";
src = ./.;
Expand Down Expand Up @@ -54,7 +39,7 @@ let
moreutils
;
})
++ [ nixConfig fixUpEnv ];
++ [ nixConfig ];
in
pkgs.dockerTools.buildImage {
name = "ttyd-container";
Expand Down Expand Up @@ -91,7 +76,13 @@ pkgs.dockerTools.buildImage {
TODO: try with cachix and try with det sys action for the magic cache.
*/
# runAsRoot = "";
runAsRoot = ''
mkdir -p /tmp
${pkgs.dockerTools.shadowSetup}
groupadd -r nixbld
for n in $(seq 1 10); do useradd -c "Nix build user $n" -d /var/empty -g nixbld -G nixbld -M -N -r -s "$(command -v nologin)" "nixbld$n"; done
'';

architecture = "amd64";

Expand Down

0 comments on commit 6c99166

Please sign in to comment.