-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
104 lines (92 loc) · 2.6 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
{
description = "hasundue's system configuration";
nixConfig = {
extra-trusted-substituters = [
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:nixos/nixos-hardware";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-wsl = {
url = "github:nix-community/nixos-wsl";
inputs.nixpkgs.follows = "nixpkgs";
};
firefox-addons = {
url = "sourcehut:~rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
stylix = {
url = "github:danth/stylix";
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
};
};
neovim-flake = {
url = "github:hasundue/neovim-flake";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
outputs = { nixpkgs, home-manager, stylix, ... } @ inputs:
let
inherit (nixpkgs) lib;
forSystem = system: f: f {
inherit lib;
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
(final: prev: {
firefox-addons = inputs.firefox-addons.packages.${system};
})
];
};
neovim-flake = inputs.neovim-flake.${system};
};
forEachSystem = f: lib.genAttrs
[ "x86_64-linux" ]
(system: forSystem system f);
nixosSystem = system: host: forSystem system (args: lib.nixosSystem {
inherit system;
modules = [
{ nixpkgs.pkgs = args.pkgs; }
home-manager.nixosModules.home-manager
stylix.nixosModules.stylix
host
];
specialArgs = {
inherit (inputs) nixos-hardware nixos-wsl;
inherit (args) neovim-flake;
};
});
homeConfig = args: home-manager.lib.homeManagerConfiguration {
inherit (args) pkgs;
modules = [ ./home ];
extraSpecialArgs = {
inherit (args) neovim-flake;
};
};
in
{
devShells = forEachSystem (import ./shells);
nixosConfigurations = {
# Thinkpad X1 Carbon 5th Gen
x1carbon = nixosSystem "x86_64-linux" ./hosts/x1carbon;
# NixOS-WSL
nixos = nixosSystem "x86_64-linux" ./hosts/wsl;
};
homeConfigurations = forEachSystem homeConfig;
};
}