Improve modularity

This commit is contained in:
Isshi0417 2024-07-11 14:51:17 +09:00
parent 6a8f352a75
commit 028a5584a9
14 changed files with 174 additions and 121 deletions

View File

@ -10,15 +10,15 @@
./hardware-configuration.nix ./hardware-configuration.nix
../../modules/hardware ../../modules/hardware
# System
../../modules/system
# NH # NH
../../modules/nh ../../modules/nh
# Gaming # Gaming
../../modules/gaming ../../modules/gaming
# Gnome customization
../../modules/gnome
# Catppuccin # Catppuccin
../../modules/ricing/catppuccin ../../modules/ricing/catppuccin
@ -26,28 +26,18 @@
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
]; ];
# Bootloader. # Swap
boot.loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
grub = {
efiSupport = true;
device = "nodev";
useOSProber = true;
};
};
swapDevices = [{ swapDevices = [{
device = "/var/lib/swapfile"; device = "/var/lib/swapfile";
size = 20*1024; size = 20*1024;
}]; }];
# Hardware update
hardware = { hardware = {
enableRedistributableFirmware = lib.mkDefault true; enableRedistributableFirmware = lib.mkDefault true;
}; };
# Temp control
services = { services = {
fwupd = { fwupd = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
@ -57,18 +47,12 @@
}; };
}; };
nix.settings.experimental-features = [ "nix-command" "flakes" ];
networking.hostName = "alienware"; # Define your hostname. networking.hostName = "alienware"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary # Enable mullvad
# networking.proxy.default = "http://user:password@proxy:port/"; services.mullvad-vpn.enable = true;
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone. # Set your time zone.
time.timeZone = "Asia/Seoul"; time.timeZone = "Asia/Seoul";
@ -87,57 +71,19 @@
LC_TIME = "en_US.UTF-8"; LC_TIME = "en_US.UTF-8";
}; };
# Enable the X11 windowing system.
services.xserver.enable = true;
services.displayManager.sddm = { services.displayManager.sddm = {
enable = true; enable = true;
package = pkgs.kdePackages.sddm; package = pkgs.kdePackages.sddm;
wayland.enable = true; wayland.enable = true;
}; };
# Enable the GNOME Desktop Environment.
services.xserver.desktopManager.gnome.enable = true;
# Configure keymap in X11
services.xserver = {
layout = "us";
xkbVariant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable bluetooth
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
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;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
programs.zsh.enable = true; programs.zsh.enable = true;
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.shoi = { users.users.shoi = {
isNormalUser = true; isNormalUser = true;
description = "Sho Ishida"; description = "Sho Ishida";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [ "networkmanager" "wheel" "inputs" ];
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
@ -151,44 +97,17 @@
home-manager.backupFileExtension = "hm-backup"; home-manager.backupFileExtension = "hm-backup";
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
environment.sessionVariables = { environment.sessionVariables = {
FLAKE = "/home/shoi/etc/nixos"; FLAKE = "/home/shoi/etc/nixos";
}; };
# Enable Mullvad
services.mullvad-vpn.enable = true;
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
gparted
nh
dxvk_2
lm_sensors lm_sensors
]; ];
fonts = {
enableDefaultPackages = true;
packages = with pkgs; [
noto-fonts
nerdfonts
font-awesome
];
fontconfig = {
defaultFonts = {
serif = [ "Hack Nerd Font" ];
sansSerif = [ "DejaVuSansM Nerd Font" ];
monospace = [ "JetBrainsMono Nerd Font" ];
};
};
};
# Some programs need SUID wrappers, can be configured further or are # Some programs need SUID wrappers, can be configured further or are
# started in user sessions. # started in user sessions.
# programs.mtr.enable = true; # programs.mtr.enable = true;

View File

@ -7,5 +7,6 @@
wineWowPackages.staging wineWowPackages.staging
winetricks winetricks
lutris lutris
dxvk_2
]; ];
} }

View File

@ -1,30 +0,0 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs.gnomeExtensions; [
caffeine
dash-to-dock
gnome-40-ui-improvements
media-controls
search-light
];
environment.gnome.excludePackages = with pkgs; [
gnome-tour
gedit
gnome.baobab
gnome.cheese
gnome.eog
gnome.epiphany
gnome.simple-scan
gnome.totem
gnome.yelp
gnome.evince
gnome.geary
gnome.seahorse
gnome.gnome-contacts
gnome.gnome-maps
gnome.gnome-music
];
}

View File

@ -6,6 +6,7 @@
./ricing/catppuccin ./ricing/catppuccin
./vscode ./vscode
./terminal ./terminal
./gnome-extensions
]; ];
# Allow Unfree # Allow Unfree

View File

@ -0,0 +1,25 @@
{ pkgs, ... }:
{
home.packages = with pkgs.gnomeExtensions; [
caffeine
dash-to-dock
gnome-40-ui-improvements
media-controls
search-light
];
dconf = {
enable = true;
settings."org/gnome/shell" = {
disable-user-extensions = false;
enabled-extensions = with pkgs.gnomeExtensions; [
caffeine.extensionUuid
dash-to-dock.extensionUuid
gnome-40-ui-improvements.extensionUuid
media-controls.extensionUuid
search-light.extensionUuid
];
};
};
}

View File

@ -0,0 +1,19 @@
{ ... }:
{
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
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;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
}

View File

@ -0,0 +1,7 @@
{ ... }:
{
# Enable bluetooth
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
}

View File

@ -0,0 +1,16 @@
{ ... }:
{
# Bootloader.
boot.loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
grub = {
efiSupport = true;
device = "nodev";
useOSProber = true;
};
};
}

View File

@ -0,0 +1,38 @@
{ pkgs, ... }:
{
imports = [
./boot
./experimental
./network
./desktop
./printing
./bluetooth
./audio
];
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
wget
gparted
nh
];
fonts = {
enableDefaultPackages = true;
packages = with pkgs; [
noto-fonts
nerdfonts
font-awesome
];
fontconfig = {
defaultFonts = {
serif = [ "Hack Nerd Font" ];
sansSerif = [ "DejaVuSansM Nerd Font" ];
monospace = [ "JetBrainsMono Nerd Font" ];
};
};
};
}

View File

@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./gnome-de.nix
];
}

View File

@ -0,0 +1,34 @@
{ pkgs, ... }:
{
services.xserver = {
enable = true;
desktopManager.gnome.enable = true;
};
environment.gnome.excludePackages = (with pkgs; [
gnome-photos
gnome-tour
gedit
]) ++ (with pkgs.gnome; [
baobab
cheese
eog
epiphany
simple-scan
totem
yelp
evince
geary
seahorse
gnome-contacts
gnome-maps
gnome-music
]);
# Configure keymap in X11
services.xserver = {
layout = "us";
xkbVariant = "";
};
}

View File

@ -0,0 +1,5 @@
{ ... }:
{
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}

View File

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

View File

@ -0,0 +1,6 @@
{ ... }:
{
# Enable CUPS to print documents.
services.printing.enable = true;
}