Skip to content

Instantly share code, notes, and snippets.

@vizanto
Last active November 26, 2015 20:46
Show Gist options
  • Save vizanto/63022c24fca39d2b85f2 to your computer and use it in GitHub Desktop.
Save vizanto/63022c24fca39d2b85f2 to your computer and use it in GitHub Desktop.
{ config, lib, pkgs, ... }:
{
imports = [ ];
### SmartOS Linux Branded Zone specific configuration
# boot.initrd.availableKernelModules = [ ];
# boot.kernelModules = [ ];
# boot.extraModulePackages = [ ];
nix.extraOptions = ''
build-users-group =
'';
boot.isContainer = true;
boot.postBootCommands = "/lib/smartdc/joyent_rc.local";
networking.useDHCP = false;
networking.firewall.enable = false;
services.nscd.enable = false;
systemd.services.systemd-udevd.unitConfig.ConditionVirtualization = "!other";
systemd.services.smartos-init = {
path = [ pkgs.bash ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = ''/lib/smartdc/joyent_rc.local'';
};
};
fileSystems."/native/lib" =
{ device = "/native/lib";
fsType = "lofs";
};
fileSystems."/native/etc/svc/volatile" =
{ device = "swap";
fsType = "tmpfs";
};
fileSystems."/native/tmp" =
{ device = "swap";
fsType = "tmpfs";
};
fileSystems."/tmp" =
{ device = "swap";
fsType = "tmpfs";
};
fileSystems."/system/object" =
{ device = "objfs";
fsType = "objfs";
};
swapDevices = [ ];
nix.maxJobs = 12;
nix.buildCores = 12;
}
[root@nixos:~]# ls -Al /bin/
total 2
lrwxrwxrwx 1 root root 32 Nov 16 14:12 login -> /run/current-system/sw/bin/login
lrwxrwxrwx 1 root root 63 Nov 22 13:39 sh -> /nix/store/kj6gl6xd81jgigrmq9gjsffmgipafjs4-bash-4.3-p42/bin/sh
-rwxr-xr-x 1 root root 65 Nov 16 21:45 su
[root@nixos:~]# ls -Al /sbin/
total 2
lrwxrwxrwx 1 root root 32 Nov 16 14:14 getty -> /run/current-system/sw/bin/getty
lrwxrwxrwx 1 root root 33 Nov 16 14:17 init -> /nix/var/nix/profiles/system/init
lrwxrwxrwx 1 root root 35 Nov 16 21:39 shutdown -> /run/current-system/sw/bin/shutdown
[root@nixos:~]# cat /bin/su
#!/bin/sh
"$(dirname '$0')/../run/current-system/sw/bin/su" "$@"
[root@nixos:/]# ls -Al usr/
total 1
drwxr-xr-x 2 root root 3 Nov 22 13:39 bin
drwxr-xr-x 2 root root 6 Nov 16 20:02 sbin
[root@nixos:/]# ls -Al usr/*
usr/bin:
total 1
lrwxrwxrwx 1 root root 66 Nov 22 13:39 env -> /nix/store/8xfxnm4a7jvyh0i1sd967z6rws8lh21a-coreutils-8.24/bin/env
usr/sbin:
total 2
lrwxrwxrwx 1 root root 29 Oct 7 14:51 mdata-delete -> /native/usr/sbin/mdata-delete
lrwxrwxrwx 1 root root 26 Oct 7 14:51 mdata-get -> /native/usr/sbin/mdata-get
lrwxrwxrwx 1 root root 27 Oct 7 14:51 mdata-list -> /native/usr/sbin/mdata-list
lrwxrwxrwx 1 root root 26 Oct 7 14:51 mdata-put -> /native/usr/sbin/mdata-put
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment