This commit is contained in:
Chris Dombroski 2024-09-19 20:46:32 -04:00
parent 16bfa3f839
commit 27a029fe25
7 changed files with 66 additions and 59 deletions

View file

@ -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",

View file

@ -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;
};

View file

@ -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";

View file

@ -2,6 +2,7 @@
config,
lib,
pkgs,
inputs,
...
}:
let
@ -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";

View file

@ -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
]
}
'';
});
}

View file

@ -1 +0,0 @@
final: prev: { zwave-js-ui = (prev.callPackage ../pkgs/zwave-js-ui.nix { }); }

View file

@ -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;