commit 975e039ce3bd4174154a272fb4c48c61253670f3 Author: Manu Date: Mon Feb 24 10:39:27 2020 +0100 Create an initial configuration This is a NixOS system definition for a minimal working system with only an SSH server. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..577b0a0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +hardware-configuration.nix diff --git a/README.md b/README.md new file mode 100644 index 0000000..b6ca1f2 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +Configuration for my VPS +======================== + +This is the configuration for my virtual private server on +[OVH](https://www.ovh.com/). The system is managed using +[NixOS](https://nixos.org/). + +From Debian to NixOS +-------------------- + +Out of the box, the server came with a Debian 10 installation, OVH does not +offer NixOS as an option for their servers. The part of the dicumentation on +[Installing from another Linux +distribution](https://nixos.org/nixos/manual/index.html#sec-installing-from-other-distro) +on the same partition did work fine. The call to `nixos-generate-config` made +an initial configuration with `extlinux` as the boot loader but the VPS +actually uses Grub. diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..b1d8972 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,54 @@ +# The is the system definition for vps749417.ovh.net. + +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Boot loader + boot.loader = { + grub = { + enable = true; + device = "/dev/sda"; + }; + }; + + # Network configuration + networking = { + hostName = "vps749417"; + useDHCP = false; + interfaces.ens3.useDHCP = true; + }; + + # Time zone + time.timeZone = "Europe/Paris"; + + # Packages installed in system profile + environment.systemPackages = with pkgs; [ + git htop tmux vim wget + ]; + + # OpenSSH daemon + services.openssh = { + enable = true; + passwordAuthentication = false; + }; + + # Initial user account + users.users.manu = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + initialHashedPassword = "$6$40/yq55oyhD2MhbS$fox2DB5Aj4EpbQAx8z6FYEh3Jl3HKa7aHlGbijJukWxOpXIlKqNucBA8Eene7SaUQzHpvrhke9EFZIRxZpl5F/"; + }; + + # This value determines the NixOS release with which your system is to be + # compatible, in order to avoid breaking some software such as database + # servers. You should change this only after NixOS release notes say you + # should. + system.stateVersion = "19.09"; # Did you read the comment? + +} +