mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-26 23:14:57 +08:00
Add 'here' VM
And justfile as well
This commit is contained in:
parent
6545764534
commit
fac4275980
4 changed files with 77 additions and 0 deletions
11
flake.nix
11
flake.nix
|
|
@ -73,6 +73,15 @@
|
|||
flake = {
|
||||
# Configurations for Linux (NixOS) systems
|
||||
nixosConfigurations = {
|
||||
here = self.nixos-flake.lib.mkLinuxSystem {
|
||||
imports = [
|
||||
self.nixosModules.common # Defined in nixos/default.nix
|
||||
./systems/here.nix
|
||||
./nixos/server/harden.nix
|
||||
];
|
||||
services.tailscale.enable = true;
|
||||
};
|
||||
|
||||
immediacy = self.nixos-flake.lib.mkLinuxSystem {
|
||||
imports = [
|
||||
self.nixosModules.default # Defined in nixos/default.nix
|
||||
|
|
@ -135,6 +144,8 @@
|
|||
pkgs.nixpkgs-fmt
|
||||
pkgs.sops
|
||||
pkgs.ssh-to-age
|
||||
pkgs.nixos-rebuild
|
||||
pkgs.just
|
||||
];
|
||||
};
|
||||
formatter = config.treefmt.build.wrapper;
|
||||
|
|
|
|||
5
justfile
Normal file
5
justfile
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
default:
|
||||
@just --list
|
||||
|
||||
here:
|
||||
nixos-rebuild switch --fast --flake .#here --target-host $USER@here --build-host $USER@here --use-remote-sudo
|
||||
34
systems/disko/vm.nix
Normal file
34
systems/disko/vm.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/sda";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
size = "1M";
|
||||
type = "EF02"; # for grub MBR
|
||||
};
|
||||
ESP = {
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
27
systems/here.nix
Normal file
27
systems/here.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# My Linux VM running on macOS
|
||||
{ flake, modulesPath, ... }: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
flake.inputs.disko.nixosModules.disko
|
||||
];
|
||||
system.stateVersion = "23.11";
|
||||
services.openssh.enable = true;
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
binfmt.emulatedSystems = [ "x86_64-linux" ]; # For cross-compiling
|
||||
swraid.mdadmConf = ''
|
||||
MAILADDR srid@srid.ca
|
||||
'';
|
||||
};
|
||||
nixpkgs.hostPlatform = "aarch64-linux";
|
||||
|
||||
networking = {
|
||||
hostName = "here";
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
time.timeZone = "America/New_York";
|
||||
disko.devices = import ./disko/vm.nix;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue