Compare commits

...

10 Commits

23 changed files with 139 additions and 74 deletions

66
flake.lock generated
View File

@@ -58,11 +58,11 @@
]
},
"locked": {
"lastModified": 1762276996,
"narHash": "sha256-TtcPgPmp2f0FAnc+DMEw4ardEgv1SGNR3/WFGH0N19M=",
"lastModified": 1764627417,
"narHash": "sha256-D6xc3Rl8Ab6wucJWdvjNsGYGSxNjQHzRc2EZ6eeQ6l4=",
"owner": "nix-community",
"repo": "disko",
"rev": "af087d076d3860760b3323f6b583f4d828c1ac17",
"rev": "5a88a6eceb8fd732b983e72b732f6f4b8269bef3",
"type": "github"
},
"original": {
@@ -111,11 +111,11 @@
]
},
"locked": {
"lastModified": 1762980239,
"narHash": "sha256-8oNVE8TrD19ulHinjaqONf9QWCKK+w4url56cdStMpM=",
"lastModified": 1763759067,
"narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "52a2caecc898d0b46b2b905f058ccc5081f842da",
"rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0",
"type": "github"
},
"original": {
@@ -203,16 +203,16 @@
]
},
"locked": {
"lastModified": 1758463745,
"narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=",
"lastModified": 1764866045,
"narHash": "sha256-0GsEtXV9OquDQ1VclQfP16cU5VZh7NEVIOjSH4UaJuM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3",
"rev": "f63d0fe9d81d36e5fc95497217a72e02b8b7bcab",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-25.05",
"ref": "release-25.11",
"repo": "home-manager",
"type": "github"
}
@@ -385,11 +385,11 @@
]
},
"locked": {
"lastModified": 1751903740,
"narHash": "sha256-PeSkNMvkpEvts+9DjFiop1iT2JuBpyknmBUs0Un0a4I=",
"lastModified": 1764234087,
"narHash": "sha256-NHF7QWa0ZPT8hsJrvijREW3+nifmF2rTXgS2v0tpcEA=",
"owner": "nix-community",
"repo": "nixos-generators",
"rev": "032decf9db65efed428afd2fa39d80f7089085eb",
"rev": "032a1878682fafe829edfcf5fdfad635a2efe748",
"type": "github"
},
"original": {
@@ -400,11 +400,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1762847253,
"narHash": "sha256-BWWnUUT01lPwCWUvS0p6Px5UOBFeXJ8jR+ZdLX8IbrU=",
"lastModified": 1764440730,
"narHash": "sha256-ZlJTNLUKQRANlLDomuRWLBCH5792x+6XUJ4YdFRjtO4=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "899dc449bc6428b9ee6b3b8f771ca2b0ef945ab9",
"rev": "9154f4569b6cdfd3c595851a6ba51bfaa472d9f3",
"type": "github"
},
"original": {
@@ -446,11 +446,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1763421233,
"narHash": "sha256-Stk9ZYRkGrnnpyJ4eqt9eQtdFWRRIvMxpNRf4sIegnw=",
"lastModified": 1764950072,
"narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "89c2b2330e733d6cdb5eae7b899326930c2c0648",
"rev": "f61125a668a320878494449750330ca58b78c557",
"type": "github"
},
"original": {
@@ -474,16 +474,16 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1763334038,
"narHash": "sha256-LBVOyaH6NFzQ3X/c6vfMZ9k4SV2ofhpxeL9YnhHNJQQ=",
"lastModified": 1764831616,
"narHash": "sha256-OtzF5wBvO0jgW1WW1rQU9cMGx7zuvkF7CAVJ1ypzkxA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4c8cdd5b1a630e8f72c9dd9bf582b1afb3127d2c",
"rev": "c97c47f2bac4fa59e2cbdeba289686ae615f8ed4",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-25.05",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
@@ -498,16 +498,16 @@
"systems": "systems_5"
},
"locked": {
"lastModified": 1763332965,
"narHash": "sha256-ixaP8XeGRo4ZMOLlUJm1YSxMjoOMvrPN3UbMMWe2Nt8=",
"lastModified": 1764755396,
"narHash": "sha256-f6UrlGdwg+TIxxyDjeq1M7WGNZH/vpbOm0yzPgkMy9c=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "4ddfbc0414d28d6ba0267470a0b94b84b85ad490",
"rev": "64d9e2616f4ee2acee380d61ccf1f3d610e7e969",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "nixos-25.05",
"ref": "nixos-25.11",
"repo": "nixvim",
"type": "github"
}
@@ -585,11 +585,11 @@
]
},
"locked": {
"lastModified": 1763509310,
"narHash": "sha256-s2WzTAD3vJtPACBCZXezNUMTG/wC6SFsU9DxazB9wDI=",
"lastModified": 1764483358,
"narHash": "sha256-EyyvCzXoHrbL467YSsQBTWWg4sR96MH1sPpKoSOelB4=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "3ee33c0ed7c5aa61b4e10484d2ebdbdc98afb03e",
"rev": "5aca6ff67264321d47856a2ed183729271107c9c",
"type": "github"
},
"original": {
@@ -724,11 +724,11 @@
"yazi-flavors": {
"flake": false,
"locked": {
"lastModified": 1761204921,
"narHash": "sha256-bavHcmeGZ49nNeM+0DSdKvxZDPVm3e6eaNmfmwfCid0=",
"lastModified": 1763969227,
"narHash": "sha256-twgXHeIj52EfpMpLrhxjYmwaPnIYah3Zk/gqCNTb2SQ=",
"owner": "yazi-rs",
"repo": "flavors",
"rev": "f6b425a6d57af39c10ddfd94790759f4d7612332",
"rev": "3edeb49597e1080621a9b0b50d9f0a938b8f62bb",
"type": "github"
},
"original": {

View File

@@ -3,7 +3,7 @@
inputs = {
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
systems.url = "github:nix-systems/default-linux";
nixos-hardware.url = "github:nixos/nixos-hardware";
impermanence.url = "github:nix-community/impermanence";
@@ -16,7 +16,7 @@
};
home-manager = {
url = "github:nix-community/home-manager/release-25.05";
url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
@@ -38,7 +38,7 @@
flake = false;
};
nixvim = {
url = "github:nix-community/nixvim/nixos-25.05";
url = "github:nix-community/nixvim/nixos-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-matlab = {

View File

@@ -52,6 +52,14 @@ in {
shfmt
pyright
clang-tools # c++ lsp etc
ccls # alternative c++ lsp
cmake
bear
cmake-language-server
# qt6.full # qt tools and libs including lsp
tinymist # typst lsp
ltex-ls # latex languagetool
graphviz

View File

@@ -12,7 +12,7 @@ with lib; {
dejavu_fonts
noto-fonts
noto-fonts-cjk-sans
noto-fonts-emoji
noto-fonts-color-emoji
liberation_ttf
fira-code
fira-code-symbols

View File

@@ -4,7 +4,7 @@
inputs,
...
}: {
imports = [inputs.nixvim.homeManagerModules.nixvim];
imports = [inputs.nixvim.homeModules.nixvim];
home.sessionVariables = {
EDITOR = "nvim";

View File

@@ -1,7 +1,7 @@
{pkgs, ...}: {
home.packages = with pkgs; [
bat
du-dust # Like du tree but better
dust # Like du tree but better
fd # better find
fdupes # find and delete duplicate files
ffmpeg
@@ -24,7 +24,7 @@
p7zip # unzip 7zip archives
parted
pciutils # lspci
poppler_utils # Pdf utils including pdfimages
poppler-utils # Pdf utils including pdfimages
libqalculate # Nice tui calculator (qalc)
ripgrep # better grep
rnr # renaming tool

View File

@@ -27,7 +27,7 @@
# element-desktop
# rocketchat-desktop
thunderbird
tdesktop # telegram
telegram-desktop # telegram
# schildichat-desktop # not updated regularly
nheko
evince # Simple pdf reader, good for focusing on document content
@@ -51,8 +51,7 @@
# rpi-imager # make isos
# rustdesk
tor-browser
unstable.rusty-path-of-building # Path of Building for poe1 and poe2
path-of-building # Path of Building for poe1 and poe2
rusty-path-of-building # Path of Building for poe1 and poe2
# frajul.pob-dev-version # Path of Building
vlc
wineWowPackages.stable # 32-bit and 64-bit wine

View File

@@ -35,6 +35,8 @@
biblatex
;
})
vagrant
qtcreator
matlab # Using nix-matlab overlay defined in flake
maven
nodejs

View File

@@ -1,13 +1,10 @@
{
lib,
pkgs,
config,
...
}: {
programs.tmux = {
enable = true;
clock24 = true;
keyMode = "vi";
customPaneNavigationAndResize = true; # use hjkl
mouse = true;
prefix = "C-Space"; # use instead of C-b
};
}

View File

@@ -9,8 +9,8 @@
home.packages = with pkgs; [
exiftool
unar # extract archives
xdragon # dragndrop
poppler_utils # pdf preview
dragon-drop# dragndrop
poppler-utils # pdf preview
fd
ripgrep
fzf

View File

@@ -5,7 +5,7 @@ with pkgs; [
dejavu_fonts
noto-fonts
noto-fonts-cjk-sans
noto-fonts-emoji
noto-fonts-color-emoji
liberation_ttf
fira-code
fira-code-symbols

View File

@@ -31,7 +31,7 @@ with pkgs; [
ffmpeg
julia-bin
poppler_utils # Pdf utils including pdfimages
poppler-utils # Pdf utils including pdfimages
sage
pkg-config # Often needed to build something

View File

@@ -20,7 +20,7 @@
../common/optional/virtualbox.nix
../common/optional/podman.nix
# ../common/optional/wireguard.nix
../common/optional/wireguard.nix
../common/optional/flatpak.nix
../common/optional/avahi.nix
@@ -50,8 +50,8 @@
programs.steam.enable = true;
# TODO: not working
services.logind.lidSwitch = "lock";
services.logind.lidSwitchDocked = "lock";
# services.logind.lidSwitch = "lock";
# services.logind.lidSwitchDocked = "lock";
programs.kdeconnect.enable = true;

View File

@@ -2,7 +2,8 @@
lib,
outputs,
...
}: {
}:
{
# Apply overlays
nixpkgs = {
# TODO: apply this to hm and nixos without duplicate code
@@ -18,7 +19,9 @@
};
};
nix.settings.auto-optimise-store = lib.mkDefault true;
# optimize at every build, slows down builds
# better to do optimise.automatic for regular optimising
# nix.settings.auto-optimise-store = lib.mkDefault true;
nix.settings.experimental-features = [
"nix-command"
"flakes"
@@ -32,6 +35,10 @@
# Keep the last 3 generations
options = "--delete-older-than +3";
};
nix.optimise = {
automatic = true;
dates = [ "weekly" ]; # Optional; allows customizing optimisation schedule
};
programs.nix-ld.enable = true;

View File

@@ -1,7 +1,7 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
shared-mime-info # extended mimetype support
lxde.lxmenu-data # open with "Installed Applications"
lxmenu-data # open with "Installed Applications"
pcmanfm
];

View File

@@ -55,7 +55,7 @@ in {
# element-desktop
# rocketchat-desktop
thunderbird
tdesktop # telegram
telegram-desktop # telegram
# schildichat-desktop # not updated regularly
nheko
evince # Simple pdf reader, good for focusing on document content

View File

@@ -26,6 +26,26 @@
../common/optional/avahi.nix
];
environment.systemPackages = [
(pkgs.python3.withPackages (p:
with p; [
numpy
pillow
flask
rpi-gpio
webcolors
psutil
mido
rtmidi-python
spidev
waitress
websockets
werkzeug
pkgs.frajul.rpi-ws281x-python
]))
];
# disko.devices.disk.main.device = "/dev/mmcblk1";
# enabled by fish, disabling speeds up builds
@@ -169,7 +189,7 @@
};
};
networking.firewall.enable = true;
networking.firewall.enable = false;
networking.firewall.allowedTCPPorts = [
5900 # for vnc
];
@@ -201,7 +221,7 @@
hardware.raspberry-pi."4".apply-overlays-dtmerge.enable = true;
hardware.deviceTree = {
enable = true;
filter = lib.mkForce "*-rpi-*.dtb";
filter = lib.mkForce "*-rpi-4*.dtb";
overlays = [
{
name = "spi";
@@ -234,4 +254,23 @@
## My own Piano LED Visualizer
services.piano-led-visualizer.enable = true;
## Crude fix for avahi
systemd.timers.avahiRestart = {
description = "Restart avahi-daemon every 5 minutes";
wantedBy = ["timers.target"];
timerConfig = {
OnBootSec = "5min";
OnUnitActiveSec = "5min";
Unit = "avahiRestart.service";
};
};
systemd.services.avahiRestart = {
description = "Restart avahi-daemon service";
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.systemd}/bin/systemctl restart avahi-daemon.service";
};
};
}

View File

@@ -15,6 +15,7 @@
boot.kernelModules = [];
boot.extraModulePackages = [];
boot.kernelPackages = pkgs.linuxKernel.packages.linux_rpi4;
boot.blacklistedKernelModules = ["snd_bcm2835"]; # Disables sound, required for ws281x to work
# boot.supportedFilesystems = lib.mkForce [
# # remove zfs, since its incompatible with latest kernel
# "vfat"

View File

@@ -27,6 +27,10 @@ in {
};
config = lib.mkIf cfg.enable {
security.sudo.extraConfig = ''
root ALL=(julian) NOPASSWD: ${pkgs.git}/bin/git -C "${cfg.flakePath}" commit -m *
'';
# Ensure the flag directory exists
systemd.tmpfiles.rules = [
"d /var/lib/frajul-auto-upgrade 0755 root root -"
@@ -67,11 +71,16 @@ in {
echo $$ > "$LOCK_FILE"
trap 'rm -f "$LOCK_FILE"' EXIT
if /run/current-system/sw/bin/nix flake update --flake "${cfg.flakePath}" && /run/current-system/sw/bin/nixos-rebuild switch --flake "${cfg.flakePath}"; then
# Back up flake.lock
cp -f "${cfg.flakePath}/flake.lock" /var/lib/frajul-auto-upgrade/flake.lock.bak
# Try updating
if /run/current-system/sw/bin/nix flake update --flake "${cfg.flakePath}" && /run/current-system/sw/bin/nixos-rebuild switch --flake "${cfg.flakePath}" && ${pkgs.sudo}/bin/sudo -u julian git -C "${cfg.flakePath}" commit -m "Auto-update flake.lock" -- flake.lock; then
echo "success" > "$LAST_STATUS_FILE"
else
echo "failure" > "$LAST_STATUS_FILE"
git -C "${cfg.flakePath}" restore flake.lock
# Restore flake.lock
cp -f /var/lib/frajul-auto-upgrade/flake.lock.bak "${cfg.flakePath}/flake.lock"
fi
# Write full timestamp

View File

@@ -26,6 +26,9 @@ in {
users.users.${cfg.user} = {
isSystemUser = true;
group = cfg.group;
createHome = true;
home = "/home/${cfg.user}";
extraGroups = ["wheel" "gpio"];
};
users.groups.${cfg.group} = {};
@@ -36,11 +39,12 @@ in {
wantedBy = ["multi-user.target"];
serviceConfig = {
WorkingDirectory = "/home/${cfg.user}/Piano-LED-Visualizer";
ExecStart = "${pkgs.frajul.piano-led-visualizer}/bin/piano-led-visualizer";
Restart = "always";
Type = "simple";
User = cfg.user;
Group = cfg.group;
# User = cfg.user;
# Group = cfg.group;
};
};
};

View File

@@ -14,5 +14,7 @@
wl-ocr = pkgs.callPackage ./wl-ocr {};
rtklib = pkgs.qt6Packages.callPackage ./rtklib {};
pob2-frajul = pkgs.callPackage ./pob2-frajul {};
rpi-ws281x-python = pkgs.callPackage ./rpi-ws281x-python {};
piano-led-visualizer = pkgs.callPackage ./piano-led-visualizer {};
}

View File

@@ -1,10 +1,12 @@
{
lib,
python3,
callPackage,
fetchFromGitHub,
...
}: let
pythonPackages = python3.pkgs;
rpi-ws281x-python = callPackage ../rpi-ws281x-python {inherit python3;};
in
pythonPackages.buildPythonApplication rec {
pname = "piano-led-visualizer";
@@ -36,7 +38,8 @@ in
waitress
websockets
werkzeug
# rpi_ws281x
rpi-ws281x-python
];
format = "setuptools";

View File

@@ -10,15 +10,12 @@ python3.pkgs.buildPythonPackage rec {
src = fetchFromGitHub {
owner = "rpi-ws281x";
repo = "rpi-ws281x-pytho";
repo = "rpi-ws281x-python";
rev = "v${version}";
sha256 = "sha256-tnjvFDBa+sNX6dK6/I1/rRt62k15kTP+9J8eyFRFs/I=";
sha256 = "sha256-CVPibDs1QLeXhtoEBw3JplKIIUpzahjgJKy8GVy99Wk=";
fetchSubmodules = true;
deepClone = true;
};
# sourceRoot = "${src}/library";
format = "setuptools";
propagatedBuildInputs = with python3.pkgs; [
@@ -30,9 +27,6 @@ python3.pkgs.buildPythonPackage rec {
sourceRoot="$sourceRoot/library"
'';
# Some of the bindings compile C code, so you may need these
nativeBuildInputs = [python3.pkgs.setuptools pkgs.scons];
meta = with lib; {
description = "Python bindings for the rpi_ws281x C library";
homepage = "https://github.com/rpi-ws281x/rpi-ws281x-python";