-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
90 lines (79 loc) · 3.07 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
{
description = "One mans configurations";
inputs = {
# nixpkgs.url = "github:NixOS/nixpkgs/d4899e96eb336485b0f22e60282b999d5493f854";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-21.11";
emacs-community-overlay.url = "github:nix-community/emacs-overlay";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
deploy-rs.url = "github:serokell/deploy-rs";
# deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
agenix.url = "github:ryantm/agenix"; # welp, that's only for servers
homeage.url = "github:jordanisaacs/homeage";
htmx-examples.url =
"git+ssh://[email protected]:65433/efim/Learning-HTMX.git";
planning-poker-kazbegi.url =
"git+ssh://[email protected]:65433/efim/planning-poker-gwargh.git";
go-ssr-oauth-attempt.url =
"git+ssh://[email protected]:65433/efim/go-ssr-pocketbase-oauth-attempt-github-mirror.git";
some-automoderation.url =
"git+ssh://[email protected]:65433/efim/some-automoderation.git";
};
outputs = { self, nixpkgs, home-manager, deploy-rs, ... }@inputs:
let
utils = import ./kinda-utils.nix;
findModules = utils.findModules;
rev = if self ? rev then self.rev else null;
in {
myModules = builtins.listToAttrs (findModules ./modules);
myProfiles = builtins.listToAttrs (findModules ./profiles);
myRoles = import ./roles;
nixosConfigurations.chunky-notebook = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ ./machines/chunky-notebook/base-conf.nix ];
specialArgs = { inherit inputs rev; };
};
homeConfigurations.work-laptop =
home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [{
imports = [ ./machines/work-laptop/home-for-flake.nix ];
home = {
homeDirectory = "/home/enefedov";
username = "enefedov";
stateVersion = "21.11";
};
nix.registry.nixpkgs.flake = nixpkgs;
}];
extraSpecialArgs = { inherit inputs; };
};
nixosConfigurations.franzk = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./machines/franzk/configuration.nix
# agenix.nixosModule
];
specialArgs = { inherit inputs rev; };
};
deploy = {
magicRollback = true;
nodes = {
franzk = {
hostname = "franzk";
profiles = {
system = {
user = "root";
sshUser = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.franzk;
};
};
};
};
};
# This is highly advised, and will prevent many possible mistakes
checks = builtins.mapAttrs
(system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
};
}