Factorised some nix expressions because I had some time to spare, started adding a new host

This commit is contained in:
Alexandre1a 2026-01-14 22:10:18 +01:00
parent a6c0ba30dc
commit 9fddd3f4c8
No known key found for this signature in database
GPG Key ID: CE01C28FBC5EEF10
21 changed files with 348 additions and 232 deletions

View File

@ -28,12 +28,9 @@
home = {
packages = with pkgs; [
# CLI
btop
hello
fastfetch
yt-dlp
syncthing # ToDo: configure it ig
cmatrix
spicetify-cli
# Dev CLI
doxygen
@ -41,9 +38,6 @@
pkg-config
swig
pandoc
gh
fzf
eza
# GUI apps
vscode
@ -70,6 +64,7 @@
python312 # The main interpreter
#pip # The package manager
];
shellAliases = {
drs = "sudo darwin-rebuild switch --flake ~/Developer/nix/NixOSDots#macOS";
nrs = "sudo nixos-rebuild switch --flake ~/Developer/nix/NixOSDots#nixos";

View File

@ -1,6 +1,10 @@
{
# Common nixos systems modules (not nix-darwin)
imports = [
../../modules/common/nix.nix
../../modules/nixos/locale.nix
../../modules/nixos/locale.nix # For localisation options
../../modules/common/ssh.nix
../../modules/nixos/bootloader.nix
../../modules/common/environment.nix
];
}

View File

@ -4,4 +4,41 @@
./modules.nix
];
networking = {
hostName = "light";
};
# Users
# Don't forget to add a password or change the username
users = {
users = {
light = { # Here
isNormalUser = true;
# You can change the description too !
description = "A lightweight system for lowend or performance machines"
shell = pkgs.zsh;
extraGroups = [ "networkmanager" "wheel" ];
};
};
};
# Home-Manager config
home-manager = {
extraSpecialArgs = { inherit inputs };
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "HM-backup";
users = {
# Change this to your username
"light" = import ./home.nix";
};
};
environment = {
systemPackages = with pkgs; [
wget
git
];
};
}

View File

@ -13,32 +13,21 @@
environment = {
systemPackages = with pkgs;
[
# Basic text editing for all users
neovim
vim
# General tools
btop
eza
fastfetch
ffmpeg
fzf
git
git-lfs
gnupg
wget
tree
netcat
tmux
#telnet
];
pathsToLink = [ "/share/zsh" ];
};
# Create the user
users.users.alex = {
users = {
users = {
alex = {
description = "Alexandre Delcamp--Enache";
home = "/Users/alex";
shell = pkgs.zsh;
};
};
};
# HomeManager
home-manager = {
extraSpecialArgs = { inherit inputs; };
@ -61,14 +50,18 @@
};
# Enable required settings
# TouchID login
security.pam.services.sudo_local.touchIdAuth = true;
security = {
pam = {
services = {
sudo_local = {
touchIdAuth = true;
};
};
};
};
# Target arch
nixpkgs = {
hostPlatform = "aarch64-darwin";
config = {
allowUnfree = true;
};
};
# Nix-Darwin State Version
system = {

View File

@ -6,14 +6,14 @@
../common/home.nix
];
home.stateVersion = "25.11";
# Allow unfree packages
#nixpkgs.config.allowUnfree = true;
home.packages = with pkgs; [
home = {
packages = with pkgs; [
# Window management (maybe configure it with home-manager)
yabai
skhd
#borders
];
stateVersion = "25.11";
};
}

View File

@ -3,7 +3,7 @@
{
# Enpty file for future imports
imports = [
../common/modules.nix
../../modules/common/nix.nix
../../modules/macos/ollama.nix
../../modules/common/ai.nix
];

View File

@ -11,11 +11,12 @@
./modules.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "nixos"; # Define your hostname.
networking = {
hostName = "nixos"; # Define your hostname.
networkmanager = {
enable = true; # Enables wireless connectivity
};
};
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
@ -47,11 +48,11 @@
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.alex = {
users = {
users = {
alex = {
isNormalUser = true;
description = "Alexandre Delcamp--Enache";
shell = pkgs.zsh;
@ -59,6 +60,8 @@
packages = with pkgs; [
];
};
};
};
home-manager = {
extraSpecialArgs = { inherit inputs; };
@ -83,23 +86,11 @@
enableAutosuggestions = true;
};
};
# Hint Electron Apps to use Wayland
environment = {
sessionVariables.NIXOS_OZONE_WL = "1";
pathsToLink = [ "/share/zsh" ];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
git
tree
kitty
neovim
environment = {
systemPackages = with pkgs; [
playerctl
# Nvidia packages
@ -113,6 +104,10 @@
# Theme SDDM
sddm-astronaut
];
# Hint Electron Apps to use Wayland
sessionVariables.NIXOS_OZONE_WL = "1";
pathsToLink = [ "/share/zsh" ];
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.

View File

@ -8,10 +8,14 @@
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot = {
initrd = {
availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
kernelModules = [ ];
};
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/09ecff70-45e5-48b4-baed-00534605fc04";
@ -30,10 +34,20 @@
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
networking ={
useDHCP = lib.mkDefault true;
};
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
nixpkgs = {
hostPlatform = lib.mkDefault "x86_64-linux";
};
hardware = {
cpu = {
intel = {
updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
};
};
};
}

View File

@ -14,11 +14,10 @@
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "25.11"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
home = {
stateVersion = "25.11"; # Please read the comment before changing.
packages = with pkgs; [
# # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run.
@ -28,8 +27,10 @@
firefox
cava
# File manager
kdePackages.dolphin
kdePackages.gwenview
kdePackages = [
dolphin
gwenview
]
# Hypr* ecosystem
hyprlauncher
@ -46,10 +47,9 @@
# echo "Hello, ${config.home.username}!"
# '')
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
@ -61,6 +61,12 @@
# org.gradle.daemon.idletimeout=3600000
# '';
};
sessionVariables = {
EDITOR = "vim";
};
};
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. These will be explicitly sourced when using a
@ -78,7 +84,4 @@
#
# /etc/profiles/per-user/alex/etc/profile.d/hm-session-vars.sh
#
home.sessionVariables = {
# EDITOR = "emacs";
};
}

View File

@ -7,11 +7,9 @@
inputs.sops-nix.nixosModules.sops
../../modules/nixos/secrets.nix # Sops
# ../../modules/nixos/wireless.nix # For the wifi
../../modules/nixos/locale.nix # For localisation options
../../modules/nixos/gamming/nvidia.nix # Nvidia (Drivers and Settings)
../../modules/nixos/gamming/steam.nix # For Steam/Proton/Lutris/MangoHUD/Heroic/Bottles
../../modules/common/spotify.nix # Spotify/Spicetify
../../modules/common/ssh.nix
../../modules/common/spotify.nix # Spotify
../../modules/common/ai.nix
];
}

View File

@ -0,0 +1,24 @@
{ pkgs, ... }:
{
environment = {
systemPackages = with pkgs; [
# Text editors
neovim
vim
# Sytem utilities
wget
git
tree
btop
eza
fastfetch
ffmpeg
fzf
netcat
tmux
gnupg
cmatrix
gh
];
}
}

View File

@ -25,4 +25,10 @@
];
};
};
nixpkgs = {
config = {
allowUnfree = true;
};
};
}

View File

@ -2,13 +2,19 @@
{
# Installs Spotify and Spicetify (import this module in configuration.nix)
environment.systemPackages = with pkgs; [
environment = {
systemPackages = with pkgs; [
spotify
];
};
networking = {
firewall = {
# Local discovery
networking.firewall.allowedTCPPorts = [ 57621 ];
allowedTCPPorts = [ 57621 ];
# Spotify Connect
networking.firewall.allowedUDPPorts = [ 5353 ];
allowedUDPPorts = [ 5353 ];
};
};
}

View File

@ -1,10 +1,12 @@
{
# The OpenSSH agent
programs.ssh = {
programs = {
ssh = {
startAgent = true;
extraConfig = ''
Host github.com
IdentityFile ~/.ssh/github
'';
};
};
}

View File

@ -1,7 +1,8 @@
{ pkgs, ... }:
{
programs.zsh = {
programs = {
zsh = {
enable = true;
package = pkgs.zsh;
enableCompletion = true;
@ -42,4 +43,5 @@
];
};
};
};
}

View File

@ -0,0 +1,12 @@
{
boot = {
loader = {
systemd-boot = {
enable = true;
};
efi = {
canTouchEfiVariables = true;
};
};
};
}

View File

@ -22,17 +22,20 @@
kernelParams = [
"nvidia-drm.modset=1" # DRM modesetting
];
initrd.kernelModules = [
initrd = {
kernelModules = [
"nvidia"
"nvidia_modeset"
"nvidia_uvm"
"nvidia_drm"
];
};
kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ];
};
# Environment variables
environment.sessionVariables = {
environment ={
sessionVariables = {
# Backend GBM for NVIDIA
GBM_BACKEND = "nvidia-drm";
@ -49,7 +52,12 @@
# Native Wayland Electron Apps
NIXOS_OZONE_WL = "1";
};
};
# Nvidia Drivers
services.xserver.videoDrivers = [ "nvidia" ];
services = {
xserver = {
videoDrivers = [ "nvidia" ];
};
};
}

View File

@ -15,17 +15,21 @@
};
# Proton GE
environment.sessionVariables = {
environment = {
sessionVariables = {
STEAM_EXTRA_COMPAT_TOOLS_PATHS =
"/home/alex/.steam/root/compatibilitytools.d";
};
};
# Programmes requis
environment.systemPackages = with pkgs; [
environment = {
systemPackages = with pkgs; [
mangohud
protonup-ng
lutris
heroic
bottles
];
};
}

View File

@ -19,12 +19,17 @@
};
# Keymap in X11
services.xserver.xkb = {
services = {
xserver = {
xkb = {
layout = "fr";
#variant = "fr";
};
};
};
# Keymap in the console
console.keyMap = "fr";
console = {
keyMap = "fr";
};
}

View File

@ -5,6 +5,8 @@
defaultSopsFile = ../../secrets/secrets.yaml;
defaultSopsFormat = "yaml";
age.keyFile = "${config.home-manager.users.alex.home.homeDirectory}/.config/sops/age/keys.txt";
age = {
keyFile = "${config.home-manager.users.alex.home.homeDirectory}/.config/sops/age/keys.txt";
};
};
}

View File

@ -1,15 +1,21 @@
{ config, ... }:
{
sops.secrets."wireless/freebox-password" = {
sops = {
secrets = {
"wireless/freebox-password" = {
owner = "root";
group = "root";
mode = "0400";
};
};
};
networking.wireless.networks = {
networking = {
wireless.networks = {
Freebox-357429 = {
pskRaw = "ext:${config.sops.secrets."wireless/freebox-password".path}";
};
};
};
}