aboutsummaryrefslogtreecommitdiff
path: root/nix/mkHomeManagerConfiguration.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-09-22 18:05:34 -0700
committerFranck Cuny <franck@fcuny.net>2022-09-22 18:05:34 -0700
commit4f1513dfa4fc22240ab7dcbe1c60c14f827645a7 (patch)
treeb81a45ae768dc2620d54e3b6a41b2c485d1f6aac /nix/mkHomeManagerConfiguration.nix
parentref(flake): move all the checks to external module (diff)
downloadinfra-4f1513dfa4fc22240ab7dcbe1c60c14f827645a7.tar.gz
ref(home-manager): don't use home-manager when building the host
When rebuilding the host (through `nixos-rebuild switch --flake`) I don't want to rebuild also my home-manager configuration. I want these to be two different steps. I rebuild the home-manager configuration more frequently and it's a waste of time and CPU to rebuild the world every time. This is a pretty large refactoring: - move checks back into the flake: if I modify a check, the configuration for `pre-commits` is not regenerated, as the file with the checks is not monitored with `direnv` (I could probably configure it for it, but not now) - remove `home.nix` from the host level configuration - introduce a `mkHomeManagerConfiguration` function to manage the different user@host - fix a warning with the rust overlay
Diffstat (limited to 'nix/mkHomeManagerConfiguration.nix')
-rw-r--r--nix/mkHomeManagerConfiguration.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/nix/mkHomeManagerConfiguration.nix b/nix/mkHomeManagerConfiguration.nix
new file mode 100644
index 0000000..bcf374a
--- /dev/null
+++ b/nix/mkHomeManagerConfiguration.nix
@@ -0,0 +1,28 @@
+inputs@{ self, ... }:
+{ system ? "x86_64-linux"
+, username ? "fcuny"
+, hostname
+, stateVersion ? "22.05"
+, extraModules ? [ ]
+,
+}:
+inputs.home-manager.lib.homeManagerConfiguration {
+ inherit system;
+ inherit username;
+ inherit stateVersion;
+
+ homeDirectory = "/home/${username}";
+
+ pkgs = import inputs.nixpkgs {
+ inherit system;
+ config.allowUnfree = true;
+ overlays = [
+ inputs.emacs-overlay.overlay
+ inputs.nur.overlay
+ inputs.rust.overlays.default
+ (final: prev: { tools = import "${self}/tools" { pkgs = prev; }; })
+ ];
+ };
+ configuration.imports =
+ [ "${self}/home" "${self}/hosts/${hostname}/home.nix" ];
+}