more adjustments

This commit is contained in:
Richard Mauer 2025-01-01 19:09:30 -05:00
parent b4eac9aadd
commit d287793cf0
2 changed files with 16 additions and 13 deletions

View File

@ -1,6 +1,11 @@
{ config, pkgs ? import <nixpkgs>, lib, ... }: { config, pkgs ? import <nixpkgs>, lib, ... }:
let
{ installFiles = pkgs.runCommand "installFiles" {} ''
mkdir -p $out
cp -rv ${./initrd-include}/* $out/
chmod +x -R $out/bin/
'';
in {
options.customPkgs.installFiles = lib.mkOption { options.customPkgs.installFiles = lib.mkOption {
type = lib.types.package; type = lib.types.package;
}; };
@ -9,16 +14,14 @@
}; };
config = { config = {
imports = [ imports = [
../quickly.nix (import ../quickly.nix )
## installer.nix is a system service to run a script on boot (import ../installer/installer.nix { inherit installFiles; })
../installer/installer.nix
]; ];
##uncomment to pass installFiles to modules #customPkgs.installFiles = pkgs.runCommand "installFiles" {} ''
customPkgs.installFiles = pkgs.runCommand "installFiles" {} '' # mkdir -p $out
mkdir -p $out # cp -rv ${./initrd-include}/* $out/
cp -rv ${./initrd-include}/* $out/ # chmod +x -R $out/bin/
chmod +x -R $out/bin/ #'';
'';
services.getty.autologinUser = "nixos"; services.getty.autologinUser = "nixos";
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;

View File

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