modularize
This commit is contained in:
parent
d3fa1821fa
commit
f1a1dd5d53
27 changed files with 422 additions and 325 deletions
76
mod/desktop/default.nix
Normal file
76
mod/desktop/default.nix
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
options,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.desktop;
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./audio.nix
|
||||
./fonts.nix
|
||||
./gpg.nix
|
||||
./network.nix
|
||||
./services.nix
|
||||
./window-manager.nix
|
||||
./software
|
||||
inputs.nixos-config-hidden.nixosModules.pc
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.users."hd" = lib.mkAliasDefinitions options.home;
|
||||
# install to /etc/profiles, not ~/.nix-profile
|
||||
home-manager.useUserPackages = true;
|
||||
# dont use home.nixpkgs
|
||||
home-manager.useGlobalPkgs = true;
|
||||
}
|
||||
|
||||
];
|
||||
|
||||
options = {
|
||||
desktop.enable = mkEnableOption "Desktop Configuration";
|
||||
home = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.str;
|
||||
default = { };
|
||||
description = "home-manager configuration.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
desktop = {
|
||||
audio.enable = true;
|
||||
fonts.enable = true;
|
||||
gpg.enable = true;
|
||||
network.enable = true;
|
||||
services.enable = true;
|
||||
software.enable = true;
|
||||
wm.enable = true;
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfreePredicate =
|
||||
pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
"nvidia-x11"
|
||||
"nvidia-settings"
|
||||
"vscode"
|
||||
"obsidian"
|
||||
"steam"
|
||||
"steam-unwrapped"
|
||||
"gateway" # jetbrains
|
||||
"spotify"
|
||||
"rust-rover"
|
||||
];
|
||||
|
||||
programs.nix-ld.enable = true;
|
||||
|
||||
home = {
|
||||
home.stateVersion = config.system.stateVersion;
|
||||
imports = [ ../../mod-hm ];
|
||||
};
|
||||
|
||||
security.protectKernelImage = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue