Switch to catppuccin
Some checks failed
/ test (push) Has been cancelled

This commit is contained in:
Andrea Ciceri 2024-05-17 16:08:36 +02:00
parent 116474d8a8
commit f7302479b3
Signed by: aciceri
SSH key fingerprint: SHA256:/AagBweyV4Hlfg9u092n8hbHwD5fcB6A3qhDiDA65Rg
48 changed files with 8219 additions and 524 deletions

View file

@ -72,6 +72,30 @@
# "chatgpt-token".owner = "ccr";
# };
# };
deltaflyer = {
nixpkgs = let
# keep in sync with https://github.com/NixOS/mobile-nixos/blob/development/pkgs.nix
rev = "44d0940ea560dee511026a53f0e2e2cde489b4d4";
in
builtins.getFlake "github:NixOS/nixpkgs/${rev}";
extraHmModules = [
inputs.ccrEmacs.hmModules.default
];
vpn = {
ip = "10.100.0.5";
publicKey = "6bzmBx2b5yzMdW0aK0KapoBesNcxTv5+qdo+pGmG+jc=";
};
homeManager = builtins.getFlake "github:nix-community/home-manager/670d9ecc3e46a6e3265c203c2d136031a3d3548e";
extraModules = [
(import "${inputs.mobile-nixos}/lib/configuration.nix" {device = "oneplus-fajita";})
];
secrets = {
"deltaflyer-wireguard-private-key" = {};
"chatgpt-token".owner = "ccr";
};
};
kirk = {
vpn = {
ip = "10.100.0.3";
@ -80,6 +104,7 @@
extraModules = [
inputs.disko.nixosModules.disko
inputs.nixosHardware.nixosModules.lenovo-thinkpad-x1-7th-gen
inputs.lix-module.nixosModules.default
];
extraHmModules = [
inputs.ccrEmacs.hmModules.default
@ -103,6 +128,7 @@
extraModules = [
inputs.disko.nixosModules.disko
inputs.nixThePlanet.nixosModules.macos-ventura
inputs.lix-module.nixosModules.default
# inputs.hercules-ci-agent.nixosModules.agent-service
];
extraHmModules = [
@ -127,13 +153,13 @@
sisko = {
system = "aarch64-linux";
nixpkgs = inputs.nixpkgsUnstableForSisko; # using more recent `nixpkgsUnstable` it fails to restart
vpn = {
ip = "10.100.0.1";
publicKey = "bc5giljukT1+ChbbyTLdOfejfR3c8RZ4XoXmQM54nTY=";
};
extraModules = with inputs; [
disko.nixosModules.disko
# lix-module.nixosModules.default
# inputs.hercules-ci-agent.nixosModules.agent-service;
# rock5b.nixosModules.default
];

View file

@ -0,0 +1,146 @@
{
fleetModules,
config,
lib,
pkgs,
fleetFlake,
...
}: {
imports =
fleetModules [
"common"
"ssh"
"ccr"
"nix"
"bluetooth"
"dbus"
"networkmanager"
"pam"
"fonts"
"waydroid"
"wireguard-client"
]
++ [
# ./mobile-nixos-branding.nix
./plasma-mobile.nix
];
# options.home-manager.services.kanshi.attrTag = null;
config = lib.mkMerge [
# INSECURE STUFF FIRST
# Users and hardcoded passwords.
{
users.users.root.password = "nixos";
# users.users.ccr.password = "1234";
# Automatically login as defaultUserName.
# services.xserver.displayManager.autoLogin = {
# user = "ccr";
# };
}
# Networking, modem and misc.
{
# Ensures any rndis config from stage-1 is not clobbered by NetworkManager
networking.networkmanager.unmanaged = ["rndis0" "usb0"];
# Setup USB gadget networking in initrd...
mobile.boot.stage-1.networking.enable = lib.mkDefault true;
}
# SSH
{
# Start SSH by default...
# Not a good idea given the fact this config is insecure (well-known password).
services.openssh = {
settings.PermitRootLogin = lib.mkForce "yes";
};
mobile.adbd.enable = true;
ccr = {
enable = true;
autologin = true;
modules = [
"git"
"shell"
"helix"
"hyprland"
"emacs"
"firefox"
"mpv"
"xdg"
];
extraGroups = [
"dialout"
"feedbackd"
"networkmanager"
"video"
"wheel"
];
backupPaths = [];
};
}
{
system.stateVersion = "24.11";
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"oneplus-sdm845-firmware-zstd"
"oneplus-sdm845-firmware-xz"
"oneplus-sdm845-firmware"
];
nixpkgs.crossSystem = lib.mkForce null;
nixpkgs.localSystem.system = "aarch64-linux"; # we use an aarch64 nix remote builder or binfmt
# mobile.boot.stage-1.kernel.useStrictKernelConfig = lib.mkDefault true;
ccr.extraModules = [
{
programs.fish.loginShellInit = ''
pgrep Hypr >/dev/null || exec dbus-run-session Hyprland
'';
wayland.windowManager.hyprland.extraConfig = lib.mkAfter ''
monitor = DSI-1, 1080x2340, 0x0, 2, transform, 1
input {
touchdevice {
transform = 1
}
}
bind = $mod, r, exec, rotate-screen hor
bind = $mod SHIFT, r, exec, rotate-screen ver
'';
home.packages = let
rotateScript = pkgs.writeShellApplication {
name = "rotate-screen";
runtimeInputs = [pkgs.hyprland];
text = ''
if [[ "$1" == "hor" ]]; then
hyprctl keyword monitor DSI-1,1080x2340,0x0,2,transform,1
hyprctl keyword input:touchdevice:transform 1
elif [[ "$1" == "ver" ]]; then
hyprctl keyword monitor DSI-1,1080x2340,0x0,2,transform,0
hyprctl keyword input:touchdevice:transform 0
fi
'';
};
in [rotateScript];
services.swayidle.enable = lib.mkForce false;
}
];
environment.systemPackages = [
# (pkgs.writeShellApplication {
# name = "start-win98";
# text = fleetFlake.inputs.nixThePlanet.apps.aarch64-linux.win98.program;
# })
pkgs.libreoffice
pkgs.superTuxKart
pkgs.chromium
pkgs.dolphin-emu
];
zramSwap.enable = lib.mkDefault true;
boot.binfmt.emulatedSystems = lib.mkForce ["x86_64-linux" "i686-linux" "i386-linux" "i486-linux" "i586-linux"];
}
];
}

View file

@ -0,0 +1,52 @@
#
# Minimum config used to enable Plasma Mobile.
#
{
config,
lib,
pkgs,
...
}: {
mobile.beautification = {
silentBoot = lib.mkDefault false;
splash = lib.mkDefault false;
};
services.xserver = {
enable = true;
# # desktopManager.plasma5.mobile.enable = true;
# displayManager.autoLogin = {
# enable = true;
# };
# displayManager.session = [{
# manage = "desktop";
# name = "hyprland";
# start = ''
# ${pkgs.hyprland}/bin/Hyprland &
# waitPID=$!
# '';
# }];
# displayManager.defaultSession = "hyprland";
# 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
# '';
# };
libinput.enable = true;
};
hardware.bluetooth.enable = true;
hardware.pulseaudio.enable = lib.mkDefault true; # mkDefault to help out users wanting pipewire
networking.networkmanager.enable = true;
networking.wireless.enable = false;
powerManagement.enable = true;
}

View file

@ -103,6 +103,11 @@ in {
type = lib.types.anything;
default = inputs.nixpkgsUnstable;
};
homeManager = lib.mkOption {
description = "Used home-manager";
type = lib.types.anything;
default = inputs.homeManager;
};
vpn = {
ip = lib.mkOption {
description = "Wireguard VPN ip";
@ -206,7 +211,6 @@ in {
nixpkgs.overlays = config.overlays;
})
"${self.outPath}/hosts/${hostname}"
inputs.lix-module.nixosModules.default
]
++ (lib.optionals (config.secrets != []) [
inputs.agenix.nixosModules.default
@ -234,7 +238,7 @@ in {
user = config.extraHmModulesUser;
extraHmModules = config.extraHmModules;
in [
inputs.homeManager.nixosModule
config.homeManager.nixosModule
({
config,
pkgs,

View file

@ -1,6 +1,7 @@
{
fleetModules,
pkgs,
fleetFlake,
config,
...
}: {
@ -34,19 +35,23 @@
# FIXME why is this needed?
nixpkgs.config.permittedInsecurePackages = ["openssl-1.1.1w"];
boot.kernelPackages = pkgs.linuxKernel.packages.linux_testing;
# boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_8;
# boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_testing;
# boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.linux_testing.override {
boot.kernelPackages = let
pkgs = fleetFlake.inputs.nixpkgsUnstableForSisko.legacyPackages.aarch64-linux;
in
pkgs.linuxPackagesFor pkgs.linux_testing;
# boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.linux_6_9.override {
# argsOverride = {
# src = pkgs.fetchFromGitLab {
# domain = "gitlab.collabora.com";
# owner = "hardware-enablement/rockchip-3588";
# repo = "linux";
# rev = "b07290444a7fb5cf56a5200d2bad7f927e77e8b8";
# sha256 = "sha256-ruD9+vRwFQOXf5PWB+QxtA8DWfOcIydD0nSekoQTqWw=";
# rev = "23bb9c65a88c114bbe945b7ef5366bb02d3d9b80";
# sha256 = "sha256-6TygOl5r7/N2jlcPznWlvJfVVeXKSR8yMoGuTDbIdTA=";
# };
# version = "6.7";
# modDirVersion = "6.7.0";
# version = "6.9";
# modDirVersion = "6.9.0";
# };
# });

17
hosts/test/default.nix Normal file
View file

@ -0,0 +1,17 @@
{
fleetModules,
lib,
config,
pkgs,
...
}: {
imports =
fleetModules [
"common"
"ssh"
"nix"
]
++ [
./disko.nix
];
}

33
hosts/test/disko.nix Normal file
View file

@ -0,0 +1,33 @@
{
disko.devices = {
disk = {
vdb = {
device = "/dev/disk/by-path/pci-0000:02:00.0-nvme-1";
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
end = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
name = "root";
end = "-0";
content = {
type = "filesystem";
format = "bcachefs";
mountpoint = "/";
};
};
};
};
};
};
};
}