Continue porting darwin, make settei module(s) more reusable by others.
This commit is contained in:
parent
823721ac52
commit
f4890a5d74
8 changed files with 32 additions and 18 deletions
|
@ -84,6 +84,7 @@
|
||||||
inputs.home-manager.darwinModules.home-manager
|
inputs.home-manager.darwinModules.home-manager
|
||||||
inputs.hercules-ci-agent.darwinModules.agent-service
|
inputs.hercules-ci-agent.darwinModules.agent-service
|
||||||
self.darwinModules.settei
|
self.darwinModules.settei
|
||||||
|
self.darwinModules.common
|
||||||
sharedOptions
|
sharedOptions
|
||||||
defaultOptions
|
defaultOptions
|
||||||
module
|
module
|
||||||
|
|
3
modules/darwin/common/default.nix
Normal file
3
modules/darwin/common/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
system.stateVersion = 4;
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
{config, ...}: {
|
{config, ...}: {
|
||||||
flake.darwinModules = {
|
flake.darwinModules = {
|
||||||
settei = import ./settei {inherit (config) perInput;};
|
settei = import ./settei {inherit (config) perInput;};
|
||||||
|
common = ./common;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,5 @@
|
||||||
security.pam.enableSudoTouchIdAuth = true;
|
security.pam.enableSudoTouchIdAuth = true;
|
||||||
|
|
||||||
users.users.${username}.home = "/Users/${username}";
|
users.users.${username}.home = "/Users/${username}";
|
||||||
|
|
||||||
system.stateVersion = 4;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,15 +31,15 @@ with lib; {
|
||||||
|
|
||||||
configurations = {
|
configurations = {
|
||||||
nixos = mkOption {
|
nixos = mkOption {
|
||||||
type = types.attrsOf types.deferredModule;
|
type = types.lazyAttrsOf types.deferredModule;
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
darwin = mkOption {
|
darwin = mkOption {
|
||||||
type = types.attrsOf types.deferredModule;
|
type = types.lazyAttrsOf types.deferredModule;
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
home = mkOption {
|
home = mkOption {
|
||||||
type = types.attrsOf types.deferredModule;
|
type = types.lazyAttrsOf types.deferredModule;
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,4 +2,11 @@
|
||||||
imports = [
|
imports = [
|
||||||
./hercules.nix
|
./hercules.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
config = {
|
||||||
|
system.stateVersion = "22.05";
|
||||||
|
|
||||||
|
# https://github.com/NixOS/nixpkgs/issues/254807
|
||||||
|
boot.swraid.enable = false;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,11 +6,9 @@
|
||||||
...
|
...
|
||||||
} @ args: let
|
} @ args: let
|
||||||
cfg = config.settei.sane-defaults;
|
cfg = config.settei.sane-defaults;
|
||||||
|
nmEnabled = config.networking.networkmanager.enable;
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
# https://github.com/NixOS/nixpkgs/issues/254807
|
|
||||||
boot.swraid.enable = false;
|
|
||||||
|
|
||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
@ -24,12 +22,10 @@ in {
|
||||||
group = username;
|
group = username;
|
||||||
extraGroups = ["wheel"];
|
extraGroups = ["wheel"];
|
||||||
openssh.authorizedKeys.keys = let
|
openssh.authorizedKeys.keys = let
|
||||||
filteredKeys = let
|
configName' =
|
||||||
configName' =
|
args.configurationName
|
||||||
args.configurationName
|
or (throw "pass configurationName to module arguments or set users.users.${username}.openssh.authorizedKeys yourself");
|
||||||
or (throw "pass configurationName to module arguments or set users.users.${username}.openssh.authorizedKeys yourself");
|
filteredKeys = lib.filterAttrs (name: _: name != configName') cfg.allSshKeys;
|
||||||
in
|
|
||||||
lib.filterAttrs (name: _: name != configName') cfg.allSshKeys;
|
|
||||||
in
|
in
|
||||||
lib.mkDefault (lib.attrValues filteredKeys);
|
lib.mkDefault (lib.attrValues filteredKeys);
|
||||||
};
|
};
|
||||||
|
@ -40,6 +36,15 @@ in {
|
||||||
# be able to use sudo with no password
|
# be able to use sudo with no password
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
|
||||||
system.stateVersion = "22.05";
|
# When NetworkManager isn't in use, add tailscale DNS address manually
|
||||||
|
networking.nameservers = lib.mkIf (!nmEnabled && config.services.tailscale.enable) [
|
||||||
|
"100.100.100.100"
|
||||||
|
"1.1.1.1"
|
||||||
|
"1.0.0.1"
|
||||||
|
];
|
||||||
|
# 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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
# This module is supposed to be a reusable set of options you probably would want to set anyway
|
# This module is supposed to be a reusable set of options you probably would want to set anyway.
|
||||||
#
|
# For options specific to nixos or darwin go to modules/{nixos,darwin}/settei/sane-defaults.nix
|
||||||
# Other default options which don't necessairly make sense for other people go into hosts/default.nix
|
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue