-
-
Save chrisportela/650f80d18ea48b4c31259ca73b66e8ec to your computer and use it in GitHub Desktop.
Basic configuration for a "base nix" VM instance you can deploy changes on top of
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix | |
]; | |
# Use the systemd-boot EFI boot loader. | |
boot.loader.systemd-boot.enable = true; | |
boot.loader.efi.canTouchEfiVariables = true; | |
nix = { | |
settings = { | |
sandbox = true; | |
trusted-users = [ "root" "@wheel" ]; | |
experimental-features = [ "nix-command" "flakes" ]; | |
}; | |
}; | |
networking.hostName = "nixos-template"; # Define your hostname. | |
environment.systemPackages = with pkgs; [ | |
nixpkgs-fmt | |
curl | |
neovim | |
git | |
parted | |
]; | |
environment.variables = { | |
EDITOR = "vim"; | |
}; | |
services.openssh = { | |
enable = true; | |
openFirewall = true; | |
settings = { | |
#PermitRootLogin = "no"; | |
PasswordAuthentication = false; | |
KexAlgorithms = [ | |
"curve25519-sha256" | |
"curve25519-sha256@libssh.org" | |
"diffie-hellman-group-exchange-sha256" | |
"ecdh-sha2-nistp256" | |
]; | |
}; | |
hostKeys = [ | |
{ | |
type = "rsa"; | |
bits = 4096; | |
path = "/etc/ssh/ssh_host_rsa_key"; | |
} | |
{ | |
type = "ed25519"; | |
path = "/etc/ssh/ssh_host_ed25519_key"; | |
} | |
{ | |
type = "ecdsa"; | |
bits = 256; | |
path = "/etc/ssh/ssh_host_ecdsa_key"; | |
} | |
]; | |
#ports = [ 2222 ]; | |
}; | |
users.users = { | |
cmp = { | |
isNormalUser = true; | |
extraGroups = [ "wheel" ]; | |
packages = [ ]; | |
openssh.authorizedKeys.keys = [ | |
"..." | |
]; | |
}; | |
}; | |
security.sudo.wheelNeedsPassword = true; | |
system.stateVersion = "23.05"; # Did you read the comment? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment