-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
110 lines (96 loc) · 2.74 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
{
description = "NixOS systems & configuration";
inputs = {
# consider switching to github:numtide/nixpkgs-unfree?ref=nixos-unstable
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/0.1";
nix-darwin.url = "github:lnl7/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-parts.url = "github:hercules-ci/flake-parts";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
ghostty.url = "git+ssh://[email protected]/ghostty-org/ghostty";
ghostty.inputs.nixpkgs-stable.follows = "nixpkgs";
nix-index-database.url = "github:nix-community/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
stylix.url = "github:danth/stylix";
helix.url = "github:helix-editor/helix";
};
outputs =
inputs@{
stylix,
chaotic,
nixpkgs,
ghostty,
nix-darwin,
flake-utils,
determinate,
flake-parts,
home-manager,
...
}:
let
user = "o";
overlays = [ ];
mkNixos = import ./nixos.nix;
mkDarwin = import ./darwin.nix;
in
# Custom packages and modifications, exported as overlays
{
overlays = import ./overlays { inherit inputs nixpkgs; };
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#vm-orb'
# nix run nix-darwin -- switch --flake .#vm-osx --upgrade-all --fast --print-build-logs --show-trace
# nix run nix-darwin -- switch --flake ~/.config/nix-darwin
nixosConfigurations =
let
system = "aarch64-linux";
in
{
# orbstack machine
vm-orb = mkNixos "vm-orb" {
inherit
user
stylix
inputs
system
nixpkgs
ghostty
overlays
determinate
home-manager
;
};
};
darwinConfigurations =
let
system = "aarch64-darwin";
in
{
vm-osx = mkDarwin "vm-osx" {
inherit
user
inputs
system
nixpkgs
ghostty
overlays
nix-darwin
determinate
home-manager
;
};
};
}
// (flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
devShells = import ./shell.nix { inherit pkgs; };
}
));
}