Refactoring the config

This commit is contained in:
Lyes Saadi 2024-11-10 18:06:07 +01:00
parent 9c3fc1879c
commit 0e866b1cb0
No known key found for this signature in database
GPG key ID: 17418538BAA17767
24 changed files with 355 additions and 304 deletions

32
users/lyes/default.nix Normal file
View file

@ -0,0 +1,32 @@
{ pkgs, home-manager, ... }:
{
imports =
[
./packages.nix
home-manager.nixosModules.default
];
users.users.lyes = {
description = "Lyes Saadi";
home = "/home/lyes";
isNormalUser = true;
initialHashedPassword = ""; # Set for vms and initial installations
extraGroups = [ "wheel" "networkmanager" ];
shell = pkgs.fish;
};
home-manager.useUserPackages = true;
home-manager.useGlobalPkgs = true;
home-manager.users.lyes = { pkgs, ... }: {
imports =
[
./home.nix
];
home.username = "lyes";
home.homeDirectory = "/home/lyes";
home.stateVersion = "22.11";
};
}

30
users/lyes/home.nix Normal file
View file

@ -0,0 +1,30 @@
{ ... }:
{
# Git config
programs.git = {
enable = true;
userName = "Lyes Saadi";
userEmail = "dev@lyes.eu";
signing = {
key = "17418538BAA17767";
signByDefault = true;
};
extraConfig = {
color.ui = true;
init.defaultBranch = "main";
includeIf = {
"gitdir:~/Documents/fedpkg/" = {
path = "~/Documents/fedpkg/.gitconfig_include";
};
};
push.followTags = true;
};
};
# Protonup config
home.sessionVariables = {
STEAM_EXTRA_COMPAT_TOOLS_PATHS =
"\${HOME}/.steam/root/compatibilitytools.d";
};
}

32
users/lyes/packages.nix Normal file
View file

@ -0,0 +1,32 @@
{ pkgs, nixpkgs-unstable, lib, config, ... }:
{
# Packages
users.users.lyes.packages = with pkgs; [
# Commandline
starship
wl-clipboard
sl
# Programming
git
git-lfs
vscode
unstable.zed-editor
gcc
rustup
python3
ocaml
ocamlPackages.ocaml-lsp
ocamlPackages.ocamlformat
opam
ledit
nodejs
nil
# Containers & VMs
toolbox
distrobox
gnome.gnome-boxes
];
}