nix-on-droid fixes
This commit is contained in:
parent
11494614c8
commit
9bf27e1960
2 changed files with 17 additions and 9 deletions
16
helpers.nix
16
helpers.nix
|
@ -100,10 +100,12 @@ with inputs.nixpkgs.lib; {
|
|||
}: let
|
||||
pkgs = import nixpkgs {
|
||||
system = "aarch64-linux";
|
||||
config.allowUnfree = true;
|
||||
overlays = [
|
||||
nix-on-droid.overlays.default
|
||||
];
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
overlays = [
|
||||
nix-on-droid.overlays.default
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
activateNixOnDroid = configuration:
|
||||
|
@ -114,12 +116,10 @@ with inputs.nixpkgs.lib; {
|
|||
nixOnDroidConfigurations.${hostname} = nix-on-droid.lib.nixOnDroidConfiguration {
|
||||
inherit pkgs;
|
||||
|
||||
extraSpecialArgs = {inherit uid gid;};
|
||||
|
||||
modules = [
|
||||
./suites/nix-on-droid
|
||||
{
|
||||
user.uid = uid;
|
||||
user.gid = gid;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
uid,
|
||||
gid,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
|
@ -17,6 +19,12 @@ with lib; let
|
|||
${pkgs.openssh}/bin/sshd -f "${sshdDirectory}/sshd_config" -D
|
||||
'';
|
||||
in {
|
||||
# Set UID & GID
|
||||
user = {
|
||||
uid = uid;
|
||||
gid = gid;
|
||||
};
|
||||
|
||||
# NixOS version.
|
||||
system.stateVersion = "24.05";
|
||||
|
||||
|
@ -28,7 +36,7 @@ in {
|
|||
# SSHD script.
|
||||
build.activation.sshd = ''
|
||||
$DRY_RUN_CMD mkdir $VERBOSE_ARG --parents "${config.user.home}/.ssh"
|
||||
$DRY_RUN_CMD cat ${authorizedKeys} > "${config.user.home}/.ssh/authorized_keys"
|
||||
$DRY_RUN_CMD echo ${authorizedKeys} > "${config.user.home}/.ssh/authorized_keys"
|
||||
|
||||
if [[ ! -d "${sshdDirectory}" ]]; then
|
||||
$DRY_RUN_CMD rm $VERBOSE_ARG --recursive --force "${sshdTmpDirectory}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue