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,7 +37,8 @@
outputs = { self, nixpkgs, home-manager, catppuccin, lanzaboote, stablepkgs
, bleedingpkgs, lix-module, nix-darwin, nix-homebrew, ... }@inputs: rec {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt;
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
nixosConfigurations = {
nixos = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
system = "x86_64-linux";
modules = [
@ -63,17 +64,18 @@
home-manager.backupFileExtension = "backup";
home-manager.users.youwen = {
imports = [
./modules/home-manager/linux/linux-home.nix
./modules/home-manager/linux/desktop.nix
./modules/home-manager/linux/programs.nix
./modules/home-manager/common/core.nix
./modules/home-manager/linux/catppuccin.nix
./users/youwen/home-manager/linux/linux-home.nix
./users/youwen/home-manager/linux/desktop.nix
./users/youwen/home-manager/linux/programs.nix
./users/youwen/home-manager/common/core.nix
./users/youwen/home-manager/linux/catppuccin.nix
inputs.catppuccin.homeManagerModules.catppuccin
];
};
}
];
};
};
formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.nixfmt;
# Build darwin flake using:
# $ darwin-rebuild build --flake .#Youwens-MacBook-Pro

View file

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

View file

@ -87,14 +87,41 @@
users.users.youwen = {
isNormalUser = true;
description = "Youwen Wu";
extraGroups = [ "networkmanager" "wheel" "nixos" ];
extraGroups = [ "networkmanager" "wheel" "nixos" "realtime" ];
};
users.groups.realtime = { };
nix.settings = {
trusted-users = [ "root" "youwen" ];
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
nixpkgs.config.allowUnfree = true;