-
Notifications
You must be signed in to change notification settings - Fork 4
/
flake.nix
94 lines (82 loc) · 2.6 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
{
description = "Nan's environment configurations";
nixConfig = {
extra-substituters = [
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:nixos/nixos-hardware/master";
darwin = {
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
raspberry-pi-nix.url = "github:nix-community/raspberry-pi-nix";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
mkAlias = {
url = "github:reckenrode/mkAlias";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, ... }@inputs:
let
mkLinuxSystem = pkgs: system: machine:
pkgs.lib.nixosSystem {
system = system;
modules = [
./modules/common/nixos.nix
./modules/dev/nixos.nix
./modules/home/nixos.nix
(./machines + "/${machine}/configuration.nix")
];
specialArgs = { inherit inputs; };
};
mkDarwinSystem = pkgs: system: machine:
inputs.darwin.lib.darwinSystem {
system = system;
modules = [
./modules/common/darwin.nix
./modules/dev/darwin.nix
./modules/home/darwin.nix
(./machines + "/${machine}/configuration.nix")
];
specialArgs = { inherit inputs system; };
};
forEachSystem = fn:
nixpkgs.lib.genAttrs [
"x86_64-linux" "aarch64-linux"
"x86_64-darwin" "aarch64-darwin"
] (system: fn {
pkgs = import nixpkgs { inherit system; };
});
in {
nixosConfigurations = {
dev = mkLinuxSystem inputs.nixpkgs "x86_64-linux" "dev";
media = mkLinuxSystem inputs.nixpkgs "x86_64-linux" "media";
homepi = mkLinuxSystem inputs.nixpkgs "aarch64-linux" "homepi";
devpi = mkLinuxSystem inputs.nixpkgs "aarch64-linux" "devpi";
};
darwinConfigurations = {
stdio = mkDarwinSystem inputs.nixpkgs "aarch64-darwin" "stdio";
wrk = mkDarwinSystem inputs.nixpkgs "aarch64-darwin" "wrk";
};
devShells = forEachSystem ({ pkgs, ... }: {
default = pkgs.mkShell {
buildInputs = with pkgs; [
lua-language-server
];
};
});
};
}