Functionning template

This commit is contained in:
Théo Barnouin 2024-09-10 09:51:13 +02:00
parent f1260cbc95
commit 91e61ef0a6
2 changed files with 19 additions and 17 deletions

View file

@ -13,23 +13,24 @@
outputs = inputs@{ self, nixpkgs, home-manager, microvm, ... }: outputs = inputs@{ self, nixpkgs, home-manager, microvm, ... }:
let let
hostName = "nixos-hypervisor";
system = "x86_64-linux"; system = "x86_64-linux";
username = "tbarnouin"; username = "tbarnouin";
in in
{ {
nixosConfigurations = { nixosConfigurations = {
nixos-hypervisor = nixpkgs.lib.nixosSystem { ${hostName} = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
./hosts/nixos-hypervisor/configuration.nix ./hosts/${hostName}/configuration.nix
{ {
networking.hostName = "nixos-hypervisor"; networking.hostName = hostName;
} }
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.${username} = import ./hosts/nixos-hypervisor/home.nix; home-manager.users.${username} = import ./hosts/${hostName}/home.nix;
} }
microvm.nixosModules.host microvm.nixosModules.host
{ {
@ -50,6 +51,7 @@
specialArgs = { specialArgs = {
inherit inputs; inherit inputs;
inherit username; inherit username;
inherit hostName;
}; };
}; };
nginx = nixpkgs.lib.nixosSystem { nginx = nixpkgs.lib.nixosSystem {

View file

@ -2,7 +2,7 @@
{ imports = { imports =
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
./hardware-configuration.nix # ./hardware-configuration.nix
]; ];
nix.settings = { nix.settings = {