-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
136 lines (124 loc) · 4.43 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
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
{
inputs = {
nix-alien.url = "https://flakehub.com/f/thiagokokada/nix-alien/0.1.381.tar.gz";
home-manager.url = "github:nix-community/home-manager";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/22.11";
nixpkgs-master.url = "github:nixos/nixpkgs/master";
#inputs.agenix.url = "github:ryantm/agenix";
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
memflow.url = "github:memflow/memflow-nixos";
prism.url = "github:PrismLauncher/PrismLauncher";
prism.inputs.nixpkgs.follows = "nixpkgs";
darwin.url = "github:lnl7/nix-darwin";
darwin.inputs.nixpkgs.follows = "nixpkgs";
looking-glass-src = {
url = "ssh://git@github.com/gnif/LookingGlass.git";
type = "git";
ref = "master";
submodules = true;
flake = false;
};
gb-src = {
url = "github:babbaj/gb/gitignore";
flake = false;
};
};
outputs = inputs@{
self, nixpkgs, nixpkgs-stable, nixpkgs-master, home-manager, agenix, memflow, prism, looking-glass-src, gb-src,
darwin, nix-alien
}:
let
system = "x86_64-linux";
pkgsMaster = import nixpkgs-master { inherit system; config.allowUnfree = true; };
pkgsStable = import nixpkgs-stable { inherit system; config.allowUnfree = true; };
nixpkgs-patched = let
pkgs = (import nixpkgs { inherit system; config = {}; });
in pkgs.applyPatches {
name = "nixpkgs-patched";
src = nixpkgs;
patches = with pkgs; [
./update-openrazer.patch
];
};
pkgsUnpatched = (import nixpkgs { inherit system; });
lowerBuildCores = drv: drv.overrideAttrs(old: {
postConfigure = ''
export NIX_BUILD_CORES=8
'';
});
pkgs = import nixpkgs-patched {
inherit system;
config.allowUnfree = true;
config.permittedInsecurePackages = [
"lepton-unstable-2019-08-20"
"olm-3.2.16"
];
overlays = [
(final: prev: {
looking-glass-client = pkgs.callPackage ./pkgs/looking-glass/looking-glass.nix { src = looking-glass-src // { name = "source"; }; terminal = false; };
gb-backup = pkgs.callPackage ./pkgs/gb-backup/gb.nix { src = gb-src; };
prismlauncher = prism.packages.${system}.default.override { jdks = [ pkgs.jdk17 pkgs.jdk8 pkgs.zulu8 ]; };
#prismlauncher = prism.packages.${system}.default;
#bzip2 = final.bzip2_1_1;
steam = prev.steam.override { extraArgs = "-noreactlogin"; };
helvum = pkgsStable.helvum;
astyle = prev.astyle.overrideAttrs(old: {
src = pkgs.fetchurl {
url = "https://gigenet.dl.sourceforge.net/project/astyle/astyle/astyle%203.4/astyle-3.4.10.tar.bz2";
sha256 = "sha256-b2fshytDe9PFHg914RLk2/2ybV+3vZz4pIDxCvVVcGM=";
};
});
nix-alien = nix-alien.packages.${system}.default;
})
];
};
home-manager-patched = pkgs.applyPatches {
name = "home-manager-patched";
src = home-manager;
patches = with pkgs; [
];
};
nixosSystem = args:
import "${nixpkgs-patched}/nixos/lib/eval-config.nix" (args // {
modules = args.modules ++ [ {
system.nixos.versionSuffix = ".${pkgs.lib.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}.${self.shortRev or "dirty"}";
system.nixos.revision = pkgs.lib.mkIf (self ? rev) self.rev;
} ];
});
in {
nixosConfigurations.nixos = nixosSystem {
inherit system;
modules = [
(import "${home-manager-patched}/nixos")
memflow.nixosModule
agenix.nixosModules.age
./configuration.nix
];
inherit pkgs;
specialArgs = { inherit inputs; };
};
darwinConfigurations.soybook = darwin.lib.darwinSystem {
system = "aarch64-darwin";
modules = [
home-manager.darwinModules.home-manager
./macbook/macbook-config.nix
];
specialArgs = { inherit inputs; };
pkgs = import nixpkgs {
system = "aarch64-darwin";
config.allowUnfree = true;
overlays = [
(final: prev: {
#prismlauncher = prism.packages.${system}.default.override { extraJDKs = [ final.zulu8 ]; };
prismlauncher = prism.packages."aarch64-darwin".default;
})
#prism.overlay
];
};
};
};
}