Compare commits
136 Commits
upstream_a
...
mt7927
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c2b0d8c2f | ||
|
|
9550032c08 | ||
|
|
d46c2a0225 | ||
|
|
6430b1cc77 | ||
|
|
157d4e4c94 | ||
|
|
075a4b8262 | ||
|
|
d62b3d8a62 | ||
|
|
ee4794859a | ||
|
|
791f67eb82
|
||
|
|
bf27504a5a
|
||
|
|
620c12eaa7
|
||
|
|
e2658412ab
|
||
|
|
a86e8c3a18
|
||
|
|
299185970d
|
||
|
|
6670fdbe73
|
||
|
|
ed4eead5c0
|
||
|
|
7f9f010217
|
||
|
|
ea133ded21
|
||
|
|
04ede4bfee
|
||
|
|
2529ca4510
|
||
|
|
69384f6cad
|
||
|
|
3df022ab3f
|
||
|
|
bf006a968b
|
||
|
|
b1b2ea2109
|
||
|
|
1211bc1c44
|
||
|
|
776ed67675
|
||
|
|
24e03ed8f7
|
||
|
|
e75c4087c3
|
||
|
|
43f3c1f955
|
||
|
|
7ab1d4b9e1
|
||
|
|
ad88a526bc
|
||
|
|
b0cebc7973
|
||
|
|
c90513cbea
|
||
|
|
07a8882766
|
||
|
|
e106a9fad1
|
||
|
|
70f3ae6894
|
||
|
|
d883dda34c
|
||
|
|
05a0459e5a
|
||
|
|
641c21c77f
|
||
|
|
88634655d0
|
||
|
|
0bd5931013
|
||
|
|
dc28b9a112
|
||
|
|
d8d466e737
|
||
|
|
f94278e96d
|
||
|
|
6452d591a7
|
||
|
|
4fbbec96c0
|
||
|
|
412c6d7220
|
||
|
|
519354fd2c
|
||
|
|
6d976d8319
|
||
|
|
910652e98c
|
||
|
|
e218973f1b
|
||
|
|
b48d2b7b25
|
||
|
|
144d8fab6c
|
||
|
|
15c99bc0b5
|
||
|
|
a547b3b04b
|
||
|
|
5de1c0cb56
|
||
|
|
906741bfcf
|
||
|
|
568440f3f1
|
||
|
|
e428bd2f00
|
||
|
|
9bd896ff4b
|
||
|
|
f663f794d0
|
||
|
|
782253a557
|
||
|
|
4ca486d7f8
|
||
|
|
8eb3c459bd
|
||
|
|
1523e691d5
|
||
|
|
c4ff96b847
|
||
|
|
aa05ab7289
|
||
|
|
b743421749
|
||
|
|
9099c4b67e
|
||
|
|
b67b491efa
|
||
|
|
ddd3200ca6
|
||
|
|
d0968ab836
|
||
|
|
8c223a066d
|
||
|
|
606b952304
|
||
|
|
c542dcdee9
|
||
|
|
39997dc4d4
|
||
|
|
3348feb613
|
||
|
|
f651241f20
|
||
|
|
ff23d8ad20
|
||
|
|
eebbf9f4aa
|
||
|
|
3bf912f3be
|
||
|
|
331651bf23
|
||
|
|
b16871c701
|
||
|
|
381448b338
|
||
|
|
300dfc68cf
|
||
|
|
8ccd34aba9
|
||
|
|
a94df0944b
|
||
|
|
b63df577d9
|
||
|
|
73335b080f
|
||
|
|
e01863cfc7
|
||
|
|
fc343d7897
|
||
|
|
09e36de78e
|
||
|
|
f13689e2c1
|
||
|
|
57b83f7175
|
||
|
|
f27aae960f
|
||
|
|
5b849c266e
|
||
|
|
588e434b56
|
||
|
|
09355dd927
|
||
|
|
4276f63c59
|
||
|
|
614ef2e5cf
|
||
|
|
888613a229
|
||
|
|
24b089a313
|
||
|
|
2f05b9e600
|
||
|
|
e4225a82bb
|
||
|
|
4a0f0bd8c8
|
||
|
|
381eb1523e
|
||
|
|
8888838457
|
||
|
|
3918775c1d
|
||
|
|
3bf84445a3
|
||
|
|
69b5cf9217
|
||
|
|
3d9513f2c5
|
||
|
|
ae6cce96a2
|
||
|
|
3274d1903f
|
||
|
|
a01b58f6ac
|
||
|
|
fb7b1322da
|
||
|
|
69b6a81b8b
|
||
|
|
f5c30860ab
|
||
|
|
255b39df0a
|
||
|
|
da66a6917b
|
||
|
|
ad2c4809d7
|
||
|
|
fe49204e3f
|
||
|
|
fa44003fad
|
||
|
|
bc0a64fb8b
|
||
|
|
3048b62834
|
||
|
|
08b424e1f3
|
||
|
|
185c43761c
|
||
|
|
37abf58271 | ||
|
|
3b007f8bc5 | ||
|
|
d358e9383e | ||
|
|
f036ec4b96 | ||
|
|
74ee87a111 | ||
|
|
d0f23c0cb1 | ||
|
|
c72141e070 | ||
|
|
e77c0ed330 | ||
|
|
70c2fb694a | ||
|
|
b32635fe71 |
@@ -1 +1 @@
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGu+k5lrirokdW5zVdRVBOqEOAvAPlIkG/MdJNc9g5ky cardno:000611194908
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID0+4zi26M3eYWnIrciR54kOlGxzfgCXG+o4ea1zpzrk openpgp:0x7FF123C8
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
@@ -10,18 +9,26 @@
|
||||
./roles/2ship2harkinian
|
||||
./roles/alacritty
|
||||
./roles/amd_s2idle
|
||||
./roles/android
|
||||
./roles/ansible
|
||||
./roles/ares
|
||||
./roles/base
|
||||
./roles/bluetooth
|
||||
./roles/boot
|
||||
./roles/build_in_ram
|
||||
./roles/chromecast
|
||||
./roles/chromium
|
||||
./roles/d2
|
||||
./roles/direnv
|
||||
./roles/disko
|
||||
./roles/distributed_build
|
||||
./roles/doas
|
||||
./roles/docker
|
||||
./roles/dont_use_substituters
|
||||
./roles/ecc
|
||||
./roles/emacs
|
||||
./roles/emulate_isa
|
||||
./roles/esim
|
||||
./roles/firefox
|
||||
./roles/firewall
|
||||
./roles/flux
|
||||
@@ -29,12 +36,16 @@
|
||||
./roles/gcloud
|
||||
./roles/git
|
||||
./roles/global_options
|
||||
./roles/gnome_keyring
|
||||
./roles/gnuplot
|
||||
./roles/gpg
|
||||
./roles/graphics
|
||||
./roles/graphviz
|
||||
./roles/hydra
|
||||
./roles/image_based_appliance
|
||||
./roles/iso
|
||||
./roles/iso_mount
|
||||
./roles/jujutsu
|
||||
./roles/kanshi
|
||||
./roles/kodi
|
||||
./roles/kubernetes
|
||||
@@ -43,35 +54,50 @@
|
||||
./roles/lvfs
|
||||
./roles/media
|
||||
./roles/memtest86
|
||||
./roles/minimal_base
|
||||
./roles/network
|
||||
./roles/nix_index
|
||||
./roles/nix_repl
|
||||
./roles/nix_worker
|
||||
./roles/nixdev
|
||||
./roles/nvme
|
||||
./roles/openpgp_card_tools
|
||||
./roles/optimized_build
|
||||
./roles/pcsx2
|
||||
./roles/podman
|
||||
./roles/postgresql_client
|
||||
./roles/python
|
||||
./roles/qemu
|
||||
./roles/recovery
|
||||
./roles/reset
|
||||
./roles/rpcs3
|
||||
./roles/rust
|
||||
./roles/sequoia
|
||||
./roles/shadps4
|
||||
./roles/shikane
|
||||
./roles/shipwright
|
||||
./roles/sm64ex
|
||||
./roles/sops
|
||||
./roles/sound
|
||||
./roles/spaghettikart
|
||||
./roles/ssh
|
||||
./roles/sshd
|
||||
./roles/steam
|
||||
./roles/steam_run_free
|
||||
./roles/sway
|
||||
./roles/tekton
|
||||
./roles/terraform
|
||||
./roles/thunderbolt
|
||||
./roles/user
|
||||
./roles/uutils
|
||||
./roles/vnc_client
|
||||
./roles/vscode
|
||||
./roles/wasm
|
||||
./roles/waybar
|
||||
./roles/webcam
|
||||
./roles/wine
|
||||
./roles/wireguard
|
||||
./roles/yubikey
|
||||
./roles/zfs
|
||||
./roles/zrepl
|
||||
./roles/zsh
|
||||
@@ -79,199 +105,159 @@
|
||||
./util/unfree_polyfill
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
nix.settings.trusted-users = [ "@wheel" ];
|
||||
|
||||
# boot.kernelPackages = pkgs.linuxPackages_6_11;
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
# Use nixos-rebuild-ng
|
||||
# system.rebuild.enableNg = true;
|
||||
|
||||
# Keep outputs so we can build offline.
|
||||
nix.extraOptions = ''
|
||||
keep-outputs = true
|
||||
keep-derivations = true
|
||||
'';
|
||||
|
||||
# Technically only needed when building the ISO because nix detects ZFS in the filesystem list normally. I basically always want this so I'm just setting it to always be on.
|
||||
boot.supportedFilesystems.zfs = true;
|
||||
# TODO: Is this different from boot.supportedFilesystems = [ "zfs" ]; ?
|
||||
|
||||
services.getty = {
|
||||
autologinUser = "talexander"; # I use full disk encryption so the user password is irrelevant.
|
||||
autologinOnce = true;
|
||||
};
|
||||
users.mutableUsers = false;
|
||||
users.users.talexander = {
|
||||
isNormalUser = true;
|
||||
createHome = true; # https://github.com/NixOS/nixpkgs/issues/6481
|
||||
group = "talexander";
|
||||
extraGroups = [ "wheel" ];
|
||||
uid = 11235;
|
||||
packages = with pkgs; [
|
||||
tree
|
||||
config = {
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
"ca-derivations"
|
||||
# "blake3-hashes"
|
||||
# "git-hashing"
|
||||
];
|
||||
# Generate with `mkpasswd -m scrypt`
|
||||
hashedPassword = "$7$CU..../....VXvNQ8za3wSGpdzGXNT50/$HcFtn/yvwPMCw4888BelpiAPLAxe/zU87fD.d/N6U48";
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGu+k5lrirokdW5zVdRVBOqEOAvAPlIkG/MdJNc9g5ky"
|
||||
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIEI6mu6I5Jp+Ib0vJxapGHbEShZjyvzV8jz5DnzDrI39AAAABHNzaDo="
|
||||
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIAFNcSXwvy+brYTOGo56G93Ptuq2MmZsjvRWAfMqbmMLAAAABHNzaDo="
|
||||
];
|
||||
};
|
||||
users.groups.talexander.gid = 11235;
|
||||
nix.settings.trusted-users = [ "@wheel" ];
|
||||
nix.settings.connect-timeout = 5;
|
||||
nix.settings.min-free = 128000000;
|
||||
nix.settings.max-free = 1000000000;
|
||||
nix.settings.fallback = true;
|
||||
nix.settings.warn-dirty = false;
|
||||
nix.settings.fsync-metadata = true;
|
||||
# Ensure store paths are durably written to disk before registering the paths so a crash mid-build does not leave us in a corrupted state.
|
||||
nix.settings.fsync-store-paths = true;
|
||||
|
||||
# Automatic garbage collection
|
||||
nix.gc = lib.mkIf (!config.me.buildingIso) {
|
||||
# Runs nix-collect-garbage --delete-older-than 5d
|
||||
automatic = true;
|
||||
persistent = true;
|
||||
dates = "monthly";
|
||||
# randomizedDelaySec = "14m";
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
nix.settings.auto-optimise-store = !config.me.buildingIso;
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
# Use doas instead of sudo
|
||||
security.doas.enable = true;
|
||||
security.doas.wheelNeedsPassword = false;
|
||||
security.sudo.enable = false;
|
||||
security.doas.extraRules = [
|
||||
{
|
||||
# Retain environment (for example NIX_PATH)
|
||||
keepEnv = true;
|
||||
persist = true; # Only ask for a password the first time.
|
||||
}
|
||||
];
|
||||
# Keep outputs so we can build offline.
|
||||
nix.settings.keep-outputs = true;
|
||||
nix.settings.keep-derivations = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
wget
|
||||
mg
|
||||
rsync
|
||||
libinput
|
||||
htop
|
||||
tmux
|
||||
file
|
||||
usbutils # for lsusb
|
||||
pciutils # for lspci
|
||||
ripgrep
|
||||
strace
|
||||
# ltrace # Disabled because it uses more than 48GB of /tmp space during test phase.
|
||||
trace-cmd # ftrace
|
||||
tcpdump
|
||||
git-crypt
|
||||
gnumake
|
||||
ncdu
|
||||
nix-tree
|
||||
libarchive # bsdtar
|
||||
lsof
|
||||
doas-sudo-shim # To support --use-remote-sudo for remote builds
|
||||
dmidecode # Read SMBIOS information.
|
||||
ipcalc
|
||||
gptfdisk # for cgdisk
|
||||
nix-output-monitor # For better view into nixos-rebuild
|
||||
nix-serve-ng # Serve nix store over http
|
||||
];
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
# Automatic garbage collection
|
||||
nix.gc = lib.mkIf (!config.me.buildingPortable) {
|
||||
# Runs nix-collect-garbage --delete-older-than 5d
|
||||
automatic = true;
|
||||
persistent = true;
|
||||
dates = "monthly";
|
||||
# randomizedDelaySec = "14m";
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
hostKeys = [
|
||||
{
|
||||
path = "/persist/ssh/ssh_host_ed25519_key";
|
||||
type = "ed25519";
|
||||
}
|
||||
{
|
||||
path = "/persist/ssh/ssh_host_rsa_key";
|
||||
type = "rsa";
|
||||
bits = 4096;
|
||||
}
|
||||
];
|
||||
};
|
||||
nix.settings.auto-optimise-store = !config.me.buildingPortable;
|
||||
|
||||
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
||||
hideMounts = true;
|
||||
directories = [
|
||||
"/var/lib/iwd" # Wifi settings
|
||||
"/var/lib/nixos" # Contains user information (uids/gids)
|
||||
"/var/lib/systemd" # Systemd state directory for random seed, persistent timers, core dumps, persist hardware state like backlight and rfkill
|
||||
"/var/log/journal" # Logs, alternatively set `services.journald.storage = "volatile";` to write to /run/log/journal
|
||||
];
|
||||
files = [
|
||||
"/etc/machine-id" # Systemd unique machine id "otherwise, the system journal may fail to list earlier boots, etc"
|
||||
"/etc/ssh/ssh_host_rsa_key"
|
||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
||||
"/etc/ssh/ssh_host_ed25519_key"
|
||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
||||
];
|
||||
users.talexander = {
|
||||
environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) {
|
||||
hideMounts = true;
|
||||
directories = [
|
||||
{
|
||||
directory = "persist";
|
||||
user = "talexander";
|
||||
group = "talexander";
|
||||
mode = "0700";
|
||||
}
|
||||
"/var/lib/nixos" # Contains user information (uids/gids)
|
||||
"/var/lib/systemd" # Systemd state directory for random seed, persistent timers, core dumps, persist hardware state like backlight and rfkill
|
||||
"/var/log/journal" # Logs, alternatively set `services.journald.storage = "volatile";` to write to /run/log/journal
|
||||
];
|
||||
files = [
|
||||
"/etc/machine-id" # Systemd unique machine id "otherwise, the system journal may fail to list earlier boots, etc"
|
||||
];
|
||||
};
|
||||
|
||||
# Write a list of the currently installed packages to /etc/current-system-packages
|
||||
# environment.etc."current-system-packages".text =
|
||||
# let
|
||||
# packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
|
||||
# sortedUnique = builtins.sort builtins.lessThan (lib.unique packages);
|
||||
# formatted = builtins.concatStringsSep "\n" sortedUnique;
|
||||
# in
|
||||
# formatted;
|
||||
|
||||
# nixpkgs.overlays = [
|
||||
# (final: prev: {
|
||||
# foot = throw "foo";
|
||||
# })
|
||||
# ];
|
||||
|
||||
nixpkgs.overlays =
|
||||
let
|
||||
disableTests = (
|
||||
# Example: (disableTests "coreutils")
|
||||
package_name:
|
||||
(final: prev: {
|
||||
"${package_name}" = prev."${package_name}".overrideAttrs (old: {
|
||||
doCheck = false;
|
||||
doInstallCheck = false;
|
||||
});
|
||||
})
|
||||
);
|
||||
disableTestsPython = (
|
||||
# Example: (disableTestsPython "scipy")
|
||||
package_name:
|
||||
(final: prev: {
|
||||
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
|
||||
(python-final: python-prev: {
|
||||
"${package_name}" = python-prev."${package_name}".overridePythonAttrs (oldAttrs: {
|
||||
doCheck = false;
|
||||
});
|
||||
})
|
||||
];
|
||||
})
|
||||
);
|
||||
disableOptimizations = (
|
||||
# Example: (disableOptimizations "coreutils")
|
||||
package_name:
|
||||
(final: prev: {
|
||||
"${package_name}" = final.unoptimized."${package_name}";
|
||||
})
|
||||
);
|
||||
disableOptimizationsScope = (
|
||||
# Example: (disableOptimizationsScope "kdePackages" "qtbase")
|
||||
scope: package_name:
|
||||
(final: prev: {
|
||||
"${scope}" = prev."${scope}".overrideScope (
|
||||
scopeFinal: scopePrev: {
|
||||
"${package_name}" = final.unoptimized."${scope}"."${package_name}";
|
||||
}
|
||||
);
|
||||
})
|
||||
);
|
||||
disableOptimizationsPython3 = (
|
||||
# Example: (disableOptimizationsPython3 "scipy")
|
||||
package_name:
|
||||
(final: prev: {
|
||||
python3Packages = prev.python3Packages.override {
|
||||
overrides = python-final: python-prev: {
|
||||
"${package_name}" = final.unoptimized.python3.pkgs."${package_name}";
|
||||
};
|
||||
};
|
||||
})
|
||||
);
|
||||
in
|
||||
[
|
||||
(disableTests "coreutils")
|
||||
(disableTests "coreutils-full")
|
||||
(disableTests "libuv")
|
||||
(final: prev: {
|
||||
inherit (final.unoptimized) libtpms libjxl;
|
||||
})
|
||||
(disableOptimizationsPython3 "scipy")
|
||||
# Works but probably sets python2's scipy to be python3:
|
||||
#
|
||||
# (final: prev: {
|
||||
# pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
|
||||
# (python-final: python-prev: {
|
||||
# scipy = final.unoptimized.python3Packages.scipy;
|
||||
# })
|
||||
# ];
|
||||
# })
|
||||
];
|
||||
|
||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||
#
|
||||
# Most users should NEVER change this value after the initial install, for any reason,
|
||||
# even if you've upgraded your system to a new NixOS release.
|
||||
#
|
||||
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
||||
# to actually do that.
|
||||
#
|
||||
# This value being lower than the current NixOS release does NOT mean your system is
|
||||
# out of date, out of support, or vulnerable.
|
||||
#
|
||||
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||||
# and migrated your data accordingly.
|
||||
#
|
||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||
system.stateVersion = "24.11"; # Did you read the comment?
|
||||
};
|
||||
|
||||
# Write a list of the currently installed packages to /etc/current-system-packages
|
||||
environment.etc."current-system-packages".text =
|
||||
let
|
||||
packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
|
||||
sortedUnique = builtins.sort builtins.lessThan (lib.unique packages);
|
||||
formatted = builtins.concatStringsSep "\n" sortedUnique;
|
||||
in
|
||||
formatted;
|
||||
|
||||
# environment.etc."system-packages-with-source".text = builtins.concatStringsSep "\n\n" (
|
||||
# builtins.map (
|
||||
# x: x.file + "\n" + builtins.concatStringsSep "\n" (builtins.map (s: " " + s) x.value)
|
||||
# ) config.environment.systemPackages.definitionsWithLocations
|
||||
# );
|
||||
|
||||
# nixpkgs.overlays = [
|
||||
# (final: prev: {
|
||||
# nix = pkgs-unstable.nix;
|
||||
# })
|
||||
# ];
|
||||
|
||||
# nixpkgs.overlays = [
|
||||
# (final: prev: {
|
||||
# foot = throw "foo";
|
||||
# })
|
||||
# ];
|
||||
|
||||
# Copy the NixOS configuration file and link it from the resulting system
|
||||
# (/run/current-system/configuration.nix). This is useful in case you
|
||||
# accidentally delete configuration.nix.
|
||||
# system.copySystemConfiguration = true;
|
||||
|
||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||
#
|
||||
# Most users should NEVER change this value after the initial install, for any reason,
|
||||
# even if you've upgraded your system to a new NixOS release.
|
||||
#
|
||||
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
||||
# to actually do that.
|
||||
#
|
||||
# This value being lower than the current NixOS release does NOT mean your system is
|
||||
# out of date, out of support, or vulnerable.
|
||||
#
|
||||
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
||||
# and migrated your data accordingly.
|
||||
#
|
||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||
system.stateVersion = "24.11"; # Did you read the comment?
|
||||
|
||||
}
|
||||
|
||||
185
nix/configuration/flake.lock
generated
185
nix/configuration/flake.lock
generated
@@ -1,22 +1,5 @@
|
||||
{
|
||||
"nodes": {
|
||||
"ansible-sshjail": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"path": "flakes/ansible-sshjail",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"path": "flakes/ansible-sshjail",
|
||||
"type": "path"
|
||||
},
|
||||
"parent": []
|
||||
},
|
||||
"crane": {
|
||||
"locked": {
|
||||
"lastModified": 1731098351,
|
||||
@@ -39,11 +22,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1756733629,
|
||||
"narHash": "sha256-dwWGlDhcO5SMIvMSTB4mjQ5Pvo2vtxvpIknhVnSz2I8=",
|
||||
"lastModified": 1769524058,
|
||||
"narHash": "sha256-zygdD6X1PcVNR2PsyK4ptzrVEiAdbMqLos7utrMDEWE=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "a5c4f2ab72e3d1ab43e3e65aa421c6f2bd2e12a1",
|
||||
"rev": "71a3fc97d80881e91710fe721f1158d3b96ae14d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -89,42 +72,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"inputs": {
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -147,13 +94,40 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"impermanence": {
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"impermanence",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1737831083,
|
||||
"narHash": "sha256-LJggUHbpyeDvNagTUrdhe/pRVp4pnS6wVKALS782gRI=",
|
||||
"lastModified": 1768598210,
|
||||
"narHash": "sha256-kkgA32s/f4jaa4UG+2f8C225Qvclxnqs76mf8zvTVPg=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "c47b2cc64a629f8e075de52e4742de688f930dc6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"impermanence": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1769548169,
|
||||
"narHash": "sha256-03+JxvzmfwRu+5JafM0DLbxgHttOQZkUtDWBmeUkN8Y=",
|
||||
"owner": "nix-community",
|
||||
"repo": "impermanence",
|
||||
"rev": "4b3e914cdf97a5b536a889e939fb2fd2b043a170",
|
||||
"rev": "7b1d382faf603b6d264f58627330f9faa5cba149",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -190,11 +164,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1756787288,
|
||||
"narHash": "sha256-rw/PHa1cqiePdBxhF66V7R+WAP8WekQ0mCDG4CFqT8Y=",
|
||||
"lastModified": 1770197578,
|
||||
"narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d0fc30899600b9b3466ddb260fd83deb486c32f1",
|
||||
"rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -204,22 +178,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-dda3dcd3f": {
|
||||
"locked": {
|
||||
"lastModified": 1746663147,
|
||||
"narHash": "sha256-Ua0drDHawlzNqJnclTJGf87dBmaO/tn7iZ+TCkTRpRc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "dda3dcd3fe03e991015e9a74b22d35950f264a54",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "dda3dcd3fe03e991015e9a74b22d35950f264a54",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1730741070,
|
||||
@@ -236,22 +194,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-unoptimized": {
|
||||
"locked": {
|
||||
"lastModified": 1756787288,
|
||||
"narHash": "sha256-rw/PHa1cqiePdBxhF66V7R+WAP8WekQ0mCDG4CFqT8Y=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d0fc30899600b9b3466ddb260fd83deb486c32f1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pre-commit-hooks-nix": {
|
||||
"inputs": {
|
||||
"flake-compat": [
|
||||
@@ -281,14 +223,10 @@
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"ansible-sshjail": "ansible-sshjail",
|
||||
"disko": "disko",
|
||||
"impermanence": "impermanence",
|
||||
"lanzaboote": "lanzaboote",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-dda3dcd3f": "nixpkgs-dda3dcd3f",
|
||||
"nixpkgs-unoptimized": "nixpkgs-unoptimized",
|
||||
"zsh-histdb": "zsh-histdb"
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
@@ -311,53 +249,6 @@
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"zsh-histdb": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"path": "flakes/zsh-histdb",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"path": "flakes/zsh-histdb",
|
||||
"type": "path"
|
||||
},
|
||||
"parent": []
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
||||
@@ -1,264 +1,133 @@
|
||||
# Build ISO image
|
||||
# nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#iso.odo
|
||||
# output: result/iso/nixos.iso
|
||||
|
||||
# Run the ISO image
|
||||
# doas "$(nix-build '<nixpkgs>' --no-out-link -A 'qemu')/bin/qemu-system-x86_64" \
|
||||
# -accel kvm \
|
||||
# -cpu host \
|
||||
# -smp cores=8 \
|
||||
# -m 32768 \
|
||||
# -drive "file=$(nix-build '<nixpkgs>' --no-out-link -A 'OVMF.fd')/FV/OVMF.fd,if=pflash,format=raw,readonly=on" \
|
||||
# -drive if=pflash,format=raw,file="/tmp/OVMF_VARS.fd" \
|
||||
# -nic user,hostfwd=tcp::60022-:22 \
|
||||
# -boot order=d \
|
||||
# -cdrom "$(readlink -f ./result/iso/nixos*.iso)" \
|
||||
# -display vnc=127.0.0.1:0
|
||||
#
|
||||
# doas cp "$(nix-build '<nixpkgs>' --no-out-link -A 'OVMF.fd')/FV/OVMF_VARS.fd" /tmp/OVMF_VARS.fd
|
||||
# doas "$(nix-build '<nixpkgs>' --no-out-link -A 'qemu')/bin/qemu-system-x86_64" -accel kvm -cpu host -smp cores=8 -m 32768 -drive "file=$(nix-build '<nixpkgs>' --no-out-link -A 'OVMF.fd')/FV/OVMF.fd,if=pflash,format=raw,readonly=on" -drive if=pflash,format=raw,file="/tmp/OVMF_VARS.fd" -nic user,hostfwd=tcp::60022-:22 -boot order=d -cdrom /persist/machine_setup/nix/configuration/result/iso/nixos*.iso -display vnc=127.0.0.1:0
|
||||
|
||||
# Get a repl for this flake
|
||||
# nix repl --expr "builtins.getFlake \"$PWD\""
|
||||
|
||||
# TODO maybe use `nix eval --raw .#iso.odo.outPath`
|
||||
# iso.odo.isoName == "nixos.iso"
|
||||
# full path = <outPath> / iso / <isoName>
|
||||
# TODO maybe use `nix eval --raw .#odo.iso.outPath`
|
||||
|
||||
#
|
||||
# Install on a new machine:
|
||||
#
|
||||
# Set
|
||||
# me.disko.enable = true;
|
||||
# me.disko.offline.enable = true;
|
||||
#
|
||||
# doas nix --substituters "http://10.0.2.2:8080?trusted=1 https://cache.nixos.org/" --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --mode destroy,format,mount hosts/odo/disk-config.nix
|
||||
|
||||
# nix flake update zsh-histdb --flake .
|
||||
# nix flake update ansible-sshjail --flake .
|
||||
# for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
# nixos-install --substituters "http://10.0.2.2:8080?trusted=1 https://cache.nixos.org/" --flake ".#vm_ionlybootzfs"
|
||||
#
|
||||
# Run
|
||||
# doas disko --mode destroy,format,mount hosts/recovery/disk-config.nix
|
||||
# doas nixos-install --substituters "http://10.0.2.2:8080?trusted=1 https://cache.nixos.org/" --flake ".#recovery"
|
||||
|
||||
{
|
||||
description = "My system configuration";
|
||||
|
||||
inputs = {
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
impermanence = {
|
||||
url = "github:nix-community/impermanence";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nixpkgs-dda3dcd3f.url = "github:NixOS/nixpkgs/dda3dcd3fe03e991015e9a74b22d35950f264a54";
|
||||
nixpkgs-unoptimized.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
lanzaboote = {
|
||||
url = "github:nix-community/lanzaboote/v0.4.2";
|
||||
|
||||
# Optional but recommended to limit the size of your system closure.
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
zsh-histdb = {
|
||||
url = "path:flakes/zsh-histdb";
|
||||
|
||||
# Optional but recommended to limit the size of your system closure.
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
ansible-sshjail = {
|
||||
url = "path:flakes/ansible-sshjail";
|
||||
|
||||
# Optional but recommended to limit the size of your system closure.
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
disko = {
|
||||
url = "github:nix-community/disko";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
mt7927.url = "github:cmspam/mt7927-nixos";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
nixpkgs-unoptimized,
|
||||
nixpkgs-dda3dcd3f,
|
||||
disko,
|
||||
impermanence,
|
||||
lanzaboote,
|
||||
zsh-histdb,
|
||||
ansible-sshjail,
|
||||
mt7927,
|
||||
...
|
||||
}@inputs:
|
||||
}:
|
||||
let
|
||||
base_x86_64_linux = rec {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
pkgs-dda3dcd3f = import nixpkgs-dda3dcd3f {
|
||||
inherit system;
|
||||
};
|
||||
pkgs-unoptimized = import nixpkgs-unoptimized {
|
||||
inherit system;
|
||||
hostPlatform.gcc.arch = "default";
|
||||
hostPlatform.gcc.tune = "default";
|
||||
};
|
||||
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
|
||||
nodes = {
|
||||
odo = {
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
odowork = {
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
quark = {
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
recovery = {
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
i_only_boot_zfs = {
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
hydra = {
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
family_disks = {
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
modules = [
|
||||
impermanence.nixosModules.impermanence
|
||||
lanzaboote.nixosModules.lanzaboote
|
||||
inputs.disko.nixosModules.disko
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
zsh-histdb.overlays.default
|
||||
ansible-sshjail.overlays.default
|
||||
];
|
||||
}
|
||||
./configuration.nix
|
||||
];
|
||||
};
|
||||
systems =
|
||||
let
|
||||
additional_iso_modules = [
|
||||
(nixpkgs + "/nixos/modules/installer/cd-dvd/iso-image.nix")
|
||||
# TODO: Figure out how to do image based appliances
|
||||
# (nixpkgs + "/nixos/modules/profiles/image-based-appliance.nix")
|
||||
{
|
||||
isoImage.makeEfiBootable = true;
|
||||
isoImage.makeUsbBootable = true;
|
||||
me.buildingIso = true;
|
||||
me.optimizations.enable = nixpkgs.lib.mkForce false;
|
||||
}
|
||||
{
|
||||
# These are big space hogs. The chance that I need them on an ISO is slim.
|
||||
me.steam.enable = nixpkgs.lib.mkForce false;
|
||||
me.pcsx2.enable = nixpkgs.lib.mkForce false;
|
||||
}
|
||||
];
|
||||
additional_vm_modules = [
|
||||
(nixpkgs + "/nixos/modules/profiles/qemu-guest.nix")
|
||||
{
|
||||
networking.dhcpcd.enable = true;
|
||||
networking.useDHCP = true;
|
||||
me.optimizations.enable = nixpkgs.lib.mkForce false;
|
||||
}
|
||||
{
|
||||
# I don't need games on a virtual machine.
|
||||
me.steam.enable = nixpkgs.lib.mkForce false;
|
||||
me.pcsx2.enable = nixpkgs.lib.mkForce false;
|
||||
me.sm64ex.enable = nixpkgs.lib.mkForce false;
|
||||
me.shipwright.enable = nixpkgs.lib.mkForce false;
|
||||
me.ship2harkinian.enable = nixpkgs.lib.mkForce false;
|
||||
}
|
||||
];
|
||||
in
|
||||
{
|
||||
odo = rec {
|
||||
main = base_x86_64_linux // {
|
||||
modules = base_x86_64_linux.modules ++ [
|
||||
./hosts/odo
|
||||
];
|
||||
};
|
||||
iso = main // {
|
||||
modules = main.modules ++ additional_iso_modules;
|
||||
};
|
||||
vm = main // {
|
||||
modules = main.modules ++ additional_vm_modules;
|
||||
};
|
||||
vm_iso = main // {
|
||||
modules = main.modules ++ additional_vm_modules ++ additional_iso_modules;
|
||||
};
|
||||
nixosConfigs = builtins.mapAttrs (
|
||||
hostname: nodeConfig: format:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit self;
|
||||
|
||||
this_nixos_config = self.nixosConfigurations."${hostname}";
|
||||
|
||||
all_nixos_configs = self.nixosConfigurations;
|
||||
};
|
||||
quark = rec {
|
||||
main = base_x86_64_linux // {
|
||||
modules = base_x86_64_linux.modules ++ [
|
||||
./hosts/quark
|
||||
];
|
||||
};
|
||||
iso = main // {
|
||||
modules = main.modules ++ additional_iso_modules;
|
||||
};
|
||||
vm = main // {
|
||||
modules = main.modules ++ additional_vm_modules;
|
||||
};
|
||||
vm_iso = main // {
|
||||
modules = main.modules ++ additional_vm_modules ++ additional_iso_modules;
|
||||
};
|
||||
};
|
||||
neelix = rec {
|
||||
main = base_x86_64_linux // {
|
||||
modules = base_x86_64_linux.modules ++ [
|
||||
./hosts/neelix
|
||||
];
|
||||
};
|
||||
iso = main // {
|
||||
modules = main.modules ++ additional_iso_modules;
|
||||
};
|
||||
vm = main // {
|
||||
modules = main.modules ++ additional_vm_modules;
|
||||
};
|
||||
vm_iso = main // {
|
||||
modules = main.modules ++ additional_vm_modules ++ additional_iso_modules;
|
||||
};
|
||||
};
|
||||
hydra =
|
||||
let
|
||||
additional_iso_modules = additional_iso_modules ++ [
|
||||
{
|
||||
me.optimizations.enable = true;
|
||||
}
|
||||
];
|
||||
in
|
||||
rec {
|
||||
main = base_x86_64_linux // {
|
||||
modules = base_x86_64_linux.modules ++ [
|
||||
./hosts/hydra
|
||||
modules = [
|
||||
impermanence.nixosModules.impermanence
|
||||
lanzaboote.nixosModules.lanzaboote
|
||||
disko.nixosModules.disko
|
||||
mt7927.nixosModules.default
|
||||
./configuration.nix
|
||||
(./. + "/hosts/${hostname}")
|
||||
(./. + "/formats/${format}.nix")
|
||||
{
|
||||
config = {
|
||||
nixpkgs.hostPlatform.system = nodeConfig.system;
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
# stable = nixpkgs-stable.legacyPackages."${prev.stdenv.hostPlatform.system}";
|
||||
unoptimized = import nixpkgs {
|
||||
system = prev.stdenv.hostPlatform.system;
|
||||
hostPlatform.gcc.arch = "default";
|
||||
hostPlatform.gcc.tune = "default";
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
iso = main // {
|
||||
modules = main.modules ++ additional_iso_modules;
|
||||
};
|
||||
vm = main // {
|
||||
modules = main.modules ++ additional_vm_modules;
|
||||
};
|
||||
vm_iso = main // {
|
||||
modules = main.modules ++ additional_vm_modules ++ additional_iso_modules;
|
||||
};
|
||||
};
|
||||
ionlybootzfs = rec {
|
||||
main = base_x86_64_linux // {
|
||||
modules = base_x86_64_linux.modules ++ [
|
||||
./hosts/ionlybootzfs
|
||||
];
|
||||
};
|
||||
iso = main // {
|
||||
modules = main.modules ++ additional_iso_modules;
|
||||
};
|
||||
vm = main // {
|
||||
modules = main.modules ++ additional_vm_modules;
|
||||
};
|
||||
vm_iso = main // {
|
||||
modules = main.modules ++ additional_vm_modules ++ additional_iso_modules;
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
) nodes;
|
||||
installerConfig =
|
||||
hostname: nodeConfig:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
targetSystem = self.nixosConfigurations."${hostname}";
|
||||
};
|
||||
|
||||
modules = [
|
||||
./formats/installer.nix
|
||||
({ nixpkgs.hostPlatform.system = nodeConfig.system; })
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
nixosConfigurations.odo = nixpkgs.lib.nixosSystem systems.odo.main;
|
||||
iso.odo = (nixpkgs.lib.nixosSystem systems.odo.iso).config.system.build.isoImage;
|
||||
nixosConfigurations.vm_odo = nixpkgs.lib.nixosSystem systems.odo.vm;
|
||||
vm_iso.odo = (nixpkgs.lib.nixosSystem systems.odo.vm_iso).config.system.build.isoImage;
|
||||
|
||||
nixosConfigurations.quark = nixpkgs.lib.nixosSystem systems.quark.main;
|
||||
iso.quark = (nixpkgs.lib.nixosSystem systems.quark.iso).config.system.build.isoImage;
|
||||
nixosConfigurations.vm_quark = nixpkgs.lib.nixosSystem systems.quark.vm;
|
||||
vm_iso.quark = (nixpkgs.lib.nixosSystem systems.quark.vm_iso).config.system.build.isoImage;
|
||||
|
||||
nixosConfigurations.neelix = nixpkgs.lib.nixosSystem systems.neelix.main;
|
||||
iso.neelix = (nixpkgs.lib.nixosSystem systems.neelix.iso).config.system.build.isoImage;
|
||||
nixosConfigurations.vm_neelix = nixpkgs.lib.nixosSystem systems.neelix.vm;
|
||||
vm_iso.neelix = (nixpkgs.lib.nixosSystem systems.neelix.vm_iso).config.system.build.isoImage;
|
||||
|
||||
nixosConfigurations.hydra = nixpkgs.lib.nixosSystem systems.hydra.main;
|
||||
iso.hydra = (nixpkgs.lib.nixosSystem systems.hydra.iso).config.system.build.isoImage;
|
||||
nixosConfigurations.vm_hydra = nixpkgs.lib.nixosSystem systems.hydra.vm;
|
||||
vm_iso.hydra = (nixpkgs.lib.nixosSystem systems.hydra.vm_iso).config.system.build.isoImage;
|
||||
|
||||
nixosConfigurations.ionlybootzfs = nixpkgs.lib.nixosSystem systems.ionlybootzfs.main;
|
||||
iso.ionlybootzfs = (nixpkgs.lib.nixosSystem systems.ionlybootzfs.iso).config.system.build.isoImage;
|
||||
nixosConfigurations.vm_ionlybootzfs = nixpkgs.lib.nixosSystem systems.ionlybootzfs.vm;
|
||||
vm_iso.ionlybootzfs =
|
||||
(nixpkgs.lib.nixosSystem systems.ionlybootzfs.vm_iso).config.system.build.isoImage;
|
||||
nixosConfigurations = (builtins.mapAttrs (name: value: value "toplevel") nixosConfigs);
|
||||
}
|
||||
// {
|
||||
packages = (
|
||||
forAllSystems (
|
||||
system:
|
||||
(builtins.mapAttrs (hostname: nodeConfig: {
|
||||
iso = (nixosConfigs."${hostname}" "iso").config.system.build.isoImage;
|
||||
vm_iso = (nixosConfigs."${hostname}" "vm_iso").config.system.build.isoImage;
|
||||
sd = (nixosConfigs."${hostname}" "sd").config.system.build.sdImage;
|
||||
installer = (installerConfig hostname nodes."${hostname}").config.system.build.isoImage;
|
||||
}) (nixpkgs.lib.attrsets.filterAttrs (hostname: nodeConfig: nodeConfig.system == system) nodes))
|
||||
)
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
61
nix/configuration/flakes/ansible-sshjail/flake.lock
generated
61
nix/configuration/flakes/ansible-sshjail/flake.lock
generated
@@ -1,61 +0,0 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1735141468,
|
||||
"narHash": "sha256-VIAjBr1qGcEbmhLwQJD6TABppPMggzOvqFsqkDoMsAY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "4005c3ff7505313cbc21081776ad0ce5dfd7a3ce",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-24.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
{
|
||||
description = "A slightly better history for zsh";
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
...
|
||||
}:
|
||||
let
|
||||
out =
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
# Maybe pkgs = import nixpkgs { inherit system; }; ?
|
||||
appliedOverlay = self.overlays.default pkgs pkgs;
|
||||
in
|
||||
{
|
||||
packages = rec {
|
||||
default = ansible-sshjail;
|
||||
ansible-sshjail = appliedOverlay.ansible-sshjail;
|
||||
};
|
||||
};
|
||||
in
|
||||
flake-utils.lib.eachDefaultSystem out
|
||||
// {
|
||||
overlays.default = final: prev: {
|
||||
ansible-sshjail = final.callPackage ./package.nix { };
|
||||
};
|
||||
};
|
||||
}
|
||||
61
nix/configuration/flakes/zsh-histdb/flake.lock
generated
61
nix/configuration/flakes/zsh-histdb/flake.lock
generated
@@ -1,61 +0,0 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1735141468,
|
||||
"narHash": "sha256-VIAjBr1qGcEbmhLwQJD6TABppPMggzOvqFsqkDoMsAY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "4005c3ff7505313cbc21081776ad0ce5dfd7a3ce",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-24.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
{
|
||||
description = "A slightly better history for zsh";
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
...
|
||||
}:
|
||||
let
|
||||
out =
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
# Maybe pkgs = import nixpkgs { inherit system; }; ?
|
||||
appliedOverlay = self.overlays.default pkgs pkgs;
|
||||
in
|
||||
{
|
||||
packages = rec {
|
||||
default = zsh-histdb;
|
||||
zsh-histdb = appliedOverlay.zsh-histdb;
|
||||
};
|
||||
};
|
||||
in
|
||||
flake-utils.lib.eachDefaultSystem out
|
||||
// {
|
||||
overlays.default = final: prev: {
|
||||
zsh-histdb = final.callPackage ./package.nix { };
|
||||
};
|
||||
};
|
||||
}
|
||||
74
nix/configuration/formats/installer.nix
Normal file
74
nix/configuration/formats/installer.nix
Normal file
@@ -0,0 +1,74 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
modulesPath,
|
||||
targetSystem,
|
||||
...
|
||||
}:
|
||||
let
|
||||
installer = pkgs.writeShellApplication {
|
||||
name = "installer";
|
||||
runtimeInputs = with pkgs; [
|
||||
# clevis
|
||||
dosfstools
|
||||
e2fsprogs
|
||||
gawk
|
||||
nixos-install-tools
|
||||
util-linux
|
||||
config.nix.package
|
||||
];
|
||||
text = ''
|
||||
set -euo pipefail
|
||||
|
||||
${targetSystem.config.system.build.diskoScript}
|
||||
|
||||
nixos-install --no-channel-copy --no-root-password --option substituters "" --system ${targetSystem.config.system.build.toplevel}
|
||||
'';
|
||||
};
|
||||
installerFailsafe = pkgs.writeShellScript "failsafe" ''
|
||||
${lib.getExe installer} || echo "ERROR: Installation failure!"
|
||||
sleep 3600
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/cd-dvd/iso-image.nix")
|
||||
(modulesPath + "/profiles/all-hardware.nix")
|
||||
];
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_18;
|
||||
# boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux;
|
||||
boot.zfs.package = pkgs.zfs_unstable;
|
||||
boot.kernelParams = [
|
||||
"quiet"
|
||||
"systemd.unit=getty.target"
|
||||
];
|
||||
boot.supportedFilesystems.zfs = true;
|
||||
boot.initrd.systemd.enable = true;
|
||||
|
||||
networking.hostId = "04581ecf";
|
||||
|
||||
isoImage.makeEfiBootable = true;
|
||||
isoImage.makeUsbBootable = true;
|
||||
isoImage.squashfsCompression = "zstd -Xcompression-level 15";
|
||||
|
||||
environment.systemPackages = [
|
||||
installer
|
||||
];
|
||||
|
||||
systemd.services."getty@tty1" = {
|
||||
overrideStrategy = "asDropin";
|
||||
serviceConfig = {
|
||||
ExecStart = [
|
||||
""
|
||||
installerFailsafe
|
||||
];
|
||||
Restart = "no";
|
||||
StandardInput = "null";
|
||||
};
|
||||
};
|
||||
|
||||
# system.stateVersion = lib.mkDefault lib.trivial.release;
|
||||
system.stateVersion = "24.11";
|
||||
}
|
||||
36
nix/configuration/formats/iso.nix
Normal file
36
nix/configuration/formats/iso.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/cd-dvd/iso-image.nix")
|
||||
];
|
||||
|
||||
config = {
|
||||
isoImage.makeEfiBootable = true;
|
||||
isoImage.makeUsbBootable = true;
|
||||
|
||||
networking.dhcpcd.enable = true;
|
||||
networking.useDHCP = true;
|
||||
|
||||
me.buildingPortable = true;
|
||||
me.disko.enable = true;
|
||||
me.disko.offline.enable = true;
|
||||
me.mountPersistence = lib.mkForce false;
|
||||
# me.optimizations.enable = lib.mkForce false;
|
||||
|
||||
# Not doing image_based_appliance because this might be an install ISO, in which case we'd need nix to do the install.
|
||||
# me.image_based_appliance.enable = true;
|
||||
|
||||
# TODO: Should I use this instead of doing a mkIf for the disk config?
|
||||
# disko.enableConfig = false;
|
||||
|
||||
# Faster image generation for testing/development.
|
||||
isoImage.squashfsCompression = "zstd -Xcompression-level 15";
|
||||
};
|
||||
}
|
||||
32
nix/configuration/formats/sd.nix
Normal file
32
nix/configuration/formats/sd.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/sd-card/sd-image.nix")
|
||||
];
|
||||
|
||||
config = {
|
||||
isoImage.makeEfiBootable = true;
|
||||
isoImage.makeUsbBootable = true;
|
||||
|
||||
boot.loader.grub.enable = false;
|
||||
boot.loader.generic-extlinux-compatible.enable = true;
|
||||
|
||||
# TODO: image based appliance?
|
||||
|
||||
# TODO: Maybe this?
|
||||
# fileSystems = {
|
||||
# "/" = {
|
||||
# device = "/dev/disk/by-label/NIXOS_SD";
|
||||
# fsType = "ext4";
|
||||
# options = [
|
||||
# "noatime"
|
||||
# "norelatime"
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
1
nix/configuration/formats/toplevel.nix
Normal file
1
nix/configuration/formats/toplevel.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ }
|
||||
22
nix/configuration/formats/vm_iso.nix
Normal file
22
nix/configuration/formats/vm_iso.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/cd-dvd/iso-image.nix")
|
||||
(modulesPath + "/profiles/qemu-guest.nix") # VirtIO kernel modules
|
||||
];
|
||||
|
||||
config = {
|
||||
isoImage.makeEfiBootable = true;
|
||||
isoImage.makeUsbBootable = true;
|
||||
|
||||
networking.dhcpcd.enable = true;
|
||||
networking.useDHCP = true;
|
||||
|
||||
me.image_based_appliance.enable = true;
|
||||
};
|
||||
}
|
||||
13
nix/configuration/hosts/family_disks/DEPLOY_BOOT
Executable file
13
nix/configuration/hosts/family_disks/DEPLOY_BOOT
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
TARGET=family_disks
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
nixos-rebuild boot --flake "$DIR/../../#family_disks" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
13
nix/configuration/hosts/family_disks/DEPLOY_SWITCH
Executable file
13
nix/configuration/hosts/family_disks/DEPLOY_SWITCH
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
TARGET=family_disks
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
nixos-rebuild switch --flake "$DIR/../../#family_disks" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
@@ -6,7 +6,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#iso.ionlybootzfs" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#family_disks.iso" --repair --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
10
nix/configuration/hosts/family_disks/SELF_BOOT
Executable file
10
nix/configuration/hosts/family_disks/SELF_BOOT
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#family_disks" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
12
nix/configuration/hosts/family_disks/SELF_BUILD
Executable file
12
nix/configuration/hosts/family_disks/SELF_BUILD
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
: "${NOM:="true"}"
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#family_disks" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
10
nix/configuration/hosts/family_disks/SELF_SWITCH
Executable file
10
nix/configuration/hosts/family_disks/SELF_SWITCH
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#family_disks" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
75
nix/configuration/hosts/family_disks/default.nix
Normal file
75
nix/configuration/hosts/family_disks/default.nix
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./wrapped-disk-config.nix
|
||||
./distributed_build.nix
|
||||
./power_management.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||
networking.hostId = "908cbf04";
|
||||
|
||||
networking.hostName = "family_disks"; # Define your hostname.
|
||||
|
||||
time.timeZone = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
me.boot.enable = true;
|
||||
me.boot.secure = false;
|
||||
me.mountPersistence = true;
|
||||
|
||||
# Toggle to start writing the extlinux config which will be used by zfsbootmenu
|
||||
boot.loader.generic-extlinux-compatible.enable = true;
|
||||
boot.loader.systemd-boot.enable = lib.mkForce false;
|
||||
|
||||
me.rollback.dataset = [
|
||||
"zroot/linux/nix/root@blank"
|
||||
"zroot/linux/nix/home@blank"
|
||||
];
|
||||
|
||||
me.optimizations = {
|
||||
enable = true;
|
||||
arch = "skylake";
|
||||
# build_arch = "x86-64-v3";
|
||||
system_features = [
|
||||
"gccarch-znver4"
|
||||
"gccarch-skylake"
|
||||
"gccarch-kabylake"
|
||||
# "gccarch-alderlake" missing WAITPKG
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
"nixos-test"
|
||||
];
|
||||
};
|
||||
|
||||
# Early KMS
|
||||
# boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
|
||||
# Mount tmpfs at /tmp
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
# Enable light sensor
|
||||
# hardware.sensor.iio.enable = lib.mkDefault true;
|
||||
|
||||
# Enable TRIM
|
||||
# services.fstrim.enable = lib.mkDefault true;
|
||||
|
||||
# Only run nix builders at idle priority for a more responsive system. Do not set on servers, just end-user devices.
|
||||
nix.daemonCPUSchedPolicy = "idle";
|
||||
|
||||
me.build_in_ram.enable = true;
|
||||
me.dont_use_substituters.enable = true;
|
||||
me.minimal_base.enable = true;
|
||||
me.recovery.enable = true;
|
||||
};
|
||||
}
|
||||
155
nix/configuration/hosts/family_disks/disk-config.nix
Normal file
155
nix/configuration/hosts/family_disks/disk-config.nix
Normal file
@@ -0,0 +1,155 @@
|
||||
# Manual Step:
|
||||
# Check if drive supports 4kn: nvme id-ns -H /dev/nvme0n1
|
||||
# Format the drive to 4kn: nvme format --lbaf=1 /dev/nvme0n1
|
||||
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/nvme0n1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
size = "1G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/efi";
|
||||
mountOptions = [
|
||||
"umask=0077"
|
||||
"noatime"
|
||||
"discard"
|
||||
];
|
||||
};
|
||||
};
|
||||
zfs = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "zroot";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
zpool = {
|
||||
zroot = {
|
||||
type = "zpool";
|
||||
# mode = "mirror";
|
||||
# Workaround: cannot import 'zroot': I/O error in disko tests
|
||||
options.cachefile = "none";
|
||||
options = {
|
||||
ashift = "12";
|
||||
compatibility = "openzfs-2.2-freebsd";
|
||||
autotrim = "on";
|
||||
};
|
||||
rootFsOptions = {
|
||||
acltype = "posixacl";
|
||||
atime = "off";
|
||||
relatime = "off";
|
||||
xattr = "sa";
|
||||
mountpoint = "none";
|
||||
compression = "lz4";
|
||||
canmount = "off";
|
||||
utf8only = "on";
|
||||
dnodesize = "auto";
|
||||
normalization = "formD";
|
||||
};
|
||||
|
||||
datasets = {
|
||||
"linux/nix" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "none";
|
||||
options = {
|
||||
# encryption = "aes-256-gcm";
|
||||
# keyformat = "passphrase";
|
||||
# # keylocation = "file:///tmp/secret.key";
|
||||
};
|
||||
};
|
||||
"linux/nix/root" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/root@blank$' || zfs snapshot zroot/linux/nix/root@blank";
|
||||
};
|
||||
"linux/nix/boot" = {
|
||||
type = "zfs_fs";
|
||||
options = {
|
||||
mountpoint = "legacy";
|
||||
"org.zfsbootmenu:active" = "on";
|
||||
};
|
||||
mountpoint = "/boot";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/boot@blank$' || zfs snapshot zroot/linux/nix/boot@blank";
|
||||
};
|
||||
"linux/nix/nix" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/nix";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/nix@blank$' || zfs snapshot zroot/linux/nix/nix@blank";
|
||||
options = {
|
||||
# recordsize = "16MiB";
|
||||
# compression = "zstd-19";
|
||||
};
|
||||
};
|
||||
"linux/nix/home" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/home";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/home@blank$' || zfs snapshot zroot/linux/nix/home@blank";
|
||||
};
|
||||
"linux/nix/persist" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/persist";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/persist@blank$' || zfs snapshot zroot/linux/nix/persist@blank";
|
||||
};
|
||||
"linux/nix/state" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/state";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/state@blank$' || zfs snapshot zroot/linux/nix/state@blank";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Make sure all persistent volumes are marked as neededForBoot
|
||||
#
|
||||
# Also mounts /home so it is mounted before the user home directories are created.
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
fileSystems."/state".neededForBoot = true;
|
||||
fileSystems."/home".neededForBoot = true;
|
||||
|
||||
fileSystems."/".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/boot".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/nix".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/persist".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/state".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/home".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
|
||||
# Only attempt to decrypt the main pool. Otherwise it attempts to decrypt pools that aren't even used.
|
||||
boot.zfs.requestEncryptionCredentials = [ "zroot/linux/nix" ];
|
||||
}
|
||||
19
nix/configuration/hosts/family_disks/distributed_build.nix
Normal file
19
nix/configuration/hosts/family_disks/distributed_build.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = {
|
||||
me.distributed_build.enable = true;
|
||||
me.distributed_build.machines.quark = {
|
||||
enable = false;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
};
|
||||
me.distributed_build.machines.hydra = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
config = {
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# 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.eno1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
};
|
||||
}
|
||||
75
nix/configuration/hosts/family_disks/power_management.nix
Normal file
75
nix/configuration/hosts/family_disks/power_management.nix
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = {
|
||||
environment.systemPackages = with pkgs; [
|
||||
powertop
|
||||
];
|
||||
|
||||
# amdgpu.abmlevel=3 :: Automatically reduce screen brightness but tweak colors to compensate for power reduction.
|
||||
# pcie_aspm=force pcie_aspm.policy=powersupersave :: Enable PCIe active state power management for power reduction.
|
||||
# nowatchdog :: Disable watchdog for power savings (related to disable_sp5100_watchdog above).
|
||||
# amd_pstate=passive :: Fully automated hardware pstate control.
|
||||
# amd_pstate=active :: Same as passive except we can set the energy performance preference (EPP) to suggest how much we prefer performance or energy efficiency.
|
||||
# amd_pstate=guided :: Same as passive except we can set upper and lower frequency bounds.
|
||||
# amdgpu.dcdebugmask=0x10 :: Allegedly disables Panel Replay from https://community.frame.work/t/tracking-freezing-arch-linux-amd/39495/32
|
||||
boot.kernelParams = [
|
||||
"amdgpu.abmlevel=2"
|
||||
"pcie_aspm=force"
|
||||
# "pcie_aspm.policy=powersupersave"
|
||||
"nowatchdog"
|
||||
# I don't see a measurable benefit from these two:
|
||||
# "cpufreq.default_governor=powersave"
|
||||
# "initcall_blacklist=cpufreq_gov_userspace_init"
|
||||
];
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"w- /sys/firmware/acpi/platform_profile - - - - low-power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy1/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy2/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy3/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy4/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy5/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy6/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy7/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy8/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy9/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy10/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy11/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy12/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy13/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy14/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy15/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpu0/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu1/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu2/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu3/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu4/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu5/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu6/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu7/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu8/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu9/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu10/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu11/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu12/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu13/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu14/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu15/cpufreq/boost - - - - 0"
|
||||
];
|
||||
|
||||
boot.extraModprobeConfig = ''
|
||||
# Disable the hardware watchdog inside AMD 700 chipset series for power savings.
|
||||
blacklist sp5100_tco
|
||||
|
||||
# Sound power-saving was causing chat notifications to be inaudible.
|
||||
# options snd_hda_intel power_save=1
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
lib.mkIf (!config.me.buildingPortable) (import ./disk-config.nix)
|
||||
@@ -6,14 +6,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
#TARGET=10.216.1.14
|
||||
# TARGET=192.168.211.250
|
||||
TARGET=hydra
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
nixos-rebuild boot --flake "$DIR/../../#hydra" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild boot --flake /persist/manual/configuration#hydra'
|
||||
nixos-rebuild boot --flake "$DIR/../../#hydra" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
@@ -6,14 +6,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
#TARGET=10.216.1.14
|
||||
# TARGET=192.168.211.250
|
||||
TARGET=hydra
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
nixos-rebuild switch --flake "$DIR/../../#hydra" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild switch --flake /persist/manual/configuration#hydra'
|
||||
nixos-rebuild switch --flake "$DIR/../../#hydra" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
@@ -6,7 +6,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#iso.hydra" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#hydra.iso" --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
10
nix/configuration/hosts/hydra/SELF_BOOT
Executable file
10
nix/configuration/hosts/hydra/SELF_BOOT
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#hydra" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
10
nix/configuration/hosts/hydra/SELF_BUILD
Executable file
10
nix/configuration/hosts/hydra/SELF_BUILD
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#hydra" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
10
nix/configuration/hosts/hydra/SELF_SWITCH
Executable file
10
nix/configuration/hosts/hydra/SELF_SWITCH
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#hydra" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
10
nix/configuration/hosts/hydra/VM_ISO
Executable file
10
nix/configuration/hosts/hydra/VM_ISO
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#hydra.vm_iso" --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
@@ -1,18 +1,9 @@
|
||||
# MANUAL: On client machines generate signing keys:
|
||||
# nix-store --generate-binary-cache-key some-name /persist/manual/nix/nix-cache-key.sec /persist/manual/nix/nix-cache-key.pub
|
||||
#
|
||||
# Testing:
|
||||
# doas "$(nix-build '<nixpkgs>' --no-out-link -A 'qemu')/bin/qemu-system-x86_64" \
|
||||
# -accel kvm \
|
||||
# -cpu host \
|
||||
# -smp cores=8 \
|
||||
# -m 32768 \
|
||||
# -drive "file=$(nix-build '<nixpkgs>' --no-out-link -A 'OVMF.fd')/FV/OVMF.fd,if=pflash,format=raw,readonly=on" \
|
||||
# -drive file=/tmp/localdisk.img,if=none,id=nvm,format=raw \
|
||||
# -device nvme,serial=deadbeef,drive=nvm \
|
||||
# -nic user,hostfwd=tcp::60022-:22 \
|
||||
# -boot order=d \
|
||||
# -cdrom "$(readlink -f /persist/machine_setup/nix/configuration/result/iso/nixos*.iso)" \
|
||||
# -display vnc=127.0.0.1:0
|
||||
#
|
||||
# Trust other machines and add the substituters:
|
||||
# nix.binaryCachePublicKeys = [ "some-name:AzNW1MOlkNEsUAXS1jIFZ1QCFKXjV+Y/LrF37quAZ1A=" ];
|
||||
# nix.binaryCaches = [ "https://test.example/nix-cache" ];
|
||||
|
||||
{
|
||||
config,
|
||||
@@ -22,47 +13,126 @@
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./disk-config.nix
|
||||
./hardware-configuration.nix
|
||||
./optimized_build.nix
|
||||
./vm_disk.nix
|
||||
];
|
||||
|
||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||
networking.hostId = "fbd233d8";
|
||||
config = {
|
||||
networking =
|
||||
let
|
||||
interface = "enp0s2";
|
||||
in
|
||||
{
|
||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||
hostId = "6fbf418b";
|
||||
|
||||
networking.hostName = "hydra"; # Define your hostname.
|
||||
hostName = "hydra"; # Define your hostname.
|
||||
|
||||
time.timeZone = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
interfaces = {
|
||||
"${interface}" = {
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "10.215.1.219";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
|
||||
me.secureBoot.enable = false;
|
||||
ipv6.addresses = [
|
||||
{
|
||||
address = "2620:11f:7001:7:ffff:ffff:0ad7:01db";
|
||||
prefixLength = 64;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
defaultGateway = "10.215.1.1";
|
||||
defaultGateway6 = {
|
||||
# address = "2620:11f:7001:7::1";
|
||||
address = "2620:11f:7001:7:ffff:ffff:0ad7:0101";
|
||||
inherit interface;
|
||||
};
|
||||
|
||||
me.optimizations = {
|
||||
enable = true;
|
||||
arch = "znver4";
|
||||
system_features = [
|
||||
"gccarch-znver4"
|
||||
"gccarch-skylake"
|
||||
# "gccarch-alderlake" missing WAITPKG
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
"nixos-test"
|
||||
dhcpcd.enable = lib.mkForce false;
|
||||
useDHCP = lib.mkForce false;
|
||||
};
|
||||
|
||||
time.timeZone = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
me.boot.enable = true;
|
||||
me.boot.secure = false;
|
||||
me.mountPersistence = true;
|
||||
boot.loader.timeout = lib.mkForce 0; # We can always generate a new ISO if we need to access other boot options.
|
||||
|
||||
me.optimizations = {
|
||||
enable = true;
|
||||
arch = "znver4";
|
||||
# build_arch = "x86-64-v3";
|
||||
system_features = [
|
||||
"gccarch-znver4"
|
||||
"gccarch-skylake"
|
||||
"gccarch-kabylake"
|
||||
# "gccarch-alderlake" missing WAITPKG
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
"nixos-test"
|
||||
];
|
||||
};
|
||||
|
||||
# Mount tmpfs at /tmp
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
# Enable TRIM
|
||||
# services.fstrim.enable = lib.mkDefault true;
|
||||
|
||||
# nix.optimise.automatic = true;
|
||||
# nix.optimise.dates = [ "03:45" ];
|
||||
# nix.optimise.persistent = true;
|
||||
|
||||
me.image_based_appliance.enable = lib.mkForce false;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
htop
|
||||
git # for building on hydra
|
||||
tmux # for building on hydra
|
||||
nix-output-monitor # for building on hydra
|
||||
];
|
||||
|
||||
# nix.sshServe.enable = true;
|
||||
# nix.sshServe.keys = [ "ssh-dss AAAAB3NzaC1k... bob@example.org" ];
|
||||
|
||||
# Override garbage collection to keep things longer
|
||||
# Automatic garbage collection
|
||||
nix.gc = lib.mkForce {
|
||||
automatic = true;
|
||||
persistent = true;
|
||||
dates = "weekly";
|
||||
# randomizedDelaySec = "14m";
|
||||
options = "--delete-older-than 60d";
|
||||
};
|
||||
|
||||
# The default limit of files is 1024 which is too low for some nix builds.
|
||||
#
|
||||
# Check with `ulimit -n`
|
||||
security.pam.loginLimits = [
|
||||
{
|
||||
domain = "*";
|
||||
item = "nofile";
|
||||
type = "-";
|
||||
value = "8192";
|
||||
}
|
||||
];
|
||||
|
||||
# systemd.user.extraConfig = "DefaultLimitNOFILE=8192";
|
||||
# systemd.services."user@11400".serviceConfig.LimitNOFILE = "8192";
|
||||
|
||||
me.build_in_ram.enable = true;
|
||||
me.dont_use_substituters.enable = true;
|
||||
me.hydra.enable = true;
|
||||
me.minimal_base.enable = true;
|
||||
me.nix_worker.enable = true;
|
||||
};
|
||||
|
||||
# Mount tmpfs at /tmp
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
me.emacs_flavor = "plainmacs";
|
||||
me.graphical = false;
|
||||
me.hydra.enable = false;
|
||||
me.nix_worker.enable = true;
|
||||
me.vm_disk.enable = true;
|
||||
me.wireguard.activated = [ ];
|
||||
me.wireguard.deactivated = [ ];
|
||||
me.zsh.enable = true;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
# 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,
|
||||
...
|
||||
}:
|
||||
@@ -14,26 +10,22 @@
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"sdhci_pci"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
config = {
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# 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.dhcpcd.enable = lib.mkForce true;
|
||||
networking.useDHCP = lib.mkForce true;
|
||||
networking.interfaces.enp0s2.useDHCP = lib.mkForce true;
|
||||
# systemd.network.enable = true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
# 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.eno1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,70 +8,88 @@
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
vm_disk.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to mount the local disk for persistent storage.";
|
||||
config = {
|
||||
# environment.systemPackages = with pkgs; [
|
||||
# e2fsprogs # mkfs.ext4
|
||||
# gptfdisk # cgdisk
|
||||
# ];
|
||||
|
||||
# Mount the local disk
|
||||
fileSystems = lib.mkIf config.me.mountPersistence {
|
||||
"/.disk" = lib.mkForce {
|
||||
device = "/dev/nvme0n1p1";
|
||||
fsType = "ext4";
|
||||
options = [
|
||||
"noatime"
|
||||
"discard"
|
||||
];
|
||||
neededForBoot = true;
|
||||
};
|
||||
|
||||
# "/.persist" = lib.mkForce {
|
||||
# device = "bind9p";
|
||||
# fsType = "9p";
|
||||
# options = [
|
||||
# "noatime"
|
||||
# "trans=virtio"
|
||||
# "version=9p2000.L"
|
||||
# "cache=mmap"
|
||||
# "msize=512000"
|
||||
# "uname=root"
|
||||
# "dfltuid=0"
|
||||
# "dfltgid=0"
|
||||
# "nodevmap"
|
||||
# # "noauto"
|
||||
# # "x-systemd.automount"
|
||||
# ];
|
||||
# neededForBoot = true;
|
||||
# };
|
||||
|
||||
"/persist" = {
|
||||
fsType = "none";
|
||||
device = "/.disk/persist";
|
||||
options = [
|
||||
"bind"
|
||||
"rw"
|
||||
];
|
||||
depends = [
|
||||
"/.disk/persist"
|
||||
];
|
||||
neededForBoot = true;
|
||||
};
|
||||
|
||||
"/state" = {
|
||||
fsType = "none";
|
||||
device = "/.disk/state";
|
||||
options = [
|
||||
"bind"
|
||||
"rw"
|
||||
];
|
||||
depends = [
|
||||
"/.disk/state"
|
||||
];
|
||||
neededForBoot = true;
|
||||
};
|
||||
|
||||
# "/nix/store" = lib.mkForce {
|
||||
# overlay = {
|
||||
# lowerdir = [ "/nix/.ro-store" ];
|
||||
# upperdir = "/.disk/persist/store";
|
||||
# workdir = "/.disk/state/work";
|
||||
# };
|
||||
# # fsType = "overlay";
|
||||
# # device = "overlay";
|
||||
# # options = [
|
||||
# # "lowerdir=/nix/.ro-store"
|
||||
# # "upperdir=/.disk/persist/store"
|
||||
# # "workdir=/.disk/state/work"
|
||||
# # ];
|
||||
# depends = [
|
||||
# "/nix/.ro-store"
|
||||
# "/.disk/persist/store"
|
||||
# "/.disk/state/work"
|
||||
# ];
|
||||
# };
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.vm_disk.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
# Mount the local disk
|
||||
fileSystems = {
|
||||
"/.disk" = lib.mkForce {
|
||||
device = "/dev/nvme0n1p1";
|
||||
fsType = "ext4";
|
||||
options = [
|
||||
"noatime"
|
||||
"discard"
|
||||
];
|
||||
neededForBoot = true;
|
||||
};
|
||||
|
||||
"/persist" = {
|
||||
fsType = "none";
|
||||
device = "/.disk/persist";
|
||||
options = [
|
||||
"bind"
|
||||
"rw"
|
||||
];
|
||||
depends = [
|
||||
"/.disk/persist"
|
||||
];
|
||||
};
|
||||
|
||||
"/state" = {
|
||||
fsType = "none";
|
||||
device = "/.disk/state";
|
||||
options = [
|
||||
"bind"
|
||||
"rw"
|
||||
];
|
||||
depends = [
|
||||
"/.disk/state"
|
||||
];
|
||||
};
|
||||
|
||||
"/nix/store" = lib.mkForce {
|
||||
fsType = "overlay";
|
||||
device = "overlay";
|
||||
options = [
|
||||
"lowerdir=/nix/.ro-store"
|
||||
"upperdir=/.disk/persist/store"
|
||||
"workdir=/.disk/state/work"
|
||||
];
|
||||
depends = [
|
||||
"/nix/.ro-store"
|
||||
"/.disk/persist/store"
|
||||
"/.disk/state/work"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
13
nix/configuration/hosts/i_only_boot_zfs/DEPLOY_BOOT
Executable file
13
nix/configuration/hosts/i_only_boot_zfs/DEPLOY_BOOT
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
TARGET=i_only_boot_zfs
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
nixos-rebuild boot --flake "$DIR/../../#i_only_boot_zfs" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
13
nix/configuration/hosts/i_only_boot_zfs/DEPLOY_SWITCH
Executable file
13
nix/configuration/hosts/i_only_boot_zfs/DEPLOY_SWITCH
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
TARGET=i_only_boot_zfs
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
nixos-rebuild switch --flake "$DIR/../../#i_only_boot_zfs" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
10
nix/configuration/hosts/i_only_boot_zfs/ISO
Executable file
10
nix/configuration/hosts/i_only_boot_zfs/ISO
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#i_only_boot_zfs.iso" --repair --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
10
nix/configuration/hosts/i_only_boot_zfs/SELF_BOOT
Executable file
10
nix/configuration/hosts/i_only_boot_zfs/SELF_BOOT
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#i_only_boot_zfs" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
10
nix/configuration/hosts/i_only_boot_zfs/SELF_BUILD
Executable file
10
nix/configuration/hosts/i_only_boot_zfs/SELF_BUILD
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#i_only_boot_zfs" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
10
nix/configuration/hosts/i_only_boot_zfs/SELF_SWITCH
Executable file
10
nix/configuration/hosts/i_only_boot_zfs/SELF_SWITCH
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#i_only_boot_zfs" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
63
nix/configuration/hosts/i_only_boot_zfs/default.nix
Normal file
63
nix/configuration/hosts/i_only_boot_zfs/default.nix
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./wrapped-disk-config.nix
|
||||
./distributed_build.nix
|
||||
./power_management.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||
networking.hostId = "6a05d86e";
|
||||
|
||||
networking.hostName = "i_only_boot_zfs"; # Define your hostname.
|
||||
|
||||
time.timeZone = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
me.boot.enable = true;
|
||||
me.boot.secure = false;
|
||||
me.mountPersistence = true;
|
||||
|
||||
# Toggle to start writing the extlinux config which will be used by zfsbootmenu
|
||||
# boot.loader.generic-extlinux-compatible.enable = true;
|
||||
# boot.loader.systemd-boot.enable = lib.mkForce false;
|
||||
|
||||
me.optimizations = {
|
||||
# enable = true;
|
||||
# arch = "kabylake";
|
||||
# build_arch = "x86-64-v3";
|
||||
system_features = [
|
||||
# "gccarch-kabylake"
|
||||
"gccarch-x86-64-v3"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
"nixos-test"
|
||||
];
|
||||
};
|
||||
|
||||
# Early KMS
|
||||
# boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
|
||||
# Mount tmpfs at /tmp
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
# Enable TRIM
|
||||
# services.fstrim.enable = lib.mkDefault true;
|
||||
|
||||
# Even when installed, we want to dhcp because this is for a VM.
|
||||
networking.dhcpcd.enable = true;
|
||||
networking.useDHCP = true;
|
||||
|
||||
me.build_in_ram.enable = true;
|
||||
me.dont_use_substituters.enable = true;
|
||||
me.minimal_base.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,14 +1,8 @@
|
||||
# Manual Step:
|
||||
# Check if drive supports 4kn: nvme id-ns -H /dev/nvme0n1
|
||||
# Format the drive to 4kn: nvme format --lbaf=1 /dev/nvme0n1
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
lib.mkIf (!config.me.buildingIso) {
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
@@ -23,7 +17,7 @@ lib.mkIf (!config.me.buildingIso) {
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountpoint = "/efi";
|
||||
mountOptions = [
|
||||
"umask=0077"
|
||||
"noatime"
|
||||
@@ -70,6 +64,11 @@ lib.mkIf (!config.me.buildingIso) {
|
||||
"linux/nix" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "none";
|
||||
options = {
|
||||
# encryption = "aes-256-gcm";
|
||||
# keyformat = "passphrase";
|
||||
# keylocation = "file:///tmp/secret.key";
|
||||
};
|
||||
};
|
||||
"linux/nix/root" = {
|
||||
type = "zfs_fs";
|
||||
@@ -77,14 +76,23 @@ lib.mkIf (!config.me.buildingIso) {
|
||||
mountpoint = "/";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/root@blank$' || zfs snapshot zroot/linux/nix/root@blank";
|
||||
};
|
||||
"linux/nix/boot" = {
|
||||
type = "zfs_fs";
|
||||
options = {
|
||||
mountpoint = "legacy";
|
||||
"org.zfsbootmenu:active" = "on";
|
||||
};
|
||||
mountpoint = "/boot";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/boot@blank$' || zfs snapshot zroot/linux/nix/boot@blank";
|
||||
};
|
||||
"linux/nix/nix" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/nix";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/nix@blank$' || zfs snapshot zroot/linux/nix/nix@blank";
|
||||
options = {
|
||||
recordsize = "1MiB";
|
||||
compression = "lz4";
|
||||
recordsize = "16MiB";
|
||||
compression = "zstd-19";
|
||||
};
|
||||
};
|
||||
"linux/nix/home" = {
|
||||
@@ -121,6 +129,10 @@ lib.mkIf (!config.me.buildingIso) {
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/boot".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/nix".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
@@ -137,4 +149,7 @@ lib.mkIf (!config.me.buildingIso) {
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
|
||||
# Only attempt to decrypt the main pool. Otherwise it attempts to decrypt pools that aren't even used.
|
||||
# boot.zfs.requestEncryptionCredentials = [ "zroot/linux/nix" ];
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = {
|
||||
me.distributed_build.enable = true;
|
||||
me.distributed_build.machines.quark = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
config = {
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# 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.eno1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
};
|
||||
}
|
||||
63
nix/configuration/hosts/i_only_boot_zfs/power_management.nix
Normal file
63
nix/configuration/hosts/i_only_boot_zfs/power_management.nix
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = {
|
||||
environment.systemPackages = with pkgs; [
|
||||
powertop
|
||||
];
|
||||
|
||||
# pcie_aspm=force pcie_aspm.policy=powersupersave :: Enable PCIe active state power management for power reduction.
|
||||
# nowatchdog :: Disable watchdog for power savings (related to disable_sp5100_watchdog above).
|
||||
boot.kernelParams = [
|
||||
"pcie_aspm=force"
|
||||
# "pcie_aspm.policy=powersupersave"
|
||||
"nowatchdog"
|
||||
];
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"w- /sys/firmware/acpi/platform_profile - - - - low-power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy1/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy2/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy3/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy4/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy5/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy6/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy7/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy8/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy9/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy10/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy11/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy12/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy13/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy14/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy15/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpu0/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu1/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu2/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu3/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu4/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu5/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu6/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu7/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu8/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu9/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu10/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu11/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu12/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu13/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu14/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu15/cpufreq/boost - - - - 0"
|
||||
];
|
||||
|
||||
boot.extraModprobeConfig = ''
|
||||
# Sound power-saving was causing chat notifications to be inaudible.
|
||||
# options snd_hda_intel power_save=1
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
lib.mkIf (!config.me.buildingPortable) (import ./disk-config.nix)
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
#TARGET=10.216.1.14
|
||||
# TARGET=192.168.211.250
|
||||
TARGET="ionlybootzfs"
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
nixos-rebuild boot --flake "$DIR/../../#ionlybootzfs" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild boot --flake /persist/manual/configuration#ionlybootzfs'
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
#TARGET=10.216.1.14
|
||||
# TARGET=192.168.211.250
|
||||
TARGET=ionlybootzfs
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
nixos-rebuild switch --flake "$DIR/../../#ionlybootzfs" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild switch --flake /persist/manual/configuration#ionlybootzfs'
|
||||
@@ -1,63 +0,0 @@
|
||||
#
|
||||
# Testing:
|
||||
# doas "$(nix-build '<nixpkgs>' --no-out-link -A 'qemu')/bin/qemu-system-x86_64" \
|
||||
# -accel kvm \
|
||||
# -cpu host \
|
||||
# -smp cores=8 \
|
||||
# -m 32768 \
|
||||
# -drive "file=$(nix-build '<nixpkgs>' --no-out-link -A 'OVMF.fd')/FV/OVMF.fd,if=pflash,format=raw,readonly=on" \
|
||||
# -drive file=/tmp/localdisk.img,if=none,id=nvm,format=raw \
|
||||
# -device nvme,serial=deadbeef,drive=nvm \
|
||||
# -nic user,hostfwd=tcp::60022-:22 \
|
||||
# -boot order=d \
|
||||
# -cdrom "$(readlink -f /persist/machine_setup/nix/configuration/result/iso/nixos*.iso)" \
|
||||
# -display vnc=127.0.0.1:0
|
||||
#
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./wrapped-disk-config.nix
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||
networking.hostId = "fbd233d8";
|
||||
|
||||
networking.hostName = "ionlybootzfs"; # Define your hostname.
|
||||
|
||||
time.timeZone = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
me.secureBoot.enable = true;
|
||||
|
||||
me.optimizations = {
|
||||
enable = false;
|
||||
arch = "znver4";
|
||||
system_features = [
|
||||
"gccarch-znver4"
|
||||
"gccarch-skylake"
|
||||
# "gccarch-alderlake" missing WAITPKG
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
"nixos-test"
|
||||
];
|
||||
};
|
||||
|
||||
# Mount tmpfs at /tmp
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
me.emacs_flavor = "plainmacs";
|
||||
me.graphical = false;
|
||||
me.wireguard.activated = [ ];
|
||||
me.wireguard.deactivated = [ ];
|
||||
me.zsh.enable = true;
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
# 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 = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"sdhci_pci"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# 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.dhcpcd.enable = lib.mkForce true;
|
||||
networking.useDHCP = lib.mkForce true;
|
||||
# systemd.network.enable = true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
pkgs-unoptimized,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = lib.mkMerge [
|
||||
{ }
|
||||
(lib.mkIf (!config.me.optimizations.enable) {
|
||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_14;
|
||||
})
|
||||
(lib.mkIf (config.me.optimizations.enable) {
|
||||
nixpkgs.hostPlatform = {
|
||||
gcc.arch = "znver4";
|
||||
gcc.tune = "znver4";
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(
|
||||
final: prev:
|
||||
let
|
||||
addConfig =
|
||||
additionalConfig: pkg:
|
||||
pkg.override (oldconfig: {
|
||||
structuredExtraConfig = pkg.structuredExtraConfig // additionalConfig;
|
||||
});
|
||||
in
|
||||
{
|
||||
linux_me = addConfig {
|
||||
# Full preemption
|
||||
PREEMPT = lib.mkOverride 60 lib.kernel.yes;
|
||||
PREEMPT_VOLUNTARY = lib.mkOverride 60 lib.kernel.no;
|
||||
|
||||
# Google's BBRv3 TCP congestion Control
|
||||
TCP_CONG_BBR = lib.kernel.yes;
|
||||
DEFAULT_BBR = lib.kernel.yes;
|
||||
|
||||
# Preemptive Full Tickless Kernel at 300Hz
|
||||
HZ = lib.kernel.freeform "300";
|
||||
HZ_300 = lib.kernel.yes;
|
||||
HZ_1000 = lib.kernel.no;
|
||||
} prev.linux_6_14;
|
||||
# gsl = prev.gsl.overrideAttrs (old: {
|
||||
# # gsl tests fails when optimizations are enabled.
|
||||
# # > FAIL: cholesky_invert unscaled hilbert ( 4, 4)[0,2]: 2.55795384873636067e-13 0
|
||||
# # > (2.55795384873636067e-13 observed vs 0 expected) [28259614]
|
||||
# doCheck = false;
|
||||
# });
|
||||
}
|
||||
)
|
||||
(final: prev: {
|
||||
haskellPackages = prev.haskellPackages.extend (
|
||||
final': prev': {
|
||||
inherit (pkgs-unoptimized.haskellPackages)
|
||||
crypton
|
||||
crypton-connection
|
||||
crypton-x509
|
||||
crypton-x509-store
|
||||
crypton-x509-system
|
||||
crypton-x509-validation
|
||||
hspec-wai
|
||||
http-client-tls
|
||||
http2
|
||||
pandoc
|
||||
pandoc-cli
|
||||
pandoc-lua-engine
|
||||
pandoc-server
|
||||
servant-server
|
||||
tls
|
||||
wai-app-static
|
||||
wai-extra
|
||||
warp
|
||||
;
|
||||
}
|
||||
);
|
||||
})
|
||||
(final: prev: {
|
||||
inherit (pkgs-unoptimized)
|
||||
gsl
|
||||
redis
|
||||
valkey
|
||||
;
|
||||
})
|
||||
];
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_me;
|
||||
})
|
||||
(lib.mkIf (!config.me.buildingIso) {
|
||||
nix.settings.system-features = lib.mkForce [
|
||||
"gccarch-znver4"
|
||||
"gccarch-skylake"
|
||||
# "gccarch-alderlake" missing WAITPKG
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
"nixos-test"
|
||||
];
|
||||
|
||||
# Keep ALL dependencies so we can rebuild offline. This DRASTICALLY increase disk usage, but disk space is cheap.
|
||||
# system.includeBuildDependencies = true;
|
||||
|
||||
# This also should enable building offline? TODO: test.
|
||||
nix.extraOptions = ''
|
||||
keep-outputs = true
|
||||
keep-derivations = true
|
||||
'';
|
||||
|
||||
# # building ON
|
||||
# nixpkgs.localSystem = { system = "aarch64-linux"; };
|
||||
# # building FOR
|
||||
# nixpkgs.crossSystem = { system = "aarch64-linux"; };
|
||||
|
||||
# nixpkgs.config = {
|
||||
# replaceStdenv = ({ pkgs }: pkgs.clangStdenv);
|
||||
# };
|
||||
# or maybe an overlay
|
||||
# stdenv = prev.clangStdenv;
|
||||
|
||||
})
|
||||
(lib.mkIf (config.me.buildingIso) {
|
||||
boot.supportedFilesystems.zfs = true;
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
lib.mkIf (!config.me.buildingIso) (import ./disk-config.nix)
|
||||
@@ -10,10 +10,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
# TARGET=192.168.211.250
|
||||
TARGET=neelix
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
nixos-rebuild boot --flake "$DIR/../../#neelix" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
nixos-rebuild boot --flake "$DIR/../../#neelix" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild boot --flake /persist/manual/configuration#neelix'
|
||||
|
||||
@@ -10,10 +10,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
# TARGET=192.168.211.250
|
||||
TARGET=neelix
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
nixos-rebuild switch --flake "$DIR/../../#neelix" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
nixos-rebuild switch --flake "$DIR/../../#neelix" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild switch --flake /persist/manual/configuration#neelix'
|
||||
|
||||
@@ -6,46 +6,61 @@
|
||||
./power_management.nix
|
||||
];
|
||||
|
||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||
networking.hostId = "bca9d0a5";
|
||||
config = {
|
||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||
networking.hostId = "bca9d0a5";
|
||||
|
||||
networking.hostName = "neelix"; # Define your hostname.
|
||||
networking.hostName = "neelix"; # Define your hostname.
|
||||
|
||||
time.timeZone = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
time.timeZone = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
me.secureBoot.enable = false;
|
||||
me.boot.secure = false;
|
||||
me.mountPersistence = true;
|
||||
|
||||
me.optimizations = {
|
||||
enable = false;
|
||||
arch = "alderlake";
|
||||
system_features = [
|
||||
"gccarch-alderlake"
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
"nixos-test"
|
||||
];
|
||||
me.optimizations = {
|
||||
enable = false;
|
||||
arch = "alderlake";
|
||||
system_features = [
|
||||
"gccarch-alderlake"
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
"nixos-test"
|
||||
];
|
||||
};
|
||||
|
||||
# Early KMS
|
||||
boot.initrd.kernelModules = [ "i915" ];
|
||||
|
||||
# Mount tmpfs at /tmp
|
||||
# boot.tmp.useTmpfs = true;
|
||||
|
||||
me.base.enable = true;
|
||||
me.bluetooth.enable = true;
|
||||
me.boot.enable = true;
|
||||
me.doas.enable = true;
|
||||
me.emacs_flavor = "plainmacs";
|
||||
me.firewall.enable = true;
|
||||
me.font.enable = true;
|
||||
me.git.enable = true;
|
||||
me.graphical = true;
|
||||
me.graphics_card_type = "intel";
|
||||
me.kodi.enable = true;
|
||||
me.lvfs.enable = true;
|
||||
me.memtest.enable = true;
|
||||
me.network.enable = true;
|
||||
me.nvme.enable = true;
|
||||
me.sound.enable = true;
|
||||
me.ssh.enable = true;
|
||||
me.sshd.enable = true;
|
||||
me.user.enable = true;
|
||||
me.wireguard.activated = [ "wgh" ];
|
||||
me.wireguard.deactivated = [ "wgf" ];
|
||||
me.zfs.enable = true;
|
||||
me.zrepl.enable = true;
|
||||
me.zsh.enable = true;
|
||||
};
|
||||
|
||||
# Early KMS
|
||||
boot.initrd.kernelModules = [ "i915" ];
|
||||
|
||||
# Mount tmpfs at /tmp
|
||||
# boot.tmp.useTmpfs = true;
|
||||
|
||||
me.bluetooth.enable = true;
|
||||
me.emacs_flavor = "plainmacs";
|
||||
me.graphical = true;
|
||||
me.graphics_card_type = "intel";
|
||||
me.kodi.enable = true;
|
||||
me.lvfs.enable = true;
|
||||
me.sound.enable = true;
|
||||
me.wireguard.activated = [ "wgh" ];
|
||||
me.wireguard.deactivated = [ "wgf" ];
|
||||
me.zrepl.enable = true;
|
||||
me.zsh.enable = true;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
# 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,
|
||||
...
|
||||
}:
|
||||
@@ -14,26 +10,27 @@
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"sdhci_pci"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
config = {
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"sdhci_pci"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# 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.eno1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
|
||||
# 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.eno1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
@@ -8,28 +6,30 @@
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
powertop
|
||||
];
|
||||
config = {
|
||||
environment.systemPackages = with pkgs; [
|
||||
powertop
|
||||
];
|
||||
|
||||
# pcie_aspm=force pcie_aspm.policy=powersupersave :: Enable PCIe active state power management for power reduction.
|
||||
# nowatchdog :: Disable watchdog for power savings (related to disable_sp5100_watchdog above).
|
||||
boot.kernelParams = [
|
||||
"pcie_aspm=force"
|
||||
# "pcie_aspm.policy=powersupersave"
|
||||
"nowatchdog"
|
||||
];
|
||||
# pcie_aspm=force pcie_aspm.policy=powersupersave :: Enable PCIe active state power management for power reduction.
|
||||
# nowatchdog :: Disable watchdog for power savings (related to disable_sp5100_watchdog above).
|
||||
boot.kernelParams = [
|
||||
"pcie_aspm=force"
|
||||
# "pcie_aspm.policy=powersupersave"
|
||||
"nowatchdog"
|
||||
];
|
||||
|
||||
# default performance balance_performance balance_power power
|
||||
# defaults to balance_performance
|
||||
# systemd.tmpfiles.rules = [
|
||||
# "w- /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference - - - - power"
|
||||
# "w- /sys/devices/system/cpu/cpufreq/policy1/energy_performance_preference - - - - power"
|
||||
# "w- /sys/devices/system/cpu/cpufreq/policy2/energy_performance_preference - - - - power"
|
||||
# "w- /sys/devices/system/cpu/cpufreq/policy3/energy_performance_preference - - - - power"
|
||||
# ];
|
||||
# default performance balance_performance balance_power power
|
||||
# defaults to balance_performance
|
||||
# systemd.tmpfiles.rules = [
|
||||
# "w- /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference - - - - power"
|
||||
# "w- /sys/devices/system/cpu/cpufreq/policy1/energy_performance_preference - - - - power"
|
||||
# "w- /sys/devices/system/cpu/cpufreq/policy2/energy_performance_preference - - - - power"
|
||||
# "w- /sys/devices/system/cpu/cpufreq/policy3/energy_performance_preference - - - - power"
|
||||
# ];
|
||||
|
||||
boot.extraModprobeConfig = ''
|
||||
options snd_hda_intel power_save=1
|
||||
'';
|
||||
boot.extraModprobeConfig = ''
|
||||
options snd_hda_intel power_save=1
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,14 +6,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
# TARGET=10.216.1.15
|
||||
# TARGET=192.168.211.250
|
||||
TARGET=odo
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
nixos-rebuild boot --flake "$DIR/../../#odo" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild boot --flake /persist/manual/configuration#odo'
|
||||
nixos-rebuild boot --flake "$DIR/../../#odo" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
@@ -6,14 +6,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
#TARGET=10.216.1.14
|
||||
# TARGET=192.168.211.250
|
||||
TARGET=odo
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
nixos-rebuild switch --flake "$DIR/../../#odo" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild switch --flake /persist/manual/configuration#odo'
|
||||
nixos-rebuild switch --flake "$DIR/../../#odo" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
@@ -6,7 +6,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#iso.odo" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#odo.iso" --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
@@ -6,7 +6,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nixos-rebuild boot --show-trace --use-remote-sudo --max-jobs "$JOBS" --flake "$DIR/../../#odo" --log-format internal-json -v "${@}" |& nom --json
|
||||
nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odo" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
@@ -5,8 +5,8 @@ IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
: "${NOM:="true"}"
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nixos-rebuild build --show-trace --use-remote-sudo --max-jobs "$JOBS" --flake "$DIR/../../#odo" --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odo" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
@@ -6,7 +6,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nixos-rebuild switch --show-trace --use-remote-sudo --max-jobs "$JOBS" --flake "$DIR/../../#odo" --log-format internal-json -v "${@}" |& nom --json
|
||||
nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odo" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
@@ -15,106 +15,156 @@
|
||||
./framework_module.nix
|
||||
];
|
||||
|
||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||
networking.hostId = "908cbf04";
|
||||
config = {
|
||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||
networking.hostId = "908cbf04";
|
||||
|
||||
networking.hostName = "odo"; # Define your hostname.
|
||||
networking.hostName = "odo"; # Define your hostname.
|
||||
|
||||
time.timeZone = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
time.timeZone = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
me.secureBoot.enable = true;
|
||||
me.boot.enable = true;
|
||||
me.boot.secure = false;
|
||||
me.mountPersistence = true;
|
||||
|
||||
me.optimizations = {
|
||||
enable = true;
|
||||
arch = "znver4";
|
||||
system_features = [
|
||||
"gccarch-znver4"
|
||||
"gccarch-skylake"
|
||||
# "gccarch-alderlake" missing WAITPKG
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
"nixos-test"
|
||||
# Toggle to start writing the extlinux config which will be used by zfsbootmenu
|
||||
boot.loader.generic-extlinux-compatible.enable = true;
|
||||
boot.loader.systemd-boot.enable = lib.mkForce false;
|
||||
|
||||
me.rollback.dataset = [
|
||||
"zroot/linux/nix/root@blank"
|
||||
"zroot/linux/nix/home@blank"
|
||||
];
|
||||
|
||||
me.optimizations = {
|
||||
enable = true;
|
||||
arch = "znver4";
|
||||
# build_arch = "x86-64-v3";
|
||||
system_features = [
|
||||
"gccarch-znver4"
|
||||
"gccarch-skylake"
|
||||
"gccarch-kabylake"
|
||||
# "gccarch-alderlake" missing WAITPKG
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
"nixos-test"
|
||||
];
|
||||
};
|
||||
|
||||
# Early KMS
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
|
||||
# Mount tmpfs at /tmp
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
fw-ectool
|
||||
framework-tool
|
||||
];
|
||||
|
||||
# Enable light sensor
|
||||
# hardware.sensor.iio.enable = lib.mkDefault true;
|
||||
|
||||
# Enable TRIM
|
||||
# services.fstrim.enable = lib.mkDefault true;
|
||||
|
||||
# Only run nix builders at idle priority for a more responsive system. Do not set on servers, just end-user devices.
|
||||
nix.daemonCPUSchedPolicy = "idle";
|
||||
|
||||
me.alacritty.enable = true;
|
||||
me.amd_s2idle.enable = true;
|
||||
me.android.enable = true;
|
||||
me.ansible.enable = true;
|
||||
me.ares.enable = true;
|
||||
me.base.enable = true;
|
||||
me.bluetooth.enable = true;
|
||||
me.build_in_ram.enable = true;
|
||||
me.chromecast.enable = true;
|
||||
me.chromium.enable = true;
|
||||
me.d2.enable = true;
|
||||
me.direnv.enable = true;
|
||||
me.doas.enable = true;
|
||||
me.docker.enable = false;
|
||||
me.dont_use_substituters.enable = true;
|
||||
me.ecc.enable = false;
|
||||
me.emacs_flavor = "full";
|
||||
me.emulate_isa.enable = true;
|
||||
me.esim.enable = true;
|
||||
me.firefox.enable = true;
|
||||
me.firewall.enable = true;
|
||||
me.flux.enable = true;
|
||||
me.font.enable = true;
|
||||
me.gcloud.enable = true;
|
||||
me.git.config = ../../roles/git/files/gitconfig_home;
|
||||
me.git.enable = true;
|
||||
me.gnuplot.enable = true;
|
||||
me.gpg.enable = true;
|
||||
me.graphical = true;
|
||||
me.graphics_card_type = "amd";
|
||||
me.graphviz.enable = true;
|
||||
me.iso_mount.enable = true;
|
||||
me.jujutsu.config = ../../roles/jujutsu/files/jujutsu_config_home.toml;
|
||||
me.jujutsu.enable = true;
|
||||
me.kanshi.enable = false;
|
||||
me.kubernetes.enable = true;
|
||||
me.latex.enable = true;
|
||||
me.launch_keyboard.enable = true;
|
||||
me.lvfs.enable = true;
|
||||
me.media.enable = true;
|
||||
me.memtest.enable = true;
|
||||
me.network.enable = true;
|
||||
me.nix_index.enable = true;
|
||||
me.nix_repl.enable = true;
|
||||
me.nixdev.enable = true;
|
||||
me.nvme.enable = true;
|
||||
me.openpgp_card_tools.enable = true;
|
||||
me.pcsx2.enable = true;
|
||||
me.podman.enable = true;
|
||||
me.postgresql_client.enable = true;
|
||||
me.python.enable = true;
|
||||
me.qemu.enable = true;
|
||||
me.recovery.enable = true;
|
||||
me.rpcs3.enable = true;
|
||||
me.rust.enable = true;
|
||||
me.sequoia.enable = true;
|
||||
me.shadps4.enable = false;
|
||||
me.shikane.enable = true;
|
||||
me.sops.enable = true;
|
||||
me.sound.enable = true;
|
||||
me.spaghettikart.enable = true;
|
||||
me.ssh.enable = true;
|
||||
me.sshd.enable = true;
|
||||
me.steam.enable = true;
|
||||
me.steam_run_free.enable = true;
|
||||
me.sway.enable = true;
|
||||
me.tekton.enable = true;
|
||||
me.terraform.enable = true;
|
||||
me.thunderbolt.enable = true;
|
||||
me.user.enable = true;
|
||||
me.uutils.enable = false;
|
||||
me.vnc_client.enable = true;
|
||||
me.vscode.enable = true;
|
||||
me.wasm.enable = true;
|
||||
me.waybar.enable = true;
|
||||
me.webcam.enable = true;
|
||||
me.wine.enable = false;
|
||||
me.wireguard.activated = [
|
||||
"drmario"
|
||||
"wgh"
|
||||
"colo"
|
||||
];
|
||||
me.wireguard.deactivated = [ "wgf" ];
|
||||
me.yubikey.enable = true;
|
||||
me.zfs.enable = true;
|
||||
me.zrepl.enable = true;
|
||||
me.zsh.enable = true;
|
||||
|
||||
me.sm64ex.enable = true;
|
||||
me.shipwright.enable = true;
|
||||
me.ship2harkinian.enable = true;
|
||||
};
|
||||
|
||||
# Early KMS
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
|
||||
# Mount tmpfs at /tmp
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
fw-ectool
|
||||
framework-tool
|
||||
];
|
||||
|
||||
# Enable light sensor
|
||||
# hardware.sensor.iio.enable = lib.mkDefault true;
|
||||
|
||||
# Enable TRIM
|
||||
# services.fstrim.enable = lib.mkDefault true;
|
||||
|
||||
me.alacritty.enable = true;
|
||||
me.amd_s2idle.enable = true;
|
||||
me.ansible.enable = true;
|
||||
me.ares.enable = true;
|
||||
me.bluetooth.enable = true;
|
||||
me.chromecast.enable = true;
|
||||
me.chromium.enable = true;
|
||||
me.d2.enable = true;
|
||||
me.direnv.enable = true;
|
||||
me.docker.enable = true;
|
||||
me.ecc.enable = false;
|
||||
me.emacs_flavor = "full";
|
||||
me.firefox.enable = true;
|
||||
me.flux.enable = true;
|
||||
me.gcloud.enable = true;
|
||||
me.git.config = ../../roles/git/files/gitconfig_home;
|
||||
me.gnuplot.enable = true;
|
||||
me.gpg.enable = true;
|
||||
me.graphical = true;
|
||||
me.graphics_card_type = "amd";
|
||||
me.iso_mount.enable = true;
|
||||
me.kanshi.enable = false;
|
||||
me.kubernetes.enable = true;
|
||||
me.latex.enable = true;
|
||||
me.launch_keyboard.enable = true;
|
||||
me.lvfs.enable = true;
|
||||
me.media.enable = true;
|
||||
me.nix_index.enable = true;
|
||||
me.pcsx2.enable = true;
|
||||
me.python.enable = true;
|
||||
me.qemu.enable = true;
|
||||
me.rpcs3.enable = true;
|
||||
me.rust.enable = true;
|
||||
me.shadps4.enable = true;
|
||||
me.shikane.enable = true;
|
||||
me.sops.enable = true;
|
||||
me.sound.enable = true;
|
||||
me.steam.enable = true;
|
||||
me.steam_run_free.enable = true;
|
||||
me.sway.enable = true;
|
||||
me.tekton.enable = true;
|
||||
me.terraform.enable = true;
|
||||
me.thunderbolt.enable = true;
|
||||
me.vnc_client.enable = true;
|
||||
me.vscode.enable = true;
|
||||
me.wasm.enable = true;
|
||||
me.waybar.enable = true;
|
||||
me.wireguard.activated = [
|
||||
"drmario"
|
||||
"wgh"
|
||||
"colo"
|
||||
];
|
||||
me.wireguard.deactivated = [ "wgf" ];
|
||||
me.zrepl.enable = true;
|
||||
me.zsh.enable = true;
|
||||
|
||||
me.sm64ex.enable = true;
|
||||
me.shipwright.enable = true;
|
||||
me.ship2harkinian.enable = true;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountpoint = "/efi";
|
||||
mountOptions = [
|
||||
"umask=0077"
|
||||
"noatime"
|
||||
@@ -76,6 +76,15 @@
|
||||
mountpoint = "/";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/root@blank$' || zfs snapshot zroot/linux/nix/root@blank";
|
||||
};
|
||||
"linux/nix/boot" = {
|
||||
type = "zfs_fs";
|
||||
options = {
|
||||
mountpoint = "legacy";
|
||||
"org.zfsbootmenu:active" = "on";
|
||||
};
|
||||
mountpoint = "/boot";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/boot@blank$' || zfs snapshot zroot/linux/nix/boot@blank";
|
||||
};
|
||||
"linux/nix/nix" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
@@ -120,6 +129,10 @@
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/boot".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/nix".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
|
||||
@@ -1,27 +1,19 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
me.distributed_build.enable = true;
|
||||
me.distributed_build.machines.hydra = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
config = {
|
||||
me.distributed_build.enable = true;
|
||||
me.distributed_build.machines.quark = {
|
||||
enable = false;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
me.distributed_build.machines.quark = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
};
|
||||
me.distributed_build.machines.hydra = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,23 +1,19 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
boot.extraModulePackages = with config.boot.kernelPackages; [
|
||||
framework-laptop-kmod
|
||||
];
|
||||
# https://github.com/DHowett/framework-laptop-kmod?tab=readme-ov-file#usage
|
||||
boot.kernelModules = [
|
||||
"cros_ec"
|
||||
"cros_ec_lpcs"
|
||||
];
|
||||
}
|
||||
];
|
||||
config = {
|
||||
boot.extraModulePackages = with config.boot.kernelPackages; [
|
||||
framework-laptop-kmod
|
||||
];
|
||||
# https://github.com/DHowett/framework-laptop-kmod?tab=readme-ov-file#usage
|
||||
boot.kernelModules = [
|
||||
"cros_ec"
|
||||
"cros_ec_lpcs"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
# 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,
|
||||
...
|
||||
}:
|
||||
@@ -14,23 +10,24 @@
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
config = {
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# 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.eno1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
|
||||
# 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.eno1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
@@ -8,68 +6,70 @@
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
powertop
|
||||
];
|
||||
config = {
|
||||
environment.systemPackages = with pkgs; [
|
||||
powertop
|
||||
];
|
||||
|
||||
# amdgpu.abmlevel=3 :: Automatically reduce screen brightness but tweak colors to compensate for power reduction.
|
||||
# pcie_aspm=force pcie_aspm.policy=powersupersave :: Enable PCIe active state power management for power reduction.
|
||||
# nowatchdog :: Disable watchdog for power savings (related to disable_sp5100_watchdog above).
|
||||
# amd_pstate=passive :: Fully automated hardware pstate control.
|
||||
# amd_pstate=active :: Same as passive except we can set the energy performance preference (EPP) to suggest how much we prefer performance or energy efficiency.
|
||||
# amd_pstate=guided :: Same as passive except we can set upper and lower frequency bounds.
|
||||
# amdgpu.dcdebugmask=0x10 :: Allegedly disables Panel Replay from https://community.frame.work/t/tracking-freezing-arch-linux-amd/39495/32
|
||||
boot.kernelParams = [
|
||||
"amdgpu.abmlevel=2"
|
||||
"pcie_aspm=force"
|
||||
# "pcie_aspm.policy=powersupersave"
|
||||
"nowatchdog"
|
||||
# I don't see a measurable benefit from these two:
|
||||
# "cpufreq.default_governor=powersave"
|
||||
# "initcall_blacklist=cpufreq_gov_userspace_init"
|
||||
];
|
||||
# amdgpu.abmlevel=3 :: Automatically reduce screen brightness but tweak colors to compensate for power reduction.
|
||||
# pcie_aspm=force pcie_aspm.policy=powersupersave :: Enable PCIe active state power management for power reduction.
|
||||
# nowatchdog :: Disable watchdog for power savings (related to disable_sp5100_watchdog above).
|
||||
# amd_pstate=passive :: Fully automated hardware pstate control.
|
||||
# amd_pstate=active :: Same as passive except we can set the energy performance preference (EPP) to suggest how much we prefer performance or energy efficiency.
|
||||
# amd_pstate=guided :: Same as passive except we can set upper and lower frequency bounds.
|
||||
# amdgpu.dcdebugmask=0x10 :: Allegedly disables Panel Replay from https://community.frame.work/t/tracking-freezing-arch-linux-amd/39495/32
|
||||
boot.kernelParams = [
|
||||
"amdgpu.abmlevel=2"
|
||||
"pcie_aspm=force"
|
||||
# "pcie_aspm.policy=powersupersave"
|
||||
"nowatchdog"
|
||||
# I don't see a measurable benefit from these two:
|
||||
# "cpufreq.default_governor=powersave"
|
||||
# "initcall_blacklist=cpufreq_gov_userspace_init"
|
||||
];
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"w- /sys/firmware/acpi/platform_profile - - - - low-power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy1/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy2/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy3/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy4/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy5/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy6/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy7/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy8/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy9/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy10/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy11/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy12/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy13/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy14/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy15/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpu0/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu1/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu2/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu3/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu4/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu5/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu6/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu7/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu8/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu9/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu10/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu11/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu12/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu13/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu14/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu15/cpufreq/boost - - - - 0"
|
||||
];
|
||||
systemd.tmpfiles.rules = [
|
||||
"w- /sys/firmware/acpi/platform_profile - - - - low-power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy1/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy2/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy3/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy4/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy5/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy6/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy7/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy8/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy9/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy10/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy11/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy12/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy13/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy14/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy15/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpu0/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu1/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu2/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu3/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu4/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu5/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu6/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu7/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu8/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu9/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu10/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu11/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu12/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu13/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu14/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu15/cpufreq/boost - - - - 0"
|
||||
];
|
||||
|
||||
boot.extraModprobeConfig = ''
|
||||
# Disable the hardware watchdog inside AMD 700 chipset series for power savings.
|
||||
blacklist sp5100_tco
|
||||
boot.extraModprobeConfig = ''
|
||||
# Disable the hardware watchdog inside AMD 700 chipset series for power savings.
|
||||
blacklist sp5100_tco
|
||||
|
||||
# Sound power-saving was causing chat notifications to be inaudible.
|
||||
# options snd_hda_intel power_save=1
|
||||
'';
|
||||
# Sound power-saving was causing chat notifications to be inaudible.
|
||||
# options snd_hda_intel power_save=1
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"w- /sys/class/backlight/amdgpu_bl1/brightness - - - - 21845"
|
||||
];
|
||||
config = {
|
||||
systemd.tmpfiles.rules = [
|
||||
"w- /sys/class/backlight/amdgpu_bl1/brightness - - - - 32767"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = {
|
||||
# Doesn't seem necessary starting with 6.13
|
||||
# environment.loginShellInit = lib.mkIf (!config.me.buildingIso) ''
|
||||
# doas iw dev wlan0 set power_save off
|
||||
# '';
|
||||
|
||||
# Enable debug logging for ath12k wifi card.
|
||||
boot.kernelParams = [
|
||||
"ath12k.debug_mask=0xffffffff"
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
lib.mkIf (!config.me.buildingIso) (import ./disk-config.nix)
|
||||
lib.mkIf (!config.me.buildingPortable) (import ./disk-config.nix)
|
||||
|
||||
11
nix/configuration/hosts/odowork/DEPLOY_BOOT
Executable file
11
nix/configuration/hosts/odowork/DEPLOY_BOOT
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
TARGET=odowork
|
||||
|
||||
nixos-rebuild boot --flake "$DIR/../../#odowork" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
11
nix/configuration/hosts/odowork/DEPLOY_SWITCH
Executable file
11
nix/configuration/hosts/odowork/DEPLOY_SWITCH
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
TARGET=odowork
|
||||
|
||||
nixos-rebuild switch --flake "$DIR/../../#odowork" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
9
nix/configuration/hosts/odowork/INSTALLER
Executable file
9
nix/configuration/hosts/odowork/INSTALLER
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#odowork.installer" --repair --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
9
nix/configuration/hosts/odowork/ISO
Executable file
9
nix/configuration/hosts/odowork/ISO
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#odowork.iso" --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
9
nix/configuration/hosts/odowork/SELF_BOOT
Executable file
9
nix/configuration/hosts/odowork/SELF_BOOT
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odowork" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
9
nix/configuration/hosts/odowork/SELF_BUILD
Executable file
9
nix/configuration/hosts/odowork/SELF_BUILD
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odowork" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
9
nix/configuration/hosts/odowork/SELF_SWITCH
Executable file
9
nix/configuration/hosts/odowork/SELF_SWITCH
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#odowork" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
156
nix/configuration/hosts/odowork/default.nix
Normal file
156
nix/configuration/hosts/odowork/default.nix
Normal file
@@ -0,0 +1,156 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./wrapped-disk-config.nix
|
||||
./distributed_build.nix
|
||||
./power_management.nix
|
||||
./screen_brightness.nix
|
||||
./wifi.nix
|
||||
./framework_module.nix
|
||||
./ssh_config.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||
networking.hostId = "133cb66e";
|
||||
|
||||
networking.hostName = "odowork"; # Define your hostname.
|
||||
|
||||
time.timeZone = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
me.boot.enable = true;
|
||||
me.boot.secure = false;
|
||||
me.mountPersistence = true;
|
||||
|
||||
# Toggle to start writing the extlinux config which will be used by zfsbootmenu
|
||||
boot.loader.generic-extlinux-compatible.enable = true;
|
||||
boot.loader.systemd-boot.enable = lib.mkForce false;
|
||||
|
||||
me.rollback.dataset = [
|
||||
"zroot/linux/nixwork/root@blank"
|
||||
"zroot/linux/nixwork/home@blank"
|
||||
];
|
||||
|
||||
me.optimizations = {
|
||||
enable = true;
|
||||
arch = "znver4";
|
||||
# build_arch = "x86-64-v3";
|
||||
system_features = [
|
||||
"gccarch-znver4"
|
||||
"gccarch-skylake"
|
||||
"gccarch-kabylake"
|
||||
# "gccarch-alderlake" missing WAITPKG
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
"nixos-test"
|
||||
];
|
||||
};
|
||||
|
||||
# Early KMS
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
|
||||
# Mount tmpfs at /tmp
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
fw-ectool
|
||||
framework-tool
|
||||
];
|
||||
|
||||
# Enable light sensor
|
||||
# hardware.sensor.iio.enable = lib.mkDefault true;
|
||||
|
||||
# Enable TRIM
|
||||
# services.fstrim.enable = lib.mkDefault true;
|
||||
|
||||
# Only run nix builders at idle priority for a more responsive system. Do not set on servers, just end-user devices.
|
||||
nix.daemonCPUSchedPolicy = "idle";
|
||||
|
||||
fonts.enableDefaultPackages = lib.mkForce true;
|
||||
fonts.packages = with pkgs; [
|
||||
corefonts
|
||||
];
|
||||
allowedUnfree = [ "corefonts" ];
|
||||
|
||||
me.alacritty.enable = true;
|
||||
me.amd_s2idle.enable = true;
|
||||
me.android.enable = true;
|
||||
me.ansible.enable = true;
|
||||
me.base.enable = true;
|
||||
me.bluetooth.enable = true;
|
||||
me.build_in_ram.enable = true;
|
||||
me.chromium.enable = true;
|
||||
me.d2.enable = true;
|
||||
me.direnv.enable = true;
|
||||
me.doas.enable = true;
|
||||
me.docker.enable = false;
|
||||
me.dont_use_substituters.enable = true;
|
||||
me.emacs_flavor = "full";
|
||||
me.firefox.enable = true;
|
||||
me.firewall.enable = true;
|
||||
me.font.enable = true;
|
||||
me.gcloud.enable = true;
|
||||
me.git.config = ../../roles/git/files/gitconfig_work;
|
||||
me.git.enable = true;
|
||||
me.gnome_keyring.enable = true;
|
||||
me.gnuplot.enable = true;
|
||||
me.gpg.enable = true;
|
||||
me.graphical = true;
|
||||
me.graphics_card_type = "amd";
|
||||
me.graphviz.enable = true;
|
||||
me.iso_mount.enable = true;
|
||||
me.jujutsu.config = ../../roles/jujutsu/files/jujutsu_config_home.toml;
|
||||
me.jujutsu.enable = true;
|
||||
me.latex.enable = true;
|
||||
me.launch_keyboard.enable = true;
|
||||
me.lvfs.enable = true;
|
||||
me.media.enable = true;
|
||||
me.memtest.enable = true;
|
||||
me.network.enable = true;
|
||||
me.nix_index.enable = true;
|
||||
me.nix_repl.enable = true;
|
||||
me.nixdev.enable = true;
|
||||
me.nvme.enable = true;
|
||||
me.openpgp_card_tools.enable = true;
|
||||
me.podman.enable = true;
|
||||
me.postgresql_client.enable = true;
|
||||
me.python.enable = true;
|
||||
me.rust.enable = true;
|
||||
me.sequoia.enable = true;
|
||||
me.shikane.enable = true;
|
||||
me.sops.enable = true;
|
||||
me.sound.enable = true;
|
||||
me.ssh.enable = true;
|
||||
me.sshd.enable = true;
|
||||
me.steam_run_free.enable = true;
|
||||
me.sway.enable = true;
|
||||
me.terraform.enable = true;
|
||||
me.thunderbolt.enable = true;
|
||||
me.user.enable = true;
|
||||
me.vscode.enable = true;
|
||||
me.vscode.enable_work_profile = true;
|
||||
me.waybar.enable = true;
|
||||
me.webcam.enable = true;
|
||||
me.wireguard.activated = [
|
||||
"wgh"
|
||||
];
|
||||
me.wireguard.deactivated = [
|
||||
"wgf"
|
||||
"colo"
|
||||
];
|
||||
me.yubikey.enable = true;
|
||||
me.zfs.enable = true;
|
||||
me.zrepl.enable = true;
|
||||
me.zsh.enable = true;
|
||||
};
|
||||
}
|
||||
155
nix/configuration/hosts/odowork/disk-config.nix
Normal file
155
nix/configuration/hosts/odowork/disk-config.nix
Normal file
@@ -0,0 +1,155 @@
|
||||
# Manual Step:
|
||||
# Check if drive supports 4kn: nvme id-ns -H /dev/nvme0n1
|
||||
# Format the drive to 4kn: nvme format --lbaf=1 /dev/nvme0n1
|
||||
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/nvme0n1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
size = "1G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/efi";
|
||||
mountOptions = [
|
||||
"umask=0077"
|
||||
"noatime"
|
||||
"discard"
|
||||
];
|
||||
};
|
||||
};
|
||||
zfs = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "zroot";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
zpool = {
|
||||
zroot = {
|
||||
type = "zpool";
|
||||
# mode = "mirror";
|
||||
# Workaround: cannot import 'zroot': I/O error in disko tests
|
||||
options.cachefile = "none";
|
||||
options = {
|
||||
ashift = "12";
|
||||
compatibility = "openzfs-2.2-freebsd";
|
||||
autotrim = "on";
|
||||
};
|
||||
rootFsOptions = {
|
||||
acltype = "posixacl";
|
||||
atime = "off";
|
||||
relatime = "off";
|
||||
xattr = "sa";
|
||||
mountpoint = "none";
|
||||
compression = "lz4";
|
||||
canmount = "off";
|
||||
utf8only = "on";
|
||||
dnodesize = "auto";
|
||||
normalization = "formD";
|
||||
};
|
||||
|
||||
datasets = {
|
||||
"linux/nixwork" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "none";
|
||||
options = {
|
||||
encryption = "aes-256-gcm";
|
||||
keyformat = "passphrase";
|
||||
# keylocation = "file:///tmp/secret.key";
|
||||
};
|
||||
};
|
||||
"linux/nixwork/root" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nixwork/root@blank$' || zfs snapshot zroot/linux/nixwork/root@blank";
|
||||
};
|
||||
"linux/nixwork/boot" = {
|
||||
type = "zfs_fs";
|
||||
options = {
|
||||
mountpoint = "legacy";
|
||||
"org.zfsbootmenu:active" = "on";
|
||||
};
|
||||
mountpoint = "/boot";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nixwork/boot@blank$' || zfs snapshot zroot/linux/nixwork/boot@blank";
|
||||
};
|
||||
"linux/nixwork/nix" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/nix";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nixwork/nix@blank$' || zfs snapshot zroot/linux/nixwork/nix@blank";
|
||||
options = {
|
||||
recordsize = "16MiB";
|
||||
compression = "zstd-19";
|
||||
};
|
||||
};
|
||||
"linux/nixwork/home" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/home";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nixwork/home@blank$' || zfs snapshot zroot/linux/nixwork/home@blank";
|
||||
};
|
||||
"linux/nixwork/persist" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/persist";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nixwork/persist@blank$' || zfs snapshot zroot/linux/nixwork/persist@blank";
|
||||
};
|
||||
"linux/nixwork/state" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/state";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nixwork/state@blank$' || zfs snapshot zroot/linux/nixwork/state@blank";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Make sure all persistent volumes are marked as neededForBoot
|
||||
#
|
||||
# Also mounts /home so it is mounted before the user home directories are created.
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
fileSystems."/state".neededForBoot = true;
|
||||
fileSystems."/home".neededForBoot = true;
|
||||
|
||||
fileSystems."/".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/boot".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/nix".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/persist".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/state".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
fileSystems."/home".options = [
|
||||
"noatime"
|
||||
"norelatime"
|
||||
];
|
||||
|
||||
# Only attempt to decrypt the main pool. Otherwise it attempts to decrypt pools that aren't even used.
|
||||
boot.zfs.requestEncryptionCredentials = [ "zroot/linux/nixwork" ];
|
||||
}
|
||||
19
nix/configuration/hosts/odowork/distributed_build.nix
Normal file
19
nix/configuration/hosts/odowork/distributed_build.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = {
|
||||
me.distributed_build.enable = true;
|
||||
me.distributed_build.machines.quark = {
|
||||
enable = false;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
};
|
||||
me.distributed_build.machines.hydra = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
19
nix/configuration/hosts/odowork/framework_module.nix
Normal file
19
nix/configuration/hosts/odowork/framework_module.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = {
|
||||
boot.extraModulePackages = with config.boot.kernelPackages; [
|
||||
framework-laptop-kmod
|
||||
];
|
||||
# https://github.com/DHowett/framework-laptop-kmod?tab=readme-ov-file#usage
|
||||
boot.kernelModules = [
|
||||
"cros_ec"
|
||||
"cros_ec_lpcs"
|
||||
];
|
||||
};
|
||||
}
|
||||
33
nix/configuration/hosts/odowork/hardware-configuration.nix
Normal file
33
nix/configuration/hosts/odowork/hardware-configuration.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
config = {
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# 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.eno1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
};
|
||||
}
|
||||
75
nix/configuration/hosts/odowork/power_management.nix
Normal file
75
nix/configuration/hosts/odowork/power_management.nix
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = {
|
||||
environment.systemPackages = with pkgs; [
|
||||
powertop
|
||||
];
|
||||
|
||||
# amdgpu.abmlevel=3 :: Automatically reduce screen brightness but tweak colors to compensate for power reduction.
|
||||
# pcie_aspm=force pcie_aspm.policy=powersupersave :: Enable PCIe active state power management for power reduction.
|
||||
# nowatchdog :: Disable watchdog for power savings (related to disable_sp5100_watchdog above).
|
||||
# amd_pstate=passive :: Fully automated hardware pstate control.
|
||||
# amd_pstate=active :: Same as passive except we can set the energy performance preference (EPP) to suggest how much we prefer performance or energy efficiency.
|
||||
# amd_pstate=guided :: Same as passive except we can set upper and lower frequency bounds.
|
||||
# amdgpu.dcdebugmask=0x10 :: Allegedly disables Panel Replay from https://community.frame.work/t/tracking-freezing-arch-linux-amd/39495/32
|
||||
boot.kernelParams = [
|
||||
"amdgpu.abmlevel=2"
|
||||
"pcie_aspm=force"
|
||||
# "pcie_aspm.policy=powersupersave"
|
||||
"nowatchdog"
|
||||
# I don't see a measurable benefit from these two:
|
||||
# "cpufreq.default_governor=powersave"
|
||||
# "initcall_blacklist=cpufreq_gov_userspace_init"
|
||||
];
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"w- /sys/firmware/acpi/platform_profile - - - - low-power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy1/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy2/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy3/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy4/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy5/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy6/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy7/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy8/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy9/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy10/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy11/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy12/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy13/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy14/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpufreq/policy15/energy_performance_preference - - - - power"
|
||||
"w- /sys/devices/system/cpu/cpu0/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu1/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu2/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu3/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu4/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu5/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu6/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu7/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu8/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu9/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu10/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu11/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu12/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu13/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu14/cpufreq/boost - - - - 0"
|
||||
"w- /sys/devices/system/cpu/cpu15/cpufreq/boost - - - - 0"
|
||||
];
|
||||
|
||||
boot.extraModprobeConfig = ''
|
||||
# Disable the hardware watchdog inside AMD 700 chipset series for power savings.
|
||||
blacklist sp5100_tco
|
||||
|
||||
# Sound power-saving was causing chat notifications to be inaudible.
|
||||
# options snd_hda_intel power_save=1
|
||||
'';
|
||||
};
|
||||
}
|
||||
9
nix/configuration/hosts/odowork/screen_brightness.nix
Normal file
9
nix/configuration/hosts/odowork/screen_brightness.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = {
|
||||
systemd.tmpfiles.rules = [
|
||||
"w- /sys/class/backlight/amdgpu_bl1/brightness - - - - 32767"
|
||||
];
|
||||
};
|
||||
}
|
||||
15
nix/configuration/hosts/odowork/ssh_config.nix
Normal file
15
nix/configuration/hosts/odowork/ssh_config.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = {
|
||||
me.install.user.talexander.file = {
|
||||
".ssh/config" = {
|
||||
source = lib.mkForce "/persist/manual/ssh/talexander/config";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
10
nix/configuration/hosts/odowork/wifi.nix
Normal file
10
nix/configuration/hosts/odowork/wifi.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = {
|
||||
# Enable debug logging for ath12k wifi card.
|
||||
boot.kernelParams = [
|
||||
"ath12k.debug_mask=0xffffffff"
|
||||
];
|
||||
};
|
||||
}
|
||||
7
nix/configuration/hosts/odowork/wrapped-disk-config.nix
Normal file
7
nix/configuration/hosts/odowork/wrapped-disk-config.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
lib.mkIf (!config.me.buildingPortable) (import ./disk-config.nix)
|
||||
@@ -6,14 +6,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
#TARGET=10.216.1.15
|
||||
# TARGET=192.168.211.250
|
||||
TARGET=quark
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
nixos-rebuild boot --flake "$DIR/../../#quark" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild boot --flake /persist/manual/configuration#quark'
|
||||
nixos-rebuild boot --flake "$DIR/../../#quark" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
@@ -6,14 +6,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
#TARGET=10.216.1.14
|
||||
# TARGET=192.168.211.250
|
||||
TARGET=quark
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
|
||||
nixos-rebuild switch --flake "$DIR/../../#quark" --target-host "$TARGET" --build-host "$TARGET" --fast --use-remote-sudo --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
# rsync -av --progress --delete --exclude=.git "$DIR/../../../configuration" "talexander@${TARGET}:/persist/manual/" && ssh talexander@${TARGET} 'cd /persist/manual/configuration && nix flake update zsh-histdb && nix flake update ansible-sshjail && doas nice -n 19 nixos-rebuild switch --flake /persist/manual/configuration#quark'
|
||||
nixos-rebuild switch --flake "$DIR/../../#quark" --target-host "$TARGET" --build-host "$TARGET" --sudo --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
@@ -6,7 +6,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#iso.quark" --max-jobs "$JOBS" --log-format internal-json -v "${@}" |& nom --json
|
||||
nix build --extra-experimental-features nix-command --extra-experimental-features flakes "$DIR/../..#quark.iso" --max-jobs "$JOBS" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
@@ -6,7 +6,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nixos-rebuild boot --show-trace --use-remote-sudo --max-jobs "$JOBS" --flake "$DIR/../../#quark" --log-format internal-json -v "${@}" |& nom --json
|
||||
nixos-rebuild boot --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#quark" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
@@ -6,7 +6,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nixos-rebuild build --show-trace --use-remote-sudo --max-jobs "$JOBS" --flake "$DIR/../../#quark" --log-format internal-json -v "${@}" |& nom --json
|
||||
nixos-rebuild build --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#quark" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
@@ -6,7 +6,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
: "${JOBS:="1"}"
|
||||
|
||||
nix flake update zsh-histdb --flake "$DIR/../../"
|
||||
nix flake update ansible-sshjail --flake "$DIR/../../"
|
||||
for f in /persist/manual/manual_add_to_store/*; do nix-store --add-fixed sha256 "$f"; done
|
||||
nixos-rebuild switch --show-trace --use-remote-sudo --max-jobs "$JOBS" --flake "$DIR/../../#quark" --log-format internal-json -v "${@}" |& nom --json
|
||||
nixos-rebuild switch --show-trace --sudo --max-jobs "$JOBS" --flake "$DIR/../../#quark" --repair --log-format internal-json -v "${@}" |& nom --json
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./disk-config.nix
|
||||
./wrapped-disk-config.nix
|
||||
./distributed_build.nix
|
||||
./hardware-configuration.nix
|
||||
./power_management.nix
|
||||
./waybar.nix
|
||||
./wifi.nix
|
||||
];
|
||||
|
||||
@@ -22,15 +23,28 @@
|
||||
time.timeZone = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
me.secureBoot.enable = true;
|
||||
me.boot.enable = true;
|
||||
me.boot.secure = false;
|
||||
me.mountPersistence = true;
|
||||
|
||||
# Toggle to start writing the extlinux config which will be used by zfsbootmenu
|
||||
boot.loader.generic-extlinux-compatible.enable = true;
|
||||
boot.loader.systemd-boot.enable = lib.mkForce false;
|
||||
|
||||
me.rollback.dataset = [
|
||||
"zroot/linux/nix/root@blank"
|
||||
"zroot/linux/nix/home@blank"
|
||||
];
|
||||
|
||||
me.optimizations = {
|
||||
enable = true;
|
||||
arch = "znver5";
|
||||
arch = "znver4";
|
||||
# build_arch = "x86-64-v3";
|
||||
system_features = [
|
||||
"gccarch-znver4"
|
||||
"gccarch-znver5"
|
||||
"gccarch-skylake"
|
||||
"gccarch-kabylake"
|
||||
# "gccarch-alderlake" missing WAITPKG
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
@@ -50,63 +64,98 @@
|
||||
# Enable TRIM
|
||||
# services.fstrim.enable = lib.mkDefault true;
|
||||
|
||||
# Only run nix builders at idle priority for a more responsive system. Do not set on servers, just end-user devices.
|
||||
nix.daemonCPUSchedPolicy = "idle";
|
||||
|
||||
# RPCS3 has difficulty with znver5
|
||||
me.rpcs3.config.Core."Use LLVM CPU" = "znver4";
|
||||
|
||||
me.alacritty.enable = true;
|
||||
me.amd_s2idle.enable = true;
|
||||
me.ansible.enable = true;
|
||||
me.android.enable = true;
|
||||
me.ares.enable = true;
|
||||
me.base.enable = true;
|
||||
me.bluetooth.enable = true;
|
||||
me.build_in_ram.enable = true;
|
||||
me.chromecast.enable = true;
|
||||
me.chromium.enable = true;
|
||||
me.d2.enable = true;
|
||||
me.direnv.enable = true;
|
||||
me.docker.enable = true;
|
||||
me.doas.enable = true;
|
||||
me.docker.enable = false;
|
||||
me.dont_use_substituters.enable = true;
|
||||
me.ecc.enable = true;
|
||||
me.emacs_flavor = "full";
|
||||
me.emulate_isa.enable = true;
|
||||
me.esim.enable = true;
|
||||
me.firefox.enable = true;
|
||||
me.firewall.enable = true;
|
||||
me.flux.enable = true;
|
||||
me.font.enable = true;
|
||||
me.gcloud.enable = true;
|
||||
me.git.config = ../../roles/git/files/gitconfig_home;
|
||||
me.git.enable = true;
|
||||
me.gnuplot.enable = true;
|
||||
me.gpg.enable = true;
|
||||
me.graphical = true;
|
||||
me.graphics_card_type = "amd";
|
||||
me.graphviz.enable = true;
|
||||
me.iso_mount.enable = true;
|
||||
me.jujutsu.config = ../../roles/jujutsu/files/jujutsu_config_home.toml;
|
||||
me.jujutsu.enable = true;
|
||||
me.kanshi.enable = false;
|
||||
me.kubernetes.enable = true;
|
||||
me.latex.enable = true;
|
||||
me.launch_keyboard.enable = true;
|
||||
me.lvfs.enable = true;
|
||||
me.media.enable = true;
|
||||
me.memtest.enable = true;
|
||||
me.network.enable = true;
|
||||
me.nix_index.enable = true;
|
||||
me.nix_repl.enable = true;
|
||||
me.nix_worker.enable = true;
|
||||
me.nixdev.enable = true;
|
||||
me.nvme.enable = true;
|
||||
me.openpgp_card_tools.enable = true;
|
||||
me.pcsx2.enable = true;
|
||||
me.podman.enable = true;
|
||||
me.postgresql_client.enable = true;
|
||||
me.python.enable = true;
|
||||
me.qemu.enable = true;
|
||||
me.recovery.enable = true;
|
||||
me.rpcs3.enable = true;
|
||||
me.rust.enable = true;
|
||||
me.shadps4.enable = true;
|
||||
me.sequoia.enable = true;
|
||||
me.shadps4.enable = false;
|
||||
me.shikane.enable = true;
|
||||
me.sops.enable = true;
|
||||
me.sound.enable = true;
|
||||
me.spaghettikart.enable = true;
|
||||
me.ssh.enable = true;
|
||||
me.sshd.enable = true;
|
||||
me.steam.enable = true;
|
||||
me.steam_run_free.enable = true;
|
||||
me.sway.enable = true;
|
||||
me.tekton.enable = true;
|
||||
me.terraform.enable = true;
|
||||
me.thunderbolt.enable = true;
|
||||
me.user.enable = true;
|
||||
me.uutils.enable = false;
|
||||
me.vnc_client.enable = true;
|
||||
me.vscode.enable = true;
|
||||
me.wasm.enable = true;
|
||||
me.waybar.enable = true;
|
||||
me.webcam.enable = true;
|
||||
me.wine.enable = false;
|
||||
me.wireguard.activated = [
|
||||
"drmario"
|
||||
"wgh"
|
||||
"colo"
|
||||
];
|
||||
me.wireguard.deactivated = [ "wgf" ];
|
||||
me.yubikey.enable = true;
|
||||
me.zfs.enable = true;
|
||||
me.zrepl.enable = true;
|
||||
me.zsh.enable = true;
|
||||
|
||||
|
||||
@@ -2,13 +2,6 @@
|
||||
# Check if drive supports 4kn: nvme id-ns -H /dev/nvme0n1
|
||||
# Format the drive to 4kn: nvme format --lbaf=1 /dev/nvme0n1
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
lib.mkIf (!config.me.buildingIso) {
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
@@ -23,7 +16,7 @@ lib.mkIf (!config.me.buildingIso) {
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountpoint = "/efi";
|
||||
mountOptions = [
|
||||
"umask=0077"
|
||||
"noatime"
|
||||
@@ -82,6 +75,15 @@ lib.mkIf (!config.me.buildingIso) {
|
||||
mountpoint = "/";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/root@blank$' || zfs snapshot zroot/linux/nix/root@blank";
|
||||
};
|
||||
"linux/nix/boot" = {
|
||||
type = "zfs_fs";
|
||||
options = {
|
||||
mountpoint = "legacy";
|
||||
"org.zfsbootmenu:active" = "on";
|
||||
};
|
||||
mountpoint = "/boot";
|
||||
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/linux/nix/boot@blank$' || zfs snapshot zroot/linux/nix/boot@blank";
|
||||
};
|
||||
"linux/nix/nix" = {
|
||||
type = "zfs_fs";
|
||||
options.mountpoint = "legacy";
|
||||
|
||||
@@ -1,21 +1,13 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
me.distributed_build.enable = true;
|
||||
me.distributed_build.machines.hydra = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
config = {
|
||||
me.distributed_build.enable = true;
|
||||
me.distributed_build.machines.hydra = {
|
||||
enable = true;
|
||||
additional_config = {
|
||||
speedFactor = 2;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
# 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,
|
||||
...
|
||||
}:
|
||||
@@ -14,22 +10,24 @@
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
config = {
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# 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.eno1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
|
||||
# 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.eno1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
};
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user