This commit is contained in:
Geoffrey Frogeye 2024-05-08 09:47:57 +02:00
parent 176be4f218
commit bdabf30728
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8

View file

@ -93,6 +93,37 @@
}
];
};
flakeTools = { self }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
apps = {
disko = {
type = "app";
program = "${disko.packages.${system}.default}/bin/disko";
};
nixos-generate-config = {
type = "app";
program = "${pkgs.nixos-install-tools}/bin/nixos-generate-config";
};
nixos-install = {
type = "app";
program = "${pkgs.nixos-install-tools}/bin/nixos-install";
};
nixos-rebuild = {
type = "app";
program = "${pkgs.nixos-rebuild}/bin/nixos-rebuild";
};
repl = {
type = "app";
program = "${pkgs.writeShellScript "vivarium-repl" ''
${pkgs.nix}/bin/nix repl --expr 'let flake = builtins.getFlake "${self}"; in flake // flake.nixosConfigurations // rec { pkgs = flake.inputs.nixpkgs.legacyPackages.${system}; lib = pkgs.lib; }'
''}";
};
};
}
);
};
in
{
@ -119,30 +150,5 @@
modules = [ ./pindakaas/sd.nix ];
};
nixOnDroidConfigurations.sprinkles = lib.nixOnDroidConfiguration { };
} // (flake-utils.lib.eachDefaultSystem (system:
# Machine dependant outputs
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
apps = {
disko = {
type = "app";
program = "${disko.packages.${system}.default}/bin/disko";
};
nixos-generate-config = {
type = "app";
program = "${pkgs.nixos-install-tools}/bin/nixos-generate-config";
};
nixos-install = {
type = "app";
program = "${pkgs.nixos-install-tools}/bin/nixos-install";
};
nixos-rebuild = {
type = "app";
program = "${pkgs.nixos-rebuild}/bin/nixos-rebuild";
};
};
}
));
}
} // (lib.flakeTools { inherit self; });
}