writeShellApplication updates
This commit is contained in:
@@ -3,26 +3,23 @@ let
|
||||
username = "john";
|
||||
hostname = "john-pc-ubuntu";
|
||||
|
||||
testHost = "soteria"; # which host to test build
|
||||
testTarget = "fded:fb16:653e:25da:be24:11ff:fea0:753f"; # test-nix
|
||||
resolvedTarget = "test-nix";
|
||||
# testTarget = "fded:fb16:653e:25da:be24:11ff:fe89:1cc3"; # soteria
|
||||
# testTarget = "fded:fb16:653e:25da:be24:11ff:fea0:753f"; # test-nix
|
||||
testHost = "soteria"; # which host to test build
|
||||
testTarget = "test-nix";
|
||||
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager."${hostname}" = { config, pkgs, lib, ... }:
|
||||
let
|
||||
flakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic";
|
||||
selfPkgs = inputs.self.packages.${pkgs.stdenv.hostPlatform.system};
|
||||
resticPasswordFile = "${config.xdg.configHome}/restic/password.txt";
|
||||
|
||||
testPushCmd = (pkgs.writeShellScriptBin "test-push" ''
|
||||
${lib.getExe' pkgs.coreutils "echo"} "Pushing ${testHost} to ${resolvedTarget}"
|
||||
${lib.getExe pkgs.nh} os switch ${flakeDir}#${testHost} \
|
||||
-e passwordless \
|
||||
--target-host ${resolvedTarget} \
|
||||
--diff always \
|
||||
"$@"
|
||||
'');
|
||||
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; [
|
||||
@@ -46,8 +43,11 @@ in
|
||||
home.homeDirectory = "/home/${username}";
|
||||
home.packages = with pkgs; [
|
||||
nixos-rebuild
|
||||
testPushCmd
|
||||
inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.my-neovim
|
||||
test-push
|
||||
selfPkgs.neovim-min
|
||||
# ${selfPkgs}.my-neovim
|
||||
selfPkgs.richPrinter
|
||||
selfPkgs.janus-ca
|
||||
];
|
||||
|
||||
shell.program = "zsh";
|
||||
|
||||
Reference in New Issue
Block a user