diff options
| author | seth <[email protected]> | 2023-07-02 14:17:43 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-07-02 18:25:08 +0000 |
| commit | dfc33b227931d06cc3510022cb6fe815ef690463 (patch) | |
| tree | d21511bb3477719bc45e6cef4e1cd5af59e89348 | |
| parent | c54e7f3aa30e5c6615fed42cbd2e76b01ad17c82 (diff) | |
!hercules-ci -> garnix
| -rw-r--r-- | .github/dependabot.yml | 8 | ||||
| -rw-r--r-- | README.md | 26 | ||||
| -rw-r--r-- | flake.nix | 72 | ||||
| -rw-r--r-- | garnix.yaml | 5 | ||||
| -rw-r--r-- | lib/default.nix | 4 | ||||
| -rw-r--r-- | pkgs/_theseus.nix (renamed from pkgs/theseus.nix) | 0 | ||||
| -rw-r--r-- | pkgs/default.nix | 18 | ||||
| -rw-r--r-- | pkgs/discord-canary.nix | 1 | ||||
| -rw-r--r-- | pkgs/discord.nix | 1 |
9 files changed, 89 insertions, 46 deletions
diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1d662ce --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + commit-message: + prefix: "actions" @@ -1,14 +1,30 @@ # nix-exprs -[](https://hercules-ci.com/github/getchoo/nix-exprs) +[](https://garnix.io) ## how to use -### enable cachix +### enable binary cache -i have a binary cache at <https://getchoo.cachix.org>, make sure to enable it -in your flake or nixos/darwin config or use `nix run nixpkgs#cachix use getchoo` -for cli support. +all packages are built with [garnix](https://garnix.io/), and cached on their servers. you can use this +yourself by following the instructions [here](https://garnix.io/docs/caching). i would also recommend +[donating](https://opencollective.com/garnix_io) if you can! + +example: + +```nix +{ + nix.settings = { + trusted-substituters = [ + "https://cache.garnix.io" + ]; + + trusted-public-keys = [ + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + ]; + } +} +``` ### library @@ -2,8 +2,12 @@ description = "getchoo's nix expressions"; nixConfig = { - extra-substituters = ["https://nix-community.cachix.org"]; - extra-trusted-public-keys = ["nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="]; + extra-substituters = [ + "https://cache.garnix.io" + ]; + extra-trusted-public-keys = [ + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + ]; }; inputs = { @@ -27,26 +31,18 @@ ]; forAllSystems = nixpkgs.lib.genAttrs systems; - nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;}); - forEachSystem = fn: forAllSystems (s: fn nixpkgsFor.${s}); - - packageSet = pkgs: - with pkgs; { - cartridges = callPackage ./pkgs/cartridges.nix {}; - huion = callPackage ./pkgs/huion.nix {}; - mommy = callPackage ./pkgs/mommy.nix {}; - # broken due to upstrea adopting pnpm - # theseus = callPackage ./pkgs/theseus.nix {}; - treefetch = callPackage ./pkgs/treefetch.nix {}; - swhkd = callPackage ./pkgs/swhkd {}; - vim-just = callPackage ./pkgs/vim-just.nix {}; - xwaylandvideobridge = callPackage ./pkgs/xwaylandvideobridge.nix {}; - }; + nixpkgsFor = forAllSystems (system: + import nixpkgs { + inherit system; + overlays = [self.overlays.default]; + }); - overrides = prev: { - discord = import ./pkgs/discord.nix prev; - discord-canary = import ./pkgs/discord-canary.nix prev; - }; + forEachSystem = fn: + forAllSystems (system: + fn { + inherit system; + pkgs = nixpkgsFor.${system}; + }); in { flakeModules = { default = import ./modules/flake; @@ -54,36 +50,38 @@ hydraJobs = import ./modules/flake/hydraJobs.nix; }; - formatter = forEachSystem (pkgs: pkgs.alejandra); + formatter = forEachSystem ({pkgs, ...}: pkgs.alejandra); - herculesCI = let + checks = let ciSystems = [ "x86_64-linux" "aarch64-linux" ]; - lib = self.lib {inherit (self) inputs;}; - inherit (lib.ci ciSystems) mkCompatiblePkgs; - in { - inherit ciSystems; - - onPush.default = { - outputs = { - packages = mkCompatiblePkgs self.packages; - }; - }; - }; + pkgs = (self.lib.ci ciSystems).mkCompatiblePkgs self.packages; + in + nixpkgs.lib.genAttrs ciSystems (sys: pkgs.${sys}); packages = forEachSystem ( - pkgs: let - p = packageSet pkgs; + {pkgs, ...}: let + inherit (builtins) attrNames filter listToAttrs map readDir substring; + inherit (nixpkgs.lib) removeSuffix; + + pkgNames = filter (p: substring 0 1 p != "_") (attrNames (readDir ./pkgs)); + pkgs' = map (removeSuffix ".nix") pkgNames; + + p = listToAttrs (map (name: { + inherit name; + value = pkgs.${name}; + }) + pkgs'); in p // {default = p.treefetch;} ); lib = import ./lib nixpkgs.lib; - overlays.default = final: prev: packageSet final // overrides prev; + overlays.default = import ./pkgs; templates = let # string -> string -> {} diff --git a/garnix.yaml b/garnix.yaml new file mode 100644 index 0000000..92f2c79 --- /dev/null +++ b/garnix.yaml @@ -0,0 +1,5 @@ +builds: + exclude: [] + include: + - "checks.x86_64-linux.*" + - "checks.aarch64-linux.*" diff --git a/lib/default.nix b/lib/default.nix index ccdb0bf..10ac688 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,4 +1,4 @@ -lib: {inputs, ...}: { +lib: { ci = import ./ci.nix lib; - configs = import ./configs.nix inputs; + configs = import ./configs.nix; } diff --git a/pkgs/theseus.nix b/pkgs/_theseus.nix index c458896..c458896 100644 --- a/pkgs/theseus.nix +++ b/pkgs/_theseus.nix diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..d245bec --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,18 @@ +final: prev: let + inherit (final) callPackage; +in { + # original packages + cartridges = callPackage ./cartridges.nix {}; + huion = callPackage ./huion.nix {}; + mommy = callPackage ./mommy.nix {}; + ## broken due to upstream adopting pnpm + ## theseus = callPackage ./theseus.nix {}; + treefetch = callPackage ./treefetch.nix {}; + swhkd = callPackage ./swhkd {}; + vim-just = callPackage ./vim-just.nix {}; + xwaylandvideobridge = callPackage ./xwaylandvideobridge.nix {}; + + # modified packages + discord = prev.discord.override {withOpenASAR = true;}; + discord-canary = prev.discord-canary.override {withOpenASAR = true;}; +} diff --git a/pkgs/discord-canary.nix b/pkgs/discord-canary.nix deleted file mode 100644 index 6cb9d27..0000000 --- a/pkgs/discord-canary.nix +++ /dev/null @@ -1 +0,0 @@ -prev: prev.discord-canary.override {withOpenASAR = true;} diff --git a/pkgs/discord.nix b/pkgs/discord.nix deleted file mode 100644 index 3cfa01d..0000000 --- a/pkgs/discord.nix +++ /dev/null @@ -1 +0,0 @@ -prev: prev.discord.override {withOpenASAR = true;} |
