aboutsummaryrefslogtreecommitdiff
path: root/hosts/default.nix
blob: f4393d204a48f455609c70d635e1bcbaa848e321 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{self, ...}: let
  # get inputs from self
  inherit (self) inputs;
  # get necessary inputs from self.inputs
  inherit (inputs) nixpkgs;
  inherit (inputs.home-manager.nixosModules) home-manager;
  # get lib from nixpkgs and create and alias  for lib.nixosSystem
  # for potential future overrides & abstractions
  inherit (nixpkgs) lib;
  mkSystem = lib.nixosSystem;

  home = ../homes;

  # define a sharedArgs variable that we can simply inherit
  # across all hosts to avoid traversing the file whenever
  # we need to add a common specialArg
  # if a host needs a specific arg that others do not need
  # then we can merge into the old attribute set as such:
  # specialArgs = commonArgs // { newArg = "value"; };

  commonArgs = {inherit self inputs;};
in {
  "watermelon" = mkSystem {
    specialArgs = commonArgs;
    modules = [
      # this list defines which files will be imported to be used as "modules" in the system config
      ./watermelon/configuration.nix
      # use the nixos-module for home-manager
      home-manager
      home
    ];
  };

  "banana" = mkSystem {
    specialArgs = commonArgs;
    modules = [
      ./banana/configuration.nix
      home-manager
      home
    ];
  };
}