mirror of
https://git.kb-one.de/kb01/aux-config.git
synced 2026-04-28 10:33:32 +00:00
Added udev Rules for FOSSASIA/led-name-badge-ls32, Added aarch64 Cross-Compilation Feature
This commit is contained in:
parent
6170421c0f
commit
a6f52135c9
71
systems/aarch64-linux/NoMra7/default.nix
Normal file
71
systems/aarch64-linux/NoMra7/default.nix
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
#./mobile-nixos-branding.nix
|
||||
#./plasma-mobile.nix
|
||||
];
|
||||
|
||||
# Users
|
||||
users.users.kb = {
|
||||
isNormalUser = true;
|
||||
# Numeric pin makes it **possible** to input on the lockscreen.
|
||||
password = "1234"; # INSECURE!!!
|
||||
home = "/home/kb";
|
||||
extraGroups = [
|
||||
"dialout"
|
||||
"feedbackd"
|
||||
"networkmanager"
|
||||
"video"
|
||||
"wheel"
|
||||
];
|
||||
};
|
||||
users.users.root.password = "nixos"; # INSECURE!!!
|
||||
|
||||
# Automatically login as defaultUserName.
|
||||
services.displayManager.autoLogin = {
|
||||
user = "kb";
|
||||
};
|
||||
|
||||
# Desktop
|
||||
services.displayManager.autoLogin.enable = true;
|
||||
services.displayManager.defaultSession = "plasma-mobile";
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
desktopManager.plasma5.mobile.enable = true;
|
||||
displayManager.lightdm = {
|
||||
enable = true;
|
||||
# Workaround for autologin only working at first launch.
|
||||
# A logout or session crashing will show the login screen otherwise.
|
||||
extraSeatDefaults = ''
|
||||
session-cleanup-script=${pkgs.procps}/bin/pkill -P1 -fx ${pkgs.lightdm}/sbin/lightdm
|
||||
'';
|
||||
};
|
||||
};
|
||||
services.libinput.enable = true;
|
||||
|
||||
# Audio
|
||||
services.pipewire.enable = lib.mkDefault true;
|
||||
services.pulseaudio.enable = lib.mkDefault false;
|
||||
|
||||
|
||||
# Networking
|
||||
networking.hostName = "Ohybke";
|
||||
networking.networkmanager.enable = true;
|
||||
networking.networkmanager.unmanaged = [ "rndis0" "usb0" ];
|
||||
networking.wireless.enable = false;
|
||||
|
||||
# Bluetooth
|
||||
hardware.bluetooth.enable = true;
|
||||
|
||||
# Mobile Configuration
|
||||
mobile.boot.stage-1.networking.enable = lib.mkDefault true;
|
||||
mobile.boot.stage-1.kernel.useStrictKernelConfig = lib.mkDefault true;
|
||||
mobile.beautification = {
|
||||
silentBoot = lib.mkDefault true;
|
||||
splash = lib.mkDefault true;
|
||||
};
|
||||
powerManagement.enable = true;
|
||||
|
||||
# SSH Server
|
||||
services.openssh.enable = true;
|
||||
}
|
||||
78
systems/aarch64-linux/NoMra7/mobile-nixos-branding.nix
Normal file
78
systems/aarch64-linux/NoMra7/mobile-nixos-branding.nix
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
#
|
||||
# This configuration serves to force Mobile NixOS branding in the
|
||||
# Plasma Mobile environment at first boot.
|
||||
#
|
||||
# This is **not** an example for end-user-centric configuration.
|
||||
#
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
# This script will run *only once*, even if changed.
|
||||
# https://develop.kde.org/docs/plasma/scripting/#update-scripts
|
||||
# This will not work through userSetupScript, it seems that plasma mobile on
|
||||
# first initialization forcibly resets some of the configurations.
|
||||
# Running last (ZZZ) ensures it can do whatever initialization it needs to do.
|
||||
plamoInitialDefaults = pkgs.writeTextDir "share/plasma/shells/org.kde.plasma.phoneshell/contents/updates/ZZZ-Mobile-NixOS-initial-defaults.js" ''
|
||||
var allDesktops = desktops();
|
||||
for (i=0; i<allDesktops.length; i++) {
|
||||
d = allDesktops[i];
|
||||
d.wallpaperPlugin = "org.kde.image";
|
||||
d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General");
|
||||
d.writeConfig("Image", "file://${wallpaper}")
|
||||
}
|
||||
'';
|
||||
|
||||
# Those configs are found in the file named as `--file`, with
|
||||
# `--group` being [like][these].
|
||||
userSetupScript = pkgs.writeScript "userInitialConfiguration" ''
|
||||
#!${pkgs.runtimeShell}
|
||||
${pkgs.libsForQt5.kconfig}/bin/kwriteconfig5 \
|
||||
--file kscreenlockerrc \
|
||||
--group Greeter \
|
||||
--group Wallpaper \
|
||||
--group org.kde.image \
|
||||
--group General \
|
||||
--key Image "file://${wallpaper}"
|
||||
'';
|
||||
|
||||
# Why copy them all?
|
||||
# Because otherwise the wallpaper picker will default to /nix/store as a path
|
||||
# and this could get messy with the amazing amount of files there are in there.
|
||||
# Why copy only pngs?
|
||||
# Rendering of `svg` is hard! Not that it's costly in cpu time, but that the
|
||||
# rendering might not be as expected depending on what renders it.
|
||||
# The SVGs in that directory are used as an authoring format files, not files
|
||||
# to be used as they are. They need to be pre-rendered.
|
||||
wallpapers = pkgs.runCommand "wallpapers" {} ''
|
||||
mkdir -p $out/
|
||||
cp ${../../artwork/wallpapers}/*.png $out/
|
||||
'';
|
||||
|
||||
wallpaper="${wallpapers}/mobile-nixos-19.09.png";
|
||||
|
||||
# Used to run an ugly activation script.
|
||||
defaultUserName = "alice";
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [
|
||||
plamoInitialDefaults
|
||||
];
|
||||
|
||||
# Force some initial configuration
|
||||
system.activationScripts.userInitialConfiguration = let
|
||||
homeDir = config.users.users.${defaultUserName}.home;
|
||||
in ''
|
||||
echo ":: Mobile NixOS initial configuration..."
|
||||
if [ ! -e ${homeDir}/.config ]; then
|
||||
echo "Assuming first boot!"
|
||||
echo "Creating home dir"
|
||||
mkdir -p ${homeDir}
|
||||
chown ${defaultUserName} ${homeDir}
|
||||
echo "Configuring things"
|
||||
${pkgs.sudo}/bin/sudo -u "${defaultUserName}" "${userSetupScript}"
|
||||
else
|
||||
echo "Assuming any other boring normal boot..."
|
||||
echo "Doing nothing..."
|
||||
fi
|
||||
'';
|
||||
}
|
||||
37
systems/aarch64-linux/NoMra7/plasma-mobile.nix
Normal file
37
systems/aarch64-linux/NoMra7/plasma-mobile.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#
|
||||
# Minimum config used to enable Plasma Mobile.
|
||||
#
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
mobile.beautification = {
|
||||
silentBoot = lib.mkDefault true;
|
||||
splash = lib.mkDefault true;
|
||||
};
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
|
||||
desktopManager.plasma5.mobile.enable = true;
|
||||
|
||||
displayManager.lightdm = {
|
||||
enable = true;
|
||||
# Workaround for autologin only working at first launch.
|
||||
# A logout or session crashing will show the login screen otherwise.
|
||||
extraSeatDefaults = ''
|
||||
session-cleanup-script=${pkgs.procps}/bin/pkill -P1 -fx ${pkgs.lightdm}/sbin/lightdm
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
services.pipewire.enable = lib.mkDefault true;
|
||||
services.pulseaudio.enable = lib.mkDefault false;
|
||||
networking.networkmanager.enable = true;
|
||||
networking.wireless.enable = false;
|
||||
powerManagement.enable = true;
|
||||
services.libinput.enable = true;
|
||||
services.displayManager.defaultSession = "plasma-mobile";
|
||||
services.displayManager.autoLogin.enable = true;
|
||||
}
|
||||
|
|
@ -82,6 +82,11 @@
|
|||
sudo.u2fAuth = true;
|
||||
swaylock.u2fAuth = true;
|
||||
};
|
||||
services.udev.extraRules = ''
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="0416", ATTRS{idProduct}=="5020", MODE="0666"
|
||||
# FIXME: the following line is not sufficient for pyhidapi.
|
||||
KERNEL=="hidraw*", ATTRS{idVendor}=="0416", ATTRS{idProduct}=="5020", ATTRS{busnum}=="1", MODE="0666"
|
||||
'';
|
||||
|
||||
# Printing
|
||||
services.printing.enable = true;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ in {
|
|||
boot.supportedFilesystems = [ "zfs" ];
|
||||
boot.zfs.forceImportRoot = false;
|
||||
networking.hostId = "60dbcc20";
|
||||
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||
|
||||
|
||||
# Boot Process
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue