-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
115 lines (96 loc) · 2.89 KB
/
Copy pathflake.nix
File metadata and controls
115 lines (96 loc) · 2.89 KB
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
{
description = "bedrock — DigitalOcean NixOS droplet with Subduction sync server";
inputs = {
command-utils.url = "git+https://codeberg.org/expede/nix-command-utils";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
home-manager.url = "github:nix-community/home-manager/release-25.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
subduction.url = "github:inkandswitch/subduction";
subduction.inputs.nixpkgs.follows = "nixpkgs";
unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = {
self,
command-utils,
disko,
flake-utils,
home-manager,
nixpkgs,
subduction,
unstable,
...
}: let
hostname = "bedrock";
adminUsername = "expede";
targetSystem = "x86_64-linux";
targetPkgs = import nixpkgs { system = targetSystem; };
unstablePkgs = import unstable {
system = targetSystem;
config.allowUnfree = true;
};
# On-server command bundle. Same UX as the dev-shell menu, but the
# underlying scripts run locally (no SSH). Added to
# `environment.systemPackages` in configuration.nix so every account on
# bedrock gets `menu`, `logs:tail`, `deploy:gens`, … in their PATH.
bedrockMenu = command-utils.commands.${targetSystem} [
{
commands = import ./nix/server-commands.nix {
pkgs = targetPkgs;
system = targetSystem;
cmd = command-utils.cmd.${targetSystem};
subduction = subduction;
};
packages = [];
}
];
in {
nixosConfigurations.${hostname} = nixpkgs.lib.nixosSystem {
system = targetSystem;
specialArgs = {
inherit hostname adminUsername bedrockMenu;
unstable = unstablePkgs;
};
modules = [
disko.nixosModules.disko
home-manager.nixosModules.home-manager
subduction.nixosModules.default
./configuration.nix
./digitalocean.nix
./disk-config.nix
./hardware-configuration.nix
./nix.nix
];
};
} //
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs { inherit system; };
cmd = command-utils.cmd.${system};
projectCommands = import ./nix/commands.nix {
inherit pkgs system cmd;
};
command_menu = command-utils.commands.${system} [
{ commands = projectCommands; packages = []; }
];
in {
devShells.default = pkgs.mkShell {
name = "bedrock-shell";
nativeBuildInputs = [
command_menu
pkgs.curl
pkgs.git
pkgs.jq
pkgs.nixos-rebuild
pkgs.openssh
pkgs.ripgrep
];
shellHook = ''
export BEDROCK_ROOT="$(pwd)"
menu
'';
};
formatter = pkgs.nixpkgs-fmt;
});
}