Reorder settings in flake

This commit is contained in:
Manuel Thalmann 2024-05-01 19:13:25 +02:00
parent 92a4e3d332
commit 4141931c39

View file

@ -6,57 +6,56 @@
flake-utils.url = "github:numtide/flake-utils?ref=b1d9ab70662946ef0850d488da1c9019f3a9752a"; flake-utils.url = "github:numtide/flake-utils?ref=b1d9ab70662946ef0850d488da1c9019f3a9752a";
}; };
outputs = { self, nixpkgs, flake-utils }: outputs = { self, nixpkgs, flake-utils }: (
let flake-utils.lib.eachDefaultSystem (
systems = [ system:
{ let
name = "nixos"; pkgs = nixpkgs.legacyPackages.${system};
} in {
]; devShells.default = pkgs.mkShellNoCC (
in with pkgs;
flake-utils.lib.eachDefaultSystem ( {
system: packages = [
nixos-rebuild
];
});
}
) // {
nixosConfigurations =
let let
pkgs = nixpkgs.legacyPackages.${system}; systems = [
in {
devShells.default = pkgs.mkShellNoCC (
with pkgs;
{ {
packages = [ name = "nixos";
nixos-rebuild }
]; ];
}); in
} builtins.listToAttrs (
) //
{
nixosConfigurations = builtins.listToAttrs
(
builtins.map ( builtins.map (
{ name, system ? "x86_64-linux", ... }@config: { name, system ? "x86_64-linux", ... }@config: {
{ inherit name;
inherit name;
value = nixpkgs.lib.nixosSystem { value = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
({ ... }: { config._module.args = { machineConfig = config; }; }) ({ ... }: { config._module.args = { machineConfig = config; }; })
./lib/configuration.nix ./lib/configuration.nix
( (
let let
configCandidate = ./lib/machines/${name}.nix; configCandidate = ./lib/machines/${name}.nix;
machineConfigPath =
if builtins.pathExists configCandidate machineConfigPath =
then if builtins.pathExists configCandidate
configCandidate then
else configCandidate
./lib/hardware/base.nix; else
in ./lib/hardware/base.nix;
machineConfigPath) in
]; machineConfigPath)
}; ];
}) };
})
systems); systems);
}; });
} }