-
Notifications
You must be signed in to change notification settings - Fork 4
/
flake.nix
96 lines (83 loc) · 2.69 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
{
description = "Nan's environment configurations";
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";
};
bash-env-json = {
url = "github:tesujimath/bash-env-json/main";
inputs.nixpkgs.follows = "nixpkgs";
};
bash-env-nushell = {
url = "github:tesujimath/bash-env-nushell/main";
inputs.nixpkgs.follows = "nixpkgs";
inputs.bash-env-json.follows = "bash-env-json";
};
};
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
];
};
});
};
}