-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
71 lines (65 loc) · 2.23 KB
/
flake.nix
File metadata and controls
71 lines (65 loc) · 2.23 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
{
description = "davide's dotfiles";
inputs = {
nixpkgs.url = "nixpkgs/nixos-25.11";
home-manager = {
url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix = {
url = "github:nix-community/stylix/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim/nixos-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
rofi-nix-run = {
url = "github:ITHackerstein/rofi-nix-run/nixos-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.7.0";
};
outputs =
{ self, nixpkgs, home-manager, nixvim, stylix, nix-flatpak, rofi-nix-run, ... }:
let
lib = nixpkgs.lib;
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
rofi-nix-run-pkg = rofi-nix-run.packages.${system}.default;
makeSystem = host: users: nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit host users; };
modules = [
./hosts/${host}/configuration.nix
nix-flatpak.nixosModules.nix-flatpak
];
};
makeHome = { user, host }: home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = { inherit user host rofi-nix-run-pkg; };
modules = [
./homes/${host}/${user}/home.nix
nixvim.homeModules.nixvim
stylix.homeModules.stylix
];
};
system = "x86_64-linux";
hosts = {
"nixos-pc" = [ "davide" ];
"nixos-laptop" = [ "davide" ];
};
in
{
nixosConfigurations = lib.mapAttrs (host: users: makeSystem host users) hosts;
homeConfigurations = lib.foldl' (hostAcc: host:
hostAcc // lib.foldl' (userAcc: user:
userAcc // {
"${user}@${host}" = makeHome { inherit user host; };
}
) {} (hosts.${host})
) {} (builtins.attrNames hosts);
};
}