aboutsummaryrefslogtreecommitdiffstats
path: root/flake.nix
blob: 719b19aa7dd3a6e9b577365c49e46ea50a89451e (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
{
  description = "nipsy's NixOS configuration";

  inputs = {
    hardware.url = "github:nixos/nixos-hardware";

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

    nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
    nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
  };

  outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ... } @ inputs:
    let
      inherit (self) outputs;
      lib = nixpkgs.lib // home-manager.lib;
      systems = [
        "x86_64-linux"
        # "aarch64-linux"
        # "x86_64-darwin"
        #"aarch64-darwin"
        # "i686-linux"
      ];
      forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system});
      pkgsFor = lib.genAttrs systems (system: import nixpkgs {
        inherit system;
        config.allowUnfree = true;
      });
    in
    {
      inherit lib;

      # Custom modules to enable special functionality for nixos or home-manager oriented configs.
      nixosModules = import ./modules/nixos;
      homeManagerModules = import ./modules/home-manager;

      # Custom modifications/overrides to upstream packages.
      overlays = import ./overlays { inherit inputs outputs; };

      # Your custom packages meant to be shared or upstreamed.
      # Accessible through 'nix build', 'nix shell', etc
      packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; });

      # nixos-rebuild switch --flake .#hostname'
      nixosConfigurations = {
        ginaz = nixpkgs-unstable.lib.nixosSystem rec {
          system = "x86_64-linux";
          modules = [
            {
              nixpkgs.config.pkgs = import nixpkgs-unstable { inherit system; };
            }
            ./hosts/ginaz
          ];
          specialArgs = { inherit inputs outputs; };
        };
      };

      # home-manager switch --flake .#primary-username@hostname'
      homeConfigurations = {
        "nipsy@ginaz" = lib.homeManagerConfiguration {
          modules = [ ./home/nipsy/ginaz.nix ];
          pkgs = pkgsFor.x86_64-linux;
          extraSpecialArgs = { inherit inputs outputs; };
        };
      };
    };
}