the secular bird system: nixos

J

jobinson99

Guest
I have used nixos for about a year. Before it, i had used archlinux for about 8 years and ubuntu about 3years.
The most advantage of the nixos is its safety mechanism. it saves all package in hashed path, and make symbolic link to users' profile. as well, it saves every version of all package installed. as a result, you can roll back to the past version, if you meet a kernel panic.

bye to the update hole of archlinux. bye to the worry of online update for a working server.

It also support multi-version of a package. the coder would take advantage to it. you will never to worry about the mess of you developing environment.

Nixos is built by a configuration file. you can write once and rerbuild as many as you wish.
Code:
[code]
{ config, pkgs, ... }:

{
? imports =
??? [
????? ./hardware-configuration.nix
??? ];
?
? boot.initrd = {
????? availableKernelModules = [
?? ?? "virtio_net" "virtio_pci" "virtio_blk"
?? ?? "virtio_scsi" "9p" "9pnet_virtio"
????? ];
????? kernelModules = [
?? ?? "virtio_balloon" "virtio_console" "virtio_rng"
????? ];
? };
?
? boot.loader.grub ={
?????????????????? enable = true;
?????????????????? version = 2;
?????????????????? device = "/dev/vda";
? };

? networking = {
????? hostName = "devbase";??
????? nameservers = [ "8.8.8.8" "8.8.4.4"];
????? # set the ip
????? localCommands =
????? ''
?? ?ip addr add 10.0.2.100/24 dev eth0
?? ?ip link set dev eth0 up
?? ?ip route add default via 10.0.2.1
????? '';
? };
? ?
? # local
? i18n = {
???? consoleFont = "Lat2-Terminus16";
???? consoleKeyMap = "us";
???? defaultLocale = "en_US.UTF-8";
???? supportedLocales = [ "en_US.UTF-8/UTF-8"
??????????????? "zh_CN.UTF-8/UTF-8"
??????????????? "zh_CN/GB2312"
??????????????? "zh_CN.GBK/GBK"
??????????????? "zh_CN.GB18030/GB18030"
??????????????? "zh_TW.UTF-8/UTF-8" ];??? ?
?? };

? # set the timezone
? time.timeZone = "Asia/Shanghai";

? # software installed
? environment.systemPackages = with pkgs; [
???? wget
?? ];

? services = {
????? # OpenSSH
????? openssh.enable = true;
? };

? # mount v9p file

? fileSystems = [
????? { mountPoint = "/vfs";
??????? device = "host_share";
??????? fsType = "9p";
??????? options = "trans=virtio,version=9p2000.L,nobootwait,rw,_netdev";
????? }
? ];

? # set the user
? users.extraUsers.devdemo = {
????? isNormalUser = true;
????? uid = 1000;
????? group = "users";
????? extraGroups = ["wheel"];
????? home = "/home/devdemo";
????? useDefaultShell = true;
????? initialPassword = "devdemo";
? };

? # set the nixos version
? system.stateVersion = "16.03";

}
[/code]

the below is my basic configuration for my qemu vm
 

sxiii

New member
Thanks for sharing! I've already red some articles about NixOS on some websites and also probably distrowatch, but never tried the distro itself. The reason for this probably was afraid of lacking of packages... Now I believe I should try this distro definetly! :) Will comment my opinion on it later.