diff --git a/flake.lock b/flake.lock index f9f0a97..b13b77a 100644 --- a/flake.lock +++ b/flake.lock @@ -158,6 +158,29 @@ "type": "github" } }, + "ez-configs": { + "inputs": { + "flake-parts": [ + "flake-parts" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1720994547, + "narHash": "sha256-5WmTdtALYr8zSTBEeyKWos08pqNwRJ2SiT/vAnw19TU=", + "owner": "ehllie", + "repo": "ez-configs", + "rev": "563000e533a1b1aa957a4b788bf505cd243e5154", + "type": "github" + }, + "original": { + "owner": "ehllie", + "repo": "ez-configs", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -176,7 +199,9 @@ }, "flake-parts": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib" + "nixpkgs-lib": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1726153070, @@ -293,18 +318,6 @@ "type": "github" } }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1725233747, - "narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" - } - }, "nixunstable": { "locked": { "lastModified": 1726463316, @@ -325,6 +338,7 @@ "inputs": { "deploy-rs": "deploy-rs", "devshell": "devshell", + "ez-configs": "ez-configs", "flake-compat": "flake-compat", "flake-parts": "flake-parts", "home-manager": "home-manager", diff --git a/flake.nix b/flake.nix index 1019753..a6ee7c4 100644 --- a/flake.nix +++ b/flake.nix @@ -3,10 +3,12 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; nixunstable.url = "github:NixOS/nixpkgs/nixos-unstable"; - flake-parts.url = "github:hercules-ci/flake-parts"; + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; flake-compat = { url = "github:edolstra/flake-compat"; - flake = false; }; devshell = { url = "github:numtide/devshell"; @@ -36,17 +38,33 @@ }; }; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + ez-configs = { + url = "github:ehllie/ez-configs"; + inputs = { + flake-parts.follows = "flake-parts"; + nixpkgs.follows = "nixpkgs"; + }; + }; }; outputs = - inputs@{ flake-parts, ... }: - flake-parts.lib.mkFlake { inherit inputs; } ( + inputs: + inputs.flake-parts.lib.mkFlake { inherit inputs; } ( { withSystem, self, ... }: { - imports = [ inputs.devshell.flakeModule ]; + imports = [ + inputs.devshell.flakeModule + inputs.ez-configs.flakeModule + ]; systems = [ "x86_64-linux" "aarch64-linux" ]; + ezConfigs = { + root = ./.; + globalArgs = { + inherit inputs; + }; + }; flake = { deploy = { sshUser = "root"; @@ -139,7 +157,7 @@ (final: prev: { deploy-rs = { inherit (inputs.nixpkgs.legacyPackages.${system}) deploy-rs; - lib = prev.deploy-rs.lib; + inherit (prev.deploy-rs) lib; }; }) ]; @@ -151,6 +169,7 @@ sops ]; }; + packages.zwave-js-ui = pkgs.callPackage ./pkgs/zwave-js-ui.nix { }; checks = inputs.deploy-rs.lib.${system}.deployChecks self.deploy; formatter = pkgs.nixfmt-rfc-style; }; diff --git a/modules/common/nix.nix b/modules/common/nix.nix index d8c3354..38500ec 100644 --- a/modules/common/nix.nix +++ b/modules/common/nix.nix @@ -15,10 +15,6 @@ }; optimise.automatic = true; }; - nixpkgs.overlays = [ - (import ../../overlays/recyclarr.nix) - (import ../../overlays/zwave-js-ui.nix) - ]; system.autoUpgrade = { enable = true; flake = "git+https://git.icanttype.org/cdombroski/nix-configs.git"; diff --git a/modules/zwave-js-ui.nix b/modules/zwave-js-ui.nix index b725986..b7f9c0a 100644 --- a/modules/zwave-js-ui.nix +++ b/modules/zwave-js-ui.nix @@ -2,6 +2,7 @@ config, lib, pkgs, + inputs, ... }: let @@ -19,9 +20,9 @@ in serialPort = mkOption { type = types.path; description = '' - Serial port for the Z-Wave controller. + Serial port for the Z-Wave controller. - Used for permissions only; must be additionally set in the application + Used for permissions only; must be additionally set in the application ''; example = "/dev/ttyUSB0"; }; @@ -38,7 +39,7 @@ in STORE_DIR = "/var/lib/zwave-js-ui"; ZWAVEJS_EXTERNAL_CONFIG = "/var/lib/zwave-js-ui/.config-db"; }; - script = "${pkgs.zwave-js-ui}/bin/zwave-js-ui"; + script = "${inputs.self.packages.${pkgs.stdenv.system}.zwave-js-ui}/bin/zwave-js-ui"; wantedBy = [ "multi-user.target" ]; serviceConfig = { RuntimeDirectory = "zwave-js-ui"; diff --git a/overlays/recyclarr.nix b/overlays/recyclarr.nix deleted file mode 100644 index 8d0c60a..0000000 --- a/overlays/recyclarr.nix +++ /dev/null @@ -1,28 +0,0 @@ -final: prev: -let - os = "linux"; - arch = "x64"; - hash = "sha256:04vg1s86krg7baifcpnqr5zg6jd6nfw0jhjsq09zzpxwg5skxlf7"; - version = "7.2.1"; -in -{ - recyclarr = prev.recyclarr.overrideAttrs (old: { - inherit version; - name = "recyclarr-${version}"; - src = prev.fetchurl { - url = "https://github.com/recyclarr/recyclarr/releases/download/v${version}/recyclarr-${os}-${arch}.tar.xz"; - inherit hash; - }; - postInstall = '' - wrapProgram $out/bin/recyclarr \ - --prefix PATH : ${prev.lib.makeBinPath [ prev.git ]} \ - --prefix LD_LIBRARY_PATH : ${ - prev.lib.makeLibraryPath [ - prev.icu - prev.openssl - prev.zlib - ] - } - ''; - }); -} diff --git a/overlays/zwave-js-ui.nix b/overlays/zwave-js-ui.nix deleted file mode 100644 index 75fc5f5..0000000 --- a/overlays/zwave-js-ui.nix +++ /dev/null @@ -1 +0,0 @@ -final: prev: { zwave-js-ui = (prev.callPackage ../pkgs/zwave-js-ui.nix { }); } diff --git a/systems/zeus/configuration.nix b/systems/zeus/configuration.nix index 0525471..497c595 100644 --- a/systems/zeus/configuration.nix +++ b/systems/zeus/configuration.nix @@ -1,4 +1,10 @@ -{ config, pkgs, ... }: +{ + config, + pkgs, + pkgs-unstable, + inputs, + ... +}: { imports = [ @@ -45,7 +51,7 @@ networking.hostId = "9e95b576"; systemd.services = { recyclarr = { - script = "${pkgs.recyclarr}/bin/recyclarr sync"; + script = "${pkgs-unstable.recyclarr}/bin/recyclarr sync"; startAt = "daily"; }; }; @@ -175,7 +181,7 @@ name = "my-zwave-js-ui"; tag = "latest"; contents = with pkgs; [ cacert ]; - config.Cmd = [ "${pkgs.zwave-js-ui}/bin/zwave-js-ui" ]; + config.Cmd = [ "${inputs.self.packages.${pkgs.stdenv.system}.zwave-js-ui}/bin/zwave-js-ui" ]; }; volumes = [ "zwave-config:/usr/src/app/store" ]; environment = { @@ -409,7 +415,7 @@ docker-compose tcpdump ethtool - recyclarr + pkgs-unstable.recyclarr ]; persistence."/persist" = { enableWarnings = false;