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

  inputs = {

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

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

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

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

    # per https://nixos-and-flakes.thiscute.world/nixos-with-flakes/downgrade-or-upgrade-packages
    nixpkgs-67e692392.url = "github:nixos/nixpkgs/67e69239226f37168d1adb8d29bd61150756a03e";
    nixpkgs-master.url = "github:nixos/nixpkgs";
    nixpkgs-stable.url = "github:nixos/nixpkgs/release-24.05";
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

    nvidia-patch = {
      url = "github:icewind1991/nvidia-patch-nixos";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    sops-nix = {
      url = "github:Mic92/sops-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };

  };

  outputs = { home-manager-stable, home-manager, nixos-hardware, nixpkgs-67e692392, nixpkgs-master, nixpkgs-stable, nixpkgs, nvidia-patch, self, sops-nix, ... } @ inputs: let
    inherit (self) outputs;
    systems = [
      #"aarch64-linux"
      #"i686-linux"
      "x86_64-linux"
      #"aarch64-darwin"
      #"x86_64-darwin"
    ];
    forAllSystems = nixpkgs.lib.genAttrs systems;
  in {

    nixosConfigurations = {

      arrakis = nixpkgs.lib.nixosSystem {
        specialArgs = { inherit inputs outputs; };
        modules = [
          ./hosts/arrakis
          home-manager.nixosModules.home-manager {
            home-manager.sharedModules = [ sops-nix.homeManagerModules.sops ];
            home-manager.users.root = import ./home/root/arrakis.nix;
            home-manager.users.nipsy = import ./home/nipsy/arrakis.nix;
          }
          sops-nix.nixosModules.sops
        ];
      };

      darkstar = nixpkgs.lib.nixosSystem {
        specialArgs = { inherit inputs outputs; };
        modules = [
          ./hosts/darkstar
          home-manager.nixosModules.home-manager {
            home-manager.users.root = import ./home/root/darkstar.nix;
            home-manager.users.nipsy = import ./home/nipsy/darkstar.nix;
          }
          sops-nix.nixosModules.sops
        ];
      };

      ginaz = nixpkgs.lib.nixosSystem rec {
        specialArgs = { inherit inputs outputs; };
        modules = [
          ./hosts/ginaz
          home-manager.nixosModules.home-manager {
            home-manager.sharedModules = [ sops-nix.homeManagerModules.sops ];
            home-manager.users.root = import ./home/root/ginaz.nix;
            home-manager.users.nipsy = import ./home/nipsy/ginaz.nix;
          }
          nixos-hardware.nixosModules.lenovo-yoga-7-14ARH7-amdgpu
          sops-nix.nixosModules.sops
        ];
      };

      # from https://nixos.wiki/wiki/Creating_a_NixOS_live_CD and https://chengeric.com/homelab/
      iso = nixpkgs.lib.nixosSystem {
        modules = [
          "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
          ({
            #isoImage.squashfsCompression = "gzip -Xcompression-level 1";
            users.users.nixos = {
              openssh.authorizedKeys.keys = [
                (builtins.readFile ./hosts/common/users/nipsy/keys/id_arrakis.pub)
              ];
            };
          })
        ];
        system = "x86_64-linux";
      };

      kaitain = nixpkgs.lib.nixosSystem rec {
        specialArgs = { inherit inputs outputs; };
        modules = [
          ./hosts/kaitain
          home-manager.nixosModules.home-manager {
            home-manager.users.root = import ./home/root/kaitain.nix;
            home-manager.users.nipsy = import ./home/nipsy/kaitain.nix;
          }
        ];
      };

      richese = nixpkgs.lib.nixosSystem rec {
        specialArgs = { inherit inputs outputs; };
        modules = [
          ./hosts/richese
          home-manager.nixosModules.home-manager {
            home-manager.users.root = import ./home/root/richese.nix;
            home-manager.users.nipsy = import ./home/nipsy/richese.nix;
          }
        ];
      };

    };

    overlays = import ./overlays {inherit inputs;};
    packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});

  };

}