-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
103 lines (100 loc) · 3.06 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
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";
flake-utils.url = "github:numtide/flake-utils";
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.flake-utils.follows = "flake-utils";
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,
flake-utils,
...
}:
let
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 = lib.importDir ./modules/darwin (inputs // outputs);
systemModules = lib.importDir ./modules/system (inputs // outputs);
homeModules = lib.importDir ./modules/home (inputs // outputs);
users = lib.importDir ./users (inputs // outputs);
packages = (
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
packages = lib.callPackageDirWith ./pkgs (inputs // pkgs);
in
packages
)
);
};
darwinConfigurations = {
Jellyfish = mkDarwin {
host = "Jellyfish";
arch = "aarch64";
};
"dszakallas--Clownfish" = mkDarwin {
host = "dszakallas--Clownfish";
arch = "aarch64";
};
};
};
in
outputs;
}