🧹 Moved almost all files to /modules. Moved some code to separate files

This commit is contained in:
Martin Berg Alstad 2025-01-05 19:14:37 +01:00
parent f0ac3a7705
commit b30376cdcf
Signed by: martials
GPG Key ID: A3824877B269F2E2
101 changed files with 133 additions and 102 deletions

3
.gitignore vendored
View File

@ -1,6 +1,3 @@
# Autogenerated
hardware-configuration.nix
# Symlink create by `nix build`
result

View File

@ -9,20 +9,7 @@
}:
{
imports = [
./gnome
./hardware-configuration.nix
./keyboard.nix
./terminal
./hyprland
./audio.nix
./networking.nix
./nixHelper.nix
./development.nix
./security.nix
./locale.nix
./sddm.nix
];
imports = [ ./modules ];
nixpkgs.overlays = [ outputs.overlays.unstable-packages ];
@ -46,27 +33,14 @@
environment.sessionVariables = {
# Tells Electron apps to use Wayland
NIXOS_OZONE_WL = "1";
NIXOS_CONFIG_PATH = "/etc/nixos";
LIBVA_DRIVER_NAME = "iHD"; # For hardware acceleration
};
fonts = {
fontconfig.enable = true;
packages = with pkgs; [
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
jetbrains-mono
# The line below will replace the lines above in 25.05
# nerd-fonts.jetbrains-mono
];
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
gnupg
wget
kitty
xdg-utils
xdg-desktop-portal
xdg-desktop-portal-gtk
kdePackages.qtwayland
kdePackages.qtsvg
@ -92,16 +66,7 @@
# programs.mtr.enable = true;
programs = {
gnupg.agent.enable = true;
kdeconnect.enable = true;
steam = {
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
};
};
# List services that you want to enable:
@ -111,48 +76,11 @@
services = {
flatpak.enable = true;
xserver = {
enable = true;
# Load Nvidia driver for Xorg and Wayland
videoDrivers = [ "nvidia" ];
};
};
stylix = {
enable = true;
image = ./catppuccin.png;
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
polarity = "dark";
opacity.terminal = 0.8;
override = {
base02 = "b0b0b0"; # Comments in shell
base03 = "b0b0b0"; # Comments in nvim
base04 = "b0b0b0"; # Secondary text in shell
};
xserver.enable = true;
};
qt.enable = true;
hardware = {
# Enable OpenGL
graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # For Broadwell (2014) or newer processors. LIBVA_DRIVER_NAME=iHD
];
};
nvidia = {
# Required
modesetting.enable = true;
# Use closed-source drivers
open = false;
# Enable the Nvidia settings menu
nvidiaSettings = true;
};
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave

View File

@ -50,7 +50,7 @@
useUserPackages = true;
# Passes inputs as an argument to home-manager
extraSpecialArgs = { inherit inputs; };
users.martin = import ./home;
users.martin = import ./home-manager;
};
}
stylix.nixosModules.stylix

View File

@ -21,11 +21,11 @@ in
on-timeout = "loginctl lock-session";
}
# Turn off screens TODO buggy main monitor, turns off and on after resume
# {
# timeout = 120;
# on-timeout = "hyprctl dispatch dpms off";
# on-resume = "hyprctl dispatch dpms on";
# }
# {
# timeout = 120;
# on-timeout = "hyprctl dispatch dpms off";
# on-resume = "hyprctl dispatch dpms on";
# }
# Suspend
{
timeout = suspendAfter;

View File

Before

Width:  |  Height:  |  Size: 969 B

After

Width:  |  Height:  |  Size: 969 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 877 B

After

Width:  |  Height:  |  Size: 877 B

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

19
modules/default.nix Normal file
View File

@ -0,0 +1,19 @@
{ ... }:
{
imports = [
./development.nix
./fonts.nix
./gnome
./hardware
./locale.nix
./networking.nix
./nix-helper.nix
./hyprland
./sddm.nix
./security.nix
./steam.nix
./stylix.nix
./terminal
];
}

14
modules/fonts.nix Normal file
View File

@ -0,0 +1,14 @@
{ pkgs, ... }:
{
fonts = {
fontconfig.enable = true;
packages = with pkgs; [
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
jetbrains-mono
# The line below will replace the lines above in 25.05
# nerd-fonts.jetbrains-mono
];
};
}

View File

@ -10,7 +10,7 @@
glib
adwaita-icon-theme
gnomeExtensions.appindicator
# gnome-extension-manager
# gnome-extension-manager
loupe
gnome-calculator
gnome-disk-utility

View File

@ -0,0 +1,10 @@
{ ... }:
{
imports = [
./audio.nix
./graphics
./hardware-configuration.nix
./keyboard.nix
];
}

View File

@ -0,0 +1,19 @@
{ pkgs, ... }:
{
imports = [
./nvidia.nix
];
# For hardware acceleration
environment.sessionVariables.LIBVA_DRIVER_NAME = "iHD";
# Enable OpenGL
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
# Used for hardware-acceleration
intel-media-driver # For Broadwell (2014) or newer processors. LIBVA_DRIVER_NAME=iHD
];
};
}

View File

@ -0,0 +1,15 @@
{ ... }:
{
hardware.nvidia = {
# Required
modesetting.enable = true;
# Use closed-source drivers
open = false;
# Enable the Nvidia settings menu
nvidiaSettings = true;
};
# Load Nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = [ "nvidia" ];
}

View File

@ -16,7 +16,5 @@
# Or disable the firewall altogether.
# networking.firewall.enable = false;
services.tailscale = {
enable = true;
};
services.tailscale.enable = true;
}

View File

@ -6,7 +6,7 @@
flavor = "mocha";
font = "Noto Sans";
fontSize = "9";
background = "${./catppuccin_high.png}";
background = "${../catppuccin_high.png}";
loginBackground = true;
})
];

View File

@ -2,9 +2,12 @@
{
environment.systemPackages = with pkgs; [
gnupg
yubioath-flutter
];
programs.gnupg.agent.enable = true;
security.pam = {
services = {
login.u2fAuth = false; # U2F and password

10
modules/steam.nix Normal file
View File

@ -0,0 +1,10 @@
{ ... }:
{
programs.steam = {
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
};
}

16
modules/stylix.nix Normal file
View File

@ -0,0 +1,16 @@
{ pkgs, ... }:
{
stylix = {
enable = true;
image = ../catppuccin.png;
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
polarity = "dark";
opacity.terminal = 0.8;
override = {
base02 = "b0b0b0"; # Comments in shell
base03 = "b0b0b0"; # Comments in nvim
base04 = "b0b0b0"; # Secondary text in shell
};
};
}

View File

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
imports = [
./shell.nix
];
environment.systemPackages = with pkgs; [
kitty
];
}

View File

@ -1,5 +0,0 @@
{ ... }:
{
imports = [ ];
}

5
switch
View File

@ -1,6 +1,9 @@
#!/usr/bin/env sh
# Accepts all arguments to nh os switch
# For example --ask to prompt if the user want to switch configs
# Rebuild and switch the environment if successful
git add .
./fmt
nh os switch .
nh os switch . "$@"

Some files were not shown because too many files have changed in this diff Show More