First commit

This commit is contained in:
Lomig 2025-08-21 11:21:15 +02:00
parent 9532c89e63
commit ca0610b675
13 changed files with 597 additions and 40 deletions

11
apps/browser.nix Normal file
View file

@ -0,0 +1,11 @@
{ config, pkgs, ... }:
{
programs.floorp = {
enable = true ;
languagePacks = [ "fr" ] ;
};
programs.firefox = {
enable = true ;
languagePacks = [ "fr" ] ;
};
}

4
apps/gitea.nix Normal file
View file

@ -0,0 +1,4 @@
{ config, pkgs, ... }:
{
}

50
apps/picom.nix Normal file
View file

@ -0,0 +1,50 @@
{ config, pkgs, ... }:
{
services.picom = {
enable = true;
backend = "glx"; # plus fluide si ta carte gère bien OpenGL
fade = true;
fadeDelta = 5; # vitesse fondu
shadow = true;
shadowOpacity = 0.5;
vSync = true; # évite le tearing
settings = {
# Transparence
inactive-opacity = 0.80;
active-opacity = 0.9;
frame-opacity = 0.90;
inactive-opacity-override = false;
# Coins arrondis
corner-radius = 8;
round-borders = 1;
rounded-corners-exclude = [
"class_g = 'Polybar'"
"class_g = 'Rofi'"
];
# Flou subtil
blur-method = "dual_kawase";
blur-strength = 4;
blur-background = true;
blur-background-frame = true;
blur-background-fixed = false;
blur-background-exclude = [
"class_g = 'Polybar'"
"class_g = 'Rofi'"
"class_g = 'Gimp'"
"window_type = 'dock'"
];
# Exclusions ombres
shadow-exclude = [
"class_g = 'Polybar'"
"class_g = 'Rofi'"
"window_type = 'dock'"
"window_type = 'desktop'"
];
};
};
}

4
apps/template.nix Normal file
View file

@ -0,0 +1,4 @@
{ config, pkgs, ... }:
{
}

20
apps/zsh.nix Normal file
View file

@ -0,0 +1,20 @@
{ config, pkgs, ... }:
{
programs.zsh = {
enable = true ;
enableCompletion = true ;
history = {
append = true ;
extended = true ;
findNoDups = true ;
ignoreAllDups = true ;
ignoreSpace = true ;
ignorePatterns = [ "rm *" "cd *" "ls *" ] ;
saveNoDups = false ;
};
shellGlobalAliases = {
G = "| grep";
M = "| more";
};
};
}

View file

@ -1,32 +1,40 @@
{ {
description = "Mon système NixOS flake-enabled avec Home Manager"; description = "My nixos config with WM switch capacity";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = { self, nixpkgs, home-manager, ... }: outputs = { self, nixpkgs, home-manager, ... }:
let let
system = "x86_64-linux"; # Change si tas un ordi chelou system = "x86_64-linux";
in { pkgs = import nixpkgs {
nixosConfigurations = { inherit system;
pennsardin = nixpkgs.lib.nixosSystem { config.allowUnfree = true;
inherit system; };
modules = [
./hosts/pennsardin/configuration.nix
home-manager.nixosModules.home-manager in {
{ nixosConfigurations = {
home-manager.useUserPackages = true; pennsardin = nixpkgs.lib.nixosSystem {
home-manager.users.lomig = import ./home/pennsardin.nix; inherit system;
}
]; modules = [
}; ./hosts/pennsardin/configuration.nix
}; home-manager.nixosModules.home-manager
}; {
home-manager.useGlobalPkgs = true ;
# home-manager.useUserPackages = true;
home-manager.users.lomig = import ./user/lomig.nix ;
}
];
};
};
};
} }
# vim: set ts=2 sw=2 sts=2 et :

View file

