treewide: fix darwin configs
This commit is contained in:
parent
de9b2d73e9
commit
2f16de8f02
2 changed files with 75 additions and 64 deletions
|
@ -16,7 +16,8 @@
|
||||||
./kogata
|
./kogata
|
||||||
];
|
];
|
||||||
|
|
||||||
builders = let
|
builders =
|
||||||
|
let
|
||||||
sharedOptions = {
|
sharedOptions = {
|
||||||
_file = ./default.nix;
|
_file = ./default.nix;
|
||||||
|
|
||||||
|
@ -53,21 +54,25 @@
|
||||||
];
|
];
|
||||||
specialArgs.configurationName = "base";
|
specialArgs.configurationName = "base";
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
nixos =
|
nixos =
|
||||||
name: module:
|
name: module:
|
||||||
baseNixos.extendModules {
|
baseNixos.extendModules {
|
||||||
modules = [
|
modules = [ module ];
|
||||||
module
|
|
||||||
];
|
|
||||||
specialArgs.configurationName = name;
|
specialArgs.configurationName = name;
|
||||||
};
|
};
|
||||||
|
|
||||||
darwin =
|
darwin =
|
||||||
name: module:
|
name: module:
|
||||||
baseDarwin.extendModules {
|
let
|
||||||
|
eval = baseDarwin._module.args.extendModules {
|
||||||
modules = [ module ];
|
modules = [ module ];
|
||||||
specialArgs.configurationName = name;
|
specialArgs.configurationName = name;
|
||||||
};
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
system = eval.config.system.build.toplevel;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,6 @@ let
|
||||||
|
|
||||||
# FIXME: Move to common
|
# FIXME: Move to common
|
||||||
services.tailscale.enable = true;
|
services.tailscale.enable = true;
|
||||||
networking.firewall.trustedInterfaces = [ "tailscale0" ];
|
|
||||||
|
|
||||||
networking.hostName = lib.mkDefault (
|
networking.hostName = lib.mkDefault (
|
||||||
args.configurationName
|
args.configurationName
|
||||||
|
@ -83,10 +82,15 @@ let
|
||||||
linuxConfig = lib.optionalAttrs isLinux (
|
linuxConfig = lib.optionalAttrs isLinux (
|
||||||
let
|
let
|
||||||
nmEnabled = config.networking.networkmanager.enable;
|
nmEnabled = config.networking.networkmanager.enable;
|
||||||
|
tlEnabled = config.services.tailscale.enable;
|
||||||
in
|
in
|
||||||
|
lib.mkMerge [
|
||||||
{
|
{
|
||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
|
||||||
|
# FIXME: Move to common
|
||||||
|
networking.firewall.trustedInterfaces = lib.mkIf tlEnabled [ "tailscale0" ];
|
||||||
|
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
programs.mosh.enable = lib.mkDefault true;
|
programs.mosh.enable = lib.mkDefault true;
|
||||||
programs.git.enable = lib.mkDefault true;
|
programs.git.enable = lib.mkDefault true;
|
||||||
|
@ -105,10 +109,11 @@ let
|
||||||
# TODO: Actually this should be extraRules which makes wheel users without any password set
|
# TODO: Actually this should be extraRules which makes wheel users without any password set
|
||||||
# be able to use sudo with no password
|
# be able to use sudo with no password
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
}
|
||||||
|
{
|
||||||
# When NetworkManager isn't in use, add tailscale DNS address manually
|
# When NetworkManager isn't in use, add tailscale DNS address manually
|
||||||
# FIXME: Move to common
|
# FIXME: Move to common
|
||||||
networking = lib.mkIf (!nmEnabled && config.services.tailscale.enable && cfg.tailnet != null) {
|
networking = lib.mkIf (!nmEnabled && tlEnabled && cfg.tailnet != null) {
|
||||||
nameservers = [
|
nameservers = [
|
||||||
"100.100.100.100"
|
"100.100.100.100"
|
||||||
"1.1.1.1"
|
"1.1.1.1"
|
||||||
|
@ -120,6 +125,7 @@ let
|
||||||
# NetworkManager probably means desktop system so we don't want to slow down boot times
|
# NetworkManager probably means desktop system so we don't want to slow down boot times
|
||||||
systemd.services = lib.mkIf nmEnabled { NetworkManager-wait-online.enable = false; };
|
systemd.services = lib.mkIf nmEnabled { NetworkManager-wait-online.enable = false; };
|
||||||
}
|
}
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
darwinConfig = lib.optionalAttrs (!isLinux) {
|
darwinConfig = lib.optionalAttrs (!isLinux) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue