From 2c859d57044e35fe563a8c6946c69d8fd2259dc2 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sun, 12 Sep 2021 18:37:47 -0400 Subject: [PATCH] second home --- Makefile | 13 +++++-------- README.md | 4 ++-- flake.nix | 10 +++++----- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index bb55146..29b72ae 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,9 @@ -include /etc/lsb-release -export $(shell sed 's/=.*//' /etc/lsb-release) all: - # FIXME: Should just check for nixos instead. - @if [ "${DISTRIB_ID}" = "Ubuntu" ]; then \ - make home;\ - else \ + @if [ test -d /etc/nixos ]; then \ make nixos;\ + else \ + make home;\ fi nixos: @@ -14,8 +11,8 @@ nixos: systemctl restart --user emanote # Not sure why this doesn't reliably work -homeBroken: - nix build --no-link ".#homeConfigurations."`whoami`@`hostname`".activationPackage" +home0: + nix build --no-link ".#homeConfigurations."`hostname`".activationPackage" ./result/activate # This requires the symlink to be setup; see README diff --git a/README.md b/README.md index 4f3e9e2..439f172 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ VSCode note: Ctrl+Shift+B will run effectuate the new configuration ( First time run, ``` +make home0 ln -s /path/to/here ~/.config/nixpkgs # Why? See Makefile -make ``` -Afterwards, feel free to use `home-manager switch`. +Afterwards, feel free to use `home-manager switch` (or `make`). ## Install notes diff --git a/flake.nix b/flake.nix index e8de26e..a8ae2e2 100644 --- a/flake.nix +++ b/flake.nix @@ -93,11 +93,7 @@ homeConfigurations = let username = "srid"; - hostname = "P71"; - in - { - # WSL ubuntu - "${username}@${hostname}" = home-manager.lib.homeManagerConfiguration { + mkHomeConfig = home-manager.lib.homeManagerConfiguration { inherit username system; homeDirectory = "/home/${username}"; configuration = import ./home.nix { @@ -106,6 +102,10 @@ pkgs = import nixpkgs { inherit system; }; }; }; + in + { + "P71" = mkHomeConfig; + "x1c7" = mkHomeConfig; }; };