diff --git a/flake.nix b/flake.nix index 1902770..1821b51 100644 --- a/flake.nix +++ b/flake.nix @@ -1,29 +1,29 @@ { - description = "NixOS Machine Configurations by manuth"; + description = "NixOS Machine Configurations by manuth"; - inputs = { - nixpkgs.url = "nixpkgs/38c01297e7ec11f7b9e3f2cae7d6fcec6cc767ec"; + inputs = { + 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); - }; } diff --git a/lib/system.nix b/lib/system.nix index aa3debc..c32c835 100644 --- a/lib/system.nix +++ b/lib/system.nix @@ -1,42 +1,42 @@ { nixpkgs }: - name : - { dualBoot ? false } : - let - lib = nixpkgs.lib; - configPath = ./machines/${name}.nix; - machineConfig = - if builtins.pathExists configPath then - configPath - else - ./hardware/base.nix; - in - lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ( - { config, pkgs, lib, ... }: { - imports = [ - machineConfig - ./config/custom-build-vm.nix - ]; + name : + { dualBoot ? false } : + let + lib = nixpkgs.lib; + configPath = ./machines/${name}.nix; + machineConfig = + if builtins.pathExists configPath then + configPath + else + ./hardware/base.nix; + in + lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ( + { config, pkgs, lib, ... }: { + imports = [ + machineConfig + ./config/custom-build-vm.nix + ]; - system.stateVersion = "23.11"; + system.stateVersion = "23.11"; - virtualisation = - let - vmConfig = { - virtualisation = { - sharedHostKeys = true; - virt-viewer = true; - }; - }; - in { - vmVariant = vmConfig; - vmVariantWithBootLoader = vmConfig; - }; + virtualisation = + let + vmConfig = { + virtualisation = { + sharedHostKeys = true; + virt-viewer = true; + }; + }; + in { + vmVariant = vmConfig; + vmVariantWithBootLoader = vmConfig; + }; - # Networking - networking.hostName = name; - }) - ]; - } + # Networking + networking.hostName = name; + }) + ]; + }