-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
65 lines (62 loc) · 2.41 KB
/
flake.nix
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
rec {
description = "My personal Nix configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-darwin.url = "github:LnL7/nix-darwin";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
poetry2nix.url = "github:nix-community/poetry2nix";
poetry2nix.inputs.nixpkgs.follows = "nixpkgs";
davids-dotfiles-private.url = "github:dszakallas/davids-dotfiles-private";
davids-dotfiles-private.inputs.nixpkgs.follows = "nixpkgs";
davids-dotfiles-private.inputs.poetry2nix.follows = "poetry2nix";
};
nixConfig = {
extra-experimental-features = [ "nix-command" "flakes" ];
extra-substituters =
[ "https://nix-community.cachix.org" "https://devenv.cachix.org" ];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
];
};
outputs = inputs@{ self, nix-darwin, nixpkgs, home-manager
, davids-dotfiles-private, poetry2nix, ... }:
let
importChildren = d:
builtins.mapAttrs (_: v: import v (inputs // outputs))
(outputs.davids-dotfiles.lib.subDirs d);
mkDarwin = { host, arch, ... }:
nix-darwin.lib.darwinSystem rec {
system = "${arch}-darwin";
specialArgs = let
hostPlatform = nixpkgs.legacyPackages.${system}.stdenv.hostPlatform;
in { inherit home-manager hostPlatform system nixConfig; };
modules = [
home-manager.darwinModules.home-manager
(import ./hosts/${host} (inputs // outputs))
{ home-manager = { extraSpecialArgs = specialArgs; }; }
];
};
outputs = {
davids-dotfiles = rec {
lib = import ./lib { inherit (nixpkgs) lib; };
darwinModules = importChildren ./modules/darwin;
systemModules = importChildren ./modules/system;
homeModules = importChildren ./modules/home;
users = importChildren ./users;
};
darwinConfigurations = {
Jellyfish = mkDarwin {
host = "Jellyfish";
arch = "aarch64";
};
"dszakallas--Clownfish" = mkDarwin {
host = "dszakallas--Clownfish";
arch = "aarch64";
};
};
};
in outputs;
}