Skip to content

Commit

Permalink
feat: add VMWare and WSL fixtures
Browse files Browse the repository at this point in the history
remi-gelinas committed Oct 20, 2024
1 parent 8438ed5 commit 14f5725
Showing 19 changed files with 380 additions and 141 deletions.
130 changes: 108 additions & 22 deletions flake.lock

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

3 changes: 1 addition & 2 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -11,8 +11,6 @@
parts = import ./parts;
in
{
debug = true;

imports = [ (import "${flake-parts}/all-modules.nix") ] ++ builtins.attrValues parts;

systems = [
@@ -69,6 +67,7 @@
nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
stylix.url = "github:danth/stylix";
zls.url = "github:zigtools/zls/0.13.0";
nixos-wsl.url = "github:nix-community/NixOS-WSL";

#--------------------------------------------------------
# Homebrew dependencies for Darwin
45 changes: 45 additions & 0 deletions modules/by-name/ca/caches/common-module.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.caches;
in
{
config.caches =
let
cacheConfig = importJSON ./caches.json;

cachixCaches = map (
{ name, publicKey }:
{
name = "https://${name}.cachix.org";
inherit publicKey;
}
) cacheConfig.cachix;
in
mkDefault (cachixCaches ++ cacheConfig.nix);

options.caches =
with types;
mkOption {
type = listOf (submodule {
options = {
name = mkOption { type = str; };
publicKey = mkOption { type = str; };
};
});
};

config = {
environment.systemPackages = [ pkgs.cachix ];

nix.settings = {
trusted-substituters = map ({ name, ... }: name) cfg;
trusted-public-keys = map ({ publicKey, ... }: publicKey) cfg;
};
};
}
44 changes: 1 addition & 43 deletions modules/by-name/ca/caches/darwin-module.nix
Original file line number Diff line number Diff line change
@@ -1,43 +1 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.caches;
in
{
config.caches =
let
cacheConfig = importJSON ./caches.json;

cachixCaches = map (
{ name, publicKey }:
{
name = "https://${name}.cachix.org";
inherit publicKey;
}
) cacheConfig.cachix;
in
mkDefault (cachixCaches ++ cacheConfig.nix);

options.caches =
with types;
mkOption {
type = listOf (submodule {
options = {
name = mkOption { type = str; };
publicKey = mkOption { type = str; };
};
});
};

config.nix.settings = {
trusted-substituters = map ({ name, ... }: name) cfg;
trusted-public-keys = map ({ publicKey, ... }: publicKey) cfg;
};

config.environment.systemPackages = [ pkgs.cachix ];
}
{ imports = [ ./common-module.nix ]; }
1 change: 1 addition & 0 deletions modules/by-name/ca/caches/nixos-module.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ imports = [ ./common-module.nix ]; }
29 changes: 29 additions & 0 deletions modules/by-name/ni/nix/common-module.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{ config, lib, ... }:
{
nix = {
# Add inputs to path for channel compatibility
nixPath = lib.mapAttrsToList (flake: _: "${flake}=flake:${flake}") config.nix.registry;

settings = {
trusted-users = [ "@admin" ];

experimental-features = [
"nix-command"
"flakes"
"auto-allocate-uids"
];

sandbox = false;
cores = 0;
max-jobs = "auto";
auto-allocate-uids = true;
keep-outputs = true;
keep-derivations = true;
};

gc = {
automatic = true;
options = "--delete-older-than 30d";
};
};
}
Loading

0 comments on commit 14f5725

Please sign in to comment.