forked from PetarKirov/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
95 lines (86 loc) · 2.62 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
{
description = "NixOS configuration";
nixConfig = {
extra-substituters = "https://petar-kirov-dotfiles.cachix.org";
extra-trusted-public-keys = "petar-kirov-dotfiles.cachix.org-1:WW4VsSGibdlNBDpqSsVhjVpz5/FZBX8uS0+yLdFEYP0=";
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-23.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-on-droid = {
url = "github:t184256/nix-on-droid";
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
};
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
flake-utils-plus = {
url = "github:gytis-ivaskevicius/flake-utils-plus";
};
nixd = {
url = "github:nix-community/nixd";
inputs.flake-parts.follows = "flake-parts";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
home-manager,
nixpkgs,
nixpkgs-unstable,
nix-on-droid,
flake-parts,
...
} @ inputs: let
defaultUser = "zlx";
in
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
_module.args = {inherit defaultUser;};
imports = [./nixos/machines];
flake = {
nixOnDroidConfigurations.device = nix-on-droid.lib.nixOnDroidConfiguration {
config = ./nix-on-droid.nix;
system = "aarch64-linux";
};
};
perSystem = {
pkgs,
unstablePkgs,
system,
inputs',
...
}: let
makeHomeConfig = modules: username:
home-manager.lib.homeManagerConfiguration {
inherit pkgs modules;
extraSpecialArgs = {inherit username unstablePkgs inputs' inputs;};
};
in {
_module.args = {
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
unstablePkgs = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
};
devShells.default = import ./shell.nix {inherit pkgs;};
legacyPackages.homeConfigurations = rec {
${defaultUser} = home-config-full;
home-config-base = makeHomeConfig [./nixos/home/base] defaultUser;
home-config-full = makeHomeConfig [./nixos/home/full] defaultUser;
home-config-macos = makeHomeConfig [./nixos/home/macos] "pkirov";
};
};
};
}