liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

hello-from-qemu.nix (1033B)


      1 { config, pkgs, ... }:
      2 let
      3   svc = config.system.service;
      4 
      5 in
      6 rec {
      7   imports = [
      8     ../modules/network
      9     ../modules/dnsmasq
     10     ../modules/ssh
     11   ];
     12 
     13   hostname = "hello";
     14 
     15   # configure the internal network (LAN) with an address
     16   services.int = svc.network.address.build {
     17     interface = config.hardware.networkInterfaces.lan;
     18     family = "inet";
     19     address = "10.3.0.1";
     20     prefixLength = 16;
     21   };
     22 
     23   services.sshd = svc.ssh.build { };
     24 
     25   users.root = {
     26     # the password is "secret". Use mkpasswd -m sha512crypt to
     27     # create this hashed password string
     28     passwd = "$6$y7WZ5hM6l5nriLmo$5AJlmzQZ6WA.7uBC7S8L4o19ESR28Dg25v64/vDvvCN01Ms9QoHeGByj8lGlJ4/b.dbwR9Hq2KXurSnLigt1W1";
     29   };
     30 
     31   services.dns =
     32     let
     33       interface = services.int;
     34     in
     35     svc.dnsmasq.build {
     36       inherit interface;
     37       ranges = [
     38         "10.3.0.10,10.3.0.240"
     39         "::,constructor:$(output ${interface} ifname),ra-stateless"
     40       ];
     41 
     42       domain = "example.org";
     43     };
     44 
     45   defaultProfile.packages = with pkgs; [
     46     figlet
     47   ];
     48 }