-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
81 lines (71 loc) · 2.05 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
nixpkgs-stable,
home-manager,
darwin,
...
}@inputs:
let
supportedSystems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
# helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# nixpkgs instantiated for supported system types
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
# function to create a nixos or darwin system
mkSystem = import ./lib/mksystem.nix { inherit nixpkgs inputs; };
in
{
# desktop ProArt motherboard w/ AMD 7950x 64GB RAM and 2x1TB SDD
nixosConfigurations.proart = mkSystem "proart" rec {
system = "x86_64-linux";
user = "dvcorreia";
};
# university macbook pro 13" 2018 w/ ???
darwinConfigurations.macbook-pro-intel = mkSystem "macbook-pro-intel" {
system = "x86_64-darwin";
user = "dvcorreia";
darwin = true;
};
# macbook pro 14" 2023 w/ M3 Pro CPU 36GB RAM and 1TB SSD
darwinConfigurations.macbook-m3-pro = mkSystem "macbook-m3-pro" {
system = "aarch64-darwin";
user = "dvcorreia";
darwin = true;
};
devShells = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
in
{
default = pkgs.mkShell {
buildInputs = with pkgs; [
git
nixfmt-rfc-style
];
};
}
);
formatter = forAllSystems (system: (nixpkgsFor.${system}).nixfmt-rfc-style);
};
}