From 4141931c39a43cf79741d971b87e566831d8b249 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 1 May 2024 19:13:25 +0200 Subject: [PATCH] Reorder settings in flake --- flake.nix | 91 +++++++++++++++++++++++++++---------------------------- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/flake.nix b/flake.nix index 38bd268..c32a615 100644 --- a/flake.nix +++ b/flake.nix @@ -6,57 +6,56 @@ flake-utils.url = "github:numtide/flake-utils?ref=b1d9ab70662946ef0850d488da1c9019f3a9752a"; }; - outputs = { self, nixpkgs, flake-utils }: - let - systems = [ - { - name = "nixos"; - } - ]; - in - flake-utils.lib.eachDefaultSystem ( - system: + outputs = { self, nixpkgs, flake-utils }: ( + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in { + devShells.default = pkgs.mkShellNoCC ( + with pkgs; + { + packages = [ + nixos-rebuild + ]; + }); + } + ) // { + nixosConfigurations = let - pkgs = nixpkgs.legacyPackages.${system}; - in { - devShells.default = pkgs.mkShellNoCC ( - with pkgs; + systems = [ { - packages = [ - nixos-rebuild - ]; - }); - } - ) // - { - nixosConfigurations = builtins.listToAttrs - ( + name = "nixos"; + } + ]; + in + builtins.listToAttrs ( builtins.map ( - { name, system ? "x86_64-linux", ... }@config: - { - inherit name; + { name, system ? "x86_64-linux", ... }@config: { + inherit name; - value = nixpkgs.lib.nixosSystem { - inherit system; + value = nixpkgs.lib.nixosSystem { + inherit system; - modules = [ - ({ ... }: { config._module.args = { machineConfig = config; }; }) - ./lib/configuration.nix + modules = [ + ({ ... }: { config._module.args = { machineConfig = config; }; }) + ./lib/configuration.nix - ( - let - configCandidate = ./lib/machines/${name}.nix; - machineConfigPath = - if builtins.pathExists configCandidate - then - configCandidate - else - ./lib/hardware/base.nix; - in - machineConfigPath) - ]; - }; - }) + ( + let + configCandidate = ./lib/machines/${name}.nix; + + machineConfigPath = + if builtins.pathExists configCandidate + then + configCandidate + else + ./lib/hardware/base.nix; + in + machineConfigPath) + ]; + }; + }) systems); - }; + }); }