testpushCmd
This commit is contained in:
@@ -1,17 +1,28 @@
|
|||||||
{ inputs, ... }:
|
{ self, inputs, ... }:
|
||||||
let
|
let
|
||||||
username = "john";
|
username = "john";
|
||||||
hostname = "john-pc-ubuntu";
|
hostname = "john-pc-ubuntu";
|
||||||
|
|
||||||
|
testHost = "soteria";
|
||||||
testTarget = "fded:fb16:653e:25da:be24:11ff:fea0:753f"; # test-nix
|
testTarget = "fded:fb16:653e:25da:be24:11ff:fea0:753f"; # test-nix
|
||||||
# testTarget = "fded:fb16:653e:25da:be24:11ff:fe89:1cc3"; # soteria
|
# testTarget = "fded:fb16:653e:25da:be24:11ff:fe89:1cc3"; # soteria
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
flake.modules.homeManager."${hostname}" = { pkgs, config, ... }:
|
flake.modules.homeManager."${hostname}" = { config, pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
flakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic";
|
flakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic";
|
||||||
certDir = "${config.mtls.certDir}";
|
certDir = "${config.mtls.certDir}";
|
||||||
mtlsBundle = "${certDir}/${config.mtls.bundleFilename}";
|
mtlsBundle = "${certDir}/${config.mtls.bundleFilename}";
|
||||||
resticPasswordFile = "${config.xdg.configHome}/restic/password.txt";
|
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
|
in
|
||||||
{
|
{
|
||||||
imports = with inputs.self.modules.homeManager; [
|
imports = with inputs.self.modules.homeManager; [
|
||||||
@@ -25,28 +36,21 @@ in
|
|||||||
docker
|
docker
|
||||||
desktop
|
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
|
# TODO: make this more restrictive, rather than allowing all unfree packages
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1w" ];
|
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;
|
homeManagerFlakeDir = flakeDir;
|
||||||
docker.enable = true;
|
docker.enable = true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user