flake.nix: Add packages for utility scripts to enable `nix build`

pull/74/head
Tristan Daniël Maat 2022-11-05 16:00:50 +00:00
parent 2304711359
commit ea06138a9b
Signed by: tlater
GPG Key ID: 49670FD774E43268
1 changed files with 26 additions and 14 deletions

View File

@ -72,13 +72,15 @@
lib = nixpkgs.lib;
};
####################
# VM launch script #
####################
apps.${system} = let
###################
# Utility scripts #
###################
packages.${system} = let
inherit (nixpkgs.legacyPackages.${system}) writeShellScript;
in {
default = let
default = self.packages.${system}.run-vm;
run-vm = let
vm = self.lib.makeNixosSystem {
inherit system;
extraModules = [(import ./configuration/hardware-specific/vm.nix)];
@ -91,23 +93,33 @@
"8448" = "8448"; # Matrix
"21025" = "21025"; # Starbound
};
in {
type = "app";
program = builtins.toString (writeShellScript "run-vm" ''
in
writeShellScript "run-vm" ''
export QEMU_OPTS="-m 3941 -smp 2 -display curses"
export QEMU_NET_OPTS="${qemuNetOpts}"
"${vm.config.system.build.vm}/bin/run-tlaternet-vm"
'');
};
'';
update-nextcloud-apps = let
nvfetcher-bin = "${nvfetcher.defaultPackage.${system}}/bin/nvfetcher";
in {
type = "app";
program = builtins.toString (writeShellScript "update-nextcloud-apps" ''
in
writeShellScript "update-nextcloud-apps" ''
cd "$(git rev-parse --show-toplevel)/pkgs"
${nvfetcher-bin} -o _sources_nextcloud -c nextcloud-apps.toml
'');
'';
};
apps.${system} = let
inherit (nixpkgs.legacyPackages.${system}) writeShellScript;
in {
default = {
type = "app";
program = builtins.toString self.packages.${system}.run-vm;
};
update-nextcloud-apps = {
type = "app";
program = builtins.toString self.packages.${system}.update-nextcloud-apps;
};
};