@ -1,10 +0,0 @@
{ config, pkgs, ... }:
{
home.username = "lomig";
home.homeDirectory = "/home/lomig";
programs.zsh.enable = true;
home.stateVersion = "25.05"; # ou ton actuelle
}

View file

@ -0,0 +1,102 @@
# modules/alerts/sms.nix
{ config, pkgs, lib, ... }:
{
# services.xserver.enable = true;
services.xserver.xkb.extraLayouts.bepovim = {
description = "Clavier Bepovim 4 niveaux";
languages = [ "fr" ];
# IMPORTANT: c'est `symbolsFile`, pas `symbols`.
symbolsFile = builtins.toFile "bepovim.xkb" ''
xkb_symbols "basic" {
name[Group1] = "Bepovim";
key <ESC> { [ Escape ] };
key <AE01> { [ dollar, numbersign ] };
key <AE02> { [ less, 1, guillemotleft ] };
key <AE03> { [ greater, 2, guillemotright ] };
key <AE04> { [ parenleft, 3, bracketleft ] };
key <AE05> { [ parenright, 4, bracketright ] };
key <AE06> { [ at, 5, braceleft ] };
key <AE07> { [ plus, 6, braceright ] };
key <AE08> { [ minus, 7, asciitilde ] };
key <AE09> { [ asterisk, 8 ] };
key <AE10> { [ slash, 9, backslash ] };
key <AE11> { [ quotedbl, 0 ] };
key <AE12> { [ equal, ampersand ] };
key <BKSP> { [ BackSpace ] };
key <TAB> { [ Tab, ISO_Left_Tab ] };
key <AD01> { [ b, B ] };
key <AD02> { [ eacute, Eacute ] };
key <AD03> { [ p, P ] };
key <AD04> { [ o, O ] };
key <AD05> { [ r, R ] };
key <AD06> { [ dead_circumflex, grave ] };
key <AD07> { [ v, V ] };
key <AD08> { [ s, S ] };
key <AD09> { [ t, T ] };
key <AD10> { [ d, D ] };
key <AD11> { [ egrave, Egrave ] };
key <AD12> { [ ccedilla, Ccedilla ] };
key <RTRN> { [ Return ] };
key <AC01> { [ c, C ] };
key <AC02> { [ a, A ] };
key <AC03> { [ u, U ] };
key <AC04> { [ i, I ] };
key <AC05> { [ e, E, EuroSign ] };
key <AC06> { [ period, question ] };
key <AC07> { [ n, N ] };
key <AC08> { [ h, H, Left ] };
key <AC09> { [ j, J, Down ] };
key <AC10> { [ k, K, Up ] };
key <AC11> { [ l, L, Right ] };
key <AC12> { [ m, M ] };
key <LFSH> { [ Shift_L ] };
key <LSGT> { [ q, Q ] };
key <AB01> { [ w, W ] };
key <AB02> { [ agrave, Agrave ] };
key <AB03> { [ f, F ] };
key <AB04> { [ colon, bar ] };
key <AB05> { [ comma, semicolon ] };
key <AB06> { [ apostrophe, exclam ] };
key <AB07> { [ x, X ] };
key <AB08> { [ g, G ] };
key <AB09> { [ z, Z ] };
key <AB10> { [ y, Y ] };
key <DELE> { [ Up ] };
key <DOWN> { [ Left ] };
key <RGHT> { [ Down ] };
key <INS> { [ Right ] };
key <LCTL> { [ Control_L ] };
key <LALT> { [ Alt_L ] };
key <SPCE> { [ space, underscore, nobreakspace, U202F ] };
key <RALT> { [ ISO_Level3_Shift ] };
key <FK02> { [ F1, F1 ] };
key <FK03> { [ F2, F2 ] };
key <FK04> { [ F3, F3 ] };
key <FK05> { [ F4, F4 ] };
key <FK06> { [ F5, F5 ] };
key <FK07> { [ F6, F6 ] };
key <FK08> { [ F7, F7 ] };
key <FK09> { [ F8, F8 ]};
key <FK10> { [ F9, F9 ] };
key <FK11> { [ F10, F10 ] };
key <FK12> { [ F11, F11 ] };
};
'';
};
services.xserver.xkb.layout = "bepovim";
services.xserver.xkb.variant = "basic";
services.xserver.xkb.options = "lv3:ralt_switch";
console.useXkbConfig = true;
}

