diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2024-08-22 14:48:24 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2024-08-22 14:48:24 +0200 |
commit | 567c22812fe1fbe525f1732661d253b3902710a9 (patch) | |
tree | b78ce8007f265ed9d542f7992beca14a12327dec /hosts | |
parent | d88404d51a6acd082e9917467862105ff1266367 (diff) | |
download | nixos-567c22812fe1fbe525f1732661d253b3902710a9.tar nixos-567c22812fe1fbe525f1732661d253b3902710a9.tar.gz nixos-567c22812fe1fbe525f1732661d253b3902710a9.tar.bz2 nixos-567c22812fe1fbe525f1732661d253b3902710a9.tar.xz nixos-567c22812fe1fbe525f1732661d253b3902710a9.zip |
...
Diffstat (limited to 'hosts')
-rw-r--r-- | hosts/sif/default.nix | 9 | ||||
-rw-r--r-- | hosts/sif/libvirt/default.nix | 38 |
2 files changed, 42 insertions, 5 deletions
diff --git a/hosts/sif/default.nix b/hosts/sif/default.nix index e3becb4b..d2902f95 100644 --- a/hosts/sif/default.nix +++ b/hosts/sif/default.nix | |||
@@ -12,11 +12,12 @@ let | |||
12 | in { | 12 | in { |
13 | imports = with flake.nixosModules.systemProfiles; [ | 13 | imports = with flake.nixosModules.systemProfiles; [ |
14 | ./hw.nix | 14 | ./hw.nix |
15 | 15 | ./mail ./libvirt | |
16 | tmpfs-root bcachefs initrd-all-crypto-modules default-locale openssh rebuild-machines | 16 | tmpfs-root bcachefs initrd-all-crypto-modules default-locale openssh rebuild-machines |
17 | networkmanager | 17 | networkmanager |
18 | flakeInputs.nixos-hardware.nixosModules.lenovo-thinkpad-p1 | 18 | flakeInputs.nixos-hardware.nixosModules.lenovo-thinkpad-p1 |
19 | flakeInputs.impermanence.nixosModules.impermanence | 19 | flakeInputs.impermanence.nixosModules.impermanence |
20 | flakeInputs.nixVirt.nixosModules.default | ||
20 | ]; | 21 | ]; |
21 | 22 | ||
22 | config = { | 23 | config = { |
@@ -627,10 +628,6 @@ in { | |||
627 | dconf.enable = true; | 628 | dconf.enable = true; |
628 | }; | 629 | }; |
629 | 630 | ||
630 | virtualisation.libvirtd = { | ||
631 | enable = true; | ||
632 | }; | ||
633 | |||
634 | zramSwap = { | 631 | zramSwap = { |
635 | enable = true; | 632 | enable = true; |
636 | algorithm = "zstd"; | 633 | algorithm = "zstd"; |
@@ -704,6 +701,8 @@ in { | |||
704 | 701 | ||
705 | security.pam.services.gtklock = {}; | 702 | security.pam.services.gtklock = {}; |
706 | 703 | ||
704 | home-manager.sharedModules = [ flakeInputs.nixVirt.homeModules.default ]; | ||
705 | |||
707 | system.stateVersion = "24.11"; | 706 | system.stateVersion = "24.11"; |
708 | }; | 707 | }; |
709 | } | 708 | } |
diff --git a/hosts/sif/libvirt/default.nix b/hosts/sif/libvirt/default.nix new file mode 100644 index 00000000..b5d95996 --- /dev/null +++ b/hosts/sif/libvirt/default.nix | |||
@@ -0,0 +1,38 @@ | |||
1 | { flakeInputs, ... }: | ||
2 | |||
3 | with flakeInputs.nixVirt.lib; | ||
4 | |||
5 | { | ||
6 | config = { | ||
7 | virtualisation.libvirtd.qemu.swtpm.enable = true; | ||
8 | virtualisation.libvirt = { | ||
9 | enable = true; | ||
10 | swtpm.enable = true; | ||
11 | connections."qemu:///system" = { | ||
12 | networks = [ | ||
13 | { active = null; | ||
14 | definition = network.writeXML { | ||
15 | name = "default"; | ||
16 | uuid = "012bfad7-4408-4345-8747-041853ef84c6"; | ||
17 | forward.mode = "nat"; | ||
18 | bridge = { | ||
19 | name = "virbr0"; | ||
20 | stp = true; | ||
21 | delay = 0; | ||
22 | }; | ||
23 | mac.address = "52:54:00:ad:34:af"; | ||
24 | ip = { | ||
25 | address = "192.168.122.1"; | ||
26 | netmask = "255.255.255.0"; | ||
27 | dhcp.range = { | ||
28 | start = "192.168.122.2"; | ||
29 | end = "192.168.122.254"; | ||
30 | }; | ||
31 | }; | ||
32 | }; | ||
33 | } | ||
34 | ]; | ||
35 | }; | ||
36 | }; | ||
37 | }; | ||
38 | } | ||