-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
108 lines (102 loc) · 2.53 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
{
description = "Syu's NixOS flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
leftwm.url = "github:leftwm/leftwm";
lefthk.url = "github:Syudagye/lefthk";
eww.url = "github:elkowar/eww";
hyprland.url = "github:hyprwm/hyprland";
funky-tags.url = "github:Syudagye/funky-tags";
roc.url = "github:roc-lang/roc";
};
outputs =
{
nixpkgs,
home-manager,
...
}@inputs:
let
overlays = import ./overlays.nix;
mksys =
{
nixpkgs,
inputs,
hostname,
username,
}:
nixpkgs.lib.nixosSystem {
specialArgs = inputs;
modules = [
# System configuration
{
nixpkgs = {
inherit overlays;
config.allowUnfree = true;
};
}
./hardware/${hostname}
./hosts
./hosts/${hostname}
# Home configuration
inputs.home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = inputs;
users.${username} = import ./home/${hostname};
};
}
];
};
in
{
# Systems configs
nixosConfigurations = {
fancy-toaster = mksys {
inherit nixpkgs inputs;
hostname = "fancy-toaster";
username = "syu";
};
free-real-estate = mksys {
inherit nixpkgs inputs;
hostname = "free-real-estate";
username = "syu";
};
};
# home-manager configs
homeConfigurations.archbtw =
let
pkgs = import nixpkgs {
inherit overlays;
system = "x86_64-linux";
};
in
home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./home/archbtw ];
extraSpecialArgs = inputs;
};
formatter =
let
systems = [
"x86_64-linux"
"aarch64-linux"
];
in
nixpkgs.lib.genAttrs systems (
system:
let
pkgs = import nixpkgs {
inherit system overlays;
};
in
pkgs.nixfmt-rfc-style
);
overlays.default = overlays;
};
}