refactor: move home-manager configuration to users dir

This commit is contained in:
Youwen Wu 2024-08-07 00:49:16 -07:00
parent d7373ba537
commit ee4c922eb2
12 changed files with 66 additions and 33 deletions

View file

@ -37,42 +37,44 @@
outputs = { self, nixpkgs, home-manager, catppuccin, lanzaboote, stablepkgs outputs = { self, nixpkgs, home-manager, catppuccin, lanzaboote, stablepkgs
, bleedingpkgs, lix-module, nix-darwin, nix-homebrew, ... }@inputs: rec { , bleedingpkgs, lix-module, nix-darwin, nix-homebrew, ... }@inputs: rec {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt; formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt;
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { nixosConfigurations = {
specialArgs = { inherit inputs; }; nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; specialArgs = { inherit inputs; };
modules = [ system = "x86_64-linux";
./modules/nixos/nixos-configuration.nix modules = [
./modules/nixos/secureboot.nix ./modules/nixos/nixos-configuration.nix
./modules/nixos/gaming.nix ./modules/nixos/secureboot.nix
./modules/nixos/audio.nix ./modules/nixos/gaming.nix
./modules/nixos/nvidia.nix ./modules/nixos/audio.nix
./modules/nixos/networking.nix ./modules/nixos/nvidia.nix
./modules/common/fonts.nix ./modules/nixos/networking.nix
./machines/nixos/hardware-configuration.nix ./modules/common/fonts.nix
./machines/nixos/hardware-configuration.nix
catppuccin.nixosModules.catppuccin catppuccin.nixosModules.catppuccin
lix-module.nixosModules.default lix-module.nixosModules.default
lanzaboote.nixosModules.lanzaboote lanzaboote.nixosModules.lanzaboote
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup"; home-manager.backupFileExtension = "backup";
home-manager.users.youwen = { home-manager.users.youwen = {
imports = [ imports = [
./modules/home-manager/linux/linux-home.nix ./users/youwen/home-manager/linux/linux-home.nix
./modules/home-manager/linux/desktop.nix ./users/youwen/home-manager/linux/desktop.nix
./modules/home-manager/linux/programs.nix ./users/youwen/home-manager/linux/programs.nix
./modules/home-manager/common/core.nix ./users/youwen/home-manager/common/core.nix
./modules/home-manager/linux/catppuccin.nix ./users/youwen/home-manager/linux/catppuccin.nix
inputs.catppuccin.homeManagerModules.catppuccin inputs.catppuccin.homeManagerModules.catppuccin
]; ];
}; };
} }
]; ];
};
}; };
formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.nixfmt; formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.nixfmt;
# Build darwin flake using: # Build darwin flake using:

View file

@ -22,6 +22,10 @@
libvorbis libvorbis
stdenv.cc.cc.lib stdenv.cc.cc.lib
libkrb5 libkrb5
(writeShellScriptBin "launch-gamescope" ''
(sleep 1; pgrep gamescope| xargs renice -n -11 -p)&
exec gamescope "$@"
'')
keyutils keyutils
]; ];
}; };

View file

@ -87,14 +87,41 @@
users.users.youwen = { users.users.youwen = {
isNormalUser = true; isNormalUser = true;
description = "Youwen Wu"; description = "Youwen Wu";
extraGroups = [ "networkmanager" "wheel" "nixos" ]; extraGroups = [ "networkmanager" "wheel" "nixos" "realtime" ];
}; };
users.groups.realtime = { };
nix.settings = { nix.settings = {
trusted-users = [ "root" "youwen" ]; trusted-users = [ "root" "youwen" ];
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];
}; };
services.udev.extraRules = ''
KERNEL=="cpu_dma_latency", GROUP="realtime"
'';
security.pam.loginLimits = [
{
domain = "@realtime";
type = "-";
item = "rtprio";
value = 98;
}
{
domain = "@realtime";
type = "-";
item = "memlock";
value = "unlimited";
}
{
domain = "@realtime";
type = "-";
item = "nice";
value = -11;
}
];
# Allow unfree packages # Allow unfree packages
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;