Skip to content

Commit

Permalink
Add cachix nix config
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeChannings committed Sep 17, 2024
1 parent c75040b commit f6bbdcf
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 15 deletions.
1 change: 0 additions & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"streetsidesoftware.code-spell-checker",
"eamodio.gitlens",
"tamasfe.even-better-toml",
"jnoortheen.nix-ide",
"1password.op-vscode",
"ibecker.treefmt-vscode",
"jnoortheen.nix-ide"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/binary-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
- name: Build dev shell
run: |
export NIXPKGS_ALLOW_UNFREE=1
nix develop --impure --accept-flake-config --build
nix develop --impure --accept-flake-config --accept-flake-config --build
7 changes: 4 additions & 3 deletions .github/workflows/template-darwin-system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- templates/darwin-system/*

jobs:
binary-cache:
template-test:
permissions:
contents: write
runs-on: macos-latest
Expand All @@ -20,5 +20,6 @@ jobs:
- name: Build packages
run: |
export NIXPKGS_ALLOW_UNFREE=1
nix flake new -t .#darwin-system darwin-system
nix run --flake ./darwin-system#activate
nix flake new --accept-flake-config -t .#darwin-system darwin-system
sudo rm -rf ~/.nix-defexpr
sudo nix run --accept-flake-config path:"$(pwd)/darwin-system"#activate --show-trace
7 changes: 3 additions & 4 deletions config/default-packages.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
pkgs,
lib,
config,
...
}:
let
Expand Down Expand Up @@ -39,7 +40,7 @@ let
;
};

allDefaultPackages = cliTools // (if pkgs.stdlib.isDarwin then macUtilities else { });
allDefaultPackages = cliTools // (if pkgs.stdenv.isDarwin then macUtilities else { });
in
{
options.dotfiles = {
Expand All @@ -53,8 +54,6 @@ in
};

config = {
home.packages = (
with builtins; attrValues (removeAttrs allDefaultPackages config.dotfiles.disabledDefaultPackages)
);
home.packages = attrValues (removeAttrs allDefaultPackages config.dotfiles.disabledDefaultPackages);
};
}
6 changes: 5 additions & 1 deletion config/wezterm/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
enable = true;

extraConfig = builtins.replaceStrings [ "@multiplexingName@" ] [
(lib.toLower ("${osConfig.networking.hostName or "wezterm"}_${config.home.username}"))
(lib.toLower (
"${
(if osConfig.networking.hostName != null then osConfig.networking.hostName else "wezterm")
}_${config.home.username}"
))
] (builtins.readFile ./config.lua);
};
}
23 changes: 20 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs-darwin.url = "github:NixOS/nixpkgs/nixpkgs-24.05-darwin";
flake-parts.url = "github:hercules-ci/flake-parts";
devenv-root = {
url = "file+file:///dev/null";
Expand Down
7 changes: 5 additions & 2 deletions templates/darwin-system/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ in
modules = [
(dotfiles.lib.configureOsModules {
osModules = attrValues dotfiles.modules.darwin;
homeModules = attrValues dotfiles.modules.homeModules;
homeModules = dotfiles.lib.homeModulesWithDisabled [ "default-apps" ];
})
(
let
username = "luke";
in
{ ... }:
{ lib, ... }:
{
# This can be removed for multi-user Nix installs
nix.gc.user = username;

users = {
knownUsers = [ username ];

Expand Down
7 changes: 7 additions & 0 deletions templates/darwin-system/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,11 @@
};
};
};

nixConfig = {
extra-substituters = [ "https://luke-channings.cachix.org" ];
extra-trusted-public-keys = [
"luke-channings.cachix.org-1:ETsZ3R5ue9QOwO4spg8aGJMwMU6k5tQIaHWnTakGHjo="
];
};
}
7 changes: 7 additions & 0 deletions templates/devenv/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,11 @@
"aarch64-linux"
];
};

nixConfig = {
extra-substituters = [ "https://luke-channings.cachix.org" ];
extra-trusted-public-keys = [
"luke-channings.cachix.org-1:ETsZ3R5ue9QOwO4spg8aGJMwMU6k5tQIaHWnTakGHjo="
];
};
}

0 comments on commit f6bbdcf

Please sign in to comment.