Skip to content

Commit 3bc9350

Browse files
committed
flake: add formatter and format
1 parent bdd55fe commit 3bc9350

File tree

3 files changed

+34
-39
lines changed

3 files changed

+34
-39
lines changed

flake.nix

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,47 @@
11
# This is a basic NixOS flake template for a live ISO image
22
# that can be used to install NixOS on a system.
3-
# ISO can be built using
3+
# ISO can be built using
44
# `nix build .#nixosConfigurations.nixos-iso.config.system.build.isoImage` - Graphical ISO
55
# `nix build .#nixosConfigurations.nixos-minimal.config.system.build.isoImage` - Minimal ISO
66
# Make sure to enable flakes and nix-command on the host system, before building the ISO
77
# Resulting image can be found in ./result/iso/ directory
8-
98
{
109
description = "Unstable NixOS custom installation media";
1110
inputs = {
1211
nixpkgs.url = "nixpkgs/nixos-unstable";
1312
bcachefs-tools.url = "github:koverstreet/bcachefs-tools";
1413
};
15-
outputs =
16-
{ self, nixpkgs, ... }@inputs:
17-
let
18-
system = "x86_64-linux"; # change arch here
14+
outputs = {
15+
self,
16+
nixpkgs,
17+
...
18+
} @ inputs: let
19+
system = "x86_64-linux"; # change arch here
1920

20-
specialArgs = {
21-
inherit system;
22-
inherit inputs;
23-
};
24-
in
25-
{
26-
## GRAPHICAL ISO ##
27-
nixosConfigurations.nixos-iso = nixpkgs.lib.nixosSystem {
28-
inherit system;
29-
modules = [
30-
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix"
31-
"${nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix"
32-
./graphical-configuration.nix
33-
];
34-
inherit specialArgs;
35-
};
36-
## MINIMAL ISO ##
37-
nixosConfigurations.nixos-minimal = nixpkgs.lib.nixosSystem {
38-
inherit system;
39-
modules = [
40-
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
41-
./minimal-configuration.nix
42-
];
43-
inherit specialArgs;
44-
};
21+
specialArgs = {
22+
inherit system;
23+
inherit inputs;
24+
};
25+
in {
26+
formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra;
27+
## GRAPHICAL ISO ##
28+
nixosConfigurations.nixos-iso = nixpkgs.lib.nixosSystem {
29+
inherit system;
30+
modules = [
31+
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix"
32+
"${nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix"
33+
./graphical-configuration.nix
34+
];
35+
inherit specialArgs;
4536
};
37+
## MINIMAL ISO ##
38+
nixosConfigurations.nixos-minimal = nixpkgs.lib.nixosSystem {
39+
inherit system;
40+
modules = [
41+
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
42+
./minimal-configuration.nix
43+
];
44+
inherit specialArgs;
45+
};
46+
};
4647
}

graphical-configuration.nix

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@
33
# ISO can be built using `nix build .#nixosConfigurations.nixos-iso.config.system.build.isoImage`
44
# Make sure to enable flakes and nix-command on the host system before building the ISO
55
# Resulting image can be found in ./result/iso/ directory
6-
76
{
87
config,
98
lib,
109
pkgs,
1110
system,
1211
inputs,
1312
...
14-
}:
15-
16-
{
13+
}: {
1714
nixpkgs.hostPlatform = lib.mkDefault system;
1815
nix.settings.experimental-features = [
1916
"nix-command"

minimal-configuration.nix

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@
33
# ISO can be built using `nix build .#nixosConfigurations.nixos-minimal.config.system.build.isoImage`
44
# Make sure to enable flakes and nix-command on the host system before building the ISO
55
# Resulting image can be found in ./result/iso/ directory
6-
76
{
87
config,
98
lib,
109
pkgs,
1110
system,
1211
...
13-
}:
14-
15-
{
12+
}: {
1613
nixpkgs.hostPlatform = lib.mkDefault system;
1714
nix.settings.experimental-features = [
1815
"nix-command"

0 commit comments

Comments
 (0)