refactors

This commit is contained in:
maxstrb 2025-09-22 10:19:00 +02:00
parent 26b798c4b3
commit d18110a018
15 changed files with 230 additions and 379 deletions

View file

@ -1,170 +1,32 @@
{ {
pkgs, imports = [
inputs, ../modules/locale.nix
... ../modules/main-user.nix
}: { ../modules/system.nix
nix.settings.experimental-features = ["nix-command" "flakes"]; ../modules/boot.nix
../modules/file-management.nix
nixpkgs = { ../modules/desktop.nix
config.allowUnfree = true; ../modules/audio.nix
}; ../modules/printing.nix
../modules/programs.nix
environment.systemPackages = with pkgs; [
nushell
wl-clipboard
gvfs
libsForQt5.qt5.qtquickcontrols2
libsForQt5.qt5.qtgraphicaleffects
]; ];
hardware.graphics = { nix.settings.experimental-features = ["nix-command" "flakes"];
enable = true; nixpkgs.config.allowUnfree = true;
enable32Bit = true;
};
xdg = { services.avahi.enable = true;
mime.enable = true;
menus.enable = true;
portal = {
enable = true;
};
};
programs = {
firefox.enable = true;
bash.blesh.enable = true;
xfconf.enable = true;
thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
hyprland = {
enable = true;
withUWSM = true;
package = inputs.hyprland.packages."x86_64-linux".hyprland;
portalPackage = inputs.hyprland.packages."x86_64-linux".xdg-desktop-portal-hyprland;
};
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
};
nix-ld = {
enable = true;
#libraries = with pkgs; [
# Add libraries here
#];
};
};
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
kernelPackages = pkgs.linuxPackages_latest;
#kernelPackages = pkgs.linuxPackages_zen;
};
networking = { networking = {
hostName = "max-laptop";
proxy.noProxy = "127.0.0.1,localhost,internal.domain"; proxy.noProxy = "127.0.0.1,localhost,internal.domain";
networkmanager.enable = true; networkmanager.enable = false;
wireless = { wireless = {
enable = false; enable = true;
networks = { networks = {
aaa = {psk = "laserjet6plas";}; aaa = {psk = "laserjet6plas";};
}; "Mi Phone" = {psk = "simoneKYS";};
};
firewall = {
enable = true;
allowedTCPPorts = [8000];
};
};
environment.sessionVariables = {
XDG_CURRENT_DESKTOP = "Hyprland";
TERMINAL = "foot";
};
time.timeZone = "Europe/Prague";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "cs_CZ.UTF-8";
LC_IDENTIFICATION = "cs_CZ.UTF-8";
LC_MEASUREMENT = "cs_CZ.UTF-8";
LC_MONETARY = "cs_CZ.UTF-8";
LC_NAME = "cs_CZ.UTF-8";
LC_NUMERIC = "cs_CZ.UTF-8";
LC_PAPER = "cs_CZ.UTF-8";
LC_TELEPHONE = "cs_CZ.UTF-8";
LC_TIME = "cs_CZ.UTF-8";
};
};
services = {
xserver = {
enable = true;
videoDrivers = ["amdgpu"];
xkb = {
layout = "cz";
variant = "";
options = "caps:escape";
}; };
}; };
tumbler.enable = true; firewall.enable = true;
printing.enable = true;
avahi.enable = true;
displayManager.sddm = {
enable = true;
theme = "${import ./sddm-theme.nix {inherit pkgs;}}";
autoNumlock = true;
};
devmon.enable = true;
gvfs.enable = true;
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
jack.enable = true;
};
};
console.keyMap = "cz-lat2";
security.rtkit.enable = true;
users.users.maxag = {
isNormalUser = true;
description = "Max Ag";
extraGroups = ["networkmanager" "wheel" "video" "input"];
shell = pkgs.nushell;
};
system = {
stateVersion = "25.11";
activationScripts.cleanBackups = ''
echo "Removing .backup_nix files..."
find /home/maxag -type f -name "*.backup_nix" -delete
'';
}; };
} }

View file

