Skip to content

Commit

Permalink
fix: enable sudo password - proxmox
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan4yin committed Mar 7, 2024
1 parent 10e6c0f commit 870ff73
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 21 deletions.
14 changes: 11 additions & 3 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,18 @@ aarch:
colmena apply --on '@aarch' --verbose --show-trace

suzu:
colmena apply --on '@suzu' --verbose --show-trace
colmena apply --on '@suzu' --build-on-target --verbose --show-trace

suzu-debug:
colmena apply --on '@suzu' --verbose --show-trace
suzu-local mode="default":
use utils.nu *; \
nixos-switch suzu {{mode}}

rakushun:
colmena apply --on '@rakushun' --build-on-target --verbose --show-trace

rakushun-local mode="default":
use utils.nu *; \
nixos-switch rakushun {{mode}}

############################################################################
#
Expand Down
2 changes: 1 addition & 1 deletion hosts/12kingdoms_rakushun/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Generate LUKS keyfile to encrypt the root partition, it's used by disko.

```bash
# partition the usb stick
DEV=/dev/sda
DEV=/dev/sdX
parted ${DEV} -- mklabel gpt
parted ${DEV} -- mkpart OPI5P_DSC fat32 0% 512MB
mkfs.fat -F 32 -n OPI5P_DSC ${DEV}1
Expand Down
8 changes: 7 additions & 1 deletion hosts/12kingdoms_rakushun/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ in {
inherit (vars_networking) defaultGateway nameservers;

networkmanager.enable = false;
interfaces.end1 = {
# RJ45 port 1
interfaces.enP4p65s0 = {
useDHCP = false;
ipv4.addresses = [hostAddress];
};
# RJ45 port 2
# interfaces.enP3p49s0 = {
# useDHCP = false;
# ipv4.addresses = [hostAddress];
# };
};

# This value determines the NixOS release from which the default
Expand Down
15 changes: 10 additions & 5 deletions hosts/12kingdoms_rakushun/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@
(modulesPath + "/installer/scan/not-detected.nix")
];

# Use the EFI boot loader.
boot.loader.efi.canTouchEfiVariables = true;
# depending on how you configured your disk mounts, change this to /boot or /boot/efi.
boot.loader.efi.efiSysMountPoint = "/boot";
boot.loader.systemd-boot.enable = true;
boot.loader = {
# depending on how you configured your disk mounts, change this to /boot or /boot/efi.
efi.efiSysMountPoint = "/boot/";
efi.canTouchEfiVariables = true;
# do not use systemd-boot here, it has problems when running `nixos-install`
grub = {
device = "nodev";
efiSupport = true;
};
};
# clear /tmp on boot to get a stateless /tmp directory.
boot.tmp.cleanOnBoot = true;

Expand Down
2 changes: 1 addition & 1 deletion hosts/12kingdoms_suzu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ssh rk@<ip-addr>

git clone https://github.com/ryan4yin/nix-config.git

cd nix-config/hosts/12kingdoms_suzu
cd ~/nix-config/hosts/12kingdoms_suzu
# 1. change the disk device path in ./disko-fs.nix to the disk you want to use
# 2. partition & format the disk via disko
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko ./disko-fs.nix
Expand Down
1 change: 1 addition & 0 deletions hosts/12kingdoms_suzu/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ in {
nixos-rk3588.nixosModules.orangepi5plus.core
disko.nixosModules.default
./disko-fs.nix
./hardware-configuration.nix
];

networking = {
Expand Down
6 changes: 3 additions & 3 deletions hosts/12kingdoms_suzu/disko-fs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot/efi";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
Expand All @@ -28,7 +28,7 @@
type = "luks";
name = "crypted";
settings = {
keyFile = "/dev/disk/by-label/OPI5P_DSC"; # The keyfile is stored on a USB stick
keyFile = "/dev/disk/by-label/OPI5_DSC"; # The keyfile is stored on a USB stick
# The maxium size of the keyfile is 8192 bytes
keyFileSize = 512 * 64; # match the `bs * count` of the `dd` command
keyFileOffset = 512 * 128; # match the `bs * skip` of the `dd` command
Expand Down Expand Up @@ -84,7 +84,7 @@
};
"@swap" = {
mountpoint = "/swap";
swap.swapfile.size = "16384M";
swap.swapfile.size = "8192M";
};
};
};
Expand Down
39 changes: 39 additions & 0 deletions hosts/12kingdoms_suzu/hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];

boot.loader = {
# depending on how you configured your disk mounts, change this to /boot or /boot/efi.
efi.efiSysMountPoint = "/boot/";
efi.canTouchEfiVariables = true;
# do not use systemd-boot here, it has problems when running `nixos-install`
grub = {
device = "nodev";
efiSupport = true;
};
};
# clear /tmp on boot to get a stateless /tmp directory.
boot.tmp.cleanOnBoot = true;

boot.initrd.availableKernelModules = ["nvme" "usbhid" "usb_storage"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];

# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enP3p49s0.useDHCP = lib.mkDefault true;
# networking.interfaces.enP4p65s0.useDHCP = lib.mkDefault true;

nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}
1 change: 1 addition & 0 deletions modules/nixos/server/server-aarch64.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
../../base.nix
];

boot.loader.timeout = lib.mkForce 3; # wait for 3 seconds to select the boot entry
# Fix: jasper is marked as broken, refusing to evaluate.
environment.enableAllTerminfo = lib.mkForce false;
}
4 changes: 3 additions & 1 deletion modules/nixos/server/server-riscv64.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{pkgs, ...}: {
{lib, ...}: {
# =========================================================================
# Base NixOS Configuration
# =========================================================================
Expand All @@ -14,4 +14,6 @@

../../base.nix
];

boot.loader.timeout = lib.mkForce 3; # wait for 3 seconds to select the boot entry
}
10 changes: 5 additions & 5 deletions systems/colmena.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ with allSystemAttrs; let
};

# aarch64 related
# using the same nixpkgs as nixos-rk3588 to utilize the cross-compilation cache.
rk3588_pkgs = import nixos-rk3588.inputs.nixpkgs {system = x64_system;};
rk3588_pkgs = import nixos-rk3588.inputs.nixpkgs {system = aarch64_system;};
# aarch64 related
rk3588_specialArgs = let
# using the same nixpkgs as nixos-rk3588
inherit (nixos-rk3588.inputs) nixpkgs;
# use aarch64-linux's native toolchain
pkgsKernel = import nixpkgs {
system = "aarch64-linux";
system = aarch64_system;
};
in
allSystemSpecialArgs.aarch64_system
Expand All @@ -45,9 +44,8 @@ with allSystemAttrs; let
rk3588 = {inherit nixpkgs pkgsKernel;};
};
rk3588_base_args = {
inherit home-manager nixos-generators;
inherit home-manager;
inherit (nixos-rk3588.inputs) nixpkgs; # or nixpkgs-unstable
system = aarch64_system;
specialArgs = rk3588_specialArgs;
targetUser = "root";
};
Expand All @@ -65,13 +63,15 @@ in {

# aarch64 SBCs
suzu = rk3588_specialArgs;
rakushun = rk3588_specialArgs;
};
nodeNixpkgs = {
nozomi = lpi4a_pkgs;
yukina = lpi4a_pkgs;

# aarch64 SBCs
suzu = rk3588_pkgs;
rakushun = rk3588_pkgs;
};
};

Expand Down
2 changes: 1 addition & 1 deletion systems/nixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ with allSystemAttrs; let
inherit (nixos-rk3588.inputs) nixpkgs;
# use aarch64-linux's native toolchain
pkgsKernel = import nixpkgs {
system = "aarch64-linux";
system = aaarch64_system;
};
in
allSystemSpecialArgs.aarch64_system
Expand Down
1 change: 1 addition & 0 deletions systems/vars.nix
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ in {
];
# home-module.imports = [];
};
_12kingdoms_rakushun_tags = ["aarch" "rakushun"];

# Shoukei (祥瓊, Shōkei)
_12kingdoms_shoukei_modules_i3 = {
Expand Down

0 comments on commit 870ff73

Please sign in to comment.