grace/dots

dotfiles/nix configs

git clone https://git.gae.moe/grace/dots

Grace Yoderbig changesc1be8e3

main
1.3 KiB50 linesraw
1{ lib, ... }:
2let
3  host = import ./hosts.nix;
4  sources = import ./sources.nix;
5in
6assert lib.assertMsg (
7  host.type != "home"
8) "${host.name} is a Home Manager host; use home-manager instead.";
9{
10  imports = [
11    (./hosts + "/${host.name}.nix")
12  ]
13  ++ lib.optional (host.type == "nixos") (./hosts/hardware-configurations + "/${host.name}.nix");
14
15  nixpkgs.hostPlatform = host.system;
16  nixpkgs.pkgs = import sources.nixpkgs {
17    system = host.system;
18    config.allowUnfree = true;
19  };
20  nix.nixPath = [
21    "nixpkgs=${sources.nixpkgs}"
22    "home-manager=${sources.home-manager}"
23    "nixos-config=/etc/nixos/configuration.nix"
24    "darwin-config=/etc/nix-darwin/configuration.nix"
25  ];
26
27  nix.distributedBuilds = host.name != "dijkstra";
28  nix.buildMachines = lib.optional (host.name != "dijkstra") {
29    hostName = "dijkstra.i.gae.moe";
30    sshUser = "builder";
31    protocol = "ssh-ng";
32    systems = [ "x86_64-linux" ];
33    maxJobs = 8;
34    speedFactor = 1;
35    supportedFeatures = [
36      "kvm"
37      "big-parallel"
38      "nixos-test"
39      "benchmark"
40    ];
41  };
42  nix.settings.builders-use-substitutes = true;
43
44  security.sudo.extraConfig = ''
45    Defaults env_keep += "NIX_HOST"
46  ''
47  + lib.optionalString (host.type == "nixos") ''
48    Defaults env_keep += "XDG_CONFIG_HOME EDITOR VISUAL JJ_CONFIG"
49  '';
50}