Refactor with nixfmt

This commit is contained in:
2026-02-06 08:36:47 +01:00
parent fe643f065b
commit 82e4ea3c73
41 changed files with 1259 additions and 1112 deletions

View File

@@ -1,54 +1,63 @@
{ pkgs, lib, currentSystemDe, ... }:
{
services = {
xserver.enable = true;
xserver.excludePackages = with pkgs; [
xterm
];
pkgs,
lib,
currentSystemDe,
...
}:
{
services = {
xserver.enable = true;
xserver.excludePackages = with pkgs; [
xterm
];
# Display managers
displayManager = {
sddm = lib.mkIf (currentSystemDe == "plasma") {
enable = true;
wayland.enable = true;
};
gdm.enable = lib.mkIf (currentSystemDe == "gnome") true;
};
# Display managers
displayManager = {
sddm = lib.mkIf (currentSystemDe == "plasma") {
enable = true;
wayland.enable = true;
};
gdm.enable = lib.mkIf (currentSystemDe == "gnome") true;
};
# Desktop environments
desktopManager = {
plasma6.enable = lib.mkIf (currentSystemDe == "plasma") true;
gnome.enable = lib.mkIf (currentSystemDe == "gnome") true;
};
};
environment.plasma6.excludePackages = with pkgs.kdePackages; [
elisa
konsole
];
environment.gnome.excludePackages = with pkgs; [
epiphany
geary
gedit
gnome-characters
gnome-console
gnome-contacts
gnome-maps
gnome-music
gnome-software
gnome-tour
seahorse
simple-scan
xterm
yelp
];
# Desktop environments
desktopManager = {
plasma6.enable = lib.mkIf (currentSystemDe == "plasma") true;
gnome.enable = lib.mkIf (currentSystemDe == "gnome") true;
};
};
environment.plasma6.excludePackages = with pkgs.kdePackages; [
elisa
konsole
];
environment.gnome.excludePackages = with pkgs; [
epiphany
geary
gedit
gnome-characters
gnome-console
gnome-contacts
gnome-maps
gnome-music
gnome-software
gnome-tour
seahorse
simple-scan
xterm
yelp
];
xdg = {
autostart.enable = true;
portal.enable = true;
};
xdg = {
autostart.enable = true;
portal.enable = true;
};
programs.kdeconnect = lib.mkIf (currentSystemDe != "none") {
enable = true;
package = if (currentSystemDe == "gnome") then pkgs.gnomeExtensions.gsconnect else pkgs.kdePackages.kdeconnect-kde;
};
programs.kdeconnect = lib.mkIf (currentSystemDe != "none") {
enable = true;
package =
if (currentSystemDe == "gnome") then
pkgs.gnomeExtensions.gsconnect
else
pkgs.kdePackages.kdeconnect-kde;
};
}

View File

