perf: Home-manager to module

feat: Optionise config
This commit is contained in:
Sweetbread 2025-02-02 14:57:36 +03:00
parent f2c215460b
commit ea39ab9992
97 changed files with 395 additions and 488 deletions

View File

@ -38,87 +38,41 @@
}; };
}; };
outputs = { self, nixpkgs, nixpkgs-stable, home-manager, ... }@inputs: outputs = { self, nixpkgs, nixpkgs-stable, home-manager, ... }@inputs: let
let
system = "x86_64-linux"; system = "x86_64-linux";
in { in {
nixosConfigurations = { nixosConfigurations = {
Rias = nixpkgs-stable.lib.nixosSystem { Rias = nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
pkgs-unstable = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
inherit inputs system;
};
modules = [
./nixos/hosts/Rias/configuration.nix
inputs.sops-nix.nixosModules.sops
];
};
Senko = nixpkgs-stable.lib.nixosSystem {
specialArgs = {
pkgs-unstable = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
inherit inputs system;
};
modules = [
./nixos/hosts/Senko/configuration.nix
inputs.sops-nix.nixosModules.sops
];
};
Eclipse = nixpkgs-stable.lib.nixosSystem {
specialArgs = {
pkgs-unstable = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
inherit inputs system;
};
modules = [
./nixos/hosts/Eclipse/configuration.nix
inputs.sops-nix.nixosModules.sops
];
};
};
homeConfigurations = {
sweetbread = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {
inherit inputs;
pkgs-stable = import nixpkgs-stable { pkgs-stable = import nixpkgs-stable {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
}; };
inherit inputs system;
}; };
modules = [ modules = [ ./host/Rias/configuration.nix ];
./home-manager/users/sweetbread/home.nix
inputs.sops-nix.homeManagerModules.sops
inputs.stylix.homeManagerModules.stylix
];
}; };
chest = home-manager.lib.homeManagerConfiguration { Senko = nixpkgs.lib.nixosSystem {
pkgs = nixpkgs.legacyPackages.${system}; specialArgs = {
extraSpecialArgs = {
inherit inputs;
pkgs-stable = import nixpkgs-stable { pkgs-stable = import nixpkgs-stable {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
}; };
inherit inputs system;
}; };
modules = [ modules = [ ./host/Senko/configuration.nix ];
./home-manager/users/chest/home.nix };
inputs.sops-nix.homeManagerModules.sops
inputs.stylix.homeManagerModules.stylix Eclipse = nixpkgs.lib.nixosSystem {
]; specialArgs = {
pkgs-stable = import nixpkgs-stable {
inherit system;
config.allowUnfree = true;
};
inherit inputs system;
};
modules = [ ./host/Eclipse/configuration.nix ];
}; };
}; };

View File

@ -1,16 +0,0 @@
{
imports = [
./kitty.nix
./qt.nix
./sops.nix
./neofetch.nix
./yazi.nix
./ags.nix
./zsh.nix
./helix.nix
./btop.nix
./wms/wofi.nix
./wms/mako.nix
];
}

View File

@ -1,27 +0,0 @@
{ pkgs, pkgs-stable, ... }: {
imports = [
../../modules/bundle.nix
../../packages/art.nix
../../packages/desktop.nix
../../packages/utils.nix
./modules/git.nix
./modules/hyprland.nix
./modules/style.nix
];
nixpkgs.config.allowUnfree = true;
home = {
username = "chest";
homeDirectory = "/home/chest";
stateVersion = "23.11";
packages = with pkgs; [
nautilus
] ++ (with pkgs-stable; [
jetbrains.pycharm-community
]);
};
}

View File

@ -1,23 +0,0 @@
{ pkgs, ... }: {
imports = [
../../modules/bundle.nix
../../modules/hyprlock.nix
../../packages/coding.nix
../../packages/desktop.nix
../../packages/utils.nix
../../packages/art.nix
./modules/git.nix
./modules/hyprland.nix
./modules/style.nix
];
nixpkgs.config.allowUnfree = true;
home = {
username = "sweetbread";
homeDirectory = "/home/sweetbread";
stateVersion = "23.11";
};
}

