diff --git a/flake.nix b/flake.nix index a7236dd..939255a 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,7 @@ }@inputs: let - userConfig = { + baseUserConfig = { username = "szymon"; # for git email = "szymon_jozef@proton.me"; @@ -40,7 +40,7 @@ # your public ssh key signingKey = "~/.ssh/github.pub"; - mainMonitor = "eDP-1"; # only for some applications: you still need to set hyprland monitors yourself! + mainMonitor = "DP-1"; # only for some applications: you still need to set hyprland monitors yourself! statusBar = "ashell"; # available: ashell|waybar pathConfig = { @@ -51,45 +51,70 @@ }; system = "x86_64-linux"; + general_import = import nixpkgs { inherit system; config.allowUnfree = true; }; - general_special_args = { - inherit - inputs - userConfig - ; - }; - general_module_import = [ ./home.nix catppuccin.homeModules.catppuccin nixvim.homeModules.nixvim ]; - in - { - homeConfigurations = { - "arch" = home-manager.lib.homeManagerConfiguration { + mkHomeConfig = + { + isNixOS, + overrides ? { }, + hostName, + }: + home-manager.lib.homeManagerConfiguration { pkgs = general_import; - extraSpecialArgs = general_special_args // { - isNixOS = false; + extraSpecialArgs = { + inherit inputs isNixOS hostName; + userConfig = baseUserConfig // overrides; }; modules = general_module_import; }; - "nixos" = home-manager.lib.homeManagerConfiguration { - pkgs = general_import; + in + { + homeConfigurations = { + "arch" = mkHomeConfig { + isNixOS = false; + hostName = "arch"; + }; - extraSpecialArgs = general_special_args // { - isNixOS = true; + "nixos" = mkHomeConfig { + isNixOS = true; + hostName = "nixos"; + }; + + "pitagoras" = mkHomeConfig { + isNixOS = true; + overrides = { + mainMonitor = "eDP-1"; }; + hostName = "pitagoras"; + }; - modules = general_module_import; + "pilecki" = mkHomeConfig { + isNixOS = true; + overrides = { + mainMonitor = "LVDS-1"; + }; + hostName = "pilecki"; + }; + + "paderewski" = mkHomeConfig { + isNixOS = false; + overrides = { + mainMonitor = "DP-1"; + }; + hostName = "paderewski"; }; }; }; diff --git a/modules/cli/fish.nix b/modules/cli/fish.nix index 809ace3..fb4d3f4 100644 --- a/modules/cli/fish.nix +++ b/modules/cli/fish.nix @@ -1,4 +1,4 @@ -{ isNixOS, ... }: +{ isNixOS, hostName, ... }: { programs.fish = { @@ -45,7 +45,7 @@ set -l rel_file (realpath --relative-to=$config_dir $file) - if nh home switch $config_dir -c ${if isNixOS then "nixos" else "arch"} + if nh home switch $config_dir -c ${hostName} git add -A set commit_msg "update: $rel_file" git commit -m "$commit_msg" @@ -61,7 +61,7 @@ reload_dotfiles = { body = # fish - "nh home switch ~/.config/home-manager -c ${if isNixOS then "nixos" else "arch"}"; + "nh home switch ~/.config/home-manager -c ${hostName}"; }; ls = {