@ -1,83 +1,23 @@
{ {
pkgs,
inputs,
...
}: {
imports = [ imports = [
./verbatim.nix ./verbatim.nix
../modules/steam.nix
../modules/locale.nix
../modules/main-user.nix
../modules/system.nix
../modules/boot.nix
../modules/file-management.nix
../modules/desktop.nix
../modules/audio.nix
../modules/printing.nix
../modules/programs.nix
]; ];
nix.settings.experimental-features = ["nix-command" "flakes"]; nix.settings.experimental-features = ["nix-command" "flakes"];
nixpkgs.config.allowUnfree = true;
nixpkgs = { services.avahi.enable = true;
config.allowUnfree = true;
};
environment.systemPackages = with pkgs; [
nushell
wl-clipboard
gvfs
libsForQt5.qt5.qtquickcontrols2
libsForQt5.qt5.qtgraphicaleffects
];
hardware.graphics = {
enable = true;
enable32Bit = true;
};
xdg = {
mime.enable = true;
menus.enable = true;
portal = {
enable = true;
};
};
programs = {
firefox.enable = true;
bash.blesh.enable = true;
xfconf.enable = true;
thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
hyprland = {
enable = true;
withUWSM = true;
package = inputs.hyprland.packages."x86_64-linux".hyprland;
portalPackage = inputs.hyprland.packages."x86_64-linux".xdg-desktop-portal-hyprland;
};
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
};
nix-ld = {
enable = true;
#libraries = with pkgs; [
# Add libraries here
#];
};
};
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
kernelPackages = pkgs.linuxPackages_latest;
#kernelPackages = pkgs.linuxPackages_zen;
};
networking = { networking = {
hostName = "max-main"; hostName = "max-main";
@ -88,81 +28,4 @@
allowedTCPPorts = [8000]; allowedTCPPorts = [8000];
}; };
}; };
environment.sessionVariables = {
XDG_CURRENT_DESKTOP = "Hyprland";
TERMINAL = "foot";
};
time.timeZone = "Europe/Prague";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "cs_CZ.UTF-8";
LC_IDENTIFICATION = "cs_CZ.UTF-8";
LC_MEASUREMENT = "cs_CZ.UTF-8";
LC_MONETARY = "cs_CZ.UTF-8";
LC_NAME = "cs_CZ.UTF-8";
LC_NUMERIC = "cs_CZ.UTF-8";
LC_PAPER = "cs_CZ.UTF-8";
LC_TELEPHONE = "cs_CZ.UTF-8";
LC_TIME = "cs_CZ.UTF-8";
};
};
services = {
xserver = {
enable = true;
videoDrivers = ["amdgpu"];
xkb = {
layout = "cz";
variant = "";
options = "caps:escape";
};
};
tumbler.enable = true;
printing.enable = true;
avahi.enable = true;
displayManager.sddm = {
enable = true;
theme = "${import ./sddm-theme.nix {inherit pkgs;}}";
autoNumlock = true;
};
devmon.enable = true;
gvfs.enable = true;
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
jack.enable = true;
};
};
console.keyMap = "cz-lat2";
security.rtkit.enable = true;
users.users.maxag = {
isNormalUser = true;
description = "Max Ag";
extraGroups = ["networkmanager" "wheel" "video" "input"];
shell = pkgs.nushell;
};
system = {
stateVersion = "25.11";
activationScripts.cleanBackups = ''
echo "Removing .backup_nix files..."
find /home/maxag -type f -name "*.backup_nix" -delete
'';
};
} }

View file

@ -0,0 +1,13 @@
{
services.pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
jack.enable = true;
};
security.rtkit.enable = true;
}

View file

@ -0,0 +1,11 @@
{pkgs, ...}: {
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
kernelPackages = pkgs.linuxPackages_latest;
#kernelPackages = pkgs.linuxPackages_zen;
};
}

View file

@ -0,0 +1,52 @@
{
pkgs,
inputs,
...
}: {
environment.systemPackages = with pkgs; [
wl-clipboard
libsForQt5.qt5.qtquickcontrols2
libsForQt5.qt5.qtgraphicaleffects
];
hardware.graphics = {
enable = true;
enable32Bit = true;
};
xdg = {
mime.enable = true;
menus.enable = true;
portal.enable = true;
};
programs.hyprland = {
enable = true;
withUWSM = true;
package = inputs.hyprland.packages."x86_64-linux".hyprland;
portalPackage = inputs.hyprland.packages."x86_64-linux".xdg-desktop-portal-hyprland;
};
services = {
xserver = {
enable = true;
videoDrivers = ["amdgpu"];
xkb = {
layout = "cz";
variant = "";
options = "caps:escape";
};
};
displayManager.sddm = {
enable = true;
theme = "${import ./sddm-theme.nix {inherit pkgs;}}";
autoNumlock = true;
};
};
environment.sessionVariables = {
XDG_CURRENT_DESKTOP = "Hyprland";
TERMINAL = "foot";
EDITOR = "nvim";
};
}

View file

@ -0,0 +1,22 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
gvfs
];
programs = {
xfconf.enable = true;
thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
};
services = {
devmon.enable = true;
gvfs.enable = true;
tumbler.enable = true;
};
}

View file

@ -0,0 +1,19 @@
{
console.keyMap = "cz-lat2";
time.timeZone = "Europe/Prague";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "cs_CZ.UTF-8";
LC_IDENTIFICATION = "cs_CZ.UTF-8";
LC_MEASUREMENT = "cs_CZ.UTF-8";
LC_MONETARY = "cs_CZ.UTF-8";
LC_NAME = "cs_CZ.UTF-8";
LC_NUMERIC = "cs_CZ.UTF-8";
LC_PAPER = "cs_CZ.UTF-8";
LC_TELEPHONE = "cs_CZ.UTF-8";
LC_TIME = "cs_CZ.UTF-8";
};
};
}

