This commit is contained in:
dusk 2022-08-14 10:45:17 +03:00
parent 34e24a829d
commit 3af6375a8c
Signed by: dusk
GPG Key ID: 1D8F8FAF2294D6EA
6 changed files with 75 additions and 66 deletions

View File

@ -75,11 +75,11 @@
]
},
"locked": {
"lastModified": 1660460606,
"narHash": "sha256-Ii+2BV7wRKbK+92vTcdJB9rGdNYqbIOrl22oFBZZGJ8=",
"lastModified": 1660463078,
"narHash": "sha256-0Fnkx0nBt/OSzAFtOvoZVsuvWUyKOdNWLqC1WbxX42o=",
"ref": "refs/heads/master",
"rev": "04fbe0aab92fbcea4ea766b99ddafa0f5535875b",
"revCount": 60,
"rev": "9de392f81cf3e88fe125e1f952276e4ffd59d82f",
"revCount": 61,
"type": "git",
"url": "https://git.gaze.systems/dusk/website.git"
},

View File

@ -1,12 +1,11 @@
{
config,
lib,
tlib,
pkgs,
inputs,
...
}: let
byLabel = label: "/dev/disk/by-label/${label}";
in {
}: {
imports = with inputs;
with nixos-hardware.nixosModules; [
nixpkgs.nixosModules.notDetected
@ -21,60 +20,11 @@ in {
../../modules/network/iwd.nix
../../users/root
../../users/patriot
];
]
++ (tlib.importFolder (toString ./modules));
system.persistDir = "/persist";
boot = {
tmpOnTmpfs = true;
loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
systemd-boot.configurationLimit = 10;
};
kernelPackages = pkgs.linuxPackages_latest;
supportedFilesystems = ["f2fs"];
initrd = {
availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usb_storage"
"usbhid"
"sd_mod"
];
kernelModules = ["amdgpu"];
};
kernelModules = ["kvm-amd"];
extraModulePackages = [];
kernel.sysctl = {"fs.inotify.max_user_watches" = 524288;};
};
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = ["defaults" "size=2G" "mode=755"];
};
fileSystems."/nix" = {
device = byLabel "NIX";
fsType = "f2fs";
};
fileSystems."${config.system.persistDir}" = {
device = byLabel "PERSIST";
fsType = "f2fs";
neededForBoot = true;
};
fileSystems."/boot" = {
device = byLabel "BOOT";
fsType = "vfat";
};
swapDevices = [];
zramSwap = {
enable = true;
algorithm = "zstd";
};
nix.settings.max-jobs = lib.mkForce 16;
security = {
pam.loginLimits = [

View File

@ -0,0 +1,26 @@
{pkgs, ...}: {
boot = {
tmpOnTmpfs = true;
loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
systemd-boot.configurationLimit = 10;
};
kernelPackages = pkgs.linuxPackages_latest;
supportedFilesystems = ["f2fs"];
initrd = {
availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usb_storage"
"usbhid"
"sd_mod"
];
kernelModules = ["amdgpu"];
};
kernelModules = ["kvm-amd"];
extraModulePackages = [];
kernel.sysctl = {"fs.inotify.max_user_watches" = 524288;};
};
}

View File

@ -0,0 +1,30 @@
{config, ...}:
let
byLabel = label: "/dev/disk/by-label/${label}";
in
{
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = ["defaults" "size=2G" "mode=755"];
};
fileSystems."/nix" = {
device = byLabel "NIX";
fsType = "f2fs";
};
fileSystems."${config.system.persistDir}" = {
device = byLabel "PERSIST";
fsType = "f2fs";
neededForBoot = true;
};
fileSystems."/boot" = {
device = byLabel "BOOT";
fsType = "vfat";
};
swapDevices = [];
zramSwap = {
enable = true;
algorithm = "zstd";
};
}

View File

@ -3,16 +3,10 @@
pkgs,
config,
lib,
tlib,
...
}: {
imports = let
b = builtins;
modules = toString ./modules;
files = b.readDir modules;
filesToImport =
b.map (name: "${modules}/${name}") (b.attrNames files);
in
filesToImport;
imports = tlib.importFolder (toString ./modules);
boot.cleanTmpDir = true;
zramSwap.enable = true;

View File

@ -10,4 +10,13 @@ lib.makeExtensible (self: {
prefixStrings = prefix: strings:
lib.forEach strings (string: "${prefix}${string}");
importFolder = modules:
let
b = builtins;
files = b.readDir modules;
filesToImport =
b.map (name: "${modules}/${name}") (b.attrNames files);
in
filesToImport;
})