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;
|
||||||
|
|
||||||
|
@ -27,47 +28,51 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
baseNixos = inputs.nixpkgs.lib.nixosSystem {
|
baseNixos = inputs.nixpkgs.lib.nixosSystem {
|
||||||
modules = [
|
modules = [
|
||||||
inputs.agenix.nixosModules.age
|
inputs.agenix.nixosModules.age
|
||||||
inputs.disko.nixosModules.disko
|
inputs.disko.nixosModules.disko
|
||||||
inputs.mailserver.nixosModules.default
|
inputs.mailserver.nixosModules.default
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
inputs.nvidia-patch.nixosModules.nvidia-patch
|
inputs.nvidia-patch.nixosModules.nvidia-patch
|
||||||
inputs.attic.nixosModules.atticd
|
inputs.attic.nixosModules.atticd
|
||||||
inputs.lix-module.nixosModules.default
|
inputs.lix-module.nixosModules.default
|
||||||
self.nixosModules.settei
|
self.nixosModules.settei
|
||||||
self.nixosModules.common
|
self.nixosModules.common
|
||||||
sharedOptions
|
sharedOptions
|
||||||
];
|
];
|
||||||
specialArgs.configurationName = "base";
|
specialArgs.configurationName = "base";
|
||||||
};
|
};
|
||||||
|
|
||||||
baseDarwin = inputs.darwin.lib.darwinSystem {
|
baseDarwin = inputs.darwin.lib.darwinSystem {
|
||||||
modules = [
|
modules = [
|
||||||
inputs.agenix.darwinModules.age
|
inputs.agenix.darwinModules.age
|
||||||
inputs.home-manager.darwinModules.home-manager
|
inputs.home-manager.darwinModules.home-manager
|
||||||
inputs.lix-module.nixosModules.default
|
inputs.lix-module.nixosModules.default
|
||||||
self.darwinModules.settei
|
self.darwinModules.settei
|
||||||
self.darwinModules.common
|
self.darwinModules.common
|
||||||
sharedOptions
|
sharedOptions
|
||||||
];
|
];
|
||||||
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
|
||||||
modules = [module];
|
eval = baseDarwin._module.args.extendModules {
|
||||||
specialArgs.configurationName = name;
|
modules = [ module ];
|
||||||
|
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,43 +82,50 @@ 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;
|
||||||
|
|
||||||
services.openssh.enable = true;
|
# FIXME: Move to common
|
||||||
programs.mosh.enable = lib.mkDefault true;
|
networking.firewall.trustedInterfaces = lib.mkIf tlEnabled [ "tailscale0" ];
|
||||||
programs.git.enable = lib.mkDefault true;
|
|
||||||
|
|
||||||
users = {
|
services.openssh.enable = true;
|
||||||
mutableUsers = false;
|
programs.mosh.enable = lib.mkDefault true;
|
||||||
users.${username} = {
|
programs.git.enable = lib.mkDefault true;
|
||||||
isNormalUser = true;
|
|
||||||
home = "/home/${username}";
|
users = {
|
||||||
group = username;
|
mutableUsers = false;
|
||||||
extraGroups = [ "wheel" ];
|
users.${username} = {
|
||||||
|
isNormalUser = true;
|
||||||
|
home = "/home/${username}";
|
||||||
|
group = username;
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
};
|
||||||
|
groups.${username} = { };
|
||||||
};
|
};
|
||||||
groups.${username} = { };
|
|
||||||
};
|
|
||||||
|
|
||||||
# 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
|
||||||
|
# FIXME: Move to common
|
||||||
|
networking = lib.mkIf (!nmEnabled && tlEnabled && cfg.tailnet != null) {
|
||||||
|
nameservers = [
|
||||||
|
"100.100.100.100"
|
||||||
|
"1.1.1.1"
|
||||||
|
"1.0.0.1"
|
||||||
|
];
|
||||||
|
search = [ cfg.tailnet ];
|
||||||
|
};
|
||||||
|
|
||||||
# When NetworkManager isn't in use, add tailscale DNS address manually
|
# NetworkManager probably means desktop system so we don't want to slow down boot times
|
||||||
# FIXME: Move to common
|
systemd.services = lib.mkIf nmEnabled { NetworkManager-wait-online.enable = false; };
|
||||||
networking = lib.mkIf (!nmEnabled && config.services.tailscale.enable && cfg.tailnet != null) {
|
}
|
||||||
nameservers = [
|
]
|
||||||
"100.100.100.100"
|
|
||||||
"1.1.1.1"
|
|
||||||
"1.0.0.1"
|
|
||||||
];
|
|
||||||
search = [ cfg.tailnet ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# 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; };
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
darwinConfig = lib.optionalAttrs (!isLinux) {
|
darwinConfig = lib.optionalAttrs (!isLinux) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue