Skip to content

Commit

Permalink
fix self stuff in container.nix
Browse files Browse the repository at this point in the history
Signed-off-by: lucasew <lucas59356@gmail.com>
  • Loading branch information
lucasew committed Sep 15, 2024
1 parent b6c6a3c commit b9d325b
Showing 1 changed file with 36 additions and 35 deletions.
71 changes: 36 additions & 35 deletions container.nix
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
{ dockerTools
, python3Packages
, lib
, self
, fontconfig
}:

dockerTools.streamLayeredImage {
name = "fusionsolar-bot";
tag = "${builtins.readFile ./version.txt}-${self.shortRev or self.dirtyShortRev}";
maxLayers = 2;
let
self = dockerTools.streamLayeredImage {
name = "fusionsolar-bot";
tag = "${builtins.readFile ./version.txt}-${self.shortRev or self.dirtyShortRev}";
maxLayers = 2;

contents = [
dockerTools.binSh
(dockerTools.fakeNss.override {
extraPasswdLines = ["user:x:1000:1000:new user:/tmp:/bin/sh"];
extraGroupLines = ["user:x:1000:"];
})
];
contents = [
dockerTools.binSh
(dockerTools.fakeNss.override {
extraPasswdLines = ["user:x:1000:1000:new user:/tmp:/bin/sh"];
extraGroupLines = ["user:x:1000:"];
})
];

extraCommands = ''
mkdir -m777 -p tmp etc dev/shm
'';
extraCommands = ''
mkdir -m777 -p tmp etc dev/shm
'';

uid = 1000;
gid = 1000;
uname = "user";
gname = "user";
uid = 1000;
gid = 1000;
uname = "user";
gname = "user";

config = {
Entrypoint = [
(lib.getExe (python3Packages.callPackage ./package.nix {}))
"--headless"
];
User = "user";
Env = [
"HOME=/tmp"
"LANGUAGE=en_US"
"UID=1000"
"GID=1000"
"TZ=UTC"
"FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf"
"FONTCONFIG_PATH=${fontconfig.out}/etc/fonts/"
];
config = {
Entrypoint = [
(lib.getExe (python3Packages.callPackage ./package.nix {}))
"--headless"
];
User = "user";
Env = [
"HOME=/tmp"
"LANGUAGE=en_US"
"UID=1000"
"GID=1000"
"TZ=UTC"
"FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf"
"FONTCONFIG_PATH=${fontconfig.out}/etc/fonts/"
];
};
};
}
in self

0 comments on commit b9d325b

Please sign in to comment.