convert custom package

This commit is contained in:
Richard Mauer 2024-12-30 22:34:32 -05:00
parent 156615864b
commit 59b7cec348
2 changed files with 20 additions and 13 deletions

View File

@ -1,26 +1,33 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
#let #let
#disko = pkgs.callPackage ../pkgs/disko/package.nix {}; # installFiles = pkgs.runCommand "install-files" {
#disko = "github:nix-community/disko" # #inherit (pkgs) coreutils;
# } ''
# mkdir -p $out
# cp -rv ${./initrd-include}/* $out/
# '';
#in #in
let ## above is the olde installFiles Declaration.
installFiles = pkgs.runCommand "install-files" {
#inherit (pkgs) coreutils;
} ''
mkdir -p $out
cp -rv ${./initrd-include}/* $out/
'';
in
{ {
options.myPackages.installFiles = lib.mkOption {
type = lib.types.package;
};
imports = [ imports = [
../quickly.nix ../quickly.nix
## installer.nix is a system service to run a script on boot ## installer.nix is a system service to run a script on boot
../installer/installer.nix ../installer/installer.nix
]; ];
#_module.args = { inherit installFiles; }; ##uncomment to pass installFiles to modules
config = { config = {
myPackages.installFiles = pkgs.runCommand "install-files" "..." {
#inherit (pkgs) coreutils;
} ''
mkdir -p $out
cp -rv ${./initrd-include}/* $out/
'';
services.getty.autologinUser = "nixos"; services.getty.autologinUser = "nixos";
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
services.getty.loginProgram = "${installFiles}/bin/install.sh"; services.getty.loginProgram = "${config.myPackages.installFiles}/bin/install.sh";
users.users.nixos = { users.users.nixos = {
isNormalUser = true; isNormalUser = true;
password = "password"; password = "password";
@ -45,7 +52,7 @@ in
pkgs.nixos-install-tools pkgs.nixos-install-tools
pkgs.util-linux pkgs.util-linux
pkgs.nettools pkgs.nettools
installFiles config.myPackages.installFiles
]; ];
}; };

View File

@ -16,7 +16,7 @@
# Your installation commands here # Your installation commands here
if [ ! -f /etc/installation-completed ]; then if [ ! -f /etc/installation-completed ]; then
# Run your installation steps # Run your installation steps
"${pkgs.installFiles}/bin/install.sh" "${config.myPackages.installFiles}/bin/install.sh"
# Mark as completed # Mark as completed
touch /etc/installation-completed touch /etc/installation-completed
fi fi