try try try again

This commit is contained in:
Richard Mauer 2025-01-01 20:04:34 -05:00
parent f6accc8faf
commit 2dc1cf664e
2 changed files with 22 additions and 20 deletions

View File

@ -1,30 +1,32 @@
{ config, pkgs ? import <nixpkgs>, lib, ... }:
let
installFiles = pkgs.runCommand "installFiles" {} ''
mkdir -p $out
cp -rv ${./initrd-include}/* $out/
chmod +x -R $out/bin/
'';
in {
#let
# installFiles = pkgs.runCommand "installFiles" {} ''
# mkdir -p $out
# cp -rv ${./initrd-include}/* $out/
# chmod +x -R $out/bin/
# '';
#in
{
imports = [
../quickly.nix
(../installer/installer.nix { inherit installFiles; inherit config; inherit pkgs; inherit lib; })
#(../installer/installer.nix { inherit customPkgs; inherit config; inherit pkgs; inherit lib; })
../installer/installer.nix
];
# _module.args = {
# installFiles = config.installFiles;
# };
options.installFiles = lib.mkOption {
_module.args = {
installFiles = config.customPkgs.installFiles;
};
options.customPkgs.installFiles = lib.mkOption {
type = lib.types.package;
};
config = {
#customPkgs.installFiles = pkgs.runCommand "installFiles" {} ''
# mkdir -p $out
# cp -rv ${./initrd-include}/* $out/
# chmod +x -R $out/bin/
#'';
customPkgs.installFiles = pkgs.runCommand "installFiles" {} ''
mkdir -p $out
cp -rv ${./initrd-include}/* $out/
chmod +x -R $out/bin/
'';
services.getty.autologinUser = "nixos";
security.sudo.wheelNeedsPassword = false;
@ -52,7 +54,7 @@ in {
pkgs.util-linux
pkgs.nettools
pkgs.nixos-facter
config.installFiles
config.customPkgs.installFiles
];
system.autoUpgrade.channel = "https://nixos.org/channels/nixos-24.11/";

View File

@ -1,4 +1,4 @@
{ pkgs, config, lib, installFiles, ... }:
{ pkgs, config, lib, ... }:
{
config = {
systemd.services.custom-install = {
@ -17,7 +17,7 @@
script = ''
mkdir /home/nixos/installer
cp -R ${installFiles}/ /home/nixos/installer
cp -R ${config.customPkgs.installFiles}/ /home/nixos/installer
ln -s /home/nixos/installer/bin/installer.sh /home/nixos/installer.sh
echo "Installer files are available in /home/nixos/installer"
echo "The installer.sh script is available in directly in /home/nixos/installer.sh"