From 9340776aa392552089c635acdc3103ab35f09a78 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Sat, 28 Mar 2026 17:40:59 -0500 Subject: [PATCH] testpushCmd --- modules/hosts/john-pc/default.nix | 44 +++++++++++++++++-------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/modules/hosts/john-pc/default.nix b/modules/hosts/john-pc/default.nix index 4512eb5..7d3716b 100644 --- a/modules/hosts/john-pc/default.nix +++ b/modules/hosts/john-pc/default.nix @@ -1,17 +1,28 @@ -{ inputs, ... }: +{ self, inputs, ... }: let username = "john"; hostname = "john-pc-ubuntu"; + + testHost = "soteria"; testTarget = "fded:fb16:653e:25da:be24:11ff:fea0:753f"; # test-nix # testTarget = "fded:fb16:653e:25da:be24:11ff:fe89:1cc3"; # soteria + in { - flake.modules.homeManager."${hostname}" = { pkgs, config, ... }: + flake.modules.homeManager."${hostname}" = { config, pkgs, lib, ... }: let flakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic"; certDir = "${config.mtls.certDir}"; mtlsBundle = "${certDir}/${config.mtls.bundleFilename}"; resticPasswordFile = "${config.xdg.configHome}/restic/password.txt"; + + testPushCmd = (pkgs.writeShellScriptBin "test-push" '' + ${lib.getExe' pkgs.coreutils "mkdir"} -p /var/tmp/nix-build + ${lib.getExe' pkgs.coreutils "chmod"} 1777 /var/tmp/nix-build + ${lib.getExe pkgs.nixos-rebuild} switch \ + --flake ${flakeDir}#${testHost} \ + --target-host root@${testTarget} + ''); in { imports = with inputs.self.modules.homeManager; [ @@ -25,28 +36,21 @@ in docker desktop ]; - targets.genericLinux.enable = true; - - shell.program = "zsh"; - - home.username = "${username}"; - home.homeDirectory = "/home/${username}"; - - home.packages = with pkgs; [ - nixos-rebuild - (writeShellScriptBin "test-push" '' - mkdir -p /var/tmp/nix-build - chmod 1777 /var/tmp/nix-build - nixos-rebuild switch \ - --flake ${flakeDir}#${hostname} \ - --target-host root@${testTarget} - '') - ]; - # TODO: make this more restrictive, rather than allowing all unfree packages nixpkgs.config.allowUnfree = true; nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1w" ]; + targets.genericLinux.enable = true; + + home.username = "${username}"; + home.homeDirectory = "/home/${username}"; + home.packages = [ + pkgs.nixos-rebuild + testPushCmd + ]; + + shell.program = "zsh"; + homeManagerFlakeDir = flakeDir; docker.enable = true;