feat: full refactoring - work in progress...

This commit is contained in:
Xavier Morel
2025-07-23 16:49:52 +02:00
parent 66f7edf9a3
commit 85fdab6375
38 changed files with 726 additions and 774 deletions

View File

@@ -0,0 +1,11 @@
{
...
}:
{
imports = [
./desktop-apps.nix
./myhypr.nix
./shell.nix
./work-apps.nix
];
}

View File

@@ -0,0 +1,20 @@
{
config,
lib,
pkgs,
...
}:
{
options.myHome.bundle.desktop-apps.enable = lib.mkEnableOption "enable desktop-apps bundle";
config = lib.mkIf config.myHome.bundle.desktop-apps.enable {
myHome.programs.kitty.enable = true;
home.packages = map lib.lowPrio [
pkgs.bottles
pkgs.ungoogled-chromium
pkgs.xfce.thunar
pkgs.xfce.thunar-archive-plugin
pkgs.xfce.thunar-volman
pkgs.vial
];
};
}

View File

@@ -0,0 +1,19 @@
{
config,
lib,
pkgs,
...
}:
{
options.myHome.bundle.myhypr.enable = lib.mkEnableOption "enable hypr bundle";
config = lib.mkIf config.myHome.bundle.myhypr.enable {
myHome.services.hyprland.enable = true;
myHome.services.waybar.enable = true;
home.packages = map lib.lowPrio [
pkgs.mako
pkgs.swayidle
pkgs.swaylock
pkgs.swaybg
];
};
}

View File

@@ -0,0 +1,79 @@
{
pkgs,
lib,
config,
...
}:
{
options.myHome.bundle.shell.enable = lib.mkEnableOption "enable shell bundle";
config = lib.mkIf config.myHome.bundle.shell.enable {
home.packages = with pkgs; [
commitizen
pre-commit
curl
devenv
git
just
killall
lazyjj
neofetch
p7zip
ripgrep
tree
typst
unrar
unzip
wget
yt-dlp
];
programs = {
awscli.enable = true;
bat = {
enable = true;
extraPackages = [ pkgs.bat-extras.batman ];
};
btop = {
enable = true;
settings.vim_keys = true;
};
direnv.enable = true;
eza = {
enable = true;
extraOptions = [ "--group-directories-first" ];
git = true;
icons = "auto";
};
nix-your-shell = {
enable = true;
enableFishIntegration = true;
};
fish = {
enable = true;
shellAliases = {
ls = "eza";
cat = "bat";
l = "eza -lh";
ll = "eza -lh";
la = "eza -lah";
man = "batman";
".." = "cd ..";
};
interactiveShellInit = ''
fish_vi_key_bindings
'';
};
starship = {
enable = true;
enableFishIntegration = true;
};
fzf.enable = true;
gh.enable = true;
gpg.enable = true;
jujutsu.enable = true;
lazygit.enable = true;
ripgrep.enable = true;
yazi.enable = true;
};
};
}

View File

@@ -0,0 +1,16 @@
{
config,
lib,
pkgs,
...
}:
{
options.myHome.bundle.work-apps.enable = lib.mkEnableOption "enable work-apps bundle";
config = lib.mkIf config.myHome.bundle.work-apps.enable {
home.packages = map lib.lowPrio [
pkgs.tailscale-systray
pkgs.slack
pkgs.openvpn
];
};
}

View File

@@ -0,0 +1,15 @@
{
...
}:
{
imports = [
./bundles
./programs
./services
# ./dotfiles.nix
# ./helix.nix
# ./kitty.nix
# ./shell.nix
];
}

View File

@@ -0,0 +1,10 @@
{
...
}:
{
imports = [
./helix.nix
./kitty.nix
./nvim.nix
];
}

View File

View File

