diff --git a/hosts/thegeneralist-central/configuration.nix b/hosts/thegeneralist-central/configuration.nix new file mode 100644 index 0000000..b456407 --- /dev/null +++ b/hosts/thegeneralist-central/configuration.nix @@ -0,0 +1,33 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ self, config, pkgs, lib, inputs, ... }: + +{ + imports = [ ./hardware-configuration.nix ]; + + users.knownUsers = [ + "thegeneralist" + ]; + + users.users.thegeneralist = { + name = "thegeneralist"; + home = "/Users/thegeneralist"; + shell = pkgs.zsh; + uid = 501; + # openssh.authorizedKeys.keys = let + # inherit (import ../../keys.nix) thegeneralist; + # in [ thegeneralist ]; + }; + + home-manager = { + backupFileExtension = "home.bak"; + users.thegeneralist.home = { + stateVersion = "25.11"; + homeDirectory = "/Users/thegeneralist"; + }; + }; + + system.stateVersion = 6; +} diff --git a/hosts/thegeneralist-central/default.nix b/hosts/thegeneralist-central/default.nix new file mode 100644 index 0000000..e454746 --- /dev/null +++ b/hosts/thegeneralist-central/default.nix @@ -0,0 +1,31 @@ +lib: inputs: self: lib.darwinSystem { + specialArgs = inputs // { inherit inputs; inherit self; }; + modules = [ + # Extensions: nixosModules, darwinModules, overlays + ({ pkgs, lib, inputs, ... }: let + inherit (lib) attrValues hasAttrByPath getAttrFromPath filter; + + collect = packagePath: (attrValues inputs) + |> filter (hasAttrByPath packagePath) + |> map (getAttrFromPath packagePath); + + modules = collect [ "darwinModules" "default" ]; + # todo + extensions = { + nixpkgs.overlays = collect [ "overlays" "default" ]; + imports = modules; + }; + in extensions) + + ./configuration.nix + + # Modules + ({ pkgs, ... }: let + inherit (lib) filter hasSuffix; + commonModules = lib.filesystem.listFilesRecursive ../../modules/common |> filter (hasSuffix ".nix"); + darwinModules = lib.filesystem.listFilesRecursive ../../modules/darwin |> filter (hasSuffix ".nix"); + in { + imports = commonModules ++ darwinModules; + }) + ]; +} diff --git a/hosts/thegeneralist-central/hardware-configuration.nix b/hosts/thegeneralist-central/hardware-configuration.nix new file mode 100644 index 0000000..bdd1ed5 --- /dev/null +++ b/hosts/thegeneralist-central/hardware-configuration.nix @@ -0,0 +1,11 @@ +{ lib, ... }: + +{ + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + # networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "aarch64-darwin"; +} diff --git a/hosts/thegeneralist/default.nix b/hosts/thegeneralist/default.nix index aef3ca8..2fa7865 100644 --- a/hosts/thegeneralist/default.nix +++ b/hosts/thegeneralist/default.nix @@ -2,7 +2,7 @@ lib: inputs: self: lib.nixosSystem { specialArgs = inputs // { inherit inputs; inherit self; }; modules = [ # Extensions: nixosModules, darwinModules, overlays - ({ pkgs, lib, ... }: let + ({ pkgs, lib, inputs, ... }: let inherit (lib) attrValues hasAttrByPath getAttrFromPath filter; collect = packagePath: (attrValues inputs) @@ -10,7 +10,7 @@ lib: inputs: self: lib.nixosSystem { |> map (getAttrFromPath packagePath); modules = collect [ "nixosModules" "default" ]; - extensions = modules // { + extensions = { nixpkgs.overlays = collect [ "overlays" "default" ]; imports = modules; }; diff --git a/modules/common/dns-options.nix b/modules/common/dns-options.nix index e6e71b3..6614afb 100644 --- a/modules/common/dns-options.nix +++ b/modules/common/dns-options.nix @@ -3,10 +3,8 @@ in { options.dnsServers = mkOption { default = [ - "45.90.28.0#365fed.dns.nextdns.io" - "2a07:a8c0::#365fed.dns.nextdns.io" - "45.90.30.0#365fed.dns.nextdns.io" - "2a07:a8c1::#365fed.dns.nextdns.io" + "45.90.28.181#365fed.dns.nextdns.io" + "45.90.30.181#365fed.dns.nextdns.io" "100.100.100.100#shorthair-wall.ts.net" ]; }; diff --git a/modules/darwin/ssh.nix b/modules/darwin/ssh.nix index b6eeca2..9ed14dd 100644 --- a/modules/darwin/ssh.nix +++ b/modules/darwin/ssh.nix @@ -1,3 +1,4 @@ +# TODO: this # { lib, ... }: let # sshOptions = { # PermitRootLogin = "no";