Compare commits

...

2 Commits

Author SHA1 Message Date
emily 5b77db7c54
removed junk 1 month ago
emily 94efe8a7e2
added lain 1 month ago

@ -29,11 +29,6 @@ with lib; {
fish.enable = true;
};
deployment.tags = [ "all" ];
deployment.targetHost = mkDefault config.networking.fqdn;
deployment.targetPort = mkDefault 22;
deployment.targetUser = mkDefault null;
security.dhparams.defaultBitSize = 4096;
system.activationScripts.motd.text = let

@ -0,0 +1,99 @@
{ config, inputs, lib, pkgs, ... }: {
imports = [
inputs.nixos-hardware.nixosModules.raspberry-pi-4
../../common
../../profiles/headless.nix
];
boot.loader.efi.canTouchEfiVariables = true;
console.enable = false;
deployment = {
targetHost = "192.168.178.170";
targetUser = "nixos";
};
environment.systemPackages = with pkgs; [
kodiPackages.jellyfin
kodiPackages.keymap
libcec
libraspberrypi
raspberrypi-eeprom
];
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
};
hardware = {
bluetooth.enable = true;
deviceTree.enable = true;
raspberry-pi."4" = {
audio.enable = false;
apply-overlays-dtmerge.enable = true;
fkms-3d.enable = true;
};
};
kyouma.machine-type.physical = true;
nixpkgs.overlays = [
(self: super: { libcec = super.libcec.override { withLibraspberrypi = true; }; })
];
networking.hostName = "lain";
networking.networkmanager.enable = true;
systemd.network.enable = lib.mkForce false;
systemd.sockets."cec-client" = {
after = [ "dev-vchiq.device" ];
bindsTo = [ "dev-vchiq.device" ];
wantedBy = [ "sockets.target" ];
socketConfig = {
ListenFIFO = "/run/cec.fifo";
SocketGroup = "video";
SocketMode = "0660";
};
};
systemd.services."cec-client" = {
after = [ "dev-vchiq.device" ];
bindsTo = [ "dev-vchiq.device" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = ''${pkgs.libcec}/bin/cec-client -d 1'';
ExecStop = ''/bin/sh -c "echo q > /run/cec.fifo"'';
StandardInput = "socket";
StandardOutput = "journal";
Restart="no";
};
};
services.avahi = {
enable = true;
ipv6 = true;
nssmdns4 = true;
publish.enable = true;
publish.userServices = true;
};
services.cage = {
enable = true;
program = "${pkgs.kodi-wayland}/bin/kodi-standalone";
user = "kodi";
};
services.fstrim.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
};
services.udev.extraRules = ''
# allow access to raspi cec device for video group (and optionally register it as a systemd device, used below)
KERNEL=="vchiq", GROUP="video", MODE="0660", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/vchiq"
'';
users.mutableUsers = lib.mkForce true;
users.users.kodi.extraGroups = [ "video" ];
users.extraUsers.kodi.isNormalUser = true;
}

@ -0,0 +1,15 @@
{ config, lib, inputs, ... }: {
imports = [
"${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
./configuration.nix
];
networking.networkmanager.enable = lib.mkForce false;
networking.wireless = {
enable = true;
networks."Fernmeldestelle".psk = null;
interfaces = [ "wlan0" ];
};
users.users.emily = {
initialPassword = "changeme";
};
}

@ -7,6 +7,7 @@
./disko.nix
];
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
boot.extraModprobeConfig = ''
options i915 enable_guc=3
'';

