From 3051fd8593def81839aaa77f562d35d6d68d3cd0 Mon Sep 17 00:00:00 2001 From: Antoine Vaure Date: Mon, 12 May 2025 14:14:15 +0200 Subject: [PATCH] one config for each host --- bar.nix | 4 ++-- flake.nix | 62 +++++++++++++++++++++++++++++++++++++++---------------- home.nix | 6 +++--- 3 files changed, 49 insertions(+), 23 deletions(-) diff --git a/bar.nix b/bar.nix index 89c1a87..fc9f82f 100644 --- a/bar.nix +++ b/bar.nix @@ -1,4 +1,4 @@ -{ lib, config, pkgs, variant, username, ... }: { +{ lib, config, pkgs, variant, ... }: { home.packages = with pkgs; [ material-design-icons @@ -25,7 +25,7 @@ enable = true; # systemd.enable = true; settings = { - bar = { + bar = let username = config.home.username; in { "reload_style_on_change" = true; layer = "top"; position = "bottom"; diff --git a/flake.nix b/flake.nix index c241a9e..beee4ac 100644 --- a/flake.nix +++ b/flake.nix @@ -21,27 +21,53 @@ pkgs = inputs.nixpkgs.legacyPackages.${system}; pkgs-unstable = inputs.unstable.legacyPackages.${system}; nixgl = inputs.nixgl.packages.${system}; - - config = import ./config.nix; in { - homeConfigurations.${config.username} = inputs.home-manager.lib.homeManagerConfiguration { - inherit pkgs; + homeConfigurations."anvaure@Allegro23-12" = + inputs.home-manager.lib.homeManagerConfiguration { + inherit pkgs; - extraSpecialArgs = { - inherit pkgs-unstable; - inherit (config) username variant; - inherit nixgl; + extraSpecialArgs = { + inherit pkgs-unstable; + variant = "allegro"; + }; + + modules = [ + { home.username = "anvaure"; } + ./home.nix + { home.packages = [ nixgl.nixGLIntel ]; } + { home.packages = [ inputs.st-flexipatch.packages.${system}.st ]; } + ]; }; - modules = [ - ./home.nix - { - home.packages = [ nixgl.nixGLIntel ]; - } - { - home.packages = [ inputs.st-flexipatch.packages.${system}.st ]; - } - ]; - }; + homeConfigurations."ant@hs" = + inputs.home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + extraSpecialArgs = { + inherit pkgs-unstable; + variant = "hs"; + }; + + modules = [ + { home.username = "ant"; } + ./home.nix + ]; + }; + + homeConfigurations."ant@nixos" = + inputs.home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + extraSpecialArgs = { + inherit pkgs-unstable; + variant = "default"; + }; + + modules = [ + { home.username = "ant"; } + ./home.nix + { home.packages = [ inputs.st-flexipatch.packages.${system}.st ]; } + ]; + }; }; } diff --git a/home.nix b/home.nix index 8269fcd..6f008d1 100644 --- a/home.nix +++ b/home.nix @@ -1,4 +1,4 @@ -{ inputs, config, lib, pkgs, username, variant, ... }: +{ inputs, config, lib, pkgs, variant, ... }: { imports = [ @@ -16,9 +16,9 @@ # Home Manager needs a bit of information about you and the paths it should # manage. - home.username = username; home.homeDirectory = "/home/${config.home.username}"; + home.stateVersion = "23.05"; # Please read the comment before changing. home.packages = with pkgs; [ @@ -152,7 +152,7 @@ XCURSOR_SIZE = "24"; CCACHE_MAXSIZE = "40Gi"; } // (if variant == "allegro" then { - TMPDIR = "/home/${username}/tmp"; + TMPDIR = "/home/${config.home.username}/tmp"; GSETTINGS_SCHEMA_DIR = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/gsettings-desktop-schemas-47.1/glib-2.0/schemas"; } else {});