From f297b6aa213b9b25a2bed3a77efd3a73f425ad7e Mon Sep 17 00:00:00 2001 From: nullishamy Date: Thu, 9 May 2024 15:19:31 +0100 Subject: [PATCH 1/2] build: package for nix --- flake.nix | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index edc36fd..25edf12 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,12 @@ }; }; - outputs = { self, nixpkgs, pxalarm-repo, ... } @ inputs: let + outputs = { + self, + nixpkgs, + pxalarm-repo, + ... + } @ inputs: let systems = [ "aarch64-darwin" "aarch64-linux" @@ -18,16 +23,23 @@ "x86_64-linux" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); - - in { + in rec { formatter = forAllSystems (system: let pkgs = nixpkgs.legacyPackages.${system}; in pkgs.alejandra); - devShells = forAllSystems (system: let + packages = forAllSystems (system: let pkgs = nixpkgs.legacyPackages.${system}; pkgs-pxalarm = pkgs.writeShellScriptBin "pxalarm" (builtins.readFile "${pxalarm-repo}/pxalarm"); + in rec { + pxalarm = pkgs-pxalarm; + default = pxalarm; + }); + + devShells = forAllSystems (system: let + pkgs = nixpkgs.legacyPackages.${system}; + pkgs-pxalarm = packages.${system}.default; in rec { default = pxalarm; pxalarm = From 8949511ba2c8629fffdae592c41aede89e0db073 Mon Sep 17 00:00:00 2001 From: nullishamy Date: Thu, 9 May 2024 15:24:55 +0100 Subject: [PATCH 2/2] build: remove redundant input --- flake.lock | 19 +------------------ flake.nix | 7 +------ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/flake.lock b/flake.lock index fbc2b6c..2a0995e 100644 --- a/flake.lock +++ b/flake.lock @@ -16,26 +16,9 @@ "type": "github" } }, - "pxalarm-repo": { - "flake": false, - "locked": { - "lastModified": 1699640848, - "narHash": "sha256-4vRjkEYENJerPPLbAssvM59e1uTv4Ff+hNHnCkaeKC0=", - "owner": "iruzo", - "repo": "pxalarm", - "rev": "c47dda1009cf647586fb0a4163e692074add3173", - "type": "github" - }, - "original": { - "owner": "iruzo", - "repo": "pxalarm", - "type": "github" - } - }, "root": { "inputs": { - "nixpkgs": "nixpkgs", - "pxalarm-repo": "pxalarm-repo" + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index 25edf12..dbad628 100644 --- a/flake.nix +++ b/flake.nix @@ -3,16 +3,11 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; - pxalarm-repo = { - url = "github:iruzo/pxalarm"; - flake = false; - }; }; outputs = { self, nixpkgs, - pxalarm-repo, ... } @ inputs: let systems = [ @@ -31,7 +26,7 @@ packages = forAllSystems (system: let pkgs = nixpkgs.legacyPackages.${system}; - pkgs-pxalarm = pkgs.writeShellScriptBin "pxalarm" (builtins.readFile "${pxalarm-repo}/pxalarm"); + pkgs-pxalarm = pkgs.writeShellScriptBin "pxalarm" (builtins.readFile ./pxalarm); in rec { pxalarm = pkgs-pxalarm; default = pxalarm;