From f55dbaf9846edd032c2ff3ca4fbfa86f39961216 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 22 Apr 2025 20:06:50 +0200 Subject: [PATCH] xps16/machines/arch: init --- hosts/xps16/configuration.nix | 2 ++ hosts/xps16/machines/arch.nix | 25 +++++++++++++++++++++++++ hosts/xps16/machines/default.nix | 7 +++++++ 3 files changed, 34 insertions(+) create mode 100644 hosts/xps16/machines/arch.nix create mode 100644 hosts/xps16/machines/default.nix diff --git a/hosts/xps16/configuration.nix b/hosts/xps16/configuration.nix index 939cba1..a0d96e1 100644 --- a/hosts/xps16/configuration.nix +++ b/hosts/xps16/configuration.nix @@ -13,6 +13,8 @@ ./services/thermald.nix ./services/tlp.nix + ./machines + ./testconfig.nix ]; diff --git a/hosts/xps16/machines/arch.nix b/hosts/xps16/machines/arch.nix new file mode 100644 index 0000000..d264ae9 --- /dev/null +++ b/hosts/xps16/machines/arch.nix @@ -0,0 +1,25 @@ +{ ... }: +{ + systemd.nspawn."arch" = { + enable = true; + execConfig.Boot = true; + + filesConfig = { + BindReadOnly = [ + "/nix/store" + # "/etc/resolv.conf:/etc/resolv.conf" + ]; + Bind = [ + "/home/h7x4/git" + "/home/h7x4/Downloads" + ]; + }; + networkConfig.Private = false; + }; + + systemd.services."systemd-nspawn@arch" = { + enable = true; + requiredBy = [ "machines.target" ]; + overrideStrategy = "asDropin"; + }; +} diff --git a/hosts/xps16/machines/default.nix b/hosts/xps16/machines/default.nix new file mode 100644 index 0000000..ccbf54f --- /dev/null +++ b/hosts/xps16/machines/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./arch.nix + ]; + + systemd.targets.machines.enable = true; +}