flake.nix: Add packages for utility scripts to enable nix build
This commit is contained in:
parent
2304711359
commit
ea06138a9b
40
flake.nix
40
flake.nix
|
@ -72,13 +72,15 @@
|
||||||
lib = nixpkgs.lib;
|
lib = nixpkgs.lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
####################
|
###################
|
||||||
# VM launch script #
|
# Utility scripts #
|
||||||
####################
|
###################
|
||||||
apps.${system} = let
|
packages.${system} = let
|
||||||
inherit (nixpkgs.legacyPackages.${system}) writeShellScript;
|
inherit (nixpkgs.legacyPackages.${system}) writeShellScript;
|
||||||
in {
|
in {
|
||||||
default = let
|
default = self.packages.${system}.run-vm;
|
||||||
|
|
||||||
|
run-vm = let
|
||||||
vm = self.lib.makeNixosSystem {
|
vm = self.lib.makeNixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
extraModules = [(import ./configuration/hardware-specific/vm.nix)];
|
extraModules = [(import ./configuration/hardware-specific/vm.nix)];
|
||||||
|
@ -91,23 +93,33 @@
|
||||||
"8448" = "8448"; # Matrix
|
"8448" = "8448"; # Matrix
|
||||||
"21025" = "21025"; # Starbound
|
"21025" = "21025"; # Starbound
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
type = "app";
|
writeShellScript "run-vm" ''
|
||||||
program = builtins.toString (writeShellScript "run-vm" ''
|
|
||||||
export QEMU_OPTS="-m 3941 -smp 2 -display curses"
|
export QEMU_OPTS="-m 3941 -smp 2 -display curses"
|
||||||
export QEMU_NET_OPTS="${qemuNetOpts}"
|
export QEMU_NET_OPTS="${qemuNetOpts}"
|
||||||
"${vm.config.system.build.vm}/bin/run-tlaternet-vm"
|
"${vm.config.system.build.vm}/bin/run-tlaternet-vm"
|
||||||
'');
|
'';
|
||||||
};
|
|
||||||
|
|
||||||
update-nextcloud-apps = let
|
update-nextcloud-apps = let
|
||||||
nvfetcher-bin = "${nvfetcher.defaultPackage.${system}}/bin/nvfetcher";
|
nvfetcher-bin = "${nvfetcher.defaultPackage.${system}}/bin/nvfetcher";
|
||||||
in {
|
in
|
||||||
type = "app";
|
writeShellScript "update-nextcloud-apps" ''
|
||||||
program = builtins.toString (writeShellScript "update-nextcloud-apps" ''
|
|
||||||
cd "$(git rev-parse --show-toplevel)/pkgs"
|
cd "$(git rev-parse --show-toplevel)/pkgs"
|
||||||
${nvfetcher-bin} -o _sources_nextcloud -c nextcloud-apps.toml
|
${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;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue