feat: full refactoring - work in progress...
This commit is contained in:
9
modules/nixos/archetypes/default.nix
Normal file
9
modules/nixos/archetypes/default.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./general.nix
|
||||
];
|
||||
}
|
||||
63
modules/nixos/archetypes/general.nix
Normal file
63
modules/nixos/archetypes/general.nix
Normal 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";
|
||||
};
|
||||
}
|
||||
@@ -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
27
modules/nixos/default.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
9
modules/nixos/features/default.nix
Normal file
9
modules/nixos/features/default.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./stylix.nix
|
||||
];
|
||||
}
|
||||
0
modules/nixos/features/gaming.nix
Normal file
0
modules/nixos/features/gaming.nix
Normal file
46
modules/nixos/features/stylix.nix
Normal file
46
modules/nixos/features/stylix.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
0
modules/nixos/features/virtualisation.nix
Normal file
0
modules/nixos/features/virtualisation.nix
Normal file
67
modules/nixos/home-manager.nix
Normal file
67
modules/nixos/home-manager.nix
Normal 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);
|
||||
};
|
||||
}
|
||||
@@ -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
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user