From 2112cca57f8ed09f1aaec9ef384b1eefe611704f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20H=C3=A9mono?= Date: Mon, 22 Sep 2025 09:50:29 +0200 Subject: [PATCH] Finish migration to home-manager --- homes/me/default.nix | 130 ++++++++++++++++++++++++++++++++++ hosts/gwiad/configuration.nix | 61 +--------------- hosts/gwiad/home.nix | 25 +++++++ 3 files changed, 156 insertions(+), 60 deletions(-) create mode 100644 homes/me/default.nix create mode 100644 hosts/gwiad/home.nix diff --git a/homes/me/default.nix b/homes/me/default.nix new file mode 100644 index 0000000..56e8f4a --- /dev/null +++ b/homes/me/default.nix @@ -0,0 +1,130 @@ +{ config, pkgs, ... }: + +{ + + home.stateVersion = "25.05"; # Please read the comment before changing. + + programs.bash.enable = true; + + programs.fish = { + enable = true; + }; + + programs.git = { + enable = true; + userName = "Julien Hémono"; + userEmail = "julien@hemono.fr"; + }; + + programs.jujutsu = { + enable = true; + settings = { + user = { + email = "julien@hemono.fr"; + name = "Julien Hémono"; + }; + ui.default-command = "log"; + }; + }; + + programs.gh = { + enable = true; + }; + + programs.helix = { + enable = true; + defaultEditor = true; + }; + + programs.uv.enable = true; + + programs.firefox = { + enable = true; + nativeMessagingHosts = with pkgs; [ passff-host ]; + }; + + programs.browserpass.enable = true; + + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = with pkgs; let + tex = texlive.combine { + inherit (texlive) + scheme-basic + moderncv + fontawesome5 + pgf # For tikz.sty + multirow + arydshln; + }; + my-vscode = vscode-with-extensions.override { + vscodeExtensions = with vscode-marketplace; [ + ms-python.python + ms-python.vscode-pylance + ms-python.debugpy + ms-python.black-formatter + ms-python.isort + ms-vscode-remote.remote-containers + github.copilot + github.copilot-chat + dbaeumer.vscode-eslint + ]; + }; + in [ + chromium + docker-compose + drawing + hunspell + hunspellDicts.fr-classique + # inkscape + libreoffice-fresh + my-vscode + # nixfmt + pass-wayland + pwgen + # scribus + tex + + # General development + # dbeaver-bin + devenv + # poetry + pre-commit + # nodejs + ]; + + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.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. + # ".screenrc".source = dotfiles/screenrc; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; + + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. These will be explicitly sourced when using a + # shell provided by Home Manager. If you don't want to manage your shell + # through Home Manager then you have to manually source 'hm-session-vars.sh' + # located at either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/julien/etc/profile.d/hm-session-vars.sh + # + home.sessionVariables = { + }; + +} diff --git a/hosts/gwiad/configuration.nix b/hosts/gwiad/configuration.nix index 8606f64..02e00dd 100644 --- a/hosts/gwiad/configuration.nix +++ b/hosts/gwiad/configuration.nix @@ -8,6 +8,7 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ./home.nix # Services ./btrbk.nix ./syncthing.nix @@ -41,64 +42,10 @@ ]; }; - # User account - users.users.jhemono = { - isNormalUser = true; - uid = 1000; - extraGroups = [ "wheel" ]; # Enable 'sudo' for the user. - packages = with pkgs; let - tex = texlive.combine { - inherit (texlive) - scheme-basic - moderncv - fontawesome5 - pgf # For tikz.sty - multirow - arydshln; - }; - my-vscode = vscode-with-extensions.override { - vscodeExtensions = with vscode-marketplace; [ - ms-python.python - ms-python.vscode-pylance - ms-python.debugpy - ms-python.black-formatter - ms-python.isort - ms-vscode-remote.remote-containers - github.copilot - github.copilot-chat - dbaeumer.vscode-eslint - ]; - }; - in [ - chromium - docker-compose - drawing - hunspell - hunspellDicts.fr-classique - # inkscape - libreoffice-fresh - my-vscode - # nixfmt - pass-wayland - pwgen - # scribus - tex - - # General development - # dbeaver-bin - # poetry - pre-commit - # nodejs - uv - ]; - }; - users.groups.jhemono.gid = 1000; - # System packages environment.systemPackages = with pkgs; [ android-tools bc - devenv git htop jq @@ -111,12 +58,6 @@ zip ]; - programs.firefox = { - enable = true; - nativeMessagingHosts.packages = with pkgs; [ passff-host ]; - }; - programs.browserpass.enable = true; - virtualisation.docker.rootless = { enable = true; setSocketVariable = true; diff --git a/hosts/gwiad/home.nix b/hosts/gwiad/home.nix new file mode 100644 index 0000000..ca921ef --- /dev/null +++ b/hosts/gwiad/home.nix @@ -0,0 +1,25 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, inputs, outputs, ... }: + +{ + imports = [ + inputs.home-manager.nixosModules.home-manager + ]; + + users.users.jhemono = { + isNormalUser = true; + uid = 1000; + extraGroups = [ "wheel" ]; # Enable 'sudo' for the user. + }; + users.groups.jhemono.gid = 1000; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "bak"; + users.jhemono = ../../homes/me; + }; +}