Skip to content

Commit

Permalink
add workaround for reference issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pdg137 committed Mar 23, 2024
1 parent 9813689 commit 8c3de2f
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion home-manager/switch.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,25 @@ let
hash = "sha256-cLbLPTL1CDmETVh4p0nQtvoF+FSEjsnJTFpTxhXywhQ=";
};

home-manager = (import home-manager-src {inherit pkgs;}).home-manager;
# We need to do this weird thing since otherwise the source link
# somehow doesn't get picked up.
# See https://github.com/ryantm/home-manager-template/issues/9
src-ref-pkg = pkgs.stdenv.mkDerivation {
name = "source-ref-pkg";
src = ./.;
buildPhase = ''
mkdir $out
ln -s "${home-manager-src}" $out/src
'';
};

home-manager = pkgs.buildEnv {
name = "home-manager";
paths = [
(import home-manager-src {inherit pkgs;}).home-manager
src-ref-pkg
];
};

# Makes a script installed in the nix store.
make-static-script = file:
Expand All @@ -37,4 +55,5 @@ in
server = make-script "server.nix";
server-static = make-static-script "server.nix";
none = assert false; "Build with -A <type>";
home-manager = home-manager;
}

0 comments on commit 8c3de2f

Please sign in to comment.