@ -14,6 +14,7 @@
security.pam.services.swaylock = {};
services.dbus.packages = [ pkgs.gcr ];
services.geoclue2.enable = true;
services.pipewire = {
@ -267,7 +268,6 @@
# Rofi
"$mod, D, exec, ${rofi} -show drun -theme ~/.config/rofi/launcher.rasi"
"$mod, R, exec, ${rofi} -show run -theme ~/.config/rofi/runner.rasi"
"$mod, X, exec, ~/.local/bin/hypr/rofi_powermenu.sh"
"$mod, A, exec, ~/.local/bin/hypr/rofi_screenshot.sh"
# Misc
@ -635,6 +635,7 @@
services.gpg-agent = {
enable = true;
enableSshSupport = true;
pinentryPackage = pkgs.pinentry-gnome3;
};
services.swayidle =

@ -1,143 +0,0 @@
/*****----- Configuration -----*****/
configuration {
show-icons: false;
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
/*
USE_ICON=YES
*/
/*****----- Main Window -----*****/
window {
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 300px;
x-offset: 0px;
y-offset: 0px;
margin: 0px;
padding: 0px;
border: 2px solid;
border-radius: 15px;
border-color: @border;
cursor: "default";
background-color: @background;
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 30px;
background-color: transparent;
children: [ "inputbar", "message", "listview" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 10px;
padding: 0px;
border: 0px;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
children: [ "textbox-prompt-colon", "prompt"];
}
textbox-prompt-colon {
enabled: true;
expand: false;
str: "";
padding: 10px 14px;
border-radius: 0px;
background-color: var(urgent);
text-color: @background;
}
prompt {
enabled: true;
padding: 10px;
border-radius: 0px;
background-color: var(active);
text-color: @background;
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 10px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: @background-alt;
text-color: @foreground;
}
textbox {
background-color: inherit;
text-color: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 6;
lines: 1;
cycle: true;
scrollbar: false;
layout: vertical;
spacing: 10px;
background-color: transparent;
cursor: "default";
}
/*****----- Elements -----*****/
element {
enabled: true;
padding: 2px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: pointer;
}
element-text {
font: "feather 20";
background-color: transparent;
text-color: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.5;
}
element normal.normal,
element alternate.normal {
background-color: var(background-alt);
text-color: var(foreground);
}
element normal.urgent,
element alternate.urgent,
element selected.active {
background-color: var(urgent);
text-color: var(background);
}
element normal.active,
element alternate.active,
element selected.urgent {
background-color: var(active);
text-color: var(background);
}
element selected.normal {
background-color: var(selected);
text-color: var(background);
}

@ -1,140 +0,0 @@
/*****----- Configuration -----*****/
configuration {
show-icons: false;
}
/*****----- Global Properties -----*****/
@import "shared/colors.rasi"
/*****----- Main Window -----*****/
window {
transparency: "real";
location: center;
anchor: center;
fullscreen: false;
width: 510px;
x-offset: 0px;
y-offset: 0px;
margin: 0px;
padding: 0px;
border: 2px solid;
border-radius: 15px;
border-color: @border;
cursor: "default";
background-color: @background;
}
/*****----- Main Box -----*****/
mainbox {
enabled: true;
spacing: 10px;
margin: 0px;
padding: 30px;
background-color: transparent;
children: [ "inputbar", "message", "listview" ];
}
/*****----- Inputbar -----*****/
inputbar {
enabled: true;
spacing: 10px;
padding: 0px;
border: 0px;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
children: [ "textbox-prompt-colon", "prompt"];
}
textbox-prompt-colon {
enabled: true;
expand: false;
str: "";
padding: 10px 14px;
border-radius: 0px;
background-color: var(urgent);
text-color: @background;
}
prompt {
enabled: true;
padding: 10px;
border-radius: 0px;
background-color: var(active);
text-color: @background;
}
/*****----- Message -----*****/
message {
enabled: true;
margin: 0px;
padding: 10px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: @background-alt;
text-color: @foreground;
}
textbox {
background-color: inherit;
text-color: inherit;
vertical-align: 0.5;
horizontal-align: 0.0;
}
/*****----- Listview -----*****/
listview {
enabled: true;
columns: 6;
lines: 1;
cycle: true;
scrollbar: false;
layout: vertical;
spacing: 10px;
background-color: transparent;
cursor: "default";
}
/*****----- Elements -----*****/
element {
enabled: true;
padding: 15px;
border: 0px solid;
border-radius: 0px;
border-color: @selected;
background-color: transparent;
text-color: @foreground;
cursor: pointer;
}
element-text {
font: "feather 20";
background-color: transparent;
text-color: inherit;
cursor: inherit;
vertical-align: 0.5;
horizontal-align: 0.5;
}
element normal.normal,
element alternate.normal {
background-color: var(background-alt);
text-color: var(foreground);
}
element normal.urgent,
element alternate.urgent,
element selected.active {
background-color: var(urgent);
text-color: var(background);
}
element normal.active,
element alternate.active,
element selected.urgent {
background-color: var(active);
text-color: var(background);
}
element selected.normal {
background-color: var(selected);
text-color: var(background);
}

@ -1,97 +0,0 @@
#!/usr/bin/env bash
# Import Current Theme
DIR="$HOME/.config/rofi"
RASI="$DIR/powermenu.rasi"
CNFR="$DIR/confirm.rasi"
# Theme Elements
prompt="`hostname` (`echo $XDG_CURRENT_DESKTOP`)"
mesg="Uptime : `uptime -p | sed -E -e 's/up //g' -e 's/week|weeks/w/g' -e 's/day|days/d/g' -e 's/hour|hours/h/g' -e 's/minute|minutes/m/g'`"
# Options
option_1=""
option_2="☀"
option_3=""
option_4=""
option_5="↺"
option_6=""
yes=''
no=''
# Rofi CMD
rofi_cmd() {
rofi -dmenu \
-p "$prompt" \
-mesg "$mesg" \
-markup-rows \
-theme ${RASI}
}
# Pass variables to rofi dmenu
run_rofi() {
echo -e "$option_1\n$option_2\n$option_3\n$option_4\n$option_5\n$option_6" | rofi_cmd
}
# Confirmation CMD
confirm_cmd() {
rofi -dmenu \
-p 'Confirmation' \
-mesg 'Are you Sure?' \
-theme ${CNFR}
}
# Ask for confirmation
confirm_exit() {
echo -e "$yes\n$no" | confirm_cmd
}
# Confirm and execute
confirm_run () {
selected="$(confirm_exit)"
if [[ "$selected" == "$yes" ]]; then
${1} && ${2} && ${3} && ${4}
else
exit
fi
}
# Execute Command
run_cmd() {
if [[ "$1" == '--opt1' ]]; then
swaylock -f -i ~/.config/hypr/wallpapers/lockscreen.png
elif [[ "$1" == '--opt2' ]]; then
confirm_run 'hyprctl dispatch exit 0'
elif [[ "$1" == '--opt3' ]]; then
confirm_run 'pulsemixer --mute' 'swaylock -f -i ~/.config/hypr/wallpapers/lockscreen.png' 'systemctl suspend' #"$DIR/scripts/lockscreen"
elif [[ "$1" == '--opt4' ]]; then
confirm_run 'systemctl hibernate'
elif [[ "$1" == '--opt5' ]]; then
confirm_run 'systemctl reboot'
elif [[ "$1" == '--opt6' ]]; then
confirm_run 'systemctl poweroff'
fi
}
# Actions
chosen="$(run_rofi)"
case ${chosen} in
$option_1)
run_cmd --opt1
;;
$option_2)
run_cmd --opt2
;;
$option_3)
run_cmd --opt3
;;
$option_4)
run_cmd --opt4
;;
$option_5)
run_cmd --opt5
;;
$option_6)
run_cmd --opt6
;;
esac

