This commit is contained in:
Sebastian Moser
2023-11-21 14:59:08 +01:00
parent cbcf3a0e3d
commit 7ed54e66ec
4 changed files with 104 additions and 125 deletions

View File

@@ -87,14 +87,15 @@
modules = [ modules = [
./hosts/hpm.nix ./hosts/hpm.nix
./hardware/hpm-laptop.nix ./hardware/hpm-laptop.nix
]; ];
}; };
# my server at home # my server at home
"rpi" = nixpkgs.lib.nixosSystem { "rpi" = nixpkgs.lib.nixosSystem {
inherit specialArgs; #inherit specialArgs;
system = "x86_64-linux"; specialArgs = { inherit inputs confDir workDir secretsDir persistentDir self; };
system = "aarch64-linux";
modules = [ modules = [
./hosts/rpi.nix ./hosts/rpi.nix
]; ];
@@ -103,18 +104,9 @@
# my raspberry to try out stuff with # my raspberry to try out stuff with
"lush" = nixpkgs.lib.nixosSystem { "lush" = nixpkgs.lib.nixosSystem {
system = "aarch64-linux"; system = "aarch64-linux";
specialArgs = { inherit inputs confDir workDir secretsDir persistentDir self; };
modules = [ modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
inputs.nixos-hardware.nixosModules.raspberry-pi-4
./hosts/lush.nix ./hosts/lush.nix
{
system.stateVersion = "23.05"; # Did you read the comment?
nixpkgs.hostPlatform.system = "aarch64-linux";
nixpkgs.buildPlatform.system = "x86_64-linux";
hardware.enableRedistributableFirmware = true;
}
]; ];
}; };
@@ -208,6 +200,7 @@
#modules = [ "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64-new-kernel-no-zfs-installer.nix" ]; #modules = [ "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64-new-kernel-no-zfs-installer.nix" ];
#}).config.system.build.sdImage; #}).config.system.build.sdImage;
lush = self.nixosConfigurations.lush.config.system.build.sdImage; lush = self.nixosConfigurations.lush.config.system.build.sdImage;
rpi = self.nixosConfigurations.rpi.config.system.build.sdImage;
test = nixpkgs.legacyPackages.x86_64-linux.pkgsCross.raspberryPi.raspberrypi-armstubs; test = nixpkgs.legacyPackages.x86_64-linux.pkgsCross.raspberryPi.raspberrypi-armstubs;
}; };

View File

@@ -35,13 +35,6 @@
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/tmp" = {
fsType = "tmpfs";
device = "tmpfs";
options = [ "nosuid" "nodev" "relatime" "size=14G" ];
};
swapDevices = [ swapDevices = [
{ device = "/dev/disk/by-uuid/418bf0d8-e548-45d5-802a-53de72707ebc"; } { device = "/dev/disk/by-uuid/418bf0d8-e548-45d5-802a-53de72707ebc"; }
]; ];

View File

@@ -1,5 +1,16 @@
{ lib, pkgs, ... }: { lib, pkgs, inputs, ... }:
{ {
system.stateVersion = "23.05"; # Did you read the comment?
imports = [
"${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
#inputs.nixos-hardware.nixosModules.raspberry-pi-4
];
#nixpkgs.hostPlatform.system = "aarch64-linux";
#nixpkgs.buildPlatform.system = "x86_64-linux";
hardware.enableRedistributableFirmware = true;
# This causes an overlay which causes a lot of rebuilding # This causes an overlay which causes a lot of rebuilding
environment.noXlibs = lib.mkForce false; environment.noXlibs = lib.mkForce false;
@@ -12,28 +23,34 @@
}; };
boot = { boot = {
kernelPackages = lib.mkForce pkgs.linuxPackages_latest; #kernelPackages = lib.mkForce pkgs.linuxPackages_latest;
loader = { loader = {
generic-extlinux-compatible.enable = lib.mkDefault true; generic-extlinux-compatible.enable = lib.mkDefault true;
grub.enable = lib.mkDefault false; grub.enable = lib.mkDefault false;
}; };
}; };
nix.settings = { services.openssh = {
experimental-features = lib.mkDefault "nix-command flakes"; enable = true;
trusted-users = [ "root" "@wheel" ]; ports = [ 22 ];
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
}; };
# end of base.nix # end of base.nix
environment.systemPackages = with pkgs; [ vim git ]; environment.systemPackages = with pkgs; [ vim git ];
services.openssh.enable = true; networking.hostName = "lush";
networking.hostName = "luna";
users = { users = {
users.me = { users.me = {
password = "hello"; password = "hello";
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" ]; extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFjgXf9S9hxjyph2EEFh1el0z4OUT9fMoFAaDanjiuKa me@main"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICWsqiz0gEepvPONYxqhKKq4Vxfe1h+jo11k88QozUch me@bitwarden"
];
}; };
}; };
networking = { networking = {
@@ -50,7 +67,6 @@
/* /*
boot = { boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_rpi4; kernelPackages = pkgs.linuxKernel.packages.linux_rpi4;
initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ]; initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ];
loader = { loader = {
@@ -58,64 +74,6 @@
generic-extlinux-compatible.enable = true; generic-extlinux-compatible.enable = true;
}; };
}; };
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
};
networking = {
hostName = hostname;
wireless = {
enable = true;
networks."${SSID}".psk = SSIDpassword;
interfaces = [ interface ];
};
};
environment.systemPackages = with pkgs; [ vim ];
services.openssh.enable = true;
users = {
mutableUsers = false;
users."${user}" = {
isNormalUser = true;
password = password;
extraGroups = [ "wheel" ];
};
};
system.stateVersion = "23.11";
*/ */
} }

