This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## **Updates to this file are now at https://github.com/giovtorres/kvm-install-vm.** | |
## **This updated version has more options and less hardcoded variables.** | |
# Take one argument from the commandline: VM name | |
if ! [ $# -eq 1 ]; then | |
echo "Usage: $0 <node-name>" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.img | |
*.raw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Instructions for fresh install | |
$ sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume --daemon | |
# reboot | |
$ source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh | |
$ echo 'export NIX_PATH=darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH' | tee -a ~/.zshrc | |
$ echo 'source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh' | tee -a ~/.zshrc | |
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable | |
$ nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin | |
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# NixOS Configuration for Framework Laptop | |
# | |
{ config, lib, pkgs, modulesPath, ... }: | |
{ | |
boot.kernelParams = [ "mem_sleep_default=deep" ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places. | |
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of | |
###. things to watch out for: | |
### - Check out the `nix-darwin` instructions, as they have changed. | |
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026 | |
### | |
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs). | |
# So here's a minimal Gist which worked for me as an install on a new M1 Pro. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Module for configuring libvirt with static NixOS networking | |
# instead of using libvirt managed bridge. | |
{ config, lib, pkgs, ... }: | |
with lib; | |
let | |
cfg = config.virtualisation.libvirtd.networking; | |
v6Enabled = cfg.ipv6.network != null; | |
v6PLen = toInt (elemAt (splitString "/" cfg.ipv6.network) 1); |