From 8b5124aed4310c40db56d0de30f2c0b433835002 Mon Sep 17 00:00:00 2001 From: mjallen Date: Mon, 19 May 2025 15:47:39 -0500 Subject: [PATCH] pi4 argononed --- flake.lock | 13 --------- flake.nix | 6 ----- hosts/pi4/argononed.nix | 19 +++++++++++--- hosts/pi4/pkg.nix | 58 +++++++++++++++++++++++++++++++++++++++++ hosts/pi4/sops.nix | 2 +- 5 files changed, 75 insertions(+), 23 deletions(-) create mode 100644 hosts/pi4/pkg.nix diff --git a/flake.lock b/flake.lock index 93da4c4..2e14740 100755 --- a/flake.lock +++ b/flake.lock @@ -1239,18 +1239,6 @@ "type": "github" } }, - "pi4-argononed": { - "flake": false, - "locked": { - "path": "gitlab:/DarkElvenAngel/argononed/-/tree/master/OS/nixos", - "type": "path" - }, - "original": { - "path": "gitlab:/DarkElvenAngel/argononed/-/tree/master/OS/nixos", - "type": "path" - }, - "parent": [] - }, "pi4-disko": { "inputs": { "nixpkgs": [ @@ -1621,7 +1609,6 @@ "nixos-raspberrypi": "nixos-raspberrypi", "nixpkgs-stable": "nixpkgs-stable_4", "nixpkgs-unstable": "nixpkgs-unstable", - "pi4-argononed": "pi4-argononed", "pi4-disko": "pi4-disko", "pi4-home-manager": "pi4-home-manager", "pi4-impermanence": "pi4-impermanence", diff --git a/flake.nix b/flake.nix index 920d601..723bd6d 100755 --- a/flake.nix +++ b/flake.nix @@ -186,11 +186,6 @@ inputs.nixpkgs.follows = "pi4-nixpkgs"; }; - pi4-argononed = { - url = "gitlab:/DarkElvenAngel/argononed/-/tree/master/OS/nixos"; - flake = false; - }; - ##################################################### # Steamdeck # ##################################################### @@ -311,7 +306,6 @@ pi4-nixos-hardware, pi4-nixos-raspberrypi, pi4-disko, - pi4-argononed, # Steamdeck steamdeck-nixpkgs, diff --git a/hosts/pi4/argononed.nix b/hosts/pi4/argononed.nix index cd94bff..51b99c7 100644 --- a/hosts/pi4/argononed.nix +++ b/hosts/pi4/argononed.nix @@ -1,6 +1,19 @@ -{ argononed, ...}: +#{ pkgs, ... }: +#let +# argononed = pkgs.callPackage ./pkg.nix {}; +#in +#{ +# environment.systemPackages = [ argononed ]; +#} +{ lib, stdenv, pkgs, config, ...}: { - imports = [ "${argononed}/OS/nixos" ]; + imports = let + argononed = fetchGit { + url = "https://github.com/mjallen18/argononed.git"; + ref = "dev"; # Or any other branches deemed suitable + }; + in + [ "${argononed}/OS/nixos" ]; services.argonone = { enable = true; @@ -12,4 +25,4 @@ hysteresis = 4; }; }; -} \ No newline at end of file +} diff --git a/hosts/pi4/pkg.nix b/hosts/pi4/pkg.nix new file mode 100644 index 0000000..39d7ce2 --- /dev/null +++ b/hosts/pi4/pkg.nix @@ -0,0 +1,58 @@ +{ lib, stdenv, fetchFromGitHub, nix-gitignore, dtc, installShellFiles, logLevel ? 5, ... }: + +let + rawSrc = fetchFromGitHub { + owner = "mjallen18"; + repo = "argononed"; + rev = "master"; # replace with actual commit or tag + sha256 = "sha256-PpFR+6Aa4Pz9EmxOayMSsSTKFzUR6sYIAkGZ8+SUK18="; # fill this in with actual hash + }; + + ignores = '' + /* + !/version + !/makefile + !/configure + !/src + !/OS + /OS/* + !/OS/_common/ + !/OS/nixos/ + ''; + + cleanSrc = nix-gitignore.gitignoreSourcePure ignores rawSrc; +in + +stdenv.mkDerivation { + pname = "argononed"; + version = lib.strings.fileContents "${cleanSrc}/version"; + + src = cleanSrc; + + nativeBuildInputs = [ dtc installShellFiles ]; + + preConfigure = '' + patchShebangs --build ./configure + export TARGET_DISTRO=nixos + ''; + + patches = [ + "${cleanSrc}/OS/nixos/patches/nixos.patch" + "${cleanSrc}/OS/nixos/patches/shutdown.patch" + ]; + + buildFlags = [ "LOGLEVEL=${toString logLevel}" ]; + + installFlags = [ "NIX_DRVOUT=$(out)" ]; + + postInstall = '' + installShellCompletion --bash --name argonone-cli OS/_common/argonone-cli-complete.bash + ''; + + meta = { + description = "A replacement daemon for the Argon One Raspberry Pi case"; + homepage = "https://gitlab.com/DarkElvenAngel/argononed"; + license = lib.licenses.mit; + platforms = [ "aarch64-linux" ]; + }; +} diff --git a/hosts/pi4/sops.nix b/hosts/pi4/sops.nix index ced3c22..ece2c22 100755 --- a/hosts/pi4/sops.nix +++ b/hosts/pi4/sops.nix @@ -5,7 +5,7 @@ in { sops = { defaultSopsFile = ../../secrets/secrets.yaml; - age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + age.keyFile = /home/matt/.config/sops/age/keys.txt; # ------------------------------ # Secrets