-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lot going on in here that I have not yet taken time to understand; however, in this state the build completes. Of note, the homemanager configuration is disabled because it currently fails. This version borrows more from mitchellh/nixos-config even in cases where I know I don't want a package in order to get the build to work. It appears I went my own path on the previous build. This time I wanted to have a working build quickly which meant I needed to start with someone elses build.
- Loading branch information
Jason Wieringa
authored and
Jason Wieringa
committed
Jan 15, 2025
1 parent
0306920
commit 23f921b
Showing
16 changed files
with
715 additions
and
339 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,57 @@ | ||
# Credit: https://github.com/mitchellh/nixos-config/blob/501f9aa0a669479c34d8d036f52a15b04002d259/flake.nix | ||
# Credit: https://github.com/mitchellh/nixos-config/blob/06b6eb4aa6f9817605f4d45a33331f4263e02d58/flake.nix | ||
|
||
{ | ||
description = "Jason Wieringa's NixOS"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/release-22.11"; | ||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; | ||
|
||
neovim-nightly-overlay = { | ||
url = "github:nix-community/neovim-nightly-overlay"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
|
||
home-manager = { | ||
url = "github:nix-community/home-manager/release-22.11"; | ||
url = "github:nix-community/home-manager/release-24.11"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
|
||
# Other packages | ||
zig.url = "github:mitchellh/zig-overlay"; | ||
}; | ||
|
||
outputs = inputs@{ self, nixpkgs, home-manager, ... }: { | ||
# This configuration would produce a vmdx for use in VMware. | ||
# | ||
# I tried to build a VMware image on Github actions, but they do not yet support | ||
# nested virtualization (kvm). I'll need a place in CI to build the VM image to | ||
# enable this workflow. | ||
# | ||
# packages.x86_64-linux = { | ||
# vmwareImage = self.nixosConfigurations.vm-intel.config.system.build.vmwareImage; | ||
# }; | ||
|
||
nixosConfigurations.vm-aarch64 = nixpkgs.lib.nixosSystem { | ||
outputs = { self, nixpkgs, home-manager, ... }@inputs: let | ||
overlays = [ | ||
inputs.zig.overlays.default | ||
|
||
(final: prev: { | ||
# gh CLI on stable has bugs. | ||
gh = inputs.nixpkgs-unstable.legacyPackages.${prev.system}.gh; | ||
}) | ||
]; | ||
|
||
mkSystem = import ./lib/mksystem.nix { | ||
inherit overlays nixpkgs inputs; | ||
}; | ||
in { | ||
nixosConfigurations.vm-aarch64 = mkSystem "vm-aarch64" { | ||
system = "aarch64-linux"; | ||
modules = [ | ||
./hardware/vm-aarch64.nix | ||
./machines/vm-aarch64.nix | ||
home-manager.nixosModules.home-manager { | ||
home-manager.users.jason = import ./users/jason/home-manager.nix; | ||
home-manager.useGlobalPkgs = true; | ||
home-manager.useUserPackages = true; | ||
} | ||
]; | ||
user = "jason"; | ||
}; | ||
}; | ||
} | ||
|
||
# nixosConfigurations.vm-aarch64 = nixpkgs.lib.nixosSystem { | ||
# system = "aarch64-linux"; | ||
# modules = [ | ||
# ./hardware/vm-aarch64.nix | ||
# ./machines/vm-aarch64.nix | ||
# home-manager.nixosModules.home-manager { | ||
# home-manager.users.jason = import ./users/jason/home-manager.nix; | ||
# home-manager.useGlobalPkgs = true; | ||
# home-manager.useUserPackages = true; | ||
# } | ||
# ]; | ||
# }; | ||
# }; | ||
# } |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# This function creates a NixOS system based on our VM setup for a | ||
# particular architecture. | ||
{ nixpkgs, overlays, inputs }: | ||
|
||
name: | ||
{ | ||
system, | ||
user, | ||
}: | ||
|
||
let | ||
# The config files for this system. | ||
machineConfig = ../machines/${name}.nix; | ||
userOSConfig = ../users/${user}/nixos.nix; | ||
# userHMConfig = ../users/${user}/home-manager.nix; | ||
|
||
systemFunc = nixpkgs.lib.nixosSystem; | ||
home-manager = inputs.home-manager.nixosModules; | ||
in systemFunc rec { | ||
inherit system; | ||
|
||
modules = [ | ||
# Apply our overlays. Overlays are keyed by system type so we have | ||
# to go through and apply our system type. We do this first so | ||
# the overlays are available globally. | ||
{ nixpkgs.overlays = overlays; } | ||
|
||
# Allow unfree packages. | ||
{ nixpkgs.config.allowUnfree = true; } | ||
|
||
machineConfig | ||
userOSConfig | ||
# home-manager.home-manager { | ||
# home-manager.useGlobalPkgs = true; | ||
# home-manager.useUserPackages = true; | ||
# home-manager.users.${user} = import userHMConfig { | ||
# inputs = inputs; | ||
# }; | ||
# } | ||
|
||
# We expose some extra arguments so that our modules can parameterize | ||
# better based on these values. | ||
{ | ||
config._module.args = { | ||
currentSystem = system; | ||
currentSystemName = name; | ||
currentSystemUser = user; | ||
inputs = inputs; | ||
}; | ||
} | ||
]; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* This configures nixpkgs.overlays to include our overlays/ directory. | ||
*/ | ||
let path = ../overlays; in with builtins; | ||
map (n: import (path + ("/" + n))) | ||
(filter (n: match ".*\\.nix" n != null || | ||
pathExists (path + ("/" + n + "/default.nix"))) | ||
(attrNames (readDir path))) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ config, pkgs, lib, currentSystem, currentSystemName,... }: { | ||
services.xserver = { | ||
enable = true; | ||
xkb.layout = "us"; | ||
desktopManager.gnome.enable = true; | ||
displayManager.gdm.enable = true; | ||
}; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# 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 = [ "uhci_hcd" "ahci" "xhci_pci" "nvme" "usbhid" "sr_mod" ]; | ||
boot.initrd.kernelModules = [ ]; | ||
boot.kernelModules = [ ]; | ||
boot.extraModulePackages = [ ]; | ||
|
||
fileSystems."/" = | ||
{ device = "/dev/disk/by-label/nixos"; | ||
fsType = "ext4"; | ||
}; | ||
|
||
fileSystems."/boot" = | ||
{ device = "/dev/disk/by-label/boot"; | ||
fsType = "vfat"; | ||
}; | ||
|
||
swapDevices = [ ]; | ||
} |
Oops, something went wrong.