Advertisement
Guest User

Untitled

a guest
May 4th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. [[machinename.nix]]
  2. {pkgs, lib, ...}:
  3. with lib;
  4.  
  5. {
  6. imports = [ ./home.nix];
  7. options = {
  8. host = mkOption {
  9. hostname = mkOption {
  10. type = types.string;
  11. default = "";
  12. description = ''
  13. Hostname used to differ between configurations of different machienes
  14. '';
  15. };
  16. };
  17. };
  18. host.hostname = "machinename";
  19. }
  20.  
  21.  
  22. [[home.nix]]
  23. { config, pkgs, ... }:
  24. with import <nixpkgs> {};
  25. with builtins;
  26. with lib;
  27. with import <home-manager/modules/lib/dag.nix> { inherit lib; };
  28. {
  29. home.packages = if host.hostname == "machinename" then [ htop] else [];
  30. }
  31.  
  32. [[command to build homemanager configuration]]
  33. home-manager -f ~/experimentdir/machinename.nix switch
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement