summaryrefslogtreecommitdiff
path: root/modules/networking
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-01-05 00:15:11 +0100
committerDaiderd Jordan <daiderd@gmail.com>2018-01-05 00:16:09 +0100
commit7eb4e21075843a85ce9d31bbcaefe23d688e8f7d (patch)
treefcc445e216dddf66df2f4b57d128241955ef9be4 /modules/networking
parent3dfc5da1e7d7a03256ccab1891b2d9ef9e40c299 (diff)
defaults: add option for NetBIOSName
Diffstat (limited to 'modules/networking')
-rw-r--r--modules/networking/default.nix11
1 files changed, 3 insertions, 8 deletions
diff --git a/modules/networking/default.nix b/modules/networking/default.nix
index 0eed284..e45199e 100644
--- a/modules/networking/default.nix
+++ b/modules/networking/default.nix
@@ -3,34 +3,29 @@
with lib;
let
-
cfg = config.networking;
hostName = optionalString (cfg.hostName != null) ''
scutil --set ComputerName '${cfg.hostName}'
scutil --set LocalHostName '${cfg.hostName}'
scutil --set HostName '${cfg.hostName}'
- defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string '${cfg.hostName}'
'';
-
in
{
options = {
-
networking.hostName = mkOption {
type = types.nullOr types.str;
default = null;
example = "myhostname";
- description = ''
- Hostname for your machine.
- '';
+ description = "Hostname for your machine.";
};
-
};
config = {
+ system.defaults.smb.NetBIOSName = cfg.hostName;
+
system.activationScripts.networking.text = ''
# Set defaults
echo "configuring networking..." >&2