forked from PetarKirov/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
93 lines (81 loc) · 2.64 KB
/
flake.nix
File metadata and controls
93 lines (81 loc) · 2.64 KB
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
{
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-22.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-22.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-on-droid = {
url = "github:t184256/nix-on-droid";
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
};
};
omf-bobthefish.url = "github:oh-my-fish/theme-bobthefish";
omf-bobthefish.flake = false;
};
outputs = {
home-manager,
nixpkgs,
nixpkgs-unstable,
nix-on-droid,
omf-bobthefish,
...
}: let
system = "x86_64-linux";
defaultUser = "zlx";
users = [defaultUser];
pkgs = nixpkgs.legacyPackages.${system};
machines = builtins.attrNames (
nixpkgs.lib.filterAttrs
(n: v: v == "directory")
(builtins.readDir ./nixos/machines)
);
makeMachineConfig = defaultUser: hostname:
nixpkgs.lib.nixosSystem {
inherit system;
modules = [./nixos/machines/import-machine.nix];
specialArgs = {inherit defaultUser hostname;};
};
makeHomeConfig = username:
home-manager.lib.homeManagerConfiguration {
inherit system username;
homeDirectory = "/home/${username}";
configuration = import ./nixos/home/home.nix;
extraSpecialArgs = {
inherit omf-bobthefish;
unstablePkgs = import nixpkgs-unstable {
inherit system;
config = {allowUnfree = true;};
};
};
stateVersion = "21.11";
};
makeNixOnDroidConfig = username:
nix-on-droid.lib.nixOnDroidConfiguration {
config = ./nix-on-droid.nix;
system = "aarch64-linux";
extraModules = [
# import source out-of-tree modules like:
# flake.nixOnDroidModules.module
];
extraSpecialArgs = {
# arguments to be available in every nix-on-droid module
};
# your own pkgs instance (see nix-on-droid.overlay for useful additions)
# pkgs = ...;
};
in {
nixosConfigurations = pkgs.lib.genAttrs machines (makeMachineConfig defaultUser);
homeConfigurations = pkgs.lib.genAttrs users makeHomeConfig;
nixOnDroidConfigurations = {device = makeNixOnDroidConfig defaultUser;};
devShells."${system}".default = import ./shell.nix {inherit pkgs;};
};
}