Skip to content

Commit

Permalink
flake/packages: streamline docker package
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAShelf committed Oct 21, 2023
1 parent 10b3d47 commit 09e60b6
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions flake/packages.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{inputs, ...}: {
perSystem = {
self',
system,
config,
pkgs,
Expand Down Expand Up @@ -32,32 +31,30 @@
default = config.legacyPackages.neovim-nix;

# Publisged docker images
docker-nix = pkgs.dockerTools.buildImage {
name = "docker-nix";
tag = "latest";
created = "now";
docker-nix = let
inherit (pkgs) bash gitFull buildEnv dockerTools;
inherit (config.legacyPackages) neovim-nix;
in
dockerTools.buildImage {
name = "neovim-flake-nix";
tag = "latest";

copyToRoot = pkgs.buildEnv {
name = "image-root";
paths = [config.legacyPackages.neovim-nix];
pathsToLink = ["/bin"];
};

runAsRoot = ''
#!${pkgs.runtimeShell}
useradd neovim
mkdir -p /home/neovim
'';
copyToRoot = buildEnv {
name = "neovim-root";
pathsToLink = ["/bin"];
paths = [
neovim-nix
gitFull
bash
];
};

config = {
Cmd = ["/bin/nvim"];
WorkingDir = "/home/neovim";
Volumes = {"/home/neovim" = {};};
config = {
Cmd = ["${neovim-nix}/bin/nvim"];
WorkingDir = "/home/neovim/demo";
Volumes = {"/home/neovim/demo" = {};};
};
};

diskSize = 512;
buildVMMemorySize = 256;
};
}
// (
if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"])
Expand Down

0 comments on commit 09e60b6

Please sign in to comment.