View File

@ -0,0 +1,26 @@
{ config, pkgs, pkgs-stable, lib, inputs, ...}: {
imports = [
./secrets/secrets.nix
./modules/aagl.nix
./modules/grub.nix
./modules/zram.nix
../modules/nvidia.nix
(import ../modules/common.nix {
inherit lib;
inherit inputs;
hostname = "Eclipse";
})
(import ../../user/common.nix {
inherit config;
inherit pkgs;
inherit pkgs-stable;
inherit lib;
inherit inputs;
name = "chest";
})
];
programs.gamemode.enable = true;
}

View File

@ -0,0 +1,29 @@
{ inputs, ... }: {
imports = [ inputs.aagl.nixosModules.default ];
nix.settings = inputs.aagl.nixConfig; # Set up Cachix
programs.honkers-railway-launcher.enable = true;
networking.hosts."0.0.0.0" = [
"overseauspider.yuanshen.com"
"log-upload-os.hoyoverse.com"
"log-upload-os.mihoyo.com"
"dump.gamesafe.qq.com"
"apm-log-upload-os.hoyoverse.com"
"zzz-log-upload-os.hoyoverse.com"
"log-upload.mihoyo.com"
"devlog-upload.mihoyo.com"
"uspider.yuanshen.com"
"sg-public-data-api.hoyoverse.com"
"hkrpg-log-upload-os.hoyoverse.com"
"public-data-api.mihoyo.com"
"prd-lender.cdp.internal.unity3d.com"
"thind-prd-knob.data.ie.unity3d.com"
"thind-gke-usc.prd.data.corp.unity3d.com"
"cdp.cloud.unity3d.com"
"remote-config-proxy-prd.uca.cloud.unity3d.com"
"pc.crashsight.wetest.net"
];
}

View File

@ -2,7 +2,7 @@
zramSwap = { zramSwap = {
enable = true; enable = true;
algorithm = "lz4"; algorithm = "lz4";
memoryPercent = 100; memoryPercent = 50;
priority = 999; priority = 999;
}; };
} }

View File

@ -0,0 +1,27 @@
{ config, pkgs, pkgs-stable, lib, inputs, ...}: {
imports = [
./secrets/secrets.nix
./modules/grub.nix
./modules/syncthing.nix
../../modules/host/adb.nix
../modules/nvidia.nix
(import ../modules/common.nix {
inherit lib;
inherit inputs;
hostname = "Rias";
})
(import ../../user/common.nix {
inherit config;
inherit pkgs;
inherit pkgs-stable;
inherit lib;
inherit inputs;
name = "sweetbread";
fullname = "Sweet Bread";
})
];
programs.gamemode.enable = true;
}

View File

@ -0,0 +1,26 @@
{ config, pkgs, pkgs-stable, lib, inputs, ...}: {
imports = [
./secrets/secrets.nix
./modules/grub.nix
../modules/nvidia.nix
(import ../modules/common.nix {
inherit lib;
inherit inputs;
hostname = "Senko";
})
(import ../../user/common.nix {
inherit config;
inherit pkgs;
inherit pkgs-stable;
inherit lib;
inherit inputs;
name = "sweetbread";
fullname = "Sweet Bread";
})
];
hardware.bluetooth.enable = true;
host.laptop = true;
}

View File

@ -0,0 +1,11 @@
{
sops = {
age.keyFile = "/root/age.key";
secrets = {
vpn_bolt = {
format = "binary";
sopsFile = ./vpn_bolt.db;
};
};
};
}

View File

@ -0,0 +1 @@
../../Rias/secrets/vpn_bolt.db

20
host/modules/common.nix Normal file
View File

