-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
181 lines (162 loc) · 6.11 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-templates.url = "github:NixOS/templates/master";
nix.url = "github:NixOS/nix/2.17-maintenance"; # or 2.11-maintenance vs. master
home-manager = {
url = "github:nix-community/home-manager/master";
flake = true;
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware = {
url = "github:NixOS/nixos-hardware";
};
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
};
#outputs = flakeInputs@{ self, nixpkgs, flake-templates, nix, home-manager, nixos-hardware, nixos-generators }:
outputs = inputs:
let
system = "x86_64-linux";
nix = inputs.nix.packages.${system}.nix;
photoDerivation =
let
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
in
import ./photo/photo.nix { inherit pkgs; };
in
rec {
nixosConfigurations = {
vbox-config = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./hosts/virtualbox
./modules/system.nix
inputs.home-manager.nixosModules.home-manager
#home-manager-config
];
specialArgs = { inherit (inputs) flake-templates nixpkgs nix; };
};
vultr = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./modules/system.nix
./hosts/vultr
inputs.home-manager.nixosModules.home-manager
#home-manager-config
];
specialArgs = { inherit (inputs) flake-templates nixpkgs nix; };
};
# VirtualBox Appliance output
ova = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
(import "${inputs.nixpkgs}/nixos/modules/virtualisation/virtualbox-image.nix")
./modules/system.nix
inputs.home-manager.nixosModules.home-manager
#home-manager-config
];
specialArgs = { inherit (inputs) flake-templates nixpkgs nix; };
};
vultr-iso = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./hosts/vultr
"${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
({ config, pkgs, ... }: {
boot.swraid.enable = pkgs.lib.mkForce false;
isoImage = {
isoBaseName = "johnos_" + (inputs.self.rev or "dirty");
};
})
];
specialArgs = { inherit (inputs) nixpkgs; };
};
mbp-live-iso = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./hosts/mbp
./modules/system.nix
inputs.home-manager.nixosModules.home-manager
({ config, pkgs, ...}: {
config = {
boot.swraid.enable = pkgs.lib.mkForce false;
users.users.sergey.isNormalUser = true;
home-manager = {
useUserPackages = true;
users.sergey = ./home-manager/users/sergey.nix;
extraSpecialArgs = { photo = photoDerivation; };
};
};
})
"${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
({ config, pkgs, ... }: {
isoImage = {
isoBaseName = "SergeyOS-" + (inputs.self.rev or inputs.self.dirtyRev);
makeEfiBootable = true;
};
})
];
specialArgs = { inherit (inputs) flake-templates nixpkgs nix; };
};
framework-laptop = inputs.nixpkgs.lib.nixosSystem (
import ./hosts/framework/default.nix inputs
#(import ./hosts/framework/default.nix { home-manager = inputs.home-manager; nixos-hardware = inputs.nixos-hardware; })
);
simple-live-iso = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
inputs.nixos-hardware.nixosModules.framework-11th-gen-intel
./modules/kernel.nix
./modules/system.nix
./hosts/framework
inputs.home-manager.nixosModules.home-manager
#home-manager-config
({ config, pkgs, lib, ... }: {
boot.loader.grub.devices = ["/dev/sda1"];
fonts.fontconfig.enable = pkgs.lib.mkForce true;
})
];
specialArgs = { inherit (inputs) flake-templates nixpkgs nix nixos-hardware; };
};
spectre-live-iso = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./modules/system.nix
./modules/kernel.nix
./hosts/hp_spectre_x360
inputs.home-manager.nixosModules.home-manager
#home-manager-config
"${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
];
specialArgs = { inherit (inputs) flake-templates nixpkgs nix; photo = photoDerivation; };
};
gce = inputs.nixos-generators.nixosGenerate {
system = "x86_64-linux";
modules = [
./modules/system.nix
./modules/kernel.nix
./hosts/gce
#({
# nixpkgs.overlays = myOverlays;
#})
];
format = "gce";
specialArgs = { inherit (inputs) flake-templates nixpkgs; };
};
};
packages.x86_64-linux = {
# local configurations
spectre-live-iso = nixosConfigurations.spectre-live-iso.config.system.build.isoImage;
mbp-live-iso = nixosConfigurations.mbp-live-iso.config.system.build.isoImage;
# cloud configurations
vultr-iso = nixosConfigurations.vultr-iso.config.system.build.isoImage;
gce = nixosConfigurations.gce;
# VM configurations
ova = nixosConfigurations.ova.config.system.build.virtualBoxOVA;
vbox-config = nixosConfigurations.vbox-config.config.system.build.toplevel;
};
};
}