default.nix 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. { outputs, config, ... }:
  2. {
  3. imports = [
  4. outputs.modules.global.nix-config
  5. ./kanata.nix
  6. ./system.nix
  7. ./software.nix
  8. ]
  9. ++ (builtins.attrValues outputs.modules.darwin);
  10. # NOTE: might be valuable to put this in it's own file
  11. nix.linux-builder = {
  12. enable = false;
  13. systems = [
  14. "aarch64-linux"
  15. "x86_64-linux"
  16. ];
  17. ephemeral = true;
  18. supportedFeatures = [
  19. "kvm"
  20. "benchmark"
  21. "big-parallel"
  22. "nixos-test"
  23. ];
  24. maxJobs = 4;
  25. config = {
  26. # Enable x86_64 emulation
  27. boot.binfmt.emulatedSystems = [ "x86_64-linux" ];
  28. virtualisation = {
  29. darwin-builder = {
  30. diskSize = 40 * 1024;
  31. memorySize = 8 * 1024;
  32. };
  33. cores = 6;
  34. };
  35. };
  36. };
  37. nix.settings.system-features = [
  38. "nixos-test"
  39. "apple-virt"
  40. "benchmark"
  41. "big-parallel"
  42. "kvm"
  43. ];
  44. # nix.settings.extra-platforms = [ "aarch64-linux" ];
  45. # launchd.daemons.linux-builder = {
  46. # serviceConfig = {
  47. # StandardOutPath = "/var/log/darwin-builder.log";
  48. # StandardErrorPath = "/var/log/darwin-builder.log";
  49. # };
  50. # };
  51. # NOTE: this seems to be needed to make nix work in fish
  52. programs.fish = {
  53. enable = true;
  54. vendor = {
  55. completions.enable = true;
  56. config.enable = true;
  57. functions.enable = true;
  58. };
  59. };
  60. environment.shells = [
  61. config.programs.fish.package
  62. ];
  63. # TODO: move into module:
  64. # system.activationScripts.extraActivation.text = lib.mkAfter ''
  65. # # disable spotlight
  66. # echo "disable spotlight..." >&2
  67. # mdutil -i off /
  68. # '';
  69. # TODO:
  70. # - Proton Mail Bridge
  71. # - Proton Drive set up home folders
  72. programs = {
  73. nix-index.enable = true;
  74. gnupg.agent.enable = true;
  75. };
  76. users.users.thomas.home = "/Users/thomas";
  77. users.users.thomas.shell = config.programs.fish.package;
  78. users.groups.nix-users.members = [ "thomas" ];
  79. ids.gids.nixbld = 350;
  80. nix.settings.trusted-users = [ "thomas" ];
  81. networking = {
  82. hostName = "meili";
  83. remote-login = true;
  84. };
  85. time.timeZone = "Europe/Vienna";
  86. system.stateVersion = 4;
  87. }