Class: OsCtld::DistConfig::Distributions::NixOS
- Inherits:
-
Base
- Object
- Base
- OsCtld::DistConfig::Distributions::NixOS
show all
- Defined in:
- lib/osctld/dist_config/distributions/nixos.rb
Defined Under Namespace
Classes: Configurator
Instance Attribute Summary
Attributes inherited from Base
#configurator, #ct, #ctrc, #distribution, #version
Instance Method Summary
collapse
Methods inherited from Base
#add_netif, #apply_hostname, #configurator_class, distribution, #initialize, #log_type, #network, #passwd, #pre_start, #remove_netif, #rename_netif, #start, #stop, #volatile_is_systemd?, #with_rootfs
#ct_attach, #ct_syscmd
Instance Method Details
#bin_path(_opts) ⇒ Object
75
76
77
78
79
80
81
|
# File 'lib/osctld/dist_config/distributions/nixos.rb', line 75
def bin_path(_opts)
with_rootfs do
File.realpath('/nix/var/nix/profiles/system/sw/bin')
rescue Errno::ENOENT
'/bin'
end
end
|
#dns_resolvers(_opts = {}) ⇒ Object
71
72
73
|
# File 'lib/osctld/dist_config/distributions/nixos.rb', line 71
def dns_resolvers(_opts = {})
super if ct.impermanence.nil? || ct.running?
end
|
#post_mount(opts) ⇒ Object
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/osctld/dist_config/distributions/nixos.rb', line 32
def post_mount(opts)
super
return if ct.impermanence.nil?
ContainerControl::Commands::WithMountns.run!(
ct,
ns_pid: opts[:ns_pid],
chroot: opts[:rootfs_mount],
block: proc do
next if File.exist?('/sbin/init')
begin
Dir.mkdir('/sbin')
rescue Errno::EEXIST
end
File.symlink('/nix/var/nix/profiles/system/init', '/sbin/init')
true
end
)
end
|
#set_hostname(_opts = {}) ⇒ Object
59
60
61
|
# File 'lib/osctld/dist_config/distributions/nixos.rb', line 59
def set_hostname(_opts = {})
log(:warn, 'Unable to apply hostname to NixOS container')
end
|
#unset_etc_hosts(_opts = {}) ⇒ Object
67
68
69
|
# File 'lib/osctld/dist_config/distributions/nixos.rb', line 67
def unset_etc_hosts(_opts = {})
end
|
#update_etc_hosts(_opts = {}) ⇒ Object
63
64
65
|
# File 'lib/osctld/dist_config/distributions/nixos.rb', line 63
def update_etc_hosts(_opts = {})
end
|