https://github.com/lvnilesh/nix-one-click
is this enough? will it autogenerate the lock file?
You should generate the lock file by running nix flake lock
, and commit that to the repo.
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
Also, 24.05 was recently released.
Don't forget to add your ssh key to rootAuthorizedKeys
Assuming this is for https://nixos.asia/en/nixos-install-oneclick
I added my pubkey.
I did not generate lock. I could not generate lock because the git repo is remote.
Install finished when I used my README in my git repo https://github.com/lvnilesh/nix-one-click
Then the new nix machine wont boot after a power cycle.
I am now debugging.
Thanks for your help.
@LV Nilesh It is not advisable to ignore generating the lock file. You won't get the reproducibility benefits of NixOS.
Just clone the git repo and add it
LV Nilesh said:
Then the new nix machine wont boot after a power cycle.
I am now debugging.
Let me know how that goes. Probably something to do with boot loader configuration. I've tested that flake only on Parallels VM on mac.
can’t clone without git
Newbie does not know how to get git in a USB booted live nix environment
nix run nixpkgs#git clone <url>
(For more on that nifty nix run
command, see https://nixos.asia/en/nix-first)
:+1:
nix --extra-experimental-features "nix-command flakes" run nixpkgs#git clone git@github:lvnilesh/nix-one-click
Thanks.
nix --extra-experimental-features "nix-command flakes" run nix flake lock
nix --extra-experimental-features "nix-command flakes" run flake lock
nix --extra-experimental-features "nix-command flakes" flake lock
all fail LOL
I cloned git - then CD into it and then don't yet know how to nix flake lock
all fail LOL
Post the error message. Your 3rd command is correct.
git cloned https://github.com/lvnilesh/nix-one-click /tmp/nix-one-click
cd /tmp/nix-one-click
nix --extra-experimental-features "nix-command flakes" flake lock
error: while fetching the input git+file://tmp/nix-one-click
error: getting the HEAD of the git tree /tmp/nix-one-click failed with exit code 1
error executing git: no such file or directory
this screenshot when I try UEFI
and
image.png
this screenshot when I try SeaBIOS
Ah, try this.
First, run nix shell nixpkgs#git
to enter a shell with git
on PATH.
Then, you can run nix flake lock
, etc. normally.
nix --extra-experimental-features "nix-command flakes" run nixpkgs#git clone [email protected]:lvnilesh/nix-one-click
cd nix-one-click
nix --extra-experimental-features "nix-command flakes" shell nixpkgs#git
nix --extra-experimental-features "nix-command flakes" flake lock
git status
git add flake.lock
git commit -am "add flake lock"
git push
bash README.md
power off and reboot from disk and be greeted by
image.png
README.md contains
# Assuming
# - your system is x86_64-linux
# - your harddrive device is /dev/sda
FLAKE="github:lvnilesh/nix-one-click#nixoneclick"
DISK_DEVICE=/dev/sda
sudo nix \
--extra-experimental-features 'flakes nix-command' \
run github:nix-community/disko#disko-install -- \
--flake "$FLAKE" \
--write-efi-boot-entries \
--disk main "$DISK_DEVICE"
Can you say more about the machine you are installing to?
Was /dev/sda
the right disk ?
yes
Try the graphical installer, and see what configuration.nix it generates. Then adopt that config into your flake:
https://nixos.asia/en/nixos-install-flake
Did that. It created https://github.com/lvnilesh/nixos-config/blob/master/configuration.nix
How would I add that to this https://github.com/lvnilesh/nix-one-click/blob/master/flake.nix
Add it to the modules
list
Just like how you are importing ./disk-config.nix
Make sure to git add
the new file (Nix won't see it otherwise)
Though at this point you can get rid of ./disk-config.nix
, and the existing boot config from flake.
LV Nilesh said:
I recall facing this while setting up a server at Juspay. It is most likely due to Intel VMD being enabled in your BIOS, which would require the proprietary intel drivers to get it working in NixOS. I recommend just disabling it if that’s the case and you can use mdadm
for raid configuration instead.
Last updated: Nov 15 2024 at 12:33 UTC