nix/pkgs/default: init, add export-config
This commit is contained in:
parent
d2a3d8a3c6
commit
ce4bda8862
13
flake.nix
13
flake.nix
|
@ -15,16 +15,9 @@
|
||||||
lib =
|
lib =
|
||||||
import ./nix/lib { inherit nixpkgs; };
|
import ./nix/lib { inherit nixpkgs; };
|
||||||
|
|
||||||
packages = forAllSystems (system: {
|
packages = forAllSystems (system:
|
||||||
test_vm = nixpkgs.legacyPackages.${system}.runCommandLocal "test_vm" {
|
import ./nix/pkgs { inherit self nixpkgs system; }
|
||||||
src = nixosConfigurations.test_vm.config.system.build.toplevel;
|
);
|
||||||
} ''
|
|
||||||
set -x
|
|
||||||
mkdir -p $out/{bin,dev,etc,home,mnt,nix/store,nix/var,proc,root,run,sys,tmp,var,usr}
|
|
||||||
ln -s $src/init $out/
|
|
||||||
ln -s $src/etc $out/etc/static
|
|
||||||
'';
|
|
||||||
} // (import ./nix/pkgs/device-templates.nix { inherit self nixpkgs system; }));
|
|
||||||
|
|
||||||
nixosModule = { ... }: {
|
nixosModule = { ... }: {
|
||||||
imports = nixpkgs.lib.filesystem.listFilesRecursive ./nix/nixos-modules;
|
imports = nixpkgs.lib.filesystem.listFilesRecursive ./nix/nixos-modules;
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
{ self, nixpkgs, system }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (self.lib) config;
|
||||||
|
|
||||||
|
export-config-file = builtins.toFile "config.nix" (
|
||||||
|
nixpkgs.lib.generators.toPretty {} config
|
||||||
|
);
|
||||||
|
# Debug dump aid
|
||||||
|
export-config = nixpkgs.legacyPackages.${system}.runCommandLocal "config.nix" {} ''
|
||||||
|
cp ${export-config-file} $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
test_vm = nixpkgs.legacyPackages.${system}.runCommandLocal "test_vm" {
|
||||||
|
src = self.nixosConfigurations.test_vm.config.system.build.toplevel;
|
||||||
|
} ''
|
||||||
|
set -x
|
||||||
|
mkdir -p $out/{bin,dev,etc,home,mnt,nix/store,nix/var,proc,root,run,sys,tmp,var,usr}
|
||||||
|
ln -s $src/init $out/
|
||||||
|
ln -s $src/etc $out/etc/static
|
||||||
|
'';
|
||||||
|
|
||||||
|
device-templates = import ./device-templates.nix {
|
||||||
|
inherit self nixpkgs system;
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
device-templates // {
|
||||||
|
inherit export-config test_vm;
|
||||||
|
}
|
Loading…
Reference in New Issue