Update nix-darwin for latest github-runner; refactor, following a fresh install (#51)

This commit is contained in:
Sridhar Ratnakumar 2024-03-24 19:37:44 -04:00 committed by GitHub
parent 08f8f424c9
commit bdba0619ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 167 additions and 61 deletions

View file

@ -0,0 +1,45 @@
/* My Linux VM running on macOS
## Using Parallels to create a NixOS VM
- Boot into a NixOS graphical installer
- Open terminal, and set a root password using `sudo su -` and `passwd root`
- Authorize yourself to login to the root user using `ssh-copy-id -o PreferredAuthentications=password root@linux-builder`
- Run nixos-anywhere (see justfile; `j remote-deploy`)
*/
{ flake, modulesPath, ... }: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
./hardware-configuration.nix
../../../nixos/self/primary-as-admin.nix
../../../nixos/server/harden/basics.nix
../../../nixos/current-location.nix
./parallels-vm.nix
# Dev
# ./dev.nix
];
# Basics
system.stateVersion = "23.11";
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
swraid.mdadmConf = ''
MAILADDR srid@srid.ca
'';
};
networking = {
hostName = "parallels-linux-builder";
};
# Distributed Builder
nixpkgs.hostPlatform = "aarch64-linux";
boot.binfmt.emulatedSystems = [ "x86_64-linux" ]; # For cross-compiling
services.openssh.enable = true;
users.users.${flake.config.people.myself}.openssh.authorizedKeys.keys = [
# macos /etc/ssh/ssh_host_ed25519_key.pub
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICra+ZidiwrHGjcGnyqPvHcZDvnGivbLMayDyecPYDh0"
];
}

View file

@ -0,0 +1,11 @@
# Stuff I need for development (not required for CI per se)
{ flake, ... }: {
imports = [
flake.inputs.self.nixosModules.home-manager
flake.inputs.self.nixosModules.my-home
../../../nixos/nix.nix
../../../nixos/docker.nix
];
programs.nix-ld.enable = true; # For vscode-server
}

View file

@ -0,0 +1,38 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ ];
boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/eb7e394a-1c20-4996-a392-efa3b69665ed";
fsType = "ext4";
};
fileSystems."/boot" =
{
device = "/dev/disk/by-uuid/423B-8BF8";
fsType = "vfat";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s5.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
hardware.parallels.enable = true;
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "prl-tools" ];
}

View file

@ -0,0 +1,6 @@
# Parallels VM support
{
hardware.parallels.enable = true;
nixpkgs.config.allowUnfree = true; # for parallels
services.ntp.enable = true; # Accurate time in Parallels VM?
}