First Commit

This commit is contained in:
2026-01-05 04:04:36 +01:00
commit c7a17f7772
83 changed files with 3574 additions and 0 deletions

53
system/core.nix Normal file
View File

@@ -0,0 +1,53 @@
{ pkgs, config, ... }:
let
cfg = config.my.cachyosKernel;
in
{
nix = {
settings = {
download-buffer-size = 200000000;
auto-optimise-store = true;
substituters = [
"https://hyprland.cachix.org"
"https://attic.xuyh0120.win/lantian"
"https://nix-community.cachix.org"
"https://ezkea.cachix.org"
];
trusted-substituters = [ "https://hyprland.cachix.org" ];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"lantian:EeAUQ+W+6r7EtwnmYjeVwx5kOGEBpjlBfPlzGlTNvHc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"ezkea.cachix.org-1:ioBmUbJTZIKsHmWWXPe1FSFbeVe+afhfgqgTSNd34eI="
];
experimental-features = [ "nix-command" "flakes" "pipe-operators" ];
};
};
# Boot/Kernel Stuff
boot = {
kernelPackages =
(
if cfg.enable
then pkgs.cachyosKernels.linuxPackages-cachyos-latest-zen4
else pkgs.linuxPackages_latest
);
kernelModules = ["v4l2loopback" "kvm-amd"];
extraModulePackages = [config.boot.kernelPackages.v4l2loopback];
kernel.sysctl = {"vm.max_map_count" = 2147483642;};
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
# Appimage Support
binfmt.registrations.appimage = {
wrapInterpreterInShell = false;
interpreter = "${pkgs.appimage-run}/bin/appimage-run";
recognitionType = "magic";
offset = 0;
mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
magicOrExtension = ''\x7fELF....AI\x02'';
};
plymouth.enable = true;
};
}

19
system/default.nix Normal file
View File

@@ -0,0 +1,19 @@
{ lib, ... }:
let
b = builtins;
module_files =
b.readDir ./. |>
lib.filterAttrs (name: type:
( (lib.strings.hasSuffix ".nix" name
&& name != "default.nix"
&& type == "regular" )
|| ( type == "directory"
&& b.pathExists ./${name}/default.nix))
) |>
b.attrNames |>
b.map (f: ./${f});
in
{
imports = module_files;
}

24
system/user.nix Normal file
View File

@@ -0,0 +1,24 @@
{
pkgs,
username,
prettyUsername,
...
}: {
users.mutableUsers = true;
users.users.${username} = {
isNormalUser = true;
description = "${prettyUsername}";
extraGroups = [
"adbusers"
"docker" #access to docker as non-root
"libvirtd" #Virt manager/QEMU access
# "lp"
"networkmanager"
"scanner"
"wheel" #sudo access
];
shell = pkgs.bash;
# ignoreShellProgramCheck = true;
};
nix.settings.allowed-users = [ "${username}" ];
}