-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
111 lines (111 loc) · 2.93 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
109
110
111
{
description = "NixOS Flake for @tatupesonen configs";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-wsl.url = "github:nix-community/NixOS-WSL";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim/nixos-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
vscode-server = {
url = "github:nix-community/nixos-vscode-server";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
};
outputs = {
nixpkgs,
nixos-wsl,
vscode-server,
home-manager,
nixpkgs-unstable,
...
} @ inputs: {
formatter."x86_64-linux" = nixpkgs.legacyPackages."x86_64-linux".alejandra;
devShells = {
x86_64-linux.default = let
pkgs = import nixpkgs {
system = "x86_64-linux";
};
in
pkgs.mkShell {
packages = with pkgs; [
alejandra
nil
];
};
};
nixosConfigurations = let
userConfig = {
userName = "tatu";
fullName = "Tatu Pesonen";
userEmail = "tatu@narigon.dev";
root = true;
};
systemConfig = system: modules: prof:
nixpkgs.lib.nixosSystem {
specialArgs = {
pkgs-unstable = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
inherit inputs userConfig;
};
inherit system;
modules =
[
home-manager.nixosModules.home-manager
(
{...}: {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users = {
"${userConfig.userName}" = import ./home;
};
extraSpecialArgs = {
inherit inputs prof userConfig;
};
};
}
)
# Default module imported for all hosts
./modules/nixos/system.nix
./modules/dev
./modules/nixos/ssh.nix
]
++ modules;
};
in {
# WSL host Nix modules
wsl =
systemConfig "x86_64-linux"
[
./hosts/wsl/wsl.nix
nixos-wsl.nixosModules.wsl
vscode-server.nixosModules.default
./modules/nixvim
]
# WSL host home modules
[./home/common];
vindicta =
systemConfig "x86_64-linux"
[
./hosts/vindicta/configuration.nix
./modules/dev
./modules/misc/docker.nix
./modules/work
./modules/nixvim
]
[
./home/common
./home/work
./home/style
];
};
};
}