From db939b54f6e3bda159ae3cc51c42249450f3d363 Mon Sep 17 00:00:00 2001 From: Craige McWhirter Date: Thu, 12 Sep 2019 09:04:13 +1000 Subject: [PATCH] Provided a VM to spin up and test Vim in --- applications/editors/vim_vm.nix | 67 +++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 applications/editors/vim_vm.nix diff --git a/applications/editors/vim_vm.nix b/applications/editors/vim_vm.nix new file mode 100644 index 0000000..9d3ccbc --- /dev/null +++ b/applications/editors/vim_vm.nix @@ -0,0 +1,67 @@ +# Nix configuration for a VM to run a custom configured Vim +# +# It is intended as an example of building a VM that builds Vim for testing +# and evaluation purposes. It does not represent a production or secure +# deployment. + +{ config, pkgs, lib, ... }: + +{ + environment = { + systemPackages = with pkgs; [ + ( + import ./vim.nix + ) + ]; + }; + + + networking.hostName = "vim-vm"; # Define your hostname. + + system.stateVersion = "19.03"; # The version of NixOS originally installed + + # Set security options: + security = { + sudo = { + enable = true; # Enable sudo + wheelNeedsPassword = false; # Allow wheel members to run sudo without a passowrd + }; + }; + + networking.firewall.allowedTCPPorts = [ 80 ]; + + # List services that you want to enable: + services.openssh = { + enable = true; # Enable the OpenSSH daemon. + #permitRootLogin = "yes"; # Probably want to change this in production + #challengeResponseAuthentication = true; # Probably want to change this in production + #passwordAuthentication = true; # Probably want to change this in production + openFirewall = true; + hostKeys = [ + { + path = "/etc/ssh/ssh_host_ed25519_key"; # Generate a key for the vm + type = "ed25519"; # Use the current best key type + } + ]; + }; + + # Users of the Vim VM: + users.mutableUsers = false; # Remove any users not defined in here + + users.users.root = { + password = "123456"; # Probably want to change this in production + }; + + # Misc groups: + users.groups.nixos.gid = 1000; + + # NixOS users + users.users.nixos = { + isNormalUser = true; + uid = 1000; + group = "nixos"; + extraGroups = [ "wheel" ]; + password = "123456"; # Probably want to change this in production + }; + +}