Init
14
nixos/audio.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
pulse.enable = true;
|
||||
#jack.enable = true; # audio production
|
||||
};
|
||||
|
||||
};
|
||||
security.rtkit.enable = true;
|
||||
}
|
||||
101
nixos/default.nix
Normal file
@@ -0,0 +1,101 @@
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
primaryUser,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./fonts.nix
|
||||
./sops.nix
|
||||
./regreet.nix
|
||||
./plymouth
|
||||
./audio.nix
|
||||
./ssh.nix
|
||||
./locale.nix
|
||||
./tailscale.nix
|
||||
./virt.nix
|
||||
./webcam.nix
|
||||
];
|
||||
|
||||
# nix config
|
||||
nix = {
|
||||
settings = {
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
max-jobs = "auto";
|
||||
cores = 0;
|
||||
substituters = [
|
||||
"https://hyprland.cachix.org"
|
||||
"https://nix-community.cachix.org"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
};
|
||||
|
||||
# Garbage collection
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
};
|
||||
|
||||
# Disable Docs
|
||||
documentation = {
|
||||
enable = true;
|
||||
doc.enable = false; # Skip large documentation
|
||||
man.enable = true; # Keep man pages
|
||||
info.enable = false; # Skip info pages
|
||||
};
|
||||
|
||||
nixpkgs.config = {
|
||||
allowUnfree = true;
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users.${primaryUser} = {
|
||||
imports = [ ../home ];
|
||||
};
|
||||
extraSpecialArgs = { inherit inputs primaryUser; };
|
||||
};
|
||||
|
||||
programs = {
|
||||
fish.enable = true;
|
||||
hyprland = {
|
||||
enable = true;
|
||||
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||
};
|
||||
steam.enable = true;
|
||||
dconf.enable = true;
|
||||
appimage = {
|
||||
enable = true;
|
||||
binfmt = true;
|
||||
};
|
||||
};
|
||||
|
||||
security = {
|
||||
pam.services.swaylock = { };
|
||||
polkit.enable = true;
|
||||
apparmor.enable = true;
|
||||
};
|
||||
|
||||
users.users.${primaryUser} = {
|
||||
home = "/home/${primaryUser}";
|
||||
shell = pkgs.fish;
|
||||
isNormalUser = true;
|
||||
openssh.authorizedKeys.keyFiles = [ ./ssh-key ];
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"video"
|
||||
"audio"
|
||||
"libvirtd"
|
||||
];
|
||||
};
|
||||
}
|
||||
8
nixos/fonts.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
fonts.packages = with pkgs; [
|
||||
nerd-fonts.fira-code
|
||||
nerd-fonts.fira-mono
|
||||
nerd-fonts.hack
|
||||
];
|
||||
}
|
||||
18
nixos/locale.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ ... }:
|
||||
{
|
||||
time.timeZone = "Europe/Berlin";
|
||||
i18n = {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
extraLocaleSettings = {
|
||||
LC_ADDRESS = "de_DE.UTF-8";
|
||||
LC_IDENTIFICATION = "de_DE.UTF-8";
|
||||
LC_MEASUREMENT = "de_DE.UTF-8";
|
||||
LC_MONETARY = "de_DE.UTF-8";
|
||||
LC_NAME = "de_DE.UTF-8";
|
||||
LC_NUMERIC = "de_DE.UTF-8";
|
||||
LC_PAPER = "de_DE.UTF-8";
|
||||
LC_TELEPHONE = "de_DE.UTF-8";
|
||||
LC_TIME = "de_DE.UTF-8";
|
||||
};
|
||||
};
|
||||
}
|
||||
36
nixos/plymouth/default.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
mikuTheme = pkgs.stdenv.mkDerivation {
|
||||
name = "plymouth-theme-miku";
|
||||
src = ./miku;
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/plymouth/themes/miku/frames
|
||||
cp miku.plymouth $out/share/plymouth/themes/miku/
|
||||
cp miku.script $out/share/plymouth/themes/miku/
|
||||
cp images/frames/*.png $out/share/plymouth/themes/miku/frames/
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
boot = {
|
||||
plymouth = {
|
||||
enable = true;
|
||||
theme = "miku";
|
||||
themePackages = [
|
||||
mikuTheme
|
||||
];
|
||||
};
|
||||
|
||||
# Enable "Silent boot"
|
||||
consoleLogLevel = 3;
|
||||
initrd.verbose = false;
|
||||
kernelParams = [
|
||||
"quiet"
|
||||
"splash"
|
||||
"boot.shell_on_fail"
|
||||
"udev.log_priority=3"
|
||||
"rd.systemd.show_status=auto"
|
||||
];
|
||||
loader.timeout = 0;
|
||||
};
|
||||
}
|
||||
BIN
nixos/plymouth/miku/images/frames/frame_0000.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0001.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0002.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0003.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0004.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0005.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0006.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0007.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0008.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0009.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0010.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0011.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0012.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0013.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0014.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0015.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0016.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0017.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0018.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0019.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0020.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0021.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0022.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0023.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0024.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0025.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0026.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0027.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0028.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0029.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0030.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0031.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0032.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0033.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0034.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0035.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0036.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0037.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0038.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0039.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0040.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0041.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0042.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0043.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0044.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0045.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0046.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0047.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0048.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0049.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0050.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0051.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
nixos/plymouth/miku/images/frames/frame_0052.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
8
nixos/plymouth/miku/miku.plymouth
Normal file
@@ -0,0 +1,8 @@
|
||||
[Plymouth Theme]
|
||||
Name=Miku
|
||||
Description=Hatsune Miku Dancing
|
||||
ModuleName=Script
|
||||
|
||||
[script]
|
||||
ImageDir=/usr/share/plymouth/themes/miku
|
||||
ScriptFile=/usr/share/plymouth/themes/miku/miku.script
|
||||
30
nixos/plymouth/miku/miku.script
Normal file
@@ -0,0 +1,30 @@
|
||||
# Screen dimensions
|
||||
screen_width = Window.GetWidth();
|
||||
screen_height = Window.GetHeight();
|
||||
|
||||
# Load frames
|
||||
frame_count = 53;
|
||||
frames = [];
|
||||
for (i = 0; i < frame_count; i++) {
|
||||
num = String(i);
|
||||
if (i < 10) num = "000" + num;
|
||||
else if (i < 100) num = "00" + num;
|
||||
else num = "0" + num;
|
||||
frames[i] = Image("frames/frame_" + num + ".png");
|
||||
}
|
||||
|
||||
# Position centered
|
||||
x = (screen_width - 498) / 2;
|
||||
y = (screen_height - 498) / 2;
|
||||
|
||||
# Animation state
|
||||
current_frame = 0;
|
||||
|
||||
fun refresh_callback() {
|
||||
sprite = Sprite(frames[current_frame]);
|
||||
sprite.SetX(x);
|
||||
sprite.SetY(y);
|
||||
current_frame = (current_frame + 1) % frame_count;
|
||||
}
|
||||
|
||||
Plymouth.SetRefreshFunction(refresh_callback);
|
||||
66
nixos/regreet.nix
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
environment.etc = {
|
||||
"greetd/background.png".source = ../assets/wallpapers/lucy_with_cat.png;
|
||||
"greetd/environments".text = ''
|
||||
Hyprland
|
||||
niri-session
|
||||
fish
|
||||
'';
|
||||
};
|
||||
|
||||
programs.regreet = {
|
||||
enable = true;
|
||||
|
||||
cageArgs = [
|
||||
"-s"
|
||||
"-m"
|
||||
"last"
|
||||
];
|
||||
|
||||
settings = {
|
||||
|
||||
background = {
|
||||
path = "/etc/greetd/background.png";
|
||||
fit = "Fill";
|
||||
};
|
||||
|
||||
GTK = {
|
||||
application_prefer_dark_theme = true;
|
||||
cursor_theme_name = lib.mkForce "catppuccin-mocha-dark";
|
||||
font_name = lib.mkForce "FiraCode Nerd Font Propo 12";
|
||||
icon_theme_name = lib.mkForce "Papirus-Dark";
|
||||
theme_name = lib.mkForce "catppuccin-mocha-standard-mauve-dark";
|
||||
};
|
||||
|
||||
commands = {
|
||||
reboot = [
|
||||
"systemctl"
|
||||
"reboot"
|
||||
];
|
||||
poweroff = [
|
||||
"systemctl"
|
||||
"poweroff"
|
||||
];
|
||||
x11_prefix = [
|
||||
"startx"
|
||||
"/usr/bin/env"
|
||||
];
|
||||
};
|
||||
|
||||
appearance = {
|
||||
greeting_msg = "Hey there!";
|
||||
};
|
||||
|
||||
widget.clock = {
|
||||
format = "%A %d.%m.%Y %T";
|
||||
resolution = "500ms";
|
||||
timezone = "Europe/Berlin";
|
||||
label_width = 150;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
18
nixos/sops.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ primaryUser, ... }:
|
||||
{
|
||||
sops = {
|
||||
defaultSopsFile = ../secrets/secrets.yaml;
|
||||
defaultSopsFormat = "yaml";
|
||||
age.keyFile = "/home/phil/.config/sops/age/keys.txt";
|
||||
|
||||
secrets = {
|
||||
GROQ_API_KEY = { };
|
||||
OPENWEATHER_API_KEY = { };
|
||||
ssh_private_key = {
|
||||
path = "/home/${primaryUser}/.ssh/ssh";
|
||||
owner = primaryUser;
|
||||
mode = "0600";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
1
nixos/ssh-key
Normal file
@@ -0,0 +1 @@
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuYuGhqRC/QLoRBH91c3DG5JHlAdRLQsvde18k5ipY2 phil@cyperpunk.de
|
||||
14
nixos/ssh.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
PermitRootLogin = "no";
|
||||
};
|
||||
};
|
||||
|
||||
programs.ssh.startAgent = true;
|
||||
|
||||
}
|
||||
7
nixos/tailscale.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
}
|
||||
20
nixos/virt.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
virtualisation.libvirtd.enable = true;
|
||||
boot.binfmt.emulatedSystems = [
|
||||
"aarch64-linux"
|
||||
"riscv64-linux"
|
||||
];
|
||||
environment.systemPackages = with pkgs; [
|
||||
qemu
|
||||
quickemu
|
||||
quickgui
|
||||
nemu
|
||||
];
|
||||
systemd.tmpfiles.rules = [
|
||||
"L+ /var/lib/qemu/firmware - - - - ${pkgs.qemu}/share/qemu/firmware"
|
||||
];
|
||||
environment.etc."qemu/bridge.conf".text = ''
|
||||
allow br0
|
||||
'';
|
||||
}
|
||||
27
nixos/webcam.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
services.udev.extraRules = ''
|
||||
ACTION=="add", \
|
||||
SUBSYSTEM=="usb", \
|
||||
ATTR{idVendor}=="04a9", \
|
||||
ATTR{idProduct}=="31ea", \
|
||||
RUN+="systemctl restart webcam"
|
||||
'';
|
||||
|
||||
systemd.services.webcam = {
|
||||
enable = true;
|
||||
description = "Canon Camera Webcam";
|
||||
script = ''
|
||||
${pkgs.gphoto2}/bin/gphoto2 --stdout --capture-movie | \
|
||||
${pkgs.ffmpeg}/bin/ffmpeg \
|
||||
-i - \
|
||||
-vcodec rawvideo \
|
||||
-pix_fmt yuv420p \
|
||||
-threads 0 \
|
||||
-framerate 30 \
|
||||
-f v4l2 \
|
||||
/dev/video0
|
||||
'';
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
}
|
||||