modules/community-builder: add nixpkgs clone
Co-authored-by: nicoo <nicoo@mur.at>
This commit is contained in:
parent
4f3703fdc9
commit
edeaf0e3a5
3 changed files with 40 additions and 1 deletions
modules
|
@ -1,4 +1,9 @@
|
|||
{ inputs, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
"${inputs.self}/modules/shared/community-builder.nix"
|
||||
|
@ -9,4 +14,24 @@
|
|||
environment.systemPackages = [
|
||||
pkgs.vim
|
||||
];
|
||||
|
||||
launchd.daemons.nixpkgs-clone = {
|
||||
environment = {
|
||||
inherit (config.environment.variables) NIX_SSL_CERT_FILE;
|
||||
};
|
||||
serviceConfig = {
|
||||
StartCalendarInterval = [
|
||||
{
|
||||
Hour = 0;
|
||||
Minute = 0;
|
||||
}
|
||||
];
|
||||
StandardErrorPath = "/var/log/nixpkgs-clone.log";
|
||||
StandardOutPath = "/var/log/nixpkgs-clone.log";
|
||||
};
|
||||
path = [
|
||||
pkgs.git
|
||||
];
|
||||
script = builtins.readFile "${inputs.self}/modules/shared/nixpkgs-clone.bash";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -22,4 +22,13 @@
|
|||
programs.fish.enable = true;
|
||||
# disable generated completion
|
||||
environment.etc."fish/generated_completions".text = pkgs.lib.mkForce "";
|
||||
|
||||
systemd.services.nixpkgs-clone = {
|
||||
serviceConfig.Type = "oneshot";
|
||||
startAt = "daily";
|
||||
path = [
|
||||
pkgs.git
|
||||
];
|
||||
script = builtins.readFile "${inputs.self}/modules/shared/nixpkgs-clone.bash";
|
||||
};
|
||||
}
|
||||
|
|
5
modules/shared/nixpkgs-clone.bash
Normal file
5
modules/shared/nixpkgs-clone.bash
Normal file
|
@ -0,0 +1,5 @@
|
|||
CLONE_DIR="/var/lib/nixpkgs.git"
|
||||
if [ ! -d "$CLONE_DIR" ]; then
|
||||
git clone --bare https://github.com/NixOS/nixpkgs.git "$CLONE_DIR"
|
||||
fi
|
||||
git -C "$CLONE_DIR" -c remote.origin.fetch="+refs/heads/*:refs/remotes/origin/*" -c fetch.prune=true fetch
|
Loading…
Add table
Reference in a new issue