-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathflake.nix
111 lines (106 loc) · 3.7 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
{
description = "ymatsiuk NixOS configuration";
inputs = {
awsvpnclient.url = "github:ymatsiuk/awsvpnclient";
awsvpnclient.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-small.url = "github:nixos/nixpkgs/nixos-unstable-small";
nixpkgs-wayland.inputs.nixpkgs.follows = "nixpkgs";
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
nur.url = "github:nix-community/NUR";
};
outputs = { self, awsvpnclient, nixpkgs, nur, home-manager, nixpkgs-wayland, flake-utils, nixpkgs-small }:
let
makeOpinionatedNixpkgs = system: overlays:
import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
# use nixos-unstable-small as the most recent kernel source
(final: prev: {
linuxPackages = prev.recurseIntoAttrs (prev.linuxPackagesFor final.linux_latest);
linux_latest = nixpkgs-small.legacyPackages.${system}.linux_latest;
})
] ++ overlays;
};
makeOpinionatedNixosConfig = { system, modules, overlays }:
let
pkgs = makeOpinionatedNixpkgs system overlays;
in
nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./common.nix
home-manager.nixosModules.home-manager
{
nix.extraOptions = "experimental-features = nix-command flakes";
nix.package = pkgs.nixUnstable;
nix.registry.nixpkgs.flake = nixpkgs;
nix.settings.trusted-public-keys = [
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
];
nix.settings.substituters = [
"https://nixpkgs-wayland.cachix.org/"
];
nixpkgs = { inherit pkgs; };
}
] ++ modules;
};
in
{
nixosConfigurations = {
nixps = makeOpinionatedNixosConfig {
system = "x86_64-linux";
overlays = [
nixpkgs-wayland.overlay
nur.overlay
self.overlays.wayland
self.overlays.temp
awsvpnclient.overlay
];
modules = [
./nixps.nix
{ networking.hostName = "nixps"; }
];
};
nixpi4 = makeOpinionatedNixosConfig {
system = "aarch64-linux";
overlays = [ ];
modules = [
{ networking.hostName = "nixpi4"; }
./nixpi.nix
];
};
nixpi3 = makeOpinionatedNixosConfig {
system = "aarch64-linux";
overlays = [ ];
modules = [
{ networking.hostName = "nixpi3"; }
./nixpi.nix
];
};
# nix build ".#nixosConfigurations.nixpisdi4"
nixpisdi4 = self.nixosConfigurations.nixpi4.config.system.build.sdImage;
# nix build ".#nixosConfigurations.nixpisdi3"
nixpisdi3 = self.nixosConfigurations.nixpi3.config.system.build.sdImage;
};
overlays = {
wayland = final: prev: {
firefox = prev.firefox-bin.override { forceWayland = true; };
};
temp = final: prev: {
thermald = prev.thermald.overrideAttrs (oldAttrs: { configureFlags = oldAttrs.configureFlags ++ [ "--disable-werror" ]; });
};
};
} // flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
let
pkgs = makeOpinionatedNixpkgs system [ ];
in
{
packages = { };
}
);
}