Mara's laptop

This commit is contained in:
Andrea Ciceri 2024-12-06 11:43:08 +01:00
parent 26187a521b
commit 9191b17bff
Signed by: aciceri
SSH key fingerprint: SHA256:/AagBweyV4Hlfg9u092n8hbHwD5fcB6A3qhDiDA65Rg
7 changed files with 205 additions and 3 deletions

View file

@ -119,6 +119,20 @@
};
};
tpol = {
extraModules = with inputs; [
lix-module.nixosModules.default
];
secrets = {
"tpol-wireguard-private-key" = { };
};
vpn = {
ip = "10.100.0.7";
publicKey = "b/Pi7koTFo5CMAAzcL2ulvQ/0dUjKzbmXpvh4Lb/Bgo=";
};
extraHmModulesUser = "mara";
};
};
vpnExtra = {

48
hosts/spock/default.nix Normal file
View file

@ -0,0 +1,48 @@
{
lib,
modulesPath,
...
}:
{
imports = [
"${modulesPath}/installer/sd-card/sd-image-aarch64.nix"
];
sdImage.compressImage = false;
nixpkgs = {
# hostPlatform = lib.mkDefault "armv6-linux";
# config = {
# allowUnfree = true;
# };
# overlays = [
# # Workaround: https://github.com/NixOS/nixpkgs/issues/154163
# # modprobe: FATAL: Module sun4i-drm not found in directory
# (final: super: {
# makeModulesClosure = x:
# super.makeModulesClosure (x // {allowMissing = true;});
# })
# ];
};
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
};
networking = {
networkmanager.enable = false;
};
# Set your time zone.
time.timeZone = "Europe/Rome";
# Allow the user to log in as root without a password.
users.users.root.initialHashedPassword = "";
hardware.enableRedistributableFirmware = true;
system.stateVersion = "24.11";
}

95
hosts/tpol/default.nix Normal file
View file

@ -0,0 +1,95 @@
{
modulesPath,
fleetModules,
pkgs,
lib,
vpn,
config,
...
}:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix") ]
++ fleetModules [
"common"
"ssh"
"nix"
"networkmanager"
"dbus"
"udisks2"
"xdg"
"printing"
"mara"
"xfce"
"battery"
"printing"
"wireguard-client"
];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ehci_pci"
"ahci"
"usb_storage"
"sd_mod"
"sr_mod"
"rtsx_pci_sdmmc"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.loader.grub.device = "/dev/sda";
fileSystems."/" = {
device = "/dev/disk/by-uuid/1522f8d9-5251-408d-9b6e-ed6da7da916a";
fsType = "btrfs";
};
swapDevices = [
{ device = "/dev/disk/by-uuid/e111fbc7-8e5d-4fcb-95c9-249f53ab0adc"; }
];
mara = {
enable = true;
modules = [
"shell"
"mpv"
"firefox"
"git"
"chrome"
"udiskie"
"helix"
"remmina"
];
};
# nevertheless this is a laptop the battery is completely gone, so it works only attached to electrictiy
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
networking.firewall.allowedTCPPorts = [ 1234 ];
hardware.rtl-sdr.enable = true;
systemd.services.rtl-tcp = {
description = "rtl_sdr over TCP";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = ''
${lib.getExe' pkgs.rtl-sdr "rtl_tcp"} -a ${vpn.${config.networking.hostName}}
'';
};
};
systemd.services.sdrangelsrv = {
description = "sdrangelsrv";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = ''
${lib.getExe' pkgs.sdrangel "sdrangelsrv"} --remote-tcp-hwtype RTLSDR --remote-tcp-port 1234 --remote-tcp-address ${
vpn.${config.networking.hostName}
} --remote-tcp
'';
};
};
}