-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
161 lines (156 loc) · 4.79 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
{
description = "Nix Development Environment";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
nixpkgs-wayland.inputs.nixpkgs.follows = "nixpkgs";
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
emacs-overlay.url = "github:nix-community/emacs-overlay";
declarative-cachix.url = "github:jonascarpay/declarative-cachix";
nixos-wsl.url = "github:nix-community/NixOS-WSL";
nixos-wsl.inputs.nixpkgs.follows = "nixpkgs";
vscode-server.url = "github:nix-community/nixos-vscode-server";
nix-index-database.url = "github:nix-community/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
# zellij.url = "github:a-kenji/zellij-nix";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
plug-kak = {
url = "github:andreyorst/plug.kak";
flake = false;
};
alacritty-theme = {
url = "github:eendroroy/alacritty-theme";
flake = false;
};
wsl-open = {
url = "gitlab:4U6U57/wsl-open";
flake = false;
};
# fish
fish-ssh-agent = {
url = "github:danhper/fish-ssh-agent";
flake = false;
};
fish-docker-compose = {
url = "github:brgmnn/fish-docker-compose";
flake = false;
};
vscode-fish = {
url = "github:kidonng/vscode.fish";
flake = false;
};
};
outputs = {self, ...} @ inputs: let
nixpkgsConfig = {
config = {allowUnfree = true;};
overlays = [
inputs.nixpkgs-wayland.overlay
inputs.neovim-nightly-overlay.overlay
inputs.emacs-overlay.overlay
];
};
specialArgs = {inherit inputs;};
in (
inputs.flake-utils.lib.eachDefaultSystem
(system: let
pkgs = import inputs.nixpkgs (nixpkgsConfig // {inherit system;});
in {
# expose the system nixpkgs for searching, shells
# run 'nix registry add dots /path/to/repo`
# then you can search like `nix search dots <query>`
legacyPackages = pkgs;
devShell = pkgs.mkShell rec {
name = "dots";
buildInputs = with pkgs; [
(import inputs.home-manager {inherit pkgs;}).home-manager
nixVersions.stable
git
(nixos-rebuild.override {nix = nixVersions.stable;})
stow
];
NIX_PATH = builtins.concatStringsSep ":" [
"nixpkgs=${inputs.nixpkgs}"
"home-manager=${inputs.home-manager}"
];
NIXOS_CONFIG = ./configuration.nix;
};
})
// {
nixosConfigurations = let
mkSystem = extraModules: (
inputs.nixpkgs.lib.nixosSystem {
inherit specialArgs;
system = "x86_64-linux";
modules =
extraModules
++ [
{nixpkgs = nixpkgsConfig;}
inputs.home-manager.nixosModules.home-manager
{home-manager.extraSpecialArgs = specialArgs;}
];
}
);
in {
tormund = mkSystem [./systems/tormund];
nixos = mkSystem [
{system.stateVersion = "23.05";}
./systems/wsl-nixos
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.meatcar = {...}: {
imports = [
./home-manager/systems/wsl-nixos.nix
];
home.stateVersion = "23.05";
};
}
];
};
homeConfigurations = let
system = "x86_64-linux";
pkgs = import inputs.nixpkgs ({
inherit system;
}
// nixpkgsConfig);
in {
meatcar = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = specialArgs;
modules = [
./home-manager/systems/wsl-singleuser.nix
{
nixpkgs = nixpkgsConfig;
home = rec {
username = "meatcar";
homeDirectory = "/home/${username}";
stateVersion = "20.09";
};
}
];
};
deck = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = specialArgs;
modules = [
./home-manager/systems/steamdeck.nix
{
nixpkgs = nixpkgsConfig;
home = rec {
username = "deck";
homeDirectory = "/home/${username}";
stateVersion = "23.05";
};
}
];
};
};
}
);
}