-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
57 lines (55 loc) · 1.77 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
# This is a basic NixOS flake template for a live ISO image
# that can be used to install NixOS on a system.
# ISO can be built using
# `nix build .#nixosConfigurations.nixos-iso.config.system.build.isoImage` - Graphical ISO
# `nix build .#nixosConfigurations.nixos-minimal.config.system.build.isoImage` - Minimal ISO
# Make sure to enable flakes and nix-command on the host system, before building the ISO
# Resulting image can be found in ./result/iso/ directory
{
description = "Unstable NixOS custom installation media";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
bcachefs-tools.url = "github:koverstreet/bcachefs-tools";
};
outputs = {
self,
nixpkgs,
...
} @ inputs: let
system = "x86_64-linux"; # change arch here
specialArgs = {
inherit system;
inherit inputs;
};
in {
formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra;
## GRAPHICAL ISO ##
nixosConfigurations.nixos-iso = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix"
"${nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix"
./graphical-configuration.nix
];
inherit specialArgs;
};
## MINIMAL ISO ##
nixosConfigurations.nixos-minimal = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
./minimal-configuration.nix
];
inherit specialArgs;
};
};
# Add nix community cache
nixConfig = {
extra-substituters = [
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
}