change srht builds for hydra, refactor flake

This commit is contained in:
Gabriel Fontes
2023-06-11 00:48:38 -03:00
parent ef77a54805
commit 1abee86425
4 changed files with 39 additions and 89 deletions

View File

@@ -1,16 +0,0 @@
image: nixos/unstable
packages:
- nixos.cachix
environment:
NIX_CONFIG: "experimental-features = nix-command flakes"
secrets:
- f2907d38-97b4-4e7d-9fb9-57b3fb0135af
tasks:
- setup_cachix: |
cat ~/.cachix_token | cachix authtoken --stdin
cachix use misterio
- build: |
cd disconic
nix --quiet build
- upload_cachix: |
nix path-info disconic/result/ -r | cachix push misterio

14
.hydra.json Normal file
View File

@@ -0,0 +1,14 @@
{
"main": {
"enabled": 1,
"type": 1,
"hidden": false,
"description": "Build main branch",
"flake": "github:misterio77/disconic/main",
"checkinterval": 60,
"schedulingshares": 10,
"enableemail": false,
"emailoverride": "",
"keepnr": 1
}
}

36
flake.lock generated
View File

@@ -18,41 +18,7 @@
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
"nixpkgs": "nixpkgs"
}
}
},

View File

@@ -1,49 +1,35 @@
{
description = "Discord bot for interacting with subsonic music libraries";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
utils.url = "github:numtide/flake-utils";
nixConfig = {
extra-substituters = [ "https://cache.m7.rs" ];
extra-trusted-public-keys =
[ "cache.m7.rs:kszZ/NSwE/TjhOcPPQ16IuUiuRSisdiIwhKZCxguaWg=" ];
};
outputs = { self, nixpkgs, utils }:
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
outputs = { self, nixpkgs }:
let
name = "disconic";
overlay = final: prev: {
${name} = final.callPackage ./default.nix { };
forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ];
forAllPkgs = f: forAllSystems (sys: f pkgsFor.${sys});
pkgsFor = nixpkgs.legacyPackages;
in {
nixosModules.default = import ./module.nix;
overlays.default = final: _prev: {
disconic = final.callPackage ./default.nix { };
};
overlays = [ overlay ];
in
rec {
inherit overlay overlays;
nixosModules."${name}" = import ./module.nix;
nixosModule = nixosModules."${name}";
} //
(utils.lib.eachDefaultSystem (system:
let
pkgs = (import nixpkgs { inherit system overlays; });
in
rec {
# nix build
packages.${name} = pkgs.${name};
defaultPackage = packages.${name};
packages = forAllPkgs (pkgs: {
default = pkgs.callPackage ./default.nix { };
});
# nix run
apps.${name} = utils.lib.mkApp { drv = packages.${name}; };
defaultApp = apps.${name};
devShells = forAllPkgs (pkgs: {
inputsFrom = [( pkgs.callPackage ./default.nix { })];
buildInputs = with pkgs; [ clippy rust-analyzer rustc rustfmt ];
});
# nix develop
devShell = pkgs.mkShell {
inputsFrom = [ defaultPackage ];
buildInputs = with pkgs;
[
clippy
rust-analyzer
rustc
rustfmt
];
hydraJobs = self.outputs.packages;
};
}
));
}