-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
89 lines (88 loc) · 3.38 KB
/
flake.nix
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
{
description = "Woobilicious' NixOS configuration";
inputs = {
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
factorio-nixpkgs.url = "github:YellowOnion/nixpkgs/factorio-patch2";
sway-nix = {
url = "github:YellowOnion/sway-nix";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
nix-gaming.url = "github:fufexan/nix-gaming/";
factorio-mods = { url = "github:YellowOnion/factorio-mods-nix"; };
auth-server = { url = "github:YellowOnion/auth-server";
flake = false; };
conduit = {
url = "gitlab:famedly/conduit";
inputs.nixpkgs.follows = "nixpkgs-stable";
};
typed-systems = {
url = "github:YellowOnion/nix-typed-systems";
flake = false;
};
};
outputs = {self, nixpkgs-stable, nixpkgs-unstable, auth-server, sway-nix, nix-gaming, typed-systems, ... }@inputs:
let
inherit (import typed-systems) genAttrsMapBy systems' id;
systems = [
{ name = "Purple-Sunrise";
modules = [ ./purple.nix ./purple-hw.nix ./bcachefs.nix ];
system = systems'.x86_64-linux;
}
{ name = "Purple-Sunrise2";
modules = [ ./purple.nix ./purple2-hw.nix ];
system = systems'.x86_64-linux;
}
{ name = "Selene";
modules = [ ./selene.nix ];
system = systems'.x86_64-linux;
nixpkgs = nixpkgs-stable;
}
{ name = "Kawasaki-Lemon";
modules = [ ./laptop2.nix ];
system = systems'.x86_64-linux;
}
{
name = "NixOS-installer";
modules = [ ./iso.nix ];
system = systems'.x86_64-linux;
}
];
mkConfig = { nixpkgs ? nixpkgs-unstable, name, system, modules }:
let
factorioOverlay = self: super: { factorio = super.factorio.override ({ versionsJson = "${inputs.factorio-mods}/versions.json" ;}); };
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [ factorioOverlay sway-nix.overlays.default ];
};
nix-gaming = inputs.nix-gaming.packages.${system};
factorio-nixpkgs = (import inputs.factorio-nixpkgs {
inherit system;
config.allowUnfree = true;
});
in
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit nix-gaming factorio-nixpkgs nixpkgs nixpkgs-unstable;
inherit (inputs) factorio-mods;
auth-server = pkgs.haskellPackages.callPackage auth-server {};
conduit = inputs.conduit.packages.${system};
};
modules = modules ++ [
({...}: {
networking.hostName = name;
nix.registry.nixpkgs.flake = nixpkgs;
nix.registry.nix-gaming.flake = inputs.nix-gaming;
nix.registry.self.flake = self;
nixpkgs.overlays = [ factorioOverlay sway-nix.overlays.default ];
nixpkgs.config.allowUnfree = true;
nix.nixPath = [ "nixpkgs=${nixpkgs.outPath}" ];
}) ];
};
in
{
nixosConfigurations = genAttrsMapBy (a: a.name) mkConfig systems id;
};
}