This repository has been archived by the owner on Oct 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
140 lines (125 loc) · 4.19 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
{
description = "Padraic-O-Mhuiris - NixOS";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-22.11";
hardware.url = "github:NixOS/nixos-hardware";
emacs.url = "github:nix-community/emacs-overlay";
home-manager = {
url = "github:nix-community/home-manager/release-22.11";
inputs.nixpkgs.follows = "nixpkgs";
};
fup.url = "github:gytis-ivaskevicius/flake-utils-plus";
deploy-rs.url = "github:serokell/deploy-rs";
fenix.url = "github:nix-community/fenix";
sops.url = "github:Mic92/sops-nix";
foundry.url = "github:shazow/foundry.nix/monthly";
nix-doom-emacs.url = "github:nix-community/nix-doom-emacs";
ethereum = {
url = "github:nix-community/ethereum.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nur.url = "github:nix-community/NUR";
hyprland.url = "github:hyprwm/Hyprland";
devshell.url = "github:numtide/devshell";
};
outputs = { self, nixpkgs, nixpkgs-master, nixpkgs-stable, home-manager, sops
, hardware, emacs, fup, deploy-rs, fenix, foundry, ethereum, nur, hyprland
, devshell, ... }@inputs:
let
inherit (fup.lib) mkFlake;
lib = nixpkgs.lib.extend (import ./lib);
in mkFlake {
inherit self inputs lib;
channels.master.input = nixpkgs-master;
channels.stable.input = nixpkgs-stable;
channels.nixpkgs.overlaysBuilder = channels: [
(final: prev: { inherit (channels) master; })
(final: prev: { inherit (channels) stable; })
];
channelsConfig = {
allowBroken = true;
allowUnfree = true;
};
hostDefaults.system = "x86_64-linux";
hostDefaults.modules =
[ home-manager.nixosModules.home-manager sops.nixosModules.sops ];
sharedOverlays = [
(self: super: {
nix-direnv = super.nix-direnv.override { enableFlakes = true; };
})
(self: super: {
fcitx-engines = self.fcitx5;
}) # https://discourse.nixos.org/t/error-when-upgrading-nixos-related-to-fcitx-engines/26940/8
emacs.overlay
fenix.overlays.default
foundry.overlay
nur.overlay
devshell.overlays.default
];
hosts = lib.mkHosts ./hosts { inherit inputs; };
deploy = {
autoRollback = true;
remoteBuild = true;
fastConnection = false;
nodes = {
Nitrogen = {
hostname = "nitrogen.tail69d72.ts.net";
user = "root";
sshUser = "root";
profiles = {
system.path = deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.Nitrogen;
};
};
};
};
outputsBuilder = channels:
let pkgs = channels.nixpkgs;
in {
devShells = {
default = pkgs.devshell.mkShell {
name = "secrets";
packages = with pkgs; [ sops age ssh-to-age ];
env = [
{
name = "SOPS_AGE_KEY";
eval =
''$(ssh-to-age -private-key -i "$HOME/.ssh/id_ed25519")'';
}
{
name = "EDITOR";
value = "vim";
}
];
};
nixos = pkgs.devshell.mkShell {
name = "secrets";
packages = with pkgs; [ sops age ssh-to-age ];
env = [
{
name = "SOPS_AGE_KEY";
eval = "$(pass show machines/user/nixos/age)";
}
{
name = "EDITOR";
value = "vim";
}
];
};
};
};
checks = builtins.mapAttrs
(system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
# outputsBuilder = (channels: {
# devShell = channels.nixpkgs.mkShell {
# name = "nix-deploy-shell";
# buildInputs = with channels.nixpkgs; [
# nixUnstable
# inputs.deploy-rs.defaultPackage.${system}
# ];
# };
#});
};
}