summaryrefslogtreecommitdiff
path: root/users/seth/custom/standalone.nix
blob: 6bb85a17c603a94514db8a5358e81a885ab1f8a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
  config,
  lib,
  pkgs,
  ...
}:

let
  cfg = config.seth.standalone;

  inherit (pkgs.stdenv.hostPlatform) isDarwin;
in

{

  options.seth.standalone = {
    enable = lib.mkEnableOption "standalone configuration mode";
  };

  config = lib.mkIf cfg.enable {
    # This won't be set in standalone configurations
    _module.args.osConfig = { };

    # Make sure we can switch & update
    programs.home-manager.enable = true;

    home = {
      username = "seth";
      homeDirectory = (if isDarwin then "/Users" else "/home") + "/${config.home.username}";
    };

    nix = {
      package = lib.mkDefault pkgs.nix;
    };
  };
}