@ -0,0 +1,20 @@
{ lib, inputs, hostname }: {
imports = [
inputs.sops-nix.nixosModules.sops
../${hostname}/hardware-configuration.nix
../../modules/host.nix
./packages.nix
];
options = {
host.laptop = lib.mkEnableOption "laptop mode";
};
config = {
networking.hostName = hostname;
time.timeZone = lib.mkDefault "Europe/Moscow";
i18n.defaultLocale = lib.mkDefault "ru_RU.UTF-8";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "23.05";
};
}

27
host/modules/nvidia.nix Normal file
View File

@ -0,0 +1,27 @@
{ config, pkgs, lib, ... }: {
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [nvidia-vaapi-driver intel-media-driver];
extraPackages32 = with pkgs.pkgsi686Linux; [nvidia-vaapi-driver intel-media-driver];
};
nvidia = {
modesetting.enable = true;
powerManagement = {
enable = true;
finegrained = false;
};
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.beta;
prime = lib.optionalAttrs config.host.laptop {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
};
}

View File

@ -1,8 +1,5 @@
{ pkgs, pkgs-unstable, inputs, ... }: { { pkgs, inputs, ... }: {
nixpkgs.config = { nixpkgs.config.allowUnfree = true;
allowUnfree = true;
permittedInsecurePackages = ["python-2.7.18.8" "electron-25.9.0" "freeimage-unstable-2021-11-01" "obsidian-1.5.12"];
};
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
file file
@ -18,10 +15,9 @@
ncdu ncdu
tldr tldr
helix helix
pkgs-unstable.home-manager
]; ];
fonts.packages = with pkgs-unstable; [ fonts.packages = with pkgs; [
jetbrains-mono jetbrains-mono
noto-fonts noto-fonts
noto-fonts-emoji noto-fonts-emoji

23
modules/host.nix Normal file
View File

@ -0,0 +1,23 @@
{
imports = [
./host/bluetooth.nix
./host/bootloader.nix
./host/console.nix
./host/env.nix
./host/gamemode.nix
./host/gpg.nix
./host/laptop.nix
./host/printing.nix
./host/shutdown-on-lan.nix
./host/sound.nix
./host/virtmanager.nix
./host/vpn.nix
];
programs.hyprland.enable = true;
services = {
udisks2.enable = true;
fstrim.enable = true;
};
networking.networkmanager.enable = true;
}

View File

@ -1,6 +1,6 @@
{ { config, lib, ... }: {
hardware.bluetooth = { hardware.bluetooth =
enable = true; lib.mkIf config.hardware.bluetooth.enable {
powerOnBoot = true; powerOnBoot = true;
settings = { settings = {
General = { General = {

View File

@ -2,7 +2,6 @@
boot = { boot = {
loader = { loader = {
timeout = 3; timeout = 3;
# systemd-boot.enable = true;
efi = { efi = {
efiSysMountPoint = "/boot"; efiSysMountPoint = "/boot";
canTouchEfiVariables = true; canTouchEfiVariables = true;
@ -14,12 +13,7 @@
device = "nodev"; device = "nodev";
useOSProber = true; useOSProber = true;
}; };
# efi.canTouchEfiVariables = true;
}; };
# initrd = {
# verbose = false;
# # systemd.enable = true;
# };
consoleLogLevel = 0; consoleLogLevel = 0;
kernelParams = [ kernelParams = [
# "quiet" # "quiet"
@ -34,7 +28,6 @@
enable = true; enable = true;
theme = "black_hud"; theme = "black_hud";
themePackages = with pkgs; [ themePackages = with pkgs; [
# By default we would install all themes
(adi1090x-plymouth-themes.override { (adi1090x-plymouth-themes.override {
selected_themes = [ "black_hud" ]; selected_themes = [ "black_hud" ];
}) })

20
modules/host/gamemode.nix Normal file
View File

@ -0,0 +1,20 @@
{ config, pkgs, pkgs-stable, lib, ... }:
lib.mkIf config.programs.gamemode.enable {
programs.steam = {
enable = true;
gamescopeSession.enable = true;
};
environment.systemPackages = with pkgs-stable; [
mangohud
protonup
pkgs.bottles
heroic
];
environment.sessionVariables = {
STEAM_EXTRA_COMPAT_TOOLS_PATHS =
"\${HOME}/.steam/root/compatibilitytools.d";
};
}

19
modules/host/laptop.nix Normal file
View File

@ -0,0 +1,19 @@
{ config, lib, ... }:
lib.mkIf config.host.laptop {
services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 75;
};
};
}

View File

@ -0,0 +1,9 @@
{ config, lib, ... }:
lib.mkIf config.services.printing.enable {
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
}

17
modules/host/sound.nix Normal file
View File

@ -0,0 +1,17 @@
{
security.rtkit.enable = true;
services = {
pulseaudio.enable = false;
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
};
};
}

View File

@ -1,7 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }: {
virtualisation.libvirtd.enable = true; virtualisation.libvirtd.enable = true;
programs.virt-manager = { programs.virt-manager.enable = true;
enable = true;
};
} }

20
modules/user.nix Normal file
View File

@ -0,0 +1,20 @@
{
imports = [
./user/kitty.nix
./user/qt.nix
./user/sops.nix
./user/neofetch.nix
./user/yazi.nix
./user/ags.nix
./user/zsh.nix
./user/helix.nix
./user/hyprlock.nix
./user/btop.nix
./user/wofi.nix
./user/mako.nix
./user/packages/art.nix
./user/packages/desktop.nix
./user/packages/coding.nix
./user/packages/utils.nix
];
}

View File

@ -18,5 +18,5 @@
wayland.windowManager.hyprland.settings.exec-once = [ "ags run" ]; wayland.windowManager.hyprland.settings.exec-once = [ "ags run" ];
xdg.configFile."ags".source = (pkgs.callPackage ../packages/drvs/ags.nix { colors = config.lib.stylix.colors; }); xdg.configFile."ags".source = (pkgs.callPackage ./packages/drvs/ags.nix { colors = config.lib.stylix.colors; });
} }

View File

@ -1,4 +1,6 @@
{ pkgs, lib, ... }: { { config, pkgs, lib, ... }:
lib.mkIf config.programs.hyprlock.enable {
wayland.windowManager.hyprland.settings.exec-once = [ "hyprlock" ]; wayland.windowManager.hyprland.settings.exec-once = [ "hyprlock" ];
programs.hyprlock = let programs.hyprlock = let
@ -8,8 +10,6 @@
hash = "sha256-wRFs/Inw1wEzF5UKFn/o6e/xH5ZJ3SVNxxno+mDx2Fs="; hash = "sha256-wRFs/Inw1wEzF5UKFn/o6e/xH5ZJ3SVNxxno+mDx2Fs=";
}; };
in { in {
enable = true;
settings = { settings = {
background = { background = {
path = lib.mkForce "${image}"; path = lib.mkForce "${image}";
@ -58,17 +58,12 @@
dots_center = false; dots_center = false;
dots_rounding = -1; dots_rounding = -1;
dots_fade_time = 200; dots_fade_time = 200;
# outer_color = "rgb(151515)";
# inner_color = "rgb(200, 200, 200)";
# font_color = "rgb(10, 10, 10)";
font_family = "Noto Sans"; font_family = "Noto Sans";
fade_on_empty = true; fade_on_empty = true;
fade_timeout = 1000; fade_timeout = 1000;
placeholder_text = "<i>Input Password...</i>"; placeholder_text = "<i>Input Password...</i>";
hide_input = false; hide_input = false;
rounding = -1; rounding = -1;
# check_color = "rgb(204, 136, 34)";
# fail_color = "rgb(204, 34, 34)";
fail_text = "<i>$FAIL <b>($ATTEMPTS)</b></i>"; fail_text = "<i>$FAIL <b>($ATTEMPTS)</b></i>";
fail_timeout = 2000; fail_timeout = 2000;
fail_transition = 300; fail_transition = 300;

View File

@ -82,15 +82,18 @@
env = [ env = [
"LIBVA_DRIVER_NAME,nvidia" "LIBVA_DRIVER_NAME,nvidia"
"XDG_SESSION_TYPE,wayland"
"GBM_BACKEND,nvidia"
"__GLX_VENDOR_LIBRARY_NAME,nvidia" "__GLX_VENDOR_LIBRARY_NAME,nvidia"
"WLR_NO_HARDWARE_CURSORS,1" "GBM_BACKEND,nvidia"
"XDG_CURRENT_DESKTOP,Hyprland"
"XDG_SESSION_TYPE,wayland" "XDG_SESSION_TYPE,wayland"
"XDG_SESSION_DESKTOP,Hyprland"
"XCURSOR_SIZE,36"
"QT_QPA_PLATFORM,wayland" "QT_QPA_PLATFORM,wayland"
"XDG_CURRENT_DESKTOP,Hyprland"
"XDG_SESSION_DESKTOP,Hyprland"
"WLR_NO_HARDWARE_CURSORS,1"
"XCURSOR_SIZE,36"
"XDG_SCREENSHOTS_DIR,~/screens" "XDG_SCREENSHOTS_DIR,~/screens"
]; ];

View File

@ -1,6 +1,6 @@
{ config, ... }: { { config, ... }: {
sops = { sops = {
defaultSopsFile = ../users/${config.home.username}/secrets.yaml; defaultSopsFile = ../../user/${config.home.username}/secrets.yaml;
age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt"; age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
secrets."tokens/apis/wallhaven" = {}; secrets."tokens/apis/wallhaven" = {};

View File

@ -1,68 +0,0 @@
{ config, pkgs, ...}: {
imports = [
./hardware-configuration.nix
./secrets/secrets.nix
./modules/grub.nix
./modules/aagl.nix
../../packages.nix
../../modules/bundle.nix
../../modules/gamemode.nix
../../modules/users/chest.nix
];
networking.hostName = "Eclipse";
time.timeZone = "Europe/Moscow";
i18n.defaultLocale = "ru_RU.UTF-8";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "23.05";
hardware.graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [nvidia-vaapi-driver intel-media-driver];
extraPackages32 = with pkgs.pkgsi686Linux; [nvidia-vaapi-driver intel-media-driver];
};
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
networking.hosts = {
"0.0.0.0" = [
"overseauspider.yuanshen.com"
"log-upload-os.hoyoverse.com"
"log-upload-os.mihoyo.com"
"dump.gamesafe.qq.com"
"apm-log-upload-os.hoyoverse.com"
"zzz-log-upload-os.hoyoverse.com"
"log-upload.mihoyo.com"
"devlog-upload.mihoyo.com"
"uspider.yuanshen.com"
"sg-public-data-api.hoyoverse.com"
"hkrpg-log-upload-os.hoyoverse.com"
"public-data-api.mihoyo.com"
"prd-lender.cdp.internal.unity3d.com"
"thind-prd-knob.data.ie.unity3d.com"
"thind-gke-usc.prd.data.corp.unity3d.com"
"cdp.cloud.unity3d.com"
"remote-config-proxy-prd.uca.cloud.unity3d.com"
"pc.crashsight.wetest.net"
];
};
}

View File

@ -1,5 +0,0 @@
{ inputs, ... }: {
imports = [ inputs.aagl.nixosModules.default ];
nix.settings = inputs.aagl.nixConfig; # Set up Cachix
programs.honkers-railway-launcher.enable = true;
}

View File

@ -1,45 +0,0 @@
{ config, pkgs, inputs, ...}: {
imports = [
./hardware-configuration.nix
./secrets/secrets.nix
./modules/grub.nix
./modules/syncthing.nix
../../packages.nix
../../modules/bundle.nix
../../modules/adb.nix
../../modules/gamemode.nix
../../modules/users/sweetbread.nix
];
networking.hostName = "Rias";
time.timeZone = "Europe/Moscow";
i18n.defaultLocale = "ru_RU.UTF-8";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "23.05";
hardware.graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [nvidia-vaapi-driver intel-media-driver];
extraPackages32 = with pkgs.pkgsi686Linux; [nvidia-vaapi-driver intel-media-driver];
};
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
virtualisation.virtualbox.host.enable = true;
users.extraGroups.vboxusers.members = [ "sweetbread" ];
}

View File

@ -1,40 +0,0 @@
{ config, pkgs, ...}: {
imports = [
./hardware-configuration.nix
./secrets/secrets.nix
./modules/grub.nix
../../packages.nix
../../modules/bundle.nix
../../modules/adb.nix
../../modules/users/sweetbread.nix
../../modules/laptop.nix
];
networking.hostName = "Senko";
time.timeZone = "Europe/Moscow";
i18n.defaultLocale = "ru_RU.UTF-8";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "23.05";
hardware.graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [nvidia-vaapi-driver intel-media-driver];
extraPackages32 = with pkgs.pkgsi686Linux; [nvidia-vaapi-driver intel-media-driver];
};
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
}

View File

@ -1 +0,0 @@
../Rias/secrets

View File

@ -1,19 +0,0 @@
{
imports = [
./bootloader.nix
./sound.nix
./zram.nix
./env.nix
./nm.nix
./virtmanager.nix
./trim.nix
./bluetooth.nix
./vpn.nix
./printing.nix
./shutdown-on-lan.nix
./console.nix
];
programs.hyprland.enable = true;
services.udisks2.enable = true;
}

View File

@ -1,17 +0,0 @@
{ pkgs, pkgs-unstable, ...}: {
programs.steam.enable = true;
programs.steam.gamescopeSession.enable = true;
programs.gamemode.enable = true;
environment.systemPackages = with pkgs; [
mangohud
protonup
pkgs-unstable.bottles
heroic
];
environment.sessionVariables = {
STEAM_EXTRA_COMPAT_TOOLS_PATHS =
"\${HOME}/.steam/root/compatibilitytools.d";
};
}

View File

@ -1,17 +0,0 @@
{
services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 25;
};
};
}

View File

@ -1,3 +0,0 @@
{
networking.networkmanager.enable = true;
}

View File

@ -1,10 +0,0 @@
{
services = {
printing.enable = true;
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
};
}

View File

@ -1,17 +0,0 @@
{
hardware.pulseaudio.enable = false;
# rtkit is optional but recommended
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
};
}

View File

@ -1,3 +0,0 @@
{
services.fstrim.enable = true;
}

View File

@ -1,34 +0,0 @@
{ pkgs, lib, inputs, ... }: {
programs.zsh.enable = true;
users = {
defaultUserShell = pkgs.zsh;
users.chest = {
isNormalUser = true;
description = "Chest";
extraGroups = [ "networkmanager" "wheel" "input" "libvirtd" ];
packages = with pkgs; [];
};
};
services.greetd = let
tuigreet = pkgs.lib.getExe pkgs.greetd.tuigreet;
session = lib.getExe inputs.hyprland.packages.${pkgs.system}.default;
username = "chest";
in {
enable = true;
settings = {
initial_session = {
command = "${session}";
user = "${username}";
};
default_session = {
command = "${tuigreet} --greeting 'Welcome to NixOS!' --asterisks --remember --remember-user-session --time -cmd ${session}";
user = "greeter";
};
};
};
nix.settings.trusted-users = [ "chest" ];
}

View File

@ -1,34 +0,0 @@
{ pkgs, lib, inputs, ... }: {
programs.zsh.enable = true;
users = {
defaultUserShell = pkgs.zsh;
users.sweetbread = {
isNormalUser = true;
description = "Sweet Bread";
extraGroups = [ "networkmanager" "wheel" "input" "libvirtd" ];
packages = with pkgs; [];
};
};
services.greetd = let
tuigreet = pkgs.lib.getExe pkgs.greetd.tuigreet;
session = lib.getExe inputs.hyprland.packages.${pkgs.system}.default;
username = "sweetbread";
in {
enable = true;
settings = {
initial_session = {
command = "${session}";
user = "${username}";
};
default_session = {
command = "${tuigreet} --greeting 'Welcome to NixOS!' --asterisks --remember --remember-user-session --time -cmd ${session}";
user = "greeter";
};
};
};
nix.settings.trusted-users = [ "sweetbread" ];
}

7
user/chest/home.nix Normal file
View File

@ -0,0 +1,7 @@
{ pkgs, pkgs-stable, ... }: {
disabledModules = [ ../../modules/user/packages/coding.nix ];
home.packages = [
pkgs.nautilus
pkgs-stable.jetbrains.pycharm-community
];
}

View File

@ -2,6 +2,6 @@
programs.git = { programs.git = {
enable = true; enable = true;
userName = "cheeest"; userName = "cheeest";
userEmail = "a.e.sunduk@gmail.com"; userEmail = "e.a.sunduk@gmail.com";
}; };
} }

View File

@ -1,6 +1,6 @@
{ pkgs, lib, config, inputs, ... }: { { pkgs, lib, config, inputs, ... }: {
imports = [( imports = [(
import ../../../patterns/hyprland.nix { import ../../../modules/user/patterns/hyprland.nix {
inherit lib; inherit lib;
inherit pkgs; inherit pkgs;
inherit config; inherit config;

62
user/common.nix Normal file
View File

@ -0,0 +1,62 @@
{ pkgs, pkgs-stable, lib, inputs, name, fullname ? name, ... }: {
imports = [
inputs.home-manager.nixosModules.home-manager {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${name} = {
imports = [
inputs.sops-nix.homeManagerModules.sops
inputs.stylix.homeManagerModules.stylix
../modules/user.nix
./${name}/modules/git.nix
./${name}/modules/hyprland.nix
./${name}/modules/style.nix
./${name}/home.nix
];
home = {
username = name;
homeDirectory = "/home/${name}";
stateVersion = "23.11";
};
};
extraSpecialArgs = {
inherit inputs;
inherit pkgs-stable;
};
};
}
];
programs.zsh.enable = true;
users = {
defaultUserShell = pkgs.zsh;
users."${name}" = {
isNormalUser = true;
description = fullname;
extraGroups = [ "networkmanager" "wheel" "input" "libvirtd" ];
};
};
services.greetd = let
tuigreet = lib.getExe pkgs.greetd.tuigreet;
session = lib.getExe inputs.hyprland.packages.${pkgs.system}.default;
in {
enable = true;
settings = {
initial_session = {
command = "${session}";
user = "${name}";
};
default_session = {
command = "${tuigreet} --greeting 'Welcome to NixOS!' --asterisks --remember --remember-user-session --time -cmd ${session}";
user = "greeter";
};
};
};
nix.settings.trusted-users = [ name ];
}

3
user/sweetbread/home.nix Normal file
View File

@ -0,0 +1,3 @@
{
programs.hyprlock.enable = true;
}

View File

@ -1,6 +1,6 @@
{ pkgs, lib, config, inputs, ... }: { { pkgs, lib, config, inputs, ... }: {
imports = [( imports = [(
import ../../../patterns/hyprland.nix { import ../../../modules/user/patterns/hyprland.nix {
inherit lib; inherit lib;
inherit pkgs; inherit pkgs;
inherit config; inherit config;