Skip to content

Commit

Permalink
flake: add formatter alejandra
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRTitor committed Aug 2, 2024
1 parent e8f9ab9 commit d95f940
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update-flake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ jobs:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Reformat *.nix files
run: nix run nixpkgs#nixfmt-rfc-style -- $(find . -type f -name "*.nix" -printf "%P ")
run: nix fmt
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@v21
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;
};
};
}
6 changes: 1 addition & 5 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 All @@ -23,7 +20,6 @@
boot.kernelPackages = pkgs.linuxPackages_zen;
boot.supportedFilesystems = [
"btrfs"
"reiserfs"
"vfat"
"f2fs"
"xfs"
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 d95f940

Please sign in to comment.