From 5b0e693498d8ff477a6989212f6f1b75f749c0a1 Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Tue, 17 Sep 2024 11:29:25 -0300 Subject: [PATCH] feat!: per-user home-manager configuration --- flake.nix | 27 +++++++++++------- specific/{ => desktop}/home-manager.nix | 10 ++++++- specific/laptop/home-manager.nix | 38 +++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 12 deletions(-) rename specific/{ => desktop}/home-manager.nix (76%) create mode 100644 specific/laptop/home-manager.nix diff --git a/flake.nix b/flake.nix index 2ed1fe2..9090010 100644 --- a/flake.nix +++ b/flake.nix @@ -29,8 +29,14 @@ let specialArgs = inputs; modules = [ - ./modules/nixos - ./specific/wizdesk/nixos.nix + ./specific/desktop/nixos.nix + home-manager.nixosModules.home-manager + { + home-manager.extraSpecialArgs = inputs; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.wizardlink = import ./specific/desktop/home-manager.nix; + } ]; in nixpkgs.lib.nixosSystem { inherit system specialArgs modules; }; @@ -39,20 +45,19 @@ let specialArgs = inputs; modules = [ - ./modules/nixos - ./specific/wizlap/nixos.nix + ./specific/laptop/nixos.nix + home-manager.nixosModules.home-manager + { + home-manager.extraSpecialArgs = inputs; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.wizardlink = import ./specific/laptop/home-manager.nix; + } ]; in nixpkgs.lib.nixosSystem { inherit system specialArgs modules; }; }; - homeConfigurations.wizardlink = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - - extraSpecialArgs = inputs; - modules = [ ./specific/home-manager.nix ]; - }; - formatter."${system}" = pkgs.nixfmt-rfc-style; homeManagerModules = { diff --git a/specific/home-manager.nix b/specific/desktop/home-manager.nix similarity index 76% rename from specific/home-manager.nix rename to specific/desktop/home-manager.nix index 7192ae2..22f7d8e 100644 --- a/specific/home-manager.nix +++ b/specific/desktop/home-manager.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ ... }: { # @@ -28,4 +28,12 @@ home.sessionVariables = { EDITOR = "nvim"; }; + + # Add monitor configuration to hyprland + modules.hyprland.extraConfig = # hyprlang + '' + # See https://wiki.hyprland.org/Configuring/Monitors/ + monitor = DP-3, 1920x1080@74.973, 2560x0, 1 + monitor = DP-2, 2560x1440@165.00301, 0x0, 1 + ''; } diff --git a/specific/laptop/home-manager.nix b/specific/laptop/home-manager.nix new file mode 100644 index 0000000..7993919 --- /dev/null +++ b/specific/laptop/home-manager.nix @@ -0,0 +1,38 @@ +{ ... }: + +{ + # + ## HOME CONFIGURATION # + # + + # Import configurations for better modularity. + imports = [ + ../../modules/home-manager + ]; + + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "wizardlink"; + home.homeDirectory = "/home/wizardlink"; + + # 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 should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "23.05"; # Please read the comment before changing. + + home.sessionVariables = { + EDITOR = "nvim"; + }; + + # Add monitor configuration to hyprland + modules.hyprland.extraConfig = # hyprlang + '' + # See https://wiki.hyprland.org/Configuring/Monitors/ + monitor = DP-3, 1920x1080@74.973, 2561x0, 1 + monitor = DP-2, 2560x1440@165.00301, 0x0, 1 + ''; +}