-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathflake.nix
106 lines (89 loc) · 2.72 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
104
105
106
{
description = "chenglab";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
impermanence.url = "github:nix-community/impermanence";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin = {
url = "github:LnL7/nix-darwin/nix-darwin-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixarr = {
url = "github:rasmus-kirk/nixarr";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-homebrew = {
url = "github:zhaofengli-wip/nix-homebrew";
inputs.nixpkgs.follows = "nixpkgs";
};
homebrew-bundle = {
url = "github:homebrew/homebrew-bundle";
flake = false;
};
homebrew-core = {
url = "github:homebrew/homebrew-core";
flake = false;
};
homebrew-cask = {
url = "github:homebrew/homebrew-cask";
flake = false;
};
nixos-wsl = {
url = "github:nix-community/NixOS-WSL/main";
inputs.nixpkgs.follows = "nixpkgs";
};
vscode-server = {
url = "github:nix-community/nixos-vscode-server";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
nix-darwin,
...
} @ inputs: let
inherit (self) outputs;
vars = import ./vars.nix;
systems = ["x86_64-linux" "aarch64-darwin"];
forAllSystems = nixpkgs.lib.genAttrs systems;
mkNixOSConfig = path:
nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs vars;};
modules = [path];
};
mkDarwinConfig = path:
nix-darwin.lib.darwinSystem {
specialArgs = {inherit inputs outputs vars;};
modules = [path];
};
in {
# Enables `nix fmt` at root of repo to format all nix files
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
darwinConfigurations = {
mac1chng = mkDarwinConfig ./machines/mac1chng/configuration.nix;
};
nixosConfigurations = {
workchng = mkNixOSConfig ./machines/workchng/configuration.nix;
dsk1chng = mkNixOSConfig ./machines/dsk1chng/configuration.nix;
svr1chng = mkNixOSConfig ./machines/svr1chng/configuration.nix;
svr2chng = mkNixOSConfig ./machines/svr2chng/configuration.nix;
svr3chng = mkNixOSConfig ./machines/svr3chng/configuration.nix;
iso1chng = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {inherit inputs outputs vars;};
modules = [
(nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
./machines/iso1chng/configuration.nix
];
};
};
};
}