NixOS 23.11 and Flaking
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#PROVIDER_PLACEHOLDER
|
||||
];
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
|
||||
# Packages installed on the whole system
|
||||
environment.systemPackages = with pkgs; [
|
||||
curl
|
||||
@@ -54,5 +56,10 @@
|
||||
useXkbConfig = true;
|
||||
};
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
nix = {
|
||||
package = pkgs.nixFlakes;
|
||||
settings = {
|
||||
experimental-features = "nix-command flakes";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
description = "A basic NixOS Vagrant install";
|
||||
|
||||
inputs = {
|
||||
nixstable.url = "github:nixos/nixpkgs/nixos-23.05";
|
||||
};
|
||||
|
||||
outputs = { nixstable, self, ... }@inputs:
|
||||
{
|
||||
nixosConfigurations.vagrant = nixstable.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [ ./configuration.nix ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -36,9 +36,10 @@ mount "${disk}1" /mnt
|
||||
# Bootstrap system
|
||||
nixos-generate-config --root /mnt
|
||||
curl -o /mnt/etc/nixos/configuration.nix "http://${host}:${port}/configuration.nix"
|
||||
curl -o /mnt/etc/nixos/flake.nix "http://${host}:${port}/flake.nix"
|
||||
sed -i -E -e "s,@BOOT_DEVICE@,${disk}," /mnt/etc/nixos/configuration.nix
|
||||
sed -i -E -e 's,(.*device = "/dev/disk/).*(".*),\1by-label/root\2,' /mnt/etc/nixos/hardware-configuration.nix
|
||||
nixos-install --no-root-password
|
||||
nixos-install --no-root-password --flake "/mnt/etc/nixos/#vagrant"
|
||||
|
||||
# Run stuff in the chroot
|
||||
curl -o /mnt/root/in-chroot.sh "http://${host}:${port}/in-chroot.sh"
|
||||
|
||||
Reference in New Issue
Block a user