View File

@@ -1,13 +1,24 @@
{ lib, pkgs, ... }: { lib, pkgs, inputs, ... }:
{ {
imports = [ imports = [
"${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
inputs.nixos-hardware.nixosModules.raspberry-pi-4
../common/all.nix ../common/all.nix
../common/nixos-headless.nix ../common/nixos-headless.nix
../users/me/default.nix ../users/me/headless.nix
../users/root/default.nix ../users/root/default.nix
]; ];
system.stateVersion = "23.05";
# to cross compile
#nixpkgs.hostPlatform.system = "aarch64-linux";
#nixpkgs.buildPlatform.system = "x86_64-linux";
hardware.enableRedistributableFirmware = true;
# This causes an overlay which causes a lot of rebuilding # This causes an overlay which causes a lot of rebuilding
environment.noXlibs = lib.mkForce false; environment.noXlibs = lib.mkForce false;
# "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" creates a # "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" creates a
@@ -20,7 +31,7 @@
}; };
boot = { boot = {
kernelPackages = lib.mkForce pkgs.linuxPackages_latest; #kernelPackages = lib.mkForce pkgs.linuxPackages_latest;
loader = { loader = {
generic-extlinux-compatible.enable = lib.mkDefault true; generic-extlinux-compatible.enable = lib.mkDefault true;
grub.enable = lib.mkDefault false; grub.enable = lib.mkDefault false;
@@ -80,43 +91,67 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFjgXf9S9hxjyph2EEFh1el0z4OUT9fMoFAaDanjiuKa me@main" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFjgXf9S9hxjyph2EEFh1el0z4OUT9fMoFAaDanjiuKa me@main"
]; ];
################################ samba ###################################### ################################ samba ######################################
services.samba-wsdd.enable = true; # make shares visible for windows 10 clients services.samba-wsdd.enable = true; # make shares visible for windows 10 clients
services.samba = { services.samba = {
enable = true; enable = true;
securityType = "user"; securityType = "user";
extraConfig = '' extraConfig = ''
security = user server role = standalone server
map to guest = bad user map to guest = bad user
guest account = me usershare allow guests = yes
hosts allow = 192.168.0.0/16
server role = standalone server hosts deny = 0.0.0.0
workgroup = WORKGROUP workgroup = WORKGROUP
''; security = user
shares = { '';
rpi_schule = { shares = {
path = "${workDir}/rpi-schule/"; files = {
"guest ok" = "yes"; "valid users" = "files";
"read only" = "no"; "comment" = "all my files";
public = "yes"; "path" = "/home/files/storage/files";
writable = "yes"; "read only" = "no";
printable = "no"; "guest ok" = "no";
comment = "share for rpi in school wlan"; "force user" = "files";
}; "force group" = "files";
"force create mode" = "0777";
share = { # Papierkorb
comment = "share for sharing stuff"; "vfs object" = "recycle";
path = "${workDir}/share"; "recycle:repository" = "/home/files/storage/files/trash-files";
public = "yes"; "recycle:keeptree" = "No";
"guest ok" = "yes"; "recycle:versions" = "Yes";
"read only" = "no"; "recycle:touch" = "Yes";
writable = "yes"; "recycle:touch_mtime" = "Yes";
}; "recycle:maxsize" = "8000";
}; };
}; lan = {
"comment" = "gastordner";
"path" = "/home/files/storage/lan";
"read only" = "no";
"guest ok" = "yes";
"force user" = "files";
"force group" = "files";
"force create mode" = "0777";
# Papierkorb
"vfs object" = "recycle";
"recycle:repository" = "/home/files/storage/files/trash-lan";
"recycle:keeptree" = "No";
"recycle:versions" = "Yes";
"recycle:touch" = "Yes";
"recycle:touch_mtime" = "Yes";
"recycle:maxsize" = "8000";
};
mama = {
"comment" = "Meine Dateien auf Mamas Laptop";
"path" = "/home/files/storage/files/stuff/Mamas-Laptop";
"read only" = "no";
"guest ok" = "no";
"valid users" = "mamafiles";
"force user" = "files";
"force group" = "files";
"force create mode" = "0777";
};
};
};
} }