mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-10-04 11:35:41 +00:00
refactor: modularize host configuration
This commit is contained in:
parent
783b7c8705
commit
bb8d9c6752
10 changed files with 152 additions and 111 deletions
|
@ -5,118 +5,18 @@
|
||||||
[
|
[
|
||||||
inputs.nix-flatpak.nixosModules.nix-flatpak
|
inputs.nix-flatpak.nixosModules.nix-flatpak
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|
||||||
|
./modules/boot.nix
|
||||||
|
./modules/network.nix
|
||||||
|
./modules/time.nix
|
||||||
|
./modules/users.nix
|
||||||
|
./modules/packages.nix
|
||||||
|
./modules/services.nix
|
||||||
|
./modules/hardware.nix
|
||||||
|
./modules/environment.nix
|
||||||
|
./modules/programs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
|
|
||||||
networking.hostName = "nixos";
|
|
||||||
networking.networkmanager.enable = true;
|
|
||||||
networking.firewall.enable = false;
|
|
||||||
|
|
||||||
time.timeZone = "Asia/Seoul";
|
|
||||||
i18n = {
|
|
||||||
defaultLocale = "en_US.UTF-8";
|
|
||||||
extraLocaleSettings = {
|
|
||||||
LC_ADDRESS = "ko_KR.UTF-8";
|
|
||||||
LC_IDENTIFICATION = "ko_KR.UTF-8";
|
|
||||||
LC_MEASUREMENT = "ko_KR.UTF-8";
|
|
||||||
LC_MONETARY = "ko_KR.UTF-8";
|
|
||||||
LC_NAME = "ko_KR.UTF-8";
|
|
||||||
LC_NUMERIC = "ko_KR.UTF-8";
|
|
||||||
LC_PAPER = "ko_KR.UTF-8";
|
|
||||||
LC_TELEPHONE = "ko_KR.UTF-8";
|
|
||||||
LC_TIME = "ko_KR.UTF-8";
|
|
||||||
};
|
|
||||||
inputMethod = {
|
|
||||||
enable = true;
|
|
||||||
type = "kime";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
services.xserver = {
|
|
||||||
xkb.layout = "us";
|
|
||||||
videoDrivers = [ "nvidia" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.toast = {
|
|
||||||
isNormalUser = true;
|
|
||||||
description = "toast";
|
|
||||||
extraGroups = [ "networkmanager" "wheel" ];
|
|
||||||
packages = with pkgs; [];
|
|
||||||
shell = pkgs.zsh;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
vim
|
|
||||||
wget
|
|
||||||
];
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
|
||||||
programs.hyprland = {
|
|
||||||
enable = true;
|
|
||||||
withUWSM = true;
|
|
||||||
xwayland.enable = true;
|
|
||||||
};
|
|
||||||
programs.thunar = {
|
|
||||||
enable = true;
|
|
||||||
plugins = with pkgs.xfce; [
|
|
||||||
thunar-volman
|
|
||||||
];
|
|
||||||
};
|
|
||||||
programs.xfconf.enable = true;
|
|
||||||
services.gvfs.enable = true; # Mount, trash, and other functionalities
|
|
||||||
services.tumbler.enable = true; # Thumbnail support for images
|
|
||||||
|
|
||||||
environment.sessionVariables = {
|
|
||||||
# WLR_NO_HARDWARE_CURSORS = "1";
|
|
||||||
NIXOS_OZONE_WL = "1";
|
|
||||||
};
|
|
||||||
|
|
||||||
hardware = {
|
|
||||||
graphics.enable = true;
|
|
||||||
nvidia = {
|
|
||||||
modesetting.enable = true;
|
|
||||||
powerManagement.enable = false;
|
|
||||||
powerManagement.finegrained = false;
|
|
||||||
open = false;
|
|
||||||
nvidiaSettings = true;
|
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.greetd = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
default_session = {
|
|
||||||
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember --remember-session";
|
|
||||||
user = "greeter";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
services.zerotierone.enable = true;
|
|
||||||
services.flatpak = {
|
|
||||||
enable = true;
|
|
||||||
packages = [
|
|
||||||
"org.prismlauncher.PrismLauncher"
|
|
||||||
"org.vinegarhq.Sober"
|
|
||||||
"org.vinegarhq.Vinegar"
|
|
||||||
];
|
|
||||||
overrides = {
|
|
||||||
"org.prismlauncher.PrismLauncher".Context = {
|
|
||||||
filesystems = [
|
|
||||||
"home"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
"org.vinegarhq.Sober".Context = {
|
|
||||||
filesystems = [
|
|
||||||
"xdg-run/app/com.discordapp.Discord:create"
|
|
||||||
"xdg-run/discord-ipc-0"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "25.05";
|
system.stateVersion = "25.05";
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
}
|
}
|
6
hosts/nixos/modules/boot.nix
Normal file
6
hosts/nixos/modules/boot.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
}
|
8
hosts/nixos/modules/environment.nix
Normal file
8
hosts/nixos/modules/environment.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
environment.sessionVariables = {
|
||||||
|
# WLR_NO_HARDWARE_CURSORS = "1";
|
||||||
|
NIXOS_OZONE_WL = "1";
|
||||||
|
};
|
||||||
|
}
|
17
hosts/nixos/modules/hardware.nix
Normal file
17
hosts/nixos/modules/hardware.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
hardware = {
|
||||||
|
graphics.enable = true;
|
||||||
|
nvidia = {
|
||||||
|
modesetting.enable = true;
|
||||||
|
powerManagement = {
|
||||||
|
enable = false;
|
||||||
|
finegrained = false;
|
||||||
|
};
|
||||||
|
open = false;
|
||||||
|
nvidiaSettings = true;
|
||||||
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
7
hosts/nixos/modules/network.nix
Normal file
7
hosts/nixos/modules/network.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
networking.hostName = "nixos";
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
networking.firewall.enable = false;
|
||||||
|
}
|
9
hosts/nixos/modules/packages.nix
Normal file
9
hosts/nixos/modules/packages.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
vim
|
||||||
|
wget
|
||||||
|
];
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
}
|
17
hosts/nixos/modules/programs.nix
Normal file
17
hosts/nixos/modules/programs.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.zsh.enable = true;
|
||||||
|
programs.hyprland = {
|
||||||
|
enable = true;
|
||||||
|
withUWSM = true;
|
||||||
|
xwayland.enable = true;
|
||||||
|
};
|
||||||
|
programs.thunar = {
|
||||||
|
enable = true;
|
||||||
|
plugins = with pkgs.xfce; [
|
||||||
|
thunar-volman
|
||||||
|
];
|
||||||
|
};
|
||||||
|
programs.xfconf.enable = true;
|
||||||
|
}
|
43
hosts/nixos/modules/services.nix
Normal file
43
hosts/nixos/modules/services.nix
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.xserver = {
|
||||||
|
xkb.layout = "us";
|
||||||
|
videoDrivers = [ "nvidia" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.gvfs.enable = true; # Mount, trash, and other functionalities
|
||||||
|
services.tumbler.enable = true; # Thumbnail support for images
|
||||||
|
|
||||||
|
services.greetd = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
default_session = {
|
||||||
|
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember --remember-session";
|
||||||
|
user = "greeter";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.zerotierone.enable = true;
|
||||||
|
services.flatpak = {
|
||||||
|
enable = true;
|
||||||
|
packages = [
|
||||||
|
"org.prismlauncher.PrismLauncher"
|
||||||
|
"org.vinegarhq.Sober"
|
||||||
|
"org.vinegarhq.Vinegar"
|
||||||
|
];
|
||||||
|
overrides = {
|
||||||
|
"org.prismlauncher.PrismLauncher".Context = {
|
||||||
|
filesystems = [
|
||||||
|
"home"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"org.vinegarhq.Sober".Context = {
|
||||||
|
filesystems = [
|
||||||
|
"xdg-run/app/com.discordapp.Discord:create"
|
||||||
|
"xdg-run/discord-ipc-0"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
23
hosts/nixos/modules/time.nix
Normal file
23
hosts/nixos/modules/time.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
time.timeZone = "Asia/Seoul";
|
||||||
|
i18n = {
|
||||||
|
defaultLocale = "en_US.UTF-8";
|
||||||
|
extraLocaleSettings = {
|
||||||
|
LC_ADDRESS = "ko_KR.UTF-8";
|
||||||
|
LC_IDENTIFICATION = "ko_KR.UTF-8";
|
||||||
|
LC_MEASUREMENT = "ko_KR.UTF-8";
|
||||||
|
LC_MONETARY = "ko_KR.UTF-8";
|
||||||
|
LC_NAME = "ko_KR.UTF-8";
|
||||||
|
LC_NUMERIC = "ko_KR.UTF-8";
|
||||||
|
LC_PAPER = "ko_KR.UTF-8";
|
||||||
|
LC_TELEPHONE = "ko_KR.UTF-8";
|
||||||
|
LC_TIME = "ko_KR.UTF-8";
|
||||||
|
};
|
||||||
|
inputMethod = {
|
||||||
|
enable = true;
|
||||||
|
type = "kime";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
11
hosts/nixos/modules/users.nix
Normal file
11
hosts/nixos/modules/users.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
users.users.toast = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "toast";
|
||||||
|
extraGroups = [ "networkmanager" "wheel" ];
|
||||||
|
packages = with pkgs; [];
|
||||||
|
shell = pkgs.zsh;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue