First commit
This commit is contained in:
commit
3c39c5aaa4
9 changed files with 784 additions and 0 deletions
76
flake.nix
Normal file
76
flake.nix
Normal file
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
description = "A simple system flake using some Aux defaults";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-24.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
microvm.url = "github:astro/microvm.nix";
|
||||
microvm.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = inputs@{ nixpkgs, home-manager, microvm, ... }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
username = "tbarnouin";
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
nixos = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
./configuration.nix
|
||||
{
|
||||
networking.hostName = "nixos";
|
||||
}
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.${username} = import ./home.nix;
|
||||
}
|
||||
microvm.nixosModules.host
|
||||
{
|
||||
microvm = {
|
||||
autostart = [
|
||||
"nginx"
|
||||
];
|
||||
vms = {
|
||||
nginx = {
|
||||
flake = self;
|
||||
updateFlake = "git+file:///etc/nixos";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
inherit username;
|
||||
};
|
||||
};
|
||||
nginx = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
microvm.nixosModules.microvm
|
||||
"${inputs.self}/systems"
|
||||
"${inputs.self}/services"
|
||||
{
|
||||
services.vm_nginx = {
|
||||
enable = true;
|
||||
};
|
||||
services.vm = {
|
||||
enable = true;
|
||||
hostname = "nginx";
|
||||
vm_ip = "192.168.122.40";
|
||||
macAddr = "02:00:00:00:00:40";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue