flake.nix: embed pkgs instantiation in forAllSystems

This commit is contained in:
2026-05-25 15:37:12 +09:00
parent d85cbe3fb1
commit 8acff15072
+13 -19
View File
@@ -19,29 +19,23 @@
"aarch64-linux"
"aarch64-darwin"
];
forAllSystems = f: lib.genAttrs systems f;
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system nixpkgs.legacyPackages.${system});
in
{
packages = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
rec {
zoneFiles = pkgs.callPackage ./zoneConfig.nix {
inherit dns;
};
packages = forAllSystems (system: pkgs: rec {
zoneFiles = pkgs.callPackage ./zoneConfig.nix {
inherit dns;
};
nsdConfig = pkgs.callPackage ./nsd.conf.nix { inherit pkgs; };
nsdConfig = pkgs.callPackage ./nsd.conf.nix { inherit pkgs; };
default = pkgs.runCommand "pvv-dns" { } ''
mkdir -p $out/zones
mkdir -p $out/etc/nsd
default = pkgs.runCommand "pvv-dns" { } ''
mkdir -p $out/zones
mkdir -p $out/etc/nsd
cp -r ${zoneFiles}/* $out/zones/
cp -r ${nsdConfig} $out/etc/nsd/nsd.conf
'';
}
);
cp -r ${zoneFiles}/* $out/zones/
cp -r ${nsdConfig} $out/etc/nsd/nsd.conf
'';
});
};
}