@@ -1,38 +1,49 @@
{ pkgs, currentSystemUser, currentSystemDe, ... }:
{
imports = [
./keyboard.nix
./security.nix
./services.nix
] ++ (if (currentSystemDe != "none") then [
./de.nix
./fonts.nix
./sound.nix
] else []);
pkgs,
currentSystemUser,
currentSystemDe,
...
}:
{
imports = [
./keyboard.nix
./security.nix
./services.nix
]
++ (
if (currentSystemDe != "none") then
[
./de.nix
./fonts.nix
./sound.nix
]
else
[ ]
);
time.timeZone = "Europe/Rome";
time.timeZone = "Europe/Rome";
# Select internationalisation properties.
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "it_IT.UTF-8";
LC_IDENTIFICATION = "it_IT.UTF-8";
LC_MEASUREMENT = "it_IT.UTF-8";
LC_MONETARY = "it_IT.UTF-8";
LC_NAME = "it_IT.UTF-8";
LC_NUMERIC = "it_IT.UTF-8";
LC_PAPER = "it_IT.UTF-8";
LC_TELEPHONE = "it_IT.UTF-8";
LC_TIME = "it_IT.UTF-8";
};
};
# Select internationalisation properties.
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "it_IT.UTF-8";
LC_IDENTIFICATION = "it_IT.UTF-8";
LC_MEASUREMENT = "it_IT.UTF-8";
LC_MONETARY = "it_IT.UTF-8";
LC_NAME = "it_IT.UTF-8";
LC_NUMERIC = "it_IT.UTF-8";
LC_PAPER = "it_IT.UTF-8";
LC_TELEPHONE = "it_IT.UTF-8";
LC_TIME = "it_IT.UTF-8";
};
};
environment.sessionVariables = {
NIXOS_OZONE_WL = "1"; # Use Wayland when possible (this does not seem to work)
ELECTRON_OZONE_PLATFORM_HINT = "wayland";
GOPATH = "$HOME/.go";
};
environment.sessionVariables = {
NIXOS_OZONE_WL = "1"; # Use Wayland when possible (this does not seem to work)
ELECTRON_OZONE_PLATFORM_HINT = "wayland";
GOPATH = "$HOME/.go";
};
programs.fish.enable = true; # This must be true before initializing my user
users.users.${currentSystemUser} = {
@@ -42,12 +53,15 @@
shell = pkgs.fish;
};
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nixpkgs.config.packageOverrides = pkgs: {
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/main.tar.gz") {
inherit pkgs;
};
};
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nixpkgs.config.packageOverrides = pkgs: {
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/main.tar.gz") {
inherit pkgs;
};
};
documentation.man.generateCaches = false;
documentation.man.generateCaches = false;
}

View File

@@ -1,7 +1,7 @@
{ pkgs, ... }:
{
fonts.packages = with pkgs; [
nerd-fonts.jetbrains-mono
noto-fonts
];
fonts.packages = with pkgs; [
nerd-fonts.jetbrains-mono
noto-fonts
];
}

View File

@@ -1,8 +1,8 @@
{ ... }:
{ ... }:
{
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
}

View File

@@ -1,7 +1,7 @@
{ ... }:
{
security.sudo.extraConfig = ''
Defaults pwfeedback
Defaults timestamp_timeout=120
'';
security.sudo.extraConfig = ''
Defaults pwfeedback
Defaults timestamp_timeout=120
'';
}

View File

