From b2fc383405d131b96613dd64f2aac97d7bbc9db8 Mon Sep 17 00:00:00 2001 From: cosmeak Date: Sun, 30 Aug 2026 11:47:45 +0200 Subject: [PATCH] feat(njord): remove home-manager in favor of hjem --- configurations/njord/_homebrew.nix | 3 - configurations/njord/default.nix | 1 + configurations/sunna/default.nix | 122 ----------------- devshells/default.nix | 3 +- flake.lock | 88 +++++++++---- flake.nix | 5 +- modules/flatpak.nix | 2 +- users/cosmeak/default.nix | 205 ++++++++++++----------------- 8 files changed, 145 insertions(+), 284 deletions(-) delete mode 100644 configurations/sunna/default.nix diff --git a/configurations/njord/_homebrew.nix b/configurations/njord/_homebrew.nix index 07fa772..01265da 100644 --- a/configurations/njord/_homebrew.nix +++ b/configurations/njord/_homebrew.nix @@ -10,13 +10,10 @@ homebrew.casks = [ "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 "spotify" # Music player - "zed" # GUI Code editor ]; } diff --git a/configurations/njord/default.nix b/configurations/njord/default.nix index 67fe7bb..5057842 100644 --- a/configurations/njord/default.nix +++ b/configurations/njord/default.nix @@ -8,6 +8,7 @@ ./_dock.nix ./_homebrew.nix ./_NSGlobalDomain.nix + inputs.self.hjemModules.cosmeak ]; # Enable sudo via TouchID diff --git a/configurations/sunna/default.nix b/configurations/sunna/default.nix deleted file mode 100644 index bce09e2..0000000 --- a/configurations/sunna/default.nix +++ /dev/null @@ -1,122 +0,0 @@ -{ inputs, ... }: -{ - flake.nixosModules.sunna = - { - pkgs, - config, - lib, - ... - }: - { - # TODO: switch to facter - imports = [ /etc/nixos/hardware-configuration.nix ]; - - # -- Bootloader -- - boot.loader.efi.canTouchEfiVariables = true; - boot.loader.systemd-boot.enable = true; - boot.loader.systemd-boot.configurationLimit = 5; - boot.loader.timeout = 0; - - # -- Graphics / NVIDIA -- - hardware.graphics.enable = true; - hardware.nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.latest; - open = false; - nvidiaSettings = true; - powerManagement = { - enable = true; - finegrained = lib.mkForce false; - }; - prime.offload = { - enable = true; - enableOffloadCmd = true; - nvidiaBusId = "PCI:1:0:0"; - intelBusId = "PCI:0:2:0"; - }; - }; - - # -- Desktop -- - services.displayManager.sddm.enable = true; - services.displayManager.sddm.wayland.enable = true; - services.desktopManager.plasma6.enable = true; - services.displayManager.autoLogin.enable = true; - services.displayManager.autoLogin.user = "neoxa"; - - # Try to make plasma the most barebone possible - environment.plasma6.excludePackages = with pkgs; [ - kdePackages.konsole - kdePackages.khelpcenter - kdePackages.kate - kdePackages.spectacle - kdePackages.ktexteditor - kdePackages.kmahjongg - kdePackages.kmines - kdePackages.konversation - kdePackages.kpat - kdePackages.ksudoku - kdePackages.ktorrent - ]; - - # -- Localization -- - time.timeZone = "Europe/Paris"; - - # -- Keyboard -- - i18n.defaultLocale = "fr_FR.UTF-8"; - services.xserver.xkb.layout = "fr"; - - # -- Networking -- - networking.networkmanager.enable = true; - networking.hostName = "sunna"; - - # -- Steam / gaming -- - hardware.graphics.enable32Bit = true; - programs.steam.enable = true; - programs.steam.gamescopeSession.enable = true; - programs.gamescope.enable = true; - - # -- Browser -- - programs.firefox.enable = true; - programs.firefox.package = pkgs.librewolf; - - # -- Additionnal packages -- - environment.systemPackages = with pkgs; [ - blender # 3D modeling - davinci-resolve # Video editing - gale # Thunderstore mod manager - ghostty # Terminal Emulator - heroic # GOG and Epic game launcher - prismlauncher # Minecraft launcher - spotify # Music player - unityhub # Game engine and editor - vesktop # Discord client - zed-editor # Code editor - ]; - programs.git.enable = true; # VCS - - # -- Users -- - users.users.neoxa = { - isNormalUser = true; - extraGroups = [ - "wheel" - "networkmanager" - ]; - }; - - # -- Nix / Nixos -- - nixpkgs.config.allowUnfree = true; - nix.settings.auto-optimise-store = true; - nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 1w"; - }; - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - system.stateVersion = "26.05"; - }; - - flake.nixosConfigurations = inputs.nixpkgs.lib.nixosSystem { - }; -} diff --git a/devshells/default.nix b/devshells/default.nix index 621eb7f..18a7a2d 100644 --- a/devshells/default.nix +++ b/devshells/default.nix @@ -8,10 +8,9 @@ devShells.default = pkgs.mkShell { packages = with pkgs; [ deadnix # Dead code linter - nh # Nix CLI helper nixd # Language server just # CMD helper - statix # Lints and suggestions + # statix # Lints and suggestions - Currently broken for darwin ]; }; }; diff --git a/flake.lock b/flake.lock index d060aeb..a45701f 100644 --- a/flake.lock +++ b/flake.lock @@ -39,28 +39,44 @@ "type": "github" } }, - "home-manager": { + "hjem": { "inputs": { "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1787377438, - "narHash": "sha256-Sxu1NLTD/Ern6hFGLlZmtKCSct3YQXZI/lls8RE1XeM=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "65258d5c65a250189fde2e35f490d15e064c4c62", + "lastModified": 1787500880, + "narHash": "sha256-UrAlku7KST0DT+j1bdVGYI8tCz23PWL88uGMer3IZ2U=", + "owner": "feel-co", + "repo": "hjem", + "rev": "d248f0e4f7abd6e1f0eb9ace778dd7928481943e", "type": "github" }, "original": { + "owner": "feel-co", + "repo": "hjem", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1787797243, + "narHash": "sha256-8+Q7NOB7RPajRjA4pbCDLzqH+MTjnG9x6LUPLfL2joA=", "owner": "nix-community", - "ref": "release-26.05", "repo": "home-manager", + "rev": "99c9ec63390f1d8c14d95d9e8b17cc29cfbd4e11", "type": "github" + }, + "original": { + "id": "home-manager", + "type": "indirect" } }, "nixos-hardware": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1787144466, @@ -79,27 +95,24 @@ }, "nixpkgs": { "locked": { - "lastModified": 1787204541, - "narHash": "sha256-OURZPknrTjQrlNyxPdqzyqmU/81Wes1CUP/Ft1Rv/YI=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "5880666fd9eb563038431edb35c2d0aa595884e6", - "type": "github" + "lastModified": 1785454630, + "narHash": "sha256-Lr/ImHlbXabw7KPWfXWY4kkiiHb24PkmBZVVIm28V/c=", + "rev": "1559d3daa3ecc813a650b79375ea61b6741b8746", + "type": "tarball", + "url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1044798.1559d3daa3ec/nixexprs.tar.xz?lastModified=1785454630&rev=1559d3daa3ecc813a650b79375ea61b6741b8746" }, "original": { - "owner": "NixOS", - "ref": "nixos-26.05", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz" } }, "nixpkgs-darwin": { "locked": { - "lastModified": 1787323337, - "narHash": "sha256-PqomwlB2WugM9MC4tV1L2/yosMOfug3KBDjmqOqD1bU=", + "lastModified": 1787866200, + "narHash": "sha256-5+H0XN+maMdJGuYB3GW7voz0RQXJkaVEVn4hBBo4uo4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6062ba1a1b8b6281b12533c9075a2dbeb38f7e49", + "rev": "df024a6a9638a914a3d0c19b6ee386034b8913fb", "type": "github" }, "original": { @@ -126,11 +139,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1787424095, - "narHash": "sha256-dWLO5AHhKaw6rdWCtTes8hnntT1r0/J5yhQGm0f0ZgU=", + "lastModified": 1787814960, + "narHash": "sha256-PYZq1qzCJXC2zGI0mH07vrZBsw6DRBAOX0jN1pPtqOQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "174eb786fb68e3a13e4e535a3deea479a0c07a6a", + "rev": "c27cdad491a991b11ed731760aa2ef8db0cb0410", "type": "github" }, "original": { @@ -141,6 +154,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1787209939, + "narHash": "sha256-WvvHR4kSQLAbtouMC/ruZ5UpLwlUcY3K4FAllMN+yGk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "391b592eb44808b3bd0cb80bb71b63a5a118b8bb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1767892417, "narHash": "sha256-8bW3q88CEg2u4hSP66Vf4lpbLonHz7hqDNBMcCY7E9U=", @@ -153,13 +182,13 @@ "url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { - "lastModified": 1787525875, - "narHash": "sha256-sKbMlkDCBVmAjUVT94LwhVtET/YEMtZaFdn5UduWxz8=", + "lastModified": 1787753485, + "narHash": "sha256-BZWCi9ZRJiARTuKTbbtvFTj7t1TK4G3UEckT3HyNfRg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a3b98866eecd08edac6e61a3081e69540a35020f", + "rev": "062346a6d85bc4b49dfaa61c986e9c5be21217d1", "type": "github" }, "original": { @@ -173,9 +202,10 @@ "inputs": { "darwin": "darwin", "flake-parts": "flake-parts", + "hjem": "hjem", "home-manager": "home-manager", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "nixpkgs-darwin": "nixpkgs-darwin", "nixpkgs-unstable": "nixpkgs-unstable" } diff --git a/flake.nix b/flake.nix index e359db6..8926b91 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,4 @@ { - # description = "Asgard — a Nordic stronghold for declarative computing."; - inputs = { # Packages and Nixos modules nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05"; @@ -12,7 +10,7 @@ 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"; + hjem.url = "github:feel-co/hjem"; # Flake helper flake-parts.url = "github:hercules-ci/flake-parts"; @@ -28,7 +26,6 @@ flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; imports = [ - home-manager.flakeModules.home-manager ] ++ import-tree { path = ./.; include = [ "default\\.nix" ]; diff --git a/modules/flatpak.nix b/modules/flatpak.nix index d154aef..a1e17bb 100644 --- a/modules/flatpak.nix +++ b/modules/flatpak.nix @@ -1,7 +1,7 @@ { ... }: { flake.nixosModules.flatpak = { pkgs, ... }: { - # Used to install discord (with krisp and screensharing) and fluxer. + # Used to install discord (with krisp and screensharing), fluxer and PokeMMO. services.flatpak.enable = true; system.activationScripts.flathub = { text = "${pkgs.flatpak}/bin/flatpak remote-add --if-not-exists --system flathub https://dl.flathub.org/repo/flathub.flatpakrepo"; diff --git a/users/cosmeak/default.nix b/users/cosmeak/default.nix index df10fee..84ed781 100644 --- a/users/cosmeak/default.nix +++ b/users/cosmeak/default.nix @@ -1,141 +1,100 @@ { inputs, ... }: { - flake.homeModules.cosmeak = { pkgs, ... }: { - home.username = "cosmeak"; - home.homeDirectory = if pkgs.stdenv.isDarwin then "/Users/cosmeak" else "/home/cosmeak"; + flake.hjemModules.cosmeak = { pkgs, lib, ... }: { + imports = [ inputs.hjem.darwinModules.default ]; - programs.gpg = { - enable = true; - }; + hjem.users.cosmeak = { + user = "cosmeak"; + directory = "/Users/cosmeak"; + # Overwrite already existing files when present + clobberFiles = true; - programs.git = { - enable = true; - ignores = [ - ".DS_STORE" - "result/" + packages = with pkgs; [ + bruno # TUI APIs IDE + chirp # Radio programming tool + dbeaver-bin # SQL CLient + ghostty-bin # Terminal emulator + gnupg # Signing key + helix # TUI code editor + jujutsu # VSC - a better git + lazygit # TUI git helper + obsidian # Note taking + ollama # Local LLMs + podman-compose # compose provider for podman + podman-desktop # GUI podman manager + starship # + zed-editor # GUI code editor ]; - 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; - }; + files = { + # Zed Editor + ".config/zed/settings.json" = { + generator = lib.generators.toJSON {}; + value = { + # Extensions + "auto_install_extensions" = { + "colored-zed-icons-theme" = true; + "html" = true; + "just" = true; + "mermaid" = true; + "nix" = true; + "php" = true; + "sql" = true; + "twig" = true; + "zig" = true; + "monokai-pro-ce" = 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"; - }; - }; + # UI + "buffer_font_size" = 13; + "ui_font_size" = 16; - 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"; - }; - }; - }; + "soft_wrap" = "preferred_line_length"; - programs.obsidian = { - enable = true; - }; + "theme" = "Monokai Pro (CE)"; + "icon_theme" = "Colored Zed Icons Theme Dark"; - # services.ollama = { - # enable = true; - # }; + "minimap" = { + "show" = "never"; + } ; - services.podman = { - enable = true; - }; + "project_panel" = { + "auto_fold_dirs" = false; + "dock" = "right"; + }; - home.packages = with pkgs; [ - bruno # IDE for API - chirp # Radio programming tool - dbeaver-bin # SQL CLient - nh # Nix CLI helper for nixos, nix-darwin and home-manager - podman-compose # compose provider for podman - podman-desktop # GUI podman manager - ]; + # AI Agents + "agent" = { + "default_model" = { + "provider" = "ollama"; + "model" = "qwen3-coder:30b"; + }; - nixpkgs.config.allowUnfree = true; + "model_parameters" = { + "temperature" = 0.2; + "top_p" = 0.9; + }; - 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"; - }; + "inline_assistant_model" = { + "provider" = "ollama"; + "model" = "qwen3-coder:7b"; + }; + }; - flake.homeConfigurations."cosmeak@loki" = inputs.home-manager.lib.homeManagerConfiguration { - pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; - modules = [ - inputs.self.homeModules.cosmeak - ]; - }; + "edit_prediction_provider" = "zed"; + "edit_prediction" = { + "mode" = "subtle"; + }; - flake.homeConfigurations."cosmeak@njord" = inputs.home-manager.lib.homeManagerConfiguration { - pkgs = import inputs.nixpkgs-darwin { system = "aarch64-darwin"; }; - modules = [ - inputs.self.homeModules.cosmeak - ]; + # Language settings + "languages" = { + "Nix" = { + "language_servers" = [ "nixd" ]; + }; + }; + }; + }; + }; + }; }; } -- knotmirror 0.0.1