docs: add README.md

This commit is contained in:
dachxy 2025-01-03 13:59:16 +08:00
parent fe1d9adfa8
commit 1c2b263904
19 changed files with 241 additions and 73 deletions

View file

@ -2,11 +2,12 @@
{
boot.loader.systemd-boot.enable = true;
# Enable F keys in some wireless keyboard (Ex. neo65)
boot.extraModprobeConfig = ''
options hid_apple fnmode=2
'';
boot.initrd.systemd.enable = true;
boot.initrd.kernelModules = [ "i915" ];
boot.swraid.enable = true;
}

View file

@ -1,7 +1,18 @@
{ lib, system, inputs, nix-version, ... }:
{
lib,
system,
inputs,
nix-version,
...
}:
let
cursor-size = "24";
username = "danny";
git-config = {
username = "DACHXY";
email = "danny10132024@gmail.com";
};
in
{
imports = [
@ -19,8 +30,18 @@ in
system.stateVersion = nix-version;
home-manager = {
backupFileExtension = "hm-backup";
extraSpecialArgs = { inherit inputs system nix-version cursor-size; };
users."danny" = { imports = [ ../../../home ]; };
extraSpecialArgs = {
inherit
inputs
system
nix-version
cursor-size
git-config
username
;
};
users."${username}" = {
imports = [ ../../../home ];
};
};
}

View file

@ -1,18 +1,26 @@
{ config, pkgs, lib, ... }:
{ ... }:
{
boot.loader.systemd-boot.enable = true;
boot.kernelParams =
[ "nvidia-drm.fbdev=1" "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ];
boot.kernelParams = [
"nvidia-drm.fbdev=1"
"nvidia.NVreg_PreserveVideoMemoryAllocations=1"
];
# Enable F keys in some wireless keyboard (Ex. neo65)
boot.extraModprobeConfig = ''
options hid_apple fnmode=2
options nvidia_drm modeset=1 dbdev=1
'';
boot.initrd.systemd.enable = true;
boot.initrd.kernelModules =
[ "nvidia" "i915" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ];
boot.initrd.kernelModules = [
"nvidia"
"i915"
"nvidia_modeset"
"nvidia_uvm"
"nvidia_drm"
];
boot.swraid.enable = true;
boot.swraid.mdadmConf =
"\n MAILADDR smitty\n ARRAY /dev/md126 metadata=1.2 name=stuff:0\n UUID=3b0b7c51-2681-407e-a22a-e965a8aeece7\n ";
boot.swraid.mdadmConf = "\n MAILADDR smitty\n ARRAY /dev/md126 metadata=1.2 name=stuff:0\n UUID=3b0b7c51-2681-407e-a22a-e965a8aeece7\n ";
}

View file

@ -1,7 +1,18 @@
{ lib, inputs, system, nix-version, ... }:
{
lib,
inputs,
system,
nix-version,
...
}:
let
cursor-size = "32";
username = "danny";
git-config = {
username = "DACHXY";
email = "danny10132024@gmail.com";
};
in
{
imports = [
@ -23,8 +34,18 @@ in
backupFileExtension = "hm-backup";
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = { inherit inputs system nix-version cursor-size; };
users."danny" = { imports = [ ../../../home ]; };
extraSpecialArgs = {
inherit
inputs
system
nix-version
cursor-size
git-config
username
;
};
users."${username}" = {
imports = [ ../../../home ];
};
};
}

View file

@ -1,15 +1,21 @@
{ ... }:
{
# Scheduled auto upgrade system (this is only for system upgrades,
# if you want to upgrade cargo\npm\pip global packages, docker containers or different part of the system
# Scheduled auto upgrade system (this is only for system upgrades,
# if you want to upgrade cargo\npm\pip global packages, docker containers or different part of the system
# or get really full system upgrade, use `topgrade` CLI utility manually instead.
# I recommend running `topgrade` once a week or at least once a month)
system.autoUpgrade = {
enable = true;
operation = "switch"; # If you don't want to apply updates immediately, only after rebooting, use `boot` option in this case
flake = "/etc/nixos";
flags = [ "--update-input" "nixpkgs" "--update-input" "rust-overlay" "--commit-lock-file" ];
flags = [
"--update-input"
"nixpkgs"
"--update-input"
"rust-overlay"
"--commit-lock-file"
];
dates = "weekly";
# channel = "https://nixos.org/channels/nixos-unstable";
};

View file

@ -2,24 +2,10 @@
{
services = {
# greetd = {
# enable = true;
# settings = {
# default_session = {
# command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --time-format '%I:%M %p | %a • %h | %F' --cmd Hyprland";
# user = "danny";
# };
# };
# };
displayManager = {
# sddm.wayland.enable = true;
sddm.wayland.enable = true;
sddm.enable = true;
sddm.theme = "${import ./sddm-theme.nix { inherit pkgs; }}";
};
};
# environment.systemPackages = with pkgs; [
# greetd.tuigreet
# ];
}

View file

@ -1,6 +1,7 @@
{ ... }:
{
# This is my CA root cerificate, you shall delete it
security.pki.certificates = [
''
-----BEGIN CERTIFICATE-----

View file

@ -1,25 +1,37 @@
{ pkgs, nix-version, ... }:
let
nerdfont-pkg = if nix-version == "25.05" then pkgs.nerd-fonts.caskaydia-cove else (pkgs.nerdfonts.override { fonts = [ "CascadiaCode" ]; });
nerdfont-pkg =
if nix-version == "25.05" then
pkgs.nerd-fonts.caskaydia-cove
else
(pkgs.nerdfonts.override { fonts = [ "CascadiaCode" ]; });
in
{
fonts.packages = (with pkgs; [
font-awesome
jetbrains-mono
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-emoji
]) ++ ([
nerdfont-pkg
]);
fonts.packages =
(with pkgs; [
font-awesome
jetbrains-mono
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-emoji
])
++ ([
nerdfont-pkg
]);
fonts.fontDir.enable = true;
fonts.fontconfig = {
enable = true;
defaultFonts = {
serif = [ "CaskaydiaCove Nerd Font" "Noto Sans CJK" ];
sansSerif = [ "CaskaydiaCove Nerd Font" "Noto Sans CJK" ];
serif = [
"CaskaydiaCove Nerd Font"
"Noto Sans CJK"
];
sansSerif = [
"CaskaydiaCove Nerd Font"
"Noto Sans CJK"
];
monospace = [ "CaskaydiaCove Nerd Font Mono" ];
};
cache32Bit = true;

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ username, pkgs, ... }:
{
systemd.services.flatpak-repo = {
@ -20,7 +20,7 @@
ports = [ 22 ];
settings = {
PasswordAuthentication = false;
AllowUsers = [ "danny" ];
AllowUsers = [ username ];
UseDns = true;
PermitRootLogin = "no";
};
@ -31,7 +31,6 @@
xkb.layout = "us";
};
# USB auto mount
gvfs.enable = true;
udisks2.enable = true;

View file

@ -1,9 +1,16 @@
{ config, pkgs, ... }:
{ username, pkgs, ... }:
{
users.users.danny = {
users.users.${username} = {
isNormalUser = true;
shell = pkgs.bash; # Actually fish
extraGroups = [ "wheel" "input" "networkmanager" "docker" "libvirtd" "kvm" ];
extraGroups = [
"wheel"
"input"
"networkmanager"
"docker"
"libvirtd"
"kvm"
];
};
}

View file

@ -1,8 +1,13 @@
{ pkgs, config, ... }:
{
username,
pkgs,
config,
...
}:
{
programs.virt-manager.enable = true;
users.groups.libvirtd.members = [ "danny" ];
users.groups.libvirtd.members = [ username ];
virtualisation = {
docker.enable = true;

View file

@ -1,8 +1,16 @@
{ config, pkgs, ... }:
{ ... }:
let
configPath = "/etc/wireguard/wg0.conf";
in
{
networking.firewall = { allowedUDPPorts = [ 51820 ]; };
networking.wg-quick.interfaces.wg0.configFile = configPath;
networking.firewall = {
allowedUDPPorts = [ 51820 ];
};
networking.wg-quick.interfaces.wg0 =
if builtins.pathExists configPath then
{
configFile = configPath;
}
else
{ };
}