Skip to content

Commit

Permalink
flake: add formatter and format
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRTitor committed Aug 2, 2024
1 parent bdd55fe commit 3bc9350
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 39 deletions.
63 changes: 32 additions & 31 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
# 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
# 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
outputs = {
self,
nixpkgs,
...
} @ inputs: let
system = "x86_64-linux"; # change arch here

specialArgs = {
inherit system;
inherit inputs;
};
in
{
## 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;
};
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;
};
};
}
5 changes: 1 addition & 4 deletions graphical-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
# ISO can be built using `nix build .#nixosConfigurations.nixos-iso.config.system.build.isoImage`
# 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

{
config,
lib,
pkgs,
system,
inputs,
...
}:

{
}: {
nixpkgs.hostPlatform = lib.mkDefault system;
nix.settings.experimental-features = [
"nix-command"
Expand Down
5 changes: 1 addition & 4 deletions minimal-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
# ISO can be built using `nix build .#nixosConfigurations.nixos-minimal.config.system.build.isoImage`
# 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

{
config,
lib,
pkgs,
system,
...
}:

{
}: {
nixpkgs.hostPlatform = lib.mkDefault system;
nix.settings.experimental-features = [
"nix-command"
Expand Down

0 comments on commit 3bc9350

Please sign in to comment.