View file

@ -1,15 +1,137 @@
{ config, pkgs, ... }: { config, pkgs, lib, desktop, ... }:
{ {
imports = [
./raid.nix
./bepovim.nix
../../wm/bspwm.nix
];
nix.settings.experimental-features = ["nix-command" "flakes" ];
boot.initrd.kernelModules = [];
boot.kernelModules = [ "amdgpu" "kvm-amd" ];
boot.extraModulePackages = [];
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = [
"mem_sleep_default=deep"
"amdgpu.si_support=0"
"amdgpu.cik_support=0"
"radeon.si_support=0"
"radeon.cik_support=0"
];
fileSystems."/" = {
device = "/dev/disk/by-uuid/b4e3577b-17ab-4a89-9aeb-4e223be4c75b"; # à adapter si tu as un autre label/disque
fsType = "ext4"; # ou btrfs, xfs, ce que t'as utilisé
};
swapDevices = [] ;
boot.plymouth.enable = true ;
boot.loader.timeout = 5;
boot.loader.systemd-boot.enable = true ;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot";
boot.tmp.cleanOnBoot = true ;
systemd.coredump.enable = false ;
services.journald.extraConfig = ''
SystemMaxUse=200M
RuntimeMaxUse=100M
'';
hardware.firmware = with pkgs ; [ linux-firmware ];
hardware.enableRedistributableFirmware = true;
hardware.graphics = {
enable = true ;
extraPackages = with pkgs ; [
mesa libva libva-utils libvdpau libva-vdpau-driver vaapiVdpau libvdpau-va-gl amdvlk vulkan-tools vulkan-loader vulkan-validation-layers
];
enable32Bit = true ;
};
environment.variables = {
LIBVA_DRIVER_NAME = "radeonsi";
VDPAU_DRIVER = "va_gl";
};
hardware.bluetooth.enable = true ;
environment.etc."pam.d/i3lock".text = ''
auth include login
account include login
password include login
session include login
'';
services.blueman.enable = true ;
services.xserver.enable = true ;
services.xserver.videoDrivers = [ "amdgpu" ];
services.logind.extraConfig = ''
IdleAction=suspend
IdleActionSec=5min
HandleLidSwitch=suspend
HandleLidSwitchDocked=ignore
'';
networking.hostName = "pennsardin"; networking.hostName = "pennsardin";
time.timeZone = "Europe/Paris"; time.timeZone = "Europe/Paris";
# Select internationalisation properties.
i18n.defaultLocale = "fr_FR.UTF-8";
users.users.toto = { i18n.extraLocaleSettings = {
LC_ADDRESS = "fr_FR.UTF-8";
LC_IDENTIFICATION = "fr_FR.UTF-8";
LC_MEASUREMENT = "fr_FR.UTF-8";
LC_MONETARY = "fr_FR.UTF-8";
LC_NAME = "fr_FR.UTF-8";
LC_NUMERIC = "fr_FR.UTF-8";
LC_PAPER = "fr_FR.UTF-8";
LC_TELEPHONE = "fr_FR.UTF-8";
LC_TIME = "fr_FR.UTF-8";
};
services.printing.enable = true ;
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
environment.systemPackages = with pkgs; [
# i3lock
btrfs-progs
evtest
gdu
git
glances
lm_sensors
neovim
snapper
tmux
xorg.xev
xorg.xkbcomp
];
programs.steam.enable = true ;
hardware.xpadneo.enable = true ;
programs.zsh.enable = true;
users.users.lomig = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" ]; extraGroups = [ "networkmanager" "lp" "wheel" ];
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
services.xserver.enable = true; nixpkgs.config = {
allowUnfree = true;
allowUnsupportedSystem = true ;
};
system.stateVersion = "25.05"; # pour éviter les hurlements inutiles
} }

54
hosts/pennsardin/raid.nix Normal file
View file

@ -0,0 +1,54 @@
# modules/alerts/sms.nix
{ config, pkgs, lib, ... }:
let
user = "21782061"; # Ton identifiant Free
pass = "PEmCOQLKMEdMW9"; # Ta clé
in
{
environment.systemPackages = with pkgs; [ curl ];
environment.etc."mdadm-raid-wrapper.sh".text = ''
systemctl start raid-alert-sms.service
'';
boot.swraid = {
enable = true ;
mdadmConf = ''
MAILADDR guillaume.lame@protonmail.com
PROGRAM /etc/mdadm-raid-wrapper.sh
ARRAY /dev/md/raid-home UUID=cad7faf8:93cab941:ba745379:becc1918
'';
};
fileSystems."/mnt/raid" = {
device = "/dev/md/raid-home" ;
fsType = "btrfs" ;
options = ["compress=zstd" "noatime" "nofail" "x-systemd.device-timeout=5"];
};
# systemd.services.raid-alert-sms = {
# description = "Envoie un SMS si RAID pète";
# wantedBy = [ "multi-user.target" ];
# serviceConfig = {
# Type = "oneshot";
# ExecStart = ''
# ${pkgs.curl}/bin/curl -s \
# "https://smsapi.free-mobile.fr/sendmsg?user=${user}&pass=${pass}&msg=TON+RAID+EST+MORT+FUIS"
# '';
# };
# };
# systemd.services.mdadm-monitor = {
# description = "RAID monitoring";
# wantedBy = [ "multi-user.target" ];
# after = [ "network.target" ];
# serviceConfig = {
# ExecStart = "${pkgs.mdadm}/bin/mdadm --monitor --scan --daemonize --program=/etc/mdadm-raid-wrapper.sh";
# Restart = "always";
# RestartSec = "5s";
# Type = "forking";
# };
# };
}

22
user/lomig.nix Normal file
View file

@ -0,0 +1,22 @@
{ config, pkgs, lib, desktop, ... }:
{
imports = [
../apps/browser.nix
../apps/picom.nix
../apps/zsh.nix
];
home.username = "lomig";
home.homeDirectory = "/home/lomig";
home.packages = with pkgs; [
bat
nerd-fonts.iosevka
telegram-desktop
tree
fastfetch
];
programs.zsh.enable = true;
home.stateVersion = "25.05"; # ou ton actuelle
}

159
wm/bspwm.nix Normal file
View file

@ -0,0 +1,159 @@
{ config, pkgs, ... }:
{
services.xserver = {
enable = true ;
displayManager.lightdm.enable = true ;
windowManager.bspwm.enable = true ;
};
home-manager.users.lomig = { pkgs, ... }: {
home.packages = with pkgs; [
bspwm sxhkd xorg.xinit xterm
alacritty rofi feh font-awesome
picom xorg.xset xidlehook betterlockscreen
pywal16 imagemagick
];
xsession.enable = true ;
xsession.initExtra = ''
xset s 300 300
xset s on
xsession s noblank
xset +dpms
xset dpms 0 0 500
'';
systemd.user.services.xidlehook = {
Unit.Description = "Idle actions (lock at 1m, suspend at 5m)";
Service = {
ExecStart = ''
${pkgs.xidlehook}/bin/xidlehook \
--detect-sleep \
--not-when-fullscreen \
--timer 300 "${pkgs.betterlockscreen}/bin/betterlockscreen -l dim" "" \
--timer 500 "systemctl suspend" ""
'';
Restart = "always";
};
Install.WantedBy = [ "graphical-session.target" ];
};
xsession.windowManager.bspwm = {
enable = true ;
startupPrograms = [
"killall polybar"
"setxkbmap bepovim"
"sxhkd -m 1"
"xrandr \\
--output DisplayPort-1 --rate 60 --pos 0x0"
"while pgrep -x polybar >/dev/null; do sleep 0.2; done"
"polybar"
"bash ~/.fehbg"
];
extraConfig = ''
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config single_monocle true
bspc monitor -d I II III IV V VI
'';
};
services.sxhkd = {
enable = true ;
extraOptions = [ "-m 1" ] ;
keybindings = {
"super + Return" = "alacritty";
"super + c" = "bspc node -c";
"Menu" = "rofi -show drun";
"super + space" = "rofi -show drun";
# Aller au bureau ^1 .. ^6
"F1" = "bspc desktop -f ^1";
"F2" = "bspc desktop -f ^2";
"F3" = "bspc desktop -f ^3";
"F4" = "bspc desktop -f ^4";
"F5" = "bspc desktop -f ^5";
"F6" = "bspc desktop -f ^6";
# Déplacer la fenetre courante vers le bureau cible et suivre
"shift + F1" = "bspc node -d ^1 --follow";
"shift + F2" = "bspc node -d ^2 --follow";
"shift + F3" = "bspc node -d ^3 --follow";
"shift + F4" = "bspc node -d ^4 --follow";
"shift + F5" = "bspc node -d ^5 --follow";
"shift + F6" = "bspc node -d ^6 --follow";
# Focus dans un meme bureau
"super + h" = "bspc node -f west";
"super + j" = "bspc node -f south";
"super + k" = "bspc node -f north";
"super + l" = "bspc node -f east";
# Swap la fenetre dans le bureau
"super + shift + h" = "bspc node -s west";
"super + shift + j" = "bspc node -s south";
"super + shift + k" = "bspc node -s north";
"super + shift + l" = "bspc node -s east";
};
};
services.polybar = {
enable = true ;
script = "polybar main &";
config = {
"bar/main" = {
width = "100%";
height = "28";
background = "\\\${colors.background}";
foreground = "\\\${colors.foreground}";
font-0 = "Iosevka Nerd Font:size=10;2";
font-1 = "Font Awesome 6 Free:style=Solid:pixelsize=10;2";
modules-left = "bspwm";
modules-center = "date";
modules-right = "pulseaudio memory cpu";
};
"module/bspwm" = {
type = "internal/bspwm";
label-focused = "%name%";
label-focused-background = "\\\${colors.primary}";
label-focused-foreground = "#e6e0de";
label-focused-padding = 2;
label-occupied = "%name%";
label-occupied-padding = 2;
label-urgent = "%name%";
label-urgent-background = "#e42127";
label-urgent-foreground = "#ffffff";
label-empty = "%name%";
label-empty-foreground = "#645d56";
label-empty-padding = 2;
};
"module/date" = {
type = "internal/date";
interval = 60;
date = "%d-%m-%Y %H:%M";
};
};
};
programs.alacritty.enable = true ;
programs.alacritty.settings = {
general.import = [
"~/.cache/wal/colors-alacritty.toml"
];
font = {
normal = { family = "Iosevka Nerd Font"; style = "Regular"; };
bold = { family = "Iosevka Nerd Font"; style = "Bold"; };
italic = { family = "Iosevka Nerd Font"; style = "Italic"; };
size = 9;
};
};
programs.floorp = {
enable = true ;
languagePacks = [ "fr" ] ;
};
};
}
# vim: set ts=2 sw=2 sts=2 et :

11
wm/gnome.nix Normal file
View file

@ -0,0 +1,11 @@
{ config, pkgs, ... }:
{
services = {
displayManager.gdm = {
enable = true ;
};
desktopManager.gnome.enable = true ;
};
}
# vim: set ts=2 sw=2 sts=2 et :