]> Untitled Git - MarigoldOS/.git/blob - flake.nix
more 0x00 stuff moved over
[MarigoldOS/.git] / flake.nix
1 # This can be built with nixos-rebuild --flake .#myhost build
2 {
3   description = "the simplest flake for nixos-rebuild";
4
5   inputs = {
6     nixpkgs = {
7       url = "github:NixOS/nixpkgs/nixos-22.11";
8     };
9     # inputs.emacs-overlay.url = "github:nix-community/emacs-overlay";
10     # inputs.coricamu.url = "github:danth/coricamu";
11     nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
12     simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-22.11";
13     home-manager = {
14       url = "github:nix-community/home-manager/release-22.11";
15       inputs.nixpkgs.follows = "nixpkgs";
16     };
17     # alfis.url = "github:Revertron/Alfis";
18     stylix = {
19       url = "github:danth/stylix";
20       inputs.nixpkgs.follows = "nixpkgs";
21     };
22     nixos-generators = {
23       url = "github:nix-community/nixos-generators";
24       inputs.nixpkgs.follows = "nixpkgs";
25     };
26     raspberry-pi-nix.url = "github:tstat/raspberry-pi-nix";
27   };
28
29   # Outputs can be anything, but the wiki + some commands define their own
30   # specific keys. Wiki page: https://nixos.wiki/wiki/Flakes#Output_schema
31   outputs = {
32     self,
33     nixpkgs,
34     nixpkgs-unstable,
35     home-manager,
36     nixos-generators,
37     # hm-unstable,
38     stylix,
39     # alfis,
40     # colmena,
41     # coricamu,
42     # deploy-rs,
43     zero,
44     raspberry-pi-nix,
45     simple-nixos-mailserver,
46     ...
47   } @inputs:
48     let
49       system = "x86_64-linux";
50       overlay-unstable = final: prev: {
51         # unstable = nixpkgs-unstable.legacyPackages.${prev.system};
52         unstable = import nixpkgs-unstable {
53           inherit system;
54           config.allowUnfree = true;
55         };
56       };
57     in {
58       overlays = import ./overlays/unstable.nix { inherit inputs; };
59       nixosConfigurations = {
60         powerbook = nixpkgs.lib.nixosSystem {
61           system = "x86_64-linux";
62           specialArgs = self.colmena.meta.specialArgs;
63           # Import our old system configuration.nix
64           modules = self.colmena.powerbook.imports;
65         };
66         marigold = nixpkgs.lib.nixosSystem {
67           system = "x86_64-linux";
68           specialArgs = self.colmena.meta.specialArgs;
69           # Import our old system configuration.nix
70           modules = self.colmena.marigold.imports;
71         };
72       };
73       packages."x86_64-linux" = {
74         marigold-install-iso = nixos-generators.nixosGenerate {
75           system = "x86_64-linux";
76           modules = [
77             ./hosts/iso.nix
78             stylix.nixosModules.stylix
79             home-manager.nixosModules.home-manager
80             {
81               home-manager.useGlobalPkgs = true;
82               home-manager.useUserPackages = true;
83               home-manager.users.cw = import ./users/home.nix { user = "cw"; pkgs = nixpkgs.legacyPackages.x86_64-linux; };
84             }
85           ];
86           format = "install-iso";
87         };
88         marigold-iso = nixos-generators.nixosGenerate {
89           system = "x86_64-linux";
90           pkgs = nixpkgs.legacyPackages.x86_64-linux;
91           modules = [
92             ./hosts/iso.nix
93             stylix.nixosModules.stylix
94             home-manager.nixosModules.home-manager
95             {
96               home-manager.useGlobalPkgs = true;
97               home-manager.useUserPackages = true;
98               home-manager.users.cw = import ./users/home.nix { user = "cw"; pkgs = nixpkgs.legacyPackages.x86_64-linux; };
99             }
100           ];
101           format = "iso";
102         };
103       };
104       colmena = {
105         meta = {
106           nixpkgs = import nixpkgs {
107             system = "x86_64-linux";
108             overlays = [];
109           };
110           nodeNixpkgs.bike = import nixpkgs {
111             system = "aarch64-linux";
112           };
113           specialArgs = inputs;
114         };
115         marigold = {
116           imports = [
117             ./WIP/hosts/marigold.nix
118           ];
119           deployment.targetHost = "marigold.cw.ygg";
120         };
121         moto = {
122           imports = [
123             ./WIP/hosts/moto.nix
124           ];
125           deployment.targetHost = "moto.cw.ygg";
126         };
127         powerbook = {
128           imports = [
129             ./WIP/hosts/powerbook.nix
130             ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
131             home-manager.nixosModules.home-manager
132           ];
133           deployment = {
134             allowLocalDeployment = true;
135             targetHost = null;
136           };
137         };
138         kernelpanic = {
139           imports = [
140             ./WIP/hosts/kernelpanic.nix
141             home-manager.nixosModules.home-manager
142             stylix.nixosModules.stylix
143             simple-nixos-mailserver.nixosModule
144           ];
145           deployment = {
146             targetHost = "kernelpanic.cw.ygg";
147             keys = {
148               "yggdrasil.conf.secret" = {
149                 keyFile = "./secrets/yggdrasil-kernelpanic.conf";
150                 uploadAt = "pre-activation";
151               };
152             };
153           };
154         };
155         telescreen = {
156           imports = [
157             ./WIP/hosts/telescreen.nix
158             home-manager.nixosModules.home-manager
159             stylix.nixosModules.stylix
160           ];
161           deployment = {
162             targetHost = "telescreen.cw.ygg";
163           };
164         };
165       };
166     };
167 }