Home

dotnix @d6d1bec5916a94aa5e055a047281eb5514b295ec - refs - log -
-
https://git.jolheiser.com/dotnix.git
My nix dotfiles
dotnix / flake.nix
- raw
 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
  description = "jolheiser's nixos config";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
    home-manager.url = "github:nix-community/home-manager";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";

    nur.url = "github:nix-community/nur";
  };

  nixConfig = { warn-dirty = false; };

  outputs = { self, nixpkgs, home-manager, ... }@inputs:
    let
      overlays = final: prev: {
        nur = import inputs.nur {
          nurpkgs = prev;
          pkgs = prev;
        };
      };
      commonConfig = { username }:
        ({ config, pkgs, ... }: {
          config = {
            nixpkgs.overlays = [ overlays ];
            home-manager = {
              useGlobalPkgs = true;
              useUserPackages = true;
              sharedModules = [
                # inputs.jolheiser-nur.homeManagerModules.default
              ];
              users.${username}.imports = [ ./apps ];
              extraSpecialArgs = {
                flakePath = "/home/${username}/.config/nixpkgs";
              };
            };
          };
        });
    in {
      nixosConfigurations = {
        "chai" = nixpkgs.lib.nixosSystem {
          system = "x86_64-linux";
          modules = [
            home-manager.nixosModules.home-manager
            ./machines/common
            ./machines/chai
            (commonConfig { username = "jolheiser"; })
          ];
        };
        "matcha" = nixpkgs.lib.nixosSystem {
          system = "x86_64-linux";
          modules = [
            home-manager.nixosModules.home-manager
            ./machines/common
            ./machines/matcha
            (commonConfig { username = "jolheiser"; })
          ];
        };
      };
    };
}