Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Commit

Permalink
Restrict some home-manager config to one machine
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed May 26, 2020
1 parent c859647 commit 0e1c8da
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion machine/server.nix
Expand Up @@ -9,8 +9,9 @@ in
/etc/nixos/nixos-in-place.nix
../nix/base.nix
../nix/caches.nix
../nix/srid-home.nix
<home-manager/nixos>
];
home-manager.users.srid = (import ../nix/home.nix "facade");

boot.cleanTmpDir = true;
boot.loader.grub.enable = true;
Expand Down
4 changes: 2 additions & 2 deletions machine/thinkpad.nix
Expand Up @@ -21,10 +21,10 @@
# Using GitHub Actions with cachix instead
# ../nix/ci.nix

../nix/srid-home.nix

../private-config
<home-manager/nixos>
];
home-manager.users.srid = (import ../nix/home.nix "thebeast");

# EFI boot
boot = {
Expand Down
12 changes: 6 additions & 6 deletions nix/home.nix
Expand Up @@ -3,16 +3,16 @@
# Stuff on this file, and ./home/*.nix, should work across all of my computing
# devices. Presently these are: Thinkpad, Macbook and Pixel Slate.

{ config, pkgs, ...}:
device: { config, pkgs, ...}:

let
allPlatformImports = [
baseImports = [
./home/git.nix
./home/haskell.nix
./home/shells.nix
./home/tmux.nix
];
linuxImports = [
linuxDesktopImports = [
./home/scripts.nix
./home/terminal.nix
./home/i3.nix
Expand All @@ -33,9 +33,9 @@ in

programs.home-manager.enable = true;

imports = if builtins.currentSystem == "x86_64-linux"
then (allPlatformImports ++ linuxImports)
else allPlatformImports;
imports = if (builtins.currentSystem == "x86_64-linux" && device == "thebeast")
then (baseImports ++ linuxDesktopImports)
else baseImports;

home.packages = with pkgs; [
# Basic tools
Expand Down
4 changes: 2 additions & 2 deletions nix/srid-home.nix
@@ -1,8 +1,8 @@
{ config, pkgs, ...}:
device: { config, pkgs, ...}:

{
imports = [
<home-manager/nixos>
];
home-manager.users.srid = (import ./home.nix);
home-manager.users.srid = (import ./home.nix device);
}
2 changes: 1 addition & 1 deletion private-config

0 comments on commit 0e1c8da

Please sign in to comment.