-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
123 lines (121 loc) · 3.91 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
{
description = "NixOS configuration";
inputs = {
ghostty.url = "github:ghostty-org/ghostty";
disko.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
emacs-overlay.url = "github:nix-community/emacs-overlay";
flake-parts.url = "github:hercules-ci/flake-parts";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
impermanence.url = "github:nix-community/impermanence";
nixos-anywhere.inputs.nixpkgs.follows = "nixpkgs";
nixos-anywhere.url = "github:nix-community/nixos-anywhere";
nixos-facter-modules.url = "github:numtide/nixos-facter-modules";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nixpkgs-android.url = "github:NixOS/nixpkgs/nixos-23.11";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.url = "github:Mic92/sops-nix";
home-manager-android = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs-android";
};
nix-on-droid = {
url = "github:nix-community/nix-on-droid/release-23.11";
inputs.nixpkgs.follows = "nixpkgs-android";
inputs.home-manager.follows = "home-manager-android";
};
};
outputs = inputs @ {
self,
ghostty,
emacs-overlay,
flake-parts,
home-manager,
nixos-hardware,
sops-nix,
disko,
home-manager-android,
nix-on-droid,
nixpkgs,
nixpkgs-android,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} ({
withSystem,
inputs,
...
}: {
imports = [
./parts/nixos-modules.nix
];
systems = ["x86_64-linux"];
flake = {config, ...}: {
nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
modules = [
./nix-on-droid/nix-on-droid.nix
];
pkgs = import nixpkgs-android {
system = "aarch64-linux";
overlays = [
nix-on-droid.overlays.default
];
};
home-manager-path = home-manager-android.outPath;
};
nixosConfigurations = let
genSystem = user: host: extras:
withSystem "x86_64-linux" ({
pkgs,
system,
...
}:
inputs.nixpkgs.lib.nixosSystem {
inherit system;
modules =
[
config.nixosModules.nix-settings
inputs.sops-nix.nixosModules.sops
inputs.home-manager.nixosModules.home-manager
./hosts/${host}/configuration.nix
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${user} = import ./hosts/${host}/home.nix;
}
]
++ extras;
});
in {
zombie = genSystem "collin" "zombie" [];
vampire = genSystem "collin" "vampire" [];
azathoth = genSystem "collin" "azathoth" [
{
environment.systemPackages = [
ghostty.packages.x86_64-linux.default
];
}
inputs.disko.nixosModules.disko
inputs.impermanence.nixosModules.impermanence
inputs.nixos-facter-modules.nixosModules.facter
];
arachne = genSystem "collin" "arachne" [
./modules/zfs
"${nixpkgs}/nixos/modules/installer/scan/not-detected.nix"
"${nixos-hardware}/lenovo/thinkpad/t440p"
];
};
};
perSystem = {
pkgs,
system,
...
}: {
formatter = pkgs.alejandra;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [nil sops alejandra];
};
};
});
}