-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
119 lines (112 loc) · 3.46 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
{
description = "images for creation";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
notify = {
url = "github:martiert/khal_notifications";
inputs.nixpkgs.follows = "nixpkgs";
};
blocklist = {
url = "github:hagezi/dns-blocklists";
flake = false;
};
module = {
url = "github:martiert/nixos-module";
inputs = {
nixpkgs.follows = "nixpkgs";
blocklist.follows = "blocklist";
};
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
deploy-rs.url = "github:serokell/deploy-rs";
nixos-hardware.url = "github:NixOS/nixos-hardware";
};
outputs = { self, nixpkgs, module, flake-utils, agenix, home-manager, nixos-generators, nixos-hardware, deploy-rs, notify, ... }@inputs:
let
lib = nixpkgs.lib.extend(self: super: (import ./lib) {
inherit nixpkgs module nixos-hardware home-manager agenix notify;
lib = super;
});
mkDeploy = name: config:
{
hostname = config.deployTo;
profiles.system = {
sshUser = "martin";
user = "root";
interactiveSudo = true;
path = deploy-rs.lib."${config.system}".activate.nixos self.nixosConfigurations."${name}";
};
};
in {
nixosConfigurations = lib.forAllNixHosts lib.makeNixosConfig;
homeConfigurations."mertsas" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs { system = "x86_64-linux"; };
modules = [
module.nixosModules.home-manager
{
nixpkgs.overlays = [
module.overlays.x86_64-linux
(import ./overlay/dummy.nix)
];
home = {
stateVersion = "23.05";
username = "mertsas";
homeDirectory = "/home/mertsas";
};
programs.zsh.envExtra = "PATH=/home/mertsas/.nix-profile/bin:$PATH";
# programs.tmux.shell = "$SHELL";
targets.genericLinux.enable = true;
martiert = {
system.type = "laptop";
i3 = {
enable = true;
};
};
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"google-chrome"
"zoom"
"webex"
"spotify"
"steam"
"steam-original"
];
}
];
};
deploy.nodes =
lib.forNixHostsWhere
(config: builtins.hasAttr "deployTo" config)
mkDeploy;
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
packages.x86_64-linux = {
virtualbox = nixos-generators.nixosGenerate {
system = "x86_64-linux";
format = "virtualbox";
modules = [
{
nix.registry.nixpkgs.flake = nixpkgs;
imports = [ ./virtualbox ];
}
];
};
};
};
nixConfig = {
substituters = [
"https://cache.nixos.org"
"https://cache.martiert.com"
];
};
}