liminix

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

configuration.nix (980B)


      1 { config, pkgs, lib, ... } :
      2 let
      3   inherit (pkgs) dropbear;
      4   inherit (pkgs.pseudofile) dir symlink;
      5   inherit (pkgs.liminix.services) oneshot longrun bundle target;
      6   inherit
      7     (pkgs.liminix.networking)
      8     address
      9     udhcpc
     10     interface
     11     route
     12   ;
     13 in {
     14   imports = [
     15     ../../vanilla-configuration.nix
     16     ../../modules/outputs/jffs2.nix
     17   ];
     18   config =  {
     19     services.sshd = longrun {
     20       name = "sshd";
     21       run = ''
     22       mkdir -p /run/dropbear
     23       ${dropbear}/bin/dropbear -E -P /run/dropbear.pid -R -F
     24     '';
     25     };
     26 
     27     users.root = {
     28       passwd = lib.mkForce "$6$GYDbeLSyoIdgDdZW$EXlz4oI7Jz1igSYd4cxwcWR4lqEc5AWdGWuPuBarQeUskFQsBCpPc0GgIPPDl1k7SgrnC82JzSWxvx5o0bvmx/";
     29       openssh.authorizedKeys.keys = [
     30         (builtins.readFile ./id.pub)
     31       ];
     32     };
     33 
     34     rootfsType = "jffs2";
     35     services.default = lib.mkForce (target {
     36       name = "default";
     37       contents = with config.services; [ loopback ntp defaultroute4 sshd dhcpv4 ];
     38     });
     39   };
     40 }