Export shared ZFS nix-store module
This commit is contained in:
+6
-16
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user