@ -23,14 +23,23 @@
outputs = { self, nixpkgs, flake-utils, ... }@inputs: {
colmena = let
hosts = [ "web-dus" "crime" "ryuuko" ];
hosts = [ "web-dus" "crime" "ryuuko" "lain" ];
hostCfg = hostname: {
imports = [ (./config/hosts/${hostname}/configuration.nix) ];
deployment = with nixpkgs.lib; {
tags = [ "all" ];
targetHost = mkDefault config.networking.fqdn;
targetPort = mkDefault 22;
targetUser = mkDefault null;
};
};
in {
meta = {
allowApplyAll = false;
nixpkgs = nixpkgs.legacyPackages.x86_64-linux;
nodeNixpkgs = {
lain = nixpkgs.legacyPackages.aarch64-linux;
};
specialArgs = { inherit inputs; };
};
} // (builtins.listToAttrs (builtins.map (hosts: nixpkgs.lib.attrsets.nameValuePair hosts (hostCfg hosts)) hosts));
@ -44,7 +53,15 @@
./config/hosts/ryuuko/disko.nix
];
};
lain = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = { inherit inputs; };
modules = [
./config/hosts/lain/iso.nix
];
};
};
images.lain = self.nixosConfigurations.lain.config.system.build.sdImage;
} // flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {

Loading…
Cancel
Save