-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
122 lines (99 loc) · 3.73 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
{
description = "Willem's Nix configurations";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/b74a56e2acce8fe88a575287a20ac196d8d01938";
darwin.url = "github:willemml/nix-darwin?ref=feat/networking.hosts";
#darwin.url = "git+file:///Users/willem/dev/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs";
fenix.url = "github:nix-community/fenix";
flake-parts.url = "github:hercules-ci/flake-parts";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
hyprland = {
type = "git";
url = "https://github.com/hyprwm/Hyprland";
rev = "b1e5cc66bdb20b002c93479490c3a317552210b3";
submodules = true;
};
nix-github-actions.inputs.nixpkgs.follows = "nixpkgs";
nix-github-actions.url = "github:nix-community/nix-github-actions";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
nix-index-database.url = "github:nix-community/nix-index-database";
nixos-apple-silicon.inputs.nixpkgs.follows = "nixpkgs";
nixos-apple-silicon.url = "github:tpwrules/nixos-apple-silicon";
pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
stylix.url = "github:danth/stylix";
stylix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
darwin,
nixpkgs,
self,
...
} @ inputs: let
globals = import ./common/globals.nix;
in
inputs.flake-parts.lib.mkFlake {inherit inputs;} rec {
systems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
"aarch64-linux"
];
flake = let
mkSystem = type: system: definition: (type {
inherit system;
specialArgs = {
inherit inputs globals;
overlays = self.overlays;
};
modules = definition;
});
mkNixos = arch: (mkSystem nixpkgs.lib.nixosSystem "${arch}-linux");
mkDarwin = arch: (mkSystem darwin.lib.darwinSystem "${arch}-darwin");
forAllSystems = nixpkgs.lib.genAttrs systems;
in rec {
overlays = {
default = import ./packages;
fenix = inputs.fenix.overlays.default;
};
nixosConfigurations = {
x86_64-live = mkNixos "x86_64" [./nixos/hosts/x86_64-live.nix];
aarch64-live = mkNixos "aarch64" [./nixos/hosts/aarch64-live.nix];
glassbox = mkNixos "x86_64" [./nixos/hosts/glassbox.nix];
nixbox = mkNixos "x86_64" [./nixos/hosts/nixbox.nix];
thinkpad = mkNixos "x86_64" [./nixos/hosts/thinkpad.nix];
voyager = mkNixos "aarch64" [./nixos/hosts/voyager];
darwin-arm-minimal-vm = mkNixos "aarch64" [./nixos/hosts/vms/aarch64-darwin-host/minimal.nix];
darwin-arm-homeconsole-vm = mkNixos "aarch64" [./nixos/hosts/vms/aarch64-darwin-host/home-console.nix];
};
darwinConfigurations.zeus = mkDarwin "aarch64" [./nixos/hosts/zeus.nix];
packages = {
aarch64-darwin = {
minimal-vm = self.nixosConfigurations.darwin-arm-minimal-vm.config.system.build.vm;
homeconsole-vm = self.nixosConfigurations.darwin-arm-homeconsole-vm.config.system.build.vm;
default = self.darwinConfigurations.zeus.config.system.build.toplevel;
};
};
};
perSystem = {
system,
self',
pkgs,
lib,
...
}: {
checks.pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
alejandra.enable = true;
};
};
devShells.default = pkgs.mkShell {
inherit (self'.checks.pre-commit-check) shellHook;
};
formatter = pkgs.alejandra;
};
};
}