diff --git a/configurations/loki/default.nix b/configurations/loki/default.nix index 8d8bfd6..5f9c17d 100644 --- a/configurations/loki/default.nix +++ b/configurations/loki/default.nix @@ -74,7 +74,6 @@ # -- Additionnal packages -- environment.systemPackages = with pkgs; [ git # VCS - zed-editor ]; # -- Users -- diff --git a/configurations/njord/_homebrew.nix b/configurations/njord/_homebrew.nix index 16e8f27..07fa772 100644 --- a/configurations/njord/_homebrew.nix +++ b/configurations/njord/_homebrew.nix @@ -12,6 +12,7 @@ "amethyst" # Window manager "bluestacks" # Android game emulator "discord" # Discord client - used instead of the nix one for krisp + "logitech-g-hub" "protonvpn" # VPN "figma" # Collaborative design application "gpg-suite-no-mail" # Signing tool for commits diff --git a/configurations/njord/default.nix b/configurations/njord/default.nix index 0536e35..67fe7bb 100644 --- a/configurations/njord/default.nix +++ b/configurations/njord/default.nix @@ -44,46 +44,14 @@ environment.systemPackages = with pkgs; [ alt-tab-macos # alt tab like windows on macos bat # Replacement for the `cat` cmd - bruno # IDE for API - chirp # Radio programming tool - ghostty-bin # Terminal emulator - helix # TUI code editor - git # VCS - jujutsu # VCS - lazygit # Git TUI - obsidian # Note editor - ollama # LLM on local computer - podman # container tool -> replacement of docker - podman-compose # compose provider for podman prismlauncher # Minecraft launcher starship # Customizable shell prompt stats # System monitoring displayed in macos top bar zoxide # Faster replacement of the `cd` cmd - nerd-fonts.hack - librewolf # Browser ]; - # -- Environment variables -- - environment.variables = { - EDITOR = "zed"; - }; - - # -- Local LLM -- - launchd.user.agents.ollama = { - serviceConfig = { - ProgramArguments = [ - "${pkgs.ollama}/bin/ollama" - "serve" - ]; - RunAtLoad = true; - KeepAlive = true; - StandardOutPath = "/tmp/ollama.log"; - StandardErrorPath = "/tmp/ollama.log"; - }; - }; - # -- Nix -- nixpkgs.config.allowUnfree = true; nixpkgs.overlays = [ inputs.self.overlays.unstable ]; diff --git a/flake.lock b/flake.lock index 454b888..80b01f9 100644 --- a/flake.lock +++ b/flake.lock @@ -39,10 +39,29 @@ "type": "github" } }, - "nixos-hardware": { + "home-manager": { "inputs": { "nixpkgs": "nixpkgs" }, + "locked": { + "lastModified": 1783740085, + "narHash": "sha256-qajyHfZY29G2oEQk+uHxmsJcRoBUBXP9maTpFlwP/dI=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "3cd22efe6471dc7365c822bd9ad73a21e55f38fb", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-26.05", + "repo": "home-manager", + "type": "github" + } + }, + "nixos-hardware": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, "locked": { "lastModified": 1783792734, "narHash": "sha256-50rvY9GdFvpYDcMLcD/4cWSi0hVxArT5wsGlVsHy8eY=", @@ -60,15 +79,18 @@ }, "nixpkgs": { "locked": { - "lastModified": 1767892417, - "narHash": "sha256-8bW3q88CEg2u4hSP66Vf4lpbLonHz7hqDNBMcCY7E9U=", - "rev": "3497aa5c9457a9d88d71fa93a4a8368816fbeeba", - "type": "tarball", - "url": "https://releases.nixos.org/nixos/unstable/nixos-26.05pre924538.3497aa5c9457/nixexprs.tar.xz" + "lastModified": 1783549019, + "narHash": "sha256-0XnckG4ZhBmAsYa9mLuEIFowBG0fDGPLHduQGsbMS4A=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "74cc63f702f7d60a557e152a57b40fb1fd0f72ac", + "type": "github" }, "original": { - "type": "tarball", - "url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz" + "owner": "NixOS", + "ref": "nixos-26.05", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs-darwin": { @@ -119,6 +141,19 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1767892417, + "narHash": "sha256-8bW3q88CEg2u4hSP66Vf4lpbLonHz7hqDNBMcCY7E9U=", + "rev": "3497aa5c9457a9d88d71fa93a4a8368816fbeeba", + "type": "tarball", + "url": "https://releases.nixos.org/nixos/unstable/nixos-26.05pre924538.3497aa5c9457/nixexprs.tar.xz" + }, + "original": { + "type": "tarball", + "url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1783703440, "narHash": "sha256-O3/YajjWo001VUIgD8BwaRdSNLUFe7nZ1qV5TwhRBcw=", @@ -138,8 +173,9 @@ "inputs": { "darwin": "darwin", "flake-parts": "flake-parts", + "home-manager": "home-manager", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "nixpkgs-darwin": "nixpkgs-darwin", "nixpkgs-unstable": "nixpkgs-unstable" } diff --git a/flake.nix b/flake.nix index 472a247..d6a240f 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,9 @@ darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-26.05"; darwin.inputs.nixpkgs.follows= "nixpkgs-darwin"; + # Home manage - Used only in a standalone mode + home-manager.url = "github:nix-community/home-manager/release-26.05"; + # Flake helper flake-parts.url = "github:hercules-ci/flake-parts"; @@ -18,12 +21,14 @@ nixos-hardware.url = "github:NixOS/nixos-hardware/master"; }; - outputs = inputs@{ flake-parts, nixpkgs, ... }: + outputs = inputs@{ flake-parts, nixpkgs, home-manager, ... }: let import-tree = import ./lib/import-tree.nix { inherit (nixpkgs) lib; }; in flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; - imports = import-tree ./.; + imports = [ + home-manager.flakeModules.home-manager + ] ++ import-tree ./.; }; } diff --git a/users/cosmeak/default.nix b/users/cosmeak/default.nix new file mode 100644 index 0000000..335ec09 --- /dev/null +++ b/users/cosmeak/default.nix @@ -0,0 +1,139 @@ +{ inputs, ... }: +{ + flake.homeModules.cosmeak = { pkgs, ... }: { + home.username = "cosmeak"; + home.homeDirectory = if pkgs.stdenv.isDarwin then "/Users/cosmeak" else "/home/cosmeak"; + + programs.gpg = { + enable = true; + }; + + programs.git = { + enable = true; + ignores = [ + ".DS_STORE" + "result/" + ]; + settings = { + user = { + name = "cosmeak"; + email = "guillaume.fine@cosmeak.dev"; + }; + push.autoSetupRemote = true; + pull.rebase = true; + commit.gpgsign = true; + alias = { + change-commits = "!f() { VAR=$1; OLD=$2; NEW=$3; shift 3; git filter-branch --env-filter \"if [[ \\\"$`echo $VAR`\\\" = '$OLD' ]]; then export $VAR='$NEW'; fi\" $@; }; f"; + }; + }; + }; + + programs.lazygit = { + enable = true; + enableZshIntegration = true; + }; + + programs.jujutsu = { + enable = true; + }; + + programs.ghostty = { + enable = true; + enableZshIntegration = true; + package = if pkgs.stdenv.isDarwin then pkgs.ghostty-bin else pkgs.ghostty; + settings = { + theme = "dark:Gruvbox Dark,light:Gruvbox Light"; + }; + }; + + programs.helix = { + enable = true; + }; + + programs.zed-editor = { + enable = true; + defaultEditor = true; + extensions = [ + "colored-zed-icons-theme" + "html" + "just" + "mermaid" + "nix" + "php" + "sql" + "twig" + "zig" + ]; + userSettings = { + cli_default_open_behavior = "existing_window"; + agent = { + default_profile = "ask"; + default_model = { + provider = "ollama"; + model = "qwen3.5:9b"; + enable_thinking = true; + }; + }; + icon_theme = { + mode = "system"; + light = "Gruvbox Light"; + dark = "Gruvbox Dark"; + }; + ui_font_size = 16; + buffer_font_size = 13; + languages = { + Nix.language_servers = [ "nixd" ]; + }; + minimap = { + show = "never"; + }; + }; + }; + + programs.obsidian = { + enable = true; + }; + + services.ollama = { + enable = true; + }; + + services.podman = { + enable = true; + }; + + home.packages = with pkgs; [ + bruno # IDE for API + chirp # Radio programming tool + nh # Nix CLI helper for nixos, nix-darwin and home-manager + podman-compose # compose provider for podman + ]; + + nixpkgs.config.allowUnfree = true; + + programs.home-manager.enable = true; + # This value determines the home Manager release that your + # configuration is compatible with. This helps avoid breakage + # when a new home Manager release introduces backwards + # incompatible changes. + # + # You can update home Manager without changing this value. See + # the home Manager release notes for a list of state version + # changes in each release. + home.stateVersion = "26.05"; + }; + + flake.homeConfigurations."cosmeak@loki" = inputs.home-manager.lib.homeManagerConfiguration { + pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; + modules = [ + inputs.self.homeModules.cosmeak + ]; + }; + + flake.homeConfigurations."cosmeak@njord" = inputs.home-manager.lib.homeManagerConfiguration { + pkgs = import inputs.nixpkgs-darwin { system = "aarch64-darwin"; }; + modules = [ + inputs.self.homeModules.cosmeak + ]; + }; +}