View file

@ -0,0 +1,9 @@
{pkgs, ...}: {
users.users.maxag = {
isNormalUser = true;
description = "Max Ag";
extraGroups = ["networkmanager" "wheel" "video" "input"];
shell = pkgs.nushell;
};
}

View file

@ -0,0 +1,3 @@
{
services.printing.enable = true;
}

View file

@ -0,0 +1,12 @@
{
programs = {
firefox.enable = true;
bash.blesh.enable = true; # Enhanced bash
nix-ld = {
enable = true;
#libraries = with pkgs; [
# Add libraries here
#];
};
};
}

View file

@ -0,0 +1,8 @@
{
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
};
}

View file

@ -0,0 +1,10 @@
{name, ...}: {
networking.hostName = "max-${name}";
system = {
stateVersion = "25.11";
activationScripts.cleanBackups = ''
echo "Removing .backup_nix files..."
find /home/maxag -type f -name "*.backup_nix" -delete
'';
};
}

View file

@ -3,93 +3,54 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nvf = { nvf = {
url = "github:notashelf/nvf"; url = "github:notashelf/nvf";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
stylix = { stylix = {
url = "github:danth/stylix"; url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
hyprland = { hyprland = {
url = "github:hyprwm/Hyprland"; url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = {nixpkgs, ...} @ inputs: { outputs = {nixpkgs, ...} @ inputs: let
mkSystem = name:
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs name;
};
modules = [
./configuration/${name}/configuration.nix
./configuration/${name}/hardware-configuration.nix
inputs.home-manager.nixosModules.default
inputs.stylix.nixosModules.stylix
{
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {inherit inputs name;};
backupFileExtension = "backup_nix";
users.maxag = ./home/${name}/home.nix;
sharedModules = [
inputs.stylix.homeModules.stylix
];
};
}
];
};
in {
nixosConfigurations = { nixosConfigurations = {
max-laptop = nixpkgs.lib.nixosSystem { max-laptop = mkSystem "laptop";
system = "x86_64-linux"; max-main = mkSystem "main";
specialArgs = {
inherit inputs;
};
modules = [
./configuration/laptop/configuration.nix
./configuration/laptop/hardware-configuration.nix
inputs.home-manager.nixosModules.default
{
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {inherit inputs;};
backupFileExtension = "backup_nix";
users.maxag = ./home/laptop/home.nix;
};
}
inputs.stylix.nixosModules.stylix
{
home-manager.sharedModules = [
inputs.stylix.homeModules.stylix
];
}
];
};
max-main = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [
./configuration/main/configuration.nix
./configuration/main/hardware-configuration.nix
inputs.home-manager.nixosModules.default
{
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {inherit inputs;};
backupFileExtension = "backup_nix";
users.maxag = ./home/main/home.nix;
};
}
inputs.stylix.nixosModules.stylix
{
home-manager.sharedModules = [
inputs.stylix.homeModules.stylix
];
}
];
};
}; };
}; };
} }

View file

@ -1,4 +1,4 @@
{ {pkgs, ...}: {
home = { home = {
username = "maxag"; username = "maxag";
homeDirectory = "/home/maxag"; homeDirectory = "/home/maxag";
@ -7,6 +7,10 @@
programs.home-manager.enable = true; programs.home-manager.enable = true;
home.packages = with pkgs; [
brightnessctl
];
imports = [ imports = [
./hyprland.nix ./hyprland.nix
../modules/nvf.nix ../modules/nvf.nix

View file

@ -1,4 +1,8 @@
{pkgs, ...}: { {
pkgs,
name,
...
}: {
home.packages = with pkgs; [ home.packages = with pkgs; [
bat bat
]; ];
@ -14,8 +18,6 @@
enable = true; enable = true;
extraConfig = '' extraConfig = ''
$env.config.buffer_editor = "nvim"
if "ZELLIJ" in $env == false { if "ZELLIJ" in $env == false {
zellij zellij
exit exit
@ -77,8 +79,8 @@
zel = "zellij"; zel = "zellij";
rebuild = "sudo nixos-rebuild switch --flake /home/maxag/.nix-config"; rebuild = "sudo nixos-rebuild switch --flake /home/maxag/.nix-config";
system = "nvim /home/maxag/.nix-config/flake.nix"; system = "nvim /home/maxag/.nix-config/flake.nix";
home = "nvim /home/maxag/.nix-config/home/main/home.nix"; home = "nvim /home/maxag/.nix-config/home/${name}/home.nix";
config = "nvim /home/maxag/.nix-config/configuration/main/configuration.nix"; config = "nvim /home/maxag/.nix-config/configuration/${name}/configuration.nix";
cat = "bat -p -P"; cat = "bat -p -P";
nvim = "edit"; nvim = "edit";
nix-shell = "nix-shell --run nu"; nix-shell = "nix-shell --run nu";