-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
119 lines (112 loc) · 3.65 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
{
description = "Nixos and darwin configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
darwin = {
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
helix.url = "github:helix-editor/helix";
randaam-cli.url = "github:sempruijs/randaam-cli";
yazi.url = "github:sxyazi/yazi";
tools.url = "github:sempruijs/tools";
};
outputs = { self, nixpkgs, home-manager, darwin, helix, yazi, ... }@inputs: {
nixosConfigurations =
let
mkSystem = { platform, ...}:
let
pkgs = import nixpkgs;
in
nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux";
specialArgs = {inherit inputs; inherit platform;};
modules = [
./modules/packages.nix
./modules/nix.nix
./modules/sem.nix
home-manager.nixosModules.home-manager {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
platform = platform;
};
users.sem = {
imports = [
./home.nix
./hm/nix.nix
./hm/helix.nix
./hm/git.nix
./hm/direnv.nix
./hm/nushell/nu.nix
]
++
(if platform == "utm" then [
./hm/kitty.nix
] else []);
};
};
}
]
++
(if platform == "orbstack" then [
./modules/orbstack.nix
./modules/orbstack/configuration.nix
./modules/orbstack/lxd.nix
] else (if platform == "utm" then [
./modules/utm/configuration.nix
./modules/utm/hardware-configuration.nix
] else []));
};
in
{
orbstack = mkSystem {
platform = "orbstack";
};
utm = mkSystem {
platform = "utm";
};
};
# darwin
darwinConfigurations = {
default = darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = {inherit inputs;};
modules = [
./darwin/darwin-configuration.nix
home-manager.darwinModules.home-manager {
users.users.sem = {
name = "sem";
home = "/Users/sem";
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.sem = {
imports = [
./hm/nushell/nu.nix
./darwin/home.nix
./hm/nix.nix
./hm/helix.nix
# ./hm/git.nix
./hm/kitty.nix
./hm/direnv.nix
./hm/lazygit.nix
./hm/emacs/spacemacs.nix
];
};
home-manager.extraSpecialArgs = {
inherit inputs;
platform = "darwin";
# pkgs-unstable = import inputs.nixpkgs-unstable { system = "aarch64-darwin"; config.allowUnfree = true; };
};
}
];
};
};
};
}