Merge pull request #67 from DarkKirb/add-attic

Add attic
This commit is contained in:
Charlotte 🦝 Delenk 2023-01-16 11:00:37 +01:00 committed by GitHub
commit ec74ed28a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 156 additions and 2 deletions

View file

@ -55,6 +55,9 @@ jobs:
- python-instagram - python-instagram
- moa - moa
- nix-s3-dedup - nix-s3-dedup
- attic
- attic-client
- attic-server
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository

View file

@ -5,9 +5,15 @@
# Having pkgs default to <nixpkgs> is fine though, and it lets you use short # Having pkgs default to <nixpkgs> is fine though, and it lets you use short
# commands such as: # commands such as:
# nix-build -A mypackage # nix-build -A mypackage
{pkgs ? import <nixpkgs> {}}: { {pkgs ? import <nixpkgs> {}}: let
# The `lib`, `modules`, and `overlay` names are special
lib = import ./lib {inherit pkgs;}; # functions lib = import ./lib {inherit pkgs;}; # functions
attic = lib.importFlake {
input = "attic";
inherit (pkgs) system;
};
in {
# The `lib`, `modules`, and `overlay` names are special
inherit lib;
modules = import ./modules; # NixOS modules modules = import ./modules; # NixOS modules
overlays = import ./overlays; # nixpkgs overlays overlays = import ./overlays; # nixpkgs overlays
@ -58,4 +64,5 @@
python-instagram = pkgs.python3Packages.callPackage ./python/instagram.nix {}; python-instagram = pkgs.python3Packages.callPackage ./python/instagram.nix {};
moa = pkgs.python3Packages.callPackage ./moa {}; moa = pkgs.python3Packages.callPackage ./moa {};
nix-s3-dedup = pkgs.callPackage ./nix {}; nix-s3-dedup = pkgs.callPackage ./nix {};
inherit (attic.defaultNix.packages.${pkgs.system}) attic attic-client attic-server;
} }

View file

@ -1,5 +1,92 @@
{ {
"nodes": { "nodes": {
"attic": {
"inputs": {
"crane": "crane",
"flake-compat": "flake-compat",
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1673819363,
"narHash": "sha256-JQsPxaGHLCLtlxPzpf+b8XfA8vUwmIb9aJRsJQCht4Q=",
"owner": "zhaofengli",
"repo": "attic",
"rev": "70ae61b59114982a2685f67b35405f7ca0bf5b6f",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"repo": "attic",
"type": "github"
}
},
"crane": {
"inputs": {
"flake-compat": [
"attic",
"flake-compat"
],
"flake-utils": [
"attic",
"flake-utils"
],
"nixpkgs": [
"attic",
"nixpkgs"
],
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1672095661,
"narHash": "sha256-7NTsdCn3qsvU7A+1/7tY8pxbq0DYy1pFYNpzN6he9lI=",
"owner": "ipetkov",
"repo": "crane",
"rev": "98894bb39b03bfb379c5e10523cd61160e1ac782",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1667395993, "lastModified": 1667395993,
@ -32,9 +119,38 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"attic": "attic",
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
},
"rust-overlay": {
"inputs": {
"flake-utils": [
"attic",
"crane",
"flake-utils"
],
"nixpkgs": [
"attic",
"crane",
"nixpkgs"
]
},
"locked": {
"lastModified": 1670034122,
"narHash": "sha256-EqmuOKucPWtMvCZtHraHr3Q3bgVszq1x2PoZtQkUuEk=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "a0d5773275ecd4f141d792d3a0376277c0fc0b65",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -4,6 +4,15 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
attic = {
url = "github:zhaofengli/attic";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
}; };
outputs = { outputs = {

View file

@ -3,4 +3,5 @@
gradleDeps = pkgs.callPackage ./gradleDeps.nix {}; gradleDeps = pkgs.callPackage ./gradleDeps.nix {};
opensslLegacyProvider = pkgs.callPackage ./opensslLegacyProvider.nix {}; opensslLegacyProvider = pkgs.callPackage ./opensslLegacyProvider.nix {};
crushpng = pkgs.callPackage ./crushpng.nix {}; crushpng = pkgs.callPackage ./crushpng.nix {};
importFlake = import ./importFlake.nix;
} }

18
lib/importFlake.nix Normal file
View file

@ -0,0 +1,18 @@
{
input,
system,
}: let
lock = builtins.fromJSON (builtins.readFile ../flake.lock);
flake-compat = fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
};
input-src = fetchTarball {
url = "https://github.com/${lock.nodes.${input}.locked.owner}/${lock.nodes.${input}.locked.repo}/archive/${lock.nodes.${input}.locked.rev}.tar.gz";
sha256 = lock.nodes.${input}.locked.narHash;
};
in
(import flake-compat) {
src = input-src;
inherit system;
}