fix(wsl2): use shared Home Manager configuration

This commit is contained in:
Oliver Davies 2023-08-09 21:43:47 +01:00
parent 0c4b2d691d
commit 227dff7fd1
3 changed files with 13 additions and 23 deletions

View file

@ -8,10 +8,11 @@
outputs = inputs@{ flake-parts, self, ... }:
let
system = "x86_64-linux";
username = "opdavies";
nixos-system = import ./system/nixos { inherit inputs username; };
wsl-system = import ./system/wsl2 { inherit inputs username; };
wsl-system = import ./system/wsl2 { inherit inputs system username; };
in
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];

View file

@ -8,7 +8,7 @@ nixos profile command: && clean
sudo nixos-rebuild {{ command }} --flake .#{{ profile }}
wsl2 command: && clean
home-manager {{ command }} -f home-manager/home.nix --flake .#wsl2
NIXPKGS_ALLOW_UNFREE=1 home-manager {{ command }} --flake .#wsl2 --impure
update:
nix flake update

View file

@ -1,27 +1,16 @@
{ inputs, username }:
{ inputs, system, username }:
let
pkgs = inputs.nixpkgs.legacyPackages."${system}";
shared-config = import ../shared/home-manager.nix { inherit inputs pkgs username; };
shared-packages = import ../shared/home-manager-packages.nix { inherit inputs pkgs; };
in
inputs.home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = { inherit inputs; };
inherit pkgs;
modules = [
{
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (inputs.nixpkgs.lib.getName pkg) [
"intelephense"
"postman"
"tabnine"
];
}
{
imports = [
../../home-manager/modules/common.nix
../../home-manager/modules/git.nix
../../home-manager/modules/home-manager.nix
../../home-manager/modules/tmux.nix
../../home-manager/modules/zsh.nix
];
}
{ imports = [ shared-config ]; }
{ home.packages = shared-packages; }
];
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
}