Install nh and friends, modularize nixos conf.
This commit is contained in:
parent
ea86d38cd1
commit
5054b13564
14 changed files with 302 additions and 209 deletions
15
modules/nixos/bluetooth.nix
Normal file
15
modules/nixos/bluetooth.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
# Enable bluetooth
|
||||
options = {
|
||||
crony.bluetooth.enable = lib.mkEnableOption "enable bluetooth";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.bluetooth.enable {
|
||||
hardware.bluetooth.enable = true;
|
||||
hardware.bluetooth.powerOnBoot = true;
|
||||
};
|
||||
}
|
11
modules/nixos/default.nix
Normal file
11
modules/nixos/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{lib, ...}: {
|
||||
imports = [./bluetooth.nix ./nvidia.nix ./plasma.nix ./disable-hibernation.nix ./gaming.nix ./zsh.nix ./stylix.nix];
|
||||
|
||||
crony.bluetooth.enable = lib.mkDefault true;
|
||||
crony.nvidia.enable = lib.mkDefault true;
|
||||
crony.plasma.enable = lib.mkDefault true;
|
||||
crony.hibernation.disable = lib.mkDefault true;
|
||||
crony.gaming.enable = lib.mkDefault true;
|
||||
crony.zsh.enable = lib.mkDefault true;
|
||||
crony.stylix.enable = lib.mkDefault true;
|
||||
}
|
30
modules/nixos/disable-hibernation.nix
Normal file
30
modules/nixos/disable-hibernation.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.hibernation.disable = lib.mkEnableOption "disable hibernation and friends";
|
||||
};
|
||||
config = lib.mkIf config.crony.hibernation.disable {
|
||||
# Disable hibernation, sleep and other friends
|
||||
systemd.targets = {
|
||||
sleep = {
|
||||
enable = false;
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
};
|
||||
suspend = {
|
||||
enable = false;
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
};
|
||||
hibernate = {
|
||||
enable = false;
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
};
|
||||
"hybrid-sleep" = {
|
||||
enable = false;
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
15
modules/nixos/gaming.nix
Normal file
15
modules/nixos/gaming.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
# Getting gaming setup
|
||||
options = {
|
||||
crony.gaming.enable = lib.mkEnableOption "enable gaming related stuff, like steam and gamemode";
|
||||
};
|
||||
config = lib.mkIf config.crony.gaming.enable {
|
||||
programs.steam.enable = true;
|
||||
programs.steam.gamescopeSession.enable = true;
|
||||
programs.gamemode.enable = true;
|
||||
};
|
||||
}
|
27
modules/nixos/nvidia.nix
Normal file
27
modules/nixos/nvidia.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
# Allow for nvidia
|
||||
options = {
|
||||
crony.nvidia.enable = lib.mkEnableOption "enable nvidia";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.nvidia.enable {
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
hardware.nvidia.open = false;
|
||||
hardware.nvidia.modesetting.enable = true;
|
||||
hardware.nvidia.powerManagement.enable = true;
|
||||
hardware.nvidia.nvidiaSettings = true;
|
||||
hardware.nvidia.prime = {
|
||||
offload = {
|
||||
enableOffloadCmd = true;
|
||||
enable = true;
|
||||
};
|
||||
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
amdgpuBusId = "PCI:5:0:0";
|
||||
};
|
||||
};
|
||||
}
|
21
modules/nixos/plasma.nix
Normal file
21
modules/nixos/plasma.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.plasma.enable = lib.mkEnableOption "enable plasma";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.plasma.enable {
|
||||
# Enable the KDE Plasma Desktop Environment.
|
||||
services.displayManager.sddm.enable = true;
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
environment.plasma6.excludePackages = with pkgs.kdePackages; [
|
||||
plasma-browser-integration
|
||||
konsole
|
||||
oxygen
|
||||
];
|
||||
};
|
||||
}
|
51
modules/nixos/stylix.nix
Normal file
51
modules/nixos/stylix.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.stylix.enable = lib.mkEnableOption "enable stylix and style my system";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.stylix.enable {
|
||||
# Enable sytling using stylix
|
||||
stylix.enable = true;
|
||||
stylix.autoEnable = true;
|
||||
stylix.image = ./wallpaper.png;
|
||||
stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-medium.yaml";
|
||||
|
||||
# Change Cursor
|
||||
stylix.cursor.package = pkgs.bibata-cursors;
|
||||
stylix.cursor.name = "Bibata-Modern-Ice";
|
||||
|
||||
# Change u those fonts
|
||||
stylix.fonts = {
|
||||
serif = {
|
||||
package = pkgs.dejavu_fonts;
|
||||
name = "DejaVu Serif";
|
||||
};
|
||||
|
||||
sansSerif = {
|
||||
package = pkgs.dejavu_fonts;
|
||||
name = "DejaVu Sans";
|
||||
};
|
||||
|
||||
monospace = {
|
||||
package = pkgs.nerd-fonts.caskaydia-cove;
|
||||
name = "CaskaydiaCove Nerd Font";
|
||||
};
|
||||
|
||||
emoji = {
|
||||
package = pkgs.noto-fonts-emoji;
|
||||
name = "Noto Color Emoji";
|
||||
};
|
||||
};
|
||||
|
||||
# Change terminal font size
|
||||
stylix.fonts.sizes.terminal = 15;
|
||||
|
||||
# Change chrome settings
|
||||
stylix.targets.chromium.enable = true;
|
||||
};
|
||||
}
|
BIN
modules/nixos/wallpaper.png
Normal file
BIN
modules/nixos/wallpaper.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.4 MiB |
17
modules/nixos/zsh.nix
Normal file
17
modules/nixos/zsh.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
crony.zsh.enable = lib.mkEnableOption "install and enable zsh for all users";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.crony.zsh.enable {
|
||||
# Installing zsh
|
||||
programs.zsh.enable = true;
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
environment.pathsToLink = ["/share/zsh"];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue