Normalize format of nix files

This commit is contained in:
Manuel Thalmann 2024-05-01 14:00:39 +02:00
parent 819990937a
commit 3a2ce0ed87
2 changed files with 63 additions and 63 deletions

View file

@ -1,29 +1,29 @@
{ {
description = "NixOS Machine Configurations by manuth"; description = "NixOS Machine Configurations by manuth";
inputs = { inputs = {
nixpkgs.url = "nixpkgs/38c01297e7ec11f7b9e3f2cae7d6fcec6cc767ec"; nixpkgs.url = "nixpkgs/38c01297e7ec11f7b9e3f2cae7d6fcec6cc767ec";
};
outputs = { self, nixpkgs }:
let
system = import ./lib/system.nix {
inherit nixpkgs;
};
systems = [
{
name = "nixos";
}
];
in {
nixosConfigurations = builtins.listToAttrs
(
builtins.map (
{ name, config ? {} }:
{
inherit name;
value = system name config;
})
systems);
}; };
outputs = { self, nixpkgs }:
let
system = import ./lib/system.nix {
inherit nixpkgs;
};
systems = [
{
name = "nixos";
}
];
in {
nixosConfigurations = builtins.listToAttrs
(
builtins.map (
{ name, config ? {} }:
{
inherit name;
value = system name config;
})
systems);
};
} }

View file

@ -1,42 +1,42 @@
{ nixpkgs }: { nixpkgs }:
name : name :
{ dualBoot ? false } : { dualBoot ? false } :
let let
lib = nixpkgs.lib; lib = nixpkgs.lib;
configPath = ./machines/${name}.nix; configPath = ./machines/${name}.nix;
machineConfig = machineConfig =
if builtins.pathExists configPath then if builtins.pathExists configPath then
configPath configPath
else else
./hardware/base.nix; ./hardware/base.nix;
in in
lib.nixosSystem { lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
( (
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
imports = [ imports = [
machineConfig machineConfig
./config/custom-build-vm.nix ./config/custom-build-vm.nix
]; ];
system.stateVersion = "23.11"; system.stateVersion = "23.11";
virtualisation = virtualisation =
let let
vmConfig = { vmConfig = {
virtualisation = { virtualisation = {
sharedHostKeys = true; sharedHostKeys = true;
virt-viewer = true; virt-viewer = true;
}; };
}; };
in { in {
vmVariant = vmConfig; vmVariant = vmConfig;
vmVariantWithBootLoader = vmConfig; vmVariantWithBootLoader = vmConfig;
}; };
# Networking # Networking
networking.hostName = name; networking.hostName = name;
}) })
]; ];
} }