refactor: standardize config structure and consolidate modules
- Standardized apps/ directory by renaming all entry points (e.g., home.nix) to default.nix and updating imports to use directory paths. - Consolidated system/ logic into modules/system/, eliminating the top-level system/ directory and redundant wrappers. - Merged subsidiary utility scripts (e.g., hakase-popup.nix, switch-wallpaper.nix) into their parent default.nix files for better cohesion. - Cleaned up unused files and updated all module references to reflect the new structure.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
{pkgs, ...}: {
|
||||
hardware.amdgpu.initrd.enable = true;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
pkgs,
|
||||
myConfig,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
hardware.i2c.enable = true;
|
||||
# boot.extraModulePackages = [config.boot.kernelPackages.ddcci-driver];
|
||||
# boot.kernelModules = ["ddcci_backlight"];
|
||||
environment.systemPackages = with pkgs; [ddcutil];
|
||||
users.users.${myConfig.nixos.username}.extraGroups = ["i2c"];
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{pkgs, ...}: {
|
||||
boot = {
|
||||
consoleLogLevel = 3;
|
||||
initrd.verbose = false;
|
||||
loader = {
|
||||
timeout = 0;
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
efiSysMountPoint = "/boot";
|
||||
};
|
||||
};
|
||||
initrd = {
|
||||
systemd.enable = true;
|
||||
};
|
||||
plymouth = {
|
||||
enable = true;
|
||||
# themePackages = [
|
||||
# (pkgs.adi1090x-plymouth-themes.override {
|
||||
# selected_themes = ["circle_hud"];
|
||||
# })
|
||||
# ];
|
||||
# theme = "circle_hud";
|
||||
};
|
||||
};
|
||||
}
|
||||
+15
-15
@@ -1,20 +1,20 @@
|
||||
{pkgs, ...}: {
|
||||
imports = [
|
||||
../../system/time.nix
|
||||
../../system/nix.nix
|
||||
../../system/backlight.nix
|
||||
../../system/boot.nix
|
||||
../../system/amd.nix
|
||||
../../system/hardware.nix
|
||||
../../system/home-manager.nix
|
||||
../../system/services.nix
|
||||
../../system/user.nix
|
||||
../../system/version.nix
|
||||
../../system/fonts.nix
|
||||
../../system/programs.nix
|
||||
../../system/security.nix
|
||||
../../system/variables.nix
|
||||
../../system/kernel.nix
|
||||
./time.nix
|
||||
./nix.nix
|
||||
./backlight.nix
|
||||
./boot.nix
|
||||
./amd.nix
|
||||
./hardware.nix
|
||||
./home-manager.nix
|
||||
./services.nix
|
||||
./user.nix
|
||||
./version.nix
|
||||
./fonts.nix
|
||||
./programs.nix
|
||||
./security.nix
|
||||
./variables.nix
|
||||
./kernel.nix
|
||||
];
|
||||
environment.systemPackages = with pkgs; [
|
||||
# FIXME: must be on their own app
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{pkgs, ...}: {
|
||||
fonts.packages = with pkgs; [
|
||||
nerd-fonts.fira-code
|
||||
nerd-fonts.jetbrains-mono
|
||||
|
||||
# google
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-cjk-serif
|
||||
noto-fonts-color-emoji
|
||||
roboto
|
||||
open-sans
|
||||
lato
|
||||
montserrat
|
||||
inter
|
||||
poppins
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
jetbrains-mono
|
||||
];
|
||||
}
|
||||
@@ -1,5 +1,21 @@
|
||||
{
|
||||
imports = [
|
||||
../../system/steam.nix
|
||||
];
|
||||
}
|
||||
{pkgs, ...}: {
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true; # For 32-bit games
|
||||
};
|
||||
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
localNetworkGameTransfers.openFirewall = true;
|
||||
extest.enable = true;
|
||||
gamescopeSession.enable = true;
|
||||
extraCompatPackages = with pkgs; [
|
||||
proton-ge-bin
|
||||
];
|
||||
};
|
||||
|
||||
programs.gamemode.enable = true;
|
||||
# Fix slow Steam Download speeds
|
||||
services.resolved.enable = true;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
pkgs,
|
||||
myConfig,
|
||||
...
|
||||
}: {
|
||||
hardware = {
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
};
|
||||
};
|
||||
networking = {
|
||||
hostName = myConfig.nixos.hostname;
|
||||
networkmanager.enable = true;
|
||||
networkmanager.wifi.backend = "iwd";
|
||||
wireless.iwd.enable = true;
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [22 80];
|
||||
allowedUDPPorts = [53];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
specialArgs,
|
||||
myConfig,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
nixpkgs.overlays = [inputs.nur.overlays.default];
|
||||
home-manager = {
|
||||
backupFileExtension = "backup";
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = specialArgs;
|
||||
users.${myConfig.nixos.username} = import ../home/hakase.nix;
|
||||
};
|
||||
|
||||
imports = [
|
||||
];
|
||||
}
|
||||
@@ -1,5 +1,29 @@
|
||||
{
|
||||
imports = [
|
||||
../../apps/hyprland/default.nix
|
||||
myConfig,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||
portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
||||
withUWSM = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.hyprpicker
|
||||
pkgs.hyprlock
|
||||
pkgs.hypridle
|
||||
pkgs.hyprpaper
|
||||
pkgs.hyprsunset
|
||||
pkgs.hyprpolkitagent
|
||||
];
|
||||
}
|
||||
|
||||
xdg.terminal-exec = {
|
||||
enable = true;
|
||||
settings = {
|
||||
default = ["${myConfig.terminal.default}"];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{pkgs, ...}: {
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackages_cachyos; # from chaotic input
|
||||
kernelParams = [
|
||||
"quiet"
|
||||
"splash"
|
||||
"intremap=on"
|
||||
"boot.shell_on_fail"
|
||||
"udev.log_priority=3"
|
||||
"rd.systemd.show_status=auto"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
nix.settings = {
|
||||
substituters = [
|
||||
"https://cache.nixos.org"
|
||||
"https://hyprland.cachix.org"
|
||||
"https://nix-community.cachix.org"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
pkgs,
|
||||
myConfig,
|
||||
...
|
||||
}: {
|
||||
programs = {
|
||||
ssh.extraConfig = myConfig.ssh.extraConfig;
|
||||
bash.interactiveShellInit = ''
|
||||
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]; then
|
||||
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
|
||||
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
|
||||
fi
|
||||
'';
|
||||
fish.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
pkgs,
|
||||
myConfig,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
security.pam.services.greetd.enableGnomeKeyring = true;
|
||||
environment.systemPackages = with pkgs; [
|
||||
sops
|
||||
age
|
||||
ssh-to-age
|
||||
];
|
||||
sops = {
|
||||
defaultSopsFile = ../secrets/secrets.yaml;
|
||||
age.keyFile = "/home/${myConfig.nixos.username}/.config/sops/age/keys.txt";
|
||||
secrets = {
|
||||
default_password = {
|
||||
neededForUsers = true;
|
||||
};
|
||||
|
||||
AVANTE_GEMINI_API_KEY = {
|
||||
owner = "kenji";
|
||||
};
|
||||
};
|
||||
};
|
||||
programs.fish.interactiveShellInit = ''
|
||||
if test -f ${config.sops.secrets.AVANTE_GEMINI_API_KEY.path}
|
||||
set -gx AVANTE_GEMINI_API_KEY (cat ${config.sops.secrets.AVANTE_GEMINI_API_KEY.path})
|
||||
end
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
pkgs,
|
||||
myConfig,
|
||||
...
|
||||
}: {
|
||||
services = {
|
||||
greetd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
initial_session = {
|
||||
command = "${pkgs.hyprland}/bin/Hyprland";
|
||||
user = "${myConfig.nixos.username}";
|
||||
};
|
||||
default_session = {
|
||||
command = "${pkgs.tuigreet}/bin/tuigreet --time --remember --cmd Hyprland";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# essentials
|
||||
openssh.enable = true; # FIXME: remove when done
|
||||
blueman.enable = true;
|
||||
|
||||
# for encryption support for unfree apps
|
||||
gnome.gnome-keyring.enable = true;
|
||||
|
||||
# Complements printer support
|
||||
printing.enable = true;
|
||||
avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
pipewire = {
|
||||
enable = true;
|
||||
alsa = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{myConfig, ...}: {
|
||||
time.timeZone = myConfig.nixos.timezone;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
pkgs,
|
||||
myConfig,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
users = {
|
||||
users = {
|
||||
${myConfig.nixos.username} = {
|
||||
isNormalUser = true;
|
||||
extraGroups = ["wheel" "networkmanager" "input" "video"];
|
||||
hashedPasswordFile = config.sops.secrets.default_password.path; # FIXME: may not work!
|
||||
useDefaultShell = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{config, ...}: {
|
||||
environment.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
VISUAL = "nvim";
|
||||
# AVANTE_GEMINI_API_KEY = config.sops.secrets.AVANTE_GEMINI_API_KEY.path;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{pkgs, ...}: {
|
||||
system.stateVersion = "25.05";
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nix = {
|
||||
distributedBuilds = true;
|
||||
settings = {
|
||||
builders-use-substitutes = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user