test and dev wrappers
This commit is contained in:
@@ -15,23 +15,18 @@ in
|
||||
selfPkgs = inputs.self.packages.${pkgs.stdenv.hostPlatform.system};
|
||||
resticPasswordFile = "${config.xdg.configHome}/restic/password.txt";
|
||||
flakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic";
|
||||
test-push = with pkgs; writeShellApplication {
|
||||
name = "test-push";
|
||||
runtimeInputs = [ nh ];
|
||||
text = ''nh os switch ${flakeDir}#${testHost} --target-host root@${testTarget} -e none'';
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = with inputs.self.modules.homeManager; [
|
||||
rebuild
|
||||
john
|
||||
mysops
|
||||
janus-ca
|
||||
mtls
|
||||
restic
|
||||
docker
|
||||
desktop
|
||||
# sshCerts
|
||||
step-client
|
||||
mysops
|
||||
# myPackage
|
||||
# myStepClient
|
||||
];
|
||||
# TODO: make this more restrictive, rather than allowing all unfree packages
|
||||
@@ -43,13 +38,17 @@ in
|
||||
home.username = "${username}";
|
||||
home.homeDirectory = "/home/${username}";
|
||||
home.packages = with pkgs; [
|
||||
nixos-rebuild
|
||||
test-push
|
||||
selfPkgs.jsl-zsh
|
||||
selfPkgs.my-neovim
|
||||
selfPkgs.step-client
|
||||
selfPkgs.ssh-certs
|
||||
# selfPkgs.step-bootstrap
|
||||
# selfPkgs.wg-platform
|
||||
# self'.packages.myWrappedPackage
|
||||
# (inputs.self.wrappers.test-push.apply {
|
||||
# inherit pkgs flakeDir;
|
||||
# host = testHost;
|
||||
# target = testTarget;
|
||||
# }).wrapper
|
||||
];
|
||||
|
||||
shell.program = "zsh";
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
{ self, inputs, ... }: {
|
||||
flake.wrappers.test-push = inputs.wrappers.lib.wrapModule ({config, lib, wlib, ... }: {
|
||||
options = {
|
||||
flakeDir = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
host = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
target = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
sshUser = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "root";
|
||||
};
|
||||
elevationStrategy = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "none";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
binName = "test-push";
|
||||
package = config.pkgs.nh;
|
||||
args = [
|
||||
"os" "switch" "${config.flakeDir}#${config.host}"
|
||||
"--target-host" "${config.sshUser}@${config.target}"
|
||||
"--elevation-strategy" "${config.elevationStrategy}"
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user