chore: misc changes for pi setup
This commit is contained in:
parent
6c2f9aa79f
commit
02dc1a7027
5 changed files with 36 additions and 20 deletions
|
@ -65,11 +65,12 @@
|
|||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||
btop
|
||||
git
|
||||
curl
|
||||
wget
|
||||
ssh-to-age
|
||||
];
|
||||
|
||||
nix = {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{ inputs
|
||||
, lib
|
||||
, pkgs
|
||||
, config
|
||||
, ...
|
||||
}: {
|
||||
nix = {
|
||||
|
@ -15,6 +16,21 @@
|
|||
};
|
||||
};
|
||||
|
||||
# This will add each flake input as a registry
|
||||
# To make nix3 commands consistent with your flake
|
||||
nix.registry = (lib.mapAttrs (_: flake: { inherit flake; })) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
|
||||
|
||||
# This will additionally add your inputs to the system's legacy channels
|
||||
# Making legacy nix commands consistent as well, awesome!
|
||||
nix.nixPath = [ "/etc/nix/path" ];
|
||||
environment.etc =
|
||||
lib.mapAttrs'
|
||||
(name: value: {
|
||||
name = "nix/path/${name}";
|
||||
value.source = value.flake;
|
||||
})
|
||||
config.nix.registry;
|
||||
|
||||
# Enable printing changes on nix build etc with nvd
|
||||
system.activationScripts.report-changes = ''
|
||||
PATH=$PATH:${lib.makeBinPath [ pkgs.nvd pkgs.nix ]}
|
||||
|
|
|
@ -23,11 +23,19 @@
|
|||
../common/optional/maddy.nix
|
||||
];
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
|
||||
boot.loader.grub.enable = false;
|
||||
# Enables the generation of /boot/extlinux/extlinux.conf
|
||||
boot.loader.generic-extlinux-compatible.enable = true;
|
||||
|
||||
networking.hostName = "dns01"; # Define your hostname.
|
||||
|
||||
console.enable = false;
|
||||
environment.systemPackages = with pkgs; [
|
||||
libraspberrypi
|
||||
raspberrypi-eeprom
|
||||
];
|
||||
|
||||
# Pick only one of the below networking options.
|
||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
||||
|
|
|
@ -16,13 +16,11 @@
|
|||
../common/optional/fish.nix
|
||||
../common/optional/monitoring.nix
|
||||
../common/optional/reboot-required.nix
|
||||
../common/optional/dnscrypt-proxy2.nix
|
||||
../common/optional/gnome.nix
|
||||
../common/optional/editors/vscode
|
||||
../common/optional/firefox.nix
|
||||
../common/optional/sops-nix.nix
|
||||
../common/optional/cloudflare-dyndns.nix
|
||||
../common/optional/maddy.nix
|
||||
|
||||
];
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
|
21
partition.sh
21
partition.sh
|
@ -1,27 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
|
||||
# Define variables
|
||||
drive="/dev/mmcblk1" # Change this to the desired drive, e.g., "/dev/sdb"
|
||||
swap_size="100MB" # Change this to the desired swap size
|
||||
|
||||
# Confirmation prompt
|
||||
read -p "This script will partition and format $drive. Are you sure you want to proceed? (y/n): " choice
|
||||
if [ "$choice" != "y" ]; then
|
||||
echo "Exiting script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Partitioning
|
||||
parted "${drive}" -- mklabel gpt
|
||||
parted "${drive}" -- mkpart root ext4 512MB -"$swap_size"
|
||||
parted "${drive}" -- mkpart swap linux-swap -"$swap_size" 100%
|
||||
parted "${drive}" -- mkpart ESP fat32 1MB 512MB
|
||||
parted "${drive}" -- set 3 esp on
|
||||
parted "${drive}" -- mklabel gpt -s
|
||||
parted "${drive}" -- mkpart root ext4 512MB -s# -"$swap_size"
|
||||
#parted "${drive}" -- mkpart swap linux-swap -"$swap_size" 100%
|
||||
parted "${drive}" -- mkpart ESP fat32 1MB 512MB -s
|
||||
parted "${drive}" -- set 3 esp on -s
|
||||
|
||||
# Formatting
|
||||
mkfs.ext4 -L nixos "${drive}p1"
|
||||
mkswap -L swap "${drive}p2"
|
||||
#mkswap -L swap "${drive}p2"
|
||||
mkfs.fat -F 32 -n boot "${drive}p3"
|
||||
|
||||
# Mounting disks for installation
|
||||
|
|
Reference in a new issue