Add configuration for backup raspberry
This commit is contained in:
parent
94a8332605
commit
927cd07d84
4 changed files with 123 additions and 0 deletions
12
flake.nix
12
flake.nix
|
@ -72,7 +72,19 @@
|
|||
home-manager.users.${username} = import ./users/${username}/home.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
backup-raspberrypi = nixpkgs.lib.nixosSystem rec {
|
||||
system = "aarch64";
|
||||
|
||||
specialArgs = {
|
||||
inherit inputs outputs;
|
||||
};
|
||||
|
||||
modules = [
|
||||
nixos-hardware.nixosModules.raspberry-pi-4
|
||||
./hosts/backup-raspberrypi
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
1
hosts/backup-raspberrypi/.gitignore
vendored
Normal file
1
hosts/backup-raspberrypi/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
teleport-cred.nix
|
77
hosts/backup-raspberrypi/default.nix
Normal file
77
hosts/backup-raspberrypi/default.nix
Normal file
|
@ -0,0 +1,77 @@
|
|||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ outputs, config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
../../modules/nix.nix
|
||||
../../modules/network-server.nix
|
||||
../../modules/locale.nix
|
||||
../../modules/server-cli.nix
|
||||
../../modules/teleport.nix
|
||||
./teleport-cred.nix
|
||||
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
nixpkgs = {
|
||||
overlays = [
|
||||
outputs.overlays.additions
|
||||
];
|
||||
};
|
||||
|
||||
# Bootloader.
|
||||
# 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;
|
||||
|
||||
fileSystems."/backups" =
|
||||
{ device = "/dev/disk/by-uuid/7ccdab55-fba4-47b8-aef2-74be0103f885";
|
||||
fsType = "btrfs";
|
||||
};
|
||||
|
||||
networking.hostName = "backup-raspberry"; # Define your hostname.
|
||||
|
||||
users = {
|
||||
users = {
|
||||
julius = {
|
||||
isNormalUser = true;
|
||||
uid = 1000;
|
||||
extraGroups = [ "wheel" "julius" ];
|
||||
};
|
||||
restic = {
|
||||
isNormalUser = true;
|
||||
uid = 1337;
|
||||
extraGroups = [ "restic" ];
|
||||
};
|
||||
};
|
||||
groups = {
|
||||
julius = {
|
||||
gid = 1000;
|
||||
};
|
||||
restic = {
|
||||
gid = 1337;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
location = {
|
||||
latitude = 48.740556;
|
||||
longitude = 9.310833;
|
||||
};
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
# this value at the release version of the first install of this system.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "24.11"; # Did you read the comment?
|
||||
|
||||
}
|
||||
|
33
hosts/backup-raspberrypi/hardware-configuration.nix
Normal file
33
hosts/backup-raspberrypi/hardware-configuration.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-label/NIXOS_SD";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# 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.end0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
||||
}
|
||||
|
Loading…
Reference in a new issue