summaryrefslogtreecommitdiff
path: root/flake.nix
blob: 2cdade961e83e77d57b55d1447b4e105d788fc34 (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
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
{
  description = "NixOS configuration";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
    nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";

    home-manager = {
      url = "github:nix-community/home-manager/release-23.05"; 
      # The `follows` keyword in inputs is used for inheritance.
      # Here, `inputs.nixpkgs` of home-manager isn't kept consistent with the `inputs.nixpkgs` of the current flake,
      # to not avoid problems caused by different versions of nixpkgs dependencies.
      inputs.nixpkgs.follows = "nixpkgs-unstable";
    };

    # modern window compositor
    hyprland.url = "github:hyprwm/Hyprland";

    #community wayland nixpkgs
    # nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
    # anyrun - a wayland launcher
    # anyrun = {
    #   url = "github:Kirottu/anyrun";
    #   inputs.nixpkgs.follows = "nixpkgs-unstable";
    # };

    # # generate iso/qcow2/docker/... image from nixos configuration
    # nixos-generators = {
    #   url = "github:nix-community/nixos-generators";
    #   inputs.nixpkgs.follows = "nixpkgs";
    # };

    #secrets management, lock with git commit at 20xx/x/xx
    #.........

    ##################### Some non-flake repositories #########################################

    # # AstroNvim is an aesthetic and feature-ruch neovim config.
    # astronvim = {
    #   url = "github:AstroNvim/AstroVnim/v3.36.0";
    #   flake = false;
    # };

    # useful nushell scripts, such as auto_completion
    nushell-scripts = {
      url = "github:nushell/nu_scripts";
      flake = false;
    };

    # ryan4yin wallpapers
    wallpapers = {
      url = "github:ryan4yin/wallpapers";
      flake = false;
    };

    # # nur-ryan4yin = {
    #   url = "github:ryan4yin/nur-packages";
    #   # inputs.nixpkgs.follows "nixpkgs";
    # };

    # # riscv64 SBCs
    # nixos-licheepi4a.url = "github:ryan4yin/nixos-licheepi4a";
    # # nixos-jh7110.url = "github:ryan4yin/nixos-jh7110";

    # aarch64 SBCs
    # nixos-rk3588.url = "github:ryan4yin/nixos-rk3588";

    ############# Personal repositories ########################################

    # # my private secrets, it's a private repository, you need to replace it with your own.
    # # use ssh protocol to authenticate via ssh-agent/ssh-key, and shallow clone to save time
    # mysecrets = {
    #   url = "";
    #   flake = false;
    # };

    ##################### Color Schemes #######################################

    #color scheme -catppuccin
    catppuccin-btop = {
      url = "github:catppuccin/btop";
      flake = false;
    };
    catppuccin-bat = {
      url = "github:catppuccin/bat";
      flake = false;
    };
    catppuccin-alacritty = {
      url = "github:catppuccin/alacritty";
      flake = false;
    };
    catppuccin-helix = {
      url = "github:catppuccin/helix";
      flake = false;
    };
    catppuccin-starship = {
      url = "github:catppuccin/starship";
      flake = false;
    };
    catppuccin-hyprland = {
      url = "github:catppuccin/hyprland";
      flake = false;
    };


    # # the nixConfig here only affects the flake inself, not the system configuration!
    # nixConfig = {
    #   experimental-features = ["nix-command" "flakes"];

    #   substituters = [
    #     #my own cache server
    #     "url-here"
    #     "https://cache.nixos.org"
    #     "https://hyprland.cachix.org"
    #   ];

    #   # nix community's cache server
    #   extra-substituters = [
    #     "https://nix-community.cachix.org"
    #     "https://nixpkgs-wayland.cachix.org"
    #   ];
    #   extra-trusted-public-keys = [
    #     "keys here"
    #   ];
    # };
    
  };

  # outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, hyprland, ... }: {
  # outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, wallpapers, catppuccin-btop, catppuccin-bat, catppuccin-alacritty, catppuccin-starship, catppuccin-hyprland, ... }: {
  outputs = inputs@{ self, ...}: with inputs; {

    nixosConfigurations = {

      nixos-zenbook = nixpkgs.lib.nixosSystem {
        # inherit system;
        modules = [
          ./machines/zenbook/configuration.nix
          
          ./machines/zenbook/hardware-configuration.nix

          # Default users
          ./modules/user-profiles/defin.nix
          ./modules/user-profiles/root.nix

          home-manager.nixosModules.home-manager {

            home-manager.useGlobalPkgs = true;
            home-manager.useUserPackages = true;
            home-manager.users.defin = import ./home-manager/home.nix;

            # Optionally, use home-manager.extraSpecialArgs to pass
            # arguments to home.nix
          }

          # hyprland.homeManagerModules.default {wayland.windowManager.hyprland.enable = true;}

          ./modules/bluetooth.nix
          ./modules/environment.nix
          ./modules/kde-connect.nix
          ./modules/nix-common.nix
          ./modules/services.nix
          ./modules/steam.nix
          ./modules/sway.nix
          ./modules/system-packages.nix

          # ./home-manager/home.nix

          # # Let 'nixos-version --json' know the Git revision of this flake.
          # system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
          # nix.registry.nixpkgs.flake = nixpkgs;
        ];
      };

      khad = nixpkgs.lib.nixosSystem {
        modules = [
          ./machines/khad/configuration.nix

          ./machines/khad/hardware-configuration.nix

          ./modules/user-profiles/defin.nix

          home-manager.nixosModules.home-manager {
            home-manager.useGlobalPkgs = true;
            home-manager.useUserPackages = true;
            home-manager.users.defin = import ./home-manager/home.nix;
          }

          ./modules/bluetooth.nix
          ./modules/environment.nix
          ./modules/kde-connect.nix
          ./modules/nix-common.nix
          ./modules/services.nix
          ./modules/steam.nix
          ./modules/sway.nix
          ./modules/system-packages.nix
        ];
      };
    };
  };
}