Allow unfree, fix weird nix error when using home in nixos config

This commit is contained in:
Sam W 2023-01-07 13:47:13 +00:00
parent 1529fda04d
commit a0b452def4
2 changed files with 20 additions and 2 deletions

View File

@ -32,7 +32,10 @@
username ? "samw", username ? "samw",
}: }:
inputs.home-manager.lib.homeManagerConfiguration { inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs.nixpkgs.legacyPackages.${system}; pkgs = (import inputs.nixpkgs {
inherit system;
config.allowUnfree = true; # Yes I know it's bad for me
});
modules = [ modules = [
{ home = { { home = {
inherit username; inherit username;
@ -41,7 +44,18 @@
then "/Users/${username}" then "/Users/${username}"
else "/home/${username}"; else "/home/${username}";
stateVersion = "21.11"; stateVersion = "21.11";
};}] ++ profiles ++ [{nixpkgs.overlays = overlays;}]; };}] ++ profiles ++ [
{nixpkgs.overlays = overlays;}
# See comment in home/default.nix.
({ pkgs, ... }: {
nix = {
enable = true;
package = pkgs.nix;
settings.experimental-features = "nix-command flakes";
settings.max-jobs = "auto"; # Gotta go fast (build derivations in parallel)
};
})
];
extraSpecialArgs = {inherit system;}; extraSpecialArgs = {inherit system;};
}; };
}; };

View File

@ -11,12 +11,16 @@ in {
"EDITOR" = "vim"; "EDITOR" = "vim";
"WORDCHARS" = "\${WORDCHARS//[\\/.=]/}"; # ctrl-w on paths without make angery "WORDCHARS" = "\${WORDCHARS//[\\/.=]/}"; # ctrl-w on paths without make angery
}; };
/*
# For some reason this doesn't play nice when using home manager config from inside
# a nixos configuration.
nix = { nix = {
enable = true; enable = true;
package = pkgs.nix; package = pkgs.nix;
settings.experimental-features = "nix-command flakes"; settings.experimental-features = "nix-command flakes";
settings.max-jobs = "auto"; # Gotta go fast (build derivations in parallel) settings.max-jobs = "auto"; # Gotta go fast (build derivations in parallel)
}; };
*/
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;