mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat: use nixos-extra-modules
This commit is contained in:
parent
7ef0ebf5e7
commit
0caef3e587
19 changed files with 3397 additions and 1802 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{ self, inputs, config, lib, outputs, globals, nodes, minimal, configName, ... }:
|
||||
{ self, inputs, config, lib, homeLib, outputs, globals, nodes, minimal, configName, ... }:
|
||||
{
|
||||
options.swarselmodules.home-manager = lib.mkEnableOption "home-manager";
|
||||
config = lib.mkIf config.swarselmodules.home-manager {
|
||||
|
|
@ -29,7 +29,11 @@
|
|||
home.stateVersion = lib.mkDefault config.system.stateVersion;
|
||||
}
|
||||
];
|
||||
extraSpecialArgs = { inherit (inputs) self nixgl; inherit inputs outputs globals nodes minimal configName; };
|
||||
extraSpecialArgs = {
|
||||
inherit (inputs) self nixgl;
|
||||
inherit inputs outputs globals nodes minimal configName;
|
||||
lib = homeLib;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,58 +7,5 @@
|
|||
# "${self}/modules/nixos"
|
||||
# ];
|
||||
config = lib.mkIf config.swarselmodules.optional.microvmGuest
|
||||
{
|
||||
# imports = [
|
||||
# inputs.microvm.nixosModules.microvm
|
||||
|
||||
# "${self}/profiles/nixos"
|
||||
# "${self}/modules/nixos"
|
||||
# ];
|
||||
|
||||
boot.kernelParams = [ "systemd.hostname=${config.networking.hostName}" ];
|
||||
|
||||
node.name = config;
|
||||
documentation.enable = lib.mkForce false;
|
||||
|
||||
microvm = {
|
||||
guest.enable = lib.mkForce true;
|
||||
hypervisor = lib.mkDefault "qemu";
|
||||
mem = lib.mkDefault 1024 * 4;
|
||||
vcpu = lib.mkDefault 4;
|
||||
optimize.enable = false;
|
||||
writableStoreOverlay = "/nix/.rw-store";
|
||||
|
||||
# interfaces = flip lib.mapAttrsToList guestCfg.microvm.interfaces (
|
||||
# _: { mac, hostLink, ...}:
|
||||
# {
|
||||
# type = "macvtap";
|
||||
# id = "vm-${replaceStrings [ ":" ] [ "" ] mac}";
|
||||
# inherit mac;
|
||||
# macvtap = {
|
||||
# link = hostLink;
|
||||
# mode = "bridge";
|
||||
# };
|
||||
# }
|
||||
# );
|
||||
shares =
|
||||
[
|
||||
{
|
||||
source = "/nix/store";
|
||||
mountPoint = "/nix/.ro-store";
|
||||
tag = "ro-store";
|
||||
proto = "virtiofs";
|
||||
}
|
||||
];
|
||||
};
|
||||
# systemd.network.networks = lib.flip lib.concatMapAttrs guestCfg.microvm.interfaces (
|
||||
# name:
|
||||
# { mac, ... }:
|
||||
# {
|
||||
# "10-${name}".matchConfig = mkForce {
|
||||
# MACAddress = mac;
|
||||
# };
|
||||
# }
|
||||
# );
|
||||
|
||||
};
|
||||
{ };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
{ lib, config, ... }:
|
||||
{
|
||||
options.swarselmodules.optional.microvmHost = lib.mkEnableOption "optional microvmHost settings";
|
||||
options = {
|
||||
swarselmodules.optional.microvmHost = lib.mkEnableOption "optional microvmHost settings";
|
||||
};
|
||||
# imports = [
|
||||
# inputs.microvm.nixosModules.host
|
||||
# ];
|
||||
|
||||
config = lib.mkIf (config.swarselmodules.optional.microvmHost && config.swarselsystems.withMicroVMs) {
|
||||
config = lib.mkIf (config.guests != { }) {
|
||||
|
||||
microvm = {
|
||||
hypervisor = lib.mkDefault "qemu";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue