forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d723b8
commit d7e9baf
Showing
15 changed files
with
522 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./hardware-configuration.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# NixOS benchmarking setup | ||
|
||
## Deploy | ||
|
||
To deploy to a server, either select and existing *disk-config\*.nix*, or create a new one tailored to the target host. | ||
This example will use a Hetzner AX52 as target, which comes with 2 SSDs located at */dev/nvme1n1* and */dev/nvme0n1*. | ||
|
||
### Load NixOS configuration | ||
|
||
```bash | ||
$ nix-shell -p nixos-anywhere | ||
[nix-shell:~]$ RUNNER_TOKEN=<github runner token> nixos-anywhere --flake .#ax52 root@<ip_address> | ||
``` | ||
|
||
## Update | ||
|
||
```bash | ||
$ nix-shell -p nixos-rebuild | ||
[nix-shell:~]$ RUNNER_TOKEN=<github runner token> nixos-rebuild switch --flake .#ax52 --target-host root@<ip_address> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ modulesPath, lib, pkgs, ... }: | ||
{ | ||
system.activationScripts.setDataPermissions = '' | ||
chown satoshi:users /data | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ modulesPath, lib, pkgs, ... }: | ||
{ | ||
imports = [ | ||
(modulesPath + "/installer/scan/not-detected.nix") | ||
(modulesPath + "/profiles/qemu-guest.nix") | ||
./modules/users.nix | ||
./modules/security.nix | ||
./modules/packages.nix | ||
./modules/system.nix | ||
]; | ||
|
||
boot.loader.grub = { | ||
efiSupport = true; | ||
efiInstallAsRemovable = true; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ lib, ... }: | ||
{ | ||
disko.devices = { | ||
disk.disk1 = { | ||
device = lib.mkDefault "/dev/nvme1n1"; | ||
type = "disk"; | ||
content = { | ||
type = "gpt"; | ||
partitions = { | ||
boot = { | ||
name = "boot"; | ||
size = "1M"; | ||
type = "EF02"; | ||
}; | ||
esp = { | ||
name = "ESP"; | ||
size = "500M"; | ||
type = "EF00"; | ||
content = { | ||
type = "filesystem"; | ||
format = "vfat"; | ||
mountpoint = "/boot"; | ||
}; | ||
}; | ||
root = { | ||
name = "root"; | ||
size = "100%"; | ||
content = { | ||
type = "lvm_pv"; | ||
vg = "pool"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
disk.disk2 = { | ||
device = lib.mkDefault "/dev/nvme0n1"; | ||
type = "disk"; | ||
content = { | ||
type = "gpt"; | ||
partitions = { | ||
data = { | ||
name = "data"; | ||
size = "100%"; | ||
content = { | ||
type = "filesystem"; | ||
format = "ext4"; | ||
mountpoint = "/data"; | ||
mountOptions = [ | ||
"defaults" | ||
]; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
lvm_vg = { | ||
pool = { | ||
type = "lvm_vg"; | ||
lvs = { | ||
root = { | ||
size = "100%FREE"; | ||
content = { | ||
type = "filesystem"; | ||
format = "ext4"; | ||
mountpoint = "/"; | ||
mountOptions = [ | ||
"defaults" | ||
]; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Example to create a bios compatible gpt partition | ||
{ lib, ... }: | ||
{ | ||
disko.devices = { | ||
disk.disk1 = { | ||
device = lib.mkDefault "/dev/sda"; | ||
type = "disk"; | ||
content = { | ||
type = "gpt"; | ||
partitions = { | ||
boot = { | ||
name = "boot"; | ||
size = "1M"; | ||
type = "EF02"; | ||
}; | ||
esp = { | ||
name = "ESP"; | ||
size = "500M"; | ||
type = "EF00"; | ||
content = { | ||
type = "filesystem"; | ||
format = "vfat"; | ||
mountpoint = "/boot"; | ||
}; | ||
}; | ||
root = { | ||
name = "root"; | ||
size = "100%"; | ||
content = { | ||
type = "lvm_pv"; | ||
vg = "pool"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
lvm_vg = { | ||
pool = { | ||
type = "lvm_vg"; | ||
lvs = { | ||
root = { | ||
size = "100%FREE"; | ||
content = { | ||
type = "filesystem"; | ||
format = "ext4"; | ||
mountpoint = "/"; | ||
mountOptions = [ | ||
"defaults" | ||
]; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
inputs.disko.url = "github:nix-community/disko"; | ||
inputs.disko.inputs.nixpkgs.follows = "nixpkgs"; | ||
inputs.home-manager.url = "github:nix-community/home-manager"; | ||
inputs.home-manager.inputs.nixpkgs.follows = "nixpkgs"; | ||
|
||
outputs = { nixpkgs, disko, home-manager, ... }: { | ||
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt; | ||
nixosConfigurations = { | ||
# Generic configuration | ||
generic = nixpkgs.lib.nixosSystem { | ||
system = "x86_64-linux"; | ||
modules = [ | ||
disko.nixosModules.disko | ||
home-manager.nixosModules.home-manager | ||
./configuration.nix | ||
./hardware-configuration.nix | ||
./nix-channel-setup.nix | ||
]; | ||
}; | ||
|
||
# Hetzner AX52 specific configuration | ||
ax52 = nixpkgs.lib.nixosSystem { | ||
system = "x86_64-linux"; | ||
modules = [ | ||
disko.nixosModules.disko | ||
home-manager.nixosModules.home-manager | ||
./configuration.nix | ||
./disks/disk-config-ax52.nix | ||
./nix-channel-setup.nix | ||
./ax52-setup.nix | ||
]; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
throw "Have you forgotten to run nixos-anywhere with `--generate-hardware-config nixos-generate-config ./hardware-configuration.nix`?" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ config, lib, pkgs, ... }: | ||
{ | ||
environment.systemPackages = with pkgs; [ | ||
# Development tools | ||
bash | ||
coreutils | ||
docker | ||
findutils | ||
git | ||
gnugrep | ||
gnused | ||
gnutar | ||
podman | ||
python3 | ||
|
||
# Shell utilities | ||
bat | ||
curl | ||
eza | ||
fd | ||
just | ||
mosh | ||
neovim | ||
ripgrep | ||
tmux | ||
|
||
# System tools | ||
ccache | ||
magic-wormhole | ||
time | ||
]; | ||
} |
Oops, something went wrong.