@@ -3,15 +3,9 @@
config,
...
}:
let
cfg = config.myHome.helix;
in
{
options = {
myHome.helix.enable = lib.mkEnableOption "enables helix";
};
config = lib.mkIf cfg.enable {
options.myHome.programs.helix.enable = lib.mkEnableOption "enables helix";
config = lib.mkIf config.myHome.programs.helix.enable {
programs.helix = {
enable = true;
defaultEditor = true;

View File

@@ -3,15 +3,10 @@
config,
...
}:
let
cfg = config.myHome.kitty;
in
{
options = {
myHome.kitty.enable = lib.mkEnableOption "enables kitty";
};
options.myHome.programs.kitty.enable = lib.mkEnableOption "enables kitty";
config = lib.mkIf cfg.enable {
config = lib.mkIf config.myHome.programs.kitty.enable {
programs.kitty = lib.mkForce {
enable = true;
keybindings = {

View File

@@ -0,0 +1,29 @@
{
lib,
config,
pkgs,
...
}:
{
options.myHome.programs.nvim.enable = lib.mkEnableOption "enables neovim";
config = lib.mkIf config.myHome.programs.nvim.enable {
home.packages = with pkgs; [
lua
lua52Packages.luarocks
ghostscript
tectonic
mermaid-cli
lazygit
];
programs.neovim = {
enable = true;
vimAlias = true;
viAlias = true;
};
home.file.".config/nvim" = {
source = ../../../dotfiles/nvim;
recursive = true;
};
};
}

View File

@@ -0,0 +1,10 @@
{
...
}:
{
imports = [
./hyprland.nix
./nix.nix
./waybar.nix
];
}

View File

@@ -0,0 +1,51 @@
{
pkgs,
lib,
config,
...
}:
{
options.myNixOS.feature.hyprland.enable = lib.mkEnableOption "enables hyprland";
config = lib.mkIf config.myNixOS.feature.hyprland.enable {
home.file.".config/hypr" = {
source = ../../../dotfiles/hypr;
recursive = true;
};
programs = {
dconf.enable = true;
hyprland.enable = true;
};
environment.systemPackages = with pkgs; [
libnotify
xclip
wl-clipboard
hyprpaper
libnotify
hyprpicker
slurp
grim
rofi
];
services = {
picom.enable = true;
xserver.enable = true;
};
xdg.portal = {
enable = true;
wlr.enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal
];
configPackages = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-hyprland
pkgs.xdg-desktop-portal
];
};
};
}

View File

@@ -0,0 +1,42 @@
{
inputs,
config,
lib,
pkgs,
...
}:
{
options.myHome.services.nix.enable = lib.mkEnableOption "enable nix configuration";
config = lib.mkIf config.myHome.services.nix.enable {
home.sessionVariables = {
FLAKE = "${config.home.homeDirectory}/nixos/";
NH_FLAKE = "${config.home.homeDirectory}/nixos/";
};
systemPackages = map lib.lowPrio [
pkgs.nh
pkgs.nil
pkgs.nixfmt-rfc-style
];
nix = {
settings = {
auto-optimise-store = true;
experimental-features = [
"nix-command"
"flakes"
];
trusted-users = [
"root"
];
};
gc = {
automatic = true;
# dates = "weekly";
};
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
extraOptions = ''
extra-substituters = https://devenv.cachix.org
extra-trusted-public-keys = devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=
'';
};
};
}

View File

@@ -8,11 +8,9 @@ let
betterTransition = "all 0.3s cubic-bezier(.55,-0.68,.48,1.682)";
in
{
options = {
myHome.waybar.enable = lib.mkEnableOption "enables waybar";
};
options.myHome.services.waybar.enable = lib.mkEnableOption "enables waybar";
config = lib.mkIf config.myHome.waybar.enable {
config = lib.mkIf config.myHome.services.waybar.enable {
services.swaync = {
enable = true;
package = pkgs.swaynotificationcenter;
@@ -30,10 +28,6 @@ in
programs.waybar = {
enable = true;
package = pkgs.waybar;
# systemd = {
# enable = false;
# target = "graphical-session.target";
# };
settings = [
{
layer = "top";

View File

@@ -1,41 +0,0 @@
{
pkgs,
lib,
config,
...
}:
{
options = {
myHome.shell.enable = lib.mkEnableOption "enables shell stuff";
};
config = lib.mkIf config.myHome.shell.enable {
home.packages = with pkgs; [
aoc-cli
just
neofetch
typst
];
programs.direnv = {
enable = true;
};
programs.nix-your-shell = {
enable = true;
enableFishIntegration = true;
};
programs.starship = {
enable = true;
enableFishIntegration = true;
};
programs.fish = {
enable = true;
shellAliases = {
ls = "eza --icons";
cat = "bat";
ll = "eza -lh --icons --grid --group-directories-first";
la = "eza -lah --icons --grid --group-directories-first";
".." = "cd ..";
};
};
};
}

View File

@@ -0,0 +1,9 @@
{
inputs,
...
}:
{
imports = [
./general.nix
];
}

View File

@@ -0,0 +1,63 @@
{
pkgs,
lib,
config,
inputs,
...
}:
{
options.myNixOS.archetype.general.enable = lib.mkEnableOption "enable general archetype";
config = lib.mkIf config.myNixOS.archetype.general.enable {
myNixOS.features.stylix.enable = true;
environment.systemPackages = [
pkgs.openssl
pkgs.coreutils
];
hardware = {
graphics.enable = true;
bluetooth.enable = true;
bluetooth.powerOnBoot = true;
};
i18n = {
defaultLocale = "fr_FR.UTF-8";
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";
};
};
networking.networkmanager.enable = true;
security.rtkit.enable = true;
services = {
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
blueman.enable = true;
openssh.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
printing.enable = true;
udev.packages = with pkgs; [
vial
];
xserver.enable = true;
};
time.timeZone = "Europe/Paris";
};
}

View File

@@ -17,28 +17,10 @@ in
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
vim
wget
killall
htop
p7zip
unzip
unrar
helix
direnv
git
bat
tree
imv
eza
fzf
appimage-run
nh
openssl
nixfmt-rfc-style
nil
ripgrep
coreutils
fd
clang
];

27
modules/nixos/default.nix Normal file
View File

@@ -0,0 +1,27 @@
{
inputs,
...
}:
{
imports = [
inputs.stylix.nixosModules.stylix
inputs.home-manager.nixosModules.home-manager
inputs.determinate.nixosModules.default
./archetypes
./features
./home-manager.nix
# ./desktop-apps.nix
# ./fonts.nix
# ./gaming.nix
];
config = {
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nixpkgs.config.allowUnfree = true;
};
}

View File

@@ -1,47 +0,0 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.services.dev-environment;
in
{
imports = [ ];
options.services.dev-environment = {
enable = mkEnableOption "enable dev-environment";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
# docker
# docker-compose
git
gh
jujutsu
lazyjj # jjui
commitizen
pre-commit
devenv
# cargo
# rustup
python312
lua
lua52Packages.luarocks
ghostscript
tectonic
mermaid-cli
lazygit
];
programs = {
neovim = {
enable = true;
vimAlias = true;
viAlias = true;
};
};
};
}

View File

@@ -0,0 +1,9 @@
{
inputs,
...
}:
{
imports = [
./stylix.nix
];
}

View File

View File

@@ -0,0 +1,46 @@
{
pkgs,
lib,
config,
...
}:
{
options.myNixOS.features.stylix.enable = lib.mkEnableOption "enable Stylix";
config = lib.mkIf config.myNixOS.features.stylix.enable {
stylix = {
enable = true;
image = ../../../wall.jpg;
polarity = "dark";
opacity.terminal = 0.9;
cursor.package = pkgs.bibata-cursors;
cursor.name = "Bibata-Modern-Ice";
cursor.size = 24;
fonts = {
monospace = {
package = pkgs.nerd-fonts.jetbrains-mono;
name = "JetBrainsMono Nerd Font Mono";
};
sansSerif = {
package = pkgs.montserrat;
name = "Montserrat";
};
serif = {
package = pkgs.montserrat;
name = "Montserrat";
};
sizes = {
applications = 12;
terminal = 12;
desktop = 11;
popups = 12;
};
};
targets = {
chromium.enable = true;
grub.enable = true;
grub.useImage = true;
plymouth.enable = true;
};
};
};
}

View File

@@ -0,0 +1,67 @@
{
lib,
config,
inputs,
outputs,
myLib,
pkgs,
...
}:
let
cfg = config.myNixOS;
in
{
options.myNixOS.home-users = lib.mkOption {
type = lib.types.attrsOf (
lib.types.submodule {
options = {
userConfig = lib.mkOption {
default = ./../../hosts/home/home.nix;
};
userNixosSettings = lib.mkOption {
default = { };
};
};
}
);
default = { };
};
config = {
programs.fish.enable = true;
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs;
inherit myLib;
outputs = inputs.self.outputs;
};
users = builtins.mapAttrs (
name: user:
{ ... }:
{
imports = [
(import user.userConfig)
outputs.homeManagerModules.default
];
}
) (config.myNixOS.home-users);
};
users.users = builtins.mapAttrs (
name: user:
{
isNormalUser = true;
initialPassword = "toto";
description = "";
shell = pkgs.fish;
extraGroups = [
"networkmanager"
"wheel"
"docker"
"lp"
];
}
// user.userNixosSettings
) (config.myNixOS.home-users);
};
}

View File

@@ -1,70 +0,0 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.services.window-manager;
in
{
imports = [ ];
options.services.window-manager = {
enable = mkEnableOption "enable window-manager";
};
config = mkIf cfg.enable {
# services.displayManager.defaultSession = "none+i3";
services.xserver = {
enable = true;
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
# dmenu
i3lock
i3status
];
};
};
services.picom.enable = true;
programs.dconf.enable = true;
programs.hyprland.enable = true;
programs.hyprlock.enable = true;
security.pam.services.hyprlock = { };
environment.systemPackages = with pkgs; [
# wofi
kdePackages.dolphin
waybar
pavucontrol
libnotify
xclip
wl-clipboard
hyprpaper
libnotify
hyprpicker
slurp
grim
swappy
swww
file-roller
rofi
];
xdg.portal = {
enable = true;
wlr.enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal
];
configPackages = [
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal-hyprland
pkgs.xdg-desktop-portal
];
};
};
}