Export shared ZFS nix-store module

This commit is contained in:
Timothy J. Aveni
2026-06-30 21:43:28 -07:00
parent 3f26531f74
commit 837dea284c
6 changed files with 69 additions and 41 deletions
+6 -16
View File
@@ -15,9 +15,10 @@ write_config() {
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
amiBuilderModules.url = "git+${builder_repo_url}?rev=${builder_git_rev}";
};
outputs = { nixpkgs, ... }:
outputs = { nixpkgs, amiBuilderModules, ... }:
let
baseModule = { lib, modulesPath, pkgs, ... }: {
imports = [ "$${modulesPath}/virtualisation/amazon-image.nix" ];
@@ -60,23 +61,11 @@ write_config() {
};
zfsNixModule = { lib, ... }: {
boot.zfs.extraPools = [ "${nix_pool}" ];
systemd.services.amazon-init.enable = lib.mkForce false;
fileSystems."/nix" = {
device = "${nix_pool}/nix";
fsType = "zfs";
neededForBoot = true;
};
systemd.sockets.nix-daemon = {
after = [ "nix.mount" ];
requires = [ "nix.mount" ];
};
systemd.services.nix-daemon = {
after = [ "nix.mount" ];
requires = [ "nix.mount" ];
quixos.modules.zfsNixStore = {
enable = true;
pool = "${nix_pool}";
};
};
@@ -137,6 +126,7 @@ RUNNER_EOF
mkHost = hostName: extraModules: nixpkgs.lib.nixosSystem {
system = "${system}";
modules = [
amiBuilderModules.nixosModules.zfsNixStore
baseModule
({ ... }: {
networking.hostName = hostName;