NixOS 23.11 and Flaking

This commit is contained in:
Greg Hellings
2023-11-28 10:30:17 -06:00
parent d472bf08d5
commit 2b7d613737
13 changed files with 252 additions and 3 deletions
+8 -1
View File
@@ -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";
};
};
}
+15
View File
@@ -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 ];
};
};
}
+2 -1
View File
@@ -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"