From 528f0366d4482798c087823e29b386408c450880 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Fri, 23 Feb 2024 13:42:07 -0600 Subject: [PATCH] Add Cachix. --- cachix.nix | 13 +++++ cachix/hsndev.nix | 13 +++++ flake.lock | 120 +++++++++++++++++++++++++++++++++++++++++++++- nixos/common.nix | 2 + 4 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 cachix.nix create mode 100644 cachix/hsndev.nix diff --git a/cachix.nix b/cachix.nix new file mode 100644 index 0000000..ecd2d39 --- /dev/null +++ b/cachix.nix @@ -0,0 +1,13 @@ + +# WARN: this file will get overwritten by $ cachix use +{ pkgs, lib, ... }: + +let + folder = ./cachix; + toImport = name: value: folder + ("/" + name); + filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key; + imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); +in { + inherit imports; + nix.settings.substituters = ["https://cache.nixos.org/"]; +} diff --git a/cachix/hsndev.nix b/cachix/hsndev.nix new file mode 100644 index 0000000..1d59976 --- /dev/null +++ b/cachix/hsndev.nix @@ -0,0 +1,13 @@ + +{ + nix = { + settings = { + substituters = [ + "https://hsndev.cachix.org" + ]; + trusted-public-keys = [ + "hsndev.cachix.org-1:vN1/XGBZtMLnTFYDmTLDrullgZHSUYY3Kqt+Yg/C+tE=" + ]; + }; + }; +} diff --git a/flake.lock b/flake.lock index be74e85..464432c 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,23 @@ { "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1698882062, + "narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8c9fa2545007b49a5db5f650ae91f227672c3877", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -21,6 +39,28 @@ "type": "github" } }, + "nix-fast-build": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1703607026, + "narHash": "sha256-Emh0BPoqlS4ntp2UJrwydXfIP4qIMF0VBB2FUE3/M/E=", + "owner": "Mic92", + "repo": "nix-fast-build", + "rev": "4376b8a33b217ee2f78ba3dcff01a3e464d13a46", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-fast-build", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1708294118, @@ -37,10 +77,88 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1698611440, + "narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1708210246, + "narHash": "sha256-Q8L9XwrBK53fbuuIFMbjKvoV7ixfLFKLw4yV+SD28Y8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "69405156cffbdf2be50153f13cbdf9a0bea38e49", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nix-fast-build": "nix-fast-build", + "nixpkgs": "nixpkgs", + "sops-nix": "sops-nix" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1708500294, + "narHash": "sha256-mvJIecY3tDKZh7297mqOtOuAvP7U1rqjfLNfmfkjFpU=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "f6b80ab6cd25e57f297fe466ad689d8a77057c11", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nix-fast-build", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1698438538, + "narHash": "sha256-AWxaKTDL3MtxaVTVU5lYBvSnlspOS0Fjt8GxBgnU0Do=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "5deb8dc125a9f83b65ca86cf0c8167c46593e0b1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" } } }, diff --git a/nixos/common.nix b/nixos/common.nix index 2f748c9..15ef018 100644 --- a/nixos/common.nix +++ b/nixos/common.nix @@ -1,6 +1,7 @@ { config, lib, pkgs, ... }: { + imports = [ ../cachix.nix ]; # Bootloader. boot = { loader = { @@ -20,6 +21,7 @@ }; nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.trusted-users = [ "root" "jahanson" ]; # Enable fish programs.fish.enable = true;