Modularization of configuration
This commit is contained in:
parent
6ce116ef71
commit
7c3c15a9a2
@ -2,6 +2,7 @@
|
||||
inputs,
|
||||
pkgs,
|
||||
pkgs-stable,
|
||||
username,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
@ -28,14 +29,14 @@
|
||||
WLR_NO_HARDWARE_CURSORS = "1";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
EDITOR = "nvim";
|
||||
FLAKE = "/home/foglar/dotfiles";
|
||||
FLAKE = "/home/${username}/dotfiles";
|
||||
|
||||
DEFAULT_BROWSER = "${pkgs.librewolf}/bin/librewolf";
|
||||
};
|
||||
|
||||
users.users.foglar = {
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
description = "foglar";
|
||||
description = "${username}";
|
||||
extraGroups = ["wheel"];
|
||||
};
|
||||
|
||||
|
||||
@ -148,7 +148,7 @@
|
||||
"$mod" = "SUPER";
|
||||
"$term" = "${pkgs.kitty}/bin/kitty";
|
||||
"$editor" = "${pkgs.vscode}/bin/code";
|
||||
"$file" = "dolphin";
|
||||
"$file" = "nautilus";
|
||||
"$browser" = "${pkgs.librewolf}/bin/librewolf";
|
||||
|
||||
animations = {
|
||||
|
||||
@ -5,8 +5,6 @@
|
||||
hypridle
|
||||
hyprpolkitagent
|
||||
|
||||
kdePackages.dolphin
|
||||
|
||||
dunst
|
||||
libnotify
|
||||
swayosd
|
||||
@ -81,5 +79,6 @@
|
||||
#(writeShellScriptBin "rofilaunch" '''')
|
||||
]) ++ (with pkgs-stable; [
|
||||
pavucontrol
|
||||
gnome.nautilus
|
||||
]);
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
orientation = mkLiteral "vertical";
|
||||
children = ["inputbar" "listbox"];
|
||||
background-color = mkLiteral "transparent";
|
||||
background-image = mkLiteral "url(\"~/dotfiles/nixos/aurora_borealis.png\", height)";
|
||||
background-image = mkLiteral "url(\"~/dotfiles/config/backgrounds/aurora_borealis.png\", height)";
|
||||
};
|
||||
|
||||
# Input bar settings
|
||||
@ -79,7 +79,7 @@
|
||||
padding = mkLiteral "5em";
|
||||
children = ["entry"];
|
||||
background-color = mkLiteral "transparent";
|
||||
background-image = mkLiteral "url(\"~/dotfiles/nixos/aurora_borealis.png\", width)";
|
||||
background-image = mkLiteral "url(\"~/dotfiles/config/backgrounds/aurora_borealis.png\", width)";
|
||||
};
|
||||
|
||||
# Entry field settings
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
{...}: {
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
home.username = "foglar";
|
||||
home.homeDirectory = "/home/foglar";
|
||||
home.stateVersion = "24.05"; # Please read the comment before changing.
|
||||
@ -66,6 +69,38 @@
|
||||
XDG_PICTURES_DIR = "$HOME/Pictures/Screenshots/";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
(writeShellScriptBin "gs" ''
|
||||
set -xeuo pipefail
|
||||
|
||||
gamescopeArgs=(
|
||||
--adaptive-sync # VRR support
|
||||
--hdr-enabled
|
||||
--mangoapp # performance overlay
|
||||
--rt
|
||||
--steam
|
||||
)
|
||||
steamArgs=(
|
||||
-pipewire-dmabuf
|
||||
-tenfoot
|
||||
)
|
||||
mangoConfig=(
|
||||
cpu_temp
|
||||
gpu_temp
|
||||
ram
|
||||
vram
|
||||
)
|
||||
mangoVars=(
|
||||
MANGOHUD=1
|
||||
MANGOHUD_CONFIG="$(IFS=,; echo "$mangoConfig[*]")"
|
||||
)
|
||||
|
||||
export "$mangoVars[@]"
|
||||
exec gamescope "$gamescopeArgs[@]" -- steam "$steamArgs[@]"
|
||||
|
||||
'')
|
||||
];
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
|
||||
@ -23,13 +23,13 @@
|
||||
libreoffice
|
||||
localsend
|
||||
plasma5Packages.kdeconnect-kde
|
||||
qbittorrent
|
||||
vlc
|
||||
openrocket
|
||||
spotify
|
||||
spotube
|
||||
inkscape
|
||||
gnome-disk-utility
|
||||
qbittorrent
|
||||
])
|
||||
++ (with pkgs-stable; [
|
||||
loupe
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
vitetris
|
||||
steam
|
||||
heroic
|
||||
gamescope
|
||||
wine
|
||||
|
||||
(writeShellScriptBin "nvidia-offload" ''
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
"security.workspace.trust.enabled" = false;
|
||||
"terminal.external.linuxExec" = "kitty";
|
||||
"terminal.integrated.stickyScroll.enabled" = true;
|
||||
"terminal.integrated.inheritEnv"= false;
|
||||
"telemetry.telemetryLevel" = "off";
|
||||
"workbench.activityBar.location" = "hidden"; # bottom
|
||||
"workbench.iconTheme" = "material-icon-theme";
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
username,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
@ -16,6 +17,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
users.users.foglar.extraGroups = [ "docker" ];
|
||||
users.users.${username}.extraGroups = [ "docker" ];
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
username,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
@ -10,9 +12,18 @@
|
||||
config = lib.mkIf config.package.steam.enable {
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
gamescopeSession.enable = true;
|
||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
||||
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
||||
};
|
||||
|
||||
services.getty.autologinUser = "${username}";
|
||||
environment = {
|
||||
systemPackages = [pkgs.mangohud];
|
||||
loginShellInit = ''
|
||||
[[ "$(tty)" = "/dev/tty1" ]] && ./gs
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,5 +1,11 @@
|
||||
{...}:
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
options.sys.audio.enable = lib.mkEnableOption "Enable audio support";
|
||||
|
||||
config = lib.mkIf config.sys.audio.enable {
|
||||
# Enable sound with pipewire.
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
@ -15,4 +21,5 @@
|
||||
# no need to redefine it in your config for now)
|
||||
#media-session.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@ -1,30 +1,19 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
#services.xserver.desktopManager.gnome.enable = true;
|
||||
}: {
|
||||
options = {
|
||||
sys.desktop.plasma.enable = lib.mkEnableOption "Plasma Desktop";
|
||||
sys.desktop.gnome.enable = lib.mkEnableOption "GNOME Desktop";
|
||||
sys.desktop.hyprland.enable = lib.mkEnableOption "Hyprland Desktop";
|
||||
};
|
||||
|
||||
#environment.gnome.excludePackages = with pkgs; [
|
||||
# gnome-tour
|
||||
# gnome-connections
|
||||
# epiphany # web browser
|
||||
# geary # email reader. Up to 24.05. Starting from 24.11 the package name is just geary.
|
||||
# #evince # document viewer
|
||||
# gnome-weather
|
||||
# gnome-contacts
|
||||
# gnome-maps
|
||||
# gnome-logs
|
||||
# gnome-music
|
||||
# gnome-system-monitor
|
||||
# gnome-text-editor
|
||||
# yelp
|
||||
# totem
|
||||
# snapshot
|
||||
# seahorse
|
||||
#];
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf config.sys.desktop.plasma.enable {
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
|
||||
environment.plasma6.excludePackages = with pkgs.kdePackages; [
|
||||
ark
|
||||
@ -38,11 +27,38 @@
|
||||
krdp
|
||||
khelpcenter
|
||||
];
|
||||
})
|
||||
|
||||
(lib.mkIf config.sys.desktop.gnome.enable {
|
||||
services.xserver.desktopManager.gnome.enable = true;
|
||||
|
||||
environment.gnome.excludePackages = with pkgs; [
|
||||
gnome-tour
|
||||
gnome-connections
|
||||
epiphany # web browser
|
||||
geary # email reader. Up to 24.05. Starting from 24.11 the package name is just geary.
|
||||
#evince # document viewer
|
||||
gnome-weather
|
||||
gnome-contacts
|
||||
gnome-maps
|
||||
gnome-logs
|
||||
gnome-music
|
||||
gnome-system-monitor
|
||||
gnome-text-editor
|
||||
yelp
|
||||
totem
|
||||
snapshot
|
||||
seahorse
|
||||
];
|
||||
})
|
||||
|
||||
(lib.mkIf config.sys.desktop.hyprland.enable {
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
package = inputs.hyprland.packages."${pkgs.system}".hyprland;
|
||||
portalPackage = pkgs.xdg-desktop-portal-hyprland;
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
@ -1,8 +1,19 @@
|
||||
{pkgs, ...}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
sys.fonts.packages = pkgs.lib.mkEnableOption "Install fonts";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sys.fonts.packages {
|
||||
fonts.packages = with pkgs; [
|
||||
noto-fonts
|
||||
noto-fonts-emoji
|
||||
(nerdfonts.override {fonts = ["JetBrainsMono"];})
|
||||
monaspace
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,4 +1,15 @@
|
||||
{...}: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
sys.locales = {
|
||||
enable = lib.mkEnableOption "Enable locales configuration";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sys.locales.enable {
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Prague";
|
||||
# Select internationalisation properties.
|
||||
@ -20,4 +31,5 @@
|
||||
xkb.layout = "us,cz";
|
||||
xkb.options = "grp:win_space_toggle";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,5 +1,18 @@
|
||||
{...}: {
|
||||
networking.hostName = "laptop"; # Define your hostname.
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
hostname,
|
||||
username,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
sys.network.enable = lib.mkEnableOption "Enable networking";
|
||||
sys.bluetooth.enable = lib.mkEnableOption "Enable Bluetooth support";
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf config.sys.network.enable {
|
||||
networking.hostName = "${hostname}"; # Define your hostname.
|
||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Configure network proxy if necessary
|
||||
@ -8,9 +21,14 @@
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
users.users.${username}.extraGroups = ["networkmanager"];
|
||||
})
|
||||
(
|
||||
lib.mkIf config.sys.bluetooth.enable {
|
||||
hardware.bluetooth.enable = true; # enables support for Bluetooth
|
||||
hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot
|
||||
services.blueman.enable = true;
|
||||
|
||||
users.users.foglar.extraGroups = [ "networkmanager" ];
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
|
||||
@ -1,4 +1,13 @@
|
||||
{config, ...}: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
sys.nvidia.enable = lib.mkEnableOption "Enable Nvidia graphics support";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sys.nvidia.enable {
|
||||
hardware = {
|
||||
graphics.enable = true;
|
||||
};
|
||||
@ -42,4 +51,5 @@
|
||||
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,5 +1,15 @@
|
||||
{pkgs, ...}: {
|
||||
# Printing
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
username,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
sys.printing.enable = lib.mkEnableOption "Enable printing support";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sys.printing.enable {
|
||||
services.printing.enable = true;
|
||||
services.printing.drivers = with pkgs; [gutenprint hplip splix];
|
||||
hardware.printers = {
|
||||
@ -22,5 +32,6 @@
|
||||
services.ipp-usb.enable = true;
|
||||
hardware.sane.extraBackends = [pkgs.hplipWithPlugin];
|
||||
|
||||
users.users.foglar.extraGroups = ["lp" "scanner"];
|
||||
users.users.${username}.extraGroups = ["lp" "scanner"];
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,10 +1,14 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
options = {
|
||||
sys.sddm.enable = lib.mkEnableOption "Enable SDDM login";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sys.sddm.enable {
|
||||
services.displayManager = {
|
||||
defaultSession = "hyprland";
|
||||
sddm = {
|
||||
@ -25,4 +29,5 @@
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
@ -1,8 +1,14 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
options = {
|
||||
sys.style.enable = lib.mkEnableOption "Enable the Stylix theme manager.";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sys.style.enable {
|
||||
stylix = {
|
||||
enable = true;
|
||||
image = ../../../config/backgrounds/aurora_borealis.png;
|
||||
@ -33,4 +39,5 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@ -1,5 +1,4 @@
|
||||
{...}:
|
||||
{
|
||||
{lib, ...}: {
|
||||
imports = [
|
||||
./sys/audio.nix
|
||||
./sys/desktops.nix
|
||||
@ -11,4 +10,18 @@
|
||||
./sys/sddm.nix
|
||||
./sys/style.nix
|
||||
];
|
||||
|
||||
sys.audio.enable = lib.mkDefault true;
|
||||
sys.desktop.plasma.enable = lib.mkDefault true;
|
||||
sys.desktop.gnome.enable = lib.mkDefault false;
|
||||
sys.desktop.hyprland.enable = lib.mkDefault true;
|
||||
sys.fonts.packages = lib.mkDefault true;
|
||||
sys.locales.enable = lib.mkDefault true;
|
||||
sys.network.enable = lib.mkDefault true;
|
||||
sys.bluetooth.enable = lib.mkDefault true;
|
||||
sys.nvidia.enable = lib.mkDefault true;
|
||||
sys.printing.enable = lib.mkDefault true;
|
||||
sys.sddm.enable = lib.mkDefault true;
|
||||
sys.style.enable = lib.mkDefault true;
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user