diff --git a/flake/packages.nix b/flake/packages.nix index 95ae6f666..cb46e744f 100644 --- a/flake/packages.nix +++ b/flake/packages.nix @@ -1,6 +1,5 @@ {inputs, ...}: { perSystem = { - self', system, config, pkgs, @@ -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"])