@@ -1,7 +1,7 @@
{ ... }:
{
services = {
pcscd.enable = true;
nordvpn.enable = true;
};
{ ... }:
{
services = {
pcscd.enable = true;
nordvpn.enable = true;
};
}

View File

@@ -1,14 +1,14 @@
{ ... }:
{
# Enable sound with pipewire.
services = {
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
pulseaudio.enable = false;
};
security.rtkit.enable = true;
# Enable sound with pipewire.
services = {
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
pulseaudio.enable = false;
};
security.rtkit.enable = true;
}

View File

@@ -1,109 +1,148 @@
{ pkgs, gamingSystem, workSystem, currentSystemDe, ... }@ inputs:
{
imports = [
./programs
];
pkgs,
gamingSystem,
workSystem,
currentSystemDe,
...
}@inputs:
{
imports = [
./programs
];
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
# CLI utils
appimage-run
bat
btop
bun
busybox
distrobox
docker
dua
fd
fish
fzf
gh
git
gitlab-ci-local
gnumake
htop
inotify-tools
jq
just
killall
krabby
lazygit
nmap
nodejs
openssl
openvpn
pinentry-tty
python3
ripgrep
tree
unzip
wget
wl-clipboard
xdotool
xorg.xwininfo
yad
zip
zoxide
zulu
environment.systemPackages =
with pkgs;
[
# CLI utils
appimage-run
bat
btop
bun
busybox
distrobox
docker
dua
fd
fish
fzf
gh
git
gitlab-ci-local
gnumake
htop
inotify-tools
jq
just
killall
krabby
lazygit
nmap
nodejs
openssl
openvpn
pinentry-tty
python3
ripgrep
tree
unzip
wget
wl-clipboard
xdotool
xorg.xwininfo
yad
zip
zoxide
zulu
# Man pages
man-pages
# Man pages
man-pages
vim # The only and one great editor
inputs.nixvim.packages.${stdenv.hostPlatform.system}.default # The only and one great editor improved even further
] ++ (if currentSystemDe != "none" then [
# Video card
vulkan-tools
vim # The only and one great editor
inputs.nixvim.packages.${stdenv.hostPlatform.system}.default # The only and one great editor improved even further
]
++ (
if currentSystemDe != "none" then
[
# Video card
vulkan-tools
# GUI applications
baobab
bazaar
blackbox-terminal
firefox
fluffychat
gnome-boxes
mpv
nextcloud-client
piper
spotube
telegram-desktop
thunderbird
] else [])
++ (if gamingSystem then [
cura-appimage
discord
heroic
lutris
mangohud
openrgb
prismlauncher
protonplus
satisfactorymodmanager
] else [])
++ (if workSystem then [
android-studio
ansible
virt-manager
] else [])
++ (if currentSystemDe == "plasma" then [
kdePackages.wallpaper-engine-plugin
] else [])
++ (if currentSystemDe == "hyprland" then [
# Hyprland
brightnessctl
hyprpaper
pamixer
pavucontrol
kdePackages.dolphin
] else [])
++ (if currentSystemDe == "gnome" then [
gnome-tweaks
gnomeExtensions.appindicator
gnomeExtensions.caffeine
gnomeExtensions.dash-to-dock
gnomeExtensions.wallpaper-slideshow
] else []);
# GUI applications
baobab
bazaar
blackbox-terminal
firefox
fluffychat
gnome-boxes
mpv
nextcloud-client
piper
spotube
telegram-desktop
thunderbird
]
else
[ ]
)
++ (
if gamingSystem then
[
cura-appimage
discord
heroic
lutris
mangohud
openrgb
prismlauncher
protonplus
satisfactorymodmanager
]
else
[ ]
)
++ (
if workSystem then
[
android-studio
ansible
virt-manager
]
else
[ ]
)
++ (
if currentSystemDe == "plasma" then
[
kdePackages.wallpaper-engine-plugin
]
else
[ ]
)
++ (
if currentSystemDe == "hyprland" then
[
# Hyprland
brightnessctl
hyprpaper
pamixer
pavucontrol
kdePackages.dolphin
]
else
[ ]
)
++ (
if currentSystemDe == "gnome" then
[
gnome-tweaks
gnomeExtensions.appindicator
gnomeExtensions.caffeine
gnomeExtensions.dash-to-dock
gnomeExtensions.wallpaper-slideshow
]
else
[ ]
);
}

View File

@@ -1,27 +1,36 @@
{ pkgs, gamingSystem, currentSystemDe, ... }:
{
imports = [
./nordvpn.nix
];
pkgs,
gamingSystem,
currentSystemDe,
...
}:
{
imports = [
./nordvpn.nix
];
programs = {
gamescope = {
enable = true;
capSysNice = true;
};
steam = if gamingSystem then {
enable = true;
# package = pkgs.steam-millennium;
remotePlay.openFirewall = true;
} else {};
gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-tty;
enableSSHSupport = true;
};
nh = {
enable = true;
};
hyprland.enable = if currentSystemDe == "hyprland" then true else false;
};
programs = {
gamescope = {
enable = true;
capSysNice = true;
};
steam =
if gamingSystem then
{
enable = true;
# package = pkgs.steam-millennium;
remotePlay.openFirewall = true;
}
else
{ };
gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-tty;
enableSSHSupport = true;
};
nh = {
enable = true;
};
hyprland.enable = if currentSystemDe == "hyprland" then true else false;
};
}

View File

@@ -1,13 +1,13 @@
{ pkgs, ... } @ inputs:
{ pkgs, ... }@inputs:
{
imports = [
inputs.nur.modules.nixos.default
inputs.nur.legacyPackages.x86_64-linux.repos.wingej0.modules.nordvpn
];
imports = [
inputs.nur.modules.nixos.default
inputs.nur.legacyPackages.x86_64-linux.repos.wingej0.modules.nordvpn
];
nixpkgs.overlays = [
(_final: _prev: {
nordvpn = pkgs.nur.repos.wingej0.nordvpn;
})
];
nixpkgs.overlays = [
(_final: _prev: {
nordvpn = pkgs.nur.repos.wingej0.nordvpn;
})
];
}