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

View File

@ -1,12 +1,11 @@
{ {
config, config,
lib, lib,
tlib,
pkgs, pkgs,
inputs, inputs,
... ...
}: let }: {
byLabel = label: "/dev/disk/by-label/${label}";
in {
imports = with inputs; imports = with inputs;
with nixos-hardware.nixosModules; [ with nixos-hardware.nixosModules; [
nixpkgs.nixosModules.notDetected nixpkgs.nixosModules.notDetected
@ -21,60 +20,11 @@ in {
../../modules/network/iwd.nix ../../modules/network/iwd.nix
../../users/root ../../users/root
../../users/patriot ../../users/patriot
]; ]
++ (tlib.importFolder (toString ./modules));
system.persistDir = "/persist"; 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; nix.settings.max-jobs = lib.mkForce 16;
security = { security = {
pam.loginLimits = [ 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, pkgs,
config, config,
lib, lib,
tlib,
... ...
}: { }: {
imports = let imports = tlib.importFolder (toString ./modules);
b = builtins;
modules = toString ./modules;
files = b.readDir modules;
filesToImport =
b.map (name: "${modules}/${name}") (b.attrNames files);
in
filesToImport;
boot.cleanTmpDir = true; boot.cleanTmpDir = true;
zramSwap.enable = true; zramSwap.enable = true;

View File

@ -10,4 +10,13 @@ lib.makeExtensible (self: {
prefixStrings = prefix: strings: prefixStrings = prefix: strings:
lib.forEach strings (string: "${prefix}${string}"); 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;
}) })