diff --git a/flake.nix b/flake.nix index 9047893..d4fc36a 100644 --- a/flake.nix +++ b/flake.nix @@ -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; + }; + }; } diff --git a/graphical-configuration.nix b/graphical-configuration.nix index 4eec5ca..fac9d83 100644 --- a/graphical-configuration.nix +++ b/graphical-configuration.nix @@ -3,7 +3,6 @@ # 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, @@ -11,9 +10,7 @@ system, inputs, ... -}: - -{ +}: { nixpkgs.hostPlatform = lib.mkDefault system; nix.settings.experimental-features = [ "nix-command" diff --git a/minimal-configuration.nix b/minimal-configuration.nix index 6aab960..42fa36d 100644 --- a/minimal-configuration.nix +++ b/minimal-configuration.nix @@ -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"