This commit is contained in:
Shelvacu
2024-09-30 17:09:39 -07:00
parent d6ef5a81b3
commit d9ebd32f10
14 changed files with 199 additions and 144 deletions

View File

@@ -4,7 +4,8 @@
inputs, inputs,
lib, lib,
... ...
}: lib.mkMerge [ }:
lib.mkMerge [
(lib.mkIf (!config.vacu.minimal) { (lib.mkIf (!config.vacu.minimal) {
vacu.packages = vacu.packages =
(with pkgs; [ (with pkgs; [
@@ -21,9 +22,9 @@
inputs.nix-search-cli.packages.${pkgs.system}.default inputs.nix-search-cli.packages.${pkgs.system}.default
inputs.nix-inspect.packages.${pkgs.system}.default inputs.nix-inspect.packages.${pkgs.system}.default
]; ];
}) { })
vacu.packages = {
with pkgs; [ vacu.packages = with pkgs; [
nixos-rebuild nixos-rebuild
which which
nano nano

View File

@@ -3,7 +3,8 @@
pkgs, pkgs,
lib, lib,
... ...
}: let }:
let
inherit (lib) mkIf mkDefault; inherit (lib) mkIf mkDefault;
in in
{ {

View File

@@ -212,11 +212,17 @@ in
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA6lX25mCy35tf1NpcHMAdeRgvT7l0Dw0FWBH3eX4TE2"; publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA6lX25mCy35tf1NpcHMAdeRgvT7l0Dw0FWBH3eX4TE2";
}; };
legtop = { legtop = {
extraHostNames = [ "lt" "legtop.t2d.lan" ]; extraHostNames = [
"lt"
"legtop.t2d.lan"
];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKvunOGsmHg8igMGo0FpoXaegYI20wZylG8nsMFY4+JL"; publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKvunOGsmHg8igMGo0FpoXaegYI20wZylG8nsMFY4+JL";
}; };
mmm = { mmm = {
extraHostNames = [ "mmm.t2d.lan" "10.78.79.11" ]; extraHostNames = [
"mmm.t2d.lan"
"10.78.79.11"
];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFsorkZ3rIZ2lLigwQWfA64xZRlt5lk6QPzypg55eLlD"; publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFsorkZ3rIZ2lLigwQWfA64xZRlt5lk6QPzypg55eLlD";
}; };
}; };

View File

@@ -115,7 +115,10 @@
security.pki.certificates = config.vacu.rootCAs; security.pki.certificates = config.vacu.rootCAs;
# commands.nix # commands.nix
environment.pathsToLink = [ "/share/vacufuncs" "/etc/chromium" ]; environment.pathsToLink = [
"/share/vacufuncs"
"/etc/chromium"
];
vacu.shell.functionsDir = "/run/current-system/sw/share/vacufuncs"; vacu.shell.functionsDir = "/run/current-system/sw/share/vacufuncs";
programs.bash.interactiveShellInit = config.vacu.shell.interactiveLines; programs.bash.interactiveShellInit = config.vacu.shell.interactiveLines;
programs.bash.promptInit = lib.mkForce ""; programs.bash.promptInit = lib.mkForce "";

View File

@@ -11,10 +11,7 @@ let
enabledPkgs = builtins.map (o: o.package) enabledOptions; enabledPkgs = builtins.map (o: o.package) enabledOptions;
packagesSetType = types.attrsOf ( packagesSetType = types.attrsOf (
types.submodule ( types.submodule (
{ { name, ... }:
name,
...
}:
{ {
options = { options = {
enable = mkOption { enable = mkOption {

View File

@@ -1,4 +1,3 @@
{ {
# callPackage, # callPackage,
fetchFromGitHub, fetchFromGitHub,

View File

@@ -101,18 +101,29 @@
system = "x86_64-linux"; system = "x86_64-linux";
config.allowUnfree = true; config.allowUnfree = true;
}; };
mkNixosConfig = { mkNixosConfig =
{
unstable ? false, unstable ? false,
module, module,
system ? "x86_64-linux", system ? "x86_64-linux",
inp ? [ ], inp ? [ ],
}: let }:
let
suffix = if unstable then "-unstable" else ""; suffix = if unstable then "-unstable" else "";
nixpkgs = inputs.${"nixpkgs" + suffix}; nixpkgs = inputs.${"nixpkgs" + suffix};
inp' = inp ++ [ "nix-search-cli" "nix-inspect" "nixvim" ]; inp' = inp ++ [
"nix-search-cli"
"nix-inspect"
"nixvim"
];
thisInputs = builtins.listToAttrs (map (name: lib.nameValuePair name inputs.${name + suffix}) inp'); thisInputs = builtins.listToAttrs (map (name: lib.nameValuePair name inputs.${name + suffix}) inp');
in nixpkgs.lib.nixosSystem { in
specialArgs = { inputs = thisInputs // {inherit (inputs) self;}; }; nixpkgs.lib.nixosSystem {
specialArgs = {
inputs = thisInputs // {
inherit (inputs) self;
};
};
inherit system; inherit system;
modules = [ module ]; modules = [ module ];
}; };
@@ -123,9 +134,9 @@
nixpkgs = ({ revCount = 0; } // inputs.nixpkgs); nixpkgs = ({ revCount = 0; } // inputs.nixpkgs);
} }
); );
overlays.requireFileSub = (curr: prev: { overlays.requireFileSub = (
requireFile = { ... }@args: (prev args).overrideAttrs { allowSubstitutes = true; }; curr: prev: { requireFile = { ... }@args: (prev args).overrideAttrs { allowSubstitutes = true; }; }
}); );
overlays.default = self.overlays.requireFileSub; overlays.default = self.overlays.requireFileSub;
nixosConfigurations = { nixosConfigurations = {
triple-dezert = mkNixosConfig { triple-dezert = mkNixosConfig {
@@ -147,12 +158,8 @@
module = ./liam; module = ./liam;
inp = [ "sops-nix" ]; inp = [ "sops-nix" ];
}; };
lp0 = mkNixosConfig { lp0 = mkNixosConfig { module = ./lp0; };
module = ./lp0; shel-installer = mkNixosConfig { module = ./installer.nix; };
};
shel-installer = mkNixosConfig {
module = ./installer.nix;
};
fw = mkNixosConfig { fw = mkNixosConfig {
module = ./fw; module = ./fw;
inp = [ "nixos-hardware" ]; inp = [ "nixos-hardware" ];
@@ -173,7 +180,13 @@
modules = [ ./nix-on-droid ]; modules = [ ./nix-on-droid ];
extraSpecialArgs = { extraSpecialArgs = {
inputs = { inputs = {
inherit (inputs) nixpkgs self nixvim nix-search-cli nix-inspect; inherit (inputs)
nixpkgs
self
nixvim
nix-search-cli
nix-inspect
;
}; };
}; };
pkgs = import nixpkgs { system = "aarch64-linux"; }; pkgs = import nixpkgs { system = "aarch64-linux"; };
@@ -257,12 +270,20 @@
sm64 = packages.sm64coopdx; sm64 = packages.sm64coopdx;
ak = packages.authorizedKeys; ak = packages.authorizedKeys;
inherit (inputs.nixos-apple-silicon-unstable.packages.aarch64-linux) m1n1 uboot-asahi installer-bootstrap; inherit (inputs.nixos-apple-silicon-unstable.packages.aarch64-linux)
installer-bootstrap-cross = inputs.nixos-apple-silicon-unstable.packages.x86_64-linux.installer-bootstrap; m1n1
uboot-asahi
installer-bootstrap
;
installer-bootstrap-cross =
inputs.nixos-apple-silicon-unstable.packages.x86_64-linux.installer-bootstrap;
} }
// packages; // packages;
brokenBuilds = [ "sm64coopdx-aarch64" "installer-bootstrap" ]; brokenBuilds = [
"sm64coopdx-aarch64"
"installer-bootstrap"
];
all = all =
pkgs.runCommand "nix-stuff-all" pkgs.runCommand "nix-stuff-all"

View File

@@ -3,7 +3,8 @@
config, config,
lib, lib,
... ...
}: let }:
let
version = "6.10.4"; version = "6.10.4";
hash = "sha256:1y2m2pqrvsgr9ng72nnh4yvsprkvkznhnmn4p8g78350bzyrvip2"; hash = "sha256:1y2m2pqrvsgr9ng72nnh4yvsprkvkznhnmn4p8g78350bzyrvip2";
customKernel = pkgs.linux_6_10.override { customKernel = pkgs.linux_6_10.override {
@@ -15,8 +16,12 @@
modDirVersion = lib.versions.pad 3 version; modDirVersion = lib.versions.pad 3 version;
}; };
customKernelPackages = pkgs.linuxPackagesFor customKernel; customKernelPackages = pkgs.linuxPackagesFor customKernel;
in { in
system.nixos.tags = ["EXPERIMENT" "kernel-${config.boot.kernelPackages.kernel.version}"]; {
system.nixos.tags = [
"EXPERIMENT"
"kernel-${config.boot.kernelPackages.kernel.version}"
];
boot.kernelPackages = lib.mkForce customKernelPackages; boot.kernelPackages = lib.mkForce customKernelPackages;
# boot.zfs.extraPools = lib.mkForce []; # boot.zfs.extraPools = lib.mkForce [];

View File

@@ -3,14 +3,15 @@
pkgs, pkgs,
lib, lib,
... ...
}: let }:
let
in
# latestCompatibleLinuxPackages = lib.pipe pkgs.linuxKernel.packages [ # latestCompatibleLinuxPackages = lib.pipe pkgs.linuxKernel.packages [
# builtins.attrValues # builtins.attrValues
# (builtins.filter (kPkgs: (builtins.tryEval kPkgs).success && kPkgs ? kernel && kPkgs.kernel.pname == "linux" && kernelCompatible kPkgs.kernel)) # (builtins.filter (kPkgs: (builtins.tryEval kPkgs).success && kPkgs ? kernel && kPkgs.kernel.pname == "linux" && kernelCompatible kPkgs.kernel))
# (builtins.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version))) # (builtins.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version)))
# lib.last # lib.last
# ]; # ];
in
{ {
boot.zfs.extraPools = [ "fw" ]; boot.zfs.extraPools = [ "fw" ];
# config.boot.zfs.package.latestCompatibleLinuxPackages is fucked, if there are multiple compatible linuxes of the same version, it picks effectively an arbitrary one # config.boot.zfs.package.latestCompatibleLinuxPackages is fucked, if there are multiple compatible linuxes of the same version, it picks effectively an arbitrary one

View File

@@ -1,8 +1,5 @@
{ pkgs, inputs, ... }:
{ {
pkgs,
inputs,
...
}: {
imports = [ imports = [
../common/nixos.nix ../common/nixos.nix
inputs.nixos-hardware.nixosModules.gpd-micropc inputs.nixos-hardware.nixosModules.gpd-micropc

View File

@@ -1,25 +1,32 @@
{ ... }:
{ {
... boot.initrd.availableKernelModules = [
}: "ahci"
{ "xhci_pci"
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; "usbhid"
"usb_storage"
"sd_mod"
"sdhci_pci"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/e3aebf24-be76-4064-a9f5-3930c8cd1382"; device = "/dev/disk/by-uuid/e3aebf24-be76-4064-a9f5-3930c8cd1382";
fsType = "ext4"; fsType = "ext4";
}; };
boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/7fd2ca2d-7faf-4d40-8cde-ce531fa679b5"; boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/7fd2ca2d-7faf-4d40-8cde-ce531fa679b5";
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/4C47-D9A3"; device = "/dev/disk/by-uuid/4C47-D9A3";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = [
"fmask=0022"
"dmask=0022"
];
}; };
nixpkgs.hostPlatform = "x86_64-linux"; nixpkgs.hostPlatform = "x86_64-linux";
hardware.cpu.intel.updateMicrocode = true; hardware.cpu.intel.updateMicrocode = true;
} }

View File

@@ -1,7 +1,5 @@
{ inputs, ... }:
{ {
inputs,
...
}: {
imports = [ imports = [
../common/nixos.nix ../common/nixos.nix
inputs.nixos-apple-silicon.nixosModules.default inputs.nixos-apple-silicon.nixosModules.default
@@ -12,6 +10,7 @@
vacu.hostName = "mmm"; vacu.hostName = "mmm";
vacu.shell.color = "red"; vacu.shell.color = "red";
vacu.verifySystem.enable = false; vacu.verifySystem.enable = false;
vacu.verifySystem.expectedMac = "14:98:77:3f:b8:2e";
# asahi recommends systemd-boot # asahi recommends systemd-boot
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;

View File

@@ -1,29 +1,44 @@
{ config, lib, pkgs, ... }: let {
btrfsopts = [ "noatime" "compress=zstd" ]; config,
lib,
pkgs,
...
}:
let
btrfsopts = [
"noatime"
"compress=zstd"
];
in in
{ {
boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"usbhid"
"usb_storage"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/2f8b5094-94ab-4634-b11b-d4bcd2dc3f24"; device = "/dev/disk/by-uuid/2f8b5094-94ab-4634-b11b-d4bcd2dc3f24";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=root" ] ++ btrfsopts; options = [ "subvol=root" ] ++ btrfsopts;
}; };
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/4e75b9ed-ac4f-48a2-b38c-c5026723171f"; boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/4e75b9ed-ac4f-48a2-b38c-c5026723171f";
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/4407-1EF3"; device = "/dev/disk/by-uuid/4407-1EF3";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = [
"fmask=0022"
"dmask=0022"
];
}; };
fileSystems."/nix/store" = {
fileSystems."/nix/store" = device = "/dev/disk/by-uuid/2f8b5094-94ab-4634-b11b-d4bcd2dc3f24";
{ device = "/dev/disk/by-uuid/2f8b5094-94ab-4634-b11b-d4bcd2dc3f24";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=nix-store" ] ++ btrfsopts; options = [ "subvol=nix-store" ] ++ btrfsopts;
}; };
@@ -31,7 +46,10 @@ in
fileSystems."/btrfs-root" = { fileSystems."/btrfs-root" = {
device = "/dev/disk/by-uuid/2f8b5094-94ab-4634-b11b-d4bcd2dc3f24"; device = "/dev/disk/by-uuid/2f8b5094-94ab-4634-b11b-d4bcd2dc3f24";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=/" "noauto" ] ++ btrfsopts; options = [
"subvol=/"
"noauto"
] ++ btrfsopts;
}; };
swapDevices = [ ]; swapDevices = [ ];