Created
August 9, 2023 15:05
-
-
Save brianmcgee/7bf282579f00f52750c0edde93d2fe95 to your computer and use it in GitHub Desktop.
Passing hostname into home-manager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, inputs, hostName, ... }: { | |
// hostName should now be available as an arg to all of your home-manager modules | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nixosConfigurations = { | |
floyd = nixpkgs.lib.nixosSystem { | |
system = "x86_64-linux"; | |
modules = [ | |
{ system.stateVersion = "22.11"; } | |
nixos-hardware.nixosModules.lenovo-thinkpad-x260 | |
./hosts/floyd | |
./configuration.nix | |
home-manager.nixosModules.home-manager | |
({ config, ...}: { | |
home-manager.useGlobalPkgs = true; | |
home-manager.useUserPackages = true; | |
home-manager.extraSpecialArgs = { | |
inherit inputs; | |
inherit (config.networking) hostName; | |
}; | |
home-manager.users.vk = {...}: { | |
imports = [ | |
./packages/cli-tools.nix | |
[...more files...] | |
}; | |
}) # end home-manager | |
]; # end modules | |
}; # end floyd | |
[... rest of flake.nix ...] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you so much