Compare commits
No commits in common. "3f945f8ae3e6954177f4ebde3785fb74f1919f61" and "d537aa599b36384eadf6991419c05f7a9c391f4c" have entirely different histories.
3f945f8ae3
...
d537aa599b
@ -64,23 +64,6 @@
|
|||||||
# force: true
|
# force: true
|
||||||
# diff: false
|
# diff: false
|
||||||
|
|
||||||
- name: Create directories
|
|
||||||
file:
|
|
||||||
name: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
mode: 0700
|
|
||||||
owner: nochainstounlock
|
|
||||||
group: nochainstounlock
|
|
||||||
loop:
|
|
||||||
- /home/nochainstounlock/.ssh
|
|
||||||
|
|
||||||
- name: Set authorized keys
|
|
||||||
authorized_key:
|
|
||||||
user: nochainstounlock
|
|
||||||
key: |
|
|
||||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMrjXsXjtxEm47XnRZfo67kJULoc0NBLrB0lPYFiS2Ar kodi@neelix
|
|
||||||
exclusive: true
|
|
||||||
|
|
||||||
- import_tasks: tasks/freebsd.yaml
|
- import_tasks: tasks/freebsd.yaml
|
||||||
when: 'os_flavor == "freebsd"'
|
when: 'os_flavor == "freebsd"'
|
||||||
|
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./roles/reset
|
./roles/reset
|
||||||
./roles/global_options
|
|
||||||
./util/unfree_polyfill
|
./util/unfree_polyfill
|
||||||
./roles/iso
|
./roles/iso
|
||||||
|
./hosts/odo
|
||||||
"${
|
"${
|
||||||
builtins.fetchTarball {
|
builtins.fetchTarball {
|
||||||
url = "https://github.com/nix-community/disko/archive/refs/tags/v1.9.0.tar.gz";
|
url = "https://github.com/nix-community/disko/archive/refs/tags/v1.9.0.tar.gz";
|
||||||
@ -55,10 +55,6 @@
|
|||||||
./roles/wasm
|
./roles/wasm
|
||||||
./roles/vnc_client
|
./roles/vnc_client
|
||||||
./roles/chromecast
|
./roles/chromecast
|
||||||
./roles/memtest86
|
|
||||||
./roles/kodi
|
|
||||||
./roles/ansible
|
|
||||||
./roles/bluetooth
|
|
||||||
];
|
];
|
||||||
|
|
||||||
nix.settings.experimental-features = [
|
nix.settings.experimental-features = [
|
||||||
|
@ -81,19 +81,11 @@
|
|||||||
};
|
};
|
||||||
systems = {
|
systems = {
|
||||||
odo = {
|
odo = {
|
||||||
main = nixpkgs.lib.nixosSystem (
|
main = nixpkgs.lib.nixosSystem (base_x86_64_linux // { });
|
||||||
base_x86_64_linux
|
|
||||||
// {
|
|
||||||
modules = base_x86_64_linux.modules ++ [
|
|
||||||
./hosts/odo
|
|
||||||
];
|
|
||||||
}
|
|
||||||
);
|
|
||||||
iso = nixpkgs.lib.nixosSystem (
|
iso = nixpkgs.lib.nixosSystem (
|
||||||
base_x86_64_linux
|
base_x86_64_linux
|
||||||
// {
|
// {
|
||||||
modules = base_x86_64_linux.modules ++ [
|
modules = base_x86_64_linux.modules ++ [
|
||||||
./hosts/odo
|
|
||||||
(nixpkgs + "/nixos/modules/installer/cd-dvd/iso-image.nix")
|
(nixpkgs + "/nixos/modules/installer/cd-dvd/iso-image.nix")
|
||||||
# TODO: Figure out how to do image based appliances
|
# TODO: Figure out how to do image based appliances
|
||||||
# (nixpkgs + "/nixos/modules/profiles/image-based-appliance.nix")
|
# (nixpkgs + "/nixos/modules/profiles/image-based-appliance.nix")
|
||||||
@ -106,36 +98,10 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
neelix = {
|
|
||||||
main = nixpkgs.lib.nixosSystem (
|
|
||||||
base_x86_64_linux
|
|
||||||
// {
|
|
||||||
modules = base_x86_64_linux.modules ++ [
|
|
||||||
./hosts/neelix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
);
|
|
||||||
iso = nixpkgs.lib.nixosSystem (
|
|
||||||
base_x86_64_linux
|
|
||||||
// {
|
|
||||||
modules = base_x86_64_linux.modules ++ [
|
|
||||||
./hosts/neelix
|
|
||||||
(nixpkgs + "/nixos/modules/installer/cd-dvd/iso-image.nix")
|
|
||||||
{
|
|
||||||
isoImage.makeEfiBootable = true;
|
|
||||||
isoImage.makeUsbBootable = true;
|
|
||||||
me.buildingIso = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations.odo = systems.odo.main;
|
nixosConfigurations.odo = systems.odo.main;
|
||||||
iso.odo = systems.odo.iso.config.system.build.isoImage;
|
iso.odo = systems.odo.iso.config.system.build.isoImage;
|
||||||
nixosConfigurations.neelix = systems.neelix.main;
|
|
||||||
iso.neelix = systems.neelix.iso.config.system.build.isoImage;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./hardware-configuration.nix
|
|
||||||
./disk-config.nix
|
|
||||||
./optimized_build.nix
|
|
||||||
./power_management.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
|
||||||
networking.hostId = "fbd233d8";
|
|
||||||
|
|
||||||
networking.hostName = "neelix"; # Define your hostname.
|
|
||||||
|
|
||||||
time.timeZone = "America/New_York";
|
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
|
||||||
|
|
||||||
me.secureBoot.enable = false;
|
|
||||||
|
|
||||||
# Early KMS
|
|
||||||
boot.initrd.kernelModules = [ "i915" ];
|
|
||||||
|
|
||||||
# Mount tmpfs at /tmp
|
|
||||||
boot.tmp.useTmpfs = true;
|
|
||||||
|
|
||||||
me.graphical = true;
|
|
||||||
me.graphicsCardType = "intel";
|
|
||||||
|
|
||||||
me.kodi.enable = true;
|
|
||||||
me.bluetooth.enable = true;
|
|
||||||
}
|
|
@ -1,140 +0,0 @@
|
|||||||
# 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 = {
|
|
||||||
type = "disk";
|
|
||||||
device = "/dev/nvme0n1";
|
|
||||||
content = {
|
|
||||||
type = "gpt";
|
|
||||||
partitions = {
|
|
||||||
ESP = {
|
|
||||||
size = "1G";
|
|
||||||
type = "EF00";
|
|
||||||
content = {
|
|
||||||
type = "filesystem";
|
|
||||||
format = "vfat";
|
|
||||||
mountpoint = "/boot";
|
|
||||||
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";
|
|
||||||
};
|
|
||||||
"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/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";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"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."/nix".options = [
|
|
||||||
"noatime"
|
|
||||||
"norelatime"
|
|
||||||
];
|
|
||||||
fileSystems."/persist".options = [
|
|
||||||
"noatime"
|
|
||||||
"norelatime"
|
|
||||||
];
|
|
||||||
fileSystems."/state".options = [
|
|
||||||
"noatime"
|
|
||||||
"norelatime"
|
|
||||||
];
|
|
||||||
fileSystems."/home".options = [
|
|
||||||
"noatime"
|
|
||||||
"norelatime"
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,32 +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.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;
|
|
||||||
}
|
|
@ -1,78 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
imports = [ ];
|
|
||||||
|
|
||||||
config = lib.mkMerge [
|
|
||||||
{ }
|
|
||||||
(lib.mkIf (!config.me.buildingIso) {
|
|
||||||
nix.settings.system-features = lib.mkForce [
|
|
||||||
"gccarch-alderlake"
|
|
||||||
"gccarch-x86-64-v3"
|
|
||||||
"benchmark"
|
|
||||||
"big-parallel"
|
|
||||||
"kvm"
|
|
||||||
"nixos-test"
|
|
||||||
];
|
|
||||||
|
|
||||||
# nixpkgs.hostPlatform = {
|
|
||||||
# gcc.arch = "alderlake";
|
|
||||||
# gcc.tune = "alderlake";
|
|
||||||
# system = "x86_64-linux";
|
|
||||||
|
|
||||||
# };
|
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
|
||||||
(
|
|
||||||
self: super:
|
|
||||||
let
|
|
||||||
optimizeWithFlags =
|
|
||||||
pkg: flags:
|
|
||||||
pkg.overrideAttrs (old: {
|
|
||||||
NIX_CFLAGS_COMPILE = [ (old.NIX_CFLAGS_COMPILE or "") ] ++ flags;
|
|
||||||
});
|
|
||||||
addConfig =
|
|
||||||
additionalConfig: pkg:
|
|
||||||
pkg.override (oldconfig: {
|
|
||||||
structuredExtraConfig = pkg.structuredExtraConfig // additionalConfig;
|
|
||||||
});
|
|
||||||
in
|
|
||||||
{
|
|
||||||
linux_alderlake =
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
(
|
|
||||||
optimizeWithFlags super.linux_6_12 [
|
|
||||||
"-march=alderlake"
|
|
||||||
"-mtune=alderlake"
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_alderlake;
|
|
||||||
})
|
|
||||||
(lib.mkIf (config.me.buildingIso) {
|
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_12;
|
|
||||||
boot.supportedFilesystems = [ "zfs" ];
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [ ];
|
|
||||||
|
|
||||||
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"
|
|
||||||
];
|
|
||||||
|
|
||||||
# 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
|
|
||||||
'';
|
|
||||||
}
|
|
@ -31,7 +31,4 @@
|
|||||||
|
|
||||||
me.graphical = true;
|
me.graphical = true;
|
||||||
me.graphicsCardType = "amd";
|
me.graphicsCardType = "amd";
|
||||||
|
|
||||||
me.sway.enable = true;
|
|
||||||
me.ansible.enable = true;
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
# 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,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
@ -7,75 +7,65 @@
|
|||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
config = lib.mkMerge [
|
nix.settings.system-features = lib.mkForce [
|
||||||
{ }
|
"gccarch-znver4"
|
||||||
(lib.mkIf (!config.me.buildingIso) {
|
"gccarch-skylake"
|
||||||
nix.settings.system-features = lib.mkForce [
|
# "gccarch-alderlake" missing WAITPKG
|
||||||
"gccarch-znver4"
|
"gccarch-x86-64-v3"
|
||||||
"gccarch-skylake"
|
"gccarch-x86-64-v4"
|
||||||
# "gccarch-alderlake" missing WAITPKG
|
"benchmark"
|
||||||
"gccarch-x86-64-v3"
|
"big-parallel"
|
||||||
"gccarch-x86-64-v4"
|
"kvm"
|
||||||
"benchmark"
|
"nixos-test"
|
||||||
"big-parallel"
|
|
||||||
"kvm"
|
|
||||||
"nixos-test"
|
|
||||||
];
|
|
||||||
|
|
||||||
# nixpkgs.hostPlatform = {
|
|
||||||
# gcc.arch = "znver4";
|
|
||||||
# gcc.tune = "znver4";
|
|
||||||
# system = "x86_64-linux";
|
|
||||||
|
|
||||||
# };
|
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
|
||||||
(
|
|
||||||
self: super:
|
|
||||||
let
|
|
||||||
optimizeWithFlags =
|
|
||||||
pkg: flags:
|
|
||||||
pkg.overrideAttrs (old: {
|
|
||||||
NIX_CFLAGS_COMPILE = [ (old.NIX_CFLAGS_COMPILE or "") ] ++ flags;
|
|
||||||
});
|
|
||||||
addConfig =
|
|
||||||
additionalConfig: pkg:
|
|
||||||
pkg.override (oldconfig: {
|
|
||||||
structuredExtraConfig = pkg.structuredExtraConfig // additionalConfig;
|
|
||||||
});
|
|
||||||
in
|
|
||||||
{
|
|
||||||
linux_znver4 =
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
(
|
|
||||||
optimizeWithFlags super.linux_6_12 [
|
|
||||||
"-march=znver4"
|
|
||||||
"-mtune=znver4"
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_znver4;
|
|
||||||
})
|
|
||||||
(lib.mkIf (config.me.buildingIso) {
|
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_12;
|
|
||||||
boot.supportedFilesystems.zfs = true;
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# nixpkgs.hostPlatform = {
|
||||||
|
# gcc.arch = "znver4";
|
||||||
|
# gcc.tune = "znver4";
|
||||||
|
# system = "x86_64-linux";
|
||||||
|
# };
|
||||||
|
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(
|
||||||
|
self: super:
|
||||||
|
let
|
||||||
|
optimizeWithFlags =
|
||||||
|
pkg: flags:
|
||||||
|
pkg.overrideAttrs (old: {
|
||||||
|
NIX_CFLAGS_COMPILE = [ (old.NIX_CFLAGS_COMPILE or "") ] ++ flags;
|
||||||
|
});
|
||||||
|
addConfig =
|
||||||
|
additionalConfig: pkg:
|
||||||
|
pkg.override (oldconfig: {
|
||||||
|
structuredExtraConfig = pkg.structuredExtraConfig // additionalConfig;
|
||||||
|
});
|
||||||
|
in
|
||||||
|
{
|
||||||
|
linux_znver4 =
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
(
|
||||||
|
optimizeWithFlags super.linux_6_12 [
|
||||||
|
"-march=znver4"
|
||||||
|
"-mtune=znver4"
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.kernelPackages = lib.mkIf (!config.me.buildingIso) (pkgs.linuxPackagesFor pkgs.linux_znver4);
|
||||||
}
|
}
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [ ];
|
|
||||||
|
|
||||||
options.me = {
|
|
||||||
ansible.enable = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
description = "Whether we want to install ansible.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf config.me.ansible.enable (
|
|
||||||
lib.mkMerge [
|
|
||||||
{
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
ansible
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
|
||||||
(final: prev: {
|
|
||||||
ansible = pkgs.symlinkJoin {
|
|
||||||
name = "ansible";
|
|
||||||
paths = [
|
|
||||||
(prev.ansible.overridePythonAttrs {
|
|
||||||
propagatedBuildInputs = prev.ansible.propagatedBuildInputs ++ [ prev.python3Packages.jmespath ];
|
|
||||||
})
|
|
||||||
];
|
|
||||||
buildInputs = [ pkgs.makeWrapper ];
|
|
||||||
postBuild = ''
|
|
||||||
wrapProgram $out/bin/ansible --prefix PATH : ${lib.makeBinPath [ ]}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
@ -8,23 +8,6 @@
|
|||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
options.me = {
|
environment.systemPackages = with pkgs; [
|
||||||
blank.enable = lib.mkOption {
|
];
|
||||||
type = lib.types.bool;
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
description = "Whether we want to install blank.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf config.me.blank.enable (
|
|
||||||
lib.mkMerge [
|
|
||||||
{
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
];
|
|
||||||
}
|
|
||||||
(lib.mkIf config.me.graphical {
|
|
||||||
})
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [ ];
|
|
||||||
|
|
||||||
options.me = {
|
|
||||||
bluetooth.enable = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
description = "Whether we want to install bluetooth.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf config.me.bluetooth.enable (
|
|
||||||
lib.mkMerge [
|
|
||||||
{
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
];
|
|
||||||
|
|
||||||
hardware.bluetooth = {
|
|
||||||
enable = true;
|
|
||||||
powerOnBoot = true;
|
|
||||||
settings = {
|
|
||||||
General = {
|
|
||||||
# Enable support for showing battery charge level.
|
|
||||||
Experimental = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
|
||||||
hideMounts = true;
|
|
||||||
directories = [
|
|
||||||
"/var/lib/bluetooth" # Bluetooth pairing information.
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
@ -41,8 +41,6 @@
|
|||||||
# Automatically delete old generations
|
# Automatically delete old generations
|
||||||
boot.loader.systemd-boot.configurationLimit = 3;
|
boot.loader.systemd-boot.configurationLimit = 3;
|
||||||
|
|
||||||
boot.loader.systemd-boot.memtest86.enable = true;
|
|
||||||
|
|
||||||
# Check what will be lost with `zfs diff zroot/linux/root@blank`
|
# Check what will be lost with `zfs diff zroot/linux/root@blank`
|
||||||
boot.initrd.systemd.enable = lib.mkDefault true;
|
boot.initrd.systemd.enable = lib.mkDefault true;
|
||||||
boot.initrd.systemd.services.zfs-rollback = {
|
boot.initrd.systemd.services.zfs-rollback = {
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [ ];
|
|
||||||
|
|
||||||
options.me = {
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
# options.me.graphicsCardType = lib.mkOption {
|
|
||||||
# type = lib.types.nullOr (
|
|
||||||
# lib.types.enum [
|
|
||||||
# "amd"
|
|
||||||
# "intel"
|
|
||||||
# "nvidia"
|
|
||||||
# ]
|
|
||||||
# );
|
|
||||||
# default = null;
|
|
||||||
# example = "amd";
|
|
||||||
# description = "What graphics card type is in the computer.";
|
|
||||||
# };
|
|
||||||
|
|
||||||
# options.me.graphical = lib.mkOption {
|
|
||||||
# type = lib.types.bool;
|
|
||||||
# default = false;
|
|
||||||
# example = true;
|
|
||||||
# description = "Whether we want to install graphical programs.";
|
|
||||||
# };
|
|
||||||
}
|
|
@ -1,99 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [ ];
|
|
||||||
|
|
||||||
options.me = {
|
|
||||||
kodi.enable = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
description = "Whether we want to install kodi.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf config.me.kodi.enable (
|
|
||||||
lib.mkMerge [
|
|
||||||
{
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
];
|
|
||||||
}
|
|
||||||
(lib.mkIf config.me.graphical {
|
|
||||||
services.cage.user = "kodi";
|
|
||||||
services.cage.program = "${pkgs.kodi-wayland}/bin/kodi-standalone";
|
|
||||||
services.cage.enable = true;
|
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
|
||||||
(final: prev: {
|
|
||||||
kodi-wayland = prev.kodi-wayland.withPackages (
|
|
||||||
kodiPkgs: with kodiPkgs; [
|
|
||||||
joystick
|
|
||||||
vfs-sftp
|
|
||||||
]
|
|
||||||
);
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
users.users.kodi = {
|
|
||||||
isNormalUser = true;
|
|
||||||
createHome = true; # https://github.com/NixOS/nixpkgs/issues/6481
|
|
||||||
group = "kodi";
|
|
||||||
extraGroups = [ ];
|
|
||||||
uid = 12000;
|
|
||||||
packages = with pkgs; [
|
|
||||||
tree
|
|
||||||
];
|
|
||||||
# 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.kodi.gid = 12000;
|
|
||||||
|
|
||||||
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
|
||||||
hideMounts = true;
|
|
||||||
users.kodi = {
|
|
||||||
directories = [
|
|
||||||
{
|
|
||||||
directory = ".ssh";
|
|
||||||
user = "kodi";
|
|
||||||
group = "kodi";
|
|
||||||
mode = "0755";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
directory = ".kodi";
|
|
||||||
user = "kodi";
|
|
||||||
group = "kodi";
|
|
||||||
mode = "0755";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.kodi =
|
|
||||||
{ pkgs, ... }:
|
|
||||||
{
|
|
||||||
# home.file.".kodi/userdata/mediasources.xml".source = ./files/mediasources.xml;
|
|
||||||
|
|
||||||
# home.file.".kodi/userdata/addon_data/peripheral.joystick/resources/buttonmaps/xml/linux/DualSense_Wireless_Controller_13b_8a.xml".source =
|
|
||||||
# ./files/DualSense_Wireless_Controller_13b_8a.xml;
|
|
||||||
|
|
||||||
# TODO: Maybe .kodi/userdata/sources.xml
|
|
||||||
# TODO: ./userdata/guisettings.xml:303: <setting id="filecache.memorysize">128</setting>
|
|
||||||
|
|
||||||
# The state version is required and should stay at the version you
|
|
||||||
# originally installed.
|
|
||||||
home.stateVersion = "24.11";
|
|
||||||
};
|
|
||||||
})
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
<?xml version="1.0" ?>
|
|
||||||
<buttonmap>
|
|
||||||
<device name="DualSense Wireless Controller" provider="linux" buttoncount="13" axiscount="8">
|
|
||||||
<configuration>
|
|
||||||
<axis index="2" center="-1" range="2" />
|
|
||||||
<axis index="5" center="-1" range="2" />
|
|
||||||
</configuration>
|
|
||||||
<controller id="game.controller.default">
|
|
||||||
<feature name="a" button="0" />
|
|
||||||
<feature name="b" button="1" />
|
|
||||||
<feature name="back" button="9" />
|
|
||||||
<feature name="down" axis="+7" />
|
|
||||||
<feature name="guide" button="10" />
|
|
||||||
<feature name="left" axis="-6" />
|
|
||||||
<feature name="leftbumper" button="4" />
|
|
||||||
<feature name="leftstick">
|
|
||||||
<up axis="-1" />
|
|
||||||
<down axis="+1" />
|
|
||||||
<right axis="+0" />
|
|
||||||
<left axis="-0" />
|
|
||||||
</feature>
|
|
||||||
<feature name="lefttrigger" button="6" />
|
|
||||||
<feature name="right" axis="+6" />
|
|
||||||
<feature name="rightbumper" button="5" />
|
|
||||||
<feature name="rightstick">
|
|
||||||
<up axis="-4" />
|
|
||||||
<down axis="+4" />
|
|
||||||
<right axis="+3" />
|
|
||||||
<left axis="-3" />
|
|
||||||
</feature>
|
|
||||||
<feature name="righttrigger" button="7" />
|
|
||||||
<feature name="start" button="8" />
|
|
||||||
<feature name="up" axis="-7" />
|
|
||||||
<feature name="x" button="3" />
|
|
||||||
<feature name="y" button="2" />
|
|
||||||
</controller>
|
|
||||||
</device>
|
|
||||||
</buttonmap>
|
|
@ -1,5 +0,0 @@
|
|||||||
<mediasources>
|
|
||||||
<network>
|
|
||||||
<location id="0">sftp://nochainstounlock@stuff.fizz.buzz:42069/readonly/library/</location>
|
|
||||||
</network>
|
|
||||||
</mediasources>
|
|
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [ ];
|
|
||||||
config = lib.mkMerge [
|
|
||||||
{ }
|
|
||||||
(lib.mkIf (config.me.buildingIso) {
|
|
||||||
# boot.loader.systemd-boot.memtest86.enable = true;
|
|
||||||
boot.loader.grub.memtest86.enable = true;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
@ -40,7 +40,6 @@
|
|||||||
10.216.1.1 homeserver
|
10.216.1.1 homeserver
|
||||||
10.216.1.6 media
|
10.216.1.6 media
|
||||||
#10.216.1.12 odo
|
#10.216.1.12 odo
|
||||||
10.216.1.14 neelix
|
|
||||||
10.217.1.1 drmario
|
10.217.1.1 drmario
|
||||||
10.217.2.1 mrmanager
|
10.217.2.1 mrmanager
|
||||||
'';
|
'';
|
||||||
|
@ -266,15 +266,6 @@ in
|
|||||||
./notification.nix
|
./notification.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.me = {
|
|
||||||
sway.enable = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
description = "Whether we want to install sway.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
options.me.swayIncludes = lib.mkOption {
|
options.me.swayIncludes = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.package;
|
type = lib.types.listOf lib.types.package;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
@ -286,7 +277,7 @@ in
|
|||||||
description = "List of packages to import as sway configs.";
|
description = "List of packages to import as sway configs.";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf (config.me.graphical && config.me.sway.enable) {
|
config = {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
alacritty
|
alacritty
|
||||||
pcmanfm
|
pcmanfm
|
||||||
|
@ -19,7 +19,7 @@ in
|
|||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
config = lib.mkIf (config.me.graphical && config.me.sway.enable) {
|
config = lib.mkIf config.me.graphical {
|
||||||
me.swayIncludes = [
|
me.swayIncludes = [
|
||||||
force_focus_sway_config
|
force_focus_sway_config
|
||||||
];
|
];
|
||||||
|
@ -16,7 +16,7 @@ in
|
|||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
config = lib.mkIf (config.me.buildingIso && config.me.graphical && config.me.sway.enable) {
|
config = lib.mkIf (config.me.buildingIso) {
|
||||||
# Launch a terminal at boot in the live ISO for when hotkeys don't work.
|
# Launch a terminal at boot in the live ISO for when hotkeys don't work.
|
||||||
me.swayIncludes = [
|
me.swayIncludes = [
|
||||||
launch_terminal
|
launch_terminal
|
||||||
|
@ -25,7 +25,7 @@ in
|
|||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
config = lib.mkIf (config.me.graphical && config.me.sway.enable) {
|
config = lib.mkIf config.me.graphical {
|
||||||
me.swayIncludes = [
|
me.swayIncludes = [
|
||||||
lockscreen_sway_config
|
lockscreen_sway_config
|
||||||
];
|
];
|
||||||
|
@ -24,7 +24,7 @@ in
|
|||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
config = lib.mkIf (config.me.graphical && config.me.sway.enable) {
|
config = lib.mkIf config.me.graphical {
|
||||||
me.swayIncludes = [
|
me.swayIncludes = [
|
||||||
notification_sway_config
|
notification_sway_config
|
||||||
];
|
];
|
||||||
|
@ -17,7 +17,7 @@ in
|
|||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
config = lib.mkIf (config.me.graphical && config.me.sway.enable) {
|
config = lib.mkIf config.me.graphical {
|
||||||
me.swayIncludes = [
|
me.swayIncludes = [
|
||||||
rofimoji_sway_config
|
rofimoji_sway_config
|
||||||
];
|
];
|
||||||
@ -49,14 +49,14 @@ in
|
|||||||
})
|
})
|
||||||
(final: prev: {
|
(final: prev: {
|
||||||
tofi = pkgs.symlinkJoin {
|
tofi = pkgs.symlinkJoin {
|
||||||
name = "tofi";
|
name = "tofi";
|
||||||
paths = [ prev.tofi ];
|
paths = [ prev.tofi ];
|
||||||
buildInputs = [ pkgs.makeWrapper ];
|
buildInputs = [ pkgs.makeWrapper ];
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
wrapProgram $out/bin/tofi-drun --add-flags --font=${pkgs.source-sans-pro}/share/fonts/opentype/SourceSansPro-Regular.otf --add-flags --config=${./files/tofi-config}
|
wrapProgram $out/bin/tofi-drun --add-flags --font=${pkgs.source-sans-pro}/share/fonts/opentype/SourceSansPro-Regular.otf --add-flags --config=${./files/tofi-config}
|
||||||
wrapProgram $out/bin/tofi --add-flags --config=${./files/tofi-config}
|
wrapProgram $out/bin/tofi --add-flags --config=${./files/tofi-config}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -34,7 +34,7 @@ in
|
|||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
|
|
||||||
config = lib.mkIf (config.me.graphical && config.me.sway.enable) {
|
config = lib.mkIf config.me.graphical {
|
||||||
me.swayIncludes = [
|
me.swayIncludes = [
|
||||||
screenshot_sway_config
|
